refactoring.
This commit is contained in:
parent
3dbc60aee3
commit
5cc7c3a6bd
|
@ -40,7 +40,7 @@ public function has($name)
|
||||||
*/
|
*/
|
||||||
public function get($name, $default = null)
|
public function get($name, $default = null)
|
||||||
{
|
{
|
||||||
return Arr::get($_COOKIE, $name, $default);
|
return Arr::get($this->cookies, $name, $default);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -81,7 +81,7 @@ public function put($name, $value, $minutes = 0, $path = '/', $domain = null, $s
|
||||||
{
|
{
|
||||||
if (headers_sent()) return false;
|
if (headers_sent()) return false;
|
||||||
|
|
||||||
if ($minutes < 0) unset($_COOKIE[$name]);
|
if ($minutes < 0) unset($this->cookies[$name]);
|
||||||
|
|
||||||
// Since PHP needs the cookie lifetime in seconds, we will calculate it here.
|
// Since PHP needs the cookie lifetime in seconds, we will calculate it here.
|
||||||
// A "0" lifetime means the cookie expires when the browser closes.
|
// A "0" lifetime means the cookie expires when the browser closes.
|
||||||
|
|
|
@ -80,7 +80,7 @@ protected static function method($method)
|
||||||
*/
|
*/
|
||||||
protected static function action($action, $https)
|
protected static function action($action, $https)
|
||||||
{
|
{
|
||||||
$uri = IoC::container()->resolve('laravel.uri')->get();
|
$uri = IoC::container()->core('uri')->get();
|
||||||
|
|
||||||
return HTML::entities(URL::to(((is_null($action)) ? $uri : $action), $https));
|
return HTML::entities(URL::to(((is_null($action)) ? $uri : $action), $https));
|
||||||
}
|
}
|
||||||
|
@ -159,7 +159,7 @@ public static function raw_token()
|
||||||
throw new \Exception("A session driver must be specified before using CSRF tokens.");
|
throw new \Exception("A session driver must be specified before using CSRF tokens.");
|
||||||
}
|
}
|
||||||
|
|
||||||
return IoC::container()->resolve('laravel.session')->get('csrf_token');
|
return IoC::container()->core('session')->get('csrf_token');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -116,7 +116,7 @@ public function old($key = null, $default = null)
|
||||||
throw new \Exception('A session driver must be specified in order to access old input.');
|
throw new \Exception('A session driver must be specified in order to access old input.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$driver = IoC::container()->resolve('laravel.session');
|
$driver = IoC::container()->core('session');
|
||||||
|
|
||||||
return Arr::get($driver->get(Input::old_input, array()), $key, $default);
|
return Arr::get($driver->get(Input::old_input, array()), $key, $default);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
*/
|
*/
|
||||||
if (Config::get('session.driver') !== '')
|
if (Config::get('session.driver') !== '')
|
||||||
{
|
{
|
||||||
$session = $container->resolve('laravel.session.manager');
|
$session = $container->core('session.manager');
|
||||||
|
|
||||||
$container->instance('laravel.session', $session->payload(Config::get('session')));
|
$container->instance('laravel.session', $session->payload(Config::get('session')));
|
||||||
}
|
}
|
||||||
|
@ -36,15 +36,15 @@
|
||||||
* will be called with the current requst instance. If no route is found, the 404
|
* will be called with the current requst instance. If no route is found, the 404
|
||||||
* response will be returned to the browser.
|
* response will be returned to the browser.
|
||||||
*/
|
*/
|
||||||
$request = $container->resolve('laravel.request');
|
$request = $container->core('request');
|
||||||
|
|
||||||
list($method, $uri) = array($request->method(), $request->uri());
|
list($method, $uri) = array($request->method(), $request->uri());
|
||||||
|
|
||||||
$route = $container->resolve('laravel.routing.router')->route($request, $method, $uri);
|
$route = $container->core('routing.router')->route($request, $method, $uri);
|
||||||
|
|
||||||
if ( ! is_null($route))
|
if ( ! is_null($route))
|
||||||
{
|
{
|
||||||
$response = $container->resolve('laravel.routing.caller')->call($route);
|
$response = $container->core('routing.caller')->call($route);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -65,9 +65,9 @@
|
||||||
*/
|
*/
|
||||||
if (isset($session))
|
if (isset($session))
|
||||||
{
|
{
|
||||||
$flash = array(Input::old_input => $container->resolve('laravel.input')->get());
|
$flash = array(Input::old_input => $container->core('input')->get());
|
||||||
|
|
||||||
$session->close($container->resolve('laravel.session'), Config::get('session'), $flash);
|
$session->close($container->core('session'), Config::get('session'), $flash);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue