-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathmezzio-error-hero-module.local.php.dist
More file actions
147 lines (117 loc) · 5.18 KB
/
mezzio-error-hero-module.local.php.dist
File metadata and controls
147 lines (117 loc) · 5.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<?php
namespace ErrorHeroModule;
use App\Exception\MyException;
use Psr\Log\LoggerInterface;
use RuntimeException;
use Error;
use ErrorHeroModule\Command\BaseLoggingCommandInitializer;
use ErrorHeroModule\Middleware\Mezzio;
use ErrorHeroModule\Middleware\MezzioFactory;
use ErrorHeroModule\ErrorHeroModule\Middleware\Routed\Preview\ErrorPreviewAction;
use ErrorHeroModule\Handler\Logging;
use ErrorHeroModule\Handler\LoggingFactory;
use ErrorHeroModule\Command\Preview\ErrorPreviewConsoleCommand;
use Laminas\ServiceManager\Factory\InvokableFactory;
return [
'error-hero-module' => [
// it's for the enable/disable the logger functionality
'enable' => true,
'display-settings' => [
// excluded php errors ( http://www.php.net/manual/en/errorfunc.constants.php )
'exclude-php-errors' => [
// can be specific error
\E_USER_DEPRECATED,
// can be specific error with specific message
[\E_WARNING, 'specific error message'],
],
// excluded exceptions
'exclude-exceptions' => [
// can be an Exception class or class extends Exception class
MyException::class,
// can be specific exception with specific message
[RuntimeException::class, 'specific exception message'],
// or specific Error class with specific message
[Error::class, 'specific error message'],
],
// show or not error
'display_errors' => 0,
// if enable and display_errors = 0, the page will bring layout and view
'template' => [
// 'layout' config only when using Laminas View Template Engine
'layout' => 'layout::default',
'view' => 'error-hero-module::error-default'
],
// if enable and display_errors = 0, and on console env, the console will bring message for laminas-mvc
'console' => [
'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.',
],
// for Mezzio, when container doesn't has \Mezzio\Template\TemplateRendererInterface service
// if enable, and display_errors = 0, then show a message under no_template config
'no_template' => [
'message' => <<<json
{
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
"title": "Internal Server Error",
"status": 500,
"detail": "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."
}
json
],
// if enable, display_errors = 0, and request XMLHttpRequest
// on this case, the "template" key will be ignored.
'ajax' => [
'message' => <<<json
{
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
"title": "Internal Server Error",
"status": 500,
"detail": "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."
}
json
],
],
'logging-settings' => [
// time range for same error, file, line, url, message to be re-logged
// in seconds range, 86400 means 1 day
'same-error-log-time-range' => 86400,
],
'email-notification-settings' => [
// set to true to activate email notification on log error
'enable' => false,
// DSN for mailer
'mail-dsn' => 'smtp://localhost:25',
// email sender
'email-from' => 'Sender Name <sender@host.com>',
// to include or not $_FILES on send mail
'include-files-to-attachments' => true,
'email-to-send' => [
'developer1@foo.com',
'developer2@foo.com',
],
],
],
'dependencies' => [
'factories' => [
Mezzio::class => MezzioFactory::class,
ErrorPreviewAction::class => InvokableFactory::class,
Logging::class => LoggingFactory::class,
ErrorPreviewConsoleCommand::class => InvokableFactory::class,
'ErrorHeroModuleLogger' => fn (): LoggerInterface => new \Monolog\Logger('error-hero-module'),
],
'initializers' => [
BaseLoggingCommandInitializer::class,
],
],
'laminas-cli' => [
'commands' => [
'errorheromodule:preview' => ErrorPreviewConsoleCommand::class,
],
],
'templates' =>[
'paths' => [
'error-hero-module' => [
realpath( dirname(__DIR__, 2) . '/vendor/samsonasik/error-hero-module/view/error-hero-module' ),
],
],
],
];