CachedClassMapGenerator.php in X Autoload 7.5
File
src/Discovery/CachedClassMapGenerator.php
View source
<?php
namespace Drupal\xautoload\Discovery;
class CachedClassMapGenerator implements ClassMapGeneratorInterface {
protected $decorated;
protected $system;
function __construct($decorated, $system) {
$this->decorated = $decorated;
$this->system = $system;
}
function wildcardPathsToClassmap($paths) {
$cid = 'xautoload:wildcardPathsToClassmap:' . md5(serialize($paths));
$cache = $this->system
->cacheGet($cid);
if ($cache && isset($cache->data)) {
return $cache->data;
}
$map = $this->decorated
->wildcardPathsToClassmap($paths);
$this->system
->cacheSet($cid, $map);
return $map;
}
}