continued ioc refactoring.

This commit is contained in:
Taylor Otwell
2011-08-26 21:42:04 -05:00
parent fb3a0df0dd
commit 1e49001dfc
44 changed files with 1388 additions and 1046 deletions

View File

@@ -1,6 +1,5 @@
<?php namespace Laravel\Session;
use Laravel\Config;
use Laravel\Security\Crypter;
class Cookie extends Driver {
@@ -19,22 +18,26 @@ class Cookie extends Driver {
*/
private $crypter;
/**
* The session configuration array.
*
* @var array
*/
private $config;
/**
* Create a new Cookie session driver instance.
*
* @param Crypter $crypter
* @param Laravel\Cookie $cookie
* @param array $config
* @return void
*/
public function __construct(Crypter $crypter, \Laravel\Cookie $cookie)
public function __construct(Crypter $crypter, \Laravel\Cookie $cookie, $config)
{
$this->cookie = $cookie;
$this->config = $config;
$this->crypter = $crypter;
if (Config::get('application.key') == '')
{
throw new \Exception("You must set an application key before using the Cookie session driver.");
}
}
/**
@@ -63,7 +66,7 @@ class Cookie extends Driver {
{
if ( ! headers_sent())
{
extract(Config::get('session'));
extract($this->config);
$payload = $this->crypter->encrypt(serialize($this->session));