Load composer.lock's contents and return it

@param  bool $cache
@return array
487776
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;
    }
458821
public static function get($key)
    {
        if (!self::$instance) return null;

        return self::$instance->cache->get($key);
    }
1279443
public function getAll($cache = true)
    {
        if ($cache)
        {
            return $this->cache->getAll();
        }


        $all = [];

        $rows = $this->database->table($this->config['db_table'])->get();
        foreach ($rows as $row)
        {
            $value = json_decode($row->setting_value, true);

            $all[$row->setting_key] = $value;
        }

        return $all;
    }
1248089
protected function loadFromCache(string $fileName): array
    {
        $content     = file_get_contents($fileName);
        $loadedItems = unserialize($content);

        return $loadedItems;
    }
24312
public function getOrFail($data, $with = [], $cache = false)
    {
        return $this->get($data, $with, $cache, true);
    }
585656
public static function get_cache_content() {
        if (!isset(self::$plugintypes)) {
            self::fill_all_caches();
        }

        $cache = array(
            'subsystems'        => self::$subsystems,
            'plugintypes'       => self::$plugintypes,
            'plugins'           => self::$plugins,
            'parents'           => self::$parents,
            'subplugins'        => self::$subplugins,
            'classmap'          => self::$classmap,
            'classmaprenames'   => self::$classmaprenames,
            'filemap'           => self::$filemap,
            'version'           => self::$version,
        );

        return '<?php
$cache = '.var_export($cache, true).';
';
    }
261408
protected function loadFromCache()
    {
        $this->log->debug("Load from cache file {$this->filePath}");
        $data = $this->getDataFromFile();
        if ($data === false) {
            $data = '';
        }

        // validate data through parser
        if (!$this->isDataValid($data)) {
            $this->addError($this->filePath, 'Data not valid according to parser');

            return false;
        }

        // verify if local cache is expired
        if ($this->isCacheExpired()) {
            $this->addError($this->filePath, 'Local cache is expired');

            return false;
        }

        return true;
    }
522291
private function loadTemplate($template)
    {
        if (!array_key_exists($template, $this->templateCache)) {
            $this->templateCache[$template] = $this->twig->loadTemplate($template);
        }

        return $this->templateCache[$template];
    }
839042
private function downloadMe($cache = true)
    {
        if (empty($this->httpClient)) {
            throw new ClientError('Missing HTTP client to use for this operation.');
        }

        if ($cache) {
            if (empty($this->store)) {
                throw new ClientError('Missing store instance to use for this operation.');
            }

            if ($this->cached) {
                return null;
            }

            $this->cached = true;
        }

        try {
            $response = $this->httpClient->get($this->url);
            if ($response->getStatusCode() != 200) {
                throw new \Exception('Unable to download.');
            }
            if (!$cache) {
                return $response->getBody();
            }

            $this->store->set($this->getKey($this->url), $response->getBody());
        } catch (\Exception $e) {
            $this->cached = false;
            throw $e;
        }
        return null;
    }
318422
private function loadFromCache(bool $development, string $cacheFile = null): array
    {
        $bundleConfigs = is_file($cacheFile) ? include $cacheFile : null;

        if (!\is_array($bundleConfigs) || 0 === \count($bundleConfigs)) {
            $bundleConfigs = $this->loadFromPlugins($development, $cacheFile);
        }

        return $bundleConfigs;
    }
1039255
protected function getData($key)
    {
        $cacheKey = $this->key($key);
        return array_key_exists($cacheKey, $this->cache)?$this->cache[$this->key($key)]:false;
    }
845354
public function get($key = null)
    {
        if (isset ($this->cacheListing [$key])) {
            $val = apc_fetch($key, $success);

            return $success ? $val : $success;
        }

        return false;
    }
1131848
protected function getCachePermissions($cacheKey)
    {
        // Check local cache
        if (isset($this->cachePermissions[$cacheKey])) {
            return $this->cachePermissions[$cacheKey];
        }

        // Check persistent cache
        if ($this->cacheService) {
            $result = $this->cacheService->get($cacheKey);

            // Warm local cache
            if ($result) {
                $this->cachePermissions[$cacheKey] = $result;
                return $result;
            }
        }

        return null;
    }
273606
public function get( $key )
    {
        $cache_file = new File($key.self::CACHE_FILE_EXT, $this->config->getCacheRoot());
    
        if (!$cache_file->exists()){
            return false;
        }
        if (!$cache_file->canRead()){
            throw( new CacheFileNotReadableException($cache_file) );
        }
        
        $lines = $cache_file->getContentsAsArray();
        
        static $keywords = [
            'expires', 'type', 'class', 'data'
        ];
        
        $cache_info =[];
        foreach($keywords as $keyword)
        {
            $line = array_shift($lines);
            $kwlen = strlen($keyword);
            
            if (!$line){
                throw( new CacheFileFormatException($cache_file) );
            }
            if (strlen($line) < $kwlen+1 || strpos($line,$keyword.':') !== 0){
                throw( new CacheFileFormatException($cache_file) );
            }
            $cache_info[$keyword] = substr($line,$kwlen+1);
        }
    
        // check expire date
        $expires = $cache_info['expires'] ? intval($cache_info['expires']) : null;
        if ($expires === null){
            throw( new CacheMetaDataException('expires',$expires) );
        }
        $now = time();
        if ($expires > 0 && $expires < $now){
            return null;
        }
        
        // decode data
        $data = $cache_info['data'] ?? null;
        if ($data === null){
            throw( new CacheMetaDataException('data',$data) );
        }
        $data = unserialize(base64_decode($data));
    
        // type check
        $type = $cache_info['type'] ?? null;
        if ($type === null){
            throw( new CacheMetaDataException('type',$type) );
        }
        if ($type !== gettype($data)){
            return null;
        }
    
        // class check
        if ($type === 'object'){
            $class = $cache_info['class'] ?? null;
            if ($class === null){
                throw( new CacheMetaDataException('class',$class) );
            }
            if (!($data instanceof $class)){
                return null;
            }
        }
    
        return $data;
    }
706842
public function load($overwrite = false, $cache = true)
	{
		$paths = $this->find_file($cache);
		$config = array();

		foreach ($paths as $path)
		{
			$config = $overwrite ?
				array_merge($config, $this->load_file($path)) :
				\Arr::merge($config, $this->load_file($path));
		}

		return $config;
	}
379585
private function loadFromCache($key)
    {
        $encoded = (string) $this
            ->cache
            ->fetch($key);

        try {
            return is_string($encoded)
                ? $this
                    ->encoder
                    ->decode($encoded)
                : null;
        } catch (Exception $e) {
            // Silent pass
        }

        return null;
    }
284236
protected function loadTreeFromCache(): ?array
    {
        $cachedTree = $this->cache->getItem('ordermind.logauth.permissions');
        if ($cachedTree->isHit()) {
            return $cachedTree->get();
        }

        return null;
    }