Файл: concrete5.7.5.6/concrete/vendor/zendframework/zend-cache/src/Storage/PluginManager.php
Строк: 102
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace ZendCacheStorage;
use ZendCacheException;
use ZendServiceManagerAbstractPluginManager;
/**
* Plugin manager implementation for cache plugins
*
* Enforces that plugins retrieved are instances of
* PluginPluginInterface. Additionally, it registers a number of default
* plugins available.
*/
class PluginManager extends AbstractPluginManager
{
/**
* Default set of plugins
*
* @var array
*/
protected $invokableClasses = array(
'clearexpiredbyfactor' => 'ZendCacheStoragePluginClearExpiredByFactor',
'exceptionhandler' => 'ZendCacheStoragePluginExceptionHandler',
'ignoreuserabort' => 'ZendCacheStoragePluginIgnoreUserAbort',
'optimizebyfactor' => 'ZendCacheStoragePluginOptimizeByFactor',
'serializer' => 'ZendCacheStoragePluginSerializer',
);
/**
* Do not share by default
*
* @var array
*/
protected $shareByDefault = false;
/**
* Validate the plugin
*
* Checks that the plugin loaded is an instance of PluginPluginInterface.
*
* @param mixed $plugin
* @return void
* @throws ExceptionRuntimeException if invalid
*/
public function validatePlugin($plugin)
{
if ($plugin instanceof PluginPluginInterface) {
// we're okay
return;
}
throw new ExceptionRuntimeException(sprintf(
'Plugin of type %s is invalid; must implement %sPluginPluginInterface',
(is_object($plugin) ? get_class($plugin) : gettype($plugin)),
__NAMESPACE__
));
}
}