diff --git a/laravel/cache/manager.php b/laravel/cache/manager.php index ac356a2e..bb29e3d6 100644 --- a/laravel/cache/manager.php +++ b/laravel/cache/manager.php @@ -32,12 +32,12 @@ public static function driver($driver = null) if ( ! array_key_exists($driver, static::$drivers)) { - if ( ! IoC::container()->registered("laravel.cache.{$driver}")) + if ( ! IoC::registered("laravel.cache.{$driver}")) { throw new \Exception("Cache driver [$driver] is not supported."); } - return static::$drivers[$driver] = IoC::container()->core("cache.{$driver}"); + return static::$drivers[$driver] = IoC::core("cache.{$driver}"); } return static::$drivers[$driver]; @@ -62,4 +62,4 @@ public static function __callStatic($method, $parameters) return call_user_func_array(array(static::driver(), $method), $parameters); } -} \ No newline at end of file +} diff --git a/laravel/container.php b/laravel/container.php index d58707d5..63679d37 100644 --- a/laravel/container.php +++ b/laravel/container.php @@ -107,7 +107,7 @@ public function __construct($registry = array()) * * * // Register an object and its resolver - * IoC::container()->register('mailer', function($c) {return new Mailer;}); + * IoC::register('mailer', function($c) {return new Mailer;}); * * * @param string $name @@ -153,7 +153,7 @@ public function singleton($name, $resolver) * * * // Register an instance as a singleton in the container - * IoC::container()->instance('mailer', new Mailer); + * IoC::instance('mailer', new Mailer); * * * @param string $name @@ -170,13 +170,13 @@ public function instance($name, $instance) * * * // Resolve the "laravel.router" class from the container - * $input = IoC::container()->core('router'); + * $input = IoC::core('router'); * * // Equivalent resolution using the "resolve" method - * $input = IoC::container()->resolve('laravel.router'); + * $input = IoC::resolve('laravel.router'); * * // Pass an array of parameters to the resolver - * $input = IoC::container()->core('router', array('test')); + * $input = IoC::core('router', array('test')); * * * @param string $name @@ -193,10 +193,10 @@ public function core($name, $parameters = array()) * * * // Get an instance of the "mailer" object registered in the container - * $mailer = IoC::container()->resolve('mailer'); + * $mailer = IoC::resolve('mailer'); * * // Pass an array of parameters to the resolver - * $mailer = IoC::container()->resolve('mailer', array('test')); + * $mailer = IoC::resolve('mailer', array('test')); * * * @param string $name @@ -222,4 +222,4 @@ public function resolve($name, $parameters = array()) return $object; } -} \ No newline at end of file +} diff --git a/laravel/facades.php b/laravel/facades.php index 4f7d2cbb..d46a59b0 100644 --- a/laravel/facades.php +++ b/laravel/facades.php @@ -27,7 +27,7 @@ abstract class Facade { */ public static function __callStatic($method, $parameters) { - $class = IoC::container()->resolve(static::$resolve); + $class = IoC::resolve(static::$resolve); $count = count($parameters); @@ -59,4 +59,4 @@ public static function __callStatic($method, $parameters) } -class Session extends Facade { public static $resolve = 'laravel.session'; } \ No newline at end of file +class Session extends Facade { public static $resolve = 'laravel.session'; } diff --git a/laravel/form.php b/laravel/form.php index 73ba5670..0207ee35 100644 --- a/laravel/form.php +++ b/laravel/form.php @@ -149,7 +149,7 @@ public static function close() */ public static function token() { - $token = IoC::container()->core('session')->token(); + $token = IoC::core('session')->token(); return static::input('hidden', 'csrf_token', $token); } @@ -540,4 +540,4 @@ protected static function id($name, $attributes) } } -} \ No newline at end of file +} diff --git a/laravel/input.php b/laravel/input.php index c50c242c..6e6bf215 100644 --- a/laravel/input.php +++ b/laravel/input.php @@ -72,7 +72,7 @@ public static function flash() { if (Config::$items['session']['driver'] !== '') { - IoC::container()->core('session')->flash(Input::old_input, static::get()); + IoC::core('session')->flash(Input::old_input, static::get()); } } @@ -109,7 +109,7 @@ public static function old($key = null, $default = null) throw new \Exception('A session driver must be specified in order to access old input.'); } - $old = IoC::container()->core('session')->get(Input::old_input, array()); + $old = IoC::core('session')->get(Input::old_input, array()); return Arr::get($old, $key, $default); } @@ -153,4 +153,4 @@ public static function upload($key, $path) return array_key_exists($key, $_FILES) ? File::upload($key, $path, $_FILES) : false; } -} \ No newline at end of file +} diff --git a/laravel/laravel.php b/laravel/laravel.php index 781c66ef..18920564 100644 --- a/laravel/laravel.php +++ b/laravel/laravel.php @@ -103,7 +103,7 @@ $id = Cookie::get(Config::$items['session']['cookie']); - IoC::container()->instance('laravel.session', new Session\Manager($driver, $id)); + IoC::instance('laravel.session', new Session\Manager($driver, $id)); } /** @@ -198,4 +198,4 @@ IoC::core('session')->save($driver); } -$response->send(); \ No newline at end of file +$response->send(); diff --git a/laravel/redirect.php b/laravel/redirect.php index 92f76432..24ead779 100644 --- a/laravel/redirect.php +++ b/laravel/redirect.php @@ -61,7 +61,7 @@ public function with($key, $value) throw new \Exception('A session driver must be set before setting flash data.'); } - IoC::container()->core('session')->flash($key, $value); + IoC::core('session')->flash($key, $value); return $this; } @@ -94,4 +94,4 @@ public static function __callStatic($method, $parameters) throw new \Exception("Method [$method] is not defined on the Redirect class."); } -} \ No newline at end of file +} diff --git a/laravel/request.php b/laravel/request.php index 6dd862db..a9e03040 100644 --- a/laravel/request.php +++ b/laravel/request.php @@ -154,7 +154,7 @@ public static function secure() */ public static function forged() { - return Input::get('csrf_token') !== IoC::container()->core('session')->token(); + return Input::get('csrf_token') !== IoC::core('session')->token(); } /** @@ -179,4 +179,4 @@ public static function route() return static::$route; } -} \ No newline at end of file +} diff --git a/laravel/routing/controller.php b/laravel/routing/controller.php index 065cc626..afbc4d40 100644 --- a/laravel/routing/controller.php +++ b/laravel/routing/controller.php @@ -68,9 +68,9 @@ public static function resolve($controller) // If the controller is registered in the IoC container, we will resolve // it out of the container. Using constructor injection on controllers // via the container allows more flexible and testable applications. - if (IoC::container()->registered('controllers.'.$controller)) + if (IoC::registered('controllers.'.$controller)) { - return IoC::container()->resolve('controllers.'.$controller); + return IoC::resolve('controllers.'.$controller); } $controller = str_replace(' ', '_', ucwords(str_replace('.', ' ', $controller))).'_Controller'; @@ -216,17 +216,17 @@ public function __call($method, $parameters) * $mailer = $this->mailer; * * // Equivalent call using the IoC container instance - * $mailer = IoC::container()->resolve('mailer'); + * $mailer = IoC::resolve('mailer'); * */ public function __get($key) { - if (IoC::container()->registered($key)) + if (IoC::registered($key)) { - return IoC::container()->resolve($key); + return IoC::resolve($key); } throw new \Exception("Attempting to access undefined property [$key] on controller."); } -} \ No newline at end of file +} diff --git a/laravel/security/auth.php b/laravel/security/auth.php index c5c81f7c..ace58f0f 100644 --- a/laravel/security/auth.php +++ b/laravel/security/auth.php @@ -74,7 +74,7 @@ public static function user() { if ( ! is_null(static::$user)) return static::$user; - $id = IoC::container()->core('session')->get(Auth::user_key); + $id = IoC::core('session')->get(Auth::user_key); static::$user = call_user_func(Config::get('auth.user'), $id); @@ -152,7 +152,7 @@ public static function login($user, $remember = false) if ($remember) static::remember($user->id); - IoC::container()->core('session')->put(Auth::user_key, $user->id); + IoC::core('session')->put(Auth::user_key, $user->id); } /** @@ -195,7 +195,7 @@ public static function logout() Cookie::forget(Auth::remember_key); - IoC::container()->core('session')->forget(Auth::user_key); + IoC::core('session')->forget(Auth::user_key); } -} \ No newline at end of file +}