PHP Class App\services\Utils

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

Public Methods

Method Description
download ( $url, $path )
generateRndString ( integer $length, boolean $special_chars = true ) : string Generate random string
getRemoteFileSize ( $url )
getStringReplaced ( string $str, array $rules ) : string Replace content of string according to given rules
getTimeFormatted ( $timestamp )
upload ( array $file ) : string Rename uploaded file

Method Details

download() public static method

public static download ( $url, $path )

generateRndString() public static method

Generate random string
public static generateRndString ( integer $length, boolean $special_chars = true ) : string
$length integer
$special_chars boolean
return string

getRemoteFileSize() public static method

public static getRemoteFileSize ( $url )

getStringReplaced() public static method

Replace content of string according to given rules
public static getStringReplaced ( string $str, array $rules ) : string
$str string
$rules array
return string

getTimeFormatted() public static method

public static getTimeFormatted ( $timestamp )

upload() public static method

Rename uploaded file
public static upload ( array $file ) : string
$file array files uploaded via HTTP POST
return string $hash sha256 hash of file