elFinderVolumeFTP
extends elFinderVolumeDriver
in package
Simple elFinder driver for FTP
Tags
Table of Contents
Properties
- $netMountKey : string
- Net mount key
- $access : mixed
- Access control function/class
- $added : array<string|int, mixed>
- Store files added files info
- $archivers : array<string|int, mixed>
- Archivers config
- $ARGS : array<string|int, mixed>
- Request args $_POST or $_GET values
- $attributes : mixed
- Access control function/class
- $cache : array<string|int, mixed>
- Cache storage
- $connect : resource
- FTP Connection Instance
- $cryptLib : string
- Library to crypt files name
- $defaults : array<string|int, mixed>
- Defaults permissions
- $dirnameValidator : string
- Accepted dirname validator
- $dirsCache : array<string|int, mixed>
- Cache by folders
- $disabled : array<string|int, mixed>
- List of disabled client's commands
- $disabledGetUrl : string
- Is disable of command `url`
- $doSearchCurrentQuery : array<string|int, mixed>
- 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 : string
- Server character encoding
- $error : array<string|int, mixed>
- Errors from last failed action
- $extractToNewdir : int
- Force make dirctory on extract
- $finfo : resource
- Finfo resource for mimeDetect == 'finfo'
- $ftpError : string
- Last FTP error message
- $ftpListOption : string
- FTP LIST command option
- $ftpOsUnix : bool
- FTP server output list as ftp on linux
- $getMaxSize : int|string
- Maximum allowed get file size.
- $id : string
- Volume id - used as prefix for files hashes
- $imgConverter : array<string|int, mixed>
- Video to Image converter
- $imgLib : string
- Image manipulation lib name auto|imagick|gd|convert
- $isFTPS : bool
- Is connected server with FTPS?
- $isPureFtpd : bool
- Is connected server Pure FTPd?
- $maxArcFilesSize : int|string
- Static var of $this->options['maxArcFilesSize']
- $mimeDetect : string
- Mimetype detect method
- $mimetypes : array<string|int, mixed>
- overwrite extensions/mimetypes to mime.types
- $mounted : bool
- Flag - volume "mounted" and available
- $nameValidator : string
- Accepted filename validator
- $needOnline : bool
- This request require online state
- $onlyMimes : array<string|int, mixed>
- Mimetypes allowed to display
- $options : array<string|int, mixed>
- Object configuration
- $removed : array<string|int, mixed>
- Store files moved or overwrited files info
- $root : string
- Root directory path
- $rootModified : bool
- Is root modified (for clear root stat cache)
- $rootName : string
- Root basename | alias
- $searchStart : int
- Search start time
- $separator : string
- Directory separator - required by client
- $separatorForHash : string
- Directory separator for decode/encode hash
- $session : elFinderSessionInterface
- elFinder session wrapper object
- $sessionCache : array<string|int, mixed>
- This volume session cache
- $sessionCaching : array<string|int, mixed>
- Session caching item list
- $startPath : string
- Default directory to open
- $subdirsCache : array<string|int, mixed>
- You should use `$this->sessionCache['subdirs']` instead
- $systemRoot : string
- System Root path (Unix like: '/', Windows: '\', 'C:\' or 'D:\'...)
- $tmbPath : string
- Thumbnails dir path
- $tmbPathWritable : bool
- Is thumbnails dir writable
- $tmbSize : int
- Thumbnails size in px
- $tmbURL : string
- Thumbnails base URL
- $tmp : string
- Tmp folder path
- $tmpLinkPath : string
- A file save destination path when a temporary content URL is required on a network volume or the like If not specified, it tries to use "Connector Path/../files/.tmb".
- $tmpLinkUrl : string
- A file save destination URL when a temporary content URL is required on a network volume or the like If not specified, it tries to use "Connector URL/../files/.tmb".
- $tmpPath : string
- Directory for tmp files If not set driver will try to use tmbDir as tmpDir
- $today : int
- Today 24:00 timestamp
- $treeDeep : int
- How many subdirs levels return for tree
- $uploadAllow : array<string|int, mixed>
- Mime types allowed to upload
- $uploadDeny : array<string|int, mixed>
- Mime types denied to upload
- $uploadMaxSize : int|string
- Maximum allowed upload file size.
- $uploadOrder : array<string|int, mixed>
- Order to validate uploadAllow and uploadDeny
- $uploadOverwrite : string
- Run time setting of overwrite items on upload
- $URL : string
- Base URL
- $yesterday : int
- Yesterday 24:00 timestamp
- $cacheDirTarget : string
- Calling cacheDir() target path with non-MLST
- $mimetypesLoaded : bool
- Flag - mimetypes from externail file was loaded
- $MLSTsupprt : bool
- FTP command `MLST` support
Methods
- __construct() : mixed
- Constructor Extend options with required fields
- added() : array<string|int, mixed>
- Return list of added files
- archive() : array<string|int, mixed>|bool
- Add files to archive
- chmod() : array<string|int, mixed>|false
- chmod a file or folder
- clearcaches() : mixed
- Clear inner stat caches for target hash
- clearSessionCache() : mixed
- Remove session cache of this volume
- clearstatcache() : mixed
- Clear PHP stat cache & all of inner stat caches
- close() : void
- Close file pointer
- closest() : string|false
- Return file/dir hash or first founded child hash with required attr == $val
- commandDisabled() : bool
- Return true if command disabled in options
- convEncIn() : mixed
- Converts character encoding from UTF-8 to server's one
- convEncOut() : mixed
- Converts character encoding from server's one to UTF-8
- copyFromAllowed() : bool
- Return true if copy from this volume allowed
- debug() : array<string|int, mixed>
- Return debug info for client
- defaultPath() : string
- Return root or startPath hash
- dimensions() : array<string|int, mixed>|string
- Return image dimensions
- driverId() : string
- Return driver id. Used as a part of volume id.
- duplicate() : array<string|int, mixed>|false
- Create file copy with suffix "copy number" and return its info
- error() : array<string|int, mixed>
- Return error message from last failed action
- extract() : array<string|int, mixed>|bool
- Extract files from archive
- ffmpegToImg() : bool
- Convert Video To Image by ffmpeg
- fstat() : array<string|int, mixed>
- stat a file or folder for elFinder cmd exec
- getContents() : string|false
- Return file contents
- getContentUrl() : bool|string
- Return content URL (for netmout volume driver) If file.url == 1 requests from JavaScript client with XHR
- getExtentionByMime() : string
- Return file extention detected by MIME type
- getHash() : string
- Return target path hash
- getImageSize() : array<string|int, mixed>|false
- Get image size array with `dimensions`
- getMimeTable() : array<string|int, mixed>
- Return Extention/MIME Table (elFinderVolumeDriver::$mimetypes)
- getOption() : null|mixed
- Get option value of this volume
- getOptionsPlugin() : null|array<string|int, mixed>
- Get plugin values of this options
- getPath() : 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
- getRootPath() : string
- Return root path
- getSession() : object
- Get elFinder sesson wrapper object
- getSubstituteImgLink() : bool
- Get URL of substitute image by request args `substitute` or 4th argument $maxSize
- getTempLinkInfo() : bool|array<string|int, mixed>
- Get temporary contents link infomation
- getTempPath() : string
- Return temp path
- getUploadMaxSize() : int
- Return this uploadMaxSize value
- getUploadTaget() : bool|string
- (Make &) Get upload taget dirctory hash
- id() : string
- Return volume id
- imageUtil() : bool
- Image file utility
- isReadable() : bool
- Return true if voume is readable.
- isUploadableByName() : bool
- Return is uploadable that given file name
- ls() : array<string|int, mixed>|false
- Return dir files names list
- mimeAccepted() : bool|null
- Return true if mime is required mimes list
- mimeTypeNormalize() : string
- Normalize MIME-Type by options['mimeMap']
- mkdir() : array<string|int, mixed>|false
- Create directory and return dir info
- mkfile() : array<string|int, mixed>|false
- Create empty file and return its info
- mount() : bool
- "Mount" volume.
- netmountPrepare() : void
- netmountPrepare() : array<string|int, mixed>
- Prepare Call from elFinder::netmout() before volume->mount()
- open() : resource|false
- Open file for reading and return file pointer
- options() : array<string|int, mixed>
- Return volume options required by client:
- parents() : array<string|int, mixed>|false
- Return part of dirs tree from required dir up to root dir
- path() : string
- Return file path related to root with convert encoging
- postNetmount() : void
- putContents() : array<string|int, mixed>|false
- Put content in text file and return file info.
- realpath() : string
- Return file real path if file exists
- removed() : array<string|int, mixed>
- Return list of moved/overwrited files
- rename() : array<string|int, mixed>|false
- Rename file and return file info
- resetRemoved() : void
- Clean removed files list
- resetResultStat() : void
- Clean added/removed files list
- resize() : array<string|int, mixed>|false
- Resize image
- rm() : bool
- Remove file/dir
- rmdirRecursive() : bool
- Remove directory recursive on local file system
- root() : string
- Return root folder hash
- saveSessionCache() : void
- Save session cache data Calls this function before umount this volume on elFinder::exec()
- scandir() : array<string|int, mixed>|false
- Return directory content or false on error
- search() : array<string|int, mixed>
- Search files
- setMimesFilter() : void
- Set mimetypes allowed to display to client
- setNeedOnline() : mixed
- Sets the need online.
- setSession() : mixed
- Assign elFinder session wrapper object
- setUploadOverwrite() : mixed
- size() : array<string|int, mixed>
- Return file size / total directory size
- subdirs() : bool
- Return has subdirs
- tmb() : false|string
- Create thumbnail for required file and return its name or false on failed
- tmpfile() : resource|bool
- Creates a temporary file and return file pointer
- tree() : array<string|int, mixed>|false
- Return subfolders for required folder or false on error
- umount() : void
- Close opened connection
- zipdl() : array<string|int, mixed>|false
- Return path info array to archive of target items
- _abspath() : string
- Convert path related to root dir into real path
- _archive() : string|bool
- Create archive and return its path
- _basename() : string
- Return file name
- _checkArchivers() : void
- Detect available archivers
- _chmod() : bool
- chmod availability
- _copy() : bool
- Copy file into another file
- _dimensions() : string|false
- Return object width and height Ususaly used for images, but can be realize for video etc.
- _dirname() : string
- Return parent directory path
- _extract() : true
- Extract files from archive
- _fclose() : void
- Close opened file
- _filePutContents() : bool
- Write a string to a file
- _fopen() : resource|false
- Open file and return file pointer
- _getContents() : string|false
- Get file contents
- _inpath() : bool
- Return true if $path is children of $parent
- _joinPath() : string
- Join dir name and file name and retur full path
- _mkdir() : string|bool
- Create dir and return created dir path or false on failed
- _mkfile() : string|bool
- Create file and return it's path or false on failed
- _normpath() : string
- Return normalized path, this works the same as os.path.normpath() in Python
- _path() : string
- Return fake path started from root dir
- _relpath() : string
- Return file path related to root dir
- _rmdir() : bool
- Remove dir
- _save() : bool|string
- Create new file and write into it from file pointer.
- _scandir() : array<string|int, mixed>
- Return files list in directory.
- _stat() : array<string|int, mixed>|false
- Return stat for given path.
- _subdirs() : bool
- Return true if path is dir and has at least one childs directory
- _symlink() : bool
- Create symlink. FTP driver does not support symlinks.
- _unlink() : bool
- Remove file
- abspathCE() : string
- Convert path related to root dir into real path (with convert encoding)
- addError() : false
- Add error message
- allowCreate() : bool
- Return true if file with given name can be created in given folder.
- allowPutMime() : bool
- Return true if file MIME type can save with check uploadOrder config.
- attr() : bool
- Check file attribute
- basenameCE() : string
- Return file name (with convert encoding)
- cacheDir() : void
- Cache dir contents
- canCreateTmb() : string|bool
- Return true if thumnbnail for required file can be created
- canResize() : string|bool
- Return true if required file can be resized.
- checkExtractItems() : array<string|int, mixed>
- Check and filter the extracted items
- childsByAttr() : string|false
- Return first found children with required attr == $val
- clearcache() : void
- Clean cache
- closestByAttr() : 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.
- connect() : bool
- Connect to ftp server
- convEnc() : mixed
- Converts character encoding (base function)
- copy() : string|false
- Copy file/recursive copy dir only in current volume.
- copyFrom() : string|false
- Copy file from another volume.
- countSize() : array<string|int, mixed>
- Return file/total directory size infomation
- crypt() : mixed
- Return crypted path Not implemented
- decode() : string
- Decode path from hash
- delTree() : bool
- Delete dirctory trees
- dirnameCE() : string
- Return parent directory path (with convert encoding)
- doSearch() : array<string|int, mixed>
- Recursive files search
- encode() : string
- Encode path into hash
- fcloseCE() : bool
- Close opened file (with convert encoding)
- ftp_scan_dir() : array<string|int, mixed>
- Gets an array of absolute remote FTP paths of files and folders in $remote_directory omitting symbolic links.
- ftpMode() : string
- Return ftp transfer mode for file
- ftpRawList() : array<string|int, mixed>
- Call ftp_rawlist with option prefix
- gdImage() : bool
- Output gd image to file
- gdImageBackground() : mixed
- Assign the proper background to a gd image
- gdImageCreate() : resource|false
- Create an gd image according to the specified mime type
- getArchivers() : array<string|int, mixed>
- Get server side available archivers
- getFullPath() : string
- Resolve relative / (Unix-like)absolute path
- getItemsInHand() : string|false
- Copy items to a new temporary directory on the local server
- getRootstatCachekey() : string
- Return session rootstat cache key
- getRootStatExtra() : array<string|int, mixed>
- Get root stat extra key values
- getScandir() : array<string|int, mixed>
- Return required dir's files info.
- getTempFile() : string|false
- Get temporary filename. Tempfile will be removed when after script execution finishes or exit() is called.
- gettmb() : string|false
- Return thumnbnail name if exists
- gettree() : array<string|int, mixed>
- Return subdirs tree
- getWorkFile() : string
- File path of local server side work file path
- imageMagickConvertPrepare() : array<string|int, mixed>
- Prepare variables for exec convert of ImageMagick
- imagickImage() : bool
- Output imagick image to file
- imgCrop() : string|false
- Crop image
- imgResize() : string|false
- Resize image
- imgRotate() : string|false
- Rotate image
- imgSquareFit() : false|string
- Put image to square
- init() : bool
- Prepare FTP connection Connect to remote server and check if credentials are correct, if so, store the connection id in $ftp_conn
- inpathCE() : bool
- Return true if $path is children of $parent (with convert encoding)
- isMyReload() : mixed
- isNameExists() : array<string|int, mixed>
- Return fileinfo based on filename For item ID based path file system Please override if needed on each drivers
- isSameType() : bool
- Return true if all mimes is directory or files
- joinPathCE() : 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
- loadMimeTypes() : mixed
- Load file of mime.types
- localFindSymlinks() : bool
- Recursive symlinks search
- localMoveRecursive() : bool
- Move item recursive on local file system
- localRmdirRecursive() : bool
- Remove directory recursive on local file system
- localScandir() : array<string|int, mixed>
- Return files of target directory that is dotfiles excludes.
- makeArchive() : string|bool
- Create archive and return its path
- mimetype() : string
- Return file mimetype
- mimetypeInternalDetect() : string
- Detect file mimetype using "internal" method or Loading mime.types with $path = ''
- move() : string|false
- Move file Return new file path or false.
- nameAccepted() : bool
- Validate file name based on $this->options['acceptedName'] regexp or function
- normalizeRawWindows() : array<string|int, mixed>
- Normalize MS-DOS style FTP LIST Raw line
- normpathCE() : string
- Return normalized path (with convert encoding)
- parsePermissions() : array<string|int, mixed>
- Parse permissions string. Return array(read => true/false, write => true/false)
- parseRaw() : array<string|int, mixed>
- Parse line from ftp_rawlist() output and return file stat (array)
- procExec() : int
- Execute shell command
- relpathCE() : string
- Return file path related to root dir (with convert encoding)
- remoteArchive() : string|bool
- Create an archive from remote items
- remove() : bool
- Remove file/ recursive remove dir
- rmTmb() : void
- Remove thumbnail, also remove recursively if stat is directory
- saveCE() : bool|string
- Create new file and write into it from file pointer. (with convert encoding) Return new file path or false on error.
- scandirCE() : array<string|int, mixed>
- Return files list in directory (with convert encoding)
- searchMatchName() : bool
- Default serach match method (name match)
- sessionRestart() : mixed
- setError() : bool
- Save error message
- stat() : array<string|int, mixed>|bool
- Return fileinfo
- stripos() : int|bool
- Find position of first occurrence of string in a string with multibyte support
- subdirsCE() : bool
- Return true if path is dir and has at least one childs directory (with convert encoding)
- symlinkCE() : bool
- Create symlink (with convert encoding)
- tmbname() : string
- Return thumbnail file name for required file
- uncrypt() : mixed
- Return uncrypted path Not implemented
- unpackArchive() : void
- Unpack archive
- updateCache() : array<string|int, mixed>
- Put file stat in cache and return it
- updateSubdirsCache() : void
- Update subdirs cache data
- zipArchiveUnzip() : bool
- Unpack Zip archive using PHP class ZipArchive
- zipArchiveZip() : bool
- Create Zip archive using PHP class ZipArchive
- deleteDir() : bool
- Delete local directory recursively.
- ftp_download_files() : bool
- Downloads specified files from remote directory if there is a directory among files it is downloaded recursively (omitting symbolic links).
- tempDir() : string
- Create writable temporary directory and return path to it.
Properties
$netMountKey
Net mount key
public
string
$netMountKey
= ''
$access
Access control function/class
protected
mixed
$access
= \null
$added
Store files added files info
protected
array<string|int, mixed>
$added
= array()
$archivers
Archivers config
protected
array<string|int, mixed>
$archivers
= array('create' => array(), 'extract' => array())
$ARGS
Request args $_POST or $_GET values
protected
array<string|int, mixed>
$ARGS
= array()
$attributes
Access control function/class
protected
mixed
$attributes
= array()
$cache
Cache storage
protected
array<string|int, mixed>
$cache
= array()
$connect
FTP Connection Instance
protected
resource
$connect
= \null
a FTP stream
$cryptLib
Library to crypt files name
protected
string
$cryptLib
= ''
$defaults
Defaults permissions
protected
array<string|int, mixed>
$defaults
= array('read' => \true, 'write' => \true, 'locked' => \false, 'hidden' => \false)
$dirnameValidator
Accepted dirname validator
protected
string
$dirnameValidator
| callable
$dirsCache
Cache by folders
protected
array<string|int, mixed>
$dirsCache
= array()
$disabled
List of disabled client's commands
protected
array<string|int, mixed>
$disabled
= array()
$disabledGetUrl
Is disable of command `url`
protected
string
$disabledGetUrl
= \false
$doSearchCurrentQuery
Current query word on doSearch
protected
array<string|int, mixed>
$doSearchCurrentQuery
= array()
$driverId
Driver id Must be started from letter and contains [a-z0-9] Used as part of volume id
protected
string
$driverId
= 'f'
$encoding
Server character encoding
protected
string
$encoding
= \null
or null
$error
Errors from last failed action
protected
array<string|int, mixed>
$error
= array()
$extractToNewdir
Force make dirctory on extract
protected
int
$extractToNewdir
= 'auto'
$finfo
Finfo resource for mimeDetect == 'finfo'
protected
resource
$finfo
= \null
$ftpError
Last FTP error message
protected
string
$ftpError
= ''
$ftpListOption
FTP LIST command option
protected
string
$ftpListOption
= '-al'
$ftpOsUnix
FTP server output list as ftp on linux
protected
bool
$ftpOsUnix
$getMaxSize
Maximum allowed get file size.
protected
int|string
$getMaxSize
= -1
Set as number or string with unit - "10M", "500K", "1G"
$id
Volume id - used as prefix for files hashes
protected
string
$id
= ''
$imgConverter
Video to Image converter
protected
array<string|int, mixed>
$imgConverter
= array()
$imgLib
Image manipulation lib name auto|imagick|gd|convert
protected
string
$imgLib
= 'auto'
$isFTPS
Is connected server with FTPS?
protected
bool
$isFTPS
= \false
$isPureFtpd
Is connected server Pure FTPd?
protected
bool
$isPureFtpd
= \false
$maxArcFilesSize
Static var of $this->options['maxArcFilesSize']
protected
static int|string
$maxArcFilesSize
$mimeDetect
Mimetype detect method
protected
string
$mimeDetect
= 'auto'
$mimetypes
overwrite extensions/mimetypes to mime.types
protected
static array<string|int, mixed>
$mimetypes
= array(
// applications
'exe' => 'application/x-executable',
'jar' => 'application/x-jar',
// archives
'gz' => 'application/x-gzip',
'tgz' => 'application/x-gzip',
'tbz' => 'application/x-bzip2',
'rar' => 'application/x-rar',
// texts
'php' => 'text/x-php',
'js' => 'text/javascript',
'rtfd' => 'application/rtfd',
'py' => 'text/x-python',
'rb' => 'text/x-ruby',
'sh' => 'text/x-shellscript',
'pl' => 'text/x-perl',
'xml' => 'text/xml',
'c' => 'text/x-csrc',
'h' => 'text/x-chdr',
'cpp' => 'text/x-c++src',
'hh' => 'text/x-c++hdr',
'md' => 'text/x-markdown',
'markdown' => 'text/x-markdown',
'yml' => 'text/x-yaml',
// images
'bmp' => 'image/x-ms-bmp',
'tga' => 'image/x-targa',
'xbm' => 'image/xbm',
'pxm' => 'image/pxm',
//audio
'wav' => 'audio/wav',
// video
'dv' => 'video/x-dv',
'wm' => 'video/x-ms-wmv',
'ogm' => 'video/ogg',
'm2ts' => 'video/MP2T',
'mts' => 'video/MP2T',
'ts' => 'video/MP2T',
'm3u8' => 'application/x-mpegURL',
'mpd' => 'application/dash+xml',
)
$mounted
Flag - volume "mounted" and available
protected
bool
$mounted
= \false
$nameValidator
Accepted filename validator
protected
string
$nameValidator
| callable
$needOnline
This request require online state
protected
bool
$needOnline
$onlyMimes
Mimetypes allowed to display
protected
array<string|int, mixed>
$onlyMimes
= array()
$options
Object configuration
protected
array<string|int, mixed>
$options
= array(
// Driver ID (Prefix of volume ID), Normally, the value specified for each volume driver is used.
'driverId' => '',
// Id (Suffix of volume ID), Normally, the number incremented according to the specified number of volumes is used.
'id' => '',
// revision id of root directory that uses for caching control of root stat
'rootRev' => '',
// driver type it uses volume root's CSS class name. e.g. 'group' -> Adds 'elfinder-group' to CSS class name.
'type' => '',
// root directory path
'path' => '',
// Folder hash value on elFinder to be the parent of this volume
'phash' => '',
// Folder hash value on elFinder to trash bin of this volume, it require 'copyJoin' to true
'trashHash' => '',
// open this path on initial request instead of root path
'startPath' => '',
// how many subdirs levels return per request
'treeDeep' => 1,
// root url, not set to URL via the connector. If you want to hide the file URL, do not set this value. (replacement for old "fileURL" option)
'URL' => '',
// enable onetime URL to a file - (true, false, 'auto' (true if a temporary directory is available) or callable (A function that return onetime URL))
'onetimeUrl' => 'auto',
// directory link url to own manager url with folder hash (`true`, `false`, `'hide'`(No show) or default `'auto'`: URL is empty then `true` else `false`)
'dirUrlOwn' => 'auto',
// directory separator. required by client to show paths correctly
'separator' => \DIRECTORY_SEPARATOR,
// Use '/' as directory separator when the path hash encode/decode on the Windows server too
'winHashFix' => \false,
// Server character encoding (default is '': UTF-8)
'encoding' => '',
// for convert character encoding (default is '': Not change locale)
'locale' => '',
// URL of volume icon image
'icon' => '',
// CSS Class of volume root in tree
'rootCssClass' => '',
// Items to disable session caching
'noSessionCache' => array(),
// enable i18n folder name that convert name to elFinderInstance.messages['folder_'+name]
'i18nFolderName' => \false,
// Search timeout (sec)
'searchTimeout' => 30,
// Search exclusion directory regex pattern (require demiliter e.g. '#/path/to/exclude_directory#i')
'searchExDirReg' => '',
// library to crypt/uncrypt files names (not implemented)
'cryptLib' => '',
// how to detect files mimetypes. (auto/internal/finfo/mime_content_type)
'mimeDetect' => 'auto',
// mime.types file path (for mimeDetect==internal)
'mimefile' => '',
// Static extension/MIME of general server side scripts to security issues
'staticMineMap' => array('php:*' => 'text/x-php', 'pht:*' => 'text/x-php', 'php3:*' => 'text/x-php', 'php4:*' => 'text/x-php', 'php5:*' => 'text/x-php', 'php7:*' => 'text/x-php', 'phtml:*' => 'text/x-php', 'phar:*' => 'text/x-php', 'cgi:*' => 'text/x-httpd-cgi', 'pl:*' => 'text/x-perl', 'asp:*' => 'text/x-asap', 'aspx:*' => 'text/x-asap', 'py:*' => 'text/x-python', 'rb:*' => 'text/x-ruby', 'jsp:*' => 'text/x-jsp'),
// mime type normalize map : Array '[ext]:[detected mime type]' => '[normalized mime]'
'mimeMap' => array('md:application/x-genesis-rom' => 'text/x-markdown', 'md:text/plain' => 'text/x-markdown', 'markdown:text/plain' => 'text/x-markdown', 'css:text/x-asm' => 'text/css', 'css:text/plain' => 'text/css', 'csv:text/plain' => 'text/csv', 'java:text/x-c' => 'text/x-java-source', 'json:text/plain' => 'application/json', 'sql:text/plain' => 'text/x-sql', 'rtf:text/rtf' => 'application/rtf', 'rtfd:text/rtfd' => 'application/rtfd', 'ico:image/vnd.microsoft.icon' => 'image/x-icon', 'svg:text/plain' => 'image/svg+xml', 'pxd:application/octet-stream' => 'image/x-pixlr-data', 'dng:image/tiff' => 'image/x-adobe-dng', 'sketch:application/zip' => 'image/x-sketch', 'sketch:application/octet-stream' => 'image/x-sketch', 'xcf:application/octet-stream' => 'image/x-xcf', 'amr:application/octet-stream' => 'audio/amr', 'm4a:video/mp4' => 'audio/mp4', 'oga:application/ogg' => 'audio/ogg', 'ogv:application/ogg' => 'video/ogg', 'zip:application/x-zip' => 'application/zip', 'm3u8:text/plain' => 'application/x-mpegURL', 'mpd:text/plain' => 'application/dash+xml', 'mpd:application/xml' => 'application/dash+xml', '*:application/x-dosexec' => 'application/x-executable', 'doc:application/vnd.ms-office' => 'application/msword', 'xls:application/vnd.ms-office' => 'application/vnd.ms-excel', 'ppt:application/vnd.ms-office' => 'application/vnd.ms-powerpoint', 'yml:text/plain' => 'text/x-yaml', 'ai:application/pdf' => 'application/postscript', 'cgm:text/plain' => 'image/cgm', 'dxf:text/plain' => 'image/vnd.dxf', 'dds:application/octet-stream' => 'image/vnd-ms.dds', 'hpgl:text/plain' => 'application/vnd.hp-hpgl', 'igs:text/plain' => 'model/iges', 'iges:text/plain' => 'model/iges', 'plt:application/octet-stream' => 'application/plt', 'plt:text/plain' => 'application/plt', 'sat:text/plain' => 'application/sat', 'step:text/plain' => 'application/step', 'stp:text/plain' => 'application/step'),
// An option to add MimeMap to the `mimeMap` option
// Array '[ext]:[detected mime type]' => '[normalized mime]'
'additionalMimeMap' => array(),
// MIME-Type of filetype detected as unknown
'mimeTypeUnknown' => 'application/octet-stream',
// MIME regex of send HTTP header "Content-Disposition: inline" or allow preview in quicklook
// '.' is allow inline of all of MIME types
// '$^' is not allow inline of all of MIME types
'dispInlineRegex' => '^(?:(?:video|audio)|image/(?!.+\\+xml)|application/(?:ogg|x-mpegURL|dash\\+xml)|(?:text/plain|application/pdf)$)',
// temporary content URL's base path
'tmpLinkPath' => '',
// temporary content URL's base URL
'tmpLinkUrl' => '',
// directory for thumbnails
'tmbPath' => '.tmb',
// mode to create thumbnails dir
'tmbPathMode' => 0777,
// thumbnails dir URL. Set it if store thumbnails outside root directory
'tmbURL' => '',
// thumbnails size (px)
'tmbSize' => 48,
// thumbnails crop (true - crop, false - scale image to fit thumbnail size)
'tmbCrop' => \true,
// thumbnail URL require custom data as the GET query
'tmbReqCustomData' => \false,
// thumbnails background color (hex #rrggbb or 'transparent')
'tmbBgColor' => 'transparent',
// image rotate fallback background color (hex #rrggbb)
'bgColorFb' => '#ffffff',
// image manipulations library (imagick|gd|convert|auto|none, none - Does not check the image library at all.)
'imgLib' => 'auto',
// Fallback self image to thumbnail (nothing imgLib)
'tmbFbSelf' => \true,
// Video to Image converters ['TYPE or MIME' => ['func' => function($file){ /* Converts $file to Image */ return true; }, 'maxlen' => (int)TransferLength]]
'imgConverter' => array(),
// Max length of transfer to image converter
'tmbVideoConvLen' => 10000000,
// Captre point seccond
'tmbVideoConvSec' => 6,
// Life time (hour) for thumbnail garbage collection ("0" means no GC)
'tmbGcMaxlifeHour' => 0,
// Percentage of garbage collection executed for thumbnail creation command ("1" means "1%")
'tmbGcPercentage' => 1,
// Resource path of fallback icon images defailt: php/resouces
'resourcePath' => '',
// Jpeg image saveing quality
'jpgQuality' => 100,
// Save as progressive JPEG on image editing
'jpgProgressive' => \true,
// enable to get substitute image with command `dim`
'substituteImg' => \true,
// on paste file - if true - old file will be replaced with new one, if false new file get name - original_name-number.ext
'copyOverwrite' => \true,
// if true - join new and old directories content on paste
'copyJoin' => \true,
// on upload - if true - old file will be replaced with new one, if false new file get name - original_name-number.ext
'uploadOverwrite' => \true,
// mimetypes allowed to upload
'uploadAllow' => array(),
// mimetypes not allowed to upload
'uploadDeny' => array(),
// order to process uploadAllow and uploadDeny options
'uploadOrder' => array('deny', 'allow'),
// maximum upload file size. NOTE - this is size for every uploaded files
'uploadMaxSize' => 0,
// Maximum number of folders that can be created at one time. (0: unlimited)
'uploadMaxMkdirs' => 0,
// maximum number of chunked upload connection. `-1` to disable chunked upload
'uploadMaxConn' => 3,
// maximum get file size. NOTE - Maximum value is 50% of PHP memory_limit
'getMaxSize' => 0,
// files dates format
'dateFormat' => 'j M Y H:i',
// files time format
'timeFormat' => 'H:i',
// if true - every folder will be check for children folders, -1 - every folder will be check asynchronously, false - all folders will be marked as having subfolders
'checkSubfolders' => \true,
// true, false or -1
// allow to copy from this volume to other ones?
'copyFrom' => \true,
// allow to copy from other volumes to this one?
'copyTo' => \true,
// cmd duplicate suffix format e.g. '_%s_' to without spaces
'duplicateSuffix' => ' %s ',
// unique name numbar format e.g. '(%d)' to (1), (2)...
'uniqueNumFormat' => '%d',
// list of commands disabled on this root
'disabled' => array(),
// enable file owner, group & mode info, `false` to inactivate "chmod" command.
'statOwner' => \false,
// allow exec chmod of read-only files
'allowChmodReadOnly' => \false,
// regexp or function name to validate new file name
'acceptedName' => '/^[^\\.].*/',
// Notice: overwritten it in some volume drivers contractor
// regexp or function name to validate new directory name
'acceptedDirname' => '',
// used `acceptedName` if empty value
// function/class method to control files permissions
'accessControl' => \null,
// some data required by access control
'accessControlData' => \null,
// root stat that return without asking the system when mounted and not the current volume. Query to the system with false. array|false
'rapidRootStat' => array(
'read' => \true,
'write' => \true,
'locked' => \false,
'hidden' => \false,
'size' => 0,
// Unknown
'ts' => 0,
// Unknown
'dirs' => -1,
// Check on demand for subdirectories
'mime' => 'directory',
),
// default permissions.
'defaults' => array('read' => \true, 'write' => \true, 'locked' => \false, 'hidden' => \false),
// files attributes
'attributes' => array(),
// max allowed archive files size (0 - no limit)
'maxArcFilesSize' => '2G',
// Allowed archive's mimetypes to create. Leave empty for all available types.
'archiveMimes' => array(),
// Manual config for archivers. See example below. Leave empty for auto detect
'archivers' => array(),
// Use Archive function for remote volume
'useRemoteArchive' => \false,
// plugin settings
'plugin' => array(),
// Is support parent directory time stamp update on add|remove|rename item
// Default `null` is auto detection that is LocalFileSystem, FTP or Dropbox are `true`
'syncChkAsTs' => \null,
// Long pooling sync checker function for syncChkAsTs is true
// Calls with args (TARGET DIRCTORY PATH, STAND-BY(sec), OLD TIMESTAMP, VOLUME DRIVER INSTANCE, ELFINDER INSTANCE)
// This function must return the following values. Changed: New Timestamp or Same: Old Timestamp or Error: false
// Default `null` is try use elFinderVolumeLocalFileSystem::localFileSystemInotify() on LocalFileSystem driver
// another driver use elFinder stat() checker
'syncCheckFunc' => \null,
// Long polling sync stand-by time (sec)
'plStandby' => 30,
// Sleep time (sec) for elFinder stat() checker (syncChkAsTs is true)
'tsPlSleep' => 10,
// Sleep time (sec) for elFinder ls() checker (syncChkAsTs is false)
'lsPlSleep' => 30,
// Client side sync interval minimum (ms)
// Default `null` is auto set to ('tsPlSleep' or 'lsPlSleep') * 1000
// `0` to disable auto sync
'syncMinMs' => \null,
// required to fix bug on macos
// However, we recommend to use the Normalizer plugin instead this option
'utf8fix' => \false,
// й ё Й Ё Ø Å
'utf8patterns' => array("\\u0438\\u0306", "\\u0435\\u0308", "\\u0418\\u0306", "\\u0415\\u0308", "\\u00d8A", "\\u030a"),
'utf8replace' => array("\\u0439", "\\u0451", "\\u0419", "\\u0401", "\\u00d8", "\\u00c5"),
// cache control HTTP headers for commands `file` and `get`
'cacheHeaders' => array('Cache-Control: max-age=3600', 'Expires:', 'Pragma:'),
// Header to use to accelerate sending local files to clients (e.g. 'X-Sendfile', 'X-Accel-Redirect')
'xsendfile' => '',
// Root path to xsendfile target. Probably, this is required for 'X-Accel-Redirect' on Nginx.
'xsendfilePath' => '',
)
$removed
Store files moved or overwrited files info
protected
array<string|int, mixed>
$removed
= array()
$root
Root directory path
protected
string
$root
= ''
$rootModified
Is root modified (for clear root stat cache)
protected
bool
$rootModified
= \false
$rootName
Root basename | alias
protected
string
$rootName
= ''
$searchStart
Search start time
protected
int
$searchStart
$separator
Directory separator - required by client
protected
string
$separator
= \DIRECTORY_SEPARATOR
$separatorForHash
Directory separator for decode/encode hash
protected
string
$separatorForHash
= ''
$session
elFinder session wrapper object
protected
elFinderSessionInterface
$session
$sessionCache
This volume session cache
protected
array<string|int, mixed>
$sessionCache
$sessionCaching
Session caching item list
protected
array<string|int, mixed>
$sessionCaching
= array('rootstat' => \true, 'subdirs' => \true)
$startPath
Default directory to open
protected
string
$startPath
= ''
$subdirsCache
You should use `$this->sessionCache['subdirs']` instead
protected
array<string|int, mixed>
$subdirsCache
= array()
Tags
$systemRoot
System Root path (Unix like: '/', Windows: '\', 'C:\' or 'D:\'...)
protected
string
$systemRoot
= \DIRECTORY_SEPARATOR
$tmbPath
Thumbnails dir path
protected
string
$tmbPath
= ''
$tmbPathWritable
Is thumbnails dir writable
protected
bool
$tmbPathWritable
= \false
$tmbSize
Thumbnails size in px
protected
int
$tmbSize
= 48
$tmbURL
Thumbnails base URL
protected
string
$tmbURL
= ''
$tmp
Tmp folder path
protected
string
$tmp
= ''
$tmpLinkPath
A file save destination path when a temporary content URL is required on a network volume or the like If not specified, it tries to use "Connector Path/../files/.tmb".
protected
string
$tmpLinkPath
= ''
$tmpLinkUrl
A file save destination URL when a temporary content URL is required on a network volume or the like If not specified, it tries to use "Connector URL/../files/.tmb".
protected
string
$tmpLinkUrl
= ''
$tmpPath
Directory for tmp files If not set driver will try to use tmbDir as tmpDir
protected
string
$tmpPath
= ''
$today
Today 24:00 timestamp
protected
int
$today
= 0
$treeDeep
How many subdirs levels return for tree
protected
int
$treeDeep
= 1
$uploadAllow
Mime types allowed to upload
protected
array<string|int, mixed>
$uploadAllow
= array()
$uploadDeny
Mime types denied to upload
protected
array<string|int, mixed>
$uploadDeny
= array()
$uploadMaxSize
Maximum allowed upload file size.
protected
int|string
$uploadMaxSize
= 0
Set as number or string with unit - "10M", "500K", "1G"
$uploadOrder
Order to validate uploadAllow and uploadDeny
protected
array<string|int, mixed>
$uploadOrder
= array()
$uploadOverwrite
Run time setting of overwrite items on upload
protected
string
$uploadOverwrite
= \true
$URL
Base URL
protected
string
$URL
= ''
$yesterday
Yesterday 24:00 timestamp
protected
int
$yesterday
= 0
$cacheDirTarget
Calling cacheDir() target path with non-MLST
private
string
$cacheDirTarget
= ''
$mimetypesLoaded
Flag - mimetypes from externail file was loaded
private
static bool
$mimetypesLoaded
= \false
$MLSTsupprt
FTP command `MLST` support
private
bool
$MLSTsupprt
= \false
Methods
__construct()
Constructor Extend options with required fields
public
__construct() : mixed
Tags
added()
Return list of added files
public
added() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>archive()
Add files to archive
public
archive( $hashes, $mime[, string $name = '' ]) : array<string|int, mixed>|bool
Parameters
Tags
Return values
array<string|int, mixed>|boolchmod()
chmod a file or folder
public
chmod(string $hash, string $mode) : array<string|int, mixed>|false
Parameters
- $hash : string
-
file or folder hash to chmod
- $mode : string
-
octal string representing new permissions
Tags
Return values
array<string|int, mixed>|falseclearcaches()
Clear inner stat caches for target hash
public
clearcaches([string $hash = null ]) : mixed
Parameters
- $hash : string = null
clearSessionCache()
Remove session cache of this volume
public
clearSessionCache() : mixed
clearstatcache()
Clear PHP stat cache & all of inner stat caches
public
clearstatcache() : mixed
close()
Close file pointer
public
close(resource $fp, string $hash) : void
Parameters
- $fp : resource
-
file pointer
- $hash : string
-
file hash
Tags
closest()
Return file/dir hash or first founded child hash with required attr == $val
public
closest(string $hash, string $attr, bool $val) : string|false
Parameters
- $hash : string
-
file hash
- $attr : string
-
attribute name
- $val : bool
-
attribute value
Tags
Return values
string|falsecommandDisabled()
Return true if command disabled in options
public
commandDisabled(string $cmd) : bool
Parameters
- $cmd : string
-
command name
Tags
Return values
boolconvEncIn()
Converts character encoding from UTF-8 to server's one
public
convEncIn([mixed $var = null ][, bool $restoreLocale = false ][, string $unknown = '_' ]) : mixed
Parameters
- $var : mixed = null
-
target string or array var
- $restoreLocale : bool = false
-
do retore global locale, default is false
- $unknown : string = '_'
-
replaces character for unknown
Tags
convEncOut()
Converts character encoding from server's one to UTF-8
public
convEncOut([mixed $var = null ][, bool $restoreLocale = true ][, string $unknown = '_' ]) : mixed
Parameters
- $var : mixed = null
-
target string or array var
- $restoreLocale : bool = true
-
do retore global locale, default is true
- $unknown : string = '_'
-
replaces character for unknown
Tags
copyFromAllowed()
Return true if copy from this volume allowed
public
copyFromAllowed() : bool
Tags
Return values
booldebug()
Return debug info for client
public
debug() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>defaultPath()
Return root or startPath hash
public
defaultPath() : string
Tags
Return values
stringdimensions()
Return image dimensions
public
dimensions(string $hash) : array<string|int, mixed>|string
Parameters
- $hash : string
-
file hash
Tags
Return values
array<string|int, mixed>|stringdriverId()
Return driver id. Used as a part of volume id.
public
driverId() : string
Tags
Return values
stringduplicate()
Create file copy with suffix "copy number" and return its info
public
duplicate(string $hash[, string $suffix = 'copy' ]) : array<string|int, mixed>|false
Parameters
- $hash : string
-
file hash
- $suffix : string = 'copy'
-
suffix to add to file name
Tags
Return values
array<string|int, mixed>|falseerror()
Return error message from last failed action
public
error() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>extract()
Extract files from archive
public
extract(string $hash[, null $makedir = null ]) : array<string|int, mixed>|bool
Parameters
- $hash : string
-
archive hash
- $makedir : null = null
Tags
Return values
array<string|int, mixed>|boolffmpegToImg()
Convert Video To Image by ffmpeg
public
ffmpegToImg(string $file, array<string|int, mixed> $stat, object $self[, int $ss = null ]) : bool
Parameters
- $file : string
-
video source file path
- $stat : array<string|int, mixed>
-
file stat array
- $self : object
-
volume driver object
- $ss : int = null
-
start seconds
Tags
Return values
boolfstat()
stat a file or folder for elFinder cmd exec
public
fstat(string $hash) : array<string|int, mixed>
Parameters
- $hash : string
-
file or folder hash to chmod
Tags
Return values
array<string|int, mixed>getContents()
Return file contents
public
getContents(string $hash) : string|false
Parameters
- $hash : string
-
file hash
Tags
Return values
string|falsegetContentUrl()
Return content URL (for netmout volume driver) If file.url == 1 requests from JavaScript client with XHR
public
getContentUrl(string $hash[, array<string|int, mixed> $options = array() ]) : bool|string
Parameters
- $hash : string
-
file hash
- $options : array<string|int, mixed> = array()
-
options array
Tags
Return values
bool|stringgetExtentionByMime()
Return file extention detected by MIME type
public
getExtentionByMime(string $mime[, string $suffix = '' ]) : string
Parameters
- $mime : string
-
MIME type
- $suffix : string = ''
-
Additional suffix
Tags
Return values
stringgetHash()
Return target path hash
public
getHash(string $path[, string $name = '' ]) : string
Parameters
- $path : string
- $name : string = ''
Tags
Return values
stringgetImageSize()
Get image size array with `dimensions`
public
getImageSize(string $path[, string $mime = '' ]) : array<string|int, mixed>|false
Parameters
- $path : string
-
path need convert encoding to server encoding
- $mime : string = ''
-
file mime type
Tags
Return values
array<string|int, mixed>|falsegetMimeTable()
Return Extention/MIME Table (elFinderVolumeDriver::$mimetypes)
public
getMimeTable() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>getOption()
Get option value of this volume
public
getOption(string $name) : null|mixed
Parameters
- $name : string
-
target option name
Tags
Return values
null|mixed —target option value
getOptionsPlugin()
Get plugin values of this options
public
getOptionsPlugin([string $name = '' ]) : null|array<string|int, mixed>
Parameters
- $name : string = ''
-
Plugin name
Tags
Return values
null|array<string|int, mixed> —Plugin values
getPath()
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
public
getPath(string $hash) : string
Parameters
- $hash : string
Tags
Return values
stringgetRootPath()
Return root path
public
getRootPath() : string
Tags
Return values
stringgetSession()
Get elFinder sesson wrapper object
public
getSession() : object
Return values
object —The session object
getSubstituteImgLink()
Get URL of substitute image by request args `substitute` or 4th argument $maxSize
public
getSubstituteImgLink(string $target, array<string|int, mixed> $srcSize[, resource $srcfp = null ][, int $maxSize = null ]) : bool
Parameters
- $target : string
-
Target hash
- $srcSize : array<string|int, mixed>
-
Size info array [width, height]
- $srcfp : resource = null
-
Source file file pointer
- $maxSize : int = null
-
Maximum pixel of substitute image
Tags
Return values
boolgetTempLinkInfo()
Get temporary contents link infomation
public
getTempLinkInfo([string $name = null ]) : bool|array<string|int, mixed>
Parameters
- $name : string = null
Tags
Return values
bool|array<string|int, mixed>getTempPath()
Return temp path
public
getTempPath() : string
Tags
Return values
stringgetUploadMaxSize()
Return this uploadMaxSize value
public
getUploadMaxSize() : int
Tags
Return values
intgetUploadTaget()
(Make &) Get upload taget dirctory hash
public
getUploadTaget(string $baseTargetHash, string $path, array<string|int, mixed> &$result) : bool|string
Parameters
- $baseTargetHash : string
- $path : string
- $result : array<string|int, mixed>
Tags
Return values
bool|stringid()
Return volume id
public
id() : string
Tags
Return values
stringimageUtil()
Image file utility
public
imageUtil(string $mode, string $src[, array<string|int, mixed> $options = array() ]) : bool
Parameters
- $mode : string
-
'resize', 'rotate', 'propresize', 'crop', 'fitsquare'
- $src : string
-
Image file local path
- $options : array<string|int, mixed> = array()
-
excute options
Tags
Return values
boolisReadable()
Return true if voume is readable.
public
isReadable() : bool
Tags
Return values
boolisUploadableByName()
Return is uploadable that given file name
public
isUploadableByName(string $name[, bool $allowUnknown = false ]) : bool
Parameters
- $name : string
-
file name
- $allowUnknown : bool = false
Tags
Return values
boolls()
Return dir files names list
public
ls(string $hash[, null $intersect = null ]) : array<string|int, mixed>|false
Parameters
- $hash : string
-
file hash
- $intersect : null = null
Tags
Return values
array<string|int, mixed>|falsemimeAccepted()
Return true if mime is required mimes list
public
mimeAccepted(string $mime[, array<string|int, mixed> $mimes = null ][, bool|null $empty = true ]) : bool|null
Parameters
- $mime : string
-
mime type to check
- $mimes : array<string|int, mixed> = null
-
allowed mime types list or not set to use client mimes list
- $empty : bool|null = true
-
what to return on empty list
Tags
Return values
bool|nullmimeTypeNormalize()
Normalize MIME-Type by options['mimeMap']
public
mimeTypeNormalize(string $type, string $name[, string $ext = '' ]) : string
Parameters
- $type : string
-
MIME-Type
- $name : string
-
Filename
- $ext : string = ''
-
File extention without first dot (optional)
Return values
string —Normalized MIME-Type
mkdir()
Create directory and return dir info
public
mkdir(string $dsthash, string $name) : array<string|int, mixed>|false
Parameters
- $dsthash : string
-
destination directory hash
- $name : string
-
directory name
Tags
Return values
array<string|int, mixed>|falsemkfile()
Create empty file and return its info
public
mkfile(string $dst, string $name) : array<string|int, mixed>|false
Parameters
- $dst : string
-
destination directory
- $name : string
-
file name
Tags
Return values
array<string|int, mixed>|falsemount()
"Mount" volume.
public
mount(array<string|int, mixed> $opts) : bool
Return true if volume available for read or write, false - otherwise
Parameters
- $opts : array<string|int, mixed>
Tags
Return values
boolnetmountPrepare()
public
netmountPrepare(array<string|int, mixed> $options) : void
Parameters
- $options : array<string|int, mixed>
netmountPrepare()
Prepare Call from elFinder::netmout() before volume->mount()
public
netmountPrepare( $options) : array<string|int, mixed>
Parameters
Tags
Return values
array<string|int, mixed> —volume root options
open()
Open file for reading and return file pointer
public
open(mixed $hash) : resource|false
Parameters
- $hash : mixed
Tags
Return values
resource|falseoptions()
Return volume options required by client:
public
options( $hash) : array<string|int, mixed>
Parameters
Tags
Return values
array<string|int, mixed>parents()
Return part of dirs tree from required dir up to root dir
public
parents(string $hash[, bool|null $lineal = false ]) : array<string|int, mixed>|false
Parameters
- $hash : string
-
directory hash
- $lineal : bool|null = false
-
only lineal parents
Tags
Return values
array<string|int, mixed>|falsepath()
Return file path related to root with convert encoging
public
path(string $hash) : string
Parameters
- $hash : string
-
file hash
Tags
Return values
stringpostNetmount()
public
postNetmount(array<string|int, mixed> $options) : void
Parameters
- $options : array<string|int, mixed>
putContents()
Put content in text file and return file info.
public
putContents(string $hash, string $content) : array<string|int, mixed>|false
Parameters
- $hash : string
-
file hash
- $content : string
-
new file content
Tags
Return values
array<string|int, mixed>|falserealpath()
Return file real path if file exists
public
realpath(string $hash) : string
Parameters
- $hash : string
-
file hash
Tags
Return values
string —| false
removed()
Return list of moved/overwrited files
public
removed() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>rename()
Rename file and return file info
public
rename(string $hash, string $name) : array<string|int, mixed>|false
Parameters
- $hash : string
-
file hash
- $name : string
-
new file name
Tags
Return values
array<string|int, mixed>|falseresetRemoved()
Clean removed files list
public
resetRemoved() : void
Tags
resetResultStat()
Clean added/removed files list
public
resetResultStat() : void
resize()
Resize image
public
resize(string $hash, int $width, int $height, int $x, int $y[, string $mode = 'resize' ][, string $bg = '' ][, int $degree = 0 ][, int $jpgQuality = null ]) : array<string|int, mixed>|false
Parameters
- $hash : string
-
image file
- $width : int
-
new width
- $height : int
-
new height
- $x : int
-
X start poistion for crop
- $y : int
-
Y start poistion for crop
- $mode : string = 'resize'
-
action how to mainpulate image
- $bg : string = ''
-
background color
- $degree : int = 0
-
rotete degree
- $jpgQuality : int = null
-
JEPG quality (1-100)
Tags
Return values
array<string|int, mixed>|falserm()
Remove file/dir
public
rm(string $hash) : bool
Parameters
- $hash : string
-
file hash
Tags
Return values
boolrmdirRecursive()
Remove directory recursive on local file system
public
rmdirRecursive(string $dir) : bool
Parameters
- $dir : string
-
Target dirctory path
Tags
Return values
boolroot()
Return root folder hash
public
root() : string
Tags
Return values
stringsaveSessionCache()
Save session cache data Calls this function before umount this volume on elFinder::exec()
public
saveSessionCache() : void
scandir()
Return directory content or false on error
public
scandir(string $hash) : array<string|int, mixed>|false
Parameters
- $hash : string
-
file hash
Tags
Return values
array<string|int, mixed>|falsesearch()
Search files
public
search(string $q, array<string|int, mixed> $mimes[, null $hash = null ]) : array<string|int, mixed>
Parameters
- $q : string
-
search string
- $mimes : array<string|int, mixed>
- $hash : null = null
Tags
Return values
array<string|int, mixed>setMimesFilter()
Set mimetypes allowed to display to client
public
setMimesFilter(array<string|int, mixed> $mimes) : void
Parameters
- $mimes : array<string|int, mixed>
Tags
setNeedOnline()
Sets the need online.
public
setNeedOnline([bool $state = null ]) : mixed
Parameters
- $state : bool = null
-
The state
setSession()
Assign elFinder session wrapper object
public
setSession( $session) : mixed
Parameters
setUploadOverwrite()
public
setUploadOverwrite(mixed $var) : mixed
Parameters
- $var : mixed
size()
Return file size / total directory size
public
size(mixed $hash) : array<string|int, mixed>
Parameters
- $hash : mixed
Tags
Return values
array<string|int, mixed>subdirs()
Return has subdirs
public
subdirs(string $hash) : bool
Parameters
- $hash : string
-
file hash
Tags
Return values
booltmb()
Create thumbnail for required file and return its name or false on failed
public
tmb( $hash) : false|string
Parameters
Tags
Return values
false|stringtmpfile()
Creates a temporary file and return file pointer
public
tmpfile() : resource|bool
Return values
resource|booltree()
Return subfolders for required folder or false on error
public
tree([string $hash = '' ][, int $deep = 0 ][, string $exclude = '' ]) : array<string|int, mixed>|false
Parameters
- $hash : string = ''
-
folder hash or empty string to get tree from root folder
- $deep : int = 0
-
subdir deep
- $exclude : string = ''
-
dir hash which subfolders must be exluded from result, required to not get stat twice on cwd subfolders
Tags
Return values
array<string|int, mixed>|falseumount()
Close opened connection
public
umount() : void
Tags
zipdl()
Return path info array to archive of target items
public
zipdl(array<string|int, mixed> $hashes) : array<string|int, mixed>|false
Parameters
- $hashes : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>|false_abspath()
Convert path related to root dir into real path
protected
_abspath(string $path) : string
Parameters
- $path : string
-
file path
Tags
Return values
string_archive()
Create archive and return its path
protected
_archive(string $dir, array<string|int, mixed> $files, string $name, array<string|int, mixed> $arc) : string|bool
Parameters
- $dir : string
-
target dir
- $files : array<string|int, mixed>
-
files names list
- $name : string
-
archive name
- $arc : array<string|int, mixed>
-
archiver options
Tags
Return values
string|bool_basename()
Return file name
protected
_basename(string $path) : string
Parameters
- $path : string
-
file path
Tags
Return values
string_checkArchivers()
Detect available archivers
protected
_checkArchivers() : void
Tags
_chmod()
chmod availability
protected
_chmod(string $path, string $mode) : bool
Parameters
- $path : string
- $mode : string
Return values
bool_copy()
Copy file into another file
protected
_copy(string $source, string $targetDir, string $name) : bool
Parameters
- $source : string
-
source file path
- $targetDir : string
-
target directory path
- $name : string
-
new file name
Tags
Return values
bool_dimensions()
Return object width and height Ususaly used for images, but can be realize for video etc.
protected
_dimensions(string $path, string $mime) : string|false
..
Parameters
- $path : string
-
file path
- $mime : string
-
file mime type
Tags
Return values
string|false_dirname()
Return parent directory path
protected
_dirname(string $path) : string
Parameters
- $path : string
-
file path
Tags
Return values
string_extract()
Extract files from archive
protected
_extract(string $path, array<string|int, mixed> $arc) : true
Parameters
- $path : string
-
archive path
- $arc : array<string|int, mixed>
-
archiver command and arguments (same as in $this->archivers)
Tags
Return values
true_fclose()
Close opened file
protected
_fclose(resource $fp[, string $path = '' ]) : void
Parameters
- $fp : resource
-
file pointer
- $path : string = ''
Tags
_filePutContents()
Write a string to a file
protected
_filePutContents(string $path, string $content) : bool
Parameters
- $path : string
-
file path
- $content : string
-
new file content
Tags
Return values
bool_fopen()
Open file and return file pointer
protected
abstract _fopen(string $path[, string $mode = "rb" ]) : resource|false
Parameters
- $path : string
-
file path
- $mode : string = "rb"
-
open mode
Tags
Return values
resource|false_getContents()
Get file contents
protected
_getContents(string $path) : string|false
Parameters
- $path : string
-
file path
Tags
Return values
string|false_inpath()
Return true if $path is children of $parent
protected
_inpath(string $path, string $parent) : bool
Parameters
- $path : string
-
path to check
- $parent : string
-
parent path
Tags
Return values
bool_joinPath()
Join dir name and file name and retur full path
protected
_joinPath(string $dir, string $name) : string
Parameters
- $dir : string
- $name : string
Tags
Return values
string_mkdir()
Create dir and return created dir path or false on failed
protected
_mkdir(string $path, string $name) : string|bool
Parameters
- $path : string
-
parent dir path
- $name : string
-
new directory name
Tags
Return values
string|bool_mkfile()
Create file and return it's path or false on failed
protected
_mkfile(string $path, string $name) : string|bool
Parameters
- $path : string
-
parent dir path
- $name : string
-
new file name
Tags
Return values
string|bool_normpath()
Return normalized path, this works the same as os.path.normpath() in Python
protected
_normpath(string $path) : string
Parameters
- $path : string
-
path
Tags
Return values
string_path()
Return fake path started from root dir
protected
_path(string $path) : string
Parameters
- $path : string
-
file path
Tags
Return values
string_relpath()
Return file path related to root dir
protected
_relpath(string $path) : string
Parameters
- $path : string
-
file path
Tags
Return values
string_rmdir()
Remove dir
protected
_rmdir(string $path) : bool
Parameters
- $path : string
-
dir path
Tags
Return values
bool_save()
Create new file and write into it from file pointer.
protected
_save(resource $fp, string $dir, string $name, array<string|int, mixed> $stat) : bool|string
Return new file path or false on error.
Parameters
- $fp : resource
-
file pointer
- $dir : string
-
target dir path
- $name : string
-
file name
- $stat : array<string|int, mixed>
-
file stat (required by some virtual fs)
Tags
Return values
bool|string_scandir()
Return files list in directory.
protected
_scandir(string $path) : array<string|int, mixed>
Parameters
- $path : string
-
dir path
Tags
Return values
array<string|int, mixed>_stat()
Return stat for given path.
protected
_stat(string $path) : array<string|int, mixed>|false
Stat contains following fields:
- (int) size file size in b. required
- (int) ts file modification time in unix time. required
- (string) mime mimetype. required for folders, others - optionally
- (bool) read read permissions. required
- (bool) write write permissions. required
- (bool) locked is object locked. optionally
- (bool) hidden is object hidden. optionally
- (string) alias for symlinks - link target path relative to root path. optionally
- (string) target for symlinks - link target path. optionally If file does not exists - returns empty array or false.
Parameters
- $path : string
-
file path
Tags
Return values
array<string|int, mixed>|false_subdirs()
Return true if path is dir and has at least one childs directory
protected
_subdirs(string $path) : bool
Parameters
- $path : string
-
dir path
Tags
Return values
bool_symlink()
Create symlink. FTP driver does not support symlinks.
protected
_symlink(string $target, string $path, string $name) : bool
Parameters
- $target : string
-
link target
- $path : string
-
symlink path
- $name : string
Tags
Return values
bool_unlink()
Remove file
protected
_unlink(string $path) : bool
Parameters
- $path : string
-
file path
Tags
Return values
boolabspathCE()
Convert path related to root dir into real path (with convert encoding)
protected
abspathCE(string $path) : string
Parameters
- $path : string
-
rel file path
Tags
Return values
stringaddError()
Add error message
protected
addError() : false
Tags
Return values
falseallowCreate()
Return true if file with given name can be created in given folder.
protected
allowCreate(string $dir, string $name[, null $isDir = null ]) : bool
Parameters
- $dir : string
-
parent dir path
- $name : string
-
new file name
- $isDir : null = null
Tags
Return values
boolallowPutMime()
Return true if file MIME type can save with check uploadOrder config.
protected
allowPutMime(string $mime) : bool
Parameters
- $mime : string
Return values
boolattr()
Check file attribute
protected
attr(string $path, string $name[, bool $val = null ][, bool $isDir = null ]) : bool
Parameters
- $path : string
-
file path
- $name : string
-
attribute name (read|write|locked|hidden)
- $val : bool = null
-
attribute value returned by file system
- $isDir : bool = null
-
path is directory (true: directory, false: file)
Tags
Return values
boolbasenameCE()
Return file name (with convert encoding)
protected
basenameCE(string $path) : string
Parameters
- $path : string
-
file path
Tags
Return values
stringcacheDir()
Cache dir contents
protected
cacheDir(string $path) : void
Parameters
- $path : string
-
dir path
Tags
canCreateTmb()
Return true if thumnbnail for required file can be created
protected
canCreateTmb(string $path, array<string|int, mixed> $stat[, bool $checkTmbPath = true ]) : string|bool
Parameters
- $path : string
-
thumnbnail path
- $stat : array<string|int, mixed>
-
file stat
- $checkTmbPath : bool = true
Tags
Return values
string|boolcanResize()
Return true if required file can be resized.
protected
canResize(string $path, array<string|int, mixed> $stat) : string|bool
By default - the same as canCreateTmb
Parameters
- $path : string
-
thumnbnail path
- $stat : array<string|int, mixed>
-
file stat
Tags
Return values
string|boolcheckExtractItems()
Check and filter the extracted items
protected
checkExtractItems(string $path[, array<string|int, mixed> $checks = null ]) : array<string|int, mixed>
Parameters
- $path : string
-
target local path
- $checks : array<string|int, mixed> = null
-
types to check default: ['symlink', 'name', 'writable', 'mime']
Tags
Return values
array<string|int, mixed> —['symlinks' => [], 'names' => [], 'writables' => [], 'mimes' => [], 'rmNames' => [], 'totalSize' => 0]
childsByAttr()
Return first found children with required attr == $val
protected
childsByAttr(string $path, string $attr, bool $val) : string|false
Parameters
- $path : string
-
file path
- $attr : string
-
attribute name
- $val : bool
-
attribute value
Tags
Return values
string|falseclearcache()
Clean cache
protected
clearcache() : void
Tags
closestByAttr()
If file has required attr == $val - return file path, If dir has child with has required attr == $val - return child path
protected
closestByAttr(string $path, string $attr, bool $val) : string|false
Parameters
- $path : string
-
file path
- $attr : string
-
attribute name
- $val : bool
-
attribute value
Tags
Return values
string|falseconfigure()
Configure after successfull mount.
protected
configure() : void
Tags
connect()
Connect to ftp server
protected
connect() : bool
Tags
Return values
boolconvEnc()
Converts character encoding (base function)
protected
convEnc(mixed $var, string $from, string $to, string $locale, $restoreLocale[, string $unknown = '_' ]) : mixed
Parameters
copy()
Copy file/recursive copy dir only in current volume.
protected
copy(string $src, string $dst, string $name) : string|false
Return new file path or false.
Parameters
- $src : string
-
source path
- $dst : string
-
destination dir path
- $name : string
-
new file name (optionaly)
Tags
Return values
string|falsecopyFrom()
Copy file from another volume.
protected
copyFrom(object $volume, string $src, string $destination, string $name) : string|false
Return new file path or false.
Parameters
- $volume : object
-
source volume
- $src : string
-
source file hash
- $destination : string
-
destination dir path
- $name : string
-
file name
Tags
Return values
string|falsecountSize()
Return file/total directory size infomation
protected
countSize(string $path) : array<string|int, mixed>
Parameters
- $path : string
-
file path
Tags
Return values
array<string|int, mixed>crypt()
Return crypted path Not implemented
protected
crypt(mixed $path) : mixed
Parameters
- $path : mixed
Tags
decode()
Decode path from hash
protected
decode(mixed $hash) : string
Parameters
- $hash : mixed
Tags
Return values
stringdelTree()
Delete dirctory trees
protected
delTree(string $localpath) : bool
Parameters
- $localpath : string
-
path need convert encoding to server encoding
Tags
Return values
booldirnameCE()
Return parent directory path (with convert encoding)
protected
dirnameCE(string $path) : string
Parameters
- $path : string
-
file path
Tags
Return values
stringdoSearch()
Recursive files search
protected
doSearch(string $path, string $q, array<string|int, mixed> $mimes) : array<string|int, mixed>
Parameters
- $path : string
-
dir path
- $q : string
-
search string
- $mimes : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>encode()
Encode path into hash
protected
encode(mixed $path) : string
Parameters
- $path : mixed
Tags
Return values
stringfcloseCE()
Close opened file (with convert encoding)
protected
fcloseCE(resource $fp[, string $path = '' ]) : bool
Parameters
- $fp : resource
-
file pointer
- $path : string = ''
-
file path
Tags
Return values
boolftp_scan_dir()
Gets an array of absolute remote FTP paths of files and folders in $remote_directory omitting symbolic links.
protected
ftp_scan_dir( $remote_directory[, $targets = null ]) : array<string|int, mixed>
Parameters
- $remote_directory :
-
string remote FTP path to scan for file and folders recursively
- $targets : = null
-
array Array of target item.
null
is to get all of items
Return values
array<string|int, mixed> —of elements each of which is an array of two elements:
- $item['path'] - absolute remote FTP path
- $item['type'] - either 'f' for file or 'd' for directory
ftpMode()
Return ftp transfer mode for file
protected
ftpMode(string $path) : string
Parameters
- $path : string
-
file path
Tags
Return values
stringftpRawList()
Call ftp_rawlist with option prefix
protected
ftpRawList(string $path) : array<string|int, mixed>
Parameters
- $path : string
Return values
array<string|int, mixed>gdImage()
Output gd image to file
protected
gdImage(resource $image, string $filename, string $destformat, string $mime[, int $jpgQuality = null ]) : bool
Parameters
- $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 : int = null
-
JEPG quality (1-100)
Return values
boolgdImageBackground()
Assign the proper background to a gd image
protected
gdImageBackground(resource $image, string $bgcolor) : mixed
Parameters
- $image : resource
-
gd image resource
- $bgcolor : string
-
background color in #rrggbb format
gdImageCreate()
Create an gd image according to the specified mime type
protected
gdImageCreate(string $path, string $mime) : resource|false
Parameters
- $path : string
-
image file
- $mime : string
Return values
resource|false —GD image resource identifier
getArchivers()
Get server side available archivers
protected
getArchivers([bool $use_cache = true ]) : array<string|int, mixed>
Parameters
- $use_cache : bool = true
Tags
Return values
array<string|int, mixed>getFullPath()
Resolve relative / (Unix-like)absolute path
protected
getFullPath(string $path, string $base) : string
Parameters
- $path : string
-
target path
- $base : string
-
base path
Return values
stringgetItemsInHand()
Copy items to a new temporary directory on the local server
protected
getItemsInHand(array<string|int, mixed> $hashes[, string $dir = null ][, string $canLink = null ]) : string|false
Parameters
- $hashes : array<string|int, mixed>
-
target hashes
- $dir : string = null
-
destination directory (for recurcive)
- $canLink : string = null
-
it can use link() (for recurcive)
Tags
Return values
string|false —saved path name
getRootstatCachekey()
Return session rootstat cache key
protected
getRootstatCachekey() : string
Return values
stringgetRootStatExtra()
Get root stat extra key values
protected
getRootStatExtra() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —stat extras
getScandir()
Return required dir's files info.
protected
getScandir(string $path) : array<string|int, mixed>
If onlyMimes is set - return only dirs and files of required mimes
Parameters
- $path : string
-
dir path
Tags
Return values
array<string|int, mixed>getTempFile()
Get temporary filename. Tempfile will be removed when after script execution finishes or exit() is called.
protected
getTempFile([string $path = '' ]) : string|false
When needing the unique file to a path, give $path to parameter.
Parameters
- $path : string = ''
-
for get unique file to a path
Tags
Return values
string|falsegettmb()
Return thumnbnail name if exists
protected
gettmb(string $path, array<string|int, mixed> $stat) : string|false
Parameters
- $path : string
-
file path
- $stat : array<string|int, mixed>
-
file stat
Tags
Return values
string|falsegettree()
Return subdirs tree
protected
gettree(string $path, int $deep[, string $exclude = '' ]) : array<string|int, mixed>
Parameters
- $path : string
-
parent dir path
- $deep : int
-
tree deep
- $exclude : string = ''
Tags
Return values
array<string|int, mixed>getWorkFile()
File path of local server side work file path
protected
getWorkFile(string $path) : string
Parameters
- $path : string
-
path need convert encoding to server encoding
Tags
Return values
stringimageMagickConvertPrepare()
Prepare variables for exec convert of ImageMagick
protected
imageMagickConvertPrepare(string $path, string $destformat, int $jpgQuality[, array<string|int, mixed> $imageSize = null ][, null $mime = null ]) : array<string|int, mixed>
Parameters
- $path : string
- $destformat : string
- $jpgQuality : int
- $imageSize : array<string|int, mixed> = null
- $mime : null = null
Tags
Return values
array<string|int, mixed>imagickImage()
Output imagick image to file
protected
imagickImage(imagick $img, string $filename, string $destformat[, int $jpgQuality = null ]) : bool
Parameters
- $img : imagick
-
imagick image resource
- $filename : string
-
The path to save the file to.
- $destformat : string
-
The Image type to use for $filename
- $jpgQuality : int = null
-
JEPG quality (1-100)
Return values
boolimgCrop()
Crop image
protected
imgCrop(string $path, int $width, int $height, bool $x, bool $y[, string $destformat = null ][, int $jpgQuality = null ]) : string|false
Parameters
- $path : string
-
image file
- $width : int
-
crop width
- $height : int
-
crop height
- $x : bool
-
crop left offset
- $y : bool
-
crop top offset
- $destformat : string = null
-
image destination format
- $jpgQuality : int = null
-
JEPG quality (1-100)
Tags
Return values
string|falseimgResize()
Resize image
protected
imgResize(string $path, int $width, int $height[, bool $keepProportions = false ][, bool $resizeByBiggerSide = true ][, string $destformat = null ][, int $jpgQuality = null ][, array<string|int, mixed> $options = array() ]) : string|false
Parameters
- $path : string
-
image file
- $width : int
-
new width
- $height : int
-
new height
- $keepProportions : bool = false
-
crop image
- $resizeByBiggerSide : bool = true
-
resize image based on bigger side if true
- $destformat : string = null
-
image destination format
- $jpgQuality : int = null
-
JEPG quality (1-100)
- $options : array<string|int, mixed> = array()
-
Other extra options
Tags
Return values
string|falseimgRotate()
Rotate image
protected
imgRotate(string $path, int $degree[, string $bgcolor = '#ffffff' ][, string $destformat = null ][, int $jpgQuality = null ]) : string|false
Parameters
- $path : string
-
image file
- $degree : int
-
rotete degrees
- $bgcolor : string = '#ffffff'
-
square background color in #rrggbb format
- $destformat : string = null
-
image destination format
- $jpgQuality : int = null
-
JEPG quality (1-100)
Tags
Return values
string|falseimgSquareFit()
Put image to square
protected
imgSquareFit(string $path, int $width, int $height[, int|string $align = 'center' ][, int|string $valign = 'middle' ][, string $bgcolor = '#0000ff' ][, string $destformat = null ][, int $jpgQuality = null ]) : false|string
Parameters
- $path : string
-
image file
- $width : int
-
square width
- $height : int
-
square height
- $align : int|string = 'center'
-
reserved
- $valign : int|string = 'middle'
-
reserved
- $bgcolor : string = '#0000ff'
-
square background color in #rrggbb format
- $destformat : string = null
-
image destination format
- $jpgQuality : int = null
-
JEPG quality (1-100)
Tags
Return values
false|stringinit()
Prepare FTP connection Connect to remote server and check if credentials are correct, if so, store the connection id in $ftp_conn
protected
init() : bool
Tags
Return values
boolinpathCE()
Return true if $path is children of $parent (with convert encoding)
protected
inpathCE(string $path, string $parent) : bool
Parameters
- $path : string
-
path to check
- $parent : string
-
parent path
Tags
Return values
boolisMyReload()
protected
isMyReload([mixed $target = '' ][, mixed $ARGtarget = '' ]) : mixed
Parameters
- $target : mixed = ''
- $ARGtarget : mixed = ''
isNameExists()
Return fileinfo based on filename For item ID based path file system Please override if needed on each drivers
protected
isNameExists(string $path) : array<string|int, mixed>
Parameters
- $path : string
-
file cache
Return values
array<string|int, mixed>isSameType()
Return true if all mimes is directory or files
protected
isSameType(string $mime1, string $mime2) : bool
Parameters
- $mime1 : string
-
mimetype
- $mime2 : string
-
mimetype
Tags
Return values
booljoinPathCE()
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
protected
joinPathCE(string $dir, string $name) : string
Parameters
- $dir : string
-
dir path
- $name : string
-
file name
Tags
Return values
stringloadMimeTypes()
Load file of mime.types
protected
static loadMimeTypes([string $mimeTypesFile = '' ]) : mixed
Parameters
- $mimeTypesFile : string = ''
-
The mime types file
localFindSymlinks()
Recursive symlinks search
protected
static localFindSymlinks(string $path) : bool
Parameters
- $path : string
-
file/dir path
Tags
Return values
boollocalMoveRecursive()
Move item recursive on local file system
protected
static localMoveRecursive(string $src, string $target[, bool $overWrite = true ][, bool $copyJoin = true ]) : bool
Parameters
- $src : string
- $target : string
- $overWrite : bool = true
- $copyJoin : bool = true
Tags
Return values
boollocalRmdirRecursive()
Remove directory recursive on local file system
protected
static localRmdirRecursive(string $dir) : bool
Parameters
- $dir : string
-
Target dirctory path
Tags
Return values
boollocalScandir()
Return files of target directory that is dotfiles excludes.
protected
static localScandir(string $dir) : array<string|int, mixed>
Parameters
- $dir : string
-
target directory path
Tags
Return values
array<string|int, mixed>makeArchive()
Create archive and return its path
protected
makeArchive(string $dir, array<string|int, mixed> $files, string $name, array<string|int, mixed> $arc) : string|bool
Parameters
- $dir : string
-
target dir
- $files : array<string|int, mixed>
-
files names list
- $name : string
-
archive name
- $arc : array<string|int, mixed>
-
archiver options
Tags
Return values
string|boolmimetype()
Return file mimetype
protected
mimetype(string $path[, string|bool $name = '' ][, int $size = null ][, string $mime = null ]) : string
Parameters
- $path : string
-
file path
- $name : string|bool = ''
- $size : int = null
- $mime : string = null
-
was notified from the volume driver
Tags
Return values
stringmimetypeInternalDetect()
Detect file mimetype using "internal" method or Loading mime.types with $path = ''
protected
static mimetypeInternalDetect([string $path = '' ]) : string
Parameters
- $path : string = ''
-
file path
Tags
Return values
stringmove()
Move file Return new file path or false.
protected
move(string $src, string $dst, string $name) : string|false
Parameters
- $src : string
-
source path
- $dst : string
-
destination dir path
- $name : string
-
new file name
Tags
Return values
string|falsenameAccepted()
Validate file name based on $this->options['acceptedName'] regexp or function
protected
nameAccepted(string $name[, bool $isDir = false ]) : bool
Parameters
- $name : string
-
file name
- $isDir : bool = false
Tags
Return values
boolnormalizeRawWindows()
Normalize MS-DOS style FTP LIST Raw line
protected
normalizeRawWindows(string $raw) : array<string|int, mixed>
Parameters
- $raw : string
-
line from FTP LIST (MS-DOS style)
Tags
Return values
array<string|int, mixed>normpathCE()
Return normalized path (with convert encoding)
protected
normpathCE(string $path) : string
Parameters
- $path : string
-
file path
Tags
Return values
stringparsePermissions()
Parse permissions string. Return array(read => true/false, write => true/false)
protected
parsePermissions(string $perm[, bool $isowner = true ]) : array<string|int, mixed>
Parameters
- $perm : string
-
permissions string 'rwx' + 'rwx' + 'rwx' ^ ^ ^ | | +-> others | +---------> group +-----------------> owner The isowner parameter is computed by the caller. If the owner parameter in the options is true, the user is the actual owner of all objects even if che user used in the ftp Login is different from the file owner id. If the owner parameter is false to understand if the user is the file owner we compare the ftp user with the file owner id.
- $isowner : bool = true
-
. Tell if the current user is the owner of the object.
Tags
Return values
array<string|int, mixed>parseRaw()
Parse line from ftp_rawlist() output and return file stat (array)
protected
parseRaw(string $raw, $base[, bool $nameOnly = false ]) : array<string|int, mixed>
Parameters
Tags
Return values
array<string|int, mixed>procExec()
Execute shell command
protected
procExec(string $command[, string &$output = '' ][, int &$return_var = -1 ][, string &$error_output = '' ][, mixed $cwd = null ]) : int
Parameters
- $command : string
-
command line
- $output : string = ''
-
stdout strings
- $return_var : int = -1
-
process exit code
- $error_output : string = ''
-
stderr strings
- $cwd : mixed = null
Tags
Return values
int —exit code
relpathCE()
Return file path related to root dir (with convert encoding)
protected
relpathCE(string $path) : string
Parameters
- $path : string
-
file path
Tags
Return values
stringremoteArchive()
Create an archive from remote items
protected
remoteArchive(array<string|int, mixed> $hashes, string $name, array<string|int, mixed> $arc) : string|bool
Parameters
- $hashes : array<string|int, mixed>
-
files hashes list
- $name : string
-
archive name
- $arc : array<string|int, mixed>
-
archiver options
Tags
Return values
string|bool —path of created archive
remove()
Remove file/ recursive remove dir
protected
remove(string $path[, bool $force = false ]) : bool
Parameters
- $path : string
-
file path
- $force : bool = false
-
try to remove even if file locked
Tags
Return values
boolrmTmb()
Remove thumbnail, also remove recursively if stat is directory
protected
rmTmb(array<string|int, mixed> $stat) : void
Parameters
- $stat : array<string|int, mixed>
-
file stat
Tags
saveCE()
Create new file and write into it from file pointer. (with convert encoding) Return new file path or false on error.
protected
saveCE(resource $fp, string $dir, string $name, array<string|int, mixed> $stat) : bool|string
Parameters
- $fp : resource
-
file pointer
- $dir : string
-
target dir path
- $name : string
-
file name
- $stat : array<string|int, mixed>
-
file stat (required by some virtual fs)
Tags
Return values
bool|stringscandirCE()
Return files list in directory (with convert encoding)
protected
scandirCE(string $path) : array<string|int, mixed>
Parameters
- $path : string
-
dir path
Tags
Return values
array<string|int, mixed>searchMatchName()
Default serach match method (name match)
protected
searchMatchName(string $name, string $query, string $path) : bool
Parameters
- $name : string
-
Item name
- $query : string
-
Query word
- $path : string
-
Item path
Return values
bool —@return bool
sessionRestart()
protected
sessionRestart() : mixed
Tags
setError()
Save error message
protected
setError() : bool
Tags
Return values
bool —false
stat()
Return fileinfo
protected
stat(string $path) : array<string|int, mixed>|bool
Parameters
- $path : string
-
file cache
Tags
Return values
array<string|int, mixed>|boolstripos()
Find position of first occurrence of string in a string with multibyte support
protected
stripos(string $haystack, string $needle[, int $offset = 0 ]) : int|bool
Parameters
- $haystack : string
-
The string being checked.
- $needle : string
-
The string to find in haystack.
- $offset : int = 0
-
The search offset. If it is not specified, 0 is used.
Tags
Return values
int|boolsubdirsCE()
Return true if path is dir and has at least one childs directory (with convert encoding)
protected
subdirsCE(string $path) : bool
Parameters
- $path : string
-
dir path
Tags
Return values
boolsymlinkCE()
Create symlink (with convert encoding)
protected
symlinkCE(string $source, string $targetDir, string $name) : bool
Parameters
- $source : string
-
file to link to
- $targetDir : string
-
folder to create link in
- $name : string
-
symlink name
Tags
Return values
booltmbname()
Return thumbnail file name for required file
protected
tmbname(array<string|int, mixed> $stat) : string
Parameters
- $stat : array<string|int, mixed>
-
file stat
Tags
Return values
stringuncrypt()
Return uncrypted path Not implemented
protected
uncrypt(mixed $hash) : mixed
Parameters
- $hash : mixed
Tags
unpackArchive()
Unpack archive
protected
unpackArchive(string $path, array<string|int, mixed> $arc[, bool|string $mode = true ]) : void
Parameters
- $path : string
-
archive path
- $arc : array<string|int, mixed>
-
archiver command and arguments (same as in $this->archivers)
- $mode : bool|string = true
-
bool: remove archive ( unlink($path) ) | string: extract to directory
Tags
updateCache()
Put file stat in cache and return it
protected
updateCache(string $path, array<string|int, mixed> $stat) : array<string|int, mixed>
Parameters
- $path : string
-
file path
- $stat : array<string|int, mixed>
-
file stat
Tags
Return values
array<string|int, mixed>updateSubdirsCache()
Update subdirs cache data
protected
updateSubdirsCache(string $path, bool $subdirs) : void
Parameters
- $path : string
- $subdirs : bool
zipArchiveUnzip()
Unpack Zip archive using PHP class ZipArchive
protected
static zipArchiveUnzip(string $zipPath, string $toDir) : bool
Parameters
- $zipPath : string
-
Zip archive name
- $toDir : string
-
Extract to path
Tags
Return values
boolzipArchiveZip()
Create Zip archive using PHP class ZipArchive
protected
static zipArchiveZip(string $dir, array<string|int, mixed> $files, string|object $zipPath) : bool
Parameters
- $dir : string
-
target dir
- $files : array<string|int, mixed>
-
files names list
- $zipPath : string|object
-
Zip archive name
Tags
Return values
booldeleteDir()
Delete local directory recursively.
private
deleteDir( $dirPath) : bool
Parameters
Tags
Return values
bool —true on success and false on failure.
ftp_download_files()
Downloads specified files from remote directory if there is a directory among files it is downloaded recursively (omitting symbolic links).
private
ftp_download_files( $remote_directory, array<string|int, mixed> $files, $dest_local_directory) : bool
Parameters
- $remote_directory :
-
string remote FTP path to a source directory to download from.
- $files : array<string|int, mixed>
-
list of files to download from remote directory.
- $dest_local_directory :
-
string destination folder to store downloaded files.
Return values
bool —true on success and false on failure.
tempDir()
Create writable temporary directory and return path to it.
private
tempDir() : string
Return values
string —path to the new temporary directory or false in case of error.