TYPO3  7.6
Public Member Functions | Protected Attributes | List of all members
ApplicationContext Class Reference

Public Member Functions

 __construct ($contextString)
 
 __toString ()
 
 isDevelopment ()
 
 isProduction ()
 
 isTesting ()
 
 getParent ()
 

Protected Attributes

 $contextString
 
 $rootContextString
 
 $parentContext
 

Detailed Description

The TYPO3 Context object.

A TYPO3 Application context is something like "Production", "Development", "Production/StagingSystem", and is set using the TYPO3_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.

This class is derived from the TYPO3 Flow framework. Credits go to the respective authors.

Definition at line 33 of file ApplicationContext.php.

Constructor & Destructor Documentation

__construct (   $contextString)

Initialize the context object.

Parameters
string$contextString
Exceptions
\Exceptionif the parent context is none of "Development", "Production" or "Testing"

Definition at line 62 of file ApplicationContext.php.

References ApplicationContext\$contextString.

Member Function Documentation

__toString ( )

Returns the full context string, for example "Development", or "Production/LiveSystem"

Returns
string

Definition at line 87 of file ApplicationContext.php.

References ApplicationContext\$contextString.

getParent ( )

Returns the parent context object, if any

Returns
the parent context or NULL, if there is none

Definition at line 132 of file ApplicationContext.php.

References ApplicationContext\$parentContext.

isDevelopment ( )

Returns TRUE if this context is the Development context or a sub-context of it

Returns
bool

Definition at line 98 of file ApplicationContext.php.

isProduction ( )

Returns TRUE if this context is the Production context or a sub-context of it

Returns
bool

Definition at line 110 of file ApplicationContext.php.

isTesting ( )

Returns TRUE if this context is the Testing context or a sub-context of it

Returns
bool

Definition at line 121 of file ApplicationContext.php.

Member Data Documentation

$contextString
protected
$parentContext
protected

Definition at line 54 of file ApplicationContext.php.

Referenced by ApplicationContext\getParent().

$rootContextString
protected

Definition at line 47 of file ApplicationContext.php.