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 / Log / Writer / FormatterPluginManager.php
blob3abc4487260291078a1f67636f58fd058c22b54b
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\Log\Writer;
12 use Zend\Log\Exception;
13 use Zend\Log\Formatter;
14 use Zend\ServiceManager\AbstractPluginManager;
16 class FormatterPluginManager extends AbstractPluginManager
18 /**
19 * Default set of formatters
21 * @var array
23 protected $invokableClasses = array(
24 'base' => 'Zend\Log\Formatter\Base',
25 'simple' => 'Zend\Log\Formatter\Simple',
26 'xml' => 'Zend\Log\Formatter\Xml',
27 'db' => 'Zend\Log\Formatter\Db',
28 'errorhandler' => 'Zend\Log\Formatter\ErrorHandler',
29 'exceptionhandler' => 'Zend\Log\Formatter\ExceptionHandler',
32 /**
33 * Allow many filters of the same type
35 * @var bool
37 protected $shareByDefault = false;
39 /**
40 * Validate the plugin
42 * Checks that the formatter loaded is an instance of Formatter\FormatterInterface.
44 * @param mixed $plugin
45 * @return void
46 * @throws Exception\InvalidArgumentException if invalid
48 public function validatePlugin($plugin)
50 if ($plugin instanceof Formatter\FormatterInterface) {
51 // we're okay
52 return;
55 throw new Exception\InvalidArgumentException(sprintf(
56 'Plugin of type %s is invalid; must implement %s\Formatter\FormatterInterface',
57 (is_object($plugin) ? get_class($plugin) : gettype($plugin)),
58 __NAMESPACE__
59 ));