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
Afficher le fichier Open project: studio-42/elfinder Class Usage Examples

Méthodes publiques

Свойство Type Description
$netMountKey string Net mount key

Protected Properties

Свойство 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

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode 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 méthode

Destracter
public __destruct ( )

_abspath() abstract protected méthode

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

_archive() abstract protected méthode

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
Résultat string | boolean

_basename() abstract protected méthode

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

_checkArchivers() abstract protected méthode

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

_chmod() abstract protected méthode

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'
Résultat boolean

_copy() abstract protected méthode

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
Résultat boolean | string

_dimensions() abstract protected méthode

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

_dirname() abstract protected méthode

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

_extract() abstract protected méthode

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
Résultat boolean

_fclose() abstract protected méthode

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

_filePutContents() abstract protected méthode

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
Résultat boolean

_fopen() abstract protected méthode

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
Résultat resource | false

_getContents() abstract protected méthode

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

_inpath() abstract protected méthode

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
Résultat boolean

_joinPath() abstract protected méthode

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
Résultat string

_mkdir() abstract protected méthode

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
Résultat string | boolean

_mkfile() abstract protected méthode

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
Résultat string | boolean

_move() abstract protected méthode

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
Résultat boolean | string

_normpath() abstract protected méthode

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

_path() abstract protected méthode

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

_relpath() abstract protected méthode

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

_rmdir() abstract protected méthode

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

_save() abstract protected méthode

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)
Résultat boolean | string

_scandir() abstract protected méthode

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

_stat() abstract protected méthode

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
Résultat array | false

_subdirs() abstract protected méthode

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
Résultat boolean

abspathCE() protected méthode

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
Résultat string

added() public méthode

Return list of added files
Deprecation:
Author: Naoki Sawada
public added ( ) : array
Résultat array

allowCreate() protected méthode

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
Résultat boolean

allowPutMime() protected méthode

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

archive() public méthode

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

attr() protected méthode

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)
Résultat boolean

basenameCE() protected méthode

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

cacheDir() protected méthode

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

canCreateTmb() protected méthode

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
Résultat string | boolean

canResize() protected méthode

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
Résultat string | boolean

childsByAttr() protected méthode

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
Résultat string | false

chmod() public méthode

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
Résultat array | false

clearcache() protected méthode

Clean cache
Author: Dmitry (dio) Levashov
protected clearcache ( ) : void
Résultat void

clearcaches() public méthode

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

clearstatcache() public méthode

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

close() public méthode

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

closest() public méthode

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
Résultat string | false

closestByAttr() protected méthode

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
Résultat string | false

commandDisabled() public méthode

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

configure() protected méthode

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

convEnc() protected méthode

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
Résultat mixed

convEncIn() public méthode

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
Résultat mixed

convEncOut() public méthode

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
Résultat mixed

copy() protected méthode

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)
Résultat string | false

copyFrom() protected méthode

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
Résultat string | false

copyFromAllowed() public méthode

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

countSize() protected méthode

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

createTmb() protected méthode

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
Résultat false | string

crypt() protected méthode

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

debug() public méthode

Return debug info for client
Author: Dmitry (dio) Levashov
public debug ( ) : array
Résultat array

decode() protected méthode

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

defaultPath() public méthode

Return root or startPath hash
Author: Dmitry (dio) Levashov
public defaultPath ( ) : string
Résultat string

delTree() protected méthode

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

dimensions() public méthode

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

dir() public méthode

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

dirnameCE() protected méthode

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

doSearch() protected méthode

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
Résultat array

driverId() public méthode

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

duplicate() public méthode

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
Résultat array | false

encode() protected méthode

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

error() public méthode

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

extract() public méthode

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
Résultat array | boolean

fcloseCE() protected méthode

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

ffmpegToImg() public méthode

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

file() public méthode

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

fopenCE() protected méthode

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
Résultat false | resource

fstat() public méthode

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
Résultat array

gdImage() protected méthode

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)
Résultat boolean

gdImageBackground() protected méthode

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 méthode

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

getArchivers() protected méthode

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

getContentUrl() public méthode

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
Résultat boolean | string

getContents() public méthode

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

getExtentionByMime() public méthode

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
Résultat string

getFullPath() protected méthode

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

getHash() public méthode

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

getImageSize() public méthode

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
Résultat array | false

getItemsInHand() protected méthode

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)
Résultat string | false saved path name

getMimeTable() public méthode

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

getOption() public méthode

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

getOptionsPlugin() public méthode

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

getPath() public méthode

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
Résultat string

getRootStatExtra() protected méthode

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

getScandir() protected méthode

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
Résultat array

getTempFile() protected méthode

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
Résultat string | false

getTempPath() public méthode

Return temp path
Author: Naoki Sawada
public getTempPath ( ) : string
Résultat string

getUploadMaxSize() public méthode

Return this uploadMaxSize value
Author: Naoki Sawada
public getUploadMaxSize ( ) : integer
Résultat integer

getUploadTaget() public méthode

(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
Résultat boolean | string

getWorkFile() protected méthode

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
Résultat string

gettmb() protected méthode

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
Résultat string | false

gettree() protected méthode

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
Résultat array

id() public méthode

Return volume id
Author: Dmitry (dio) Levashov
public id ( ) : string
Résultat string

imageMagickConvertPrepare() protected méthode

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
Résultat array

imageUtil() public méthode

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
Résultat boolean

imagickImage() protected méthode

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)
Résultat boolean

imgCrop() protected méthode

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)
Résultat string | false

imgResize() protected méthode

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
Résultat string | false

imgRotate() protected méthode

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)
Résultat string | false

imgSquareFit() protected méthode

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)
Résultat false | string

init() protected méthode

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

inpathCE() protected méthode

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
Résultat boolean

isMyReload() protected méthode

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

isNameExists() protected méthode

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
Résultat array

isReadable() public méthode

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

isSameType() protected méthode

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
Résultat boolean

isUploadableByName() public méthode

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

joinPathCE() protected méthode

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
Résultat string

localScandir() protected static méthode

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

ls() public méthode

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

makeArchive() protected méthode

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
Résultat string | boolean

mimeAccepted() public méthode

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
Résultat boolean | null

mimetype() protected méthode

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

mimetypeInternalDetect() protected static méthode

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
Résultat string

mkdir() public méthode

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
Résultat array | false

mkfile() public méthode

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
Résultat array | false

mount() public méthode

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
Résultat boolean

move() protected méthode

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
Résultat string | false

nameAccepted() protected méthode

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

normpathCE() protected méthode

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

open() public méthode

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

options() public méthode

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

parents() public méthode

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
Résultat array

paste() public méthode

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
Résultat array | false

path() public méthode

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

procExec() protected méthode

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
Résultat integer exit code

putContents() public méthode

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
Résultat array

realpath() public méthode

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

relpathCE() protected méthode

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

remove() protected méthode

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
Résultat boolean

removed() public méthode

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

rename() public méthode

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
Résultat array | false

resetRemoved() public méthode

Clean removed files list
Author: Dmitry (dio) Levashov
public resetRemoved ( ) : void
Résultat void

resetResultStat() public méthode

Clean added/removed files list
public resetResultStat ( ) : void
Résultat void

resize() public méthode

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)
Résultat array | false

rm() public méthode

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

rmTmb() protected méthode

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
Résultat void

rmdirRecursive() public méthode

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

root() public méthode

Return root folder hash
Author: Dmitry (dio) Levashov
public root ( ) : string
Résultat string

saveCE() protected méthode

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)
Résultat boolean | string

scandir() public méthode

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

scandirCE() protected méthode

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

sessionRestart() protected méthode

Deprecation:
protected sessionRestart ( )

setError() protected méthode

Save error message
Author: Dmitry(dio) Levashov
protected setError ( $error ) : false
Résultat false

setMimesFilter() public méthode

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

setSession() public méthode

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

size() public méthode

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

stat() protected méthode

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

stripos() protected méthode

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.
Résultat integer | boolean

subdirsCE() protected méthode

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
Résultat boolean

symlinkCE() protected méthode

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
Résultat boolean

tmb() public méthode

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

tmbname() protected méthode

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

tree() public méthode

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
Résultat array | false

umount() public méthode

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

uncrypt() protected méthode

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

uniqueName() public méthode

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
Résultat string

unpackArchive() protected méthode

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) )
Résultat void

updateCache() protected méthode

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
Résultat array

upload() public méthode

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
Résultat array | false

zipArchiveUnzip() protected static méthode

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
Résultat boolean

zipArchiveZip() protected static méthode

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
Résultat boolean

zipdl() public méthode

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

Property Details

$ARGS protected_oe property

Request args $_POST or $_GET values
protected array $ARGS
Résultat array

$URL protected_oe property

Base URL
protected string $URL
Résultat string

$access protected_oe property

Access control function/class
protected mixed $access
Résultat mixed

$added protected_oe property

Store files added files info
protected array $added
Résultat array

$archivers protected_oe property

Archivers config
protected array $archivers
Résultat array

$attributes protected_oe property

Access control function/class
protected mixed $attributes
Résultat mixed

$cache protected_oe property

Cache storage
protected array $cache
Résultat array

$cryptLib protected_oe property

Library to crypt files name
protected string $cryptLib
Résultat string

$defaults protected_oe property

Defaults permissions
protected array $defaults
Résultat array

$dirsCache protected_oe property

Cache by folders
protected array $dirsCache
Résultat array

$disabled protected_oe property

List of disabled client's commands
protected array $disabled
Résultat array

$doSearchCurrentQuery protected_oe property

Current query word on doSearch
protected string $doSearchCurrentQuery
Résultat 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
Résultat string

$encoding protected_oe property

Server character encoding
protected $encoding

$error protected_oe property

Errors from last failed action
protected array $error
Résultat array

$extractToNewdir protected_oe property

Force make dirctory on extract
protected int $extractToNewdir
Résultat integer

$finfo protected_oe property

Finfo object for mimeDetect == 'finfo'
protected object $finfo
Résultat object

$id protected_oe property

Volume id - used as prefix for files hashes
protected string $id
Résultat string

$imgConverter protected_oe property

Video to Image converter
protected array $imgConverter
Résultat array

$imgLib protected_oe property

Image manipulation lib name auto|imagick|gd|convert
protected string $imgLib
Résultat string

$mimeDetect protected_oe property

Mimetype detect method
protected string $mimeDetect
Résultat string

$mimetypes protected_oe static_oe property

default extensions/mimetypes for mimeDetect == 'internal'
protected static array $mimetypes
Résultat array

$mounted protected_oe property

Flag - volume "mounted" and available
protected bool $mounted
Résultat boolean

$netMountKey public_oe property

Net mount key
public string $netMountKey
Résultat string

$onlyMimes protected_oe property

Mimetypes allowed to display
protected array $onlyMimes
Résultat array

$options protected_oe property

Object configuration
protected array $options
Résultat array

$removed protected_oe property

Store files moved or overwrited files info
protected array $removed
Résultat array

$root protected_oe property

Root directory path
protected string $root
Résultat string

$rootModified protected_oe property

Is root modified (for clear root stat cache)
protected bool $rootModified
Résultat boolean

$rootName protected_oe property

Root basename | alias
protected string $rootName
Résultat string

$searchStart protected_oe property

Search start time
protected int $searchStart
Résultat integer

$separator protected_oe property

Directory separator - required by client
protected string $separator
Résultat string

$session protected_oe property

elFinder session wrapper object
protected elFinderSessionInterface $session
Résultat elFinderSessionInterface

$sessionCache protected_oe property

This volume session cache
protected array $sessionCache
Résultat array

$sessionCaching protected_oe property

Session caching item list
protected array $sessionCaching
Résultat array

$startPath protected_oe property

Default directory to open
protected string $startPath
Résultat string

$subdirsCache protected_oe property

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

$systemRoot protected_oe property

..)
protected string $systemRoot
Résultat string

$tmbPath protected_oe property

Thumbnails dir path
protected string $tmbPath
Résultat string

$tmbPathWritable protected_oe property

Is thumbnails dir writable
protected bool $tmbPathWritable
Résultat boolean

$tmbSize protected_oe property

Thumbnails size in px
protected int $tmbSize
Résultat integer

$tmbURL protected_oe property

Thumbnails base URL
protected string $tmbURL
Résultat string

$today protected_oe property

Today 24:00 timestamp
protected int $today
Résultat integer

$treeDeep protected_oe property

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

$uploadAllow protected_oe property

Mime types allowed to upload
protected array $uploadAllow
Résultat array

$uploadDeny protected_oe property

Mime types denied to upload
protected array $uploadDeny
Résultat array

$uploadMaxSize protected_oe property

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

$uploadOrder protected_oe property

Order to validate uploadAllow and uploadDeny
protected array $uploadOrder
Résultat array

$yesterday protected_oe property

Yesterday 24:00 timestamp
protected int $yesterday
Résultat integer