/** * Get or create the singleton alias loader instance. * * @param array $aliases * @return \Nova\Foundation\AliasLoader */ public static function getInstance(array $aliases = array()) { if (is_null(static::$instance)) { return static::$instance = new static($aliases); } $aliases = array_merge(static::$instance->getAliases(), $aliases); static::$instance->setAliases($aliases); return static::$instance; }
} } //-------------------------------------------------------------------------- // Register The Config Manager //-------------------------------------------------------------------------- $app->instance('config', $config = new ConfigRepository($app->getConfigLoader())); //-------------------------------------------------------------------------- // Set The Default Timezone From Configuration //-------------------------------------------------------------------------- $config = $app['config']['app']; date_default_timezone_set($config['timezone']); //-------------------------------------------------------------------------- // Register The Alias Loader //-------------------------------------------------------------------------- $aliases = $config['aliases']; AliasLoader::getInstance($aliases)->register(); //-------------------------------------------------------------------------- // Enable HTTP Method Override //-------------------------------------------------------------------------- Request::enableHttpMethodParameterOverride(); //-------------------------------------------------------------------------- // Enable Trusting Of X-Sendfile Type Header //-------------------------------------------------------------------------- BinaryFileResponse::trustXSendfileTypeHeader(); //-------------------------------------------------------------------------- // Register The Core Service Providers //-------------------------------------------------------------------------- $providers = $config['providers']; $app->getProviderRepository()->load($app, $providers); //-------------------------------------------------------------------------- // Additional Middleware On Application