PHP 클래스 elFinder

Core class.
저자: Dmitry (dio) Levashov
저자: Troex Nevelin
저자: Alexey Sukhotin
파일 보기 프로젝트 열기: studio-42/elfinder 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$defaultMimefile string elFinderVolumeDriver default mime.type file path
$instance object elFinder instance
$locale string elFinder global locale
$maxTargets Max allowed numbar of @var targets (0 - no limit)
$mountErrors array Errors from not mounted volumes
$netDrivers array Network mount drivers
$phpErrors array Errors from PHP
$sessionCacheKey string elFinder global sessionCacheKey
$volumesCnt integer Mounted volumes count Required to create unique volume id

보호된 프로퍼티들

프로퍼티 타입 설명
$base64encodeSessionData boolean elFinder base64encodeSessionData elFinder save session data as UTF-8 If the session storage mechanism of the system does not allow UTF-8 And it must be true option 'base64encodeSessionData' of elFinder
$callbackWindowURL URL for callback output window for CORS redirect to this URL when callback output
$commands array Commands and required arguments list
$commonTempPath string elFinder common tempraly path
$debug string Send debug to client?
$default elFinderStorageDriver Default root (storage)
$listeners array Commands listeners
$loaded boolean Is elFinder init correctly?
$maxArcFilesSize integer Max allowed archive files size (0 - no limit)
$netVolumesSessionKey string Session key of net mount volumes
$optionsNetVolumes array Additional volume root options for network mounting volume
$plugins array Plugins instance
$session elFinderSessionInterface elFinder session wrapper object
$sessionCloseEarlier boolean Call session_write_close() before exec command?
$sessionUseCmds array SESSION use commands @see __construct()
$time string script work time for debug
$timeout integer session expires timeout
$uploadDebug string undocumented class variable
$uploadTempPath string Temp dir path for Upload
$version string API version number
$volumes array Storages (root dirs)

공개 메소드들

메소드 설명
__construct ( $opts ) 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
curlExec ( resource $curl, array $options = [], array $headers = [] ) : mixed Call curl_exec() with supported redirect on safe_mode or open_basedir
error ( ) : array Normalize error messages
exec ( string $cmd, array $args ) : array Exec command and return result
extendTimeLimit ( Int $time = null ) : void Extend PHP execution time limit
getConnectorUrl ( ) : string Get script url.
getIniBytes ( string $iniName = '', string $val = '' ) : number Return bytes from php.ini value
getSession ( ) : object Return elFinder session wrapper instance
getStaticVar ( $key ) : mixed | null Return elFinder static variable
getStreamByUrl ( array $data, number $redirectLimit = 5 ) : resource | boolean Get stream resource pointer by URL
getVolume ( $hash ) : elFinderStorageDriver Return root - file's owner (public func of volume())
isAnimationGif ( string $path ) : boolean Return Is Animation Gif
isSeekableStream ( resource $resource ) : boolean Return Is seekable stream resource
loaded ( ) : boolean Return true if fm init correctly
phpErrorHandler ( integer $errno, string $errstr, string $errfile, integer $errline ) : void | boolean PHP error handler, catch error types only E_WARNING | E_NOTICE | E_USER_WARNING | E_USER_NOTICE
realpath ( string $hash ) : string Return file real path
rewind ( resource $resource ) : void Rewind stream resource
sessionDataDecode ( mixed &$var, boolean $checkIs = null ) : boolean | mixed base64_decode and unserialize of session data (If needed)
sessionDataEncode ( mixed $var ) : mixed | string serialize and base64_encode of session data (If needed)
sessionWrite ( ) : void Call session_write_close() if session is restarted
unbind ( $cmd, $handler ) : elFinder Remove event (command exec) handler
updateNetVolumeOption ( string $netKey, string $optionKey, mixed $val ) Update sesstion value of a NetVolume option
version ( ) : string Return version (api) number

보호된 메소드들

메소드 설명
archive ( array $args ) : array Create archive
callback ( $args ) Output callback result with JavaScript that control elFinder or HTTP redirect to callbackWindowURL
chmod ( $args ) : array chmod
curl_get_contents ( string &$url, integer $timeout, integer $redirect_max, string $ua, resource $outfp ) : string Get remote contents with cURL
detectFileExtension ( string $path ) : string Detect file type extension by local path
dim ( array $args ) : array Return image dimensions
duplicate ( array $args ) : array Duplicate file - create copy with "copy %d" suffix
ensureDirsRecursively ( object $volume, string $target, string $dirs, string $path = '' ) : array | false Ensure directories recursively
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
fsock_get_contents ( string &$url, integer $timeout, integer $redirect_max, string $ua, resource $outfp ) : string Get remote contents with fsockopen()
get ( array $args ) : array Return file content
getNetVolumeUniqueId ( array $netVolumes = null, string $prefix = 'nm' ) : string | false Return Network mount volume unique ID
getNetVolumes ( ) : array Return network volumes config.
getPluginInstance ( string $name, array $opts = [] ) : object | boolean Get plugin instance & set to $this->plugins
get_remote_contents ( string &$url, integer $timeout = 30, integer $redirect_max = 5, string $ua = 'Mozilla/5.0', resource $fp = null ) : string Get remote contents
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
parse_data_scheme ( string $str, array $extTable ) : array Parse Data URI scheme
paste ( $args ) : array Copy/move files into new destination
put ( $args ) : array Save content into text file
removeNetVolume ( string $key, object $volume ) : boolean Remove netmount volume
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
url ( array $args ) : array Return content URL
utime ( )
volume ( $hash ) : elFinderStorageDriver Return root - file's owner
zipdl ( $args ) : array Download files/folders as an archive file

비공개 메소드들

메소드 설명
checkChunkedFile ( string $tmpname, string $chunk, string $cid, string $tempDir, null $volume = null ) : array Check chunked upload files
getTempDir ( string $volumeTempPath = null ) : string Get temporary directory path
session_expires ( )

메소드 상세

__construct() 공개 메소드

Constructor
저자: Dmitry (dio) Levashov
public __construct ( $opts )

archive() 보호된 메소드

Create archive
저자: Dmitry (dio) Levashov,
저자: Alexey Sukhotin
protected archive ( array $args ) : array
$args array command arguments
리턴 array

bind() 공개 메소드

Add handler to elFinder command
저자: Dmitry (dio) Levashov
public bind ( $cmd, $handler ) : elFinder
리턴 elFinder

callback() 보호된 메소드

Output callback result with JavaScript that control elFinder or HTTP redirect to callbackWindowURL
저자: Naoki Sawada
protected callback ( $args )

chmod() 보호된 메소드

chmod
저자: David Bartle
protected chmod ( $args ) : array
리턴 array

commandArgsList() 공개 메소드

Return command required arguments info
저자: Dmitry (dio) Levashov
public commandArgsList ( $cmd ) : array
리턴 array

commandExists() 공개 메소드

Return true if command exists
저자: Dmitry (dio) Levashov
public commandExists ( $cmd ) : boolean
리턴 boolean

curlExec() 공개 정적인 메소드

Call curl_exec() with supported redirect on safe_mode or open_basedir
저자: Naoki Sawada
public static curlExec ( resource $curl, array $options = [], array $headers = [] ) : mixed
$curl resource
$options array
$headers array
리턴 mixed

curl_get_contents() 보호된 메소드

Get remote contents with cURL
저자: Naoki Sawada
protected curl_get_contents ( string &$url, integer $timeout, integer $redirect_max, string $ua, resource $outfp ) : string
$url string target url
$timeout integer timeout (sec)
$redirect_max integer redirect max count
$ua string
$outfp resource
리턴 string or bool(false)

detectFileExtension() 보호된 메소드

Detect file type extension by local path
저자: Naoki Sawada
protected detectFileExtension ( string $path ) : string
$path string Local path
리턴 string file type extension with dot

dim() 보호된 메소드

Return image dimensions
저자: Dmitry (dio) Levashov
protected dim ( array $args ) : array
$args array command arguments
리턴 array

duplicate() 보호된 메소드

Duplicate file - create copy with "copy %d" suffix
저자: Dmitry (dio) Levashov
protected duplicate ( array $args ) : array
$args array command arguments
리턴 array

ensureDirsRecursively() 보호된 메소드

Ensure directories recursively
저자: Naoki Sawada
protected ensureDirsRecursively ( object $volume, string $target, string $dirs, string $path = '' ) : array | false
$volume object Volume object
$target string Target hash
$dirs string Array of directory tree to ensure
$path string Relative path form target hash
리턴 array | false array('stats' => array([stat of maked directory]), 'hashes' => array('[path]' => '[hash]'))

error() 공개 메소드

Normalize error messages
저자: Dmitry (dio) Levashov
public error ( ) : array
리턴 array

exec() 공개 메소드

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

extendTimeLimit() 공개 정적인 메소드

Extend PHP execution time limit
public static extendTimeLimit ( Int $time = null ) : void
$time Int
리턴 void

extract() 보호된 메소드

Extract files from archive
저자: Dmitry (dio) Levashov,
저자: Alexey Sukhotin
protected extract ( array $args ) : array
$args array command arguments
리턴 array

file() 보호된 메소드

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

filter() 보호된 메소드

Remove from files list hidden files and files with required mime types
저자: Dmitry (dio) Levashov
protected filter ( array $files ) : array
$files array files info
리턴 array

fsock_get_contents() 보호된 메소드

Get remote contents with fsockopen()
저자: Naoki Sawada
protected fsock_get_contents ( string &$url, integer $timeout, integer $redirect_max, string $ua, resource $outfp ) : string
$url string url
$timeout integer timeout (sec)
$redirect_max integer redirect max count
$ua string
$outfp resource
리턴 string or bool(false)

get() 보호된 메소드

Return file content
저자: Dmitry (dio) Levashov
protected get ( array $args ) : array
$args array command arguments
리턴 array

getConnectorUrl() 공개 정적인 메소드

Get script url.
저자: Naoki Sawada
public static getConnectorUrl ( ) : string
리턴 string full URL

getIniBytes() 공개 정적인 메소드

Return bytes from php.ini value
public static getIniBytes ( string $iniName = '', string $val = '' ) : number
$iniName string
$val string
리턴 number

getNetVolumeUniqueId() 보호된 메소드

Return Network mount volume unique ID
저자: Naoki Sawada
protected getNetVolumeUniqueId ( array $netVolumes = null, string $prefix = 'nm' ) : string | false
$netVolumes array Saved netvolumes array
$prefix string Id prefix
리턴 string | false

getNetVolumes() 보호된 메소드

Return network volumes config.
저자: Dmitry (dio) Levashov
protected getNetVolumes ( ) : array
리턴 array

getPluginInstance() 보호된 메소드

Get plugin instance & set to $this->plugins
저자: Naoki Sawada
protected getPluginInstance ( string $name, array $opts = [] ) : object | boolean
$name string Plugin name (dirctory name)
$opts array Plugin options (optional)
리턴 object | boolean | bool Plugin object instance Or false

getSession() 공개 메소드

Return elFinder session wrapper instance
public getSession ( ) : object
리턴 object elFinderSessionInterface

getStaticVar() 공개 정적인 메소드

Return elFinder static variable
public static getStaticVar ( $key ) : mixed | null
$key
리턴 mixed | null

getStreamByUrl() 공개 정적인 메소드

Get stream resource pointer by URL
저자: Naoki Sawada
public static getStreamByUrl ( array $data, number $redirectLimit = 5 ) : resource | boolean
$data array array('target'=>'URL', 'headers' => array())
$redirectLimit number
리턴 resource | boolean

getVolume() 공개 메소드

Return root - file's owner (public func of volume())
저자: Naoki Sawada
public getVolume ( $hash ) : elFinderStorageDriver
리턴 elFinderStorageDriver

get_remote_contents() 보호된 메소드

Get remote contents
저자: Naoki Sawada
protected get_remote_contents ( string &$url, integer $timeout = 30, integer $redirect_max = 5, string $ua = 'Mozilla/5.0', resource $fp = null ) : string
$url string target url
$timeout integer timeout (sec)
$redirect_max integer redirect max count
$ua string
$fp resource
리턴 string or bool(false)

hashes() 보호된 메소드

Return fils hashes list
저자: Dmitry (dio) Levashov
protected hashes ( array $files ) : array
$files array files info
리턴 array

info() 보호된 메소드

Return file info (used by client "places" ui)
저자: Dmitry Levashov
protected info ( array $args ) : array
$args array command arguments
리턴 array

isAnimationGif() 공개 정적인 메소드

Return Is Animation Gif
public static isAnimationGif ( string $path ) : boolean
$path string server local path of target image
리턴 boolean

isSeekableStream() 공개 정적인 메소드

Return Is seekable stream resource
public static isSeekableStream ( resource $resource ) : boolean
$resource resource
리턴 boolean

loaded() 공개 메소드

Return true if fm init correctly
저자: Dmitry (dio) Levashov
public loaded ( ) : boolean
리턴 boolean

ls() 보호된 메소드

Return dir files names list
저자: Dmitry (dio) Levashov
protected ls ( $args ) : array
리턴 array

mkdir() 보호된 메소드

Create directory
저자: Dmitry (dio) Levashov
protected mkdir ( $args ) : array
리턴 array

mkfile() 보호된 메소드

Create empty file
저자: Dmitry (dio) Levashov
protected mkfile ( $args ) : array
리턴 array

netmount() 보호된 메소드

protected netmount ( $args )

open() 보호된 메소드

"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
저자: Dmitry (dio) Levashov
protected open ( $args ) : array
리턴 array

parents() 보호된 메소드

Return parents dir for required directory
저자: Dmitry (dio) Levashov
protected parents ( $args ) : array
리턴 array

parse_data_scheme() 보호된 메소드

Parse Data URI scheme
저자: Naoki Sawada
protected parse_data_scheme ( string $str, array $extTable ) : array
$str string
$extTable array
리턴 array

paste() 보호된 메소드

Copy/move files into new destination
저자: Dmitry (dio) Levashov
protected paste ( $args ) : array
리턴 array

phpErrorHandler() 공개 정적인 메소드

PHP error handler, catch error types only E_WARNING | E_NOTICE | E_USER_WARNING | E_USER_NOTICE
public static phpErrorHandler ( integer $errno, string $errstr, string $errfile, integer $errline ) : void | boolean
$errno integer
$errstr string
$errfile string
$errline integer
리턴 void | boolean

put() 보호된 메소드

Save content into text file
저자: Dmitry (dio) Levashov
protected put ( $args ) : array
$args
리턴 array

realpath() 공개 메소드

Return file real path
저자: Dmitry (dio) Levashov
public realpath ( string $hash ) : string
$hash string file hash
리턴 string

removeNetVolume() 보호된 메소드

Remove netmount volume
protected removeNetVolume ( string $key, object $volume ) : boolean
$key string netvolume key
$volume object volume driver instance
리턴 boolean

rename() 보호된 메소드

Rename file
저자: Dmitry (dio) Levashov
protected rename ( array $args ) : array
$args array
리턴 array

resize() 보호된 메소드

Resize image
저자: Dmitry (dio) Levashov
저자: Alexey Sukhotin
protected resize ( $args ) : array
리턴 array

rewind() 공개 정적인 메소드

Rewind stream resource
public static rewind ( resource $resource ) : void
$resource resource
리턴 void

rm() 보호된 메소드

Remove dirs/files
저자: Dmitry (dio) Levashov
protected rm ( $args ) : array
리턴 array

saveNetVolumes() 보호된 메소드

Save network volumes config.
저자: Dmitry (dio) Levashov
protected saveNetVolumes ( array $volumes ) : void
$volumes array volumes config
리턴 void

sessionDataDecode() 공개 정적인 메소드

base64_decode and unserialize of session data (If needed)
사용 중단:
저자: Naoki Sawada
public static sessionDataDecode ( mixed &$var, boolean $checkIs = null ) : boolean | mixed
$var mixed target variable
$checkIs boolean data type for check (array|string|object|int)
리턴 boolean | mixed

sessionDataEncode() 공개 정적인 메소드

serialize and base64_encode of session data (If needed)
사용 중단:
저자: Naoki Sawada
public static sessionDataEncode ( mixed $var ) : mixed | string
$var mixed target variable
리턴 mixed | string

sessionWrite() 공개 정적인 메소드

Call session_write_close() if session is restarted
사용 중단:
public static sessionWrite ( ) : void
리턴 void

size() 보호된 메소드

Count total files size
저자: Dmitry (dio) Levashov
protected size ( $args ) : array
리턴 array

tmb() 보호된 메소드

Return new created thumbnails list
저자: Dmitry (dio) Levashov
protected tmb ( $args ) : array
리턴 array

toArray() 보호된 메소드

Return files info array
저자: Dmitry (dio) Levashov
protected toArray ( array $data ) : array
$data array one file info or files info
리턴 array

tree() 보호된 메소드

Return subdirs for required directory
저자: Dmitry (dio) Levashov
protected tree ( $args ) : array
리턴 array

unbind() 공개 메소드

Remove event (command exec) handler
저자: Dmitry (dio) Levashov
public unbind ( $cmd, $handler ) : elFinder
리턴 elFinder

updateNetVolumeOption() 공개 메소드

Update sesstion value of a NetVolume option
public updateNetVolumeOption ( string $netKey, string $optionKey, mixed $val )
$netKey string
$optionKey string
$val mixed

upload() 보호된 메소드

Save uploaded files
저자: Dmitry (dio) Levashov
protected upload ( $args ) : array
리턴 array

url() 보호된 메소드

Return content URL
저자: Naoki Sawada
protected url ( array $args ) : array
$args array command arguments
리턴 array

utime() 보호된 메소드

protected utime ( )

version() 공개 메소드

Return version (api) number
저자: Dmitry (dio) Levashov
public version ( ) : string
리턴 string

volume() 보호된 메소드

Return root - file's owner
저자: Dmitry (dio) Levashov
protected volume ( $hash ) : elFinderStorageDriver
리턴 elFinderStorageDriver

zipdl() 보호된 메소드

1st: Return srrsy contains download archive file info 2nd: Return array contains opened file pointer, root itself and required headers
저자: Naoki Sawada
protected zipdl ( $args ) : array
리턴 array

프로퍼티 상세

$base64encodeSessionData 보호되어 있는 정적으로 프로퍼티

elFinder base64encodeSessionData elFinder save session data as UTF-8 If the session storage mechanism of the system does not allow UTF-8 And it must be true option 'base64encodeSessionData' of elFinder
protected static bool $base64encodeSessionData
리턴 boolean

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

URL for callback output window for CORS redirect to this URL when callback output
protected $callbackWindowURL

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

Commands and required arguments list
protected array $commands
리턴 array

$commonTempPath 보호되어 있는 정적으로 프로퍼티

elFinder common tempraly path
protected static string $commonTempPath
리턴 string

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

Send debug to client?
protected string $debug
리턴 string

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

Default root (storage)
protected elFinderStorageDriver $default
리턴 elFinderStorageDriver

$defaultMimefile 공개적으로 정적으로 프로퍼티

elFinderVolumeDriver default mime.type file path
public static string $defaultMimefile
리턴 string

$instance 공개적으로 정적으로 프로퍼티

elFinder instance
public static object $instance
리턴 object

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

Commands listeners
protected array $listeners
리턴 array

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

Is elFinder init correctly?
protected bool $loaded
리턴 boolean

$locale 공개적으로 정적으로 프로퍼티

elFinder global locale
public static string $locale
리턴 string

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

Max allowed archive files size (0 - no limit)
protected int $maxArcFilesSize
리턴 integer

$maxTargets 공개적으로 프로퍼티

Max allowed numbar of @var targets (0 - no limit)
public $maxTargets

$mountErrors 공개적으로 프로퍼티

Errors from not mounted volumes
public array $mountErrors
리턴 array

$netDrivers 공개적으로 정적으로 프로퍼티

Network mount drivers
public static array $netDrivers
리턴 array

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

Session key of net mount volumes
사용 중단:
protected string $netVolumesSessionKey
리턴 string

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

Additional volume root options for network mounting volume
protected array $optionsNetVolumes
리턴 array

$phpErrors 공개적으로 정적으로 프로퍼티

Errors from PHP
public static array $phpErrors
리턴 array

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

Plugins instance
protected array $plugins
리턴 array

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

elFinder session wrapper object
protected elFinderSessionInterface $session
리턴 elFinderSessionInterface

$sessionCacheKey 공개적으로 정적으로 프로퍼티

elFinder global sessionCacheKey
사용 중단:
public static string $sessionCacheKey
리턴 string

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

Call session_write_close() before exec command?
protected bool $sessionCloseEarlier
리턴 boolean

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

SESSION use commands @see __construct()
protected array $sessionUseCmds
리턴 array

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

script work time for debug
protected string $time
리턴 string

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

session expires timeout
protected int $timeout
리턴 integer

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

undocumented class variable
protected string $uploadDebug
리턴 string

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

Temp dir path for Upload
protected string $uploadTempPath
리턴 string

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

API version number
protected string $version
리턴 string

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

Storages (root dirs)
protected array $volumes
리턴 array

$volumesCnt 공개적으로 정적으로 프로퍼티

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