File tree Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Original file line number Diff line number Diff line change 1818$ basePath = $ _SERVER ['APP_BASE_PATH ' ] ?? $ _ENV ['APP_BASE_PATH ' ] ?? $ serverState ['octaneConfig ' ]['base_path ' ] ?? null ;
1919
2020if (! is_string ($ basePath )) {
21- exit ( 'Cannot find application base path. ' ) ;
21+ echo 'Cannot find application base path. ' ;
2222
2323 exit (11 );
2424}
3838$ vendorDir = $ _ENV ['COMPOSER_VENDOR_DIR ' ] ?? "{$ basePath }/vendor " ;
3939
4040if (! is_file ($ autoload_file = "{$ vendorDir }/autoload.php " )) {
41- exit ( "Composer autoload file was not found. Did you install the project's dependencies? " ) ;
41+ echo "Composer autoload file was not found. Did you install the project's dependencies? " ;
4242
4343 exit (10 );
4444}
Original file line number Diff line number Diff line change 3030
3131$ frankenPhpClient = new FrankenPhpClient ();
3232
33- $ worker = null ;
33+ $ worker = tap (new Worker (
34+ new ApplicationFactory ($ basePath ), $ frankenPhpClient
35+ ))->boot ();
36+
3437$ requestCount = 0 ;
38+ $ debugMode = $ _ENV ['APP_DEBUG ' ] ?? $ _SERVER ['APP_DEBUG ' ] ?? 'false ' ;
3539$ maxRequests = $ _ENV ['MAX_REQUESTS ' ] ?? $ _SERVER ['MAX_REQUESTS ' ] ?? 1000 ;
3640$ requestMaxExecutionTime = $ _ENV ['REQUEST_MAX_EXECUTION_TIME ' ] ?? $ _SERVER ['REQUEST_MAX_EXECUTION_TIME ' ] ?? null ;
3741
4044}
4145
4246try {
43- $ handleRequest = static function () use (& $ worker , $ basePath , $ frankenPhpClient ) {
47+ $ handleRequest = static function () use ($ worker , $ frankenPhpClient , $ debugMode ) {
4448 try {
45- $ worker ??= tap (
46- new Worker (
47- new ApplicationFactory ($ basePath ), $ frankenPhpClient
48- )
49- )->boot ();
50-
5149 [$ request , $ context ] = $ frankenPhpClient ->marshalRequest (new RequestContext ());
5250
5351 $ worker ->handle ($ request , $ context );
5654 report ($ e );
5755 }
5856
59- $ debugMode = $ _ENV ['APP_DEBUG ' ] ?? $ _SERVER ['APP_DEBUG ' ] ?? 'false ' ;
60-
6157 $ response = new Response (
6258 $ debugMode === 'true ' ? (string ) $ e : 'Internal Server Error ' ,
6359 500 ,
You can’t perform that action at this time.
0 commit comments