PHP Интерфейс FOF30\Platform\FilesystemInterface

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

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

Метод Описание
__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

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

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

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

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

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
Результат boolean True on success

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

Delete a file or array of files
public fileDelete ( mixed $file ) : boolean
$file mixed The file name or an array of file names
Результат boolean True on success

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

Does the file exists?
public fileExists ( $path ) : boolean
$path string Path to the file to test
Результат boolean

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

Write contents to a file
public fileWrite ( string $file, &$buffer ) : boolean
$file string The full file path
Результат boolean True on success

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

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.
Результат boolean True if successful.

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

Wrapper for the standard file_exists function
public folderExists ( string $path ) : boolean
$path string Folder name relative to installation dir
Результат boolean True if path is a folder

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

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
Результат array Files in the given folder.

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

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.
Результат array Folders in the given folder.

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

Gets the extension of a file name
public getExt ( string $file ) : string
$file string The file name
Результат string The file extension

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

Checks for snooping outside of the file system root.
public pathCheck ( string $path ) : string
$path string A file system path to check.
Результат string A cleaned version of the path or exit on error.

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

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).
Результат string The cleaned path.

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

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.
Результат 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() публичный Метод

Strips the last extension off of a file name
public stripExt ( string $file ) : string
$file string The file name
Результат string The file name without the extension