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

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

Only revisions up to thirty days old are available (or more if the Dropbox user has Pack-Rat). You can use the revision number in conjunction with the /restore call to revert the file to its previous state.
public revisions ( string $path, int[optional] $revLimit = 10, string[optional] $locale = null, bool[optional] $sandbox = false ) : array
$path string The path to the file.
$revLimit int[optional]
$locale string[optional]
$sandbox bool[optional]
Результат array
    public function revisions($path, $revLimit = 10, $locale = null, $sandbox = false)
    {
        // build url
        $url = '1/revisions/';
        $url .= $sandbox ? 'sandbox/' : 'dropbox/';
        $url .= trim((string) $path, '/');
        // build parameters
        $parameters = null;
        if ($revLimit !== null) {
            $parameters['rev_limit'] = (int) $revLimit;
        }
        if ($locale !== null) {
            $parameters['locale'] = (string) $locale;
        }
        // make the call
        return (array) $this->doCall($url, $parameters);
    }

Usage Example

Пример #1
0
 /**
  * Tests Dropbox->revisions()
  */
 public function testRevisions()
 {
     $response = $this->dropbox->revisions(BASE_PATH . 'hàh@, $.txt');
     $this->assertInternalType('array', $response);
     foreach ($response as $row) {
         $this->isFile($row);
     }
 }