EVO - config : check if APP_CONF_DIR environment variable has been setted and use it has a basedir for the data folder

pull/8/head
Cyril Rouyer 2017-03-10 15:30:47 +01:00
parent 7a1c3b7434
commit f9dd0b7d4b
2 changed files with 13 additions and 3 deletions

View File

@ -9,8 +9,10 @@ $env = getenv('APP_ENV') ?: 'production';
$appconfdir = getenv('APP_CONF_DIR') ? getenv('APP_CONF_DIR') : '';
$confpaths = [ 'config/autoload/{,*.}{global,local}.php' ];
$datapath = "data";
if( ! empty($appconfdir) ){
$confpaths[] = $appconfdir.'/local.php';
$datapath = $appconfdir.'/data';
}
return array(
@ -30,7 +32,7 @@ return array(
'config_cache_key' => 'c8aaaaa11586f8b1bf5565cc6064e70a', // md5('config_cache_key_monarc')
'module_map_cache_enabled' => ($env == 'production'),
'module_map_cache_key' => '664579376c4dcdcaa0bcdd0f7e7bf25b', // md5('module_map_cache_key_monarc'),
'cache_dir' => 'data/cache/',
'cache_dir' => $datapath.'/cache/',
'check_dependencies' => ($env != 'production'),
),
);

View File

@ -10,6 +10,14 @@
* control, so do not include passwords or other sensitive information in this
* file.
*/
$appconfdir = getenv('APP_CONF_DIR') ? getenv('APP_CONF_DIR') : '';
$datapath = "data";
if( ! empty($appconfdir) ){
$datapath = $appconfdir.'/data';
}
return array(
// DOCTRINE CONF
'service_manager' => array(
@ -87,7 +95,7 @@ return array(
'result_cache' => 'mycache',
'driver' => 'orm_default', // This driver will be defined later
'generate_proxies' => true,
'proxy_dir' => 'data/DoctrineORMModule/Proxy',
'proxy_dir' => $datapath.'/DoctrineORMModule/Proxy',
'proxy_namespace' => 'DoctrineORMModule\Proxy',
'filters' => array(),
'datetime_functions' => array(),
@ -102,7 +110,7 @@ return array(
'result_cache' => 'mycache',
'driver' => 'orm_cli', // This driver will be defined later
'generate_proxies' => true,
'proxy_dir' => 'data/DoctrineORMModule/Proxy',
'proxy_dir' => $datapath.'/DoctrineORMModule/Proxy',
'proxy_namespace' => 'DoctrineORMModule\Proxy',
'filters' => array(),
'datetime_functions' => array(),