Moved Cache\Factory functionality into Cache class.
This commit is contained in:
parent
c5a2752e8a
commit
b1b2b932cc
|
@ -25,9 +25,28 @@ public static function driver($driver = null)
|
|||
$driver = Config::get('cache.driver');
|
||||
}
|
||||
|
||||
return (array_key_exists($driver, static::$drivers))
|
||||
? static::$drivers[$driver]
|
||||
: static::$drivers[$driver] = Cache\Factory::make($driver);
|
||||
if ( ! array_key_exists($driver, static::$drivers))
|
||||
{
|
||||
switch ($driver)
|
||||
{
|
||||
case 'file':
|
||||
static::$drivers[$driver] = new Cache\Driver\File;
|
||||
break;
|
||||
|
||||
case 'memcached':
|
||||
static::$drivers[$driver] = new Cache\Driver\Memcached;
|
||||
break;
|
||||
|
||||
case 'apc':
|
||||
static::$drivers[$driver] = new Cache\Driver\APC;
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new \Exception("Cache driver [$driver] is not supported.");
|
||||
}
|
||||
}
|
||||
|
||||
return static::$drivers[$driver];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue