You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> This is README for version ^2.0 which only support ZF3 and ZF Expressive version 3 with php ^7.1.
10
+
> This is README for version ^3.0 which only support Laminas Mvc version 3 and Mezzio version 3 with php ^7.1.
11
11
12
-
> For version 1, you can read at [version 1 readme](https://github.com/samsonasik/ErrorHeroModule/tree/1.x.x) which still support ZF2 and ZF Expressive version 1 and 2 with php ^5.6|^7.0 support.
12
+
> For version ^2.0, you can read at [version 2 readme](https://github.com/samsonasik/ErrorHeroModule/tree/2.x.x) which only support ZF3 and ZF Expressive version 3 with php ^7.1.
13
+
14
+
> For version 1, you can read at [version 1 readme](https://github.com/samsonasik/ErrorHeroModule/tree/1.x.x) which still support ZF2 and ZF Mezzio version 1 and 2 with php ^5.6|^7.0 support.
13
15
14
16
Introduction
15
17
------------
16
18
17
-
ErrorHeroModule is a module for Error Logging (DB and Mail) your ZF3 Mvc Application, and ZF Expressive for Exceptions in 'dispatch.error' or 'render.error' or during request and response, and [PHP E_* Error](http://www.php.net/manual/en/errorfunc.constants.php).
19
+
ErrorHeroModule is a module for Error Logging (DB and Mail) your Laminas Mvc 3 Application, and Mezzio 3 for Exceptions in 'dispatch.error' or 'render.error' or during request and response, and [PHP E_* Error](http://www.php.net/manual/en/errorfunc.constants.php).
18
20
19
21
Features
20
22
--------
@@ -26,7 +28,7 @@ Features
26
28
-[x] Handle only once log error for same error per configured time range.
27
29
-[x] Set default page (web access) or default message (console access) for error if configured 'display_errors' = 0.
28
30
-[x] Set default content when request is XMLHttpRequest via 'ajax' configuration.
29
-
-[x] Set default content when there is [no template service](https://github.com/zendframework/zend-expressive-template/blob/9b6c2e06f8c1d7e43750f72b64cc749552f2bdbe/src/TemplateRendererInterface.php) via 'no_template' configuration (ZF Expressive 3).
31
+
-[x] Set default content when there is [no template service](https://github.com/mezzio/mezzio-template/blob/9b6c2e06f8c1d7e43750f72b64cc749552f2bdbe/src/TemplateRendererInterface.php) via 'no_template' configuration (Mezzio 3).
30
32
-[x] Provide request information ( http method, raw data, body data, query data, files data, cookie data, and ip address).
31
33
-[x] Send Mail
32
34
-[x] many receivers to listed configured email
@@ -55,9 +57,9 @@ CREATE TABLE `log` (
55
57
```
56
58
> If you use other RDBMS, you may follow the `log` table structure above.
57
59
58
-
**2. Setup your Zend\Db\Adapter\AdapterInterface service or your Doctrine\ORM\EntityManager service config**
60
+
**2. Setup your Laminas\Db\Adapter\AdapterInterface service or your Doctrine\ORM\EntityManager service config**
59
61
60
-
You can use 'db' (with _Zend\Db_) config or 'doctrine' (with _DoctrineORMModule_) config that will be transformed to be usable with `Zend\Log\Writer\Db`.
62
+
You can use 'db' (with _Laminas\Db_) config or 'doctrine' (with _DoctrineORMModule_) config that will be transformed to be usable with `Laminas\Log\Writer\Db`.
***a. For [ZF3 Mvc](https://zendframework.github.io/tutorials/getting-started/overview/) application, copy `error-hero-module.local.php.dist` config to your local's autoload and configure it***
117
+
***a. For [Laminas Mvc](https://docs.laminas.dev/tutorials/getting-started/overview/) application, copy `error-hero-module.local.php.dist` config to your local's autoload and configure it***
***b. For [ZF Expressive](https://zendframework.github.io/zend-expressive/) application, copy `expressive-error-hero-module.local.php.dist` config to your local's autoload and configure it***
129
+
***b. For [Mezzio](https://docs.mezzio.dev/mezzio/) application, copy `mezzio-error-hero-module.local.php.dist` config to your local's autoload and configure it***
'message' => 'We have encountered a problem and we can not fulfill your request. An error report has been generated and sent to the support team and someone will attend to this problem urgently. Please try again later. Thank you for your patience.',
253
255
],
@@ -275,10 +277,10 @@ json
275
277
// set to true to activate email notification on log error event
276
278
'enable' => false,
277
279
278
-
// Zend\Mail\Message instance registered at service manager
280
+
// Laminas\Mail\Message instance registered at service manager
279
281
'mail-message' => 'YourMailMessageService',
280
282
281
-
// Zend\Mail\Transport\TransportInterface instance registered at service manager
283
+
// Laminas\Mail\Transport\TransportInterface instance registered at service manager
282
284
'mail-transport' => 'YourMailTransportService',
283
285
284
286
// email sender
@@ -296,7 +298,7 @@ json
296
298
297
299
**5. Lastly, enable it**
298
300
299
-
***a. For ZF Mvc application***
301
+
***a. For Laminas Mvc application***
300
302
301
303
```php
302
304
// config/modules.config.php or config/application.config.php
@@ -306,21 +308,21 @@ return [
306
308
],
307
309
```
308
310
309
-
***b.ForZFExpressiveapplication***
311
+
***b.ForMezzioapplication***
310
312
311
-
> You need to use Zend\ServiceManager for service container and Zend\View for template engine.
313
+
> You need to use Laminas\ServiceManager for service container and Laminas\View for template engine.
312
314
313
-
For [zend-expressive-skeleton](https://github.com/zendframework/zend-expressive-skeleton) ^3.0.0, you need to open `config/pipeline.php` and add the `ErrorHeroModule\Middleware\Expressive::class` middleware after default `ErrorHandler::class` registration:
315
+
For [laminas-Mezzio-skeleton](https://github.com/mezzio/mezzio-skeleton) ^3.0.0, you need to open `config/pipeline.php` and add the `ErrorHeroModule\Middleware\Mezzio::class` middleware after default `ErrorHandler::class` registration:
314
316
315
317
```php
316
318
$app->pipe(ErrorHandler::class);
317
-
$app->pipe(ErrorHeroModule\Middleware\Expressive::class); // here
319
+
$app->pipe(ErrorHeroModule\Middleware\Mezzio::class); // here
318
320
```
319
321
320
322
and also add `error-preview` routes in `config/routes.php` (optional) :
@@ -368,7 +370,7 @@ You will get the following page if display_errors config is 0:
368
370
369
371
> For production env, you can disable error-preview sample page with set`['error-hero-module']['enable-error-preview-page']` to false.
370
372
371
-
> For ZF Expressive, there is no default console implementation, so, if you want to apply it in your console inZF Expressive, you may need to custom implementation error handler that utilize `ErrorHeroModule\Handler\Logging` service (see detailed usage at `ErrorHeroModule\Middleware\Expressive` class)
373
+
> For Mezzio, there is no default console implementation, so, if you want to apply it in your console inMezzio, you may need to custom implementation error handler that utilize `ErrorHeroModule\Handler\Logging` service (see detailed usage at `ErrorHeroModule\Middleware\Mezzio` class)
0 commit comments