abstract class AbstractCachedClassLoader in X Autoload 7.4
Same name and namespace in other branches
- 7.5 src/ClassLoader/AbstractCachedClassLoader.php \Drupal\xautoload\ClassLoader\AbstractCachedClassLoader
Hierarchy
- class \Drupal\xautoload\ClassLoader\AbstractClassLoader implements ClassLoaderInterface
- class \Drupal\xautoload\ClassLoader\AbstractClassLoaderDecorator
- class \Drupal\xautoload\ClassLoader\AbstractCachedClassLoader implements CacheManagerObserverInterface
- class \Drupal\xautoload\ClassLoader\AbstractClassLoaderDecorator
Expanded class hierarchy of AbstractCachedClassLoader
1 file declares its use of AbstractCachedClassLoader
- XAutoloadUnitTestCase.php in lib/
Drupal/ xautoload/ Tests/ XAutoloadUnitTestCase.php
File
- lib/
ClassLoader/ AbstractCachedClassLoader.php, line 9
Namespace
Drupal\xautoload\ClassLoaderView source
abstract class AbstractCachedClassLoader extends AbstractClassLoaderDecorator implements CacheManagerObserverInterface {
/**
* @var string
*/
protected $prefix;
/**
* This method has side effects, so it is not the constructor.
*
* @param ClassFinderInterface $finder
* @param CacheManager $cacheManager
*
* @return self
*
* @throws \Exception
*/
static function create($finder, $cacheManager) {
/** @var self $loader */
$loader = new static($finder);
if (!$loader
->checkRequirements()) {
$class = get_class($loader);
throw new CacheNotSupportedException("Unable to use {$class}, because the respetive PHP extension is not enabled.");
}
$cacheManager
->observeCachePrefix($loader);
return $loader;
}
/**
* @throws \Exception
* Throws an exception, if requirements are not satisfied.
*/
protected abstract function checkRequirements();
/**
* {@inheritdoc}
*/
function setCachePrefix($prefix) {
$this->prefix = $prefix;
}
}