Browse Source

refactoring session class.

Taylor Otwell 13 years ago
parent
commit
6c98f5faee
1 changed files with 5 additions and 12 deletions
  1. 5 12
      system/session.php

+ 5 - 12
system/session.php

@@ -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;
-					break;
+					return static::$driver = new Session\Cookie;
 
 
 				case 'file':
 				case 'file':
-					static::$driver = new Session\File;
-					break;
+					return static::$driver = new Session\File;
 
 
 				case 'db':
 				case 'db':
-					static::$driver = new Session\DB;
-					break;
+					return static::$driver = new Session\DB;
 
 
 				case 'memcached':
 				case 'memcached':
-					static::$driver = new Session\Memcached;
-					break;
+					return static::$driver = new Session\Memcached;
 
 
 				case 'apc':
 				case 'apc':
-					static::$driver = new Session\APC;
-					break;
+					return static::$driver = new Session\APC;
 
 
 				default:
 				default:
 					throw new \Exception("Session driver [$driver] is not supported.");
 					throw new \Exception("Session driver [$driver] is not supported.");
 			}			
 			}			
 		}
 		}
-
-		return static::$driver;
 	}
 	}
 
 
 	/**
 	/**