Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bin/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
|
*/

$basePath = $_SERVER['APP_BASE_PATH'] ?? $_ENV['APP_BASE_PATH'] ?? $serverState['octaneConfig']['base_path'] ?? null;
$basePath = $_SERVER['APP_BASE_PATH'] ?? getenv('APP_BASE_PATH') ?? $serverState['octaneConfig']['base_path'] ?? null;

if (! is_string($basePath)) {
echo 'Cannot find application base path.';
Expand All @@ -35,7 +35,7 @@
|
*/

$vendorDir = $_ENV['COMPOSER_VENDOR_DIR'] ?? "{$basePath}/vendor";
$vendorDir = getenv('COMPOSER_VENDOR_DIR') ?? "{$basePath}/vendor";

if (! is_file($autoload_file = "{$vendorDir}/autoload.php")) {
echo "Composer autoload file was not found. Did you install the project's dependencies?";
Expand Down
13 changes: 13 additions & 0 deletions config/octane.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,17 @@

'max_execution_time' => 30,

/*
|--------------------------------------------------------------------------
| Vendor Path
|--------------------------------------------------------------------------
|
| This value determines the path to the "vendor" directory that Octane will
| use when bootstrapping the application. By default, it will use the
| vendor folder inside the base path of the application.
|
*/

'vendor_path' => env('OCTANE_VENDOR_PATH', base_path('vendor')),

];
1 change: 1 addition & 0 deletions src/Commands/StartFrankenPhpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public function handle(ServerProcessInspector $inspector, ServerStateFile $serve
'CADDY_SERVER_WORKER_DIRECTIVE' => $this->workerCount() ? "num {$this->workerCount()}" : '',
'CADDY_SERVER_EXTRA_DIRECTIVES' => $this->buildMercureConfig(),
'CADDY_SERVER_WATCH_DIRECTIVES' => $this->buildWatchConfig(),
'COMPOSER_VENDOR_DIR' => config('octane.vendor_path'),
]));

$server = $process->start();
Expand Down
1 change: 1 addition & 0 deletions src/Commands/StartRoadRunnerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public function handle(ServerProcessInspector $inspector, ServerStateFile $serve
'APP_ENV' => app()->environment(),
'APP_BASE_PATH' => base_path(),
'LARAVEL_OCTANE' => 1,
'COMPOSER_VENDOR_DIR' => config('octane.vendor_path'),
]))->start();

$serverStateFile->writeProcessId($server->getPid());
Expand Down
1 change: 1 addition & 0 deletions src/Commands/StartSwooleCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public function handle(
'APP_ENV' => app()->environment(),
'APP_BASE_PATH' => base_path(),
'LARAVEL_OCTANE' => 1,
'COMPOSER_VENDOR_DIR' => config('octane.vendor_path'),
]))->start();

return $this->runServer($server, $inspector, 'swoole');
Expand Down
Loading