PHP 클래스 Dropbox_API, dropbox-php

파일 보기 프로젝트 열기: dropbox-php/dropbox-php 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$chunkSize unknown Chunked file size limit

보호된 프로퍼티들

프로퍼티 타입 설명
$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