PHP Class PHPPM\Utils

Mostrar archivo Open project: php-pm/php-pm Class Usage Examples

Public Methods

Method Description
bindAndCall ( callable $fn, object $newThis, array $args = [], string $bindClass = null ) Executes a function in the context of an object. This basically bypasses the private/protected check of PHP.
generateSessionId ( ) : string Generates stronger session ids for session handling.
getMaxMemory ( ) : integer
hijackProperty ( object $object, string $propertyName, mixed $newValue ) Changes a property value of an object. (hijack because you can also change private/protected properties)
isWindows ( ) : boolean

Method Details

bindAndCall() public static method

Executes a function in the context of an object. This basically bypasses the private/protected check of PHP.
public static bindAndCall ( callable $fn, object $newThis, array $args = [], string $bindClass = null )
$fn callable
$newThis object
$args array
$bindClass string

generateSessionId() public static method

Generates stronger session ids for session handling.
public static generateSessionId ( ) : string
return string

getMaxMemory() public static method

public static getMaxMemory ( ) : integer
return integer bytes

hijackProperty() public static method

Changes a property value of an object. (hijack because you can also change private/protected properties)
public static hijackProperty ( object $object, string $propertyName, mixed $newValue )
$object object
$propertyName string
$newValue mixed

isWindows() public static method

public static isWindows ( ) : boolean
return boolean