Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Remove zend-log dependency #121

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"zendframework/zend-form": "^2.7",
"zendframework/zend-inputfilter": "^2.6",
"zendframework/zend-json": "^2.6.1 || ^3.0",
"zendframework/zend-log": "^2.7.1",
"zendframework/zend-psr7bridge": "^0.2",
"fabpot/php-cs-fixer": "1.7.*",
"phpunit/phpunit": "^4.5"
Expand All @@ -38,7 +37,6 @@
"zendframework/zend-http": "Zend\\Http component",
"zendframework/zend-inputfilter": "Zend\\Inputfilter component",
"zendframework/zend-json": "(^2.6.1 || ^3.0) To auto-deserialize JSON body content in AbstractRestfulController extensions, when json_decode is unavailable",
"zendframework/zend-log": "Zend\\Log component",
"zendframework/zend-modulemanager": "Zend\\ModuleManager component",
"zendframework/zend-mvc-console": "zend-mvc-console provides the ability to expose zend-mvc as a console application",
"zendframework/zend-mvc-i18n": "zend-mvc-i18n provides integration with zend-i18n, including a translation bridge and translatable route segments",
Expand Down
106 changes: 2 additions & 104 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions doc/book/migration/to-v3-0.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,34 @@ factories have changed. In such situations, you have two options:
- Instead of extending, consider using [delegator factories](https://zendframework.github.io/zend-servicemanager/delegators/),
as these decorate the service factory, regardless of what factory is used.

## Log integration

In version 2, zend-mvc exposed `LogProcessorManager` and `LogWriterManager`
services by default, and provided specifications to zend-modulemanager's
`ServiceListener` to allow modules to provide configuration for each.

This functionality is now removed from zend-mvc. It is now exposed directly by
the [zend-log](https://zendframework.github.io/zend-log/) component
itself. To add it, install zend-log:

```bash
$ composer require zendframework/zend-log
```

Note: the above assumes you have already installed zend-component-installer, per
the section above on [dependency reduction](#dependency-reduction).

zend-log now also exposes `LogFilterManager` and `LogFormatterManager`,
corresponding to the following:

Service | Config Key | Provider Interface | Provider Method
------- | ---------- | ------------------ | ---------------
LogFilterManager | `log_filters` | `Zend\Log\Filter\LogFilterProviderInterface` | `getLogFilterConfig()`
LogFormatterManager | `log_formatters` | `Zend\Log\Formatter\LogFormatterProviderInterface` | `getLogFormatterConfig()`

This additions allow you to provide additional plugins for every aspect zend-log
exposes.

## Plugins

The following plugins have been removed from the main zend-mvc repository, and
Expand Down
17 changes: 0 additions & 17 deletions src/Service/LogProcessorManagerFactory.php

This file was deleted.

17 changes: 0 additions & 17 deletions src/Service/LogWriterManagerFactory.php

This file was deleted.

12 changes: 0 additions & 12 deletions src/Service/ModuleManagerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,6 @@ public function __invoke(ContainerInterface $container, $name, array $options =
'Zend\ModuleManager\Feature\InputFilterProviderInterface',
'getInputFilterConfig'
);
$serviceListener->addServiceManager(
'LogProcessorManager',
'log_processors',
'Zend\ModuleManager\Feature\LogProcessorProviderInterface',
'getLogProcessorConfig'
);
$serviceListener->addServiceManager(
'LogWriterManager',
'log_writers',
'Zend\ModuleManager\Feature\LogWriterProviderInterface',
'getLogWriterConfig'
);

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