From 43adc52bd69dbfd239203f9f448ad5d18fa7928d Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 11 Dec 2023 09:33:42 +0100 Subject: [PATCH] Improve portability of the realtime compiler Improves the portability of the realtime compiler to better support running through the standalone executable. Pulls changes from https://github.com/hydephp/realtime-compiler/pull/20 --- packages/realtime-compiler/bin/server.php | 2 +- .../realtime-compiler/src/Concerns/InteractsWithLaravel.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/realtime-compiler/bin/server.php b/packages/realtime-compiler/bin/server.php index 01f7dd3559e..2c2e3edd2c2 100755 --- a/packages/realtime-compiler/bin/server.php +++ b/packages/realtime-compiler/bin/server.php @@ -4,7 +4,7 @@ define('BASE_PATH', realpath(getcwd())); define('HYDE_START', microtime(true)); - require_once BASE_PATH.'/vendor/autoload.php'; + require getenv('HYDE_AUTOLOAD_PATH') ?: BASE_PATH.'/vendor/autoload.php'; try { $app = \Desilva\Microserve\Microserve::boot(\Hyde\RealtimeCompiler\Http\HttpKernel::class); diff --git a/packages/realtime-compiler/src/Concerns/InteractsWithLaravel.php b/packages/realtime-compiler/src/Concerns/InteractsWithLaravel.php index 16f2e66c32c..af146cb5da8 100644 --- a/packages/realtime-compiler/src/Concerns/InteractsWithLaravel.php +++ b/packages/realtime-compiler/src/Concerns/InteractsWithLaravel.php @@ -18,7 +18,7 @@ trait InteractsWithLaravel protected function createApplication(): void { - $this->laravel = require BASE_PATH.'/app/bootstrap.php'; + $this->laravel = require getenv('HYDE_BOOTSTRAP_PATH') ?: (BASE_PATH.'/app/bootstrap.php'); } protected function bootApplication(): void