Skip to content

Commit 245657c

Browse files
committed
fix cache first initialization
1 parent d476360 commit 245657c

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

src/Ubiquity

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ class Ubiquity {
389389
} else
390390
die();
391391
}
392+
392393
}
393394

394395
private static function includeDefaultStyles() {
@@ -1080,15 +1081,23 @@ class Ubiquity {
10801081
if (isset(\Ubiquity\controllers\Startup::$config)) {
10811082
$config = \Ubiquity\controllers\Startup::$config;
10821083
} else {
1083-
$config = require_once 'app/cache/config/config.cache.php';
1084+
$config=self::getConfigArrayFromFile();
10841085
\Ubiquity\controllers\Startup::setConfig($config);
10851086
if($noEval){
1086-
$config=\Ubiquity\config\ConfigCache::loadConfigWithoutEval();
1087-
}
1087+
$config=\Ubiquity\config\ConfigCache::loadConfigWithoutEval();
1088+
}
10881089
}
10891090
return $config;
10901091
}
10911092

1093+
private static function getConfigArrayFromFile(){
1094+
$configFile='app/cache/config/config.cache.php';
1095+
if(\file_exists($configFile)){
1096+
return require_once 'app/cache/config/config.cache.php';
1097+
}
1098+
return require_once 'app/config/config.php';
1099+
}
1100+
10921101
private static function isBooleanTrue($s) {
10931102
return $s === true || $s === "true" || $s === 1 || $s === "1";
10941103
}

0 commit comments

Comments
 (0)