PHP Class WPDKFilesystem

Author: =undo= ([email protected])
Inheritance: extends WPDKObject
Afficher le fichier Open project: wpxtreme/wpdk Class Usage Examples

Méthodes publiques

Свойство Type Description
$__version string Override version

Méthodes publiques

Méthode Description
_rglob ( string $path, string $match = '', &$result = [] ) : array Return an array with all matched files from root folder.
append ( string $data, string $filename ) : boolean Append data to a file and return TRUE on successfully, FALSE otherwise.
ext ( string $filename ) : string Return the extension of a filename
fileSize ( string $filename, integer $precision = 2 ) : string | boolean Return the file size (B, KiB, MiB, GiB, TiB, PiB, EiB, ZiB, YiB) well formatted. Return FALSE if file doesn't exists or filesize() failure.
filename ( string $filename ) : string Return the only filename part. if a filename is 'test.black.jpg' will return 'test.black'
recursiveScan ( string $path, string $match = '' ) : array Return an array with all matched files from root folder. This method release the follow filters:

Method Details

_rglob() public méthode

Return an array with all matched files from root folder.
public _rglob ( string $path, string $match = '', &$result = [] ) : array
$path string Folder root
$match string Optional. Regex to apply on file name. For example use '/^.*\.(php)$/i' to get only php file
Résultat array

append() public static méthode

Append data to a file and return TRUE on successfully, FALSE otherwise.
Since: 1.7.0
public static append ( string $data, string $filename ) : boolean
$data string Data to append.
$filename string Complete path filename.
Résultat boolean

ext() public static méthode

Return the extension of a filename
See also: filename()
public static ext ( string $filename ) : string
$filename string A comoplete filename
Résultat string

fileSize() public static méthode

Return the file size (B, KiB, MiB, GiB, TiB, PiB, EiB, ZiB, YiB) well formatted. Return FALSE if file doesn't exists or filesize() failure.
public static fileSize ( string $filename, integer $precision = 2 ) : string | boolean
$filename string File name or path to a file
$precision integer Digits to display after decimal
Résultat string | boolean

filename() public static méthode

Return the only filename part. if a filename is 'test.black.jpg' will return 'test.black'
See also: ext()
Since: 1.4.15
public static filename ( string $filename ) : string
$filename string A comoplete filename
Résultat string

recursiveScan() public static méthode

wpdk_rglob_find_dir( true, $file ) - when find a dir wpdk_rglob_find_file( true, $file ) - when find a a file wpdk_rglob_matched( $regexp_result, $file, $match ) - after preg_match() done
Since: 1.0.0.b4
public static recursiveScan ( string $path, string $match = '' ) : array
$path string Folder root
$match string Optional. Regex to apply on file name. For example use '/^.*\.(php)$/i' to get only php file. Default is empty
Résultat array

Property Details

$__version public_oe property

Override version
public string $__version
Résultat string