Commit 6c98f5fa authored by Taylor Otwell's avatar Taylor Otwell

refactoring session class.

parent af4403ba
...@@ -28,31 +28,24 @@ class Session { ...@@ -28,31 +28,24 @@ class Session {
switch (Config::get('session.driver')) switch (Config::get('session.driver'))
{ {
case 'cookie': case 'cookie':
static::$driver = new Session\Cookie; return static::$driver = new Session\Cookie;
break;
case 'file': case 'file':
static::$driver = new Session\File; return static::$driver = new Session\File;
break;
case 'db': case 'db':
static::$driver = new Session\DB; return static::$driver = new Session\DB;
break;
case 'memcached': case 'memcached':
static::$driver = new Session\Memcached; return static::$driver = new Session\Memcached;
break;
case 'apc': case 'apc':
static::$driver = new Session\APC; return static::$driver = new Session\APC;
break;
default: default:
throw new \Exception("Session driver [$driver] is not supported."); throw new \Exception("Session driver [$driver] is not supported.");
} }
} }
return static::$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