Skip to content

Commit

Permalink
[zendframework#4455] Wire log-related service config listeners
Browse files Browse the repository at this point in the history
- LogWriterManager and LogProcessorManager services.
- Wired into base service manager configuration, as well as
  ModuleManager feature provider system.
  • Loading branch information
weierophinney committed Mar 5, 2014
1 parent da24228 commit 8c2ece8
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link https://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace Zend\ModuleManager\Feature;

interface LogProcessorProviderInterface
{
/**
* Expected to return \Zend\ServiceManager\Config object or array to
* seed such an object.
*
* @return array|\Zend\ServiceManager\Config
*/
public function getLogProcessorConfig();
}
21 changes: 21 additions & 0 deletions library/Zend/ModuleManager/Feature/LogWriterProviderInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link https://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace Zend\ModuleManager\Feature;

interface LogWriterProviderInterface
{
/**
* Expected to return \Zend\ServiceManager\Config object or array to
* seed such an object.
*
* @return array|\Zend\ServiceManager\Config
*/
public function getLogWriterConfig();
}
16 changes: 16 additions & 0 deletions library/Zend/Mvc/Service/LogProcessorManagerFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link https://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace Zend\Mvc\Service;


class LogProcessorManagerFactory extends AbstractPluginManagerFactory
{
const PLUGIN_MANAGER_CLASS = 'Zend\Log\ProcessorPluginManager';
}
16 changes: 16 additions & 0 deletions library/Zend/Mvc/Service/LogWriterManagerFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link https://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace Zend\Mvc\Service;


class LogWriterManagerFactory extends AbstractPluginManagerFactory
{
const PLUGIN_MANAGER_CLASS = 'Zend\Log\WriterPluginManager';
}
12 changes: 12 additions & 0 deletions library/Zend/Mvc/Service/ModuleManagerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,18 @@ public function createService(ServiceLocatorInterface $serviceLocator)
'Zend\ModuleManager\Feature\InputFilterProviderInterface',
'getInputFilterConfig'
);
$serviceListener->addServiceManager(
'LogProcessorManager',
'log_processors',
'Zend\ModuleManager\Feature\LogProcessorProviderInterface',
'getLogProcessorConfig'
);
$serviceListener->addServiceManager(
'LogWriterManager',
'log_writers',
'Zend\ModuleManager\Feature\LogWritersProviderInterface',
'getLogWriterConfig'
);

$events = $serviceLocator->get('EventManager');
$events->attach($defaultListeners);
Expand Down
2 changes: 2 additions & 0 deletions library/Zend/Mvc/Service/ServiceListenerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ class ServiceListenerFactory implements FactoryInterface
'HttpViewManager' => 'Zend\Mvc\Service\HttpViewManagerFactory',
'HydratorManager' => 'Zend\Mvc\Service\HydratorManagerFactory',
'InputFilterManager' => 'Zend\Mvc\Service\InputFilterManagerFactory',
'LogProcessorManager' => 'Zend\Mvc\Service\LogProcessorManagerFactory',
'LogWriterManager' => 'Zend\Mvc\Service\LogWriterManagerFactory',
'MvcTranslator' => 'Zend\Mvc\Service\TranslatorServiceFactory',
'PaginatorPluginManager' => 'Zend\Mvc\Service\PaginatorPluginManagerFactory',
'Request' => 'Zend\Mvc\Service\RequestFactory',
Expand Down

0 comments on commit 8c2ece8

Please sign in to comment.