Skip to content

Commit da8c29b

Browse files
Merge pull request #9549 from AlliBalliBaba/optimize-frankenphp-file-access
[FrankenPHP] Remove unnecessary file-exists checks.
2 parents 0c959df + 17cb029 commit da8c29b

File tree

5 files changed

+36
-16
lines changed

5 files changed

+36
-16
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
{$CADDY_GLOBAL_OPTIONS}
3+
4+
admin {$CADDY_SERVER_ADMIN_HOST}:{$CADDY_SERVER_ADMIN_PORT}
5+
6+
frankenphp {
7+
worker "{$APP_PUBLIC_PATH}/frankenphp-worker.php" {$CADDY_SERVER_WORKER_COUNT}
8+
}
9+
}
10+
11+
{$CADDY_SERVER_SERVER_NAME} {
12+
route {
13+
# Mercure configuration is injected here...
14+
{$CADDY_SERVER_EXTRA_DIRECTIVES}
15+
16+
# FrankenPHP!
17+
# disable static files for this benchmark
18+
# by using php instead of php_server
19+
rewrite frankenphp-worker.php
20+
php {
21+
root "{$APP_PUBLIC_PATH}"
22+
}
23+
}
24+
}

frameworks/PHP/laravel/laravel-octane-frankenphp.dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
FROM dunglas/frankenphp
22

33
RUN install-php-extensions \
4-
intl \
54
opcache \
65
pcntl \
76
pdo_mysql \
@@ -26,4 +25,4 @@ RUN frankenphp -v
2625

2726
EXPOSE 8080
2827

29-
ENTRYPOINT ["php", "artisan", "octane:frankenphp", "--port=8080"]
28+
ENTRYPOINT ["php", "artisan", "octane:frankenphp", "--port=8080", "--caddyfile=/app/deploy/franken/Caddyfile"]

frameworks/PHP/php/deploy/franken/Caddyfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@
1111
:8080
1212

1313
route {
14-
root * /php
1514

1615
# FrankenPHP!
16+
# disable static files for this benchmark
17+
# by using php instead of php_server
1718
@phpFiles path *.php
18-
php @phpFiles
19+
php @phpFiles {
20+
root /php
21+
}
1922

2023
respond 404
2124
}

frameworks/PHP/symfony/deploy/Caddyfile

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,13 @@
1111
:8080
1212

1313
route {
14-
root * /symfony/public
1514

16-
# If the requested file does not exist, try index files
17-
@indexFiles file {
18-
try_files {path} {path}/runtime.php runtime.php
19-
split_path .php
15+
# FrankenPHP!
16+
# disable static files for this benchmark
17+
# by using php instead of php_server
18+
rewrite runtime.php
19+
php {
20+
root /symfony/public
2021
}
21-
rewrite @indexFiles {http.matchers.file.relative}
22-
23-
# FrankenPHP!
24-
@phpFiles path *.php
25-
php @phpFiles
2622

27-
respond 404
2823
}

frameworks/PHP/symfony/symfony-franken.dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ FROM dunglas/frankenphp
22

33
# add additional extensions here:
44
RUN install-php-extensions \
5-
intl \
65
opcache \
76
pdo_pgsql \
87
zip > /dev/null

0 commit comments

Comments
 (0)