File tree Expand file tree Collapse file tree 2 files changed +30
-8
lines changed
Expand file tree Collapse file tree 2 files changed +30
-8
lines changed Original file line number Diff line number Diff line change 11FROM dunglas/frankenphp
22
3- COPY . /app/public
4-
53RUN install-php-extensions \
64 pdo_mysql \
75 gd \
86 intl \
97 zip \
108 opcache
119
10+ COPY . /app
11+
1212ENV FRANKENPHP_CONFIG="worker ./public/index.php"
Original file line number Diff line number Diff line change 11<?php
22
3- declare (strict_types=1 );
4-
53use Tempest \Discovery \DiscoveryLocation ;
64use Tempest \Router \HttpApplication ;
5+ use Tempest \Router \WorkerApplication ;
76
87require_once __DIR__ . '/../vendor/autoload.php ' ;
98
10- HttpApplication::boot (__DIR__ . '/../ ' , discoveryLocations: [
11- new DiscoveryLocation ('Tests \\Tempest \\Fixtures \\' , __DIR__ . '/../tests/Fixtures/ ' ),
12- ])->run ();
9+ if (function_exists ('frankenphp_handle_request ' )) {
10+ ignore_user_abort (true );
11+
12+ $ application = WorkerApplication::boot (__DIR__ . '/../ ' );
13+
14+ $ handler = static function () {
15+ // $application->run();
16+ echo 'hi ' ;
17+ };
18+
19+ $ maxRequests = (int )($ _SERVER ['MAX_REQUESTS ' ] ?? 0 );
20+
21+ for ($ nbRequests = 0 ; ! $ maxRequests || $ nbRequests < $ maxRequests ; ++$ nbRequests ) {
22+ $ keepRunning = frankenphp_handle_request ($ handler );
23+
24+ gc_collect_cycles ();
25+
26+ if (! $ keepRunning ) break ;
27+ }
28+ } else {
29+ HttpApplication::boot (__DIR__ . '/../ ' , discoveryLocations: [
30+ new DiscoveryLocation ('Tests \\Tempest \\Fixtures \\' , __DIR__ . '/../tests/Fixtures/ ' ),
31+ ])->run ();
32+
33+ exit ();
34+
35+ }
1336
14- exit ();
You can’t perform that action at this time.
0 commit comments