PHP Class App\services\Storage

Show file Open project: printempw/blessing-skin-server Class Usage Examples

Public Methods

Method Description
copyDir ( string $source, string $dest ) : boolean Copy directory recursively
exists ( $filename )
get ( string $filename ) : string | boolean Read a file and return bin data
getDirSize ( string $dir ) : int, Recursively count the size of specified directory
getFileNum ( string $dir, $file_num ) : int, Recursively count files of specified directory
hash ( $filename, $type = 'sha256' )
put ( $filename, $data )
remove ( $filename ) Remove a file
removeDir ( $dir )
rename ( $fname, $new_fname )
size ( $filename )

Method Details

copyDir() public static method

Copy directory recursively
public static copyDir ( string $source, string $dest ) : boolean
$source string
$dest string
return boolean

exists() public static method

public static exists ( $filename )

get() public static method

Read a file and return bin data
public static get ( string $filename ) : string | boolean
$filename string
return string | boolean

getDirSize() public static method

Recursively count the size of specified directory
public static getDirSize ( string $dir ) : int,
$dir string
return int,

getFileNum() public static method

Recursively count files of specified directory
public static getFileNum ( string $dir, $file_num ) : int,
$dir string
$file_num
return int,

hash() public static method

public static hash ( $filename, $type = 'sha256' )

put() public static method

public static put ( $filename, $data )

remove() public static method

Remove a file
public static remove ( $filename )
$filename

removeDir() public static method

public static removeDir ( $dir )

rename() public static method

public static rename ( $fname, $new_fname )

size() public static method

public static size ( $filename )