PHP Class App\services\Utils

Afficher le fichier Open project: printempw/blessing-skin-server Class Usage Examples

Méthodes publiques

Méthode 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 méthode

public static download ( $url, $path )

generateRndString() public static méthode

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

getRemoteFileSize() public static méthode

public static getRemoteFileSize ( $url )

getStringReplaced() public static méthode

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

getTimeFormatted() public static méthode

public static getTimeFormatted ( $timestamp )

upload() public static méthode

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