Skip to content

Commit

Permalink
Merge pull request #1344 from g4b0/8330-cache-issue-in-CMSVersion
Browse files Browse the repository at this point in the history
Solved json obj to array issue
  • Loading branch information
chillu committed Mar 28, 2013
2 parents 469eaee + 93428bd commit 05181fc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions admin/code/LeftAndMain.php
Expand Up @@ -1413,7 +1413,11 @@ public function CMSVersion() {
$cache = SS_Cache::factory('LeftAndMain_CMSVersion');
$cacheKey = filemtime($composerLockPath);
$versions = $cache->load($cacheKey);
if(!$versions) $versions = array();
if($versions) {
$versions = json_decode($versions, true);
} else {
$versions = array();
}
if(!$versions && $jsonData = file_get_contents($composerLockPath)) {
$lockData = json_decode($jsonData);
if($lockData && isset($lockData->packages)) {
Expand All @@ -1429,7 +1433,7 @@ public function CMSVersion() {
}
}
}

// Fall back to static version file
foreach($modules as $moduleName => $moduleSpec) {
if(!isset($versions[$moduleName])) {
Expand Down

0 comments on commit 05181fc

Please sign in to comment.