TijsVerkoyen\Dropbox\Dropbox::restore PHP Метод

restore() публичный Метод

Unlike downloading a file at a given revision and then re-uploading it, this call is atomic. It also saves a bunch of bandwidth.
public restore ( string $path, string $rev, string[optional] $locale = null, bool[optional] $sandbox = false ) : array
$path string The path to the file.
$rev string The revision of the file to restore.
$locale string[optional]
$sandbox bool[optional]
Результат array
    public function restore($path, $rev, $locale = null, $sandbox = false)
    {
        // build url
        $url = '1/restore/';
        $url .= $sandbox ? 'sandbox/' : 'dropbox/';
        $url .= trim((string) $path, '/');
        // build parameters
        $parameters['rev'] = (string) $rev;
        if ($locale !== null) {
            $parameters['locale'] = (string) $locale;
        }
        // make the call
        return (array) $this->doCall($url, $parameters);
    }

Usage Example

Пример #1
0
 /**
  * Tests Dropbox->restore()
  */
 public function testRestore()
 {
     $response = $this->dropbox->restore(BASE_PATH . 'hàh@, $.txt', '368c7df600088e34');
     $this->isFile($response);
 }