Methods summary
public
|
#
__construct( )
Constructor
Extend options with required fields.
Constructor
Extend options with required fields.
Author
Dmitry (dio) Levashov
Cem (DiscoFever)
|
protected
object|string
|
#
_od_obtainAccessToken( $client_id, $client_secret, string $code, $nodeid )
Obtains a new access token from OAuth. This token is valid for one hour.
Obtains a new access token from OAuth. This token is valid for one hour.
Parameters
- $client_id
- $client_secret
- $code
The code returned by OneDrive after
successful log in
- $nodeid
Returns
object|string
Throws
Exception Thrown if the redirect URI of this Client instance's
state is not set
|
protected
true
|
#
_od_refreshToken( )
Get token and auto refresh.
Get token and auto refresh.
Returns
true
Throws
Exception
|
protected
array
|
#
_od_splitPath( string $path )
Get Parent ID, Item ID, Parent Path as an array from path.
Get Parent ID, Item ID, Parent Path as an array from path.
Parameters
Returns
array
|
protected
resource
|
#
_od_prepareCurl( $url = null )
Creates a base cURL object which is compatible with the OneDrive API.
Creates a base cURL object which is compatible with the OneDrive API.
Returns
resource A compatible cURL object
|
protected
resource
|
#
_od_createCurl( string $path, boolean $contents = false )
Creates a base cURL object which is compatible with the OneDrive API.
Creates a base cURL object which is compatible with the OneDrive API.
Parameters
- $path
- The path of the API call (eg. me/skydrive)
- $contents
Returns
resource A compatible cURL object
Throws
|
protected
object|array
|
#
_od_query( $itemId, boolean $fetch_self = false, boolean $recursive = false, array $options = array() )
Drive query and fetchAll.
Drive query and fetchAll.
Parameters
- $itemId
- $fetch_self
- $recursive
- $options
Returns
object|array
Throws
|
protected
array
|
#
_od_parseRaw( object $raw )
Parse line from onedrive metadata output and return file stat (array).
Parse line from onedrive metadata output and return file stat (array).
Parameters
- $raw
- line from ftp_rawlist() output
Returns
array
Author
Dmitry Levashov
|
protected
array|object
|
#
_od_getFileRaw( string $path )
Get raw data(onedrive metadata) from OneDrive.
Get raw data(onedrive metadata) from OneDrive.
Parameters
Returns
array|object onedrive metadata
|
protected
string
|
#
_od_getThumbnail( string $path )
Get thumbnail from OneDrive.com.
Get thumbnail from OneDrive.com.
Parameters
Returns
string | boolean
|
protected
string
|
#
_od_uploadSession( resource $fp, number $size, string $name, string $itemId, string $parent, string $parentId )
Upload large files with an upload session.
Upload large files with an upload session.
Parameters
- $fp
- source file pointer
- $size
- total size
- $name
- item name
- $itemId
- item identifier
- $parent
- parent
- $parentId
- parent identifier
Returns
string The item path
|
protected
boolean|string
|
#
_od_getChunkData( resource $fp )
Get chunk data by file pointer to upload session.
Get chunk data by file pointer to upload session.
Parameters
Returns
boolean|string chunked data
|
protected
string
|
#
_od_getATokenFile( )
Get AccessToken file path
Get AccessToken file path
Returns
string ( description_of_the_return_value )
|
protected
string
|
|
public
array
|
#
netmountPrepare( $options )
Prepare
Call from elFinder::netmout() before volume->mount().
Prepare
Call from elFinder::netmout() before volume->mount().
Returns
array
Author
Naoki Sawada
Raja Sharma updating for OneDrive
|
public
boolean
|
#
netunmount( array $netVolumes, $key )
process of on netunmount
Drop onedrive & rm thumbs.
process of on netunmount
Drop onedrive & rm thumbs.
Parameters
- $netVolumes
- $options
- $key
Returns
boolean
|
public
array
|
#
debug( )
Return debug info for client.
Return debug info for client.
Returns
array
Overrides
|
protected
boolean
|
#
init( )
Prepare FTP connection
Connect to remote server and check if credentials are correct, if so, store the connection id in $ftp_conn.
Prepare FTP connection
Connect to remote server and check if credentials are correct, if so, store the connection id in $ftp_conn.
Returns
boolean
Throws
Author
Dmitry (dio) Levashov
Cem (DiscoFever)
Overrides
|
protected
|
#
configure( )
Configure after successfull mount.
Configure after successfull mount.
Throws
Author
Dmitry (dio) Levashov
Overrides
|
public
|
#
umount( )
Close opened connection.
Author
Dmitry (dio) Levashov
Overrides
|
protected
array
|
#
isNameExists( string $path )
Return fileinfo based on filename
For item ID based path file system
Please override if needed on each drivers
Return fileinfo based on filename
For item ID based path file system
Please override if needed on each drivers
Parameters
Returns
array
Overrides
|
protected
array
|
#
cacheDir( string $path )
Cache dir contents.
Parameters
Returns
array
Throws
Author
Dmitry Levashov
Overrides
|
protected
string|false
|
#
copy( string $src, string $dst, string $name )
Copy file/recursive copy dir only in current volume.
Return new file path or false.
Copy file/recursive copy dir only in current volume.
Return new file path or false.
Parameters
- $src
- source path
- $dst
- destination dir path
- $name
- new file name (optionaly)
Returns
string|false
Throws
Author
Dmitry (dio) Levashov
Naoki Sawada
Overrides
|
protected
boolean
|
#
remove( string $path, boolean $force = false )
Remove file/ recursive remove dir.
Remove file/ recursive remove dir.
Parameters
- $path
- file path
- $force
- try to remove even if file locked
Returns
boolean
Throws
Author
Dmitry (dio) Levashov
Naoki Sawada
Overrides
|
protected
string|false
|
#
createTmb( string $path, $stat )
Create thumnbnail and return it's URL on success.
Create thumnbnail and return it's URL on success.
Parameters
Returns
string|false
Throws
Author
Dmitry (dio) Levashov
Naoki Sawada
Overrides
|
protected
string
|
#
tmbname( array $stat )
Return thumbnail file name for required file.
Return thumbnail file name for required file.
Parameters
Returns
string
Author
Dmitry (dio) Levashov
Overrides
|
public
string
|
#
getContentUrl( string $hash, array $options = array() )
Return content URL.
Parameters
- $hash
- file hash
- $options
- options
Returns
string
Author
Naoki Sawada
Overrides
|
protected
string
|
#
_dirname( string $path )
Return parent directory path.
Return parent directory path.
Parameters
Returns
string
Author
Dmitry (dio) Levashov
|
protected
string
|
#
_basename( string $path )
Return file name.
Parameters
Returns
string
Author
Dmitry (dio) Levashov
|
protected
string
|
#
_joinPath( string $dir, string $name )
Join dir name and file name and retur full path.
Join dir name and file name and retur full path.
Parameters
Returns
string
Author
Dmitry (dio) Levashov
|
protected
string
|
#
_normpath( string $path )
Return normalized path, this works the same as os.path.normpath() in Python.
Return normalized path, this works the same as os.path.normpath() in Python.
Parameters
Returns
string
Author
Troex Nevelin
|
protected
string
|
#
_relpath( string $path )
Return file path related to root dir.
Return file path related to root dir.
Parameters
Returns
string
Author
Dmitry (dio) Levashov
|
protected
string
|
#
_abspath( string $path )
Convert path related to root dir into real path.
Convert path related to root dir into real path.
Parameters
Returns
string
Author
Dmitry (dio) Levashov
|
protected
string
|
#
_path( string $path )
Return fake path started from root dir.
Return fake path started from root dir.
Parameters
Returns
string
Author
Dmitry (dio) Levashov
|
protected
boolean
|
#
_inpath( string $path, string $parent )
Return true if $path is children of $parent.
Return true if $path is children of $parent.
Parameters
- $path
- path to check
- $parent
- parent path
Returns
boolean
Author
Dmitry (dio) Levashov
|
protected
array|false
|
#
_stat( string $path )
Return stat for given path.
Stat contains following fields:
- (int) size file size in b. required
- (int) ts file modification time in unix time. required
- (string) mime mimetype. required for folders, others - optionally
- (bool) read read permissions. required
- (bool) write write permissions. required
- (bool) locked is object locked. optionally
- (bool) hidden is object hidden. optionally
- (string) alias for symlinks - link target path relative to root path. optionally
- (string) target for symlinks - link target path. optionally.
If file does not exists - returns empty array or false.
Return stat for given path.
Stat contains following fields:
- (int) size file size in b. required
- (int) ts file modification time in unix time. required
- (string) mime mimetype. required for folders, others - optionally
- (bool) read read permissions. required
- (bool) write write permissions. required
- (bool) locked is object locked. optionally
- (bool) hidden is object hidden. optionally
- (string) alias for symlinks - link target path relative to root path. optionally
- (string) target for symlinks - link target path. optionally.
If file does not exists - returns empty array or false.
Parameters
Returns
array|false
Author
Dmitry (dio) Levashov
|
protected
boolean
|
#
_subdirs( string $path )
Return true if path is dir and has at least one childs directory.
Return true if path is dir and has at least one childs directory.
Parameters
Returns
boolean
Throws
Author
Dmitry (dio) Levashov
|
protected
string
|
#
_dimensions( string $path, string $mime )
Return object width and height
Ususaly used for images, but can be realize for video etc...
Return object width and height
Ususaly used for images, but can be realize for video etc...
Parameters
- $path
- file path
- $mime
- file mime type
Returns
string
Throws
Author
Dmitry (dio) Levashov
|
protected
array
|
#
_scandir( string $path )
Return files list in directory.
Return files list in directory.
Parameters
Returns
array
Throws
Author
Dmitry (dio) Levashov
Cem (DiscoFever)
|
protected
resource|false
|
#
_fopen( string $path, boolean $mode = 'rb' )
Open file and return file pointer.
Open file and return file pointer.
Parameters
- $path
- file path
- $mode
- $write open file for writing
Returns
resource|false
Author
Dmitry (dio) Levashov
|
protected
boolean
|
#
_fclose( resource $fp, string $path = '' )
Close opened file.
Parameters
- $fp
- file pointer
- $path
- file path
Returns
boolean
Author
Dmitry (dio) Levashov
|
protected
string|boolean
|
#
_mkdir( string $path, string $name )
Create dir and return created dir path or false on failed.
Create dir and return created dir path or false on failed.
Parameters
- $path
- parent dir path
- $name
- new directory name
Returns
string|boolean
Author
Dmitry (dio) Levashov
|
protected
string|boolean
|
#
_mkfile( string $path, string $name )
Create file and return it's path or false on failed.
Create file and return it's path or false on failed.
Parameters
- $path
- parent dir path
- $name
- new file name
Returns
string|boolean
Author
Dmitry (dio) Levashov
|
protected
boolean
|
#
_symlink( string $target, string $path, string $name )
Create symlink. FTP driver does not support symlinks.
Create symlink. FTP driver does not support symlinks.
Parameters
- $target
- link target
- $path
- symlink path
- $name
- symlink name
Returns
boolean
Author
Dmitry (dio) Levashov
|
protected
boolean
|
#
_copy( string $source, string $targetDir, string $name )
Copy file into another file.
Copy file into another file.
Parameters
- $source
- source file path
- $targetDir
- target directory path
- $name
- new file name
Returns
boolean
Author
Dmitry (dio) Levashov
|
protected
string|boolean
|
#
_move( string $source, $targetDir, string $name )
Move file into another parent dir.
Return new file path or false.
Move file into another parent dir.
Return new file path or false.
Parameters
- $source
- source file path
- $targetDir
- $name
- file name
Returns
string|boolean
Author
Dmitry (dio) Levashov
|
protected
boolean
|
#
_unlink( string $path )
Remove file.
Parameters
Returns
boolean
Author
Dmitry (dio) Levashov
|
protected
boolean
|
#
_rmdir( string $path )
Remove dir.
Parameters
Returns
boolean
Author
Dmitry (dio) Levashov
|
protected
boolean|string
|
#
_save( resource $fp, $path, string $name, array $stat )
Create new file and write into it from file pointer.
Return new file path or false on error.
Create new file and write into it from file pointer.
Return new file path or false on error.
Parameters
- $fp
- file pointer
- $path
- $name
- file name
- $stat
- file stat (required by some virtual fs)
Returns
boolean|string
Author
Dmitry (dio) Levashov
|
protected
string|false
|
#
_getContents( string $path )
Get file contents.
Parameters
Returns
string|false
Author
Dmitry (dio) Levashov
|
protected
boolean
|
#
_filePutContents( string $path, string $content )
Write a string to a file.
Write a string to a file.
Parameters
- $path
- file path
- $content
- new file content
Returns
boolean
Author
Dmitry (dio) Levashov
|
protected
|
|
protected
boolean
|
#
_chmod( string $path, string $mode )
chmod implementation.
Parameters
- $path
- file path
- $mode
- octal string such as '0755'
Returns
boolean
|
protected
|
#
_unpack( string $path, array $arc )
Unpack archive.
Parameters
- $path
- archive path
- $arc
- archiver command and arguments (same as in $this->archivers)
Author
Dmitry (dio) Levashov
Alexey Sukhotin
|
protected
string|boolean
|
#
_archive( string $dir, array $files, string $name, array $arc )
Create archive and return its path.
Create archive and return its path.
Parameters
- $dir
- target dir
- $files
- files names list
- $name
- archive name
- $arc
- archiver options
Returns
string|boolean
Author
Dmitry (dio) Levashov,
Alexey Sukhotin
|