PHP Class elFinderVolumeDriver

Provide 2 layers: 1. Public API (commands) 2. abstract fs API All abstract methods begin with "_"
Author: Dmitry (dio) Levashov
Author: Troex Nevelin
Author: Alexey Sukhotin
显示文件 Open project: studio-42/elfinder Class Usage Examples

Public Properties

Property Type Description
$netMountKey string Net mount key

Protected Properties

Property Type Description
$ARGS array Request args $_POST or $_GET values
$URL string Base URL
$access mixed Access control function/class
$added array Store files added files info
$archivers array Archivers config
$attributes mixed Access control function/class
$cache array Cache storage
$cryptLib string Library to crypt files name
$defaults array Defaults permissions
$dirsCache array Cache by folders
$disabled array List of disabled client's commands
$doSearchCurrentQuery string Current query word on doSearch
$driverId string Driver id Must be started from letter and contains [a-z0-9] Used as part of volume id
$encoding Server character encoding
$error array Errors from last failed action
$extractToNewdir integer Force make dirctory on extract
$finfo object Finfo object for mimeDetect == 'finfo'
$id string Volume id - used as prefix for files hashes
$imgConverter array Video to Image converter
$imgLib string Image manipulation lib name auto|imagick|gd|convert
$mimeDetect string Mimetype detect method
$mimetypes array default extensions/mimetypes for mimeDetect == 'internal'
$mounted boolean Flag - volume "mounted" and available
$onlyMimes array Mimetypes allowed to display
$options array Object configuration
$removed array Store files moved or overwrited files info
$root string Root directory path
$rootModified boolean Is root modified (for clear root stat cache)
$rootName string Root basename | alias
$searchStart integer Search start time
$separator string Directory separator - required by client
$session elFinderSessionInterface elFinder session wrapper object
$sessionCache array This volume session cache
$sessionCaching array Session caching item list
$startPath string Default directory to open
$subdirsCache array You should use $this->sessionCache['subdirs'] instead
$systemRoot string ..)
$tmbPath string Thumbnails dir path
$tmbPathWritable boolean Is thumbnails dir writable
$tmbSize integer Thumbnails size in px
$tmbURL string Thumbnails base URL
$today integer Today 24:00 timestamp
$treeDeep integer How many subdirs levels return for tree
$uploadAllow array Mime types allowed to upload
$uploadDeny array Mime types denied to upload
$uploadMaxSize integer | string Set as number or string with unit - "10M", "500K", "1G"
$uploadOrder array Order to validate uploadAllow and uploadDeny
$yesterday integer Yesterday 24:00 timestamp

Public Methods

Method Description
__destruct ( ) Destracter
added ( ) : array Return list of added files
archive ( $hashes, $mime, string $name = '' ) : array | boolean Add files to archive
chmod ( string $hash, string $mode ) : array | false chmod a file or folder
clearcaches ( string $hash = null ) Clear inner stat caches for target hash
clearstatcache ( ) Clear PHP stat cache & all of inner stat caches
close ( Resource $fp, string $hash ) : void Close file pointer
closest ( string $hash, string $attr, boolean $val ) : string | false Return file/dir hash or first founded child hash with required attr == $val
commandDisabled ( string $cmd ) : boolean Return true if command disabled in options
convEncIn ( mixed $var = null, boolean $restoreLocale = false, string $unknown = '_' ) : mixed Converts character encoding from UTF-8 to server's one
convEncOut ( mixed $var = null, boolean $restoreLocale = true, string $unknown = '_' ) : mixed Converts character encoding from server's one to UTF-8
copyFromAllowed ( ) : boolean Return true if copy from this volume allowed
debug ( ) : array Return debug info for client
defaultPath ( ) : string Return root or startPath hash
dimensions ( string $hash ) : array Return image dimensions
dir ( string $hash, boolean $resolveLink = false ) : array | false Return folder info
driverId ( ) : string Return driver id. Used as a part of volume id.
duplicate ( string $hash, string $suffix = 'copy' ) : array | false Create file copy with suffix "copy number" and return its info
error ( ) : array Return error message from last failed action
extract ( string $hash, null $makedir = null ) : array | boolean Extract files from archive
ffmpegToImg ( $file, $stat ) : boolean Convert Video To Image by ffmpeg
file ( string $hash ) : array | false Return file info or false on error
fstat ( string $hash ) : array stat a file or folder for elFinder cmd exec
getContentUrl ( string $hash, array $options = [] ) : boolean | string Return content URL (for netmout volume driver) If file.url == 1 requests from JavaScript client with XHR
getContents ( string $hash ) : string | false Return file contents
getExtentionByMime ( string $mime, string $suffix = '' ) : string Return file extention detected by MIME type
getHash ( string $path, string $name = '' ) : string Return target path hash
getImageSize ( string $path, string $mime = '' ) : array | false Get image size array with dimensions
getMimeTable ( ) : array Return Extention/MIME Table (elFinderVolumeDriver::$mimetypes)
getOption ( string $name ) : null | mixed Get option value of this volume
getOptionsPlugin ( string $name = '' ) : null | array Get plugin values of this options
getPath ( string $hash ) : string Return decoded path of target hash This method do not check the stat of target Use method realpath() to do check of the stat of target
getTempPath ( ) : string Return temp path
getUploadMaxSize ( ) : integer Return this uploadMaxSize value
getUploadTaget ( string $baseTargetHash, string $path, array &$result ) : boolean | string (Make &) Get upload taget dirctory hash
id ( ) : string Return volume id
imageUtil ( string $mode, string $src, array $options = [] ) : boolean Image file utility
isReadable ( ) : boolean Return true if voume is readable.
isUploadableByName ( string $name, boolean $allowUnknown = true ) : boolean Return is uploadable that given file name
ls ( string $hash, null $intersect = null ) : array Return dir files names list
mimeAccepted ( string $mime, array $mimes = null, boolean | null $empty = true ) : boolean | null Return true if mime is required mimes list
mkdir ( string $dsthash, string $name ) : array | false Create directory and return dir info
mkfile ( string $dst, string $name ) : array | false Create empty file and return its info
mount ( array $opts ) : boolean "Mount" volume.
open ( $hash ) : Resource Open file for reading and return file pointer
options ( $hash ) : array Return volume options required by client:
parents ( string $hash, boolean | null $lineal = false ) : array Return part of dirs tree from required dir up to root dir
paste ( Object $volume, $src, string $dst, boolean $rmSrc = false, array $hashes = [] ) : array | false Paste files
path ( string $hash ) : string Return file path related to root with convert encoging
putContents ( string $hash, string $content ) : array Put content in text file and return file info.
realpath ( string $hash ) : string | false Return file real path if file exists
removed ( ) : array Return list of moved/overwrited files
rename ( string $hash, string $name ) : array | false Rename file and return file info
resetRemoved ( ) : void Clean removed files list
resetResultStat ( ) : void Clean added/removed files list
resize ( string $hash, integer $width, integer $height, integer $x, integer $y, string $mode = 'resize', string $bg = '', integer $degree, integer $jpgQuality = null ) : array | false Resize image
rm ( string $hash ) : boolean Remove file/dir
rmdirRecursive ( string $dir ) : boolean Remove directory recursive on local file system
root ( ) : string Return root folder hash
scandir ( string $hash ) : array | false Return directory content or false on error
search ( string $q, array $mimes, null $hash = null ) : array Search files
setMimesFilter ( array $mimes ) : void Set mimetypes allowed to display to client
setSession ( $session ) Assign elFinder session wrapper object
size ( $hash ) : integer Return file size / total directory size
tmb ( $hash ) : false | string Create thumbnail for required file and return its name of false on failed
tree ( string $hash = '', integer $deep, string $exclude = '' ) : array | false Return subfolders for required folder or false on error
umount ( ) : void Some "unmount" stuffs - may be required by virtual fs
uniqueName ( $dir, $name, string $suffix = ' copy', boolean $checkNum = true, integer $start = 1 ) : string Return new unique name based on file name and suffix
upload ( Resource $fp, string $dst, $name, string $tmpname, array $hashes = [] ) : array | false Save uploaded file.
zipdl ( array $hashes ) : string Return path to archive of target items

Protected Methods

Method Description
_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 ( ) : void Detect available archivers
_chmod ( string $path, string $mode ) : boolean Change file mode (chmod)
_copy ( string $source, $targetDir, string $name ) : boolean | string Copy file into another file (only inside one volume)
_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 ) : boolean Extract files from archive
_fclose ( resource $fp, string $path = '' ) : boolean Close opened file
_filePutContents ( string $path, string $content ) : boolean Write a string to a file
_fopen ( string $path, string $mode = "rb" ) : resource | false Open file and return file pointer
_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 return 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 ) : boolean | string Move file into another parent dir.
_normpath ( string $path ) : string Return normalized path
_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, string $dir, 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 $source, string $targetDir, string $name ) : boolean Create symlink
_unlink ( string $path ) : boolean Remove file
abspathCE ( string $path ) : string Convert path related to root dir into real path (with convert encoding)
allowCreate ( string $dir, string $name, null $isDir = null ) : boolean Return true if file with given name can be created in given folder.
allowPutMime ( string $mime ) : boolean Return true if file MIME type can save with check uploadOrder config.
attr ( string $path, string $name, boolean $val = null, boolean $isDir = null ) : boolean Check file attribute
basenameCE ( string $path ) : string Return file name (with convert encoding)
cacheDir ( string $path ) : void Get stat for folder content and put in cache
canCreateTmb ( string $path, array $stat, boolean $checkTmbPath = true ) : string | boolean Return true if thumnbnail for required file can be created
canResize ( string $path, array $stat ) : string | boolean Return true if required file can be resized.
childsByAttr ( string $path, string $attr, boolean $val ) : string | false Return first found children with required attr == $val
clearcache ( ) : void Clean cache
closestByAttr ( string $path, string $attr, boolean $val ) : string | false If file has required attr == $val - return file path, If dir has child with has required attr == $val - return child path
configure ( ) : void Configure after successfull mount.
convEnc ( mixed $var, string $from, string $to, string $locale, $restoreLocale, string $unknown = '_' ) : mixed Converts character encoding (base function)
copy ( string $src, string $dst, string $name ) : string | false Copy file/recursive copy dir only in current volume.
copyFrom ( Object $volume, string $src, string $destination, string $name ) : string | false Copy file from another volume.
countSize ( string $path ) : integer Return file/total directory size
createTmb ( string $path, $stat ) : false | string Create thumnbnail and return it's URL on success
crypt ( $path ) : mixed Return crypted path Not implemented
decode ( $hash ) : string Decode path from hash
delTree ( string $localpath ) : boolean Delete dirctory trees
dirnameCE ( string $path ) : string Return parent directory path (with convert encoding)
doSearch ( string $path, string $q, array $mimes ) : array Recursive files search
encode ( $path ) : string Encode path into hash
fcloseCE ( resource $fp, string $path = '' ) : boolean Close opened file (with convert encoding)
fopenCE ( string $path, string $mode = 'rb' ) : false | resource Open file and return file pointer (with convert encoding)
gdImage ( resource $image, string $filename, string $destformat, string $mime, integer $jpgQuality = null ) : boolean Output gd image to file
gdImageBackground ( resource $image, string $bgcolor ) Assign the proper background to a gd image
gdImageCreate ( string $path, string $mime ) : gd Create an gd image according to the specified mime type
getArchivers ( boolean $use_cache = true ) : array Get server side available archivers
getFullPath ( string $path, string $base ) : string Resolve relative / (Unix-like)absolute path
getItemsInHand ( array $hashes, string $dir = null ) : string | false Copy items to a new temporary directory on the local server
getRootStatExtra ( ) : array Get root stat extra key values
getScandir ( string $path ) : array Return required dir's files info.
getTempFile ( string $path = '' ) : string | false Get temporary filename. Tempfile will be removed when after script execution finishes or exit() is called.
getWorkFile ( string $path ) : string File path of local server side work file path
gettmb ( string $path, array $stat ) : string | false Return thumnbnail name if exists
gettree ( string $path, integer $deep, string $exclude = '' ) : array Return subdirs tree
imageMagickConvertPrepare ( string $path, string $destformat, integer $jpgQuality, array $imageSize = null ) : array Prepare variables for exec convert of ImageMagick
imagickImage ( resource $img, string $filename, string $destformat, integer $jpgQuality = null ) : boolean Output imagick image to file
imgCrop ( string $path, integer $width, integer $height, boolean $x, boolean $y, string $destformat = null, integer $jpgQuality = null ) : string | false Crop image
imgResize ( string $path, integer $width, integer $height, boolean $keepProportions = false, boolean $resizeByBiggerSide = true, string $destformat = null, integer $jpgQuality = null, array $options = [] ) : string | false Resize image
imgRotate ( string $path, integer $degree, string $bgcolor = '#ffffff', string $destformat = null, integer $jpgQuality = null ) : string | false Rotate image
imgSquareFit ( string $path, integer $width, integer $height, integer | string $align = 'center', integer | string $valign = 'middle', string $bgcolor = '#0000ff', string $destformat = null, integer $jpgQuality = null ) : false | string Put image to square
init ( ) : boolean Prepare driver before mount volume.
inpathCE ( string $path, string $parent ) : boolean Return true if $path is children of $parent (with convert encoding)
isMyReload ( $target = '', $ARGtarget = '' )
isNameExists ( string $path ) : array Return fileinfo based on filename For item ID based path file system Please override if needed on each drivers
isSameType ( string $mime1, string $mime2 ) : boolean Return true if all mimes is directory or files
joinPathCE ( string $dir, string $name ) : string Join dir name and file name and return full path. (with convert encoding) Some drivers (db) use int as path - so we give to concat path to driver itself
localScandir ( string $dir ) : array Return files of target directory that is dotfiles excludes.
makeArchive ( string $dir, array $files, string $name, array $arc ) : string | boolean Create archive and return its path
mimetype ( string $path, string $name = '' ) : string Return file mimetype
mimetypeInternalDetect ( string $path = '' ) : string Detect file mimetype using "internal" method or Loading mime.types with $path = ''
move ( string $src, string $dst, string $name ) : string | false Move file Return new file path or false.
nameAccepted ( string $name ) : boolean Validate file name based on $this->options['acceptedName'] regexp or function
normpathCE ( string $path ) : string Return normalized path (with convert encoding)
procExec ( string $command, array &$output = null, array | integer &$return_var, array &$error_output = null ) : integer Execute shell command
relpathCE ( string $path ) : string Return file path related to root dir (with convert encoding)
remove ( string $path, boolean $force = false ) : boolean Remove file/ recursive remove dir
rmTmb ( string $stat ) : void Remove thumbnail, also remove recursively if stat is directory
saveCE ( resource $fp, string $dir, string $name, array $stat ) : boolean | string Create new file and write into it from file pointer. (with convert encoding) Return new file path or false on error.
scandirCE ( string $path ) : array Return files list in directory (with convert encoding)
sessionRestart ( )
setError ( $error ) : false Save error message
stat ( string $path ) : array Return fileinfo
stripos ( string $haystack, string $needle, integer $offset ) : integer | boolean Find position of first occurrence of string in a string with multibyte support
subdirsCE ( string $path ) : boolean Return true if path is dir and has at least one childs directory (with convert encoding)
symlinkCE ( string $source, string $targetDir, string $name ) : boolean Create symlink (with convert encoding)
tmbname ( array $stat ) : string Return thumbnail file name for required file
uncrypt ( $hash ) : mixed Return uncrypted path Not implemented
unpackArchive ( string $path, array $arc, boolean $remove = true ) : void Unpack archive
updateCache ( string $path, array $stat ) : array Put file stat in cache and return it
zipArchiveUnzip ( string $zipPath, string $toDir ) : boolean Unpack Zip archive using PHP class ZipArchive
zipArchiveZip ( string $dir, array $files, string | object $zipPath ) : boolean Create Zip archive using PHP class ZipArchive

Method Details

__destruct() public method

Destracter
public __destruct ( )

_abspath() abstract protected method

Convert path related to root dir into real path
Author: Dmitry (dio) Levashov
abstract protected _abspath ( string $path ) : string
$path string rel file path
return string

_archive() abstract protected method

Create archive and return its path
Author: Dmitry (dio) Levashov,
Author: Alexey Sukhotin
abstract 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
return string | boolean

_basename() abstract protected method

Return file name
Author: Dmitry (dio) Levashov
abstract protected _basename ( string $path ) : string
$path string file path
return string

_checkArchivers() abstract protected method

Detect available archivers
Author: Dmitry (dio) Levashov,
Author: Alexey Sukhotin
abstract protected _checkArchivers ( ) : void
return void

_chmod() abstract protected method

Change file mode (chmod)
Author: David Bartle,
abstract protected _chmod ( string $path, string $mode ) : boolean
$path string file path
$mode string octal string such as '0755'
return boolean

_copy() abstract protected method

Copy file into another file (only inside one volume)
Author: Dmitry (dio) Levashov
abstract protected _copy ( string $source, $targetDir, string $name ) : boolean | string
$source string source file path
$targetDir
$name string file name
return boolean | string

_dimensions() abstract protected method

..
Author: Dmitry (dio) Levashov
abstract protected _dimensions ( string $path, string $mime ) : string
$path string file path
$mime string file mime type
return string

_dirname() abstract protected method

Return parent directory path
Author: Dmitry (dio) Levashov
abstract protected _dirname ( string $path ) : string
$path string file path
return string

_extract() abstract protected method

Extract files from archive
Author: Dmitry (dio) Levashov,
Author: Alexey Sukhotin
abstract protected _extract ( string $path, array $arc ) : boolean
$path string file path
$arc array archiver options
return boolean

_fclose() abstract protected method

Close opened file
Author: Dmitry (dio) Levashov
abstract protected _fclose ( resource $fp, string $path = '' ) : boolean
$fp resource file pointer
$path string file path
return boolean

_filePutContents() abstract protected method

Write a string to a file
Author: Dmitry (dio) Levashov
abstract protected _filePutContents ( string $path, string $content ) : boolean
$path string file path
$content string new file content
return boolean

_fopen() abstract protected method

Open file and return file pointer
Author: Dmitry (dio) Levashov
abstract protected _fopen ( string $path, string $mode = "rb" ) : resource | false
$path string file path
$mode string open mode
return resource | false

_getContents() abstract protected method

Get file contents
Author: Dmitry (dio) Levashov
abstract protected _getContents ( string $path ) : string | false
$path string file path
return string | false

_inpath() abstract protected method

Return true if $path is children of $parent
Author: Dmitry (dio) Levashov
abstract protected _inpath ( string $path, string $parent ) : boolean
$path string path to check
$parent string parent path
return boolean

_joinPath() abstract protected method

Some drivers (db) use int as path - so we give to concat path to driver itself
Author: Dmitry (dio) Levashov
abstract protected _joinPath ( string $dir, string $name ) : string
$dir string dir path
$name string file name
return string

_mkdir() abstract protected method

Create dir and return created dir path or false on failed
Author: Dmitry (dio) Levashov
abstract protected _mkdir ( string $path, string $name ) : string | boolean
$path string parent dir path
$name string new directory name
return string | boolean

_mkfile() abstract protected method

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

_move() abstract protected method

Return new file path or false.
Author: Dmitry (dio) Levashov
abstract protected _move ( string $source, $targetDir, string $name ) : boolean | string
$source string source file path
$targetDir
$name string file name
return boolean | string

_normpath() abstract protected method

Return normalized path
Author: Dmitry (dio) Levashov
abstract protected _normpath ( string $path ) : string
$path string file path
return string

_path() abstract protected method

Required to show path on client side.
Author: Dmitry (dio) Levashov
abstract protected _path ( string $path ) : string
$path string file path
return string

_relpath() abstract protected method

Return file path related to root dir
Author: Dmitry (dio) Levashov
abstract protected _relpath ( string $path ) : string
$path string file path
return string

_rmdir() abstract protected method

Remove dir
Author: Dmitry (dio) Levashov
abstract protected _rmdir ( string $path ) : boolean
$path string dir path
return boolean

_save() abstract protected method

Return new file path or false on error.
Author: Dmitry (dio) Levashov
abstract protected _save ( resource $fp, string $dir, string $name, array $stat ) : boolean | string
$fp resource file pointer
$dir string target dir path
$name string file name
$stat array file stat (required by some virtual fs)
return boolean | string

_scandir() abstract protected method

Return files list in directory
Author: Dmitry (dio) Levashov
abstract protected _scandir ( string $path ) : array
$path string dir path
return array

_stat() abstract protected method

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.
Author: Dmitry (dio) Levashov
abstract protected _stat ( string $path ) : array | false
$path string file path
return array | false

_subdirs() abstract protected method

Return true if path is dir and has at least one childs directory
Author: Dmitry (dio) Levashov
abstract protected _subdirs ( string $path ) : boolean
$path string dir path
return boolean

abspathCE() protected method

Convert path related to root dir into real path (with convert encoding)
Author: Naoki Sawada
protected abspathCE ( string $path ) : string
$path string rel file path
return string

added() public method

Return list of added files
Deprecation:
Author: Naoki Sawada
public added ( ) : array
return array

allowCreate() protected method

Return true if file with given name can be created in given folder.
Author: Dmitry (dio) Levashov
protected allowCreate ( string $dir, string $name, null $isDir = null ) : boolean
$dir string parent dir path
$name string new file name
$isDir null
return boolean

allowPutMime() protected method

Return true if file MIME type can save with check uploadOrder config.
protected allowPutMime ( string $mime ) : boolean
$mime string
return boolean

archive() public method

Add files to archive
public archive ( $hashes, $mime, string $name = '' ) : array | boolean
$hashes
$mime
$name string
return array | boolean

attr() protected method

Check file attribute
Author: Dmitry (dio) Levashov
protected attr ( string $path, string $name, boolean $val = null, boolean $isDir = null ) : boolean
$path string file path
$name string attribute name (read|write|locked|hidden)
$val boolean attribute value returned by file system
$isDir boolean path is directory (true: directory, false: file)
return boolean

basenameCE() protected method

Return file name (with convert encoding)
Author: Naoki Sawada
protected basenameCE ( string $path ) : string
$path string file path
return string

cacheDir() protected method

Get stat for folder content and put in cache
Author: Dmitry (dio) Levashov
protected cacheDir ( string $path ) : void
$path string
return void

canCreateTmb() protected method

Return true if thumnbnail for required file can be created
Author: Dmitry (dio) Levashov
protected canCreateTmb ( string $path, array $stat, boolean $checkTmbPath = true ) : string | boolean
$path string thumnbnail path
$stat array file stat
$checkTmbPath boolean
return string | boolean

canResize() protected method

By default - the same as canCreateTmb
Author: Dmitry (dio) Levashov
protected canResize ( string $path, array $stat ) : string | boolean
$path string thumnbnail path
$stat array file stat
return string | boolean

childsByAttr() protected method

Return first found children with required attr == $val
Author: Dmitry (dio) Levashov
protected childsByAttr ( string $path, string $attr, boolean $val ) : string | false
$path string file path
$attr string attribute name
$val boolean attribute value
return string | false

chmod() public method

chmod a file or folder
Author: David Bartle
public chmod ( string $hash, string $mode ) : array | false
$hash string file or folder hash to chmod
$mode string octal string representing new permissions
return array | false

clearcache() protected method

Clean cache
Author: Dmitry (dio) Levashov
protected clearcache ( ) : void
return void

clearcaches() public method

Clear inner stat caches for target hash
public clearcaches ( string $hash = null )
$hash string

clearstatcache() public method

Clear PHP stat cache & all of inner stat caches
public clearstatcache ( )

close() public method

Close file pointer
Author: Dmitry (dio) Levashov
public close ( Resource $fp, string $hash ) : void
$fp Resource file pointer
$hash string file hash
return void

closest() public method

Return file/dir hash or first founded child hash with required attr == $val
Author: Dmitry (dio) Levashov
public closest ( string $hash, string $attr, boolean $val ) : string | false
$hash string file hash
$attr string attribute name
$val boolean attribute value
return string | false

closestByAttr() protected method

If file has required attr == $val - return file path, If dir has child with has required attr == $val - return child path
Author: Dmitry (dio) Levashov
protected closestByAttr ( string $path, string $attr, boolean $val ) : string | false
$path string file path
$attr string attribute name
$val boolean attribute value
return string | false

commandDisabled() public method

Return true if command disabled in options
Author: Dmitry (dio) Levashov
public commandDisabled ( string $cmd ) : boolean
$cmd string command name
return boolean

configure() protected method

By default set thumbnails path and image manipulation library.
Author: Dmitry (dio) Levashov
protected configure ( ) : void
return void

convEnc() protected method

Converts character encoding (base function)
protected convEnc ( mixed $var, string $from, string $to, string $locale, $restoreLocale, string $unknown = '_' ) : mixed
$var mixed target string or array var
$from string from character encoding
$to string to character encoding
$locale string local locale
$restoreLocale
$unknown string replaces character for unknown
return mixed

convEncIn() public method

Converts character encoding from UTF-8 to server's one
Author: Naoki Sawada
public convEncIn ( mixed $var = null, boolean $restoreLocale = false, string $unknown = '_' ) : mixed
$var mixed target string or array var
$restoreLocale boolean do retore global locale, default is false
$unknown string replaces character for unknown
return mixed

convEncOut() public method

Converts character encoding from server's one to UTF-8
Author: Naoki Sawada
public convEncOut ( mixed $var = null, boolean $restoreLocale = true, string $unknown = '_' ) : mixed
$var mixed target string or array var
$restoreLocale boolean do retore global locale, default is true
$unknown string replaces character for unknown
return mixed

copy() protected method

Return new file path or false.
Author: Dmitry (dio) Levashov
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)
return string | false

copyFrom() protected method

Return new file path or false.
Author: Dmitry (dio) Levashov
protected copyFrom ( Object $volume, string $src, string $destination, string $name ) : string | false
$volume Object source volume
$src string source file hash
$destination string destination dir path
$name string file name
return string | false

copyFromAllowed() public method

Return true if copy from this volume allowed
Author: Dmitry (dio) Levashov
public copyFromAllowed ( ) : boolean
return boolean

countSize() protected method

Return file/total directory size
Author: Dmitry (dio) Levashov
protected countSize ( string $path ) : integer
$path string file path
return integer

createTmb() protected method

Create thumnbnail and return it's URL on success
Author: Dmitry (dio) Levashov
protected createTmb ( string $path, $stat ) : false | string
$path string file path
$stat
return false | string

crypt() protected method

Return crypted path Not implemented
Author: Dmitry (dio) Levashov
protected crypt ( $path ) : mixed
return mixed

debug() public method

Return debug info for client
Author: Dmitry (dio) Levashov
public debug ( ) : array
return array

decode() protected method

Decode path from hash
Author: Dmitry (dio) Levashov
Author: Troex Nevelin
protected decode ( $hash ) : string
return string

defaultPath() public method

Return root or startPath hash
Author: Dmitry (dio) Levashov
public defaultPath ( ) : string
return string

delTree() protected method

Delete dirctory trees
Author: Naoki Sawada
protected delTree ( string $localpath ) : boolean
$localpath string path need convert encoding to server encoding
return boolean

dimensions() public method

Return image dimensions
Author: Dmitry (dio) Levashov
public dimensions ( string $hash ) : array
$hash string file hash
return array

dir() public method

Return folder info
Author: Dmitry (dio) Levashov
public dir ( string $hash, boolean $resolveLink = false ) : array | false
$hash string folder hash
$resolveLink boolean
return array | false

dirnameCE() protected method

Return parent directory path (with convert encoding)
Author: Naoki Sawada
protected dirnameCE ( string $path ) : string
$path string file path
return string

doSearch() protected method

Recursive files search
Author: Dmitry (dio) Levashov
protected doSearch ( string $path, string $q, array $mimes ) : array
$path string dir path
$q string search string
$mimes array
return array

driverId() public method

Return driver id. Used as a part of volume id.
Author: Dmitry (dio) Levashov
public driverId ( ) : string
return string

duplicate() public method

Create file copy with suffix "copy number" and return its info
Author: Dmitry (dio) Levashov
public duplicate ( string $hash, string $suffix = 'copy' ) : array | false
$hash string file hash
$suffix string suffix to add to file name
return array | false

encode() protected method

Encode path into hash
Author: Dmitry (dio) Levashov
Author: Troex Nevelin
protected encode ( $path ) : string
return string

error() public method

Return error message from last failed action
Author: Dmitry (dio) Levashov
public error ( ) : array
return array

extract() public method

Extract files from archive
Author: Dmitry (dio) Levashov,
Author: Alexey Sukhotin
public extract ( string $hash, null $makedir = null ) : array | boolean
$hash string archive hash
$makedir null
return array | boolean

fcloseCE() protected method

Close opened file (with convert encoding)
Author: Naoki Sawada
protected fcloseCE ( resource $fp, string $path = '' ) : boolean
$fp resource file pointer
$path string file path
return boolean

ffmpegToImg() public method

Convert Video To Image by ffmpeg
Author: Naoki Sawada
public ffmpegToImg ( $file, $stat ) : boolean
$file video source file path
$stat file stat array
return boolean

file() public method

Return file info or false on error
Author: Dmitry (dio) Levashov
public file ( string $hash ) : array | false
$hash string file hash
return array | false

fopenCE() protected method

Open file and return file pointer (with convert encoding)
Author: Naoki Sawada
protected fopenCE ( string $path, string $mode = 'rb' ) : false | resource
$path string file path
$mode string
return false | resource

fstat() public method

stat a file or folder for elFinder cmd exec
Author: Naoki Sawada
public fstat ( string $hash ) : array
$hash string file or folder hash to chmod
return array

gdImage() protected method

Output gd image to file
protected gdImage ( resource $image, string $filename, string $destformat, string $mime, integer $jpgQuality = null ) : boolean
$image resource gd image resource
$filename string The path to save the file to.
$destformat string The Image type to use for $filename
$mime string The original image mime type
$jpgQuality integer JEPG quality (1-100)
return boolean

gdImageBackground() protected method

Assign the proper background to a gd image
protected gdImageBackground ( resource $image, string $bgcolor )
$image resource gd image resource
$bgcolor string background color in #rrggbb format

gdImageCreate() protected method

Create an gd image according to the specified mime type
protected gdImageCreate ( string $path, string $mime ) : gd
$path string image file
$mime string
return gd image resource identifier

getArchivers() protected method

Get server side available archivers
protected getArchivers ( boolean $use_cache = true ) : array
$use_cache boolean
return array

getContentUrl() public method

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

getContents() public method

Return file contents
Author: Dmitry (dio) Levashov
public getContents ( string $hash ) : string | false
$hash string file hash
return string | false

getExtentionByMime() public method

Return file extention detected by MIME type
Author: Naoki Sawada
public getExtentionByMime ( string $mime, string $suffix = '' ) : string
$mime string MIME type
$suffix string Additional suffix
return string

getFullPath() protected method

Resolve relative / (Unix-like)absolute path
protected getFullPath ( string $path, string $base ) : string
$path string target path
$base string base path
return string

getHash() public method

Return target path hash
Author: Naoki Sawada
public getHash ( string $path, string $name = '' ) : string
$path string
$name string
return string

getImageSize() public method

Get image size array with dimensions
public getImageSize ( string $path, string $mime = '' ) : array | false
$path string path need convert encoding to server encoding
$mime string file mime type
return array | false

getItemsInHand() protected method

Copy items to a new temporary directory on the local server
Author: Naoki Sawada
protected getItemsInHand ( array $hashes, string $dir = null ) : string | false
$hashes array target hashes
$dir string destination directory (for recurcive)
return string | false saved path name

getMimeTable() public method

Return Extention/MIME Table (elFinderVolumeDriver::$mimetypes)
Author: Naoki Sawada
public getMimeTable ( ) : array
return array

getOption() public method

Get option value of this volume
Author: Naoki Sawada
public getOption ( string $name ) : null | mixed
$name string target option name
return null | mixed target option value

getOptionsPlugin() public method

Get plugin values of this options
Author: Naoki Sawada
public getOptionsPlugin ( string $name = '' ) : null | array
$name string Plugin name
return null | array Plugin values

getPath() public method

Return decoded path of target hash This method do not check the stat of target Use method realpath() to do check of the stat of target
Author: Naoki Sawada
public getPath ( string $hash ) : string
$hash string
return string

getRootStatExtra() protected method

Get root stat extra key values
Author: Naoki Sawada
protected getRootStatExtra ( ) : array
return array stat extras

getScandir() protected method

If onlyMimes is set - return only dirs and files of required mimes
Author: Dmitry (dio) Levashov
protected getScandir ( string $path ) : array
$path string dir path
return array

getTempFile() protected method

When needing the unique file to a path, give $path to parameter.
Author: Naoki Sawada
protected getTempFile ( string $path = '' ) : string | false
$path string for get unique file to a path
return string | false

getTempPath() public method

Return temp path
Author: Naoki Sawada
public getTempPath ( ) : string
return string

getUploadMaxSize() public method

Return this uploadMaxSize value
Author: Naoki Sawada
public getUploadMaxSize ( ) : integer
return integer

getUploadTaget() public method

(Make &) Get upload taget dirctory hash
Author: Naoki Sawada
public getUploadTaget ( string $baseTargetHash, string $path, array &$result ) : boolean | string
$baseTargetHash string
$path string
$result array
return boolean | string

getWorkFile() protected method

File path of local server side work file path
Author: Naoki Sawada
protected getWorkFile ( string $path ) : string
$path string path need convert encoding to server encoding
return string

gettmb() protected method

Return thumnbnail name if exists
Author: Dmitry (dio) Levashov
protected gettmb ( string $path, array $stat ) : string | false
$path string file path
$stat array file stat
return string | false

gettree() protected method

Return subdirs tree
Author: Dmitry (dio) Levashov
protected gettree ( string $path, integer $deep, string $exclude = '' ) : array
$path string parent dir path
$deep integer tree deep
$exclude string
return array

id() public method

Return volume id
Author: Dmitry (dio) Levashov
public id ( ) : string
return string

imageMagickConvertPrepare() protected method

Prepare variables for exec convert of ImageMagick
protected imageMagickConvertPrepare ( string $path, string $destformat, integer $jpgQuality, array $imageSize = null ) : array
$path string
$destformat string
$jpgQuality integer
$imageSize array
return array

imageUtil() public method

Image file utility
Author: Naoki Sawada
public imageUtil ( string $mode, string $src, array $options = [] ) : boolean
$mode string 'resize', 'rotate', 'propresize', 'crop', 'fitsquare'
$src string Image file local path
$options array excute options
return boolean

imagickImage() protected method

Output imagick image to file
protected imagickImage ( resource $img, string $filename, string $destformat, integer $jpgQuality = null ) : boolean
$img resource imagick image resource
$filename string The path to save the file to.
$destformat string The Image type to use for $filename
$jpgQuality integer JEPG quality (1-100)
return boolean

imgCrop() protected method

Crop image
Author: Dmitry (dio) Levashov
Author: Alexey Sukhotin
protected imgCrop ( string $path, integer $width, integer $height, boolean $x, boolean $y, string $destformat = null, integer $jpgQuality = null ) : string | false
$path string image file
$width integer crop width
$height integer crop height
$x boolean crop left offset
$y boolean crop top offset
$destformat string image destination format
$jpgQuality integer JEPG quality (1-100)
return string | false

imgResize() protected method

Resize image
Author: Dmitry (dio) Levashov
Author: Alexey Sukhotin
protected imgResize ( string $path, integer $width, integer $height, boolean $keepProportions = false, boolean $resizeByBiggerSide = true, string $destformat = null, integer $jpgQuality = null, array $options = [] ) : string | false
$path string image file
$width integer new width
$height integer new height
$keepProportions boolean crop image
$resizeByBiggerSide boolean resize image based on bigger side if true
$destformat string image destination format
$jpgQuality integer JEPG quality (1-100)
$options array Other extra options
return string | false

imgRotate() protected method

Rotate image
Author: nao-pon
Author: Troex Nevelin
protected imgRotate ( string $path, integer $degree, string $bgcolor = '#ffffff', string $destformat = null, integer $jpgQuality = null ) : string | false
$path string image file
$degree integer rotete degrees
$bgcolor string square background color in #rrggbb format
$destformat string image destination format
$jpgQuality integer JEPG quality (1-100)
return string | false

imgSquareFit() protected method

Put image to square
Author: Dmitry (dio) Levashov
Author: Alexey Sukhotin
protected imgSquareFit ( string $path, integer $width, integer $height, integer | string $align = 'center', integer | string $valign = 'middle', string $bgcolor = '#0000ff', string $destformat = null, integer $jpgQuality = null ) : false | string
$path string image file
$width integer square width
$height integer square height
$align integer | string reserved
$valign integer | string reserved
$bgcolor string square background color in #rrggbb format
$destformat string image destination format
$jpgQuality integer JEPG quality (1-100)
return false | string

init() protected method

Return true if volume is ready.
Author: Dmitry (dio) Levashov
protected init ( ) : boolean
return boolean

inpathCE() protected method

Return true if $path is children of $parent (with convert encoding)
Author: Naoki Sawada
protected inpathCE ( string $path, string $parent ) : boolean
$path string path to check
$parent string parent path
return boolean

isMyReload() protected method

protected isMyReload ( $target = '', $ARGtarget = '' )

isNameExists() protected method

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
return array

isReadable() public method

Return true if voume is readable.
Author: Dmitry (dio) Levashov
public isReadable ( ) : boolean
return boolean

isSameType() protected method

Return true if all mimes is directory or files
Author: Dmitry (dio) Levashov
protected isSameType ( string $mime1, string $mime2 ) : boolean
$mime1 string mimetype
$mime2 string mimetype
return boolean

isUploadableByName() public method

Return is uploadable that given file name
Author: Naoki Sawada
public isUploadableByName ( string $name, boolean $allowUnknown = true ) : boolean
$name string file name
$allowUnknown boolean
return boolean

joinPathCE() protected method

Join dir name and file name and return full path. (with convert encoding) Some drivers (db) use int as path - so we give to concat path to driver itself
Author: Naoki Sawada
protected joinPathCE ( string $dir, string $name ) : string
$dir string dir path
$name string file name
return string

localScandir() protected static method

Return files of target directory that is dotfiles excludes.
Author: Naoki Sawada
protected static localScandir ( string $dir ) : array
$dir string target directory path
return array

ls() public method

Return dir files names list
Author: Dmitry (dio) Levashov
public ls ( string $hash, null $intersect = null ) : array
$hash string file hash
$intersect null
return array

makeArchive() protected method

Create archive and return its path
Author: Dmitry (dio) Levashov,
Author: Alexey Sukhotin
Author: Naoki Sawada
protected makeArchive ( 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
return string | boolean

mimeAccepted() public method

Return true if mime is required mimes list
Author: Dmitry (dio) Levashov
Author: Troex Nevelin
public mimeAccepted ( string $mime, array $mimes = null, boolean | null $empty = true ) : boolean | null
$mime string mime type to check
$mimes array allowed mime types list or not set to use client mimes list
$empty boolean | null what to return on empty list
return boolean | null

mimetype() protected method

Return file mimetype
Author: Dmitry (dio) Levashov
protected mimetype ( string $path, string $name = '' ) : string
$path string file path
$name string
return string

mimetypeInternalDetect() protected static method

Detect file mimetype using "internal" method or Loading mime.types with $path = ''
Author: Dmitry (dio) Levashov
protected static mimetypeInternalDetect ( string $path = '' ) : string
$path string file path
return string

mkdir() public method

Create directory and return dir info
Author: Dmitry (dio) Levashov
public mkdir ( string $dsthash, string $name ) : array | false
$dsthash string destination directory hash
$name string directory name
return array | false

mkfile() public method

Create empty file and return its info
Author: Dmitry (dio) Levashov
public mkfile ( string $dst, string $name ) : array | false
$dst string destination directory
$name string file name
return array | false

mount() public method

Return true if volume available for read or write, false - otherwise
Author: Dmitry (dio) Levashov
Author: Alexey Sukhotin
public mount ( array $opts ) : boolean
$opts array
return boolean

move() protected method

Move file Return new file path or false.
Author: Dmitry (dio) Levashov
protected move ( string $src, string $dst, string $name ) : string | false
$src string source path
$dst string destination dir path
$name string new file name
return string | false

nameAccepted() protected method

Validate file name based on $this->options['acceptedName'] regexp or function
Author: Dmitry (dio) Levashov
protected nameAccepted ( string $name ) : boolean
$name string file name
return boolean

normpathCE() protected method

Return normalized path (with convert encoding)
Author: Naoki Sawada
protected normpathCE ( string $path ) : string
$path string file path
return string

open() public method

Open file for reading and return file pointer
Author: Dmitry (dio) Levashov
public open ( $hash ) : Resource
return Resource

options() public method

Return volume options required by client:
Author: Dmitry (dio) Levashov
public options ( $hash ) : array
$hash
return array

parents() public method

Return part of dirs tree from required dir up to root dir
Author: Dmitry (dio) Levashov
public parents ( string $hash, boolean | null $lineal = false ) : array
$hash string directory hash
$lineal boolean | null only lineal parents
return array

paste() public method

Paste files
Author: Dmitry (dio) Levashov
public paste ( Object $volume, $src, string $dst, boolean $rmSrc = false, array $hashes = [] ) : array | false
$volume Object source volume
$src
$dst string destination dir hash
$rmSrc boolean remove source after copy?
$hashes array
return array | false

path() public method

Return file path related to root with convert encoging
Author: Dmitry (dio) Levashov
public path ( string $hash ) : string
$hash string file hash
return string

procExec() protected method

Execute shell command
Author: Alexey Sukhotin
protected procExec ( string $command, array &$output = null, array | integer &$return_var, array &$error_output = null ) : integer
$command string command line
$output array stdout strings
$return_var array | integer process exit code
$error_output array stderr strings
return integer exit code

putContents() public method

Put content in text file and return file info.
Author: Dmitry (dio) Levashov
public putContents ( string $hash, string $content ) : array
$hash string file hash
$content string new file content
return array

realpath() public method

Return file real path if file exists
Author: Dmitry (dio) Levashov
public realpath ( string $hash ) : string | false
$hash string file hash
return string | false | false

relpathCE() protected method

Return file path related to root dir (with convert encoding)
Author: Naoki Sawada
protected relpathCE ( string $path ) : string
$path string file path
return string

remove() protected method

Remove file/ recursive remove dir
Author: Dmitry (dio) Levashov
protected remove ( string $path, boolean $force = false ) : boolean
$path string file path
$force boolean try to remove even if file locked
return boolean

removed() public method

Return list of moved/overwrited files
Author: Dmitry (dio) Levashov
public removed ( ) : array
return array

rename() public method

Rename file and return file info
Author: Dmitry (dio) Levashov
public rename ( string $hash, string $name ) : array | false
$hash string file hash
$name string new file name
return array | false

resetRemoved() public method

Clean removed files list
Author: Dmitry (dio) Levashov
public resetRemoved ( ) : void
return void

resetResultStat() public method

Clean added/removed files list
public resetResultStat ( ) : void
return void

resize() public method

Resize image
Author: Dmitry (dio) Levashov
Author: Alexey Sukhotin
Author: nao-pon
Author: Troex Nevelin
public resize ( string $hash, integer $width, integer $height, integer $x, integer $y, string $mode = 'resize', string $bg = '', integer $degree, integer $jpgQuality = null ) : array | false
$hash string image file
$width integer new width
$height integer new height
$x integer X start poistion for crop
$y integer Y start poistion for crop
$mode string action how to mainpulate image
$bg string background color
$degree integer rotete degree
$jpgQuality integer JEPG quality (1-100)
return array | false

rm() public method

Remove file/dir
Author: Dmitry (dio) Levashov
public rm ( string $hash ) : boolean
$hash string file hash
return boolean

rmTmb() protected method

Remove thumbnail, also remove recursively if stat is directory
Author: Dmitry (dio) Levashov
Author: Naoki Sawada
Author: Troex Nevelin
protected rmTmb ( string $stat ) : void
$stat string file stat
return void

rmdirRecursive() public method

Remove directory recursive on local file system
Author: Naoki Sawada
public rmdirRecursive ( string $dir ) : boolean
$dir string Target dirctory path
return boolean

root() public method

Return root folder hash
Author: Dmitry (dio) Levashov
public root ( ) : string
return string

saveCE() protected method

Create new file and write into it from file pointer. (with convert encoding) Return new file path or false on error.
Author: Naoki Sawada
protected saveCE ( resource $fp, string $dir, string $name, array $stat ) : boolean | string
$fp resource file pointer
$dir string target dir path
$name string file name
$stat array file stat (required by some virtual fs)
return boolean | string

scandir() public method

Return directory content or false on error
Author: Dmitry (dio) Levashov
public scandir ( string $hash ) : array | false
$hash string file hash
return array | false

scandirCE() protected method

Return files list in directory (with convert encoding)
Author: Naoki Sawada
protected scandirCE ( string $path ) : array
$path string dir path
return array

sessionRestart() protected method

Deprecation:
protected sessionRestart ( )

setError() protected method

Save error message
Author: Dmitry(dio) Levashov
protected setError ( $error ) : false
return false

setMimesFilter() public method

Set mimetypes allowed to display to client
Author: Dmitry (dio) Levashov
public setMimesFilter ( array $mimes ) : void
$mimes array
return void

setSession() public method

Assign elFinder session wrapper object
public setSession ( $session )
$session elFinderSessionInterface

size() public method

Return file size / total directory size
Author: Dmitry (dio) Levashov
public size ( $hash ) : integer
return integer

stat() protected method

Return fileinfo
Author: Dmitry (dio) Levashov
protected stat ( string $path ) : array
$path string file cache
return array

stripos() protected method

Find position of first occurrence of string in a string with multibyte support
Author: Alexey Sukhotin
protected stripos ( string $haystack, string $needle, integer $offset ) : integer | boolean
$haystack string The string being checked.
$needle string The string to find in haystack.
$offset integer The search offset. If it is not specified, 0 is used.
return integer | boolean

subdirsCE() protected method

Return true if path is dir and has at least one childs directory (with convert encoding)
Author: Naoki Sawada
protected subdirsCE ( string $path ) : boolean
$path string dir path
return boolean

symlinkCE() protected method

Create symlink (with convert encoding)
Author: Naoki Sawada
protected symlinkCE ( string $source, string $targetDir, string $name ) : boolean
$source string file to link to
$targetDir string folder to create link in
$name string symlink name
return boolean

tmb() public method

Create thumbnail for required file and return its name of false on failed
Author: Dmitry (dio) Levashov
public tmb ( $hash ) : false | string
$hash
return false | string

tmbname() protected method

Return thumbnail file name for required file
Author: Dmitry (dio) Levashov
protected tmbname ( array $stat ) : string
$stat array file stat
return string

tree() public method

Return subfolders for required folder or false on error
Author: Dmitry (dio) Levashov
public tree ( string $hash = '', integer $deep, string $exclude = '' ) : array | false
$hash string folder hash or empty string to get tree from root folder
$deep integer subdir deep
$exclude string dir hash which subfolders must be exluded from result, required to not get stat twice on cwd subfolders
return array | false

umount() public method

Some "unmount" stuffs - may be required by virtual fs
Author: Dmitry (dio) Levashov
public umount ( ) : void
return void

uncrypt() protected method

Return uncrypted path Not implemented
Author: Dmitry (dio) Levashov
protected uncrypt ( $hash ) : mixed
return mixed

uniqueName() public method

Return new unique name based on file name and suffix
Author: Dmitry (dio) Levashov
public uniqueName ( $dir, $name, string $suffix = ' copy', boolean $checkNum = true, integer $start = 1 ) : string
$dir
$name
$suffix string suffix append to name
$checkNum boolean
$start integer
return string

unpackArchive() protected method

Unpack archive
Author: Dmitry (dio) Levashov
Author: Alexey Sukhotin
Author: Naoki Sawada
protected unpackArchive ( string $path, array $arc, boolean $remove = true ) : void
$path string archive path
$arc array archiver command and arguments (same as in $this->archivers)
$remove boolean remove archive ( unlink($path) )
return void

updateCache() protected method

Put file stat in cache and return it
Author: Dmitry (dio) Levashov
protected updateCache ( string $path, array $stat ) : array
$path string file path
$stat array file stat
return array

upload() public method

On success return array with new file stat and with removed file hash (if existed file was replaced)
Author: Dmitry (dio) Levashov
public upload ( Resource $fp, string $dst, $name, string $tmpname, array $hashes = [] ) : array | false
$fp Resource file pointer
$dst string destination folder hash
$name
$tmpname string file tmp name - required to detect mime type
$hashes array exists files hash array with filename as key
return array | false

zipArchiveUnzip() protected static method

Unpack Zip archive using PHP class ZipArchive
Author: Naoki Sawada
protected static zipArchiveUnzip ( string $zipPath, string $toDir ) : boolean
$zipPath string Zip archive name
$toDir string Extract to path
return boolean

zipArchiveZip() protected static method

Create Zip archive using PHP class ZipArchive
Author: Naoki Sawada
protected static zipArchiveZip ( string $dir, array $files, string | object $zipPath ) : boolean
$dir string target dir
$files array files names list
$zipPath string | object Zip archive name
return boolean

zipdl() public method

Return path to archive of target items
Author: Naoki Sawada
public zipdl ( array $hashes ) : string
$hashes array
return string archive path

Property Details

$ARGS protected_oe property

Request args $_POST or $_GET values
protected array $ARGS
return array

$URL protected_oe property

Base URL
protected string $URL
return string

$access protected_oe property

Access control function/class
protected mixed $access
return mixed

$added protected_oe property

Store files added files info
protected array $added
return array

$archivers protected_oe property

Archivers config
protected array $archivers
return array

$attributes protected_oe property

Access control function/class
protected mixed $attributes
return mixed

$cache protected_oe property

Cache storage
protected array $cache
return array

$cryptLib protected_oe property

Library to crypt files name
protected string $cryptLib
return string

$defaults protected_oe property

Defaults permissions
protected array $defaults
return array

$dirsCache protected_oe property

Cache by folders
protected array $dirsCache
return array

$disabled protected_oe property

List of disabled client's commands
protected array $disabled
return array

$doSearchCurrentQuery protected_oe property

Current query word on doSearch
protected string $doSearchCurrentQuery
return string

$driverId protected_oe property

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

$encoding protected_oe property

Server character encoding
protected $encoding

$error protected_oe property

Errors from last failed action
protected array $error
return array

$extractToNewdir protected_oe property

Force make dirctory on extract
protected int $extractToNewdir
return integer

$finfo protected_oe property

Finfo object for mimeDetect == 'finfo'
protected object $finfo
return object

$id protected_oe property

Volume id - used as prefix for files hashes
protected string $id
return string

$imgConverter protected_oe property

Video to Image converter
protected array $imgConverter
return array

$imgLib protected_oe property

Image manipulation lib name auto|imagick|gd|convert
protected string $imgLib
return string

$mimeDetect protected_oe property

Mimetype detect method
protected string $mimeDetect
return string

$mimetypes protected_oe static_oe property

default extensions/mimetypes for mimeDetect == 'internal'
protected static array $mimetypes
return array

$mounted protected_oe property

Flag - volume "mounted" and available
protected bool $mounted
return boolean

$netMountKey public_oe property

Net mount key
public string $netMountKey
return string

$onlyMimes protected_oe property

Mimetypes allowed to display
protected array $onlyMimes
return array

$options protected_oe property

Object configuration
protected array $options
return array

$removed protected_oe property

Store files moved or overwrited files info
protected array $removed
return array

$root protected_oe property

Root directory path
protected string $root
return string

$rootModified protected_oe property

Is root modified (for clear root stat cache)
protected bool $rootModified
return boolean

$rootName protected_oe property

Root basename | alias
protected string $rootName
return string

$searchStart protected_oe property

Search start time
protected int $searchStart
return integer

$separator protected_oe property

Directory separator - required by client
protected string $separator
return string

$session protected_oe property

elFinder session wrapper object
protected elFinderSessionInterface $session
return elFinderSessionInterface

$sessionCache protected_oe property

This volume session cache
protected array $sessionCache
return array

$sessionCaching protected_oe property

Session caching item list
protected array $sessionCaching
return array

$startPath protected_oe property

Default directory to open
protected string $startPath
return string

$subdirsCache protected_oe property

You should use $this->sessionCache['subdirs'] instead
Deprecation:
protected array $subdirsCache
return array

$systemRoot protected_oe property

..)
protected string $systemRoot
return string

$tmbPath protected_oe property

Thumbnails dir path
protected string $tmbPath
return string

$tmbPathWritable protected_oe property

Is thumbnails dir writable
protected bool $tmbPathWritable
return boolean

$tmbSize protected_oe property

Thumbnails size in px
protected int $tmbSize
return integer

$tmbURL protected_oe property

Thumbnails base URL
protected string $tmbURL
return string

$today protected_oe property

Today 24:00 timestamp
protected int $today
return integer

$treeDeep protected_oe property

How many subdirs levels return for tree
protected int $treeDeep
return integer

$uploadAllow protected_oe property

Mime types allowed to upload
protected array $uploadAllow
return array

$uploadDeny protected_oe property

Mime types denied to upload
protected array $uploadDeny
return array

$uploadMaxSize protected_oe property

Set as number or string with unit - "10M", "500K", "1G"
protected int|string $uploadMaxSize
return integer | string

$uploadOrder protected_oe property

Order to validate uploadAllow and uploadDeny
protected array $uploadOrder
return array

$yesterday protected_oe property

Yesterday 24:00 timestamp
protected int $yesterday
return integer