Solved json obj to array issue

This commit is contained in:
g4b0 2013-03-28 14:45:23 +01:00 committed by g4b0
parent 469eaee4c1
commit 93428bd8f2

View File

@ -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)) {