Skip to content

Commit e559c07

Browse files
committed
Revert "remove "enable-error-preview-page" config for expressive as it can be easily disabled via unregister from routes"
This reverts commit 082f007.
1 parent 082f007 commit e559c07

4 files changed

Lines changed: 26 additions & 6 deletions

File tree

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,10 @@ return [
166166
// it's for the enable/disable the logger functionality
167167
'enable' => true,
168168

169-
// for zend-mvc default to true, if set to true, then you can see sample:
169+
// default to true, if set to true, then you can see sample:
170170
// 1. /error-preview page ( ErrorHeroModule\Controller\ErrorPreviewController )
171171
// 2. error-preview command (ErrorHeroModule\Controller\ErrorPreviewConsoleController) via
172172
// php public/index.php error-preview
173-
// for zf-expressive, it can be easily disabled via unregister from routes
174173
//
175174
// otherwise(false), you can't see them, eg: on production env.
176175
'enable-error-preview-page' => true,
@@ -234,8 +233,6 @@ json
234233
],
235234
],
236235
],
237-
238-
// ...
239236
];
240237
```
241238

@@ -264,13 +261,12 @@ $app->pipe(ErrorHandler::class);
264261
$app->pipe(ErrorHeroModule\Middleware\Expressive::class); // here
265262
```
266263

267-
and also add `error-preview` routes in `config/routes.php` (optional) :
264+
and also add `error-preview` routes in `config/routes.php`:
268265

269266
```php
270267
$app->get('/error-preview[/:action]', ErrorHeroModule\Middleware\Routed\Preview\ErrorPreviewAction::class, 'error-preview');
271268
```
272269

273-
to enable error preview page. To disable error preview page, just remove it from routes.
274270

275271
Give it a try!
276272
--------------

config/expressive-error-hero-module.local.php.dist

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ return [
4141
// it's for the enable/disable the logger functionality
4242
'enable' => true,
4343

44+
// default to true, if set to true, then you can see sample:
45+
// 1. /error-preview page ( ErrorHeroModule\Middleware\ErrorPreviewAction )
46+
// 2. error-preview command ( ErrorHeroModule\Controller\ErrorPreviewConsoleAction ) via
47+
// php public/index.php error-preview
48+
//
49+
// otherwise(false), you can't see them, eg: on production env.
50+
'enable-error-preview-page' => true,
51+
4452
'display-settings' => [
4553

4654
// excluded php errors

spec/Fixture/config/autoload-expressive-display-errors/expressive-error-hero-module.local.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@
5151
// it's for the enable/disable the logger functionality
5252
'enable' => true,
5353

54+
// default to true, if set to true, then you can see sample:
55+
// 1. /error-preview page ( ErrorHeroModule\Middleware\ErrorPreviewAction )
56+
// 2. error-preview command ( ErrorHeroModule\Controller\ErrorPreviewConsoleAction ) via
57+
// php public/index.php error-preview
58+
//
59+
// otherwise(false), you can't see them, eg: on production env.
60+
'enable-error-preview-page' => true,
61+
5462
'display-settings' => [
5563

5664
// excluded php errors

spec/Fixture/config/autoload-expressive/expressive-error-hero-module.local.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@
5151
// it's for the enable/disable the logger functionality
5252
'enable' => true,
5353

54+
// default to true, if set to true, then you can see sample:
55+
// 1. /error-preview page ( ErrorHeroModule\Middleware\ErrorPreviewAction )
56+
// 2. error-preview command ( ErrorHeroModule\Controller\ErrorPreviewConsoleAction ) via
57+
// php public/index.php error-preview
58+
//
59+
// otherwise(false), you can't see them, eg: on production env.
60+
'enable-error-preview-page' => true,
61+
5462
'display-settings' => [
5563

5664
// excluded php errors

0 commit comments

Comments
 (0)