mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-09 13:02:40 +00:00
unify engine to not require the suffix (as Cache and other places do).
This commit is contained in:
parent
0d486bdab4
commit
cb24dbb084
5 changed files with 129 additions and 25 deletions
|
@ -34,7 +34,7 @@ App::uses('LogEngineCollection', 'Log');
|
|||
* A sample configuration would look like:
|
||||
*
|
||||
* {{{
|
||||
* CakeLog::config('my_log', array('engine' => 'FileLog'));
|
||||
* CakeLog::config('my_log', array('engine' => 'File'));
|
||||
* }}}
|
||||
*
|
||||
* See the documentation on CakeLog::config() for more detail.
|
||||
|
@ -133,7 +133,7 @@ class CakeLog {
|
|||
*
|
||||
* {{{
|
||||
* CakeLog::config('second_file', array(
|
||||
* 'engine' => 'FileLog',
|
||||
* 'engine' => 'File',
|
||||
* 'path' => '/var/logs/my_app/'
|
||||
* ));
|
||||
* }}}
|
||||
|
@ -378,7 +378,7 @@ class CakeLog {
|
|||
*/
|
||||
protected static function _autoConfig() {
|
||||
self::$_Collection->load('default', array(
|
||||
'engine' => 'FileLog',
|
||||
'engine' => 'File',
|
||||
'path' => LOGS,
|
||||
));
|
||||
}
|
||||
|
|
|
@ -63,7 +63,9 @@ class LogEngineCollection extends ObjectCollection {
|
|||
*/
|
||||
protected static function _getLogger($loggerName) {
|
||||
list($plugin, $loggerName) = pluginSplit($loggerName, true);
|
||||
|
||||
if (substr($loggerName, -3) !== 'Log') {
|
||||
$loggerName .= 'Log';
|
||||
}
|
||||
App::uses($loggerName, $plugin . 'Log/Engine');
|
||||
if (!class_exists($loggerName)) {
|
||||
throw new CakeLogException(__d('cake_dev', 'Could not load class %s', $loggerName));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue