Large refactor of HTTP and Console stack.
This commit is contained in:
50
bootstrap/app.php
Normal file
50
bootstrap/app.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Create The Application
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The first thing we will do is create a new Laravel application instance
|
||||
| which serves as the "glue" for all the components of Laravel, and is
|
||||
| the IoC container for the system binding all of the various parts.
|
||||
|
|
||||
*/
|
||||
|
||||
$app = new Illuminate\Foundation\Application(
|
||||
realpath(__DIR__.'/..')
|
||||
);
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Create The Application
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The first thing we will do is create a new Laravel application instance
|
||||
| which serves as the "glue" for all the components of Laravel, and is
|
||||
| the IoC container for the system binding all of the various parts.
|
||||
|
|
||||
*/
|
||||
|
||||
$app->bind(
|
||||
'Illuminate\Contracts\Http\Kernel',
|
||||
'App\Http\Kernel'
|
||||
);
|
||||
|
||||
$app->bind(
|
||||
'Illuminate\Contracts\Console\Kernel',
|
||||
'App\Console\Kernel'
|
||||
);
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Return The Application
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This script returns the application instance. The instance is given to
|
||||
| the calling script so we can separate the building of the instances
|
||||
| from the actual running of the application and sending responses.
|
||||
|
|
||||
*/
|
||||
|
||||
return $app;
|
||||
@@ -33,19 +33,3 @@ if (file_exists($compiledPath))
|
||||
{
|
||||
require $compiledPath;
|
||||
}
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Register The Workbench Loaders
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The Laravel workbench provides a convenient place to develop packages
|
||||
| when working locally. However we will need to load in the Composer
|
||||
| auto-load files for the packages so that these can be used here.
|
||||
|
|
||||
*/
|
||||
|
||||
if (is_dir($workbench = __DIR__.'/../workbench'))
|
||||
{
|
||||
Illuminate\Workbench\Starter::start($workbench);
|
||||
}
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Load Environment Variables
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Next we will load the environment variables for the application which
|
||||
| are stored in the ".env" file. These variables will be loaded into
|
||||
| the $_ENV and "putenv" facilities of PHP so they stay available.
|
||||
|
|
||||
*/
|
||||
|
||||
if (file_exists(__DIR__.'/../.env'))
|
||||
{
|
||||
Dotenv::load(__DIR__.'/../');
|
||||
|
||||
//Dotenv::required('APP_ENV');
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Detect The Application Environment
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Laravel takes a dead simple approach to your application environments
|
||||
| so you may simply return the environment from the Closure. We will
|
||||
| assume we are using the "APP_ENV" variable for this environment.
|
||||
|
|
||||
*/
|
||||
|
||||
$env = $app->detectEnvironment(function()
|
||||
{
|
||||
return getenv('APP_ENV') ?: 'production';
|
||||
});
|
||||
@@ -1,96 +0,0 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here we just defined the path to the application directory. Most likely
|
||||
| you will never need to change this value as the default setup should
|
||||
| work perfectly fine for the vast majority of all our applications.
|
||||
|
|
||||
*/
|
||||
|
||||
'app' => __DIR__.'/../app',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Base Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The base path is the root of the Laravel installation. Most likely you
|
||||
| will not need to change this value. But, if for some wild reason it
|
||||
| is necessary you will do so here, just proceed with some caution.
|
||||
|
|
||||
*/
|
||||
|
||||
'base' => __DIR__.'/..',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Configuration Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This path is used by the configuration loader to load the application
|
||||
| configuration files. In general, you should'nt need to change this
|
||||
| value; however, you can theoretically change the path from here.
|
||||
|
|
||||
*/
|
||||
|
||||
'config' => __DIR__.'/../config',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Database Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This path is used by the migration generator and migration runner to
|
||||
| know where to place your fresh database migration classes. You're
|
||||
| free to modify the path but you probably will not ever need to.
|
||||
|
|
||||
*/
|
||||
|
||||
'database' => __DIR__.'/../database',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Language Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This path is used by the language file loader to load your application
|
||||
| language files. The purpose of these files is to store your strings
|
||||
| that are translated into other languages for views, e-mails, etc.
|
||||
|
|
||||
*/
|
||||
|
||||
'lang' => __DIR__.'/../resources/lang',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Public Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The public path contains the assets for your web application, such as
|
||||
| your JavaScript and CSS files, and also contains the primary entry
|
||||
| point for web requests into these applications from the outside.
|
||||
|
|
||||
*/
|
||||
|
||||
'public' => __DIR__.'/../public',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Storage Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The storage path is used by Laravel to store cached Blade views, logs
|
||||
| and other pieces of information. You may modify the path here when
|
||||
| you want to change the location of this directory for your apps.
|
||||
|
|
||||
*/
|
||||
|
||||
'storage' => __DIR__.'/../storage',
|
||||
|
||||
];
|
||||
@@ -1,69 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Create The Application
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The first thing we will do is create a new Laravel application instance
|
||||
| which serves as the "glue" for all the components of Laravel, and is
|
||||
| the IoC container for the system binding all of the various parts.
|
||||
|
|
||||
*/
|
||||
|
||||
$app = new Illuminate\Foundation\Application;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Detect The Application Environment
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Laravel takes a dead simple approach to your application environments
|
||||
| so you can just specify a machine name for the host that matches a
|
||||
| given environment, then we will automatically detect it for you.
|
||||
|
|
||||
*/
|
||||
|
||||
require __DIR__.'/environment.php';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Bind Paths
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here we are binding the paths configured in paths.php to the app. You
|
||||
| should not be changing these here. If you need to change these you
|
||||
| may do so within the paths.php file and they will be bound here.
|
||||
|
|
||||
*/
|
||||
|
||||
$app->bindInstallPaths(require __DIR__.'/paths.php');
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Load The Application
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here we will load this Illuminate application. We will keep this in a
|
||||
| separate location so we can isolate the creation of an application
|
||||
| from the actual running of the application with a given request.
|
||||
|
|
||||
*/
|
||||
|
||||
$framework = $app['path.base'].
|
||||
'/vendor/laravel/framework/src';
|
||||
|
||||
require $framework.'/Illuminate/Foundation/start.php';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Return The Application
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This script returns the application instance. The instance is given to
|
||||
| the calling script so we can separate the building of the instances
|
||||
| from the actual running of the application and sending responses.
|
||||
|
|
||||
*/
|
||||
|
||||
return $app;
|
||||
Reference in New Issue
Block a user