From 60d6825c0d118822be3e0c807b9e7360d1d08ee7 Mon Sep 17 00:00:00 2001 From: Ben Thomson Date: Mon, 20 Jan 2020 15:11:38 +0800 Subject: [PATCH] Partially revert and restore bootstrap/autoload.php As discussed with @daftspunk, we now have to hard-code some overrides to ensure our helpers are loaded first. To keep the code DRY and self-explanatory, we do need to keep the autoload.php file. --- artisan | 28 +++++++++------------------- bootstrap/autoload.php | 35 +++++++++++++++++++++++++++++++++++ index.php | 30 ++++-------------------------- tests/functional/phpunit.xml | 2 +- 4 files changed, 49 insertions(+), 46 deletions(-) create mode 100644 bootstrap/autoload.php diff --git a/artisan b/artisan index 1d451b277..df3993e90 100644 --- a/artisan +++ b/artisan @@ -5,38 +5,28 @@ define('LARAVEL_START', microtime(true)); /* |-------------------------------------------------------------------------- -| Register Core Helpers +| Bootstrap dependencies |-------------------------------------------------------------------------- | -| We cannot rely on Composer's load order when calculating the weight of -| each package. This line ensures that the core global helpers are -| always given priority one status. +| We use a custom bootstrap autoloader to load some October dependencies +| first, before bringing in all dependencies from Composer. | */ -$helperPath = __DIR__.'/vendor/october/rain/src/Support/helpers.php'; - -if (!file_exists($helperPath)) { - echo 'Missing vendor files, try running "composer install" or use the Wizard installer.'.PHP_EOL; - exit(1); -} - -require $helperPath; +require __DIR__.'/bootstrap/autoload.php'; /* |-------------------------------------------------------------------------- -| Register The Auto Loader +| Turn On The Lights |-------------------------------------------------------------------------- | -| Composer provides a convenient, automatically generated class loader -| for our application. We just need to utilize it! We'll require it -| into the script here so that we do not have to worry about the -| loading of any our classes "manually". Feels great to relax. +| We need to illuminate PHP development, so let us turn on the lights. +| This bootstraps the framework and gets it ready for use, then it +| will load up this application so that we can run it and send +| the responses back to the browser and delight our users. | */ -require __DIR__.'/vendor/autoload.php'; - $app = require_once __DIR__.'/bootstrap/app.php'; /* diff --git a/bootstrap/autoload.php b/bootstrap/autoload.php new file mode 100644 index 000000000..9a131647a --- /dev/null +++ b/bootstrap/autoload.php @@ -0,0 +1,35 @@ +