Skip to content

Commit b8b11ef

Browse files
AlliBalliBabaa.stechertaylorotwell
authored
FrankenPHP: Allow running Octane without artisan command (#968)
* FrankenPHP: Set defaults for APP_BASE_PATH, APP_PUBLIC_PATH and MAX_REQUESTS. * Checks env before server. * style.ci * Update frankenphp-worker.php --------- Co-authored-by: a.stecher <[email protected]> Co-authored-by: Taylor Otwell <[email protected]>
1 parent 4dc701b commit b8b11ef

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

bin/frankenphp-worker.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
$worker = null;
3434
$requestCount = 0;
35-
$maxRequests = $_ENV['MAX_REQUESTS'] ?? $_SERVER['MAX_REQUESTS'];
35+
$maxRequests = $_ENV['MAX_REQUESTS'] ?? $_SERVER['MAX_REQUESTS'] ?? 1000;
3636
$requestMaxExecutionTime = $_ENV['REQUEST_MAX_EXECUTION_TIME'] ?? $_SERVER['REQUEST_MAX_EXECUTION_TIME'] ?? null;
3737

3838
if (PHP_OS_FAMILY === 'Linux' && ! is_null($requestMaxExecutionTime)) {
+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
<?php
22

3+
// Set a default for the application base path and public path if they are missing...
4+
$_SERVER['APP_BASE_PATH'] = $_ENV['APP_BASE_PATH'] ?? $_SERVER['APP_BASE_PATH'] ?? __DIR__.'/..';
5+
$_SERVER['APP_PUBLIC_PATH'] = $_ENV['APP_PUBLIC_PATH'] ?? $_SERVER['APP_BASE_PATH'] ?? __DIR__;
6+
37
require __DIR__.'/../vendor/laravel/octane/bin/frankenphp-worker.php';

0 commit comments

Comments
 (0)