[TYPO3-dev] Environment constants

Steffen Kamper steffen at sk-typo3.de
Thu Jan 17 21:52:36 CET 2008


Hi,

"Vahan Amirbekyan" <vahan at ectostar.com> schrieb im Newsbeitrag 
news:mailman.1.1200602631.30563.typo3-dev at lists.netfielders.de...
> hello folks,
> I know this forum is for core developers but still might be of your 
> interest and to a great help for users like me.

that's not true, this list is for all TYPO3 developers, not core devs only.

>
> I have DEV, STG and PROD environments for my typo3 systems and use CVS.
> There are many issues that exist in deployment typo3 systems across 
> multiple environment.
> Having an environment constant declared in localconf.php ( localconf.php 
> is not in CVS ) helps.
> For example emailredirect ext that was developed inhouse and will be put 
> in public domain in very near future checks that constant value and it is 
> not "PROD" redirects all emails generated by the system to specific list 
> of emails addresses.
> There are other cases when a constant like this one helps.
> Some of typo3 extensions require domain records to be defined either as 
> typo3 domain record or as a constant value. My environment constant values 
> are "DEV" , "STG" and "PROD"
> Domain names to systems deployed in corresponding environments are 
> dev-my.domain.com, stg-my.domain.com and my.domain.com.
> Changing typo3 domain records logic so that names get prefixed with env 
> constant value + dash is a task of typo3 core developers but being able to 
> read values of constants defined in localconf.php in typoscript code ( in 
> template setup in particular ) hopefully something I could do on my own.
> Can you tell me how to read in template setupvalue of
> $TYPO3_CONF_VARS['SYS']['dgCommEnvironment'] ='DEV'; defined in 
> localconf.php
>
> thank you
> Vahan
>

you can access Global Array with conditions:
http://typo3.org/documentation/document-library/references/doc_core_tsref/4.1.0/view/4/1/#id3526924

I'm not sure, but try to access this with
[globalString = TYPO3_CONF_VARS|SYS|dgCommEnvironment = DEV]

vg  Steffen 






More information about the TYPO3-dev mailing list