[TYPO3-english] Host conditions on LocalConfiguration.php
bernd wilke
t3ng at bernd-wilke.net
Tue Jan 20 14:01:19 CET 2015
Am 20.01.15 um 11:45 schrieb Sergio Catalá:
> Hi list,
>
> If you had to add several database credentials in your
> LocalConfiguration.php for Typo3 6.2. because you have several hosts, what
> would you use in the conditions?
> Let's imagine for the next hosts:
>
> staging.example.de
> staging.example.nl
> staging.example.ch
> example.de
> example.nl
> example.ch
>
> We have different machines for "staging" and "live", and all use the same
> path for the websites: /var/www/example.xx/
>
no way to store it in LocalConfiguration.php as this files could be
rewritten by core in multiple ways.
but you can use AdditionalConfiguration.php which is for individual
configuration.
we use it to have different configurations for different machines but
only one config file in the git deployment:
if (strpos($_SERVER['HTTP_HOST'], 't3-dev1.company.local') !==
FALSE) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] = 'Kopie Dev1';
$system = 0;
} elseif (strpos($_SERVER['HTTP_HOST'], 't3-dev2.emoto2.local') !== FALSE) {
:
:
}
bernd
--
http://www.pi-phi.de/cheatsheet.html
More information about the TYPO3-english
mailing list