PHP Class JBZoo\Utils\Sys

Afficher le fichier Open project: jbzoo/utils Class Usage Examples

Méthodes publiques

Méthode Description
IP ( boolean $trustProxy = false ) : string Get remote IP
canCollectCodeCoverage ( ) : boolean Returns true when Xdebug is supported or the runtime used is PHPDBG (PHP >= 7.0).
getBinary ( ) : string Returns the path to the binary of the current runtime.
getDocRoot ( ) : string Return document root
getHome ( ) : string Returns a home directory of current user.
getMemory ( boolean $isPeak = true ) : string Get usage memory
getName ( ) : string
getNameWithVersion ( ) : string
getVendorUrl ( ) : string
getVersion ( ) : string
hasPHPDBGCodeCoverage ( ) : boolean Returns true when the runtime used is PHP with the PHPDBG SAPI and the phpdbg_*_oplog() functions are available (PHP >= 7.0).
hasXdebug ( ) : boolean Returns true when the runtime used is PHP and Xdebug is loaded.
iniGet ( string $varName ) : mixed Alias fo ini_get function
iniSet ( string $varName, string $newValue ) : mixed Alias fo ini_set function
isFunc ( $funcName ) : boolean
isHHVM ( ) : boolean Returns true when the runtime used is HHVM.
isPHP ( string $version, string $current = PHP_VERSION ) : boolean
isPHP53 ( string $current = PHP_VERSION ) : boolean
isPHP7 ( string $current = PHP_VERSION ) : boolean
isPHPDBG ( ) : boolean Returns true when the runtime used is PHP with the PHPDBG SAPI.
isRealPHP ( ) : boolean Returns true when the runtime used is PHP without the PHPDBG SAPI.
isRoot ( ) : boolean Check is current user ROOT
isWin ( ) : boolean Check is current OS Windows
setMemory ( string $newLimit = '256M' ) Set new memory limit
setTime ( integer $newLimit ) Set PHP execution time limit (doesn't work in safe mode)

Method Details

IP() public static méthode

Get remote IP
Deprecation: use IP::getRemote()
public static IP ( boolean $trustProxy = false ) : string
$trustProxy boolean
Résultat string

canCollectCodeCoverage() public static méthode

Returns true when Xdebug is supported or the runtime used is PHPDBG (PHP >= 7.0).
public static canCollectCodeCoverage ( ) : boolean
Résultat boolean

getBinary() public static méthode

Appends ' --php' to the path when the runtime is HHVM.
public static getBinary ( ) : string
Résultat string

getDocRoot() public static méthode

Return document root
public static getDocRoot ( ) : string
Résultat string

getHome() public static méthode

Returns a home directory of current user.
public static getHome ( ) : string
Résultat string

getMemory() public static méthode

Get usage memory
public static getMemory ( boolean $isPeak = true ) : string
$isPeak boolean
Résultat string

getName() public static méthode

public static getName ( ) : string
Résultat string

getNameWithVersion() public static méthode

public static getNameWithVersion ( ) : string
Résultat string

getVendorUrl() public static méthode

public static getVendorUrl ( ) : string
Résultat string

getVersion() public static méthode

public static getVersion ( ) : string
Résultat string

hasPHPDBGCodeCoverage() public static méthode

Returns true when the runtime used is PHP with the PHPDBG SAPI and the phpdbg_*_oplog() functions are available (PHP >= 7.0).
public static hasPHPDBGCodeCoverage ( ) : boolean
Résultat boolean

hasXdebug() public static méthode

Returns true when the runtime used is PHP and Xdebug is loaded.
public static hasXdebug ( ) : boolean
Résultat boolean

iniGet() public static méthode

Alias fo ini_get function
public static iniGet ( string $varName ) : mixed
$varName string
Résultat mixed

iniSet() public static méthode

Alias fo ini_set function
public static iniSet ( string $varName, string $newValue ) : mixed
$varName string
$newValue string
Résultat mixed

isFunc() public static méthode

public static isFunc ( $funcName ) : boolean
$funcName
Résultat boolean

isHHVM() public static méthode

Returns true when the runtime used is HHVM.
public static isHHVM ( ) : boolean
Résultat boolean

isPHP() public static méthode

public static isPHP ( string $version, string $current = PHP_VERSION ) : boolean
$version string
$current string
Résultat boolean

isPHP53() public static méthode

public static isPHP53 ( string $current = PHP_VERSION ) : boolean
$current string
Résultat boolean

isPHP7() public static méthode

public static isPHP7 ( string $current = PHP_VERSION ) : boolean
$current string
Résultat boolean

isPHPDBG() public static méthode

Returns true when the runtime used is PHP with the PHPDBG SAPI.
public static isPHPDBG ( ) : boolean
Résultat boolean

isRealPHP() public static méthode

Returns true when the runtime used is PHP without the PHPDBG SAPI.
public static isRealPHP ( ) : boolean
Résultat boolean

isRoot() public static méthode

Check is current user ROOT
public static isRoot ( ) : boolean
Résultat boolean

isWin() public static méthode

Check is current OS Windows
public static isWin ( ) : boolean
Résultat boolean

setMemory() public static méthode

Set new memory limit
public static setMemory ( string $newLimit = '256M' )
$newLimit string

setTime() public static méthode

Set PHP execution time limit (doesn't work in safe mode)
public static setTime ( integer $newLimit )
$newLimit integer