Moved Session\Factory functionality into the Session class.

This commit is contained in:
Taylor Otwell 2011-07-08 09:48:01 -07:00
parent b1b2b932cc
commit 8056e0d1a7
1 changed files with 21 additions and 1 deletions

View File

@ -25,7 +25,27 @@ public static function driver()
{ {
if (is_null(static::$driver)) if (is_null(static::$driver))
{ {
static::$driver = Session\Factory::make(Config::get('session.driver')); switch (Config::get('session.driver'))
{
case 'file':
static::$driver = new Session\Driver\File;
break;
case 'db':
static::$driver = new Session\Driver\DB;
break;
case 'memcached':
static::$driver = new Session\Driver\Memcached;
break;
case 'apc':
static::$driver = new Session\Driver\APC;
break;
default:
throw new \Exception("Session driver [$driver] is not supported.");
}
} }
return static::$driver; return static::$driver;