PHP Class elFinder\elFinder

Show file Open project: gotcms/gotcms

Public Properties

Property Type Description
$mountErrors array Errors from not mounted volumes
$netDrivers
$volumesCnt integer Mounted volumes count Required to create unique volume id

Protected Properties

Property Type Description
$commands array Commands and required arguments list
$debug string Send debug to client?
$default elFinderStorageDriver Default root (storage)
$listeners array Commands listeners
$loaded boolean Is elFinder init correctly?
$time string script work time for debug
$uploadDebug string undocumented class variable
$version string API version number
$volumes array Storages (root dirs)

Public Methods

Method Description
__construct ( $opts ) : void Constructor
bind ( $cmd, $handler ) : elFinder Add handler to elFinder command
commandArgsList ( $cmd ) : array Return command required arguments info
commandExists ( $cmd ) : boolean Return true if command exists
error ( ) : array Normalize error messages
exec ( string $cmd, array $args ) : array Exec command and return result
loaded ( ) : boolean Return true if fm init correctly
realpath ( string $hash ) : string Return file real path
unbind ( $cmd, $handler ) : elFinder Remove event (command exec) handler
version ( ) : string Return version (api) number

Protected Methods

Method Description
archive ( array $args ) : array Create archive
dim ( array $args ) : array Return image dimmensions
duplicate ( array $args ) : array Duplicate file - create copy with "copy %d" suffix
extract ( array $args ) : array Extract files from archive
file ( $args ) : array Required to output file in browser when volume URL is not set Return array contains opened file pointer, root itself and required headers
filter ( array $files ) : array Remove from files list hidden files and files with required mime types
get ( array $args ) : array Return file content
getNetVolumes ( ) : array Return network volumes config.
hashes ( array $files ) : array Return fils hashes list
info ( array $args ) : array Return file info (used by client "places" ui)
ls ( $args ) : array Return dir files names list
mkdir ( $args ) : array Create directory
mkfile ( $args ) : array Create empty file
netmount ( $args )
open ( $args ) : array "Open" directory Return array with following elements - cwd - opened dir info - files - opened dir content [and dirs tree if $args[tree]] - api - api version (if $args[init]) - uplMaxSize - if $args[init] - error - on failed
parents ( $args ) : array Return parents dir for required directory
paste ( $args ) : array Copy/move files into new destination
put ( $args ) : array Save content into text file
rename ( array $args ) : array Rename file
resize ( $args ) : array Resize image
rm ( $args ) : array Remove dirs/files
saveNetVolumes ( array $volumes ) : void Save network volumes config.
search ( array $args ) : array Search files
size ( $args ) : array Count total files size
tmb ( $args ) : array Return new created thumbnails list
toArray ( array $data ) : array Return files info array
tree ( $args ) : array Return subdirs for required directory
upload ( $args ) : array Save uploaded files
utime ( )
volume ( $hash ) : elFinderStorageDriver Return root - file's owner

Method Details

__construct() public method

Constructor
Author: Dmitry (dio) Levashov
public __construct ( $opts ) : void
return void

archive() protected method

Create archive
Author: Dmitry (dio) Levashov,
Author: Alexey Sukhotin
protected archive ( array $args ) : array
$args array command arguments
return array

bind() public method

Add handler to elFinder command
Author: Dmitry (dio) Levashov
public bind ( $cmd, $handler ) : elFinder
return elFinder

commandArgsList() public method

Return command required arguments info
Author: Dmitry (dio) Levashov
public commandArgsList ( $cmd ) : array
return array

commandExists() public method

Return true if command exists
Author: Dmitry (dio) Levashov
public commandExists ( $cmd ) : boolean
return boolean

dim() protected method

Return image dimmensions
Author: Dmitry (dio) Levashov
protected dim ( array $args ) : array
$args array command arguments
return array

duplicate() protected method

Duplicate file - create copy with "copy %d" suffix
Author: Dmitry (dio) Levashov
protected duplicate ( array $args ) : array
$args array command arguments
return array

error() public method

Normalize error messages
Author: Dmitry (dio) Levashov
public error ( ) : array
return array

exec() public method

Exec command and return result
Author: Dmitry (dio) Levashov
public exec ( string $cmd, array $args ) : array
$cmd string command name
$args array command arguments
return array

extract() protected method

Extract files from archive
Author: Dmitry (dio) Levashov,
Author: Alexey Sukhotin
protected extract ( array $args ) : array
$args array command arguments
return array

file() protected method

Required to output file in browser when volume URL is not set Return array contains opened file pointer, root itself and required headers
Author: Dmitry (dio) Levashov
protected file ( $args ) : array
return array

filter() protected method

Remove from files list hidden files and files with required mime types
Author: Dmitry (dio) Levashov
protected filter ( array $files ) : array
$files array files info
return array

get() protected method

Return file content
Author: Dmitry (dio) Levashov
protected get ( array $args ) : array
$args array command arguments
return array

getNetVolumes() protected method

Return network volumes config.
Author: Dmitry (dio) Levashov
protected getNetVolumes ( ) : array
return array

hashes() protected method

Return fils hashes list
Author: Dmitry (dio) Levashov
protected hashes ( array $files ) : array
$files array files info
return array

info() protected method

Return file info (used by client "places" ui)
Author: Dmitry Levashov
protected info ( array $args ) : array
$args array command arguments
return array

loaded() public method

Return true if fm init correctly
Author: Dmitry (dio) Levashov
public loaded ( ) : boolean
return boolean

ls() protected method

Return dir files names list
Author: Dmitry (dio) Levashov
protected ls ( $args ) : array
return array

mkdir() protected method

Create directory
Author: Dmitry (dio) Levashov
protected mkdir ( $args ) : array
return array

mkfile() protected method

Create empty file
Author: Dmitry (dio) Levashov
protected mkfile ( $args ) : array
return array

netmount() protected method

protected netmount ( $args )

open() protected method

"Open" directory Return array with following elements - cwd - opened dir info - files - opened dir content [and dirs tree if $args[tree]] - api - api version (if $args[init]) - uplMaxSize - if $args[init] - error - on failed
Author: Dmitry (dio) Levashov
protected open ( $args ) : array
return array

parents() protected method

Return parents dir for required directory
Author: Dmitry (dio) Levashov
protected parents ( $args ) : array
return array

paste() protected method

Copy/move files into new destination
Author: Dmitry (dio) Levashov
protected paste ( $args ) : array
return array

put() protected method

Save content into text file
Author: Dmitry (dio) Levashov
protected put ( $args ) : array
return array

realpath() public method

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

rename() protected method

Rename file
Author: Dmitry (dio) Levashov
protected rename ( array $args ) : array
$args array
return array

resize() protected method

Resize image
Author: Dmitry (dio) Levashov
Author: Alexey Sukhotin
protected resize ( $args ) : array
return array

rm() protected method

Remove dirs/files
Author: Dmitry (dio) Levashov
protected rm ( $args ) : array
return array

saveNetVolumes() protected method

Save network volumes config.
Author: Dmitry (dio) Levashov
protected saveNetVolumes ( array $volumes ) : void
$volumes array volumes config
return void

size() protected method

Count total files size
Author: Dmitry (dio) Levashov
protected size ( $args ) : array
return array

tmb() protected method

Return new created thumbnails list
Author: Dmitry (dio) Levashov
protected tmb ( $args ) : array
return array

toArray() protected method

Return files info array
Author: Dmitry (dio) Levashov
protected toArray ( array $data ) : array
$data array one file info or files info
return array

tree() protected method

Return subdirs for required directory
Author: Dmitry (dio) Levashov
protected tree ( $args ) : array
return array

unbind() public method

Remove event (command exec) handler
Author: Dmitry (dio) Levashov
public unbind ( $cmd, $handler ) : elFinder
return elFinder

upload() protected method

Save uploaded files
Author: Dmitry (dio) Levashov
protected upload ( $args ) : array
return array

utime() protected method

protected utime ( )

version() public method

Return version (api) number
Author: Dmitry (dio) Levashov
public version ( ) : string
return string

volume() protected method

Return root - file's owner
Author: Dmitry (dio) Levashov
protected volume ( $hash ) : elFinderStorageDriver
return elFinderStorageDriver

Property Details

$commands protected property

Commands and required arguments list
protected array $commands
return array

$debug protected property

Send debug to client?
protected string $debug
return string

$default protected property

Default root (storage)
protected elFinderStorageDriver $default
return elFinderStorageDriver

$listeners protected property

Commands listeners
protected array $listeners
return array

$loaded protected property

Is elFinder init correctly?
protected bool $loaded
return boolean

$mountErrors public property

Errors from not mounted volumes
public array $mountErrors
return array

$netDrivers public static property

public static $netDrivers

$time protected property

script work time for debug
protected string $time
return string

$uploadDebug protected property

undocumented class variable
protected string $uploadDebug
return string

$version protected property

API version number
protected string $version
return string

$volumes protected property

Storages (root dirs)
protected array $volumes
return array

$volumesCnt public static property

Mounted volumes count Required to create unique volume id
public static int $volumesCnt
return integer