As a backup, I have the environment stored in a php file:

config/environment.php:
<?php return 'development';

index.php:
<?php
//... checks for env vars first ...
//if it fails:
$env = include APPLICATION_PATH . '/config/environment.php';

Cheers,
David


On 02/15/2012 11:20 AM, Alayn Gortazar wrote:
> You can do something like this directly on the public/index.php file.
>
> if (!defined('APPLICATION_ENV')) {
>     switch ($_SERVER['HTTP_HOST']) {
>         case 'localhost':
>             define('APPLICATION_ENV', 'development');
>             break;
>         case 'stagingdomain.com':
>             define('APPLICATION_ENV', 'staging');
>             break;
>         default:
>             define('APPLICATION_ENV', 'production');
>     }
> }
>
>
> ----- Mensaje original -----
>> i'm doing the same thing. i usually use the SetEnv APPLICATION_ENV
>> "staging"
>>
>> but mod_SetEnv isn't enabled on the grid servers.
>>
>> i have no idea to properly, automatically set the APPLICATION_ENV
>> based on
>> the domain.
>> any help on this would be greatly appreciated.
>>
>> --
>> View this message in context:
>> http://zend-framework-community.634137.n4.nabble.com/Best-practices-environment-setup-tp662770p4388719.html
>> Sent from the Zend Framework mailing list archive at Nabble.com.
>>
>> --
>> List: [email protected]
>> Info: http://framework.zend.com/archives
>> Unsubscribe: [email protected]


-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to