PHP Класс elFinder\elFinderVolumeDriver

Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$URL string Base URL
$access mixed Access control function/class
$archivers array Archivers config
$attributes mixed Access control function/class
$cache array Cache storage
$cryptLib string Library to crypt files name
$defaults array Defaults permissions
$diabled array List of disabled client's commands
$dirsCache array Cache by folders
$driverId string Driver id Must be started from letter and contains [a-z0-9] Used as part of volume id
$error array Errors from last failed action
$finfo object Finfo object for mimeDetect == 'finfo'
$id string Volume id - used as prefix for files hashes
$imgLib string Image manipulation lib name auto|imagick|mogtify|gd
$mimeDetect string Mimetype detect method
$mimetypes array default extensions/mimetypes for mimeDetect == 'internal'
$mounted boolean Flag - volume "mounted" and available
$onlyMimes array Mimetypes allowed to display
$options array Object configuration
$removed array Store files moved or overwrited files info
$root string Root directory path
$rootName string Root basename | alias
$separator string Directory separator - required by client
$startPath string Default directory to open
$tmbPath string Thumbnails dir path
$tmbPathWritable boolean Is thumbnails dir writable
$tmbSize integer Thumbnails size in px
$tmbURL string Thumbnails base URL
$today integer Today 24:00 timestamp
$treeDeep integer How many subdirs levels return for tree
$uploadAllow array Mime types allowed to upload
$uploadDeny array Mime types denied to upload
$uploadMaxSize integer | string Set as number or string with unit - "10M", "500K", "1G"
$uploadOrder array Order to validate uploadAllow and uploadDeny
$yesterday integer Yesterday 24:00 timestamp

Открытые методы

Метод Описание
archive ( $hashes, $mime ) : void Add files to archive
close ( Resource $fp, string $hash ) : void Close file pointer
closest ( string $hash, string $attr, boolean $val ) : string | false Return file/dir hash or first founded child hash with required attr == $val
commandDisabled ( string $cmd ) : boolean Return true if command disabled in options
copyFromAllowed ( ) : boolean Return true if copy from this volume allowed
debug ( ) : array Return debug info for client
defaultPath ( ) : string Return root or startPath hash
dimensions ( string $hash ) : array Return image dimensions
dir ( string $hash, $resolveLink = false ) : array | false Return folder info
driverId ( ) : string Return driver id. Used as a part of volume id.
duplicate ( string $hash, string $suffix = 'copy' ) : array | false Create file copy with suffix "copy number" and return its info
error ( ) : array Return error message from last failed action
extract ( string $hash ) : array | boolean Extract files from archive
file ( string $hash ) : array | false Return file info or false on error
getContents ( string $hash ) : string | false Return file contents
id ( ) : string Return volume id
isReadable ( ) : boolean Return true if voume is readable.
ls ( string $hash ) : array Return dir files names list
mimeAccepted ( string $mime, array $mimes = [], boolean | null $empty = true ) : boolean | null Return true if mime is required mimes list
mkdir ( string $dst, string $name ) : array | false Create directory and return dir info
mkfile ( string $dst, string $name ) : array | false Create empty file and return its info
mount ( array $opts ) : boolean "Mount" volume.
open ( $hash ) : Resource Open file for reading and return file pointer
options ( $hash ) : array Return volume options required by client:
parents ( string $hash ) : array Return part of dirs tree from required dir up to root dir
paste ( Object $volume, $src, string $dst, boolean $rmSrc = false ) : array | false Paste files
path ( string $hash ) : string Return file path related to root
putContents ( string $hash, string $content ) : array Put content in text file and return file info.
realpath ( string $hash ) : string Return file real path if file exists
removed ( ) : array Return list of moved/overwrited files
rename ( string $hash, string $name ) : array | false Rename file and return file info
resetRemoved ( ) : void Clean removed files list
resize ( string $hash, integer $width, integer $height, integer $x, integer $y, string $mode = 'resize', $bg = '', $degree ) : array | false Resize image
rm ( string $hash ) : boolean Remove file/dir
root ( ) : string Return root folder hash
scandir ( string $hash ) : array | false Return directory content or false on error
search ( string $q, array $mimes ) : array Search files
setMimesFilter ( array $mimes ) : void Set mimetypes allowed to display to client
size ( $hash ) : integer Return file size / total directory size
tmb ( $hash ) : string | false Create thumbnail for required file and return its name of false on failed
tree ( string $hash = '', integer $deep, string $exclude = '' ) : array | false Return subfolders for required folder or false on error
umount ( ) : void Some "unmount" stuffs - may be required by virtual fs
uniqueName ( $dir, $name, string $suffix = ' copy', $checkNum = true ) : string Return new unique name based on file name and suffix
upload ( Resource $fp, string $dst, $name, string $tmpname ) : array | false Save uploaded file.

Защищенные методы

Метод Описание
_abspath ( string $path ) : string Convert path related to root dir into real path
_archive ( string $dir, array $files, string $name, array $arc ) : string | boolean Create archive and return its path
_basename ( string $path ) : string Return file name
_checkArchivers ( ) : void Detect available archivers
_copy ( string $source, $targetDir, string $name ) : boolean Copy file into another file (only inside one volume)
_dimensions ( string $path, string $mime ) : string Return object width and height Ususaly used for images, but can be realize for video etc.
_dirname ( string $path ) : string Return parent directory path
_extract ( string $path, array $arc ) : boolean Extract files from archive
_fclose ( resource $fp, string $path = '' ) : boolean Close opened file
_filePutContents ( string $path, string $content ) : boolean Write a string to a file
_fopen ( string $path, $mode = "rb" ) : resource | false Open file and return file pointer
_getContents ( string $path ) : string | false Get file contents
_inpath ( string $path, string $parent ) : boolean Return true if $path is children of $parent
_joinPath ( string $dir, string $name ) : string Join dir name and file name and return full path.
_mkdir ( string $path, string $name ) : string | boolean Create dir and return created dir path or false on failed
_mkfile ( string $path, string $name ) : string | boolean Create file and return it's path or false on failed
_move ( string $source, $targetDir, string $name ) : string | boolean Move file into another parent dir.
_normpath ( string $path ) : string Return normalized path
_path ( string $path ) : string Return fake path started from root dir.
_relpath ( string $path ) : string Return file path related to root dir
_rmdir ( string $path ) : boolean Remove dir
_save ( resource $fp, string $dir, string $name, array $stat ) : boolean | string Create new file and write into it from file pointer.
_scandir ( string $path ) : array Return files list in directory
_stat ( string $path ) : array | false Return stat for given path.
_subdirs ( string $path ) : boolean Return true if path is dir and has at least one childs directory
_symlink ( string $source, string $targetDir, string $name ) : boolean Create symlink
_unlink ( string $path ) : boolean Remove file
allowCreate ( string $dir, string $name ) : boolean Return true if file with given name can be created in given folder.
attr ( string $path, string $name, boolean $val = null ) : boolean Check file attribute
cacheDir ( string $path ) : void Get stat for folder content and put in cache
canCreateTmb ( string $path, array $stat ) : string | boolean Return true if thumnbnail for required file can be created
canResize ( string $path, array $stat ) : string | boolean Return true if required file can be resized.
childsByAttr ( string $path, string $attr, boolean $val ) : string | false Return first found children with required attr == $val
clearcache ( ) : void Clean cache
closestByAttr ( string $path, string $attr, boolean $val ) : string | false If file has required attr == $val - return file path, If dir has child with has required attr == $val - return child path
configure ( ) : void Configure after successfull mount.
copy ( string $src, string $dst, string $name ) : string | false Copy file/recursive copy dir only in current volume.
copyFrom ( Object $volume, string $src, string $destination, string $name ) : string | false Copy file from another volume.
countSize ( string $path ) : integer Return file/total directory size
createTmb ( string $path, $stat ) : string | false Create thumnbnail and return it's URL on success
crypt ( $path ) : mixed Return crypted path Not implemented
decode ( $hash ) : string Decode path from hash
doSearch ( string $path, string $q, array $mimes ) : array Recursive files search
encode ( $path ) : string Encode path into hash
gdImage ( resource $image, string $filename, string $destformat, string $mime ) Output gd image to file
gdImageBackground ( resource $image, string $bgcolor ) Assign the proper background to a gd image
gdImageCreate ( string $path, string $mime ) : gd Create an gd image according to the specified mime type
getScandir ( string $path ) : array Return required dir's files info.
gettmb ( string $path, array $stat ) : string | false Return thumnbnail name if exists
gettree ( string $path, integer $deep, $exclude = '' ) : array Return subdirs tree
imgCrop ( string $path, integer $width, integer $height, boolean $x, boolean $y, string $destformat = null ) : string | false Crop image
imgResize ( string $path, integer $width, integer $height, boolean $keepProportions = false, boolean $resizeByBiggerSide = true, string $destformat = null ) : string | false Resize image
imgRotate ( string $path, integer $degree, string $bgcolor = '#ffffff', string $destformat = null ) : string | false Rotate image
imgSquareFit ( string $path, integer $width, integer $height, integer $align = 'center', integer $valign = 'middle', string $bgcolor = '#0000ff', string $destformat = null ) : string | false Put image to square
init ( ) : boolean Prepare driver before mount volume.
isSameType ( string $mime1, string $mime2 ) : boolean Return true if all mimes is directory or files
mimetype ( string $path, $name = '' ) : string Return file mimetype
mimetypeInternalDetect ( string $path ) : string Detect file mimetype using "internal" method
move ( string $src, string $dst, string $name ) : string | false Move file Return new file path or false.
nameAccepted ( string $name ) : boolean Validate file name based on $this->options['acceptedName'] regexp
procExec ( string $command, array &$output = null, array &$return_var, array &$error_output = null ) : integer Execute shell command
remove ( string $path, boolean $force = false ) : boolean Remove file/ recursive remove dir
rmTmb ( string $stat ) : void Remove thumbnail, also remove recursively if stat is directory
setError ( $error ) : false Save error message
stat ( string $path ) : array Return fileinfo
stripos ( string $haystack, string $needle, integer $offset ) : integer | boolean Find position of first occurrence of string in a string with multibyte support
tmbname ( array $stat ) : string Return thumbnail file name for required file
uncrypt ( $hash ) : mixed Return uncrypted path Not implemented
updateCache ( string $path, array $stat ) : array Put file stat in cache and return it

Описание методов

_abspath() абстрактный защищенный Метод

Convert path related to root dir into real path
Автор: Dmitry (dio) Levashov
abstract protected _abspath ( string $path ) : string
$path string rel file path
Результат string

_archive() абстрактный защищенный Метод

Create archive and return its path
Автор: Dmitry (dio) Levashov,
Автор: Alexey Sukhotin
abstract protected _archive ( string $dir, array $files, string $name, array $arc ) : string | boolean
$dir string target dir
$files array files names list
$name string archive name
$arc array archiver options
Результат string | boolean

_basename() абстрактный защищенный Метод

Return file name
Автор: Dmitry (dio) Levashov
abstract protected _basename ( string $path ) : string
$path string file path
Результат string

_checkArchivers() абстрактный защищенный Метод

Detect available archivers
Автор: Dmitry (dio) Levashov,
Автор: Alexey Sukhotin
abstract protected _checkArchivers ( ) : void
Результат void

_copy() абстрактный защищенный Метод

Copy file into another file (only inside one volume)
Автор: Dmitry (dio) Levashov
abstract protected _copy ( string $source, $targetDir, string $name ) : boolean
$source string source file path
$name string file name
Результат boolean

_dimensions() абстрактный защищенный Метод

..
Автор: Dmitry (dio) Levashov
abstract protected _dimensions ( string $path, string $mime ) : string
$path string file path
$mime string file mime type
Результат string

_dirname() абстрактный защищенный Метод

Return parent directory path
Автор: Dmitry (dio) Levashov
abstract protected _dirname ( string $path ) : string
$path string file path
Результат string

_extract() абстрактный защищенный Метод

Extract files from archive
Автор: Dmitry (dio) Levashov,
Автор: Alexey Sukhotin
abstract protected _extract ( string $path, array $arc ) : boolean
$path string file path
$arc array archiver options
Результат boolean

_fclose() абстрактный защищенный Метод

Close opened file
Автор: Dmitry (dio) Levashov
abstract protected _fclose ( resource $fp, string $path = '' ) : boolean
$fp resource file pointer
$path string file path
Результат boolean

_filePutContents() абстрактный защищенный Метод

Write a string to a file
Автор: Dmitry (dio) Levashov
abstract protected _filePutContents ( string $path, string $content ) : boolean
$path string file path
$content string new file content
Результат boolean

_fopen() абстрактный защищенный Метод

Open file and return file pointer
Автор: Dmitry (dio) Levashov
abstract protected _fopen ( string $path, $mode = "rb" ) : resource | false
$path string file path
Результат resource | false

_getContents() абстрактный защищенный Метод

Get file contents
Автор: Dmitry (dio) Levashov
abstract protected _getContents ( string $path ) : string | false
$path string file path
Результат string | false

_inpath() абстрактный защищенный Метод

Return true if $path is children of $parent
Автор: Dmitry (dio) Levashov
abstract protected _inpath ( string $path, string $parent ) : boolean
$path string path to check
$parent string parent path
Результат boolean

_joinPath() абстрактный защищенный Метод

Some drivers (db) use int as path - so we give to concat path to driver itself
Автор: Dmitry (dio) Levashov
abstract protected _joinPath ( string $dir, string $name ) : string
$dir string dir path
$name string file name
Результат string

_mkdir() абстрактный защищенный Метод

Create dir and return created dir path or false on failed
Автор: Dmitry (dio) Levashov
abstract protected _mkdir ( string $path, string $name ) : string | boolean
$path string parent dir path
$name string new directory name
Результат string | boolean

_mkfile() абстрактный защищенный Метод

Create file and return it's path or false on failed
Автор: Dmitry (dio) Levashov
abstract protected _mkfile ( string $path, string $name ) : string | boolean
$path string parent dir path
$name string new file name
Результат string | boolean

_move() абстрактный защищенный Метод

Return new file path or false.
Автор: Dmitry (dio) Levashov
abstract protected _move ( string $source, $targetDir, string $name ) : string | boolean
$source string source file path
$name string file name
Результат string | boolean

_normpath() абстрактный защищенный Метод

Return normalized path
Автор: Dmitry (dio) Levashov
abstract protected _normpath ( string $path ) : string
$path string file path
Результат string

_path() абстрактный защищенный Метод

Required to show path on client side.
Автор: Dmitry (dio) Levashov
abstract protected _path ( string $path ) : string
$path string file path
Результат string

_relpath() абстрактный защищенный Метод

Return file path related to root dir
Автор: Dmitry (dio) Levashov
abstract protected _relpath ( string $path ) : string
$path string file path
Результат string

_rmdir() абстрактный защищенный Метод

Remove dir
Автор: Dmitry (dio) Levashov
abstract protected _rmdir ( string $path ) : boolean
$path string dir path
Результат boolean

_save() абстрактный защищенный Метод

Return new file path or false on error.
Автор: Dmitry (dio) Levashov
abstract protected _save ( resource $fp, string $dir, string $name, array $stat ) : boolean | string
$fp resource file pointer
$dir string target dir path
$name string file name
$stat array file stat (required by some virtual fs)
Результат boolean | string

_scandir() абстрактный защищенный Метод

Return files list in directory
Автор: Dmitry (dio) Levashov
abstract protected _scandir ( string $path ) : array
$path string dir path
Результат array

_stat() абстрактный защищенный Метод

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.
Автор: Dmitry (dio) Levashov
abstract protected _stat ( string $path ) : array | false
$path string file path
Результат array | false

_subdirs() абстрактный защищенный Метод

Return true if path is dir and has at least one childs directory
Автор: Dmitry (dio) Levashov
abstract protected _subdirs ( string $path ) : boolean
$path string dir path
Результат boolean

allowCreate() защищенный Метод

Return true if file with given name can be created in given folder.
Автор: Dmitry (dio) Levashov
protected allowCreate ( string $dir, string $name ) : boolean
$dir string parent dir path
$name string new file name
Результат boolean

archive() публичный Метод

Add files to archive
public archive ( $hashes, $mime ) : void
Результат void

attr() защищенный Метод

Check file attribute
Автор: Dmitry (dio) Levashov
protected attr ( string $path, string $name, boolean $val = null ) : boolean
$path string file path
$name string attribute name (read|write|locked|hidden)
$val boolean attribute value returned by file system
Результат boolean

cacheDir() защищенный Метод

Get stat for folder content and put in cache
Автор: Dmitry (dio) Levashov
protected cacheDir ( string $path ) : void
$path string
Результат void

canCreateTmb() защищенный Метод

Return true if thumnbnail for required file can be created
Автор: Dmitry (dio) Levashov
protected canCreateTmb ( string $path, array $stat ) : string | boolean
$path string thumnbnail path
$stat array file stat
Результат string | boolean

canResize() защищенный Метод

By default - the same as canCreateTmb
Автор: Dmitry (dio) Levashov
protected canResize ( string $path, array $stat ) : string | boolean
$path string thumnbnail path
$stat array file stat
Результат string | boolean

childsByAttr() защищенный Метод

Return first found children with required attr == $val
Автор: Dmitry (dio) Levashov
protected childsByAttr ( string $path, string $attr, boolean $val ) : string | false
$path string file path
$attr string attribute name
$val boolean attribute value
Результат string | false

clearcache() защищенный Метод

Clean cache
Автор: Dmitry (dio) Levashov
protected clearcache ( ) : void
Результат void

close() публичный Метод

Close file pointer
Автор: Dmitry (dio) Levashov
public close ( Resource $fp, string $hash ) : void
$fp Resource file pointer
$hash string file hash
Результат void

closest() публичный Метод

Return file/dir hash or first founded child hash with required attr == $val
Автор: Dmitry (dio) Levashov
public closest ( string $hash, string $attr, boolean $val ) : string | false
$hash string file hash
$attr string attribute name
$val boolean attribute value
Результат string | false

closestByAttr() защищенный Метод

If file has required attr == $val - return file path, If dir has child with has required attr == $val - return child path
Автор: Dmitry (dio) Levashov
protected closestByAttr ( string $path, string $attr, boolean $val ) : string | false
$path string file path
$attr string attribute name
$val boolean attribute value
Результат string | false

commandDisabled() публичный Метод

Return true if command disabled in options
Автор: Dmitry (dio) Levashov
public commandDisabled ( string $cmd ) : boolean
$cmd string command name
Результат boolean

configure() защищенный Метод

By default set thumbnails path and image manipulation library.
Автор: Dmitry (dio) Levashov
protected configure ( ) : void
Результат void

copy() защищенный Метод

Return new file path or false.
Автор: Dmitry (dio) Levashov
protected copy ( string $src, string $dst, string $name ) : string | false
$src string source path
$dst string destination dir path
$name string new file name (optionaly)
Результат string | false

copyFrom() защищенный Метод

Return new file path or false.
Автор: Dmitry (dio) Levashov
protected copyFrom ( Object $volume, string $src, string $destination, string $name ) : string | false
$volume Object source volume
$src string source file hash
$destination string destination dir path
$name string file name
Результат string | false

copyFromAllowed() публичный Метод

Return true if copy from this volume allowed
Автор: Dmitry (dio) Levashov
public copyFromAllowed ( ) : boolean
Результат boolean

countSize() защищенный Метод

Return file/total directory size
Автор: Dmitry (dio) Levashov
protected countSize ( string $path ) : integer
$path string file path
Результат integer

createTmb() защищенный Метод

Create thumnbnail and return it's URL on success
Автор: Dmitry (dio) Levashov
protected createTmb ( string $path, $stat ) : string | false
$path string file path
Результат string | false

crypt() защищенный Метод

Return crypted path Not implemented
Автор: Dmitry (dio) Levashov
protected crypt ( $path ) : mixed
Результат mixed

debug() публичный Метод

Return debug info for client
Автор: Dmitry (dio) Levashov
public debug ( ) : array
Результат array

decode() защищенный Метод

Decode path from hash
Автор: Dmitry (dio) Levashov
Автор: Troex Nevelin
protected decode ( $hash ) : string
Результат string

defaultPath() публичный Метод

Return root or startPath hash
Автор: Dmitry (dio) Levashov
public defaultPath ( ) : string
Результат string

dimensions() публичный Метод

Return image dimensions
Автор: Dmitry (dio) Levashov
public dimensions ( string $hash ) : array
$hash string file hash
Результат array

dir() публичный Метод

Return folder info
Автор: Dmitry (dio) Levashov
public dir ( string $hash, $resolveLink = false ) : array | false
$hash string folder hash
Результат array | false

doSearch() защищенный Метод

Recursive files search
Автор: Dmitry (dio) Levashov
protected doSearch ( string $path, string $q, array $mimes ) : array
$path string dir path
$q string search string
$mimes array
Результат array

driverId() публичный Метод

Return driver id. Used as a part of volume id.
Автор: Dmitry (dio) Levashov
public driverId ( ) : string
Результат string

duplicate() публичный Метод

Create file copy with suffix "copy number" and return its info
Автор: Dmitry (dio) Levashov
public duplicate ( string $hash, string $suffix = 'copy' ) : array | false
$hash string file hash
$suffix string suffix to add to file name
Результат array | false

encode() защищенный Метод

Encode path into hash
Автор: Dmitry (dio) Levashov
Автор: Troex Nevelin
protected encode ( $path ) : string
Результат string

error() публичный Метод

Return error message from last failed action
Автор: Dmitry (dio) Levashov
public error ( ) : array
Результат array

extract() публичный Метод

Extract files from archive
Автор: Dmitry (dio) Levashov,
Автор: Alexey Sukhotin
public extract ( string $hash ) : array | boolean
$hash string archive hash
Результат array | boolean

file() публичный Метод

Return file info or false on error
Автор: Dmitry (dio) Levashov
public file ( string $hash ) : array | false
$hash string file hash
Результат array | false

gdImage() защищенный Метод

Output gd image to file
protected gdImage ( resource $image, string $filename, string $destformat, string $mime )
$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

gdImageBackground() защищенный Метод

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

gdImageCreate() защищенный Метод

Create an gd image according to the specified mime type
protected gdImageCreate ( string $path, string $mime ) : gd
$path string image file
$mime string
Результат gd image resource identifier

getContents() публичный Метод

Return file contents
Автор: Dmitry (dio) Levashov
public getContents ( string $hash ) : string | false
$hash string file hash
Результат string | false

getScandir() защищенный Метод

If onlyMimes is set - return only dirs and files of required mimes
Автор: Dmitry (dio) Levashov
protected getScandir ( string $path ) : array
$path string dir path
Результат array

gettmb() защищенный Метод

Return thumnbnail name if exists
Автор: Dmitry (dio) Levashov
protected gettmb ( string $path, array $stat ) : string | false
$path string file path
$stat array file stat
Результат string | false

gettree() защищенный Метод

Return subdirs tree
Автор: Dmitry (dio) Levashov
protected gettree ( string $path, integer $deep, $exclude = '' ) : array
$path string parent dir path
$deep integer tree deep
Результат array

id() публичный Метод

Return volume id
Автор: Dmitry (dio) Levashov
public id ( ) : string
Результат string

imgCrop() защищенный Метод

Crop image
Автор: Dmitry (dio) Levashov
Автор: Alexey Sukhotin
protected imgCrop ( string $path, integer $width, integer $height, boolean $x, boolean $y, string $destformat = null ) : string | false
$path string image file
$width integer crop width
$height integer crop height
$x boolean crop left offset
$y boolean crop top offset
$destformat string image destination format
Результат string | false

imgResize() защищенный Метод

Resize image
Автор: Dmitry (dio) Levashov
Автор: Alexey Sukhotin
protected imgResize ( string $path, integer $width, integer $height, boolean $keepProportions = false, boolean $resizeByBiggerSide = true, string $destformat = null ) : string | false
$path string image file
$width integer new width
$height integer new height
$keepProportions boolean crop image
$resizeByBiggerSide boolean resize image based on bigger side if true
$destformat string image destination format
Результат string | false

imgRotate() защищенный Метод

Rotate image
Автор: nao-pon
Автор: Troex Nevelin
protected imgRotate ( string $path, integer $degree, string $bgcolor = '#ffffff', string $destformat = null ) : string | false
$path string image file
$degree integer rotete degrees
$bgcolor string square background color in #rrggbb format
$destformat string image destination format
Результат string | false

imgSquareFit() защищенный Метод

Put image to square
Автор: Dmitry (dio) Levashov
Автор: Alexey Sukhotin
protected imgSquareFit ( string $path, integer $width, integer $height, integer $align = 'center', integer $valign = 'middle', string $bgcolor = '#0000ff', string $destformat = null ) : string | false
$path string image file
$width integer square width
$height integer square height
$align integer reserved
$valign integer reserved
$bgcolor string square background color in #rrggbb format
$destformat string image destination format
Результат string | false

init() защищенный Метод

Return true if volume is ready.
Автор: Dmitry (dio) Levashov
protected init ( ) : boolean
Результат boolean

isReadable() публичный Метод

Return true if voume is readable.
Автор: Dmitry (dio) Levashov
public isReadable ( ) : boolean
Результат boolean

isSameType() защищенный Метод

Return true if all mimes is directory or files
Автор: Dmitry (dio) Levashov
protected isSameType ( string $mime1, string $mime2 ) : boolean
$mime1 string mimetype
$mime2 string mimetype
Результат boolean

ls() публичный Метод

Return dir files names list
Автор: Dmitry (dio) Levashov
public ls ( string $hash ) : array
$hash string file hash
Результат array

mimeAccepted() публичный Метод

Return true if mime is required mimes list
Автор: Dmitry (dio) Levashov
Автор: Troex Nevelin
public mimeAccepted ( string $mime, array $mimes = [], boolean | null $empty = true ) : boolean | null
$mime string mime type to check
$mimes array allowed mime types list or not set to use client mimes list
$empty boolean | null what to return on empty list
Результат boolean | null

mimetype() защищенный Метод

Return file mimetype
Автор: Dmitry (dio) Levashov
protected mimetype ( string $path, $name = '' ) : string
$path string file path
Результат string

mimetypeInternalDetect() защищенный статический Метод

Detect file mimetype using "internal" method
Автор: Dmitry (dio) Levashov
protected static mimetypeInternalDetect ( string $path ) : string
$path string file path
Результат string

mkdir() публичный Метод

Create directory and return dir info
Автор: Dmitry (dio) Levashov
public mkdir ( string $dst, string $name ) : array | false
$dst string destination directory
$name string directory name
Результат array | false

mkfile() публичный Метод

Create empty file and return its info
Автор: Dmitry (dio) Levashov
public mkfile ( string $dst, string $name ) : array | false
$dst string destination directory
$name string file name
Результат array | false

mount() публичный Метод

Return true if volume available for read or write, false - otherwise
Автор: Dmitry (dio) Levashov
Автор: Alexey Sukhotin
public mount ( array $opts ) : boolean
$opts array
Результат boolean

move() защищенный Метод

Move file Return new file path or false.
Автор: Dmitry (dio) Levashov
protected move ( string $src, string $dst, string $name ) : string | false
$src string source path
$dst string destination dir path
$name string new file name
Результат string | false

nameAccepted() защищенный Метод

Validate file name based on $this->options['acceptedName'] regexp
Автор: Dmitry (dio) Levashov
protected nameAccepted ( string $name ) : boolean
$name string file name
Результат boolean

open() публичный Метод

Open file for reading and return file pointer
Автор: Dmitry (dio) Levashov
public open ( $hash ) : Resource
Результат Resource

options() публичный Метод

Return volume options required by client:
Автор: Dmitry (dio) Levashov
public options ( $hash ) : array
Результат array

parents() публичный Метод

Return part of dirs tree from required dir up to root dir
Автор: Dmitry (dio) Levashov
public parents ( string $hash ) : array
$hash string directory hash
Результат array

paste() публичный Метод

Paste files
Автор: Dmitry (dio) Levashov
public paste ( Object $volume, $src, string $dst, boolean $rmSrc = false ) : array | false
$volume Object source volume
$dst string destination dir hash
$rmSrc boolean remove source after copy?
Результат array | false

path() публичный Метод

Return file path related to root
Автор: Dmitry (dio) Levashov
public path ( string $hash ) : string
$hash string file hash
Результат string

procExec() защищенный Метод

Execute shell command
Автор: Alexey Sukhotin
protected procExec ( string $command, array &$output = null, array &$return_var, array &$error_output = null ) : integer
$command string command line
$output array stdout strings
$return_var array process exit code
$error_output array stderr strings
Результат integer exit code

putContents() публичный Метод

Put content in text file and return file info.
Автор: Dmitry (dio) Levashov
public putContents ( string $hash, string $content ) : array
$hash string file hash
$content string new file content
Результат array

realpath() публичный Метод

Return file real path if file exists
Автор: Dmitry (dio) Levashov
public realpath ( string $hash ) : string
$hash string file hash
Результат string

remove() защищенный Метод

Remove file/ recursive remove dir
Автор: Dmitry (dio) Levashov
protected remove ( string $path, boolean $force = false ) : boolean
$path string file path
$force boolean try to remove even if file locked
Результат boolean

removed() публичный Метод

Return list of moved/overwrited files
Автор: Dmitry (dio) Levashov
public removed ( ) : array
Результат array

rename() публичный Метод

Rename file and return file info
Автор: Dmitry (dio) Levashov
public rename ( string $hash, string $name ) : array | false
$hash string file hash
$name string new file name
Результат array | false

resetRemoved() публичный Метод

Clean removed files list
Автор: Dmitry (dio) Levashov
public resetRemoved ( ) : void
Результат void

resize() публичный Метод

Resize image
Автор: Dmitry (dio) Levashov
Автор: Alexey Sukhotin
Автор: nao-pon
Автор: Troex Nevelin
public resize ( string $hash, integer $width, integer $height, integer $x, integer $y, string $mode = 'resize', $bg = '', $degree ) : array | false
$hash string image file
$width integer new width
$height integer new height
$x integer X start poistion for crop
$y integer Y start poistion for crop
$mode string action how to mainpulate image
Результат array | false

rm() публичный Метод

Remove file/dir
Автор: Dmitry (dio) Levashov
public rm ( string $hash ) : boolean
$hash string file hash
Результат boolean

rmTmb() защищенный Метод

Remove thumbnail, also remove recursively if stat is directory
Автор: Dmitry (dio) Levashov
Автор: Naoki Sawada
Автор: Troex Nevelin
protected rmTmb ( string $stat ) : void
$stat string file stat
Результат void

root() публичный Метод

Return root folder hash
Автор: Dmitry (dio) Levashov
public root ( ) : string
Результат string

scandir() публичный Метод

Return directory content or false on error
Автор: Dmitry (dio) Levashov
public scandir ( string $hash ) : array | false
$hash string file hash
Результат array | false

setError() защищенный Метод

Save error message
Автор: Dmitry(dio) Levashov
protected setError ( $error ) : false
Результат false

setMimesFilter() публичный Метод

Set mimetypes allowed to display to client
Автор: Dmitry (dio) Levashov
public setMimesFilter ( array $mimes ) : void
$mimes array
Результат void

size() публичный Метод

Return file size / total directory size
Автор: Dmitry (dio) Levashov
public size ( $hash ) : integer
Результат integer

stat() защищенный Метод

Return fileinfo
Автор: Dmitry (dio) Levashov
protected stat ( string $path ) : array
$path string file cache
Результат array

stripos() защищенный Метод

Find position of first occurrence of string in a string with multibyte support
Автор: Alexey Sukhotin
protected stripos ( string $haystack, string $needle, integer $offset ) : integer | boolean
$haystack string The string being checked.
$needle string The string to find in haystack.
$offset integer The search offset. If it is not specified, 0 is used.
Результат integer | boolean

tmb() публичный Метод

Create thumbnail for required file and return its name of false on failed
Автор: Dmitry (dio) Levashov
public tmb ( $hash ) : string | false
Результат string | false

tmbname() защищенный Метод

Return thumbnail file name for required file
Автор: Dmitry (dio) Levashov
protected tmbname ( array $stat ) : string
$stat array file stat
Результат string

tree() публичный Метод

Return subfolders for required folder or false on error
Автор: Dmitry (dio) Levashov
public tree ( string $hash = '', integer $deep, string $exclude = '' ) : array | false
$hash string folder hash or empty string to get tree from root folder
$deep integer subdir deep
$exclude string dir hash which subfolders must be exluded from result, required to not get stat twice on cwd subfolders
Результат array | false

umount() публичный Метод

Some "unmount" stuffs - may be required by virtual fs
Автор: Dmitry (dio) Levashov
public umount ( ) : void
Результат void

uncrypt() защищенный Метод

Return uncrypted path Not implemented
Автор: Dmitry (dio) Levashov
protected uncrypt ( $hash ) : mixed
Результат mixed

uniqueName() публичный Метод

Return new unique name based on file name and suffix
Автор: Dmitry (dio) Levashov
public uniqueName ( $dir, $name, string $suffix = ' copy', $checkNum = true ) : string
$suffix string suffix append to name
Результат string

updateCache() защищенный Метод

Put file stat in cache and return it
Автор: Dmitry (dio) Levashov
protected updateCache ( string $path, array $stat ) : array
$path string file path
$stat array file stat
Результат array

upload() публичный Метод

On success return array with new file stat and with removed file hash (if existed file was replaced)
Автор: Dmitry (dio) Levashov
public upload ( Resource $fp, string $dst, $name, string $tmpname ) : array | false
$fp Resource file pointer
$dst string destination folder hash
$tmpname string file tmp name - required to detect mime type
Результат array | false

Описание свойств

$URL защищенное свойство

Base URL
protected string $URL
Результат string

$access защищенное свойство

Access control function/class
protected mixed $access
Результат mixed

$archivers защищенное свойство

Archivers config
protected array $archivers
Результат array

$attributes защищенное свойство

Access control function/class
protected mixed $attributes
Результат mixed

$cache защищенное свойство

Cache storage
protected array $cache
Результат array

$cryptLib защищенное свойство

Library to crypt files name
protected string $cryptLib
Результат string

$defaults защищенное свойство

Defaults permissions
protected array $defaults
Результат array

$diabled защищенное свойство

List of disabled client's commands
protected array $diabled
Результат array

$dirsCache защищенное свойство

Cache by folders
protected array $dirsCache
Результат array

$driverId защищенное свойство

Driver id Must be started from letter and contains [a-z0-9] Used as part of volume id
protected string $driverId
Результат string

$error защищенное свойство

Errors from last failed action
protected array $error
Результат array

$finfo защищенное свойство

Finfo object for mimeDetect == 'finfo'
protected object $finfo
Результат object

$id защищенное свойство

Volume id - used as prefix for files hashes
protected string $id
Результат string

$imgLib защищенное свойство

Image manipulation lib name auto|imagick|mogtify|gd
protected string $imgLib
Результат string

$mimeDetect защищенное свойство

Mimetype detect method
protected string $mimeDetect
Результат string

$mimetypes защищенное статическое свойство

default extensions/mimetypes for mimeDetect == 'internal'
protected static array $mimetypes
Результат array

$mounted защищенное свойство

Flag - volume "mounted" and available
protected bool $mounted
Результат boolean

$onlyMimes защищенное свойство

Mimetypes allowed to display
protected array $onlyMimes
Результат array

$options защищенное свойство

Object configuration
protected array $options
Результат array

$removed защищенное свойство

Store files moved or overwrited files info
protected array $removed
Результат array

$root защищенное свойство

Root directory path
protected string $root
Результат string

$rootName защищенное свойство

Root basename | alias
protected string $rootName
Результат string

$separator защищенное свойство

Directory separator - required by client
protected string $separator
Результат string

$startPath защищенное свойство

Default directory to open
protected string $startPath
Результат string

$tmbPath защищенное свойство

Thumbnails dir path
protected string $tmbPath
Результат string

$tmbPathWritable защищенное свойство

Is thumbnails dir writable
protected bool $tmbPathWritable
Результат boolean

$tmbSize защищенное свойство

Thumbnails size in px
protected int $tmbSize
Результат integer

$tmbURL защищенное свойство

Thumbnails base URL
protected string $tmbURL
Результат string

$today защищенное свойство

Today 24:00 timestamp
protected int $today
Результат integer

$treeDeep защищенное свойство

How many subdirs levels return for tree
protected int $treeDeep
Результат integer

$uploadAllow защищенное свойство

Mime types allowed to upload
protected array $uploadAllow
Результат array

$uploadDeny защищенное свойство

Mime types denied to upload
protected array $uploadDeny
Результат array

$uploadMaxSize защищенное свойство

Set as number or string with unit - "10M", "500K", "1G"
protected int|string $uploadMaxSize
Результат integer | string

$uploadOrder защищенное свойство

Order to validate uploadAllow and uploadDeny
protected array $uploadOrder
Результат array

$yesterday защищенное свойство

Yesterday 24:00 timestamp
protected int $yesterday
Результат integer