Methods summary
public
|
#
__construct( )
Constructor
Extend options with required fields
Constructor
Extend options with required fields
Author
Dmitry (dio) Levashov
Cem (DiscoFever)
|
public
array
|
#
netmountPrepare( $options )
Prepare
Call from elFinder::netmout() before volume->mount()
Prepare
Call from elFinder::netmout() before volume->mount()
Parameters
Returns
array volume root options
Author
Naoki Sawada
|
protected
boolean
|
#
init( )
Prepare FTP connection
Connect to remote server and check if credentials are correct, if so, store the connection id in $ftp_conn
Prepare FTP connection
Connect to remote server and check if credentials are correct, if so, store the connection id in $ftp_conn
Returns
boolean
Author
Dmitry (dio) Levashov
Cem (DiscoFever)
Overrides
|
protected
|
#
configure( )
Configure after successfull mount.
Configure after successfull mount.
Throws
Author
Dmitry (dio) Levashov
Overrides
|
protected
boolean
|
#
connect( )
Connect to ftp server
Returns
boolean
Author
Dmitry (dio) Levashov
|
protected
array
|
#
ftpRawList( string $path )
Call ftp_rawlist with option prefix
Call ftp_rawlist with option prefix
Parameters
Returns
array
|
public
|
#
umount( )
Close opened connection
Author
Dmitry (dio) Levashov
Overrides
|
protected
array
|
#
parseRaw( string $raw, $base, boolean $nameOnly = false )
Parse line from ftp_rawlist() output and return file stat (array)
Parse line from ftp_rawlist() output and return file stat (array)
Parameters
- $raw
- line from ftp_rawlist() output
- $base
- $nameOnly
Returns
array
Author
Dmitry Levashov
|
protected
array
|
#
normalizeRawWindows( string $raw )
Normalize MS-DOS style FTP LIST Raw line
Normalize MS-DOS style FTP LIST Raw line
Parameters
- $raw
- line from FTP LIST (MS-DOS style)
Returns
array
Author
Naoki Sawada
|
protected
array
|
#
parsePermissions( string $perm, Boolean $isowner = true )
Parse permissions string. Return array(read => true/false, write => true/false)
Parse permissions string. Return array(read => true/false, write => true/false)
Parameters
- $perm
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
- . Tell if the current user is the owner of the object.
Returns
array
Author
Dmitry (dio) Levashov
Ugo Vierucci
|
protected
|
#
cacheDir( string $path )
Cache dir contents
Parameters
Author
Dmitry Levashov
Overrides
|
protected
string
|
#
ftpMode( string $path )
Return ftp transfer mode for file
Return ftp transfer mode for file
Parameters
Returns
string
Author
Dmitry (dio) Levashov
|
protected
string
|
#
_dirname( string $path )
Return parent directory path
Return parent directory path
Parameters
Returns
string
Author
Naoki Sawada
|
protected
string
|
#
_basename( string $path )
Return file name
Parameters
Returns
string
Author
Naoki Sawada
|
protected
string
|
#
_joinPath( string $dir, string $name )
Join dir name and file name and retur full path
Join dir name and file name and retur full path
Parameters
Returns
string
Author
Dmitry (dio) Levashov
|
protected
string
|
#
_normpath( string $path )
Return normalized path, this works the same as os.path.normpath() in Python
Return normalized path, this works the same as os.path.normpath() in Python
Parameters
Returns
string
Author
Troex Nevelin
|
protected
string
|
#
_relpath( string $path )
Return file path related to root dir
Return file path related to root dir
Parameters
Returns
string
Author
Dmitry (dio) Levashov
|
protected
string
|
#
_abspath( string $path )
Convert path related to root dir into real path
Convert path related to root dir into real path
Parameters
Returns
string
Author
Dmitry (dio) Levashov
|
protected
string
|
#
_path( string $path )
Return fake path started from root dir
Return fake path started from root dir
Parameters
Returns
string
Author
Dmitry (dio) Levashov
|
protected
boolean
|
#
_inpath( string $path, string $parent )
Return true if $path is children of $parent
Return true if $path is children of $parent
Parameters
- $path
- path to check
- $parent
- parent path
Returns
boolean
Author
Dmitry (dio) Levashov
|
protected
array|false
|
#
_stat( string $path )
Return stat for given path.
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.
Return stat for given path.
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
Returns
array|false
Author
Dmitry (dio) Levashov
|
protected
boolean
|
#
_subdirs( string $path )
Return true if path is dir and has at least one childs directory
Return true if path is dir and has at least one childs directory
Parameters
Returns
boolean
Author
Dmitry (dio) Levashov
|
protected
string|false
|
#
_dimensions( string $path, string $mime )
Return object width and height
Ususaly used for images, but can be realize for video etc...
Return object width and height
Ususaly used for images, but can be realize for video etc...
Parameters
- $path
- file path
- $mime
- file mime type
Returns
string|false
Throws
Author
Dmitry (dio) Levashov
|
protected
array
|
#
_scandir( string $path )
Return files list in directory.
Return files list in directory.
Parameters
Returns
array
Author
Dmitry (dio) Levashov
Cem (DiscoFever)
|
protected
false|resource
|
#
_fopen( string $path, string $mode = 'rb' )
Open file and return file pointer
Open file and return file pointer
Parameters
Returns
false|resource
Throws
Author
Dmitry (dio) Levashov
|
protected
|
#
_fclose( resource $fp, string $path = '' )
Close opened file
Parameters
Author
Dmitry (dio) Levashov
|
protected
string|boolean
|
#
_mkdir( string $path, string $name )
Create dir and return created dir path or false on failed
Create dir and return created dir path or false on failed
Parameters
- $path
- parent dir path
- $name
- new directory name
Returns
string|boolean
Author
Dmitry (dio) Levashov
|
protected
string|boolean
|
#
_mkfile( string $path, string $name )
Create file and return it's path or false on failed
Create file and return it's path or false on failed
Parameters
- $path
- parent dir path
- $name
- new file name
Returns
string|boolean
Author
Dmitry (dio) Levashov
|
protected
boolean
|
#
_symlink( string $target, string $path, string $name )
Create symlink. FTP driver does not support symlinks.
Create symlink. FTP driver does not support symlinks.
Parameters
- $target
- link target
- $path
- symlink path
- $name
Returns
boolean
Author
Dmitry (dio) Levashov
|
protected
boolean
|
#
_copy( string $source, string $targetDir, string $name )
Copy file into another file
Copy file into another file
Parameters
- $source
- source file path
- $targetDir
- target directory path
- $name
- new file name
Returns
boolean
Author
Dmitry (dio) Levashov
|
protected
boolean|string
|
#
_move( string $source, $targetDir, string $name )
Move file into another parent dir.
Return new file path or false.
Move file into another parent dir.
Return new file path or false.
Parameters
- $source
- source file path
- $targetDir
- $name
- file name
Returns
boolean|string
Author
Dmitry (dio) Levashov
|
protected
boolean
|
#
_unlink( string $path )
Remove file
Parameters
Returns
boolean
Author
Dmitry (dio) Levashov
|
protected
boolean
|
#
_rmdir( string $path )
Remove dir
Parameters
Returns
boolean
Author
Dmitry (dio) Levashov
|
protected
boolean|string
|
#
_save( resource $fp, string $dir, string $name, array $stat )
Create new file and write into it from file pointer.
Return new file path or false on error.
Create new file and write into it from file pointer.
Return new file path or false on error.
Parameters
- $fp
- file pointer
- $dir
- target dir path
- $name
- file name
- $stat
- file stat (required by some virtual fs)
Returns
boolean|string
Author
Dmitry (dio) Levashov
|
protected
string|false
|
#
_getContents( string $path )
Get file contents
Parameters
Returns
string|false
Throws
Author
Dmitry (dio) Levashov
|
protected
boolean
|
#
_filePutContents( string $path, string $content )
Write a string to a file
Parameters
- $path
- file path
- $content
- new file content
Returns
boolean
Author
Dmitry (dio) Levashov
|
protected
|
#
_checkArchivers( )
Detect available archivers
Detect available archivers
Throws
|
protected
boolean
|
#
_chmod( string $path, string $mode )
chmod availability
Parameters
Returns
boolean
|
protected
string|boolean
|
#
_archive( string $dir, array $files, string $name, array $arc )
Create archive and return its path
Create archive and return its path
Parameters
- $dir
- target dir
- $files
- files names list
- $name
- archive name
- $arc
- archiver options
Returns
string|boolean
Throws
Author
Dmitry (dio) Levashov,
Alexey Sukhotin
|
protected
array
|
#
ftp_scan_dir( $remote_directory, $targets = null )
Gets an array of absolute remote FTP paths of files and
folders in $remote_directory omitting symbolic links.
Gets an array of absolute remote FTP paths of files and
folders in $remote_directory omitting symbolic links.
Parameters
- $remote_directory
- remote FTP path to scan for file and folders recursively
- $targets
- Array of target item.
null is to get all of items
Returns
array 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
|