PHP Class JBZoo\Utils\Sys

Mostra file Open project: jbzoo/utils Class Usage Examples

Public Methods

Method 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 method

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

canCollectCodeCoverage() public static method

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

getBinary() public static method

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

getDocRoot() public static method

Return document root
public static getDocRoot ( ) : string
return string

getHome() public static method

Returns a home directory of current user.
public static getHome ( ) : string
return string

getMemory() public static method

Get usage memory
public static getMemory ( boolean $isPeak = true ) : string
$isPeak boolean
return string

getName() public static method

public static getName ( ) : string
return string

getNameWithVersion() public static method

public static getNameWithVersion ( ) : string
return string

getVendorUrl() public static method

public static getVendorUrl ( ) : string
return string

getVersion() public static method

public static getVersion ( ) : string
return string

hasPHPDBGCodeCoverage() public static method

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
return boolean

hasXdebug() public static method

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

iniGet() public static method

Alias fo ini_get function
public static iniGet ( string $varName ) : mixed
$varName string
return mixed

iniSet() public static method

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

isFunc() public static method

public static isFunc ( $funcName ) : boolean
$funcName
return boolean

isHHVM() public static method

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

isPHP() public static method

public static isPHP ( string $version, string $current = PHP_VERSION ) : boolean
$version string
$current string
return boolean

isPHP53() public static method

public static isPHP53 ( string $current = PHP_VERSION ) : boolean
$current string
return boolean

isPHP7() public static method

public static isPHP7 ( string $current = PHP_VERSION ) : boolean
$current string
return boolean

isPHPDBG() public static method

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

isRealPHP() public static method

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

isRoot() public static method

Check is current user ROOT
public static isRoot ( ) : boolean
return boolean

isWin() public static method

Check is current OS Windows
public static isWin ( ) : boolean
return boolean

setMemory() public static method

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

setTime() public static method

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