Fix Kohana:: for CLI operation

This commit is contained in:
Deon George 2014-08-26 22:33:54 +10:00
parent 13e0782568
commit df74512105
2 changed files with 7 additions and 1 deletions

View File

@ -69,6 +69,12 @@ I18n::lang('en-us');
* Note: If you supply an invalid environment name, a PHP warning will be thrown * Note: If you supply an invalid environment name, a PHP warning will be thrown
* saying "Couldn't find constant Kohana::<INVALID_ENV_NAME>" * saying "Couldn't find constant Kohana::<INVALID_ENV_NAME>"
*/ */
/**
* Set the environment status by the domain.
*/
Kohana::$environment = (! isset($_SERVER['SERVER_NAME']) OR (in_array($_SERVER['SERVER_NAME'],$SERVER_NAMES))) ? Kohana::PRODUCTION : Kohana::DEVELOPMENT;
if (isset($_SERVER['KOHANA_ENV'])) if (isset($_SERVER['KOHANA_ENV']))
{ {
Kohana::$environment = constant('Kohana::'.strtoupper($_SERVER['KOHANA_ENV'])); Kohana::$environment = constant('Kohana::'.strtoupper($_SERVER['KOHANA_ENV']));

@ -1 +1 @@
Subproject commit f5c623d89783fc9bf3c8dbea7699fcefa0015c3d Subproject commit 5ffa395307a3b26f901dde5f3064c48a15979f0d