Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Cache / Storage / AdapterPluginManager.php
blob9f133fb0e94c5487d02a8054569820d3a17e6280
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\Cache\Storage;
12 use Zend\Cache\Exception;
13 use Zend\ServiceManager\AbstractPluginManager;
15 /**
16 * Plugin manager implementation for cache storage adapters
18 * Enforces that adapters retrieved are instances of
19 * StorageInterface. Additionally, it registers a number of default
20 * adapters available.
22 class AdapterPluginManager extends AbstractPluginManager
24 /**
25 * Default set of adapters
27 * @var array
29 protected $invokableClasses = array(
30 'apc' => 'Zend\Cache\Storage\Adapter\Apc',
31 'dba' => 'Zend\Cache\Storage\Adapter\Dba',
32 'filesystem' => 'Zend\Cache\Storage\Adapter\Filesystem',
33 'memcached' => 'Zend\Cache\Storage\Adapter\Memcached',
34 'memory' => 'Zend\Cache\Storage\Adapter\Memory',
35 'redis' => 'Zend\Cache\Storage\Adapter\Redis',
36 'session' => 'Zend\Cache\Storage\Adapter\Session',
37 'xcache' => 'Zend\Cache\Storage\Adapter\XCache',
38 'wincache' => 'Zend\Cache\Storage\Adapter\WinCache',
39 'zendserverdisk' => 'Zend\Cache\Storage\Adapter\ZendServerDisk',
40 'zendservershm' => 'Zend\Cache\Storage\Adapter\ZendServerShm',
43 /**
44 * Do not share by default
46 * @var array
48 protected $shareByDefault = false;
50 /**
51 * Validate the plugin
53 * Checks that the adapter loaded is an instance of StorageInterface.
55 * @param mixed $plugin
56 * @return void
57 * @throws Exception\RuntimeException if invalid
59 public function validatePlugin($plugin)
61 if ($plugin instanceof StorageInterface) {
62 // we're okay
63 return;
66 throw new Exception\RuntimeException(sprintf(
67 'Plugin of type %s is invalid; must implement %s\StorageInterface',
68 (is_object($plugin) ? get_class($plugin) : gettype($plugin)),
69 __NAMESPACE__
70 ));