Browse Source

refactoring.

Taylor Otwell 13 years ago
parent
commit
5cc7c3a6bd
5 changed files with 17 additions and 17 deletions
  1. 2 2
      laravel/cookie.php
  2. 6 6
      laravel/facades.php
  3. 2 2
      laravel/form.php
  4. 1 1
      laravel/input.php
  5. 6 6
      laravel/laravel.php

+ 2 - 2
laravel/cookie.php

@@ -40,7 +40,7 @@ class Cookie {
 	 */
 	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 {
 	{
 		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.
 		// A "0" lifetime means the cookie expires when the browser closes.

+ 6 - 6
laravel/facades.php

@@ -32,12 +32,12 @@ abstract class Facade {
 
 }
 
-class Auth extends Facade { public static $resolve = 'laravel.auth'; }
-class Cookie extends Facade { public static $resolve = 'laravel.cookie'; }
+class Auth    extends Facade { public static $resolve = 'laravel.auth'; }
+class Cookie  extends Facade { public static $resolve = 'laravel.cookie'; }
 class Crypter extends Facade { public static $resolve = 'laravel.crypter'; }
-class Hasher extends Facade { public static $resolve = 'laravel.hasher'; }
-class Input extends Facade { public static $resolve = 'laravel.input'; }
+class Hasher  extends Facade { public static $resolve = 'laravel.hasher'; }
+class Input   extends Facade { public static $resolve = 'laravel.input'; }
 class Request extends Facade { public static $resolve = 'laravel.request'; }
 class Session extends Facade { public static $resolve = 'laravel.session'; }
-class URI extends Facade { public static $resolve = 'laravel.uri'; }
-class View extends Facade { public static $resolve = 'laravel.view'; }
+class URI     extends Facade { public static $resolve = 'laravel.uri'; }
+class View    extends Facade { public static $resolve = 'laravel.view'; }

+ 2 - 2
laravel/form.php

@@ -80,7 +80,7 @@ class Form {
 	 */
 	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));
 	}
@@ -159,7 +159,7 @@ class Form {
 			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');
 	}
 
 	/**

+ 1 - 1
laravel/input.php

@@ -116,7 +116,7 @@ class 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);
 	}

+ 6 - 6
laravel/laravel.php

@@ -25,7 +25,7 @@ date_default_timezone_set(Config::get('application.timezone'));
  */
 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')));
 }
@@ -36,15 +36,15 @@ if (Config::get('session.driver') !== '')
  * will be called with the current requst instance. If no route is found, the 404
  * response will be returned to the browser.
  */
-$request = $container->resolve('laravel.request');
+$request = $container->core('request');
 
 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))
 {
-	$response = $container->resolve('laravel.routing.caller')->call($route);
+	$response = $container->core('routing.caller')->call($route);
 }
 else
 {
@@ -65,9 +65,9 @@ $response->content = $response->render();
  */
 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);
 }
 
 /**