Skip to content

Commit 55aceac

Browse files
committed
Issue #52: Removed Zend Expressive references
Signed-off-by: alexmerlin <alex.merlin.1985@gmail.com>
1 parent 0712a1d commit 55aceac

File tree

6 files changed

+31
-48
lines changed

6 files changed

+31
-48
lines changed

README.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@ composer require dotkernel/dot-errorhandler
3232
- in `config/config.php` add `\Dot\ErrorHandler\ConfigProvider`
3333
- in `config/pipeline.php` add `\Dot\ErrorHandler\ErrorHandlerInterface::class`
3434
- the interface is used as an alias to keep all error handling related configurations in one file
35-
- **IMPORTANT NOTE** there should be no other error handlers after this one (only before) because the other error handler will catch the error causing dot-errorhandler not to catch any error, we recommend using just one error handler unless you have an error-specific handler
35+
36+
> If you need other error handlers, you should place them before dot-errorhandler in the pipeline; else it will not be able to catch errors.
37+
> We recommend using just one error handler unless you have an error-specific handler.
3638
3739
- Configure the error handler as shown below.
3840

39-
In **config/autoload/error-handling.global.php**:
41+
In `config/autoload/error-handling.global.php`:
4042

4143
```php
4244
<?php
@@ -61,17 +63,13 @@ return [
6163

6264
A configuration example for the default logger can be found in `config/log.global.php.dist`.
6365

64-
When declaring the `ErrorHandlerInterface` alias you can choose whether to log or not:
65-
66-
- for logging use `LogErrorHandler`
67-
- for the simple Zend Expressive handler user `ErrorHandler`
68-
69-
The class `Dot\ErrorHandler\ErrorHandler` is the same as the Zend Expressive error handling class the only difference being the removal of the `final` statement for making extension possible.
66+
When configuring the error handler in your application, you can choose between two classes:
7067

71-
The class `Dot\ErrorHandler\LogErrorHandler` is `Dot\ErrorHandler\ErrorHandler` with added logging support.
68+
- `Dot\ErrorHandler\LogErrorHandler`: for logging and displaying errors
69+
- `Dot\ErrorHandler\ErrorHandler`: for displaying errors only
7270

73-
As a note: both `LogErrorHandler` and `ErrorHandler` have factories declared in the package's `ConfigProvider`.
74-
If you need a custom ErrorHandler it must have a factory declared in the config, as in the below example:
71+
> Both `LogErrorHandler` and `ErrorHandler` have factories declared in the package's `ConfigProvider`.
72+
> If you need a custom ErrorHandler, it must have a factory declared in the config, as in the below example:
7573
7674
```php
7775
<?php
@@ -85,15 +83,13 @@ return [
8583
'factories' => [
8684
MyErrorHandler::class => MyCustomHandlerFactory::class,
8785
],
88-
8986
'aliases' => [
9087
ErrorHandlerInterface::class => MyErrorHandler::class,
9188
]
92-
9389
],
9490
'dot-errorhandler' => [
9591
'loggerEnabled' => true,
96-
'logger' => 'dot-log.default_logger'
92+
'logger' => 'dot-log.default_logger',
9793
]
9894
];
9995
```

config/log.global.php.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ return [
1414
'name' => 'stream',
1515
'level' => Logger::ALERT,
1616
'options' => [
17-
'stream' => __DIR__ . '/../../log/error-log-{Y}-{m}-{d}.log',
17+
'stream' => __DIR__ . '/../../log/error-log/{Y}-{m}-{d}.log',
1818
// explicitly log all messages
1919
'filters' => [
2020
'allMessages' => [

docs/book/v3/configuration.md

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,13 @@ return [
2929

3030
A configuration example for the default logger can be found in `config/log.global.php.dist`.
3131

32-
When declaring the `ErrorHandlerInterface` alias you can choose whether to log or not:
32+
When configuring the error handler in your application, you can choose between two classes:
3333

34-
- for the simple Zend Expressive handler user `ErrorHandler`
35-
- for logging use `LogErrorHandler`
34+
- `Dot\ErrorHandler\LogErrorHandler`: for logging and displaying errors
35+
- `Dot\ErrorHandler\ErrorHandler`: for displaying errors only
3636

37-
The class `Dot\ErrorHandler\ErrorHandler` is the same as the Zend Expressive error handling class the only difference being the removal of the `final` statement for making extension possible.
38-
39-
The class `Dot\ErrorHandler\LogErrorHandler` is `Dot\ErrorHandler\ErrorHandler` with added logging support.
40-
41-
As a note: both `LogErrorHandler` and `ErrorHandler` have factories declared in the package's `ConfigProvider`.
42-
If you need a custom ErrorHandler it must have a factory declared in the config, as in the below example:
37+
> Both `LogErrorHandler` and `ErrorHandler` have factories declared in the package's `ConfigProvider`.
38+
> If you need a custom ErrorHandler, it must have a factory declared in the config, as in the below example:
4339
4440
```php
4541
<?php
@@ -48,21 +44,18 @@ use Dot\ErrorHandler\ErrorHandlerInterface;
4844
use Custom\MyErrorHandler;
4945
use Custom\MyErrorHandlerFactory;
5046

51-
5247
return [
5348
'dependencies' => [
5449
'factories' => [
5550
MyErrorHandler::class => MyCustomHandlerFactory::class,
5651
],
57-
5852
'aliases' => [
5953
ErrorHandlerInterface::class => MyErrorHandler::class,
60-
]
61-
54+
],
6255
],
6356
'dot-errorhandler' => [
6457
'loggerEnabled' => true,
65-
'logger' => 'dot-log.default_logger'
58+
'logger' => 'dot-log.default_logger',
6659
]
6760
];
6861
```

docs/book/v3/overview.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22

33
`dot-errorhandler` is Dotkernel's logging error handler, providing two options:
44

5-
- `Dot\ErrorHandler\ErrorHandler`, same as the Zend Expressive error handling class with the only difference being the removal of the `final` statement for making extension possible
5+
## Features
6+
7+
This package provides two features:
8+
9+
- `Dot\ErrorHandler\ErrorHandler`, same as the Mezzio error handling class with the only difference being the removal of the `final` statement for making extension possible
610
- `Dot\ErrorHandler\LogErrorHandler` adds logging support to the default `ErrorHandler` class

docs/book/v4/configuration.md

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,13 @@ return [
2929

3030
A configuration example for the default logger can be found in `config/log.global.php.dist`.
3131

32-
When declaring the `ErrorHandlerInterface` alias you can choose whether to log or not:
32+
When configuring the error handler in your application, you can choose between two classes:
3333

34-
- for the simple Zend Expressive handler user `ErrorHandler`
35-
- for logging use `LogErrorHandler`
34+
- `Dot\ErrorHandler\LogErrorHandler`: for logging and displaying errors
35+
- `Dot\ErrorHandler\ErrorHandler`: for displaying errors only
3636

37-
The class `Dot\ErrorHandler\ErrorHandler` is the same as the Zend Expressive error handling class the only difference being the removal of the `final` statement for making extension possible.
38-
39-
The class `Dot\ErrorHandler\LogErrorHandler` is `Dot\ErrorHandler\ErrorHandler` with added logging support.
40-
41-
As a note: both `LogErrorHandler` and `ErrorHandler` have factories declared in the package's `ConfigProvider`.
42-
If you need a custom ErrorHandler it must have a factory declared in the config, as in the below example:
37+
> Both `LogErrorHandler` and `ErrorHandler` have factories declared in the package's `ConfigProvider`.
38+
> If you need a custom ErrorHandler, it must have a factory declared in the config, as in the below example:
4339
4440
```php
4541
<?php
@@ -48,21 +44,18 @@ use Dot\ErrorHandler\ErrorHandlerInterface;
4844
use Custom\MyErrorHandler;
4945
use Custom\MyErrorHandlerFactory;
5046

51-
5247
return [
5348
'dependencies' => [
5449
'factories' => [
5550
MyErrorHandler::class => MyCustomHandlerFactory::class,
5651
],
57-
5852
'aliases' => [
5953
ErrorHandlerInterface::class => MyErrorHandler::class,
60-
]
61-
54+
],
6255
],
6356
'dot-errorhandler' => [
6457
'loggerEnabled' => true,
65-
'logger' => 'dot-log.default_logger'
58+
'logger' => 'dot-log.default_logger',
6659
]
6760
];
6861
```

docs/book/v4/overview.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
`dot-errorhandler` is Dotkernel's logging error handler, providing two options:
44

5-
- `Dot\ErrorHandler\ErrorHandler`, same as the Zend Expressive error handling class with the only difference being the removal of the `final` statement for making extension possible
6-
- `Dot\ErrorHandler\LogErrorHandler` adds logging support to the default `ErrorHandler` class
7-
85
## Badges
96

107
![OSS Lifecycle](https://img.shields.io/osslifecycle/dotkernel/dot-errorhandler)
@@ -23,7 +20,7 @@
2320

2421
This package provides two features:
2522

26-
- `Dot\ErrorHandler\ErrorHandler`, same as the Zend Expressive error handling class with the only difference being the removal of the `final` statement for making extension possible
23+
- `Dot\ErrorHandler\ErrorHandler`, same as the Mezzio error handling class with the only difference being the removal of the `final` statement for making extension possible
2724
- `Dot\ErrorHandler\LogErrorHandler` adds logging support to the default `ErrorHandler` class
2825

2926
> Versions **>=4.0.0** and **<4.1.0** use laminas/laminas-servicemanager **3.x**

0 commit comments

Comments
 (0)