/** * Refresh the bound request instance in the container. * * @param \Nova\Http\Request $request * @return void */ protected function refreshRequest(Request $request) { $this->instance('request', $request); Facade::clearResolvedInstance('request'); }
$app = new Application(); $app->instance('app', $app); //-------------------------------------------------------------------------- // Detect The Application Environment //-------------------------------------------------------------------------- $env = $app->detectEnvironment(array('local' => array('darkstar'))); //-------------------------------------------------------------------------- // Bind Paths //-------------------------------------------------------------------------- $paths = array('base' => ROOTDIR, 'app' => APPDIR, 'public' => PUBLICDIR, 'storage' => STORAGE_PATH); $app->bindInstallPaths($paths); //-------------------------------------------------------------------------- // Load The Framework Facades //-------------------------------------------------------------------------- Facade::clearResolvedInstances(); Facade::setFacadeApplication($app); //-------------------------------------------------------------------------- // Register Facade Aliases To Full Classes //-------------------------------------------------------------------------- $app->registerCoreContainerAliases(); //-------------------------------------------------------------------------- // Register Application Exception Handling //-------------------------------------------------------------------------- $app->startExceptionHandling(); if ($env != 'testing') { ini_set('display_errors', 'Off'); } //-------------------------------------------------------------------------- // Load The Configuration //-------------------------------------------------------------------------- foreach (glob(app_path() . DS . 'Config/*.php') as $path) {
require $path; } //-------------------------------------------------------------------------- // Try To Register Again The Config Manager //-------------------------------------------------------------------------- if (CONFIG_STORE == 'database') { // Get the Database Connection instance. $connection = $app['db']->connection(); // Get a fresh Config Loader instance. $loader = $app->getConfigLoader(); // Setup Database Connection instance. $loader->setConnection($connection); // Refresh the Application's Config instance. $app->instance('config', $config = new ConfigRepository($loader)); // Make the Facade to refresh its information. Facade::clearResolvedInstance('config'); } else { if (CONFIG_STORE != 'files') { throw new \InvalidArgumentException('Invalid Config Store type.'); } } //-------------------------------------------------------------------------- // Load The Application Events //-------------------------------------------------------------------------- $path = app_path() . DS . 'Events.php'; if (is_readable($path)) { require $path; } //-------------------------------------------------------------------------- // Load The Application's Route Filters //--------------------------------------------------------------------------
/** * Get the root Facade application instance. * * @param string $make * @return mixed */ function app($make = null) { if (!is_null($make)) { return app()->make($make); } return Facade::getFacadeApplication(); }