Skip to content

Commit

Permalink
[save] Fixing cache settings for apps
Browse files Browse the repository at this point in the history
  • Loading branch information
Raymond Benc committed Jul 27, 2015
1 parent 7aba984 commit 88e0093
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions PF.Src/Core/Setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ class Setting extends \Core\Model {
private static $_settings = null;

public function __construct() {
//if (self::$_settings === null) {
if (self::$_settings === null) {
parent::__construct();

// self::$_settings = $this->cache->get('app_settings');
// if (is_bool(self::$_settings)) {
$App = new \Core\App();
self::$_settings = $this->cache->get('app_settings');
if (is_bool(self::$_settings)) {
$App = new \Core\App(true);
foreach ($App->all() as $_app) {
if ($_app->settings) {
foreach ($_app->settings as $key => $value) {
Expand All @@ -25,10 +25,10 @@ public function __construct() {
}
}

// $this->cache->set('app_settings', self::$_settings);
// self::$_settings = $this->cache->get('app_settings');
// }
// }
$this->cache->set('app_settings', self::$_settings);
self::$_settings = $this->cache->get('app_settings');
}
}
}

public function get($key, $default = null) {
Expand Down

0 comments on commit 88e0093

Please sign in to comment.