refactoring.

This commit is contained in:
Taylor Otwell
2011-09-21 21:46:16 -05:00
parent b9b9711921
commit 0c4018ec88
42 changed files with 980 additions and 1330 deletions

View File

@@ -1,9 +1,25 @@
<?php namespace Laravel\Session\Transporters;
use Laravel\Cookie as C;
class Cookie implements Transporter {
/**
* The cookie manager instance.
*
* @var Cookie
*/
protected $cookies;
/**
* Create a new cookie session transporter instance.
*
* @param Cookie $cookie
* @return void
*/
public function __construct(\Laravel\Cookie $cookies)
{
$this->cookies = $cookies;
}
/**
* Get the session identifier for the request.
*
@@ -12,7 +28,7 @@ class Cookie implements Transporter {
*/
public function get($config)
{
return C::get('laravel_session');
return $this->cookies->get('laravel_session');
}
/**
@@ -26,7 +42,7 @@ class Cookie implements Transporter {
{
$minutes = ($config['expire_on_close']) ? 0 : $config['lifetime'];
C::put('laravel_session', $id, $minutes, $config['path'], $config['domain']);
$this->cookies->put('laravel_session', $id, $minutes, $config['path'], $config['domain']);
}
}