Skip to content

Commit 44e5546

Browse files
committed
autoload of SystemError and SystemWarning is fixed
1 parent 82c2e1e commit 44e5546

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Errors/ErrorHandler.php

+12
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@
66
use PhpPlatform\Errors\Exceptions\System\SystemError;
77
use PhpPlatform\Errors\Exceptions\System\SystemWarning;
88

9+
/**
10+
* @todo solve : autoloader will not load Custom classes within spl_autoload_register
11+
* see Example 4 in http://php.net/manual/en/language.oop5.autoload.php
12+
*
13+
* any system error or warning will invoke the set_error_handler callback, and if classes SystemError or SystemWarning used in this call back are not loaded, then php will fail to load this classes in callback
14+
*
15+
* So including these classes manually
16+
*
17+
*/
18+
include_once __DIR__.'/Exceptions/System/SystemError.php';
19+
include_once __DIR__.'/Exceptions/System/SystemWarning.php';
20+
921
final class ErrorHandler {
1022

1123
static function handleError(){

0 commit comments

Comments
 (0)