PHP 클래스 elFinderVolumeGoogleDrive

저자: Dmitry (dio) Levashov
저자: Cem (discofever)
상속: extends elFinderVolumeDriver
파일 보기 프로젝트 열기: studio-42/elfinder

공개 프로퍼티들

프로퍼티 타입 설명
$netMountKey string Net mount key.

보호된 프로퍼티들

프로퍼티 타입 설명
$client object Google API client object.
$directories array Cache of chiled directories of each directories.
$driverId string Driver id Must be started from letter and contains [a-z0-9] Used as part of volume id.
$names array Cache of itemID => name of each items.
$parents array Cache of parents of each directories.
$service object GoogleDrive service object.
$tmp string Directory for tmp files If not set driver will try to use tmbDir as tmpDir.

공개 메소드들

메소드 설명
__construct ( ) Constructor Extend options with required fields.
debug ( ) : array Return debug info for client.
getContentUrl ( string $hash, array $options = [] ) : boolean | string Return content URL (for netmout volume driver) If file.url == 1 requests from JavaScript client with XHR.
netmountPrepare ( $options ) : array Prepare Call from elFinder::netmout() before volume->mount().
netunmount ( $netVolumes, $key ) : boolean process of on netunmount Drop googledrive & rm thumbs.
umount ( ) Close opened connection.

보호된 메소드들

메소드 설명
_abspath ( string $path ) : string Convert path related to root dir into real path.
_archive ( string $dir, array $files, string $name, array $arc ) : string | boolean Create archive and return its path.
_basename ( string $path ) : string Return file name.
_checkArchivers ( ) Detect available archivers.
_chmod ( $path, $mode ) : boolean chmod implementation.
_copy ( string $source, string $targetDir, string $name ) : boolean Copy file into another file.
_dimensions ( string $path, string $mime ) : string Return object width and height Ususaly used for images, but can be realize for video etc.
_dirname ( string $path ) : string Return parent directory path.
_extract ( string $path, array $arc ) : true Extract files from archive.
_fclose ( resource $fp, $path = '' ) : boolean Close opened file.
_filePutContents ( string $path, string $content ) : boolean Write a string to a file.
_findSymlinks ( string $path ) : boolean Recursive symlinks search.
_fopen ( string $path, $mode = 'rb' ) : resource | false Open file and return file pointer.
_gd_getDirectories ( string $itemId ) : array Get descendants directories.
_gd_getDirectoryData ( string $usecache = true ) Make cache of $parents, $names and $directories.
_gd_getDownloadUrl ( Google_Service_Drive_DriveFile $file ) : string | false Get download url.
_gd_getLink ( object $file ) : string return item URL link.
_gd_getMountPaths ( $id ) Get ID based path from item ID.
_gd_getThumbnail ( string $path ) : string | boolean Get thumbnail from GoogleDrive.com.
_gd_isPublished ( object $file ) : boolean Return is published.
_gd_parseRaw ( string $raw ) : array Parse line from googledrive metadata output and return file stat (array).
_gd_publish ( string $path ) : boolean Publish permissions specified path item.
_gd_readFileChunk ( resource $handle, integer $chunkSize ) : string Read file chunk.
_gd_splitPath ( string $path ) : array Get Parent ID, Item ID, Parent Path as an array from path.
_gd_unPublish ( string $path ) : boolean unPublish permissions specified path.
_getContents ( string $path ) : string | false Get file contents.
_inpath ( string $path, string $parent ) : boolean Return true if $path is children of $parent.
_joinPath ( string $dir, string $name ) : string Join dir name and file name and retur full path.
_mkdir ( string $path, string $name ) : string | boolean Create dir and return created dir path or false on failed.
_mkfile ( string $path, string $name ) : string | boolean Create file and return it's path or false on failed.
_move ( string $source, $targetDir, string $name ) : string | boolean Move file into another parent dir.
_normpath ( string $path ) : string Return normalized path, this works the same as os.path.normpath() in Python.
_path ( string $path ) : string Return fake path started from root dir.
_relpath ( string $path ) : string Return file path related to root dir.
_rmdir ( string $path ) : boolean Remove dir.
_save ( resource $fp, $path, string $name, array $stat ) : boolean | string Create new file and write into it from file pointer.
_scandir ( string $path ) : array Return files list in directory.
_stat ( string $path ) : array | false Return stat for given path.
_subdirs ( string $path ) : boolean Return true if path is dir and has at least one childs directory.
_symlink ( string $target, string $path, $name ) : boolean Create symlink. FTP driver does not support symlinks.
_unlink ( string $path ) : boolean Remove file.
_unpack ( string $path, array $arc ) : true Unpack archive.
cacheDir ( string $path ) Cache dir contents.
configure ( ) Configure after successfull mount.
copy ( string $src, string $dst, string $name ) : string | false Copy file/recursive copy dir only in current volume.
createTmb ( string $path, $stat ) : string | false Create thumnbnail and return it's URL on success.
doSearch ( string $path, string $q, array $mimes ) : array Recursive files search.
init ( ) : boolean Prepare FTP connection Connect to remote server and check if credentials are correct, if so, store the connection id in $ftp_conn.
isNameExists ( string $path ) : array Return fileinfo based on filename For item ID based path file system Please override if needed on each drivers.
remove ( string $path, boolean $force = false, $recursive = false ) : boolean Remove file/ recursive remove dir.
tmbname ( array $stat ) : string Return thumbnail file name for required file.

비공개 메소드들

메소드 설명
_gd_getFile ( string $path, $fields = '' ) : array Get dat(googledrive metadata) from GoogleDrive.
_gd_getNameByPath ( string $path ) : array Get dat(googledrive metadata) from GoogleDrive.
_gd_query ( $opts ) : boolean | array Drive query and fetchAll.

메소드 상세

__construct() 공개 메소드

Constructor Extend options with required fields.
저자: Dmitry (dio) Levashov
저자: Cem (DiscoFever)
public __construct ( )

_abspath() 보호된 메소드

Convert path related to root dir into real path.
저자: Dmitry (dio) Levashov
protected _abspath ( string $path ) : string
$path string file path
리턴 string

_archive() 보호된 메소드

Create archive and return its path.
저자: Dmitry (dio) Levashov,
저자: Alexey Sukhotin
protected _archive ( string $dir, array $files, string $name, array $arc ) : string | boolean
$dir string target dir
$files array files names list
$name string archive name
$arc array archiver options
리턴 string | boolean

_basename() 보호된 메소드

Return file name.
저자: Dmitry (dio) Levashov
protected _basename ( string $path ) : string
$path string file path
리턴 string

_checkArchivers() 보호된 메소드

Detect available archivers.
protected _checkArchivers ( )

_chmod() 보호된 메소드

chmod implementation.
protected _chmod ( $path, $mode ) : boolean
리턴 boolean

_copy() 보호된 메소드

Copy file into another file.
저자: Dmitry (dio) Levashov
protected _copy ( string $source, string $targetDir, string $name ) : boolean
$source string source file path
$targetDir string target directory path
$name string new file name
리턴 boolean

_dimensions() 보호된 메소드

..
저자: Dmitry (dio) Levashov
protected _dimensions ( string $path, string $mime ) : string
$path string file path
$mime string file mime type
리턴 string

_dirname() 보호된 메소드

Return parent directory path.
저자: Dmitry (dio) Levashov
protected _dirname ( string $path ) : string
$path string file path
리턴 string

_extract() 보호된 메소드

Extract files from archive.
저자: Dmitry (dio) Levashov,
저자: Alexey Sukhotin
protected _extract ( string $path, array $arc ) : true
$path string archive path
$arc array archiver command and arguments (same as in $this->archivers)
리턴 true

_fclose() 보호된 메소드

Close opened file.
저자: Dmitry (dio) Levashov
protected _fclose ( resource $fp, $path = '' ) : boolean
$fp resource file pointer
리턴 boolean

_filePutContents() 보호된 메소드

Write a string to a file.
저자: Dmitry (dio) Levashov
protected _filePutContents ( string $path, string $content ) : boolean
$path string file path
$content string new file content
리턴 boolean

_fopen() 보호된 메소드

Open file and return file pointer.
저자: Dmitry (dio) Levashov
protected _fopen ( string $path, $mode = 'rb' ) : resource | false
$path string file path
리턴 resource | false

_gd_getDirectories() 보호된 메소드

Get descendants directories.
protected _gd_getDirectories ( string $itemId ) : array
$itemId string
리턴 array

_gd_getDirectoryData() 보호된 메소드

Make cache of $parents, $names and $directories.
protected _gd_getDirectoryData ( string $usecache = true )
$usecache string

_gd_getDownloadUrl() 보호된 메소드

Get download url.
protected _gd_getDownloadUrl ( Google_Service_Drive_DriveFile $file ) : string | false
$file Google_Service_Drive_DriveFile
리턴 string | false

_gd_getMountPaths() 보호된 메소드

Get ID based path from item ID.
protected _gd_getMountPaths ( $id )

_gd_getThumbnail() 보호된 메소드

Get thumbnail from GoogleDrive.com.
protected _gd_getThumbnail ( string $path ) : string | boolean
$path string
리턴 string | boolean | boolean

_gd_isPublished() 보호된 메소드

Return is published.
protected _gd_isPublished ( object $file ) : boolean
$file object
리턴 boolean

_gd_parseRaw() 보호된 메소드

Parse line from googledrive metadata output and return file stat (array).
저자: Dmitry Levashov
protected _gd_parseRaw ( string $raw ) : array
$raw string line from ftp_rawlist() output
리턴 array

_gd_publish() 보호된 메소드

Publish permissions specified path item.
protected _gd_publish ( string $path ) : boolean
$path string
리턴 boolean

_gd_readFileChunk() 보호된 메소드

Read file chunk.
protected _gd_readFileChunk ( resource $handle, integer $chunkSize ) : string
$handle resource
$chunkSize integer
리턴 string

_gd_splitPath() 보호된 메소드

Get Parent ID, Item ID, Parent Path as an array from path.
protected _gd_splitPath ( string $path ) : array
$path string
리턴 array

_gd_unPublish() 보호된 메소드

unPublish permissions specified path.
protected _gd_unPublish ( string $path ) : boolean
$path string
리턴 boolean

_getContents() 보호된 메소드

Get file contents.
저자: Dmitry (dio) Levashov
protected _getContents ( string $path ) : string | false
$path string file path
리턴 string | false

_inpath() 보호된 메소드

Return true if $path is children of $parent.
저자: Dmitry (dio) Levashov
protected _inpath ( string $path, string $parent ) : boolean
$path string path to check
$parent string parent path
리턴 boolean

_joinPath() 보호된 메소드

Join dir name and file name and retur full path.
저자: Dmitry (dio) Levashov
protected _joinPath ( string $dir, string $name ) : string
$dir string
$name string
리턴 string

_mkdir() 보호된 메소드

Create dir and return created dir path or false on failed.
저자: Dmitry (dio) Levashov
protected _mkdir ( string $path, string $name ) : string | boolean
$path string parent dir path
$name string new directory name
리턴 string | boolean

_mkfile() 보호된 메소드

Create file and return it's path or false on failed.
저자: Dmitry (dio) Levashov
protected _mkfile ( string $path, string $name ) : string | boolean
$path string parent dir path
$name string new file name
리턴 string | boolean

_move() 보호된 메소드

Return new file path or false.
저자: Dmitry (dio) Levashov
protected _move ( string $source, $targetDir, string $name ) : string | boolean
$source string source file path
$name string file name
리턴 string | boolean

_normpath() 보호된 메소드

Return normalized path, this works the same as os.path.normpath() in Python.
저자: Troex Nevelin
protected _normpath ( string $path ) : string
$path string path
리턴 string

_path() 보호된 메소드

Return fake path started from root dir.
저자: Dmitry (dio) Levashov
protected _path ( string $path ) : string
$path string file path
리턴 string

_relpath() 보호된 메소드

Return file path related to root dir.
저자: Dmitry (dio) Levashov
protected _relpath ( string $path ) : string
$path string file path
리턴 string

_rmdir() 보호된 메소드

Remove dir.
저자: Dmitry (dio) Levashov
protected _rmdir ( string $path ) : boolean
$path string dir path
리턴 boolean

_save() 보호된 메소드

Return new file path or false on error.
저자: Dmitry (dio) Levashov
protected _save ( resource $fp, $path, string $name, array $stat ) : boolean | string
$fp resource file pointer
$name string file name
$stat array file stat (required by some virtual fs)
리턴 boolean | string

_scandir() 보호된 메소드

Return files list in directory.
저자: Dmitry (dio) Levashov
저자: Cem (DiscoFever)
protected _scandir ( string $path ) : array
$path string dir path
리턴 array

_stat() 보호된 메소드

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.
저자: Dmitry (dio) Levashov
protected _stat ( string $path ) : array | false
$path string file path
리턴 array | false

_subdirs() 보호된 메소드

Return true if path is dir and has at least one childs directory.
저자: Dmitry (dio) Levashov
protected _subdirs ( string $path ) : boolean
$path string dir path
리턴 boolean

_unpack() 보호된 메소드

Unpack archive.
저자: Dmitry (dio) Levashov
저자: Alexey Sukhotin
protected _unpack ( string $path, array $arc ) : true
$path string archive path
$arc array archiver command and arguments (same as in $this->archivers)
리턴 true

cacheDir() 보호된 메소드

Cache dir contents.
저자: Dmitry Levashov
protected cacheDir ( string $path )
$path string dir path

configure() 보호된 메소드

Configure after successfull mount.
저자: Dmitry (dio) Levashov
protected configure ( )

copy() 보호된 메소드

Return new file path or false.
저자: Dmitry (dio) Levashov
저자: Naoki Sawada
protected copy ( string $src, string $dst, string $name ) : string | false
$src string source path
$dst string destination dir path
$name string new file name (optionaly)
리턴 string | false

createTmb() 보호된 메소드

Create thumnbnail and return it's URL on success.
저자: Dmitry (dio) Levashov
저자: Naoki Sawada
protected createTmb ( string $path, $stat ) : string | false
$path string file path
리턴 string | false

debug() 공개 메소드

Return debug info for client.
public debug ( ) : array
리턴 array

doSearch() 보호된 메소드

Recursive files search.
저자: Naoki Sawada
protected doSearch ( string $path, string $q, array $mimes ) : array
$path string dir path
$q string search string
$mimes array
리턴 array

getContentUrl() 공개 메소드

Return content URL (for netmout volume driver) If file.url == 1 requests from JavaScript client with XHR.
저자: Naoki Sawada
public getContentUrl ( string $hash, array $options = [] ) : boolean | string
$hash string file hash
$options array options array
리턴 boolean | string

init() 보호된 메소드

Prepare FTP connection Connect to remote server and check if credentials are correct, if so, store the connection id in $ftp_conn.
저자: Dmitry (dio) Levashov
저자: Cem (DiscoFever)
protected init ( ) : boolean
리턴 boolean

isNameExists() 보호된 메소드

Return fileinfo based on filename For item ID based path file system Please override if needed on each drivers.
protected isNameExists ( string $path ) : array
$path string file cache
리턴 array

netmountPrepare() 공개 메소드

Prepare Call from elFinder::netmout() before volume->mount().
저자: Naoki Sawada
저자: Raja Sharma updating for GoogleDrive
public netmountPrepare ( $options ) : array
리턴 array

netunmount() 공개 메소드

process of on netunmount Drop googledrive & rm thumbs.
public netunmount ( $netVolumes, $key ) : boolean
리턴 boolean

remove() 보호된 메소드

Remove file/ recursive remove dir.
저자: Dmitry (dio) Levashov
저자: Naoki Sawada
protected remove ( string $path, boolean $force = false, $recursive = false ) : boolean
$path string file path
$force boolean try to remove even if file locked
리턴 boolean

tmbname() 보호된 메소드

Return thumbnail file name for required file.
저자: Dmitry (dio) Levashov
protected tmbname ( array $stat ) : string
$stat array file stat
리턴 string

umount() 공개 메소드

Close opened connection.
저자: Dmitry (dio) Levashov
public umount ( )

프로퍼티 상세

$client 보호되어 있는 프로퍼티

Google API client object.
protected object $client
리턴 object

$directories 보호되어 있는 프로퍼티

Cache of chiled directories of each directories.
protected array $directories
리턴 array

$driverId 보호되어 있는 프로퍼티

Driver id Must be started from letter and contains [a-z0-9] Used as part of volume id.
protected string $driverId
리턴 string

$names 보호되어 있는 프로퍼티

Cache of itemID => name of each items.
protected array $names
리턴 array

$netMountKey 공개적으로 프로퍼티

Net mount key.
public string $netMountKey
리턴 string

$parents 보호되어 있는 프로퍼티

Cache of parents of each directories.
protected array $parents
리턴 array

$service 보호되어 있는 프로퍼티

GoogleDrive service object.
protected object $service
리턴 object

$tmp 보호되어 있는 프로퍼티

Directory for tmp files If not set driver will try to use tmbDir as tmpDir.
protected string $tmp
리턴 string