mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #1344 from g4b0/8330-cache-issue-in-CMSVersion
Solved json obj to array issue
This commit is contained in:
commit
05181fce78
@ -1413,7 +1413,11 @@ class LeftAndMain extends Controller implements PermissionProvider {
|
||||
$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)) {
|
||||
@ -1429,7 +1433,7 @@ class LeftAndMain extends Controller implements PermissionProvider {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Fall back to static version file
|
||||
foreach($modules as $moduleName => $moduleSpec) {
|
||||
if(!isset($versions[$moduleName])) {
|
||||
|
Loading…
Reference in New Issue
Block a user