PHP Interface FOF30\Platform\FilesystemInterface

Afficher le fichier Open project: akeeba/fof

Méthodes publiques

Méthode Description
__construct ( Container $c ) Public constructor.
fileCopy ( string $src, string $dest ) : boolean Copies a file
fileDelete ( mixed $file ) : boolean Delete a file or array of files
fileExists ( $path ) : boolean Does the file exists?
fileWrite ( string $file, &$buffer ) : boolean Write contents to a file
folderCreate ( string $path = '', integer $mode = 493 ) : boolean Create a folder -- and all necessary parent folders.
folderExists ( string $path ) : boolean Wrapper for the standard file_exists function
folderFiles ( string $path, string $filter = '.', mixed $recurse = false, boolean $full = false, array $exclude = ['.svn', 'CVS', '.DS_Store', '__MACOSX'], array $excludefilter = ['^\..*', '.*~'] ) : array Utility function to read the files in a folder.
folderFolders ( string $path, string $filter = '.', mixed $recurse = false, boolean $full = false, array $exclude = ['.svn', 'CVS', '.DS_Store', '__MACOSX'], array $excludefilter = ['^\..*'] ) : array Utility function to read the folders in a folder.
getExt ( string $file ) : string Gets the extension of a file name
pathCheck ( string $path ) : string Checks for snooping outside of the file system root.
pathClean ( string $path, string $ds = DIRECTORY_SEPARATOR ) : string Function to strip additional / or \ in a path name.
pathFind ( mixed $paths, string $file ) : mixed Searches the directory paths for a given file.
stripExt ( string $file ) : string Strips the last extension off of a file name

Method Details

__construct() public méthode

Public constructor.
public __construct ( Container $c )
$c FOF30\Container\Container The component container

fileCopy() public méthode

Copies a file
public fileCopy ( string $src, string $dest ) : boolean
$src string The path to the source file
$dest string The path to the destination file
Résultat boolean True on success

fileDelete() public méthode

Delete a file or array of files
public fileDelete ( mixed $file ) : boolean
$file mixed The file name or an array of file names
Résultat boolean True on success

fileExists() public méthode

Does the file exists?
public fileExists ( $path ) : boolean
$path string Path to the file to test
Résultat boolean

fileWrite() public méthode

Write contents to a file
public fileWrite ( string $file, &$buffer ) : boolean
$file string The full file path
Résultat boolean True on success

folderCreate() public méthode

Create a folder -- and all necessary parent folders.
public folderCreate ( string $path = '', integer $mode = 493 ) : boolean
$path string A path to create from the base path.
$mode integer Directory permissions to set for folders created. 0755 by default.
Résultat boolean True if successful.

folderExists() public méthode

Wrapper for the standard file_exists function
public folderExists ( string $path ) : boolean
$path string Folder name relative to installation dir
Résultat boolean True if path is a folder

folderFiles() public méthode

Utility function to read the files in a folder.
public folderFiles ( string $path, string $filter = '.', mixed $recurse = false, boolean $full = false, array $exclude = ['.svn', 'CVS', '.DS_Store', '__MACOSX'], array $excludefilter = ['^\..*', '.*~'] ) : array
$path string The path of the folder to read.
$filter string A filter for file names.
$recurse mixed True to recursively search into sub-folders, or an integer to specify the maximum depth.
$full boolean True to return the full path to the file.
$exclude array Array with names of files which should not be shown in the result.
$excludefilter array Array of filter to exclude
Résultat array Files in the given folder.

folderFolders() public méthode

Utility function to read the folders in a folder.
public folderFolders ( string $path, string $filter = '.', mixed $recurse = false, boolean $full = false, array $exclude = ['.svn', 'CVS', '.DS_Store', '__MACOSX'], array $excludefilter = ['^\..*'] ) : array
$path string The path of the folder to read.
$filter string A filter for folder names.
$recurse mixed True to recursively search into sub-folders, or an integer to specify the maximum depth.
$full boolean True to return the full path to the folders.
$exclude array Array with names of folders which should not be shown in the result.
$excludefilter array Array with regular expressions matching folders which should not be shown in the result.
Résultat array Folders in the given folder.

getExt() public méthode

Gets the extension of a file name
public getExt ( string $file ) : string
$file string The file name
Résultat string The file extension

pathCheck() public méthode

Checks for snooping outside of the file system root.
public pathCheck ( string $path ) : string
$path string A file system path to check.
Résultat string A cleaned version of the path or exit on error.

pathClean() public méthode

Function to strip additional / or \ in a path name.
public pathClean ( string $path, string $ds = DIRECTORY_SEPARATOR ) : string
$path string The path to clean.
$ds string Directory separator (optional).
Résultat string The cleaned path.

pathFind() public méthode

Searches the directory paths for a given file.
public pathFind ( mixed $paths, string $file ) : mixed
$paths mixed An path string or array of path strings to search in
$file string The file name to look for.
Résultat 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.

stripExt() public méthode

Strips the last extension off of a file name
public stripExt ( string $file ) : string
$file string The file name
Résultat string The file name without the extension