PHP Class Microweber\Utils\Files

Datei anzeigen Open project: microweber/microweber Class Usage Examples

Public Methods

Method Description
copy_directory ( $source, $destination ) Copies directory recursively.
dir_tree ( $path = '.', $params = false )
dir_tree_build ( $dir, $params = false )
download_to_browser ( $filename )
file_size_nice ( $size ) Returns a human readable filesize.
get ( array $params ) : mixed get_files.
rglob ( integer | string $pattern = '*', integer $flags, string $path = '' ) : mixed Recursive glob().
rmdir ( $dirPath )

Private Methods

Method Description
_readfile_chunked ( $filename, $retbytes = true )
_readfile_laravel_chunked ( $path, $name = null, array $headers = [] )

Method Details

copy_directory() public method

Copies directory recursively.
public copy_directory ( $source, $destination )
$source
$destination

dir_tree() public method

public dir_tree ( $path = '.', $params = false )

dir_tree_build() public method

public dir_tree_build ( $dir, $params = false )

download_to_browser() public method

public download_to_browser ( $filename )

file_size_nice() public method

Returns a human readable filesize.
Author: wesman20 (php.net)
Author: Jonas John
public file_size_nice ( $size )

get() public method

Get an array that represents directory and files
Since: 0.320
public get ( array $params ) : mixed
$params array = array() the params
return mixed Array with files

rglob() public method

Recursive glob().
public rglob ( integer | string $pattern = '*', integer $flags, string $path = '' ) : mixed
$pattern integer | string the pattern passed to glob()
$flags integer the flags passed to glob()
$path string the path to scan
return mixed an array of files in the given path matching the pattern.

rmdir() public method

public rmdir ( $dirPath )