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
12 use Zend\ServiceManager\AbstractPluginManager
;
14 class WriterPluginManager
extends AbstractPluginManager
17 * Default set of writers
21 protected $invokableClasses = array(
22 'chromephp' => 'Zend\Log\Writer\ChromePhp',
23 'db' => 'Zend\Log\Writer\Db',
24 'fingerscrossed' => 'Zend\Log\Writer\FingersCrossed',
25 'firephp' => 'Zend\Log\Writer\FirePhp',
26 'mail' => 'Zend\Log\Writer\Mail',
27 'mock' => 'Zend\Log\Writer\Mock',
28 'null' => 'Zend\Log\Writer\Null',
29 'stream' => 'Zend\Log\Writer\Stream',
30 'syslog' => 'Zend\Log\Writer\Syslog',
31 'zendmonitor' => 'Zend\Log\Writer\ZendMonitor',
35 * Allow many writers of the same type
39 protected $shareByDefault = false;
44 * Checks that the writer loaded is an instance of Writer\WriterInterface.
46 * @param mixed $plugin
48 * @throws Exception\InvalidArgumentException if invalid
50 public function validatePlugin($plugin)
52 if ($plugin instanceof Writer\WriterInterface
) {
57 throw new Exception\
InvalidArgumentException(sprintf(
58 'Plugin of type %s is invalid; must implement %s\Writer\WriterInterface',
59 (is_object($plugin) ?
get_class($plugin) : gettype($plugin)),