added facades and made other ioc improvements.
This commit is contained in:
@@ -7,7 +7,7 @@ class Cookie extends Driver {
|
||||
/**
|
||||
* The cookie engine instance.
|
||||
*
|
||||
* @var Cookie_Engine
|
||||
* @var Cookie
|
||||
*/
|
||||
private $cookie;
|
||||
|
||||
@@ -28,9 +28,9 @@ class Cookie extends Driver {
|
||||
/**
|
||||
* Create a new Cookie session driver instance.
|
||||
*
|
||||
* @param Crypter $crypter
|
||||
* @param Crypter $crypter
|
||||
* @param Laravel\Cookie $cookie
|
||||
* @param array $config
|
||||
* @param array $config
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Crypter $crypter, \Laravel\Cookie $cookie, $config)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php namespace Laravel\Session;
|
||||
|
||||
use Laravel\Str;
|
||||
use Laravel\Input;
|
||||
use Laravel\Input_Engine;
|
||||
use Laravel\Cookie;
|
||||
|
||||
abstract class Driver {
|
||||
@@ -196,11 +196,11 @@ abstract class Driver {
|
||||
* The input of the current request will also be flashed to the session so it is
|
||||
* available for the next request via the "old" method on the input class.
|
||||
*
|
||||
* @param Laravel\Input $input
|
||||
* @param array $config
|
||||
* @param Laravel\Input_Engine $input
|
||||
* @param array $config
|
||||
* @return void
|
||||
*/
|
||||
public function close(Input $input, $config)
|
||||
public function close(Input_Engine $input, $config)
|
||||
{
|
||||
$this->flash('laravel_old_input', $input->get())->age();
|
||||
|
||||
@@ -242,7 +242,7 @@ abstract class Driver {
|
||||
* already been sent to the browser.
|
||||
*
|
||||
* @param Laravel\Cookie $cookie
|
||||
* @param array $config
|
||||
* @param array $config
|
||||
* @return void
|
||||
*/
|
||||
protected function write_cookie(Cookie $cookies, $config)
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
class File extends Driver implements Sweeper {
|
||||
|
||||
/**
|
||||
* The file manager instance.
|
||||
* The file engine instance.
|
||||
*
|
||||
* @var Laravel\File
|
||||
* @var Laravel\File_Engine
|
||||
*/
|
||||
private $file;
|
||||
|
||||
@@ -19,11 +19,11 @@ class File extends Driver implements Sweeper {
|
||||
/**
|
||||
* Create a new File session driver instance.
|
||||
*
|
||||
* @param Laravel\File $file
|
||||
* @param string $path
|
||||
* @param Laravel\File_Engine $file
|
||||
* @param string $path
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(\Laravel\File $file, $path)
|
||||
public function __construct(\Laravel\File_Engine $file, $path)
|
||||
{
|
||||
$this->file = $file;
|
||||
$this->path = $path;
|
||||
|
||||
@@ -1,10 +1,27 @@
|
||||
<?php namespace Laravel\Session;
|
||||
|
||||
use Laravel\Config;
|
||||
use Laravel\Container;
|
||||
|
||||
class Manager {
|
||||
|
||||
/**
|
||||
* The container instance.
|
||||
*
|
||||
* @var Container
|
||||
*/
|
||||
private $container;
|
||||
|
||||
/**
|
||||
* Create a new session manager instance.
|
||||
*
|
||||
* @param Container $container
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Container $container)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the session driver.
|
||||
*
|
||||
@@ -12,15 +29,14 @@ class Manager {
|
||||
* file. Only one session driver may be active for a given request, so the driver will
|
||||
* be managed as a singleton.
|
||||
*
|
||||
* @param Container $container
|
||||
* @param string $driver
|
||||
* @return Session\Driver
|
||||
*/
|
||||
public static function driver(Container $container, $driver)
|
||||
public static function driver($driver)
|
||||
{
|
||||
if (in_array($driver, array('cookie', 'file', 'database', 'apc', 'memcached')))
|
||||
{
|
||||
return $container->resolve('laravel.session.'.$driver);
|
||||
return $this->container->resolve('laravel.session.'.$driver);
|
||||
}
|
||||
|
||||
throw new \Exception("Session driver [$driver] is not supported.");
|
||||
|
||||
Reference in New Issue
Block a user