diff --git a/lib/Cake/Log/Log.php b/lib/Cake/Log/Log.php index 947a7e1a7ca..858ff839f56 100644 --- a/lib/Cake/Log/Log.php +++ b/lib/Cake/Log/Log.php @@ -115,11 +115,11 @@ class Log { /** - * LogEngineCollection class + * LogEngineRegistry class * - * @var LogEngineCollection + * @var LogEngineRegistry */ - protected static $_Collection; + protected static $_registry; /** * Log levels as detailed in RFC 5424 @@ -160,8 +160,8 @@ class Log { * @return void */ protected static function _init() { - if (empty(static::$_Collection)) { - static::$_Collection = new LogEngineCollection(); + if (empty(static::$_registry)) { + static::$_registry = new LogEngineRegistry(); static::_loadConfig(); } } @@ -175,7 +175,7 @@ protected static function _init() { protected static function _loadConfig() { $loggers = Configure::read('Log'); foreach ((array)$loggers as $key => $config) { - static::$_Collection->load($key, $config); + static::$_registry->load($key, $config); } } @@ -189,7 +189,7 @@ protected static function _loadConfig() { * @return void */ public static function reset() { - static::$_Collection = null; + static::$_registry = null; } /** @@ -211,7 +211,7 @@ public static function config($key, $config) { */ public static function configured() { static::_init(); - return static::$_Collection->attached(); + return static::$_registry->loaded(); } /** @@ -235,7 +235,7 @@ public static function levels() { */ public static function drop($streamName) { static::_init(); - static::$_Collection->unload($streamName); + static::$_registry->unload($streamName); } /** @@ -247,10 +247,10 @@ public static function drop($streamName) { */ public static function enabled($streamName) { static::_init(); - if (!isset(static::$_Collection->{$streamName})) { + if (!isset(static::$_registry->{$streamName})) { throw new Error\Exception(__d('cake_dev', 'Stream %s not found', $streamName)); } - return static::$_Collection->enabled($streamName); + return static::$_registry->enabled($streamName); } /** @@ -263,10 +263,10 @@ public static function enabled($streamName) { */ public static function enable($streamName) { static::_init(); - if (!isset(static::$_Collection->{$streamName})) { + if (!isset(static::$_registry->{$streamName})) { throw new Error\Exception(__d('cake_dev', 'Stream %s not found', $streamName)); } - static::$_Collection->enable($streamName); + static::$_registry->enable($streamName); } /** @@ -280,10 +280,10 @@ public static function enable($streamName) { */ public static function disable($streamName) { static::_init(); - if (!isset(static::$_Collection->{$streamName})) { + if (!isset(static::$_registry->{$streamName})) { throw new Error\Exception(__d('cake_dev', 'Stream %s not found', $streamName)); } - static::$_Collection->disable($streamName); + static::$_registry->disable($streamName); } /** @@ -297,11 +297,11 @@ public static function disable($streamName) { public static function engine($name, $engine = null) { static::_init(); if ($engine) { - static::$_Collection->load($name, $engine); + static::$_registry->load($name, $engine); return; } - if (static::$_Collection->{$name}) { - return static::$_Collection->{$name}; + if (static::$_registry->{$name}) { + return static::$_registry->{$name}; } return false; } @@ -358,8 +358,8 @@ public static function write($level, $message, $scope = array()) { $level = static::$_levels[$level]; } $logged = false; - foreach (static::$_Collection->enabled() as $streamName) { - $logger = static::$_Collection->{$streamName}; + foreach (static::$_registry->enabled() as $streamName) { + $logger = static::$_registry->{$streamName}; $levels = $scopes = null; if ($logger instanceof BaseLog) { $levels = $logger->levels(); diff --git a/lib/Cake/Log/LogEngineCollection.php b/lib/Cake/Log/LogEngineRegistry.php similarity index 97% rename from lib/Cake/Log/LogEngineCollection.php rename to lib/Cake/Log/LogEngineRegistry.php index 3f120af2e4a..06c48408745 100644 --- a/lib/Cake/Log/LogEngineCollection.php +++ b/lib/Cake/Log/LogEngineRegistry.php @@ -24,7 +24,7 @@ * * @package Cake.Log */ -class LogEngineCollection extends ObjectCollection { +class LogEngineRegistry extends ObjectCollection { /** * Loads/constructs a Log engine.