Webiny\Component\ClassLoader\ClassLoader::getClassFromCache PHP Method

getClassFromCache() public method

First tries to find the class in the cache. If the class is not found in the cache, then it tries to find it by using the registered maps.
public getClassFromCache ( string $class ) : boolean
$class string Name of the class you are trying to find.
return boolean True is retuned if the class if found and loaded into memory.
    public function getClassFromCache($class)
    {
        // from cache
        if ($file = $this->cache->read($class)) {
            require $file;
        }
        // from disk
        if ($file = $this->findClass($class)) {
            $this->cache->save('wf.component.class_loader.' . $class, $file, 600, ['_wf', '_component', '_class_loader']);
            require $file;
        }
    }