ApplicationContext
class ApplicationContext (View source)
The Flow Context object.
A Flow Application context is something like "Production", "Development", "Production/StagingSystem", and is set using the FLOW_CONTEXT environment variable.
A context can contain arbitrary sub-contexts, which are delimited with slash ("Production/StagingSystem", "Production/Staging/Server1"). The top-level contexts, however, must be one of "Testing", "Development" and "Production".
Mainly, you will use $context->isProduction(), $context->isTesting() and $context->isDevelopment() inside your custom code.
Properties
protected string | $contextString | The (internal) context string; could be something like "Development" or "Development/MyLocalMacBook" |
|
protected string | $rootContextString | The root context; must be one of "Development", "Testing" or "Production" |
|
protected ApplicationContext | $parentContext | The parent context, or NULL if there is no parent context |
|
protected string[] | $hierarchy |
Methods
Initialize the context object.
Returns the full context string, for example "Development", or "Production/LiveSystem"
Returns true if this context is the Development context or a sub-context of it
Returns true if this context is the Production context or a sub-context of it
Returns true if this context is the Testing context or a sub-context of it
Returns the parent context object, if any
Returns the names of this context and all parents in ascending specificity
Details
__construct(string $contextString)
Initialize the context object.
string
__toString()
Returns the full context string, for example "Development", or "Production/LiveSystem"
bool
isDevelopment()
Returns true if this context is the Development context or a sub-context of it
bool
isProduction()
Returns true if this context is the Production context or a sub-context of it
bool
isTesting()
Returns true if this context is the Testing context or a sub-context of it
ApplicationContext
getParent()
Returns the parent context object, if any
array
getHierarchy()
Returns the names of this context and all parents in ascending specificity