PHP 인터페이스 FOF30\Platform\FilesystemInterface

파일 보기 프로젝트 열기: akeeba/fof

공개 메소드들

메소드 설명
__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