PHP Класс Dropbox_API, dropbox-php

Автор: Ben Tadiar ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$chunkSize unknown Chunked file size limit

Защищенные свойства (Protected)

Свойство Тип Описание
$api_content_url Content API URl
$api_url API URl
$oauth Dropbox_OAuth OAuth object
$root string Default root-path, this will most likely be 'sandbox' or 'dropbox'
$useSSL

Открытые методы

Метод Описание
__construct ( Dropbox_OAuth $oauth, string $root = self::ROOT_DROPBOX, $useSSL = true ) Constructor
chunkedUpload ( string $path, $handle, $root = null, boolean $overwrite = true, $offset, $uploadID = null ) : stdClass Uploads large files to Dropbox in mulitple chunks
copy ( string $from, string $to, string $root = null ) : stdclass Copies a file or directory from one location to another
copy_ref ( type $path, type $root = null ) : type 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 from_copy_ref parameter on /fileops/copy.
createFolder ( string $path, string $root = null ) : stdclass Creates a new folder
delete ( string $path, string $root = null ) : array Deletes a file or folder.
delta ( string $cursor ) : stdclass A way of letting you keep up with changes to files and folders in a user's Dropbox. You can periodically call /delta to get a list of "delta entries", which are instructions on how to update your local state to match the server's state.
getAccountInfo ( ) : stdclass Returns information about the current dropbox account
getFile ( string $path = '', string $root = null ) : string Returns a file's contents
getMetaData ( string $path, boolean $list = true, string $hash = null, integer $fileLimit = null, string $root = null ) : array | true Returns file and directory information
getThumbnail ( string $path, string $size = 'small', string $root = null ) : string Returns a thumbnail (as a string) for a file path.
media ( type $path, type $root = null ) : type Returns a link directly to a file.
move ( mixed $from, mixed $to, string $root = null ) : stdclass Moves a file or directory to a new location
putFile ( string $path, string $file, string $root = null ) : boolean Uploads a new file
putStream ( $path, $file, $root = null, boolean $overwrite = true ) : array Uploads file data from a stream
search ( string $query = '', string $root = null, string $path = '' ) : array Search
share ( string $path, string $root = null, string $short_url = true ) : array Creates and returns a shareable link to files or folders.

Защищенные методы

Метод Описание
multipartFetch ( string $uri, $file, $filename ) : boolean This method is used to generate multipart POST requests for file upload

Описание методов

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

Constructor
public __construct ( Dropbox_OAuth $oauth, string $root = self::ROOT_DROPBOX, $useSSL = true )
$oauth Dropbox_OAuth
$root string default root path (sandbox or dropbox)

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

Uploads large files to Dropbox in mulitple chunks
public chunkedUpload ( string $path, $handle, $root = null, boolean $overwrite = true, $offset, $uploadID = null ) : stdClass
$path string Path to upload the file to, relative to root
$overwrite boolean Should the file be overwritten? (Default: true)
Результат stdClass

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

This method returns the file information of the newly created file.
public copy ( string $from, string $to, string $root = null ) : stdclass
$from string source path
$to string destination path
$root string Use this to override the default root path (sandbox/dropbox)
Результат stdclass

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

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 from_copy_ref parameter on /fileops/copy.
public copy_ref ( type $path, type $root = null ) : type
$path type
$root type
Результат type

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

This method returns the information from the newly created directory
public createFolder ( string $path, string $root = null ) : stdclass
$path string
$root string Use this to override the default root path (sandbox/dropbox)
Результат stdclass

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

This method will return the metadata information from the deleted file or folder, if successful.
public delete ( string $path, string $root = null ) : array
$path string Path to new folder
$root string Use this to override the default root path (sandbox/dropbox)
Результат array

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

This method returns the information from the newly created directory
public delta ( string $cursor ) : stdclass
$cursor string A string that is used to keep track of your current state. On the next call pass in this value to return delta entries that have been recorded since the cursor was returned.
Результат stdclass

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

Returns information about the current dropbox account
public getAccountInfo ( ) : stdclass
Результат stdclass

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

Returns a file's contents
public getFile ( string $path = '', string $root = null ) : string
$path string path
$root string Use this to override the default root path (sandbox/dropbox)
Результат string

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

Returns file and directory information
public getMetaData ( string $path, boolean $list = true, string $hash = null, integer $fileLimit = null, string $root = null ) : array | true
$path string Path to receive information from
$list boolean When set to true, this method returns information from all files in a directory. When set to false it will only return infromation from the specified directory.
$hash string If a hash is supplied, this method simply returns true if nothing has changed since the last request. Good for caching.
$fileLimit integer Maximum number of file-information to receive
$root string Use this to override the default root path (sandbox/dropbox)
Результат array | true

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

Returns a thumbnail (as a string) for a file path.
public getThumbnail ( string $path, string $size = 'small', string $root = null ) : string
$path string Path to file
$size string small, medium or large
$root string Use this to override the default root path (sandbox/dropbox)
Результат string

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

Similar to /shares. The difference is that this bypasses the Dropbox webserver, used to provide a preview of the file, so that you can effectively stream the contents of your media. Note: The /media link expires after four hours, allotting enough time to stream files, but not enough to leave a connection open indefinitely.
public media ( type $path, type $root = null ) : type
$path type
$root type
Результат type

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

This method returns the information from the newly created directory
public move ( mixed $from, mixed $to, string $root = null ) : stdclass
$from mixed Source path
$to mixed destination path
$root string Use this to override the default root path (sandbox/dropbox)
Результат stdclass

multipartFetch() защищенный Метод

This method is used to generate multipart POST requests for file upload
protected multipartFetch ( string $uri, $file, $filename ) : boolean
$uri string
Результат boolean

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

Uploads a new file
public putFile ( string $path, string $file, string $root = null ) : boolean
$path string Target path (including filename)
$file string Either a path to a file or a stream resource
$root string Use this to override the default root path (sandbox/dropbox)
Результат boolean

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

Note: This function is experimental and requires further testing
public putStream ( $path, $file, $root = null, boolean $overwrite = true ) : array
$overwrite boolean Should the file be overwritten? (Default: true)
Результат array

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

Note: Links created by the /shares API call expire after thirty days.
public share ( string $path, string $root = null, string $short_url = true ) : array
$path string
$root string Use this to override the default root path (sandbox/dropbox)
$short_url string When true (default), the URL returned will be shortened using the Dropbox URL shortener
Результат array

Описание свойств

$api_content_url защищенное свойство

Content API URl
protected $api_content_url

$api_url защищенное свойство

API URl
protected $api_url

$chunkSize публичное свойство

Chunked file size limit
public unknown $chunkSize
Результат unknown

$oauth защищенное свойство

OAuth object
protected Dropbox_OAuth $oauth
Результат Dropbox_OAuth

$root защищенное свойство

Default root-path, this will most likely be 'sandbox' or 'dropbox'
protected string $root
Результат string

$useSSL защищенное свойство

protected $useSSL