Commit 5cc7c3a6 authored by Taylor Otwell's avatar Taylor Otwell

refactoring.

parent 3dbc60ae
...@@ -40,7 +40,7 @@ class Cookie { ...@@ -40,7 +40,7 @@ class Cookie {
*/ */
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 @@ class Cookie { ...@@ -81,7 +81,7 @@ class Cookie {
{ {
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.
......
...@@ -32,12 +32,12 @@ abstract class Facade { ...@@ -32,12 +32,12 @@ abstract class Facade {
} }
class Auth extends Facade { public static $resolve = 'laravel.auth'; } class Auth extends Facade { public static $resolve = 'laravel.auth'; }
class Cookie extends Facade { public static $resolve = 'laravel.cookie'; } class Cookie extends Facade { public static $resolve = 'laravel.cookie'; }
class Crypter extends Facade { public static $resolve = 'laravel.crypter'; } class Crypter extends Facade { public static $resolve = 'laravel.crypter'; }
class Hasher extends Facade { public static $resolve = 'laravel.hasher'; } class Hasher extends Facade { public static $resolve = 'laravel.hasher'; }
class Input extends Facade { public static $resolve = 'laravel.input'; } class Input extends Facade { public static $resolve = 'laravel.input'; }
class Request extends Facade { public static $resolve = 'laravel.request'; } class Request extends Facade { public static $resolve = 'laravel.request'; }
class Session extends Facade { public static $resolve = 'laravel.session'; } class Session extends Facade { public static $resolve = 'laravel.session'; }
class URI extends Facade { public static $resolve = 'laravel.uri'; } class URI extends Facade { public static $resolve = 'laravel.uri'; }
class View extends Facade { public static $resolve = 'laravel.view'; } class View extends Facade { public static $resolve = 'laravel.view'; }
\ No newline at end of file \ No newline at end of file
...@@ -80,7 +80,7 @@ class Form { ...@@ -80,7 +80,7 @@ class Form {
*/ */
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 @@ class Form { ...@@ -159,7 +159,7 @@ class Form {
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 @@ class Input { ...@@ -116,7 +116,7 @@ class Input {
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 @@ date_default_timezone_set(Config::get('application.timezone')); ...@@ -25,7 +25,7 @@ date_default_timezone_set(Config::get('application.timezone'));
*/ */
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 @@ if (Config::get('session.driver') !== '') ...@@ -36,15 +36,15 @@ if (Config::get('session.driver') !== '')
* 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 @@ $response->content = $response->render(); ...@@ -65,9 +65,9 @@ $response->content = $response->render();
*/ */
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);
} }
/** /**
......
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