PHP Class Resque\Helpers\Util

Author: Michael Haynes ([email protected])
Afficher le fichier Open project: mjphaynes/php-resque Class Usage Examples

Méthodes publiques

Méthode Description
bytes ( integer $bytes, string $force_unit = null, string $format = null, boolean $si = true ) : string Returns human readable sizes. Based on original functions written by Aidan Lister and Quentin Zervaas.
human_time_diff ( integer $from, integer $to = null ) : string Determines the difference between two timestamps.
path ( $array, $path, &$found, $delimiter = '.' ) : boolean Gets a value from an array using a dot separated path.

Method Details

bytes() public static méthode

Returns human readable sizes. Based on original functions written by Aidan Lister and Quentin Zervaas.
public static bytes ( integer $bytes, string $force_unit = null, string $format = null, boolean $si = true ) : string
$bytes integer size in bytes
$force_unit string a definitive unit
$format string the return string format
$si boolean whether to use SI prefixes or IEC
Résultat string

human_time_diff() public static méthode

The difference is returned in a human readable format such as "1 hour", "5 mins", "2 days".
public static human_time_diff ( integer $from, integer $to = null ) : string
$from integer Unix timestamp from which the difference begins.
$to integer Optional. Unix timestamp to end the time difference. Default becomes time() if not set.
Résultat string Human readable time difference.

path() public static méthode

Returns true if found and false if not.
public static path ( $array, $path, &$found, $delimiter = '.' ) : boolean
Résultat boolean