-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add FFI Fiber support preload example (#524)
- Loading branch information
Showing
9 changed files
with
90 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
version: '3.8' | ||
services: | ||
web: | ||
image: nginx:alpine | ||
ports: | ||
- '8080:80' | ||
depends_on: | ||
- php | ||
volumes: | ||
- ./docker/examples/nginx.conf:/etc/nginx/conf.d/default.conf:ro | ||
php: | ||
build: | ||
context: . | ||
dockerfile: docker/examples/Dockerfile | ||
args: | ||
- PHP_VERSION=8.1-fpm | ||
- EXT_ENABLE=ffi | ||
environment: | ||
- OTEL_PHP_FIBERS_ENABLED=true | ||
command: | ||
- php-fpm | ||
- -d | ||
- opcache.preload=/php/vendor/autoload.php | ||
volumes: | ||
- ./tests/Context/Fiber/test_context_switching_ffi_observer.phpt:/var/www/public/index.php | ||
- ./:/php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
ARG PHP_VERSION | ||
ARG PHP_ALPINE_VERSION | ||
|
||
FROM php:${PHP_VERSION:+${PHP_VERSION}-}alpine${PHP_ALPINE_VERSION} AS php | ||
|
||
ENV PROJECT_ROOT=/php | ||
|
||
RUN set -eux; \ | ||
apk add --no-cache \ | ||
bash \ | ||
; \ | ||
adduser -u 1000 -DSh /php php php | ||
|
||
ARG EXT_INSTALL | ||
ARG EXT_ENABLE='' | ||
RUN --mount=from=mlocati/php-extension-installer,dst=/build/extension-installer,src=/usr/bin/install-php-extensions \ | ||
set -eux; \ | ||
/build/extension-installer \ | ||
opcache \ | ||
${EXT_INSTALL:-${EXT_ENABLE}} \ | ||
; \ | ||
docker-php-ext-enable \ | ||
opcache \ | ||
${EXT_ENABLE} \ | ||
; | ||
|
||
RUN set eux; \ | ||
mkdir -p /usr/local/lib/php/vendor; \ | ||
echo "<?php file_exists('/php/vendor/autoload.php') and require '/php/vendor/autoload.php';" > /usr/local/lib/php/vendor/autoload.php; \ | ||
echo 'auto_prepend_file=vendor/autoload.php' > "$PHP_INI_DIR/conf.d/99-autoload.ini" | ||
|
||
USER php | ||
WORKDIR /php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
server { | ||
listen 80; | ||
server_name _; | ||
root /var/www/public; | ||
|
||
location / { | ||
fastcgi_pass php:9000; | ||
fastcgi_index index.php; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
include fastcgi_params; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters