Project

General

Profile

Actions

Feature #49988

closed

Backport ApplicationContext from Flow

Added by Steffen Müller almost 11 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2013-07-17
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

Flow has the notion of ApplicationContext which provides a unique API for handling contexts.

Having this API in TYPO3 CMS would allow us to provide default configuration sets for particular contexts. For example having decent logging in production context vs. full reports in development context.
Extension developers would also benefit from streamlining their custom solutions to a single API.

The context is set using the TYPO3_CONTEXT environment variable.

Here's an example of how to set this variable in apache htaccess:

RewriteCond %{HTTP_HOST} ^dev\.example\.com$
RewriteRule (.*) $1 [E=TYPO3_CONTEXT:Development]

RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteRule (.*) $1 [E=TYPO3_CONTEXT:Production]

The particular context can be obtained in the following way:

\TYPO3\CMS\Core\Core\Bootstrap::getInstance()->getContext()

# shorthand to predefined contexts:
\TYPO3\CMS\Core\Core\Bootstrap::getInstance()->getContext()->isDevelopment();
\TYPO3\CMS\Core\Core\Bootstrap::getInstance()->getContext()->isProduction();
...

Subtasks 3 (0 open3 closed)

Feature #50131: Load context specific configuration filesClosed2013-07-17

Actions
Feature #50132: TypoScript: Application Context conditionClosed2013-07-17

Actions
Bug #50983: Add public API to get ApplicationContext ClosedSteffen Müller2013-08-10

Actions

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Feature #39441: Add TYPO3 Context informationClosed2012-08-01

Actions
Related to TYPO3 Core - Task #49953: Disable DeprecationLog by defaultClosed2013-07-11

Actions
Actions

Also available in: Atom PDF