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

Kay Strobach typo3 at kay-strobach.de
Tue Jul 31 16:18:01 CEST 2012


Hi Fabien,

i use

http://typo3.org/extensions/repository/view/contextswitcher

Regards
Kay

Am 31.07.2012 16:14, schrieb Stefan Geith:
> 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
> 
> 
> 
> 


-- 
http://www.kay-strobach.de - Open Source Rocks

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org

Answer was useful - feel free to donate:
  -
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=KPM9NAV73VDF2
  - https://flattr.com/profile/kaystrobach




More information about the TYPO3-dev mailing list