From a3401d52474ec5fab2426310cf4a4c8b9f59b456 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 6 Jul 2011 13:40:03 -0700 Subject: [PATCH] Cleaning up Cache class. --- system/cache.php | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/system/cache.php b/system/cache.php index 6113b906..f3694b58 100644 --- a/system/cache.php +++ b/system/cache.php @@ -10,19 +10,13 @@ class Cache { private static $drivers = array(); /** - * Get the cache driver instance. + * Get a cache driver instance. Cache drivers are singletons. * * @param string $driver * @return Cache\Driver */ public static function driver($driver = null) { - // -------------------------------------------------- - // If the cache driver has already been instantiated, - // we'll just return that existing instance. - // - // Otherwise, we'll instantiate a new one. - // -------------------------------------------------- if ( ! array_key_exists($driver, static::$drivers)) { if (is_null($driver)) @@ -41,13 +35,9 @@ public static function driver($driver = null) */ public static function __callStatic($method, $parameters) { - // -------------------------------------------------- - // Passing method calls to the driver instance allows - // a better API for the developer. - // - // For instance, instead of saying Cache::driver()->foo(), - // we can now just say Cache::foo(). - // -------------------------------------------------- + // Passing method calls to the driver instance provides a better API for the + // developer. For instance, instead of saying Cache::driver()->foo(), we can + // now just say Cache::foo(). return call_user_func_array(array(static::driver(), $method), $parameters); }