refactor cache driver method.

This commit is contained in:
Taylor Otwell 2011-08-06 20:27:18 -05:00
parent d59b3ad90a
commit 16a1f89929
1 changed files with 3 additions and 8 deletions

View File

@ -30,23 +30,18 @@ public static function driver($driver = null)
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];
}
/**