TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
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 35 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 64 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 89 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 133 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 100 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 111 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 122 of file ApplicationContext.php.

Member Data Documentation

$contextString
protected
$parentContext
protected

Definition at line 56 of file ApplicationContext.php.

Referenced by ApplicationContext\getParent().

$rootContextString
protected

Definition at line 49 of file ApplicationContext.php.