Skip to content

Commit 082f007

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

4 files changed

Lines changed: 6 additions & 26 deletions

File tree

README.md

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

169-
// default to true, if set to true, then you can see sample:
169+
// for zend-mvc 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
173174
//
174175
// otherwise(false), you can't see them, eg: on production env.
175176
'enable-error-preview-page' => true,
@@ -233,6 +234,8 @@ json
233234
],
234235
],
235236
],
237+
238+
// ...
236239
];
237240
```
238241

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

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

266269
```php
267270
$app->get('/error-preview[/:action]', ErrorHeroModule\Middleware\Routed\Preview\ErrorPreviewAction::class, 'error-preview');
268271
```
269272

273+
to enable error preview page. To disable error preview page, just remove it from routes.
270274

271275
Give it a try!
272276
--------------

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,6 @@ 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-
5244
'display-settings' => [
5345

5446
// excluded php errors

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,6 @@
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-
6254
'display-settings' => [
6355

6456
// excluded php errors

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,6 @@
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-
6254
'display-settings' => [
6355

6456
// excluded php errors

0 commit comments

Comments
 (0)