PHP Class Neos\Flow\Core\ApplicationContext

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.
Datei anzeigen Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Property Type Description
$contextString string The (internal) context string; could be something like "Development" or "Development/MyLocalMacBook"
$parentContext ApplicationContext The parent context, or NULL if there is no parent context
$rootContextString string The root context; must be one of "Development", "Testing" or "Production"

Public Methods

Method Description
__construct ( string $contextString ) Initialize the context object.
__toString ( ) : string Returns the full context string, for example "Development", or "Production/LiveSystem"
getParent ( ) : ApplicationContext Returns the parent context object, if any
isDevelopment ( ) : boolean Returns TRUE if this context is the Development context or a sub-context of it
isProduction ( ) : boolean Returns TRUE if this context is the Production context or a sub-context of it
isTesting ( ) : boolean Returns TRUE if this context is the Testing context or a sub-context of it

Method Details

__construct() public method

Initialize the context object.
public __construct ( string $contextString )
$contextString string

__toString() public method

Returns the full context string, for example "Development", or "Production/LiveSystem"
public __toString ( ) : string
return string

getParent() public method

Returns the parent context object, if any
public getParent ( ) : ApplicationContext
return ApplicationContext the parent context or NULL, if there is none

isDevelopment() public method

Returns TRUE if this context is the Development context or a sub-context of it
public isDevelopment ( ) : boolean
return boolean

isProduction() public method

Returns TRUE if this context is the Production context or a sub-context of it
public isProduction ( ) : boolean
return boolean

isTesting() public method

Returns TRUE if this context is the Testing context or a sub-context of it
public isTesting ( ) : boolean
return boolean

Property Details

$contextString protected_oe property

The (internal) context string; could be something like "Development" or "Development/MyLocalMacBook"
protected string $contextString
return string

$parentContext protected_oe property

The parent context, or NULL if there is no parent context
protected ApplicationContext,Neos\Flow\Core $parentContext
return ApplicationContext

$rootContextString protected_oe property

The root context; must be one of "Development", "Testing" or "Production"
protected string $rootContextString
return string