Skip to content

Commit

Permalink
Use the new Cache::registry() method within the Cache class.
Browse files Browse the repository at this point in the history
  • Loading branch information
dakota committed Sep 10, 2015
1 parent d07708c commit 313318a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Cache/Cache.php
Expand Up @@ -135,9 +135,7 @@ public static function registry()
*/
protected static function _buildEngine($name)
{
if (empty(static::$_registry)) {
static::$_registry = new CacheRegistry();
}
$registry = static::registry();

if (empty(static::$_config[$name]['className'])) {
throw new InvalidArgumentException(
Expand All @@ -146,7 +144,7 @@ protected static function _buildEngine($name)
}

$config = static::$_config[$name];
static::$_registry->load($name, $config);
$registry->load($name, $config);

if (!empty($config['groups'])) {
foreach ($config['groups'] as $group) {
Expand All @@ -172,12 +170,14 @@ public static function engine($config)
return new NullEngine();
}

if (isset(static::$_registry->{$config})) {
return static::$_registry->{$config};
$registry = static::registry();

if (isset($registry->{$config})) {
return $registry->{$config};
}

static::_buildEngine($config);
return static::$_registry->{$config};
return $registry->{$config};
}

/**
Expand Down

0 comments on commit 313318a

Please sign in to comment.