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
10 namespace Zend\Config
;
12 use Zend\ServiceManager\AbstractPluginManager
;
14 class ReaderPluginManager
extends AbstractPluginManager
17 * Default set of readers
21 protected $invokableClasses = array(
22 'ini' => 'Zend\Config\Reader\Ini',
23 'json' => 'Zend\Config\Reader\Json',
24 'xml' => 'Zend\Config\Reader\Xml',
25 'yaml' => 'Zend\Config\Reader\Yaml',
30 * Checks that the reader loaded is an instance of Reader\ReaderInterface.
32 * @param Reader\ReaderInterface $plugin
34 * @throws Exception\InvalidArgumentException if invalid
36 public function validatePlugin($plugin)
38 if ($plugin instanceof Reader\ReaderInterface
) {
43 throw new Exception\
InvalidArgumentException(sprintf(
44 'Plugin of type %s is invalid; must implement %s\Reader\ReaderInterface',
45 (is_object($plugin) ?
get_class($plugin) : gettype($plugin)),