Commit b1b2b932 authored by Taylor Otwell's avatar Taylor Otwell

Moved Cache\Factory functionality into Cache class.

parent c5a2752e
......@@ -25,9 +25,28 @@ class Cache {
$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];
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment