Skip to content

Commit 313318a

Browse files
committed
Use the new Cache::registry() method within the Cache class.
1 parent d07708c commit 313318a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/Cache/Cache.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,7 @@ public static function registry()
135135
*/
136136
protected static function _buildEngine($name)
137137
{
138-
if (empty(static::$_registry)) {
139-
static::$_registry = new CacheRegistry();
140-
}
138+
$registry = static::registry();
141139

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

148146
$config = static::$_config[$name];
149-
static::$_registry->load($name, $config);
147+
$registry->load($name, $config);
150148

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

175-
if (isset(static::$_registry->{$config})) {
176-
return static::$_registry->{$config};
173+
$registry = static::registry();
174+
175+
if (isset($registry->{$config})) {
176+
return $registry->{$config};
177177
}
178178

179179
static::_buildEngine($config);
180-
return static::$_registry->{$config};
180+
return $registry->{$config};
181181
}
182182

183183
/**

0 commit comments

Comments
 (0)