mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
using the domain cake_error for messages intended for the developer
This commit is contained in:
parent
f95340b361
commit
b19ca3c95e
3 changed files with 6 additions and 6 deletions
|
@ -70,13 +70,13 @@ class Configure {
|
||||||
));
|
));
|
||||||
|
|
||||||
if (!include(CONFIGS . 'core.php')) {
|
if (!include(CONFIGS . 'core.php')) {
|
||||||
trigger_error(__d('cake', "Can't find application core file. Please create %score.php, and make sure it is readable by PHP.", CONFIGS), E_USER_ERROR);
|
trigger_error(__d('cake_error', "Can't find application core file. Please create %score.php, and make sure it is readable by PHP.", CONFIGS), E_USER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
App::init();
|
App::init();
|
||||||
App::build();
|
App::build();
|
||||||
if (!include(CONFIGS . 'bootstrap.php')) {
|
if (!include(CONFIGS . 'bootstrap.php')) {
|
||||||
trigger_error(__d('cake', "Can't find application bootstrap file. Please create %sbootstrap.php, and make sure it is readable by PHP.", CONFIGS), E_USER_ERROR);
|
trigger_error(__d('cake_error', "Can't find application bootstrap file. Please create %sbootstrap.php, and make sure it is readable by PHP.", CONFIGS), E_USER_ERROR);
|
||||||
}
|
}
|
||||||
$level = -1;
|
$level = -1;
|
||||||
if (isset(self::$_values['Error']['level'])) {
|
if (isset(self::$_values['Error']['level'])) {
|
||||||
|
|
|
@ -184,7 +184,7 @@ class CakeException extends RuntimeException {
|
||||||
public function __construct($message, $code = 500) {
|
public function __construct($message, $code = 500) {
|
||||||
if (is_array($message)) {
|
if (is_array($message)) {
|
||||||
$this->_attributes = $message;
|
$this->_attributes = $message;
|
||||||
$message = __d('cake', $this->_messageTemplate, $message);
|
$message = __d('cake_error', $this->_messageTemplate, $message);
|
||||||
}
|
}
|
||||||
parent::__construct($message, $code);
|
parent::__construct($message, $code);
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ class CakeLog {
|
||||||
*/
|
*/
|
||||||
public static function config($key, $config) {
|
public static function config($key, $config) {
|
||||||
if (empty($config['engine'])) {
|
if (empty($config['engine'])) {
|
||||||
throw new CakeLogException(__d('cake', 'Missing logger classname'));
|
throw new CakeLogException(__d('cake_error', 'Missing logger classname'));
|
||||||
}
|
}
|
||||||
$loggerName = $config['engine'];
|
$loggerName = $config['engine'];
|
||||||
unset($config['engine']);
|
unset($config['engine']);
|
||||||
|
@ -90,7 +90,7 @@ class CakeLog {
|
||||||
$logger = new $className($config);
|
$logger = new $className($config);
|
||||||
if (!$logger instanceof CakeLogInterface) {
|
if (!$logger instanceof CakeLogInterface) {
|
||||||
throw new CakeLogException(sprintf(
|
throw new CakeLogException(sprintf(
|
||||||
__d('cake', 'logger class %s does not implement a write method.'), $loggerName
|
__d('cake_error', 'logger class %s does not implement a write method.'), $loggerName
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
self::$_streams[$key] = $logger;
|
self::$_streams[$key] = $logger;
|
||||||
|
@ -109,7 +109,7 @@ class CakeLog {
|
||||||
|
|
||||||
App::uses($loggerName, $plugin . 'Log/Engine');
|
App::uses($loggerName, $plugin . 'Log/Engine');
|
||||||
if (!class_exists($loggerName)) {
|
if (!class_exists($loggerName)) {
|
||||||
throw new CakeLogException(__d('cake', 'Could not load class %s', $loggerName));
|
throw new CakeLogException(__d('cake_error', 'Could not load class %s', $loggerName));
|
||||||
}
|
}
|
||||||
return $loggerName;
|
return $loggerName;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue