diff --git a/bootstrap/README.md b/bootstrap/README.md new file mode 100644 index 00000000000..7e443f68ee7 --- /dev/null +++ b/bootstrap/README.md @@ -0,0 +1,5 @@ +# Deprecation Notice + +This file (bootstrap/app.php) is deprecated as of v0.35.x as it has been moved to app/bootstrap.php. + +The file is preserved for backwards compatibility. \ No newline at end of file diff --git a/bootstrap/app.php b/bootstrap/app.php new file mode 100644 index 00000000000..d860bd58c2f --- /dev/null +++ b/bootstrap/app.php @@ -0,0 +1,66 @@ +singleton( + Illuminate\Contracts\Console\Kernel::class, + LaravelZero\Framework\Kernel::class +); + +$app->singleton( + Illuminate\Contracts\Debug\ExceptionHandler::class, + Illuminate\Foundation\Exceptions\Handler::class +); + +/* +|-------------------------------------------------------------------------- +| Set Important Hyde Configurations +|-------------------------------------------------------------------------- +| +| Next, we need to configure Hyde to to use our project's base path. +| +*/ + +\Hyde\Framework\Hyde::setBasePath(getcwd()); + +/* +|-------------------------------------------------------------------------- +| 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; diff --git a/packages/realtime-compiler/src/Concerns/InteractsWithLaravel.php b/packages/realtime-compiler/src/Concerns/InteractsWithLaravel.php index e77a44be23a..e047e2a1784 100644 --- a/packages/realtime-compiler/src/Concerns/InteractsWithLaravel.php +++ b/packages/realtime-compiler/src/Concerns/InteractsWithLaravel.php @@ -16,7 +16,25 @@ trait InteractsWithLaravel protected function createApplication(): void { - $this->laravel = require_once sprintf('%s/bootstrap/app.php', BASE_PATH); + // The core bootstrapping file was moved in hyde/framework v0.35.x. + // To preserve backwards compatibility, we will continue to load + // the old bootstrap file for several minor versions. + + $legacyBootstrapper = sprintf('%s/bootstrap/app.php', BASE_PATH); + $bootstrapper = sprintf('%s/app/bootstrap.php', BASE_PATH); + if (file_exists($legacyBootstrapper) && !file_exists($bootstrapper)) { + trigger_error( + sprintf( + 'The "%s" file is deprecated since hyde/framework:v0.35.x Please use "%s" instead.', + $legacyBootstrapper, + $bootstrapper + ), + E_USER_DEPRECATED + ); + $bootstrapper = $legacyBootstrapper; + } + + $this->laravel = require_once $bootstrapper; } protected function bootApplication(): void