Skip to content

Commit

Permalink
Update: 测试修正的错误捕获处理
Browse files Browse the repository at this point in the history
  • Loading branch information
NHZEX committed Mar 20, 2024
1 parent 31631a1 commit 40a975c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
10 changes: 1 addition & 9 deletions src/Components/database/tests/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,7 @@
'Database' => 'Imi\Db',
],

'beans' => [
'ErrorLog' => [
'catchLevel' => \E_ALL,
'exceptionLevel' => \E_ALL,
'errorEventHandlers' => [
\Imi\Test\Component\ErrorEventHandler::class,
],
],
],
'beans' => [],

// 日志配置
'logger' => [
Expand Down
10 changes: 1 addition & 9 deletions src/Components/redis/tests/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,7 @@
],
],

'beans' => [
'ErrorLog' => [
'catchLevel' => \E_ALL,
'exceptionLevel' => \E_ALL,
'errorEventHandlers' => [
\Imi\Test\Component\ErrorEventHandler::class,
],
],
],
'beans' => [],

'connectionCenter' => [
'test_phpredis_standalone' => [
Expand Down
3 changes: 3 additions & 0 deletions src/Log/ErrorLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ public function register(): void
*/
public function onError(int $errno, string $errstr, string $errfile, int $errline): void
{
if (0 === (error_reporting() & $errno)) {
return;
}
foreach ($this->errorEventHandlers as $class)
{
$handler = new $class();
Expand Down

0 comments on commit 40a975c

Please sign in to comment.