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

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

Creates and returns a copy_ref to a file. This reference string can be used to copy that file to another user's Dropbox by passing it in as the fromCopyRef parameter on fileopsCopy.
public copyRef ( string $path, bool[optional] $sandbox = false ) : array
$path string The path to the file.
$sandbox bool[optional]
Результат array
    public function copyRef($path, $sandbox = false)
    {
        // build url
        $url = '1/copy_ref/';
        $url .= $sandbox ? 'sandbox/' : 'dropbox/';
        $url .= trim((string) $path, '/');
        // make the call
        return (array) $this->doCall($url);
    }

Usage Example

Пример #1
0
 /**
  * Tests Dropbox->copyRef()
  */
 public function testCopyRef()
 {
     $response = $this->dropbox->copyRef(BASE_PATH . 'hàh@, $.txt');
     $this->assertArrayHasKey('copy_ref', $response);
     $this->assertArrayHasKey('expires', $response);
 }