Environment¶
-
php\lang\Environment
Class Environment
Constants
Methods
__construct
($parent = NULL, $flags = 0)¶
Parameters:
- $parent – php\lang\Environment
- $flags – int - Environment::HOT_RELOAD, Environment::CONCURRENT
registerSourceMap
($sourceMap)¶
Parameters:
- $sourceMap – php\lang\SourceMap
unregisterSourceMap
($sourceMap)¶
Parameters:
- $sourceMap – php\lang\SourceMap
execute
($runnable)¶Executes $runnable in the environment
Parameters:
- $runnable – callable - - 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:
- $className – string
exportClass
($className)¶Exports the $className from th environment
throws php\lang\\Exception - if class not found or already registered
Parameters:
- $className – string
importFunction
($functionName)¶Imports the $functionName to the environment
throws php\lang\\Exception - if function not found or already registered
Parameters:
- $functionName – string
exportFunction
($functionName)¶Exports the $functionName from the environment
throws php\lang\\Exception - if function not found or already registered
Parameters:
- $functionName – string
importAutoLoaders
()¶
defineConstant
($name, $value, $caseSensitive = true)¶throws php\lang\\Exception - if constant already registered or value is not scalar type
Parameters:
- $name – string
- $value – mixed - - scalar value
- $caseSensitive – bool
onMessage
($callback)¶Handles messages that sent to the environment
Parameters:
- $callback – callable
onOutput
($callback)¶
Parameters:
- $callback – callable
sendMessage
($message)¶Send message to the environment
Parameters:
- $message – mixed
Returns: mixed
findModule
($path)¶
Parameters:
- $path – string
Returns: php\lang\Module, null
- static
current
¶Get environment of current execution
Returns: php\lang\Environment