Skip to content

Commit 3bf6b4a

Browse files
committed
Merge branch 'cannot-connect-db-handle'
* cannot-connect-db-handle: docblock clean up test for cannot connect to db rollback request field handle cannot connect to db in the first place
2 parents 9bf2f9b + 6e5b587 commit 3bf6b4a

10 files changed

Lines changed: 325 additions & 276 deletions

File tree

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
<?php
2+
3+
use Zend\Mail\Message;
4+
use Zend\Mail\Transport\InMemory;
5+
use Zend\ServiceManager\Factory\InvokableFactory;
6+
7+
return [
8+
9+
'service_manager' => [
10+
'factories' => [
11+
Message::class => InvokableFactory::class,
12+
InMemory::class => InvokableFactory::class,
13+
],
14+
],
15+
16+
'db' => [
17+
'username' => 'root',
18+
'password' => 'wrong_password',
19+
'driver' => 'Pdo',
20+
'dsn' => 'mysql:dbname=errorheromodule;host=127.0.0.1',
21+
'driver_options' => [
22+
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\'',
23+
],
24+
],
25+
26+
'log' => [
27+
'ErrorHeroModuleLogger' => [
28+
'writers' => [
29+
30+
[
31+
'name' => 'db',
32+
'options' => [
33+
'db' => 'Zend\Db\Adapter\Adapter',
34+
'table' => 'log',
35+
'column' => [
36+
'timestamp' => 'date',
37+
'priority' => 'type',
38+
'message' => 'event',
39+
'extra' => [
40+
'url' => 'url',
41+
'file' => 'file',
42+
'line' => 'line',
43+
'error_type' => 'error_type',
44+
'trace' => 'trace',
45+
'request_data' => 'request_data',
46+
],
47+
],
48+
],
49+
],
50+
51+
],
52+
],
53+
],
54+
55+
'error-hero-module' => [
56+
'enable' => true,
57+
'display-settings' => [
58+
59+
// excluded php errors
60+
'exclude-php-errors' => [
61+
E_USER_DEPRECATED
62+
],
63+
64+
// show or not error
65+
'display_errors' => 0,
66+
67+
// if enable and display_errors = 0, the page will bring layout and view
68+
'template' => [
69+
'layout' => 'layout/layout',
70+
'view' => 'error-hero-module/error-default'
71+
],
72+
73+
// if enable and display_errors = 0, the console will bring message
74+
'console' => [
75+
'message' => 'We have encountered a problem and we can not fulfill your request. An error report has been generated and send to the support team and someone will attend to this problem urgently. Please try again later. Thank you for your patience.',
76+
],
77+
78+
],
79+
'logging-settings' => [
80+
'same-error-log-time-range' => 86400,
81+
],
82+
'email-notification-settings' => [
83+
// set to true to activate email notification on log error
84+
'enable' => true,
85+
86+
// Zend\Mail\Message instance registered at service manager
87+
'mail-message' => Message::class,
88+
89+
// Zend\Mail\Transport\TransportInterface instance registered at service manager
90+
'mail-transport' => InMemory::class,
91+
92+
// email sender
93+
'email-from' => 'Sender Name <sender@host.com>',
94+
95+
'email-to-send' => [
96+
'developer1@foo.com',
97+
'developer2@foo.com',
98+
],
99+
],
100+
],
101+
];
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
3+
return include __DIR__ . '/../module.local.php';
Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,3 @@
11
<?php
22

3-
namespace ErrorHeroModule;
4-
5-
use Zend\Log;
6-
use Zend\ServiceManager\Factory\InvokableFactory;
7-
8-
return [
9-
10-
'controllers' => [
11-
'factories' => [
12-
Controller\ErrorPreviewController::class => InvokableFactory::class,
13-
],
14-
],
15-
16-
'router' => [
17-
'routes' => [
18-
'error-preview' => [
19-
'type' => 'Segment',
20-
'options' => [
21-
'route' => '/error-preview[/][:action]',
22-
'defaults' => [
23-
'controller' => Controller\ErrorPreviewController::class,
24-
'action' => 'exception',
25-
],
26-
],
27-
],
28-
],
29-
],
30-
31-
'service_manager' => [
32-
'abstract_factories' => [
33-
Log\LoggerAbstractServiceFactory::class,
34-
],
35-
'factories' => [
36-
Listener\Mvc::class => Listener\MvcFactory::class,
37-
Handler\Logging::class => Handler\LoggingFactory::class,
38-
],
39-
],
40-
41-
'listeners' => [
42-
Listener\Mvc::class,
43-
],
44-
45-
'view_manager' => [
46-
'template_path_stack' => [
47-
__DIR__.'/../view',
48-
],
49-
],
50-
51-
];
3+
return include __DIR__ . '/../module.local.php';
Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,3 @@
11
<?php
22

3-
namespace ErrorHeroModule;
4-
5-
use Zend\Log;
6-
use Zend\ServiceManager\Factory\InvokableFactory;
7-
8-
return [
9-
10-
'controllers' => [
11-
'factories' => [
12-
Controller\ErrorPreviewController::class => InvokableFactory::class,
13-
],
14-
],
15-
16-
'router' => [
17-
'routes' => [
18-
'error-preview' => [
19-
'type' => 'Segment',
20-
'options' => [
21-
'route' => '/error-preview[/][:action]',
22-
'defaults' => [
23-
'controller' => Controller\ErrorPreviewController::class,
24-
'action' => 'exception',
25-
],
26-
],
27-
],
28-
],
29-
],
30-
31-
'service_manager' => [
32-
'abstract_factories' => [
33-
Log\LoggerAbstractServiceFactory::class,
34-
],
35-
'factories' => [
36-
Listener\Mvc::class => Listener\MvcFactory::class,
37-
Handler\Logging::class => Handler\LoggingFactory::class,
38-
],
39-
],
40-
41-
'listeners' => [
42-
Listener\Mvc::class,
43-
],
44-
45-
'view_manager' => [
46-
'template_path_stack' => [
47-
__DIR__.'/../view',
48-
],
49-
],
50-
51-
];
3+
return include __DIR__ . '/../module.local.php';
Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,3 @@
11
<?php
22

3-
namespace ErrorHeroModule;
4-
5-
use Zend\Log;
6-
use Zend\ServiceManager\Factory\InvokableFactory;
7-
8-
return [
9-
10-
'controllers' => [
11-
'factories' => [
12-
Controller\ErrorPreviewController::class => InvokableFactory::class,
13-
],
14-
],
15-
16-
'router' => [
17-
'routes' => [
18-
'error-preview' => [
19-
'type' => 'Segment',
20-
'options' => [
21-
'route' => '/error-preview[/][:action]',
22-
'defaults' => [
23-
'controller' => Controller\ErrorPreviewController::class,
24-
'action' => 'exception',
25-
],
26-
],
27-
],
28-
],
29-
],
30-
31-
'service_manager' => [
32-
'abstract_factories' => [
33-
Log\LoggerAbstractServiceFactory::class,
34-
],
35-
'factories' => [
36-
Listener\Mvc::class => Listener\MvcFactory::class,
37-
Handler\Logging::class => Handler\LoggingFactory::class,
38-
],
39-
],
40-
41-
'listeners' => [
42-
Listener\Mvc::class,
43-
],
44-
45-
'view_manager' => [
46-
'template_path_stack' => [
47-
__DIR__.'/../view',
48-
],
49-
],
50-
51-
];
3+
return include __DIR__ . '/../module.local.php';
Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,3 @@
11
<?php
22

3-
namespace ErrorHeroModule;
4-
5-
use Zend\Log;
6-
use Zend\ServiceManager\Factory\InvokableFactory;
7-
8-
return [
9-
10-
'controllers' => [
11-
'factories' => [
12-
Controller\ErrorPreviewController::class => InvokableFactory::class,
13-
],
14-
],
15-
16-
'router' => [
17-
'routes' => [
18-
'error-preview' => [
19-
'type' => 'Segment',
20-
'options' => [
21-
'route' => '/error-preview[/][:action]',
22-
'defaults' => [
23-
'controller' => Controller\ErrorPreviewController::class,
24-
'action' => 'exception',
25-
],
26-
],
27-
],
28-
],
29-
],
30-
31-
'service_manager' => [
32-
'abstract_factories' => [
33-
Log\LoggerAbstractServiceFactory::class,
34-
],
35-
'factories' => [
36-
Listener\Mvc::class => Listener\MvcFactory::class,
37-
Handler\Logging::class => Handler\LoggingFactory::class,
38-
],
39-
],
40-
41-
'listeners' => [
42-
Listener\Mvc::class,
43-
],
44-
45-
'view_manager' => [
46-
'template_path_stack' => [
47-
__DIR__.'/../view',
48-
],
49-
],
50-
51-
];
3+
return include __DIR__ . '/../module.local.php';
Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,3 @@
11
<?php
22

3-
namespace ErrorHeroModule;
4-
5-
use Zend\Log;
6-
use Zend\ServiceManager\Factory\InvokableFactory;
7-
8-
return [
9-
10-
'controllers' => [
11-
'factories' => [
12-
Controller\ErrorPreviewController::class => InvokableFactory::class,
13-
],
14-
],
15-
16-
'router' => [
17-
'routes' => [
18-
'error-preview' => [
19-
'type' => 'Segment',
20-
'options' => [
21-
'route' => '/error-preview[/][:action]',
22-
'defaults' => [
23-
'controller' => Controller\ErrorPreviewController::class,
24-
'action' => 'exception',
25-
],
26-
],
27-
],
28-
],
29-
],
30-
31-
'service_manager' => [
32-
'abstract_factories' => [
33-
Log\LoggerAbstractServiceFactory::class,
34-
],
35-
'factories' => [
36-
Listener\Mvc::class => Listener\MvcFactory::class,
37-
Handler\Logging::class => Handler\LoggingFactory::class,
38-
],
39-
],
40-
41-
'listeners' => [
42-
Listener\Mvc::class,
43-
],
44-
45-
'view_manager' => [
46-
'template_path_stack' => [
47-
__DIR__.'/../view',
48-
],
49-
],
50-
51-
];
3+
return include __DIR__ . '/../module.local.php';

0 commit comments

Comments
 (0)