Do not use application environments anymore.

This commit is contained in:
Julien Fontanet 2013-02-07 18:40:20 +01:00
parent 486c7a933e
commit f51b8cc8b3
4 changed files with 21 additions and 12 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
/src/config/local.php
/src/log
/vendor/

View File

@ -38,25 +38,18 @@ function _bootstrap()
? __DIR__
: dirname(__FILE__)
;
if (defined('APPLICATION_ENV'))
{
$app_env = APPLICATION_ENV;
}
elseif (($app_env = getenv('APPLICATION_ENV')) === false)
{
$app_env = 'development';
}
// Class autoloading is done by composer.
require($root_dir.'/../vendor/autoload.php');
// Reads configuration.
$conffile = $root_dir.'/config/'.$app_env.'.php';
$config = new Config(require($conffile));
$config = new Config(array_merge_recursive(
require($root_dir.'/config/global.php'),
require($root_dir.'/config/local.php')
));
// Injects some variables.
$config->set('root_dir', $root_dir);
$config->set('application_env', $app_env);
// Dependency injector.
$di = new DI;

View File

@ -20,7 +20,22 @@
* @license http://www.gnu.org/licenses/gpl-3.0-standalone.html GPLv3
*
* @package Xen Orchestra Web
*
* Local Variables:
* mode: php
* End:
*/
return require(__DIR__.'/development.php') + array(
/* Local settings
*
* This file contains all settings related to this current
* installation of Xen Orchestra Server.
*
* You MUST define the following settings for which no default
* values exists.
*
* But, you MAY override any settings which already exists in
* “global.php”.
*/
return array(
);