public
|
|
public
boolean
|
#
fileExists( mixed $path )
Does the file exists?
Parameters
- $path
mixed - $path string Path to the file to test
Returns
boolean
Implementation of
|
public
boolean
|
#
fileDelete( mixed $file )
Delete a file or array of files
Delete a file or array of files
Parameters
- $file
mixed - $file The file name or an array of file names
Returns
boolean - True on success
Implementation of
|
public
boolean
|
#
fileCopy( string $src, string $dest, string $path = null, boolean $use_streams = false )
Copies a file
Parameters
- $src
string - $src The path to the source file
- $dest
string - $dest The path to the destination file
- $path
string - $path An optional base path to prefix to the file names
- $use_streams
boolean - $use_streams True to use streams
Returns
boolean - True on success
Implementation of
|
public
boolean
|
#
fileWrite( string $file, string & $buffer, boolean $use_streams = false )
Write contents to a file
Parameters
- $file
string - $file The full file path
- $buffer
string - &$buffer The buffer to write
- $use_streams
boolean - $use_streams Use streams
Returns
boolean - True on success
Implementation of
|
public
string
|
#
pathCheck( string $path )
Checks for snooping outside of the file system root.
Checks for snooping outside of the file system root.
Parameters
- $path
string - $path A file system path to check.
Returns
string - A cleaned version of the path or exit on error.
Throws
Implementation of
|
public
string
|
#
pathClean( string $path, string $ds = DIRECTORY_SEPARATOR )
Function to strip additional / or \ in a path name.
Function to strip additional / or \ in a path name.
Parameters
- $path
string - $path The path to clean.
- $ds
string - $ds Directory separator (optional).
Returns
string - The cleaned path.
Throws
Implementation of
|
public
mixed
|
#
pathFind( mixed $paths, string $file )
Searches the directory paths for a given file.
Searches the directory paths for a given file.
Parameters
- $paths
mixed - $paths An path string or array of path strings to search in
- $file
string - $file The file name to look for.
Returns
mixed - The full path and file name for the target file, or boolean false if the file is
not found in any of the paths.
Implementation of
|
public
boolean
|
#
folderExists( string $path )
Wrapper for the standard file_exists function
Wrapper for the standard file_exists function
Parameters
- $path
string - $path Folder name relative to installation dir
Returns
boolean - True if path is a folder
Implementation of
|
public
array
|
#
folderFiles( string $path, string $filter = '.', mixed $recurse = false, boolean $full = false, array $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'), array $excludefilter = array('^\..*', '.*~'), boolean $naturalSort = false )
Utility function to read the files in a folder.
Utility function to read the files in a folder.
Parameters
- $path
string - $path The path of the folder to read.
- $filter
string - $filter A filter for file names.
- $recurse
mixed - $recurse True to recursively search into sub-folders, or an integer to specify
the maximum depth.
- $full
boolean - $full True to return the full path to the file.
- $exclude
array - $exclude Array with names of files which should not be shown in the result.
- $excludefilter
array - $excludefilter Array of filter to exclude
- $naturalSort
boolean - $naturalSort False for asort, true for natsort
Returns
array - Files in the given folder.
Implementation of
|
public
array
|
#
folderFolders( string $path, string $filter = '.', mixed $recurse = false, boolean $full = false, array $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'), array $excludefilter = array('^\..*') )
Utility function to read the folders in a folder.
Utility function to read the folders in a folder.
Parameters
- $path
string - $path The path of the folder to read.
- $filter
string - $filter A filter for folder names.
- $recurse
mixed - $recurse True to recursively search into sub-folders, or an integer to specify
the maximum depth.
- $full
boolean - $full True to return the full path to the folders.
- $exclude
array - $exclude Array with names of folders which should not be shown in the result.
- $excludefilter
array - $excludefilter Array with regular expressions matching folders which should not
be shown in the result.
Returns
array - Folders in the given folder.
Implementation of
|
public
boolean
|
#
folderCreate( string $path = '', integer $mode = 0755 )
Create a folder -- and all necessary parent folders.
Create a folder -- and all necessary parent folders.
Parameters
- $path
string - $path A path to create from the base path.
- $mode
integer - $mode Directory permissions to set for folders created. 0755 by default.
Returns
boolean - True if successful.
Implementation of
|