Throw an ErrorException on E_STRICT errors

This commit is contained in:
Eric Lippmann 2014-10-16 15:51:18 +02:00
parent a2772a17a7
commit 985154d3d8
1 changed files with 12 additions and 1 deletions

View File

@ -4,10 +4,10 @@
namespace Icinga\Application;
use ErrorException;
use Exception;
use Zend_Config;
use Icinga\Application\Modules\Manager as ModuleManager;
use Icinga\Application\Config;
use Icinga\Data\ResourceFactory;
use Icinga\Exception\ConfigurationError;
use Icinga\Exception\NotReadableError;
@ -386,6 +386,17 @@ abstract class ApplicationBootstrap
error_reporting(E_ALL | E_STRICT);
ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);
set_error_handler(function ($errno, $errstr, $errfile, $errline) {
if (error_reporting() === 0) {
// Error was suppressed with the @-operator
return false; // Continue with the normal error handler
}
switch($errno) {
case E_STRICT:
throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
}
return false; // Continue with the normal error handler
});
return $this;
}