public static function factory($driver)
	{
		if (isset(static::$registrar[$driver]))
		{
			$resolver = static::$registrar[$driver];

			return $resolver();
		}

		switch ($driver)
		{
			case 'apc':
				return new Session\Drivers\APC(Cache::driver('apc'));

			case 'cookie':
				return new Session\Drivers\Cookie;

			case 'database':
				return new Session\Drivers\Database(Database::connection());

			case 'file':
				return new Session\Drivers\File(path('storage').'sessions'.DS);

			case 'memcached':
				return new Session\Drivers\Memcached(Cache::driver('memcached'));

			case 'memory':
				return new Session\Drivers\Memory;

			case 'redis':
				return new Session\Drivers\Redis(Cache::driver('redis'));

			default:
				throw new \Exception("Session driver [$driver] is not supported.");
		}
	}
public static function factory($driver)
	{
		if (isset(static::$registrar[$driver]))
		{
			$resolver = static::$registrar[$driver];

			return $resolver();
		}

		switch ($driver)
		{
			case 'apc':
				return new Session\Drivers\APC(Cache::driver('apc'));

			case 'cookie':
				return new Session\Drivers\Cookie;

			case 'database':
				return new Session\Drivers\Database(Database::connection());

			case 'file':
				return new Session\Drivers\File(path('storage').'sessions'.DS);

			case 'memcached':
				return new Session\Drivers\Memcached(Cache::driver('memcached'));

			case 'memory':
				return new Session\Drivers\Memory;

			case 'redis':
				return new Session\Drivers\Redis(Cache::driver('redis'));

			default:
				throw new \Exception("Session driver [$driver] is not supported.");
		}
	}
public static function factory ( $ driver ) { if ( isset ( static :: $ registrar [ $ driver ] ) ) { $ resolver = static :: $ registrar [ $ driver ] ; return $ resolver ( ) ; } switch ( $ driver ) { case 'apc' : return new Session \ Drivers \ APC ( Cache :: driver ( 'apc' ) ) ; case 'cookie' : return new Session \ Drivers \ Cookie ; case 'database' : return new Session \ Drivers \ Database ( Database :: connection ( ) ) ; case 'file' : return new Session \ Drivers \ File ( path ( 'storage' ) . 'sessions' . DS ) ; case 'memcached' : return new Session \ Drivers \ Memcached ( Cache :: driver ( 'memcached' ) ) ; case 'memory' : return new Session \ Drivers \ Memory ; case 'redis' : return new Session \ Drivers \ Redis ( Cache :: driver ( 'redis' ) ) ; default : throw new \ Exception ( "Session driver [$driver] is not supported." ) ; } }
Create a new session driver instance.

@param  string  $driver
@return Session\Drivers\Driver
Create a new session driver instance .