Permalink
Browse files

Register core class aliases.

  • Loading branch information...
taylorotwell committed Jan 13, 2014
1 parent 5cf4035 commit 7e3a99ebbab959324eebd88bdc38667f3fd35461
Showing with 58 additions and 0 deletions.
  1. +45 −0 src/Illuminate/Foundation/Application.php
  2. +13 −0 src/Illuminate/Foundation/start.php
@@ -972,6 +972,51 @@ public static function onRequest($method, $parameters = array())
return forward_static_call_array(array(static::requestClass(), $method), $parameters);
}
/**
* Register the core class aliases in the container.
*
* @return void
*/
public function registerCoreContainerAliases()
{
$aliases = array(
'app' => 'Illuminate\Foundation\Application',
'artisan' => 'Illuminate\Console\Application',
'auth' => 'Illuminate\Auth\AuthManager',
'blade.compiler' => 'Illuminate\View\Compilers\BladeCompiler',
'cache' => 'Illuminate\Cache\Repository',
'config' => 'Illuminate\Config\Repository',
'cookie' => 'Illuminate\Cookie\CookieJar',
'encrypter' => 'Illuminate\Encryption\Encrypter',
'db' => 'Illuminate\Database\DatabaseManager',
'events' => 'Illuminate\Events\Dispatacher',
'files' => 'Illuminate\Filesystem\Filesystem',
'form' => 'Illuminate\Html\FormBuilder',
'hash' => 'Illuminate\Hashing\HasherInterface',
'html' => 'Illuminate\Html\HtmlBuilder',
'translator' => 'Illuminate\Translation\Translator',
'log' => 'Illuminate\Log\Writer',
'mailer' => 'Illuminate\Mail\Mailer',
'paginator' => 'Illuminate\Pagination\Environment',
'auth.reminder' => 'Illuminate\Auth\Reminders\PasswordBroker',
'queue' => 'Illuminate\Queue\QueueManager',
'redirect' => 'Illuminate\Routing\Redirector',
'redis' => 'Illuminate\Redis\Database',
'request' => 'Illuminate\Http\Requset',
'router' => 'Illuminate\Routing\Router',
'session' => 'Illuminate\Session\SessionManager',
'remote' => 'Illuminate\Remote\RemoteManager',
'url' => 'Illuminate\Routing\UrlGenerator',
'validator' => 'Illuminate\Validation\Factory',
'view' => 'Illuminate\View\Environment',
);
foreach ($aliases as $key => $alias)
{
$this->alias($key, $alias);
}
}
/**
* Dynamically access application services.
*
@@ -91,6 +91,19 @@
Facade::setFacadeApplication($app);
/*
|--------------------------------------------------------------------------
| Register Facade Aliases To Full Classes
|--------------------------------------------------------------------------
|
| By default, we use short keys in the container for each of the core
| pieces of the framework. Here we will register the aliases for a
| list of all of the fully qualified class names making DI easy.
|
*/
$app->registerCoreContainerAliases();
/*
|--------------------------------------------------------------------------
| Register The Configuration Repository

0 comments on commit 7e3a99e

Please sign in to comment.