protected function loadCache(string $name)
    {
        $path = $this->cache_path;
        $cache_file = $path . '/' . $name  . '.cache';

        if (file_exists($cache_file))
        {
            if (!is_readable($cache_file))
            {
                self::getLogger()->error("Cannot read cache from {0}", [$cache_file]);
            }
            else
            {
                try
                {
                    $contents = file_get_contents($cache_file);
                    $data = unserialize($contents);
                    if (!is_array($data))
                        $data = [];
                    $this->repository[$name] = $data;
                    $this->repository[$name]['_changed'] = false;
                    $this->checkExpiry($name);
                    return;
                }
                catch (\Throwable $t)
                {
                    self::getLogger()->error("Failure loading cache {0} - removing", [$name]);
                    self::getLogger()->error("Error: {0}", [$t]);
                    if (is_writable($cache_file))
                        unlink($cache_file);
                }
            }
        }
        self::getLogger()->debug("Cache {0} does not exist - creating", [$cache_file]);
        $this->repository[$name] = [];
    }
protected function loadCache(string $name)
    {
        $path = $this->cache_path;
        $cache_file = $path . '/' . $name  . '.cache';

        if (file_exists($cache_file))
        {
            if (!is_readable($cache_file))
            {
                self::getLogger()->error("Cannot read cache from {0}", [$cache_file]);
            }
            else
            {
                try
                {
                    $contents = file_get_contents($cache_file);
                    $data = unserialize($contents);
                    if (!is_array($data))
                        $data = [];
                    $this->repository[$name] = $data;
                    $this->repository[$name]['_changed'] = false;
                    $this->checkExpiry($name);
                    return;
                }
                catch (\Throwable $t)
                {
                    self::getLogger()->error("Failure loading cache {0} - removing", [$name]);
                    self::getLogger()->error("Error: {0}", [$t]);
                    if (is_writable($cache_file))
                        unlink($cache_file);
                }
            }
        }
        self::getLogger()->debug("Cache {0} does not exist - creating", [$cache_file]);
        $this->repository[$name] = [];
    }
protected function loadCache ( string $ name ) { $ path = $ this -> cache_path ; $ cache_file = $ path . '/' . $ name . '.cache' ; if ( file_exists ( $ cache_file ) ) { if ( ! is_readable ( $ cache_file ) ) { self :: getLogger ( ) -> error ( "Cannot read cache from {0}" , [ $ cache_file ] ) ; } else { try { $ contents = file_get_contents ( $ cache_file ) ; $ data = unserialize ( $ contents ) ; if ( ! is_array ( $ data ) ) $ data = [ ] ; $ this -> repository [ $ name ] = $ data ; $ this -> repository [ $ name ] [ '_changed' ] = false ; $ this -> checkExpiry ( $ name ) ; return ; } catch ( \ Throwable $ t ) { self :: getLogger ( ) -> error ( "Failure loading cache {0} - removing" , [ $ name ] ) ; self :: getLogger ( ) -> error ( "Error: {0}" , [ $ t ] ) ; if ( is_writable ( $ cache_file ) ) unlink ( $ cache_file ) ; } } } self :: getLogger ( ) -> debug ( "Cache {0} does not exist - creating" , [ $ cache_file ] ) ; $ this -> repository [ $ name ] = [ ] ; }
Load the cache from the cache files. The data will be stored in the class-internal cache storage

@param $name string The name of the cache to load
Load the cache from the cache files . The data will be stored in the class - internal cache storage