Commit 76a5bc48 authored by Taylor Otwell's avatar Taylor Otwell

refactoring various classes.

parent 2b93963f
...@@ -92,7 +92,9 @@ class Cookie { ...@@ -92,7 +92,9 @@ class Cookie {
$time = ($minutes !== 0) ? time() + ($minutes * 60) : 0; $time = ($minutes !== 0) ? time() + ($minutes * 60) : 0;
return setcookie($name, static::hash($name, $value).'~'.$value, $time, $path, $domain, $secure, $http_only); $value = static::hash($name, $value).'~'.$value;
return setcookie($name, $value, $time, $path, $domain, $secure, $http_only);
} }
/** /**
......
...@@ -101,16 +101,6 @@ else ...@@ -101,16 +101,6 @@ else
$response = Response::error('404'); $response = Response::error('404');
} }
if ($response instanceof Routing\Delegate)
{
$response = Routing\Controller::call($response, $route->parameters);
}
if ( ! $response instanceof Response)
{
$response = new Response($response);
}
/** /**
* Stringify the response. We need to force the response to be * Stringify the response. We need to force the response to be
* stringed before closing the session, since the developer may * stringed before closing the session, since the developer may
...@@ -127,9 +117,7 @@ $response->content = $response->render(); ...@@ -127,9 +117,7 @@ $response->content = $response->render();
*/ */
if (Config::$items['session']['driver'] !== '') if (Config::$items['session']['driver'] !== '')
{ {
$flash = array(Input::old_input => Input::get()); Session\Manager::close(array(Input::old_input => Input::get()));
Session\Manager::close($flash);
} }
/** /**
......
...@@ -32,7 +32,7 @@ abstract class Controller { ...@@ -32,7 +32,7 @@ abstract class Controller {
* @param array $parameters * @param array $parameters
* @return mixed * @return mixed
*/ */
public static function call($destination, $parameters) public static function call($destination, $parameters = array())
{ {
if (strpos($destination, '@') === false) if (strpos($destination, '@') === false)
{ {
......
...@@ -5,10 +5,6 @@ class APC implements Driver { ...@@ -5,10 +5,6 @@ class APC implements Driver {
/** /**
* The APC cache driver instance. * The APC cache driver instance.
* *
* This session driver relies on the APC cache driver to provide an interface for
* working with an APC equipped server. The cache driver will provide all of the
* functionality for retrieving and storing items in APC.
*
* @var Cache\Drivers\APC * @var Cache\Drivers\APC
*/ */
private $apc; private $apc;
......
...@@ -57,7 +57,10 @@ class File implements Driver, Sweeper { ...@@ -57,7 +57,10 @@ class File implements Driver, Sweeper {
*/ */
public function delete($id) public function delete($id)
{ {
if (file_exists($this->path.$id)) @unlink($this->path.$id); if (file_exists($this->path.$id))
{
@unlink($this->path.$id);
}
} }
/** /**
......
...@@ -29,12 +29,11 @@ class Cookie implements Transporter { ...@@ -29,12 +29,11 @@ class Cookie implements Transporter {
*/ */
public function put($id, $config) public function put($id, $config)
{ {
// Session cookies may be set to expire on close, which means we will extract($config, EXTR_SKIP);
// need to pass "0" into the cookie manager. This will cause the
// cookie to not be deleted until the user closes their browser.
$minutes = ( ! $config['expire_on_close']) ? $config['lifetime'] : 0;
\Laravel\Cookie::put(Cookie::key, $id, $minutes, $config['path'], $config['domain'], $config['secure']); $minutes = ( ! $expire_on_close) ? $lifetime : 0;
\Laravel\Cookie::put(Cookie::key, $id, $minutes, $path, $domain, $secure);
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment