src/Core/Manifest/VersionProvider.php
protected function getComposerLock($cache = true)
    {
        $composerLockPath = BASE_PATH . '/composer.lock';
        if (!file_exists($composerLockPath)) {
            return [];
        }

        $lockData = [];
        $jsonData = file_get_contents($composerLockPath);

        if ($cache) {
            $cache = Injector::inst()->get(CacheInterface::class . '.VersionProvider_composerlock');
            $cacheKey = md5($jsonData);
            if ($versions = $cache->get($cacheKey)) {
                $lockData = json_decode($versions, true);
            }
        }

        if (empty($lockData) && $jsonData) {
            $lockData = json_decode($jsonData, true);

            if ($cache) {
                $cache->set($cacheKey, $jsonData);
            }
        }

        return $lockData;
    }
protected function getComposerLock($cache = true)
    {
        $composerLockPath = BASE_PATH . '/composer.lock';
        if (!file_exists($composerLockPath)) {
            return [];
        }

        $lockData = [];
        $jsonData = file_get_contents($composerLockPath);

        if ($cache) {
            $cache = Injector::inst()->get(CacheInterface::class . '.VersionProvider_composerlock');
            $cacheKey = md5($jsonData);
            if ($versions = $cache->get($cacheKey)) {
                $lockData = json_decode($versions, true);
            }
        }

        if (empty($lockData) && $jsonData) {
            $lockData = json_decode($jsonData, true);

            if ($cache) {
                $cache->set($cacheKey, $jsonData);
            }
        }

        return $lockData;
    }
protected function getComposerLock ( $ cache = true ) { $ composerLockPath = BASE_PATH . '/composer.lock' ; if ( ! file_exists ( $ composerLockPath ) ) { return [ ] ; } $ lockData = [ ] ; $ jsonData = file_get_contents ( $ composerLockPath ) ; if ( $ cache ) { $ cache = Injector :: inst ( ) -> get ( CacheInterface :: class . '.VersionProvider_composerlock' ) ; $ cacheKey = md5 ( $ jsonData ) ; if ( $ versions = $ cache -> get ( $ cacheKey ) ) { $ lockData = json_decode ( $ versions , true ) ; } } if ( empty ( $ lockData ) && $ jsonData ) { $ lockData = json_decode ( $ jsonData , true ) ; if ( $ cache ) { $ cache -> set ( $ cacheKey , $ jsonData ) ; } } return $ lockData ; }
Load composer.lock's contents and return it

@param  bool $cache
@return array
Load composer . lock s contents and return it