Methods summary
public
|
#
__construct( string $path = '', boolean $create = true, mixed $mode = false )
Constructor.
Parameters
- $path
- Path to folder
- $create
- Create folder if not found
- $mode
- Mode (CHMOD) to apply to created folder, false to ignore
|
public
string
|
#
pwd( )
Return current path.
Returns
string Current path
|
public
string|false
|
#
cd( string $path )
Change directory to $desired_path.
Change directory to $desired_path.
Parameters
- $path
- Path to the directory to change to
Returns
string|false The new path. Returns false on failure
|
public
mixed
|
#
read( boolean $sort = true, mixed $exceptions = false )
Returns an array of the contents of the current directory, or false on failure.
The returned array holds two arrays: one of dirs and one of files.
Returns an array of the contents of the current directory, or false on failure.
The returned array holds two arrays: one of dirs and one of files.
Parameters
- $sort
- sort list or not
- $exceptions
- either an array or boolean true will no grab dot files
Returns
mixed Contents of current directory as an array, false on failure
|
public
array
|
#
find( string $regexp_pattern = '.*', boolean $sort = false, mixed $exceptions = false )
Returns an array of all matching files in current directory.
Returns an array of all matching files in current directory.
Parameters
- $regexp_pattern
- Preg_match pattern (Defaults to: .*)
- $sort
- sort file list or not
- $exceptions
- either an array or boolean true will no grab dot files
Returns
array Files that match given pattern
|
public
array
|
#
findRecursive( string $pattern = '.*', boolean $sort = false, mixed $exceptions = false )
Returns an array of all matching files in and below current directory.
Returns an array of all matching files in and below current directory.
Parameters
- $pattern
- Preg_match pattern (Defaults to: .*)
- $sort
- sort files or not
- $exceptions
- either an array or boolean true will no grab dot files
Returns
array Files matching $pattern
|
public static
boolean
|
#
isWindowsPath( string $path )
Returns true if given $path is a Windows path.
Returns true if given $path is a Windows path.
Parameters
Returns
boolean true if windows path, false otherwise
|
public static
boolean
|
#
isAbsolute( string $path )
Returns true if given $path is an absolute path.
Returns true if given $path is an absolute path.
Parameters
Returns
boolean
|
public static
string
|
#
normalizePath( string $path )
Returns a correct set of slashes for given $path. (\ for Windows paths and / for other paths.)
Returns a correct set of slashes for given $path. (\ for Windows paths and / for other paths.)
Parameters
Returns
string Set of slashes (\ or /)
|
public static
string
|
#
correctSlashFor( string $path )
Returns a correct set of slashes for given $path. (\ for Windows paths and / for other paths.)
Returns a correct set of slashes for given $path. (\ for Windows paths and / for other paths.)
Parameters
Returns
string Set of slashes ("\" or "/")
|
public static
string
|
#
slashTerm( string $path )
Returns $path with added terminating slash (corrected for Windows or other OS).
Returns $path with added terminating slash (corrected for Windows or other OS).
Parameters
Returns
string Path with ending slash
|
public static
string
|
#
addPathElement( string $path, string $element )
Returns $path with $element added, with correct slash in-between.
Returns $path with $element added, with correct slash in-between.
Parameters
- $path
- Path
- $element
- Element to and at end of path
Returns
string Combined path
|
public
boolean
|
#
inXoopsPath( string $path = '' )
Returns true if the File is in a given XoopsPath.
Returns true if the File is in a given XoopsPath.
Parameters
- $path
- path to look for file in
Returns
boolean
|
public
boolean
|
#
inPath( string $path = '', boolean $reverse = false )
Returns true if the File is in given path.
Returns true if the File is in given path.
Parameters
- $path
- Path to search
- $reverse
- reverse lookup
Returns
boolean
|
public
boolean
|
#
chmod( string $path, integer|boolean $mode = false, boolean $recursive = true, array $exceptions = array() )
Change the mode on a directory structure recursively.
Change the mode on a directory structure recursively.
Parameters
- $path
- The path to chmod
- $mode
- octal value 0755
- $recursive
- chmod recursively
- $exceptions
- array of files, directories to skip
Returns
boolean Returns TRUE on success, FALSE on failure
|
public
mixed
|
#
tree( string $path, boolean $hidden = true, string $type = null )
Returns an array of nested directories and files in each directory
Returns an array of nested directories and files in each directory
Parameters
- $path
- the directory path to build the tree from
- $hidden
- return hidden files and directories
- $type
- either file or dir. null returns both files and directories
Returns
mixed array of nested directories and files in each directory
|
public
boolean
|
#
create( string $pathname, integer|boolean $mode = false )
Create a directory structure recursively.
Create a directory structure recursively.
Parameters
- $pathname
- The directory structure to create
- $mode
- octal value 0755
Returns
boolean Returns TRUE on success, FALSE on failure
|
public
integer
|
#
dirsize( )
Returns the size in bytes of this Folder.
Returns the size in bytes of this Folder.
Returns
integer
|
public
boolean
|
#
delete( string $path )
Recursively Remove directories if system allow.
Recursively Remove directories if system allow.
Parameters
- $path
- Path of directory to delete
Returns
boolean Success
|
public
boolean
|
#
copy( array $options = array() )
Recursive directory copy.
Recursive directory copy.
Parameters
- $options
- (to, from, chmod, skip)
Returns
boolean
|
public
string|false
|
#
move( array $options )
Recursive directory move.
Recursive directory move.
Parameters
- $options
- (to, from, chmod, skip)
Returns
string|false Success
|
public
array
|
#
messages( )
get messages from latest method
get messages from latest method
Returns
array
|
public
array
|
#
errors( )
get error from latest method
get error from latest method
Returns
array
|
public
string
|
#
realpath( string $path )
Get the real path (taking ".." and such into account)
Get the real path (taking ".." and such into account)
Parameters
Returns
string The resolved path
|
public static
boolean
|
#
isSlashTerm( string $path )
Returns true if given $path ends in a slash (i.e. is slash-terminated).
Returns true if given $path ends in a slash (i.e. is slash-terminated).
Parameters
Returns
boolean true if path ends with slash, false otherwise
|