refactoring various classes.
This commit is contained in:
parent
2b93963f34
commit
76a5bc483a
|
@ -92,7 +92,9 @@ public static function put($name, $value, $minutes = 0, $path = '/', $domain = n
|
||||||
|
|
||||||
$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 @@
|
||||||
$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 @@
|
||||||
*/
|
*/
|
||||||
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 {
|
||||||
* @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 {
|
||||||
/**
|
/**
|
||||||
* 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 @@ public function save($session, $config, $exists)
|
||||||
*/
|
*/
|
||||||
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 @@ public function get($config)
|
||||||
*/
|
*/
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue