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

pull/1/head
Cyril Rouyer 2017-03-10 15:24:01 +01:00
parent 9ca905717a
commit bbd70490bc
3 changed files with 15 additions and 7 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(
'modules' => array(
@ -29,7 +31,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(
@ -86,7 +94,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(),
@ -101,7 +109,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(),
@ -113,8 +121,8 @@ return array(
),
),
'spool_path_create' => getcwd() .'/data/json/create/',//default location path where the json file enabling the creation of the environment of the client should be generated
'spool_path_delete' => getcwd() .'/data/json/delete/', //default location path where the json file enabling the deletion of the environment of the client should be generated
'spool_path_create' => $datapath.'/json/create/',//default location path where the json file enabling the creation of the environment of the client should be generated
'spool_path_delete' => $datapath.'/json/delete/', //default location path where the json file enabling the deletion of the environment of the client should be generated
// END DOCTRINE CONF
);

View File

@ -1,2 +0,0 @@
*
!.gitignore