Environment

php\lang\Environment

Class Environment

Constants


constant CONCURRENT
constant HOT_RELOAD

Methods


__construct($parent = NULL, $flags = 0)
Parameters:
  • $parentphp\lang\Environment
  • $flagsint - Environment::HOT_RELOAD, Environment::CONCURRENT
registerSourceMap($sourceMap)
Parameters:
unregisterSourceMap($sourceMap)
Parameters:
execute($runnable)

Executes $runnable in the environment

Parameters:
  • $runnablecallable - - in new environment
Returns:

mixed

importClass($className)

Imports the $className to the environment

throws php\lang\\Exception - if class not found or already registered

Parameters:
  • $classNamestring
exportClass($className)

Exports the $className from th environment

throws php\lang\\Exception - if class not found or already registered

Parameters:
  • $classNamestring
importFunction($functionName)

Imports the $functionName to the environment

throws php\lang\\Exception - if function not found or already registered

Parameters:
  • $functionNamestring
exportFunction($functionName)

Exports the $functionName from the environment

throws php\lang\\Exception - if function not found or already registered

Parameters:
  • $functionNamestring
importAutoLoaders()
defineConstant($name, $value, $caseSensitive = true)

throws php\lang\\Exception - if constant already registered or value is not scalar type

Parameters:
  • $namestring
  • $valuemixed - - scalar value
  • $caseSensitivebool
onMessage($callback)

Handles messages that sent to the environment

Parameters:
  • $callbackcallable
onOutput($callback)
Parameters:
  • $callbackcallable
sendMessage($message)

Send message to the environment

Parameters:
  • $messagemixed
Returns:

mixed

findModule($path)
Parameters:
  • $pathstring
Returns:

php\lang\Module, null

static current

Get environment of current execution

Returns:php\lang\Environment