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 / Crypt / SymmetricPluginManager.php
blob6a8e73a92d2306f5d915745035f9a8a3f294676d
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\Crypt;
12 use Zend\ServiceManager\AbstractPluginManager;
14 /**
15 * Plugin manager implementation for the symmetric adapter instances.
17 * Enforces that symmetric adapters retrieved are instances of
18 * Symmetric\SymmetricInterface. Additionally, it registers a number of default
19 * symmetric adapters available.
21 class SymmetricPluginManager extends AbstractPluginManager
23 /**
24 * Default set of symmetric adapters
26 * @var array
28 protected $invokableClasses = array(
29 'mcrypt' => 'Zend\Crypt\Symmetric\Mcrypt',
32 /**
33 * Do not share by default
35 * @var bool
37 protected $shareByDefault = false;
39 /**
40 * Validate the plugin
42 * Checks that the adapter loaded is an instance
43 * of Symmetric\SymmetricInterface.
45 * @param mixed $plugin
46 * @return void
47 * @throws Exception\InvalidArgumentException if invalid
49 public function validatePlugin($plugin)
51 if ($plugin instanceof Symmetric\SymmetricInterface) {
52 // we're okay
53 return;
56 throw new Exception\InvalidArgumentException(sprintf(
57 'Plugin of type %s is invalid; must implement %s\Symmetric\SymmetricInterface',
58 (is_object($plugin) ? get_class($plugin) : gettype($plugin)),
59 __NAMESPACE__
60 ));