- CACHE backend can be set by ENV Variable (optional), #175, #420

This commit is contained in:
Exodus4D
2017-01-14 17:48:15 +01:00
parent 0343744ad5
commit ce1d5884c3
2 changed files with 9 additions and 5 deletions

View File

@@ -19,7 +19,7 @@ TZ = UTC
; Cache backend. Can handle Redis, Memcache module, APC, WinCache, XCache and a filesystem-based cache.
; (default: folder=tmp/cache/)
CACHE = folder=tmp/cache/
;CACHE = redis=localhost:6379
;CACHE = redis=localhost:6379
; Callback functions ==============================================================================
ONERROR = Controller\Controller->showError

View File

@@ -51,16 +51,20 @@ class Config extends \Prefab {
}
/**
* set some global framework variables
* set/overwrite some global framework variables original set in config.ini
* -> can be overwritten in environments.ini OR ENV-Vars
* -> see: https://github.com/exodus4d/pathfinder/issues/175
* that depend on environment settings
*/
protected function setHiveVariables(){
$f3 = \Base::instance();
// hive keys that can be overwritten
$hiveKeys = ['BASE', 'URL', 'DEBUG', 'CACHE'];
// hive keys that should be overwritten by environment config
$hiveKeys = ['BASE', 'URL', 'DEBUG'];
foreach($hiveKeys as $key){
$f3->set($key, self::getEnvironmentData($key));
if( !is_null( $var = self::getEnvironmentData($key)) ){
$f3->set($key,$var);
}
}
}