mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Adding missed isset() check
Making ConsoleErrorHandler handle both errors, and exceptions in CLI.
This commit is contained in:
parent
74bf455c49
commit
14a6368b39
2 changed files with 5 additions and 3 deletions
|
@ -141,13 +141,15 @@ class ShellDispatcher {
|
||||||
|
|
||||||
$boot = file_exists(ROOT . DS . APP_DIR . DS . 'config' . DS . 'bootstrap.php');
|
$boot = file_exists(ROOT . DS . APP_DIR . DS . 'config' . DS . 'bootstrap.php');
|
||||||
require CORE_PATH . 'cake' . DS . 'bootstrap.php';
|
require CORE_PATH . 'cake' . DS . 'bootstrap.php';
|
||||||
require_once CONSOLE_LIBS . 'console_error_handler.php';
|
|
||||||
set_exception_handler(array('ConsoleErrorHandler', 'handleException'));
|
|
||||||
|
|
||||||
if (!file_exists(APP_PATH . 'config' . DS . 'core.php')) {
|
if (!file_exists(APP_PATH . 'config' . DS . 'core.php')) {
|
||||||
include_once CAKE_CORE_INCLUDE_PATH . DS . 'cake' . DS . 'console' . DS . 'templates' . DS . 'skel' . DS . 'config' . DS . 'core.php';
|
include_once CAKE_CORE_INCLUDE_PATH . DS . 'cake' . DS . 'console' . DS . 'templates' . DS . 'skel' . DS . 'config' . DS . 'core.php';
|
||||||
App::build();
|
App::build();
|
||||||
}
|
}
|
||||||
|
require_once CONSOLE_LIBS . 'console_error_handler.php';
|
||||||
|
set_exception_handler(array('ConsoleErrorHandler', 'handleException'));
|
||||||
|
set_error_handler(array('ConsoleErrorHandler', 'handleError'));
|
||||||
|
|
||||||
if (!defined('FULL_BASE_URL')) {
|
if (!defined('FULL_BASE_URL')) {
|
||||||
define('FULL_BASE_URL', '/');
|
define('FULL_BASE_URL', '/');
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,7 +93,7 @@ class ErrorHandler {
|
||||||
*/
|
*/
|
||||||
public static function handleError($code, $description, $file = null, $line = null, $context = null) {
|
public static function handleError($code, $description, $file = null, $line = null, $context = null) {
|
||||||
$errorConfig = Configure::read('Error');
|
$errorConfig = Configure::read('Error');
|
||||||
if ($errorConfig['level'] && ($code & ~$errorConfig['level'])) {
|
if (isset($errorConfig['level']) && ($code & ~$errorConfig['level'])) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
list($error, $log) = self::_mapErrorCode($code);
|
list($error, $log) = self::_mapErrorCode($code);
|
||||||
|
|
Loading…
Reference in a new issue