Skip to content

Commit

Permalink
- CACHE backend can be set by ENV Variable (optional), #175, #420
Browse files Browse the repository at this point in the history
  • Loading branch information
exodus4d committed Jan 14, 2017
1 parent 0343744 commit ce1d588
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 8 additions & 4 deletions app/main/lib/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,20 @@ protected function getAllEnvironmentData(){
}

/**
* 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);
}
}
}

Expand Down

0 comments on commit ce1d588

Please sign in to comment.