moving some laravel classes around, switching alias to reflect changes. added some factories. removed system ioc container config file.

This commit is contained in:
Taylor Otwell
2011-11-11 21:27:30 -06:00
parent b625ebdcf3
commit b6ab0b08ce
23 changed files with 384 additions and 388 deletions

View File

@@ -0,0 +1,40 @@
<?php namespace Laravel\Session\Drivers;
use Laravel\Cache\Manager as Cache;
class Factory {
/**
* Create a new session driver instance.
*
* @param string $driver
* @return Driver
*/
public static function make($driver)
{
switch ($driver)
{
case 'apc':
return new APC(Cache::driver('apc'));
case 'cookie':
return new Cookie;
case 'database':
return new Database(\Laravel\Database\Manager::connection());
case 'file':
return new File(SESSION_PATH);
case 'memcached':
return new Memcached(Cache::driver('memcached'));
case 'redis':
return new Redis(Cache::driver('redis'));
default:
throw new \Exception("Session driver [$driver] is not supported.");
}
}
}