From 16a1f899294f258b4c29ef5f7e076b3eb4b911cf Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sat, 6 Aug 2011 20:27:18 -0500 Subject: [PATCH] refactor cache driver method. --- system/cache.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/system/cache.php b/system/cache.php index 30e541b8..67bceca8 100644 --- a/system/cache.php +++ b/system/cache.php @@ -30,23 +30,18 @@ class Cache { switch ($driver) { case 'file': - static::$drivers[$driver] = new Cache\File; - break; + return static::$drivers[$driver] = new Cache\File; case 'memcached': - static::$drivers[$driver] = new Cache\Memcached; - break; + return static::$drivers[$driver] = new Cache\Memcached; case 'apc': - static::$drivers[$driver] = new Cache\APC; - break; + return static::$drivers[$driver] = new Cache\APC; default: throw new \Exception("Cache driver [$driver] is not supported."); } } - - return static::$drivers[$driver]; } /**