mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
changing LOG_ERROR to LOG_ERR in core files
This commit is contained in:
parent
595cad84b3
commit
e6860fb856
5 changed files with 8 additions and 8 deletions
|
@ -909,7 +909,7 @@ class App {
|
|||
}
|
||||
|
||||
list(, $log) = ErrorHandler::mapErrorCode($lastError['type']);
|
||||
if ($log !== LOG_ERROR) {
|
||||
if ($log !== LOG_ERR) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ class Object {
|
|||
* @param integer $type Error type constant. Defined in app/Config/core.php.
|
||||
* @return boolean Success of log write
|
||||
*/
|
||||
public function log($msg, $type = LOG_ERROR) {
|
||||
public function log($msg, $type = LOG_ERR) {
|
||||
App::uses('CakeLog', 'Log');
|
||||
if (!is_string($msg)) {
|
||||
$msg = print_r($msg, true);
|
||||
|
|
|
@ -158,7 +158,7 @@ class ErrorHandler {
|
|||
}
|
||||
$errorConfig = Configure::read('Error');
|
||||
list($error, $log) = self::mapErrorCode($code);
|
||||
if ($log === LOG_ERROR) {
|
||||
if ($log === LOG_ERR) {
|
||||
return self::handleFatalError($code, $description, $file, $line);
|
||||
}
|
||||
|
||||
|
@ -197,7 +197,7 @@ class ErrorHandler {
|
|||
*/
|
||||
public static function handleFatalError($code, $description, $file, $line) {
|
||||
$logMessage = 'Fatal Error (' . $code . '): ' . $description . ' in [' . $file . ', line ' . $line . ']';
|
||||
CakeLog::write(LOG_ERROR, $logMessage);
|
||||
CakeLog::write(LOG_ERR, $logMessage);
|
||||
|
||||
$exceptionHandler = Configure::read('Exception.handler');
|
||||
if (!is_callable($exceptionHandler)) {
|
||||
|
@ -231,7 +231,7 @@ class ErrorHandler {
|
|||
case E_COMPILE_ERROR:
|
||||
case E_USER_ERROR:
|
||||
$error = 'Fatal Error';
|
||||
$log = LOG_ERROR;
|
||||
$log = LOG_ERR;
|
||||
break;
|
||||
case E_WARNING:
|
||||
case E_USER_WARNING:
|
||||
|
|
|
@ -77,7 +77,7 @@ class ConsoleLogTest extends CakeTestCase {
|
|||
$message = 'Test error message';
|
||||
$mock->expects($this->once())
|
||||
->method('write');
|
||||
TestCakeLog::write(LOG_ERROR, $message);
|
||||
TestCakeLog::write(LOG_ERR, $message);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -96,7 +96,7 @@ class ConsoleLogTest extends CakeTestCase {
|
|||
$message = 'Test error message';
|
||||
$mock->expects($this->once())
|
||||
->method('write');
|
||||
TestCakeLog::write(LOG_ERROR, $message);
|
||||
TestCakeLog::write(LOG_ERR, $message);
|
||||
$this->assertTrue(file_exists(LOGS . 'error.log'), 'error.log missing');
|
||||
$logOutput = file_get_contents(LOGS . 'error.log');
|
||||
$this->assertContains($message, $logOutput);
|
||||
|
|
|
@ -227,7 +227,7 @@ class Debugger {
|
|||
case E_COMPILE_ERROR:
|
||||
case E_USER_ERROR:
|
||||
$error = 'Fatal Error';
|
||||
$level = LOG_ERROR;
|
||||
$level = LOG_ERR;
|
||||
break;
|
||||
case E_WARNING:
|
||||
case E_USER_WARNING:
|
||||
|
|
Loading…
Reference in a new issue