[TYPO3-dev] Run TYPO3 in different Context: production, development, etc..

Stefan Geith typo3dev2012.nospam1 at geithware.de
Tue Jul 31 16:14:14 CEST 2012


Am 31.07.2012 10:04, schrieb Fabien Udriot:
> [...]
> Typically, you would find in your htaccess:
>
>      SetEnv TYPO3_CONTEXT Production
>
> Connected somehow with the "context" issue, [...]

I often used this construct im my localconf.php
with websites where I have a Life-, a Preview- and
a Dev-Version:

if (!defined('TYPO3_CONTEXT')) {
	if (getenv('TYPO3_CONTEXT')) {
		define('TYPO3_CONTEXT', getenv('TYPO3_CONTEXT'));
	} elseif (ini_get('TYPO3_ENV')) {
		define('TYPO3_CONTEXT', ini_get('TYPO3_CONTEXT'));
	} else {
		define('TYPO3_CONTEXT', 'UNCONFIGURED');
	}
}

...
$TYPO3_CONF_VARS['SYS']['sitename'] = 'Sitename ('.TYPO3_CONTEXT.')';
...
if (strcmp(TYPO3_CONTEXT,'www')==0) {
         $typo_db_username = ...
         $TYPO3_CONF_VARS['EXT']['extConf']['googleMapApiKey'] = ...
} elseif (strcmp(TYPO3_CONTEXT,'preview')==0) {
         $typo_db_username = ...
         $TYPO3_CONF_VARS['EXT']['extConf']['googleMapApiKey'] = ...
} elseif (strcmp(TYPO3_CONTEXT,'dev')==0) {
         $typo_db_username = ...
         $TYPO3_CONF_VARS['EXT']['extConf']['googleMapApiKey'] = ...
}

So it would be great if Typo3 could react on some CONTEXT-Variables to 
use a specific typo3conf like e.g.
        'LocalConfiguration' . TYPO3_CONTEXT. '.php'


/Stefan







More information about the TYPO3-dev mailing list