Skip to content

Commit

Permalink
loading config options before other libs so they are available
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmatic69 committed Jan 13, 2010
1 parent df08437 commit 0b19b4f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions extensions/libs/controllers/components/infinitas.php
Expand Up @@ -18,10 +18,9 @@ function initialize(&$controller, $settings = array()) {
$this->Controller = &$controller;
$settings = array_merge(array(), (array)$settings);

$this->setupConfig(); //must always be first.
$this->setupTheme();

$this->setupCache();
$this->setupConfig();
$this->setupTheme();
$this->loadCoreImages();
}

Expand All @@ -34,7 +33,11 @@ function initialize(&$controller, $settings = array()) {
* @todo load the users configs also.
*/
function setupConfig(){
$configs = ClassRegistry::init('Management.Config')->getConfig();
$configs = Cache::read('core_configs', 'core');

if (!$configs) {
$configs = ClassRegistry::init('Management.Config')->getConfig();
}

foreach($configs as $config) {
Configure::write($config['Config']['key'], $config['Config']['value']);
Expand Down

0 comments on commit 0b19b4f

Please sign in to comment.