Skip to content
Permalink
Browse files

Rename LogEngineCollection to LogEngineRegistry

In preparation for converting the logging collection into the newer
style registry rename the internal property and collection class.
  • Loading branch information...
markstory committed Aug 13, 2013
1 parent 4ef4182 commit 88f2f30731a94ec4105b91fcb497cfbff627a6b1
Showing with 21 additions and 21 deletions.
  1. +20 −20 lib/Cake/Log/Log.php
  2. +1 −1 lib/Cake/Log/{LogEngineCollection.php → LogEngineRegistry.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();
@@ -24,7 +24,7 @@
*
* @package Cake.Log
*/
class LogEngineCollection extends ObjectCollection {
class LogEngineRegistry extends ObjectCollection {
/**
* Loads/constructs a Log engine.

0 comments on commit 88f2f30

Please sign in to comment.
You can’t perform that action at this time.