From 69bd08561c1d9ee8c1858e49a9fa49df7cae0018 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 7 Apr 2024 07:43:15 +0000 Subject: [PATCH 01/14] update dockerfiles --- Dockerfile => Dockerfile-php-8.0 | 0 Dockerfile-php-8.1 | 53 ++++++++++++++++++++++++++++++++ Dockerfile-php-8.2 | 53 ++++++++++++++++++++++++++++++++ Dockerfile-php-8.3 | 53 ++++++++++++++++++++++++++++++++ 4 files changed, 159 insertions(+) rename Dockerfile => Dockerfile-php-8.0 (100%) create mode 100644 Dockerfile-php-8.1 create mode 100644 Dockerfile-php-8.2 create mode 100644 Dockerfile-php-8.3 diff --git a/Dockerfile b/Dockerfile-php-8.0 similarity index 100% rename from Dockerfile rename to Dockerfile-php-8.0 diff --git a/Dockerfile-php-8.1 b/Dockerfile-php-8.1 new file mode 100644 index 0000000..8005d29 --- /dev/null +++ b/Dockerfile-php-8.1 @@ -0,0 +1,53 @@ +FROM composer:2.0 AS step0 + + +ARG TESTING=true + +ENV TESTING=$TESTING + +WORKDIR /usr/local/src/ + +COPY composer.* /usr/local/src/ + +RUN composer update --ignore-platform-reqs --optimize-autoloader \ + --no-plugins --no-scripts --prefer-dist \ + `if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi` + +FROM php:8.1-cli-alpine as final +LABEL maintainer="team@appwrite.io" + +ENV DEBIAN_FRONTEND=noninteractive \ + PHP_VERSION=8 + +RUN \ + apk add --no-cache --virtual .deps \ + supervisor php$PHP_VERSION php$PHP_VERSION-fpm nginx bash + + +# Nginx Configuration (with self-signed ssl certificates) +COPY ./tests/docker/nginx.conf /etc/nginx/nginx.conf + +# PHP Configuration +RUN mkdir -p /var/run/php +COPY ./tests/docker/www.conf /etc/php/$PHP_VERSION/fpm/pool.d/www.conf + +# Script +COPY ./tests/docker/start /usr/local/bin/start + +# Add PHP Source Code +COPY ./src /usr/share/nginx/html/src +COPY ./tests /usr/share/nginx/html/tests +COPY ./phpunit.xml /usr/share/nginx/html/phpunit.xml +COPY --from=step0 /usr/local/src/vendor /usr/share/nginx/html/vendor + +# Supervisord Conf +COPY ./tests/docker/supervisord.conf /etc/supervisord.conf + +# Executables +RUN chmod +x /usr/local/bin/start + +EXPOSE 80 + +WORKDIR /usr/share/nginx/html + +CMD ["/bin/bash", "/usr/local/bin/start"] \ No newline at end of file diff --git a/Dockerfile-php-8.2 b/Dockerfile-php-8.2 new file mode 100644 index 0000000..2c73a4c --- /dev/null +++ b/Dockerfile-php-8.2 @@ -0,0 +1,53 @@ +FROM composer:2.0 AS step0 + + +ARG TESTING=true + +ENV TESTING=$TESTING + +WORKDIR /usr/local/src/ + +COPY composer.* /usr/local/src/ + +RUN composer update --ignore-platform-reqs --optimize-autoloader \ + --no-plugins --no-scripts --prefer-dist \ + `if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi` + +FROM php:8.2-cli-alpine as final +LABEL maintainer="team@appwrite.io" + +ENV DEBIAN_FRONTEND=noninteractive \ + PHP_VERSION=8 + +RUN \ + apk add --no-cache --virtual .deps \ + supervisor php$PHP_VERSION php$PHP_VERSION-fpm nginx bash + + +# Nginx Configuration (with self-signed ssl certificates) +COPY ./tests/docker/nginx.conf /etc/nginx/nginx.conf + +# PHP Configuration +RUN mkdir -p /var/run/php +COPY ./tests/docker/www.conf /etc/php/$PHP_VERSION/fpm/pool.d/www.conf + +# Script +COPY ./tests/docker/start /usr/local/bin/start + +# Add PHP Source Code +COPY ./src /usr/share/nginx/html/src +COPY ./tests /usr/share/nginx/html/tests +COPY ./phpunit.xml /usr/share/nginx/html/phpunit.xml +COPY --from=step0 /usr/local/src/vendor /usr/share/nginx/html/vendor + +# Supervisord Conf +COPY ./tests/docker/supervisord.conf /etc/supervisord.conf + +# Executables +RUN chmod +x /usr/local/bin/start + +EXPOSE 80 + +WORKDIR /usr/share/nginx/html + +CMD ["/bin/bash", "/usr/local/bin/start"] \ No newline at end of file diff --git a/Dockerfile-php-8.3 b/Dockerfile-php-8.3 new file mode 100644 index 0000000..da9cfc8 --- /dev/null +++ b/Dockerfile-php-8.3 @@ -0,0 +1,53 @@ +FROM composer:2.0 AS step0 + + +ARG TESTING=true + +ENV TESTING=$TESTING + +WORKDIR /usr/local/src/ + +COPY composer.* /usr/local/src/ + +RUN composer update --ignore-platform-reqs --optimize-autoloader \ + --no-plugins --no-scripts --prefer-dist \ + `if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi` + +FROM php:8.3-cli-alpine as final +LABEL maintainer="team@appwrite.io" + +ENV DEBIAN_FRONTEND=noninteractive \ + PHP_VERSION=8 + +RUN \ + apk add --no-cache --virtual .deps \ + supervisor php$PHP_VERSION php$PHP_VERSION-fpm nginx bash + + +# Nginx Configuration (with self-signed ssl certificates) +COPY ./tests/docker/nginx.conf /etc/nginx/nginx.conf + +# PHP Configuration +RUN mkdir -p /var/run/php +COPY ./tests/docker/www.conf /etc/php/$PHP_VERSION/fpm/pool.d/www.conf + +# Script +COPY ./tests/docker/start /usr/local/bin/start + +# Add PHP Source Code +COPY ./src /usr/share/nginx/html/src +COPY ./tests /usr/share/nginx/html/tests +COPY ./phpunit.xml /usr/share/nginx/html/phpunit.xml +COPY --from=step0 /usr/local/src/vendor /usr/share/nginx/html/vendor + +# Supervisord Conf +COPY ./tests/docker/supervisord.conf /etc/supervisord.conf + +# Executables +RUN chmod +x /usr/local/bin/start + +EXPOSE 80 + +WORKDIR /usr/share/nginx/html + +CMD ["/bin/bash", "/usr/local/bin/start"] \ No newline at end of file From 2381cfed01e669d9beedba3115f724a48c3f7a20 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 7 Apr 2024 07:55:26 +0000 Subject: [PATCH 02/14] fix dockerfiles --- Dockerfile-php-8.1 | 4 ++-- Dockerfile-php-8.2 | 4 ++-- Dockerfile-php-8.3 | 4 ++-- docker-compose.yml | 4 +++- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Dockerfile-php-8.1 b/Dockerfile-php-8.1 index 8005d29..6a6a954 100644 --- a/Dockerfile-php-8.1 +++ b/Dockerfile-php-8.1 @@ -17,11 +17,11 @@ FROM php:8.1-cli-alpine as final LABEL maintainer="team@appwrite.io" ENV DEBIAN_FRONTEND=noninteractive \ - PHP_VERSION=8 + PHP_VERSION=8.1 RUN \ apk add --no-cache --virtual .deps \ - supervisor php$PHP_VERSION php$PHP_VERSION-fpm nginx bash + supervisor php php-fpm nginx bash # Nginx Configuration (with self-signed ssl certificates) diff --git a/Dockerfile-php-8.2 b/Dockerfile-php-8.2 index 2c73a4c..65cd840 100644 --- a/Dockerfile-php-8.2 +++ b/Dockerfile-php-8.2 @@ -17,11 +17,11 @@ FROM php:8.2-cli-alpine as final LABEL maintainer="team@appwrite.io" ENV DEBIAN_FRONTEND=noninteractive \ - PHP_VERSION=8 + PHP_VERSION=8.2 RUN \ apk add --no-cache --virtual .deps \ - supervisor php$PHP_VERSION php$PHP_VERSION-fpm nginx bash + supervisor php php-fpm nginx bash # Nginx Configuration (with self-signed ssl certificates) diff --git a/Dockerfile-php-8.3 b/Dockerfile-php-8.3 index da9cfc8..29ac58a 100644 --- a/Dockerfile-php-8.3 +++ b/Dockerfile-php-8.3 @@ -17,11 +17,11 @@ FROM php:8.3-cli-alpine as final LABEL maintainer="team@appwrite.io" ENV DEBIAN_FRONTEND=noninteractive \ - PHP_VERSION=8 + PHP_VERSION=8.3 RUN \ apk add --no-cache --virtual .deps \ - supervisor php$PHP_VERSION php$PHP_VERSION-fpm nginx bash + supervisor php php-fpm nginx bash # Nginx Configuration (with self-signed ssl certificates) diff --git a/docker-compose.yml b/docker-compose.yml index f7624f2..6ca27e8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,9 @@ version: '3' services: web: - build: . + build: + context: . + dockerfile: Dockerfile-php-${PHP_VERSION:-8.3} ports: - "9020:80" volumes: From ef23672e0c580062952606d2e002bfdea5354cff Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 7 Apr 2024 07:56:21 +0000 Subject: [PATCH 03/14] github tests --- .github/workflows/tests.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..e444c34 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,28 @@ +name: "Tests" + +on: [ pull_request ] +jobs: + lint: + name: Tests + runs-on: ubuntu-latest + strategy: + matrix: + php-versions: ['8.0', '8.1', '8.2', '8.3'] # add PHP versions as required + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - run: git checkout HEAD^2 + + - name: Build + run: | + export PHP_VERSION=${{ matrix.php-versions }} + docker compose build + docker compose up -d + sleep 10 + + - name: Run Tests + run: docker compose exec web vendor/bin/phpunit --configuration phpunit.xml @$1 \ No newline at end of file From c053c949bc09abfa3f9233411416e1fee42839ea Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 7 Apr 2024 07:56:36 +0000 Subject: [PATCH 04/14] remove travis --- .travis.yml | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5091e1d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,35 +0,0 @@ -dist: focal - -arch: - - amd64 - -os: linux - -language: shell - -notifications: - email: - - team@appwrite.io - -services: - - docker - -before_install: - - curl -fsSL https://get.docker.com | sh - - echo '{"experimental":"enabled"}' | sudo tee /etc/docker/daemon.json - - mkdir -p $HOME/.docker - - echo '{"experimental":"enabled"}' | sudo tee $HOME/.docker/config.json - - sudo service docker start - - > - if [ ! -z "${DOCKERHUB_PULL_USERNAME:-}" ]; then - echo "${DOCKERHUB_PULL_PASSWORD}" | docker login --username "${DOCKERHUB_PULL_USERNAME}" --password-stdin - fi - - docker --version - -install: - - docker-compose up -d - - sleep 10 - -script: - - docker ps -a - - docker-compose exec web vendor/bin/phpunit --configuration phpunit.xml \ No newline at end of file From aff3d589dde5c28466cf3953afabff6175f481e8 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 7 Apr 2024 07:59:34 +0000 Subject: [PATCH 05/14] fix typo --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e444c34..25fd49f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,4 +25,4 @@ jobs: sleep 10 - name: Run Tests - run: docker compose exec web vendor/bin/phpunit --configuration phpunit.xml @$1 \ No newline at end of file + run: docker compose exec web vendor/bin/phpunit --configuration phpunit.xml \ No newline at end of file From 0e86aca54c06b7d88d45356209f8ddb7c03dadbd Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 7 Apr 2024 08:03:13 +0000 Subject: [PATCH 06/14] fix framework version --- composer.json | 2 +- composer.lock | 158 ++++++++++++++++++++++++++------------------------ 2 files changed, 84 insertions(+), 76 deletions(-) diff --git a/composer.json b/composer.json index 1f58155..b76fc1e 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "php": ">=8.0", "ext-json": "*", "ext-redis": "*", - "utopia-php/framework": "0.*.*", + "utopia-php/framework": "0.33.*", "utopia-php/cli": "0.15.*" }, "require-dev": { diff --git a/composer.lock b/composer.lock index fd464bc..5a0d6d7 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9ed9e6f27d4fd28b74422df54ad756ce", + "content-hash": "993d63edb84b1ee7cd3926bfd157918d", "packages": [ { "name": "utopia-php/cli", @@ -57,16 +57,16 @@ }, { "name": "utopia-php/framework", - "version": "0.32.0", + "version": "0.33.6", "source": { "type": "git", - "url": "https://github.com/utopia-php/framework.git", - "reference": "ad6f7e6d6b38cf5bed4e3af9a1394c59d4bb9225" + "url": "https://github.com/utopia-php/http.git", + "reference": "8fe57da0cecd57e3b17cd395b4a666a24f4c07a6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/framework/zipball/ad6f7e6d6b38cf5bed4e3af9a1394c59d4bb9225", - "reference": "ad6f7e6d6b38cf5bed4e3af9a1394c59d4bb9225", + "url": "https://api.github.com/repos/utopia-php/http/zipball/8fe57da0cecd57e3b17cd395b4a666a24f4c07a6", + "reference": "8fe57da0cecd57e3b17cd395b4a666a24f4c07a6", "shasum": "" }, "require": { @@ -95,10 +95,10 @@ "upf" ], "support": { - "issues": "https://github.com/utopia-php/framework/issues", - "source": "https://github.com/utopia-php/framework/tree/0.32.0" + "issues": "https://github.com/utopia-php/http/issues", + "source": "https://github.com/utopia-php/http/tree/0.33.6" }, - "time": "2023-12-26T14:18:36+00:00" + "time": "2024-03-21T18:10:57+00:00" } ], "packages-dev": [ @@ -299,25 +299,27 @@ }, { "name": "nikic/php-parser", - "version": "v4.18.0", + "version": "v5.0.2", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999" + "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1bcbb2179f97633e98bbbc87044ee2611c7d7999", - "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/139676794dc1e9231bf7bcd123cfc0c99182cb13", + "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13", "shasum": "" }, "require": { + "ext-ctype": "*", + "ext-json": "*", "ext-tokenizer": "*", - "php": ">=7.0" + "php": ">=7.4" }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "bin": [ "bin/php-parse" @@ -325,7 +327,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.9-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -349,26 +351,27 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.18.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.2" }, - "time": "2023-12-10T21:03:43+00:00" + "time": "2024-03-05T20:51:40+00:00" }, { "name": "phar-io/manifest", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", "shasum": "" }, "require": { "ext-dom": "*", + "ext-libxml": "*", "ext-phar": "*", "ext-xmlwriter": "*", "phar-io/version": "^3.0.1", @@ -409,9 +412,15 @@ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" + "source": "https://github.com/phar-io/manifest/tree/2.0.4" }, - "time": "2021-07-20T11:28:43+00:00" + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" }, { "name": "phar-io/version", @@ -466,16 +475,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.30", + "version": "9.2.31", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ca2bd87d2f9215904682a9cb9bb37dda98e76089" + "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ca2bd87d2f9215904682a9cb9bb37dda98e76089", - "reference": "ca2bd87d2f9215904682a9cb9bb37dda98e76089", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/48c34b5d8d983006bd2adc2d0de92963b9155965", + "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965", "shasum": "" }, "require": { @@ -532,7 +541,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.30" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.31" }, "funding": [ { @@ -540,7 +549,7 @@ "type": "github" } ], - "time": "2023-12-22T06:47:57+00:00" + "time": "2024-03-02T06:37:42+00:00" }, { "name": "phpunit/php-file-iterator", @@ -785,16 +794,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.15", + "version": "9.6.19", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "05017b80304e0eb3f31d90194a563fd53a6021f1" + "reference": "a1a54a473501ef4cdeaae4e06891674114d79db8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/05017b80304e0eb3f31d90194a563fd53a6021f1", - "reference": "05017b80304e0eb3f31d90194a563fd53a6021f1", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a1a54a473501ef4cdeaae4e06891674114d79db8", + "reference": "a1a54a473501ef4cdeaae4e06891674114d79db8", "shasum": "" }, "require": { @@ -868,7 +877,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.15" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.19" }, "funding": [ { @@ -884,20 +893,20 @@ "type": "tidelift" } ], - "time": "2023-12-01T16:55:19+00:00" + "time": "2024-04-05T04:35:58+00:00" }, { "name": "sebastian/cli-parser", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", "shasum": "" }, "require": { @@ -932,7 +941,7 @@ "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" }, "funding": [ { @@ -940,7 +949,7 @@ "type": "github" } ], - "time": "2020-09-28T06:08:49+00:00" + "time": "2024-03-02T06:27:43+00:00" }, { "name": "sebastian/code-unit", @@ -1186,16 +1195,16 @@ }, { "name": "sebastian/diff", - "version": "4.0.5", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", - "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", "shasum": "" }, "require": { @@ -1240,7 +1249,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" }, "funding": [ { @@ -1248,7 +1257,7 @@ "type": "github" } ], - "time": "2023-05-07T05:35:17+00:00" + "time": "2024-03-02T06:30:58+00:00" }, { "name": "sebastian/environment", @@ -1315,16 +1324,16 @@ }, { "name": "sebastian/exporter", - "version": "4.0.5", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", "shasum": "" }, "require": { @@ -1380,7 +1389,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" }, "funding": [ { @@ -1388,20 +1397,20 @@ "type": "github" } ], - "time": "2022-09-14T06:03:37+00:00" + "time": "2024-03-02T06:33:00+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.6", + "version": "5.0.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bde739e7565280bda77be70044ac1047bc007e34" + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bde739e7565280bda77be70044ac1047bc007e34", - "reference": "bde739e7565280bda77be70044ac1047bc007e34", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", "shasum": "" }, "require": { @@ -1444,7 +1453,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.6" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" }, "funding": [ { @@ -1452,7 +1461,7 @@ "type": "github" } ], - "time": "2023-08-02T09:26:13+00:00" + "time": "2024-03-02T06:35:11+00:00" }, { "name": "sebastian/lines-of-code", @@ -1688,16 +1697,16 @@ }, { "name": "sebastian/resource-operations", - "version": "3.0.3", + "version": "3.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", "shasum": "" }, "require": { @@ -1709,7 +1718,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -1730,8 +1739,7 @@ "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" }, "funding": [ { @@ -1739,7 +1747,7 @@ "type": "github" } ], - "time": "2020-09-28T06:45:17+00:00" + "time": "2024-03-14T16:00:52+00:00" }, { "name": "sebastian/type", @@ -1852,16 +1860,16 @@ }, { "name": "theseer/tokenizer", - "version": "1.2.2", + "version": "1.2.3", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96" + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b2ad5003ca10d4ee50a12da31de12a5774ba6b96", - "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", "shasum": "" }, "require": { @@ -1890,7 +1898,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.2" + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" }, "funding": [ { @@ -1898,7 +1906,7 @@ "type": "github" } ], - "time": "2023-11-20T00:12:19+00:00" + "time": "2024-03-03T12:36:25+00:00" } ], "aliases": [], @@ -1912,5 +1920,5 @@ "ext-redis": "*" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } From cf028ff898bcf6e1477a4ab67ad45729e8bda54c Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 7 Apr 2024 08:23:04 +0000 Subject: [PATCH 07/14] refactor image --- Dockerfile-php-8.0 | 4 ++-- Dockerfile-php-8.1 | 4 ++-- Dockerfile-php-8.2 | 4 ++-- Dockerfile-php-8.3 | 2 +- tests/docker/supervisord.conf | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Dockerfile-php-8.0 b/Dockerfile-php-8.0 index 325d287..fa9b434 100644 --- a/Dockerfile-php-8.0 +++ b/Dockerfile-php-8.0 @@ -13,7 +13,7 @@ RUN composer update --ignore-platform-reqs --optimize-autoloader \ --no-plugins --no-scripts --prefer-dist \ `if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi` -FROM php:8.0-cli-alpine as final +FROM php:8.0-fpm-alpine as final LABEL maintainer="team@appwrite.io" ENV DEBIAN_FRONTEND=noninteractive \ @@ -21,7 +21,7 @@ ENV DEBIAN_FRONTEND=noninteractive \ RUN \ apk add --no-cache --virtual .deps \ - supervisor php$PHP_VERSION php$PHP_VERSION-fpm nginx bash + supervisor nginx bash # Nginx Configuration (with self-signed ssl certificates) diff --git a/Dockerfile-php-8.1 b/Dockerfile-php-8.1 index 6a6a954..f242fa6 100644 --- a/Dockerfile-php-8.1 +++ b/Dockerfile-php-8.1 @@ -13,7 +13,7 @@ RUN composer update --ignore-platform-reqs --optimize-autoloader \ --no-plugins --no-scripts --prefer-dist \ `if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi` -FROM php:8.1-cli-alpine as final +FROM php:8.1-fpm-alpine as final LABEL maintainer="team@appwrite.io" ENV DEBIAN_FRONTEND=noninteractive \ @@ -21,7 +21,7 @@ ENV DEBIAN_FRONTEND=noninteractive \ RUN \ apk add --no-cache --virtual .deps \ - supervisor php php-fpm nginx bash + supervisor nginx bash # Nginx Configuration (with self-signed ssl certificates) diff --git a/Dockerfile-php-8.2 b/Dockerfile-php-8.2 index 65cd840..18e748c 100644 --- a/Dockerfile-php-8.2 +++ b/Dockerfile-php-8.2 @@ -13,7 +13,7 @@ RUN composer update --ignore-platform-reqs --optimize-autoloader \ --no-plugins --no-scripts --prefer-dist \ `if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi` -FROM php:8.2-cli-alpine as final +FROM php:8.2-fpm-alpine as final LABEL maintainer="team@appwrite.io" ENV DEBIAN_FRONTEND=noninteractive \ @@ -21,7 +21,7 @@ ENV DEBIAN_FRONTEND=noninteractive \ RUN \ apk add --no-cache --virtual .deps \ - supervisor php php-fpm nginx bash + supervisor nginx bash # Nginx Configuration (with self-signed ssl certificates) diff --git a/Dockerfile-php-8.3 b/Dockerfile-php-8.3 index 29ac58a..c8c0ed0 100644 --- a/Dockerfile-php-8.3 +++ b/Dockerfile-php-8.3 @@ -21,7 +21,7 @@ ENV DEBIAN_FRONTEND=noninteractive \ RUN \ apk add --no-cache --virtual .deps \ - supervisor php php-fpm nginx bash + supervisor php-fpm nginx bash # Nginx Configuration (with self-signed ssl certificates) diff --git a/tests/docker/supervisord.conf b/tests/docker/supervisord.conf index 6715ffc..47d791c 100644 --- a/tests/docker/supervisord.conf +++ b/tests/docker/supervisord.conf @@ -22,8 +22,8 @@ supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface [supervisorctl] serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket -[program:php8-fpm] -command=php-fpm%(ENV_PHP_VERSION)s -F +[program:php-fpm] +command=php-fpm -F autostart=true autorestart=true priority=5 From 0980b91a9e1d010a47964d477ea8920a16c7d34f Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 7 Apr 2024 08:25:10 +0000 Subject: [PATCH 08/14] chunked response gives cannot modify header warning --- tests/e2e/HTTPServicesTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/e2e/HTTPServicesTest.php b/tests/e2e/HTTPServicesTest.php index 7cdc273..0c117cb 100644 --- a/tests/e2e/HTTPServicesTest.php +++ b/tests/e2e/HTTPServicesTest.php @@ -45,8 +45,8 @@ public function testHook() $this->assertEquals('Hello World!', $response['body']); $this->assertEquals('init-called', $response['headers']['x-init']); - $response = $this->client->call(Client::METHOD_GET, '/chunked'); - $this->assertEquals('Hello World!', $response['body']); - $this->assertEquals('', ($response['headers']['x-init'] ?? '')); + // $response = $this->client->call(Client::METHOD_GET, '/chunked'); + // $this->assertEquals('Hello World!', $response['body']); + // $this->assertEquals('', ($response['headers']['x-init'] ?? '')); } } From d9bf72d7dc08b15724489dcbb7d8c774af5da868 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 7 Apr 2024 08:25:26 +0000 Subject: [PATCH 09/14] fix typo --- tests/e2e/HTTPServicesTest.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/e2e/HTTPServicesTest.php b/tests/e2e/HTTPServicesTest.php index 0c117cb..a405ac6 100644 --- a/tests/e2e/HTTPServicesTest.php +++ b/tests/e2e/HTTPServicesTest.php @@ -27,11 +27,11 @@ public function testRootAction() $this->assertEquals('Hello World!', $response['body']); } - public function testChunkedAction() - { - $response = $this->client->call(Client::METHOD_GET, '/chunked'); - $this->assertEquals('Hello World!', $response['body']); - } + // public function testChunkedAction() + // { + // $response = $this->client->call(Client::METHOD_GET, '/chunked'); + // $this->assertEquals('Hello World!', $response['body']); + // } public function testRedirectAction() { From eb57249ea32bd1c6a4ec5847e7ce1efdcb942499 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 7 Apr 2024 08:27:40 +0000 Subject: [PATCH 10/14] fix dockerfile --- Dockerfile-php-8.3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile-php-8.3 b/Dockerfile-php-8.3 index c8c0ed0..1bf8a57 100644 --- a/Dockerfile-php-8.3 +++ b/Dockerfile-php-8.3 @@ -13,7 +13,7 @@ RUN composer update --ignore-platform-reqs --optimize-autoloader \ --no-plugins --no-scripts --prefer-dist \ `if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi` -FROM php:8.3-cli-alpine as final +FROM php:8.3-fpm-alpine as final LABEL maintainer="team@appwrite.io" ENV DEBIAN_FRONTEND=noninteractive \ From 6aed894dd4d5b0d9753a0177b24cad888af3a185 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 8 Apr 2024 03:01:20 +0000 Subject: [PATCH 11/14] fix chunked test --- tests/e2e/HTTPServicesTest.php | 16 ++++++++-------- tests/e2e/server.php | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/e2e/HTTPServicesTest.php b/tests/e2e/HTTPServicesTest.php index a405ac6..7cdc273 100644 --- a/tests/e2e/HTTPServicesTest.php +++ b/tests/e2e/HTTPServicesTest.php @@ -27,11 +27,11 @@ public function testRootAction() $this->assertEquals('Hello World!', $response['body']); } - // public function testChunkedAction() - // { - // $response = $this->client->call(Client::METHOD_GET, '/chunked'); - // $this->assertEquals('Hello World!', $response['body']); - // } + public function testChunkedAction() + { + $response = $this->client->call(Client::METHOD_GET, '/chunked'); + $this->assertEquals('Hello World!', $response['body']); + } public function testRedirectAction() { @@ -45,8 +45,8 @@ public function testHook() $this->assertEquals('Hello World!', $response['body']); $this->assertEquals('init-called', $response['headers']['x-init']); - // $response = $this->client->call(Client::METHOD_GET, '/chunked'); - // $this->assertEquals('Hello World!', $response['body']); - // $this->assertEquals('', ($response['headers']['x-init'] ?? '')); + $response = $this->client->call(Client::METHOD_GET, '/chunked'); + $this->assertEquals('Hello World!', $response['body']); + $this->assertEquals('', ($response['headers']['x-init'] ?? '')); } } diff --git a/tests/e2e/server.php b/tests/e2e/server.php index 0663acc..1514ee8 100644 --- a/tests/e2e/server.php +++ b/tests/e2e/server.php @@ -8,10 +8,10 @@ use Utopia\Tests\TestPlatform; ini_set('memory_limit', '512M'); -ini_set('display_errors', 1); +ini_set('display_errors', 0); ini_set('display_startup_errors', 1); ini_set('display_socket_timeout', -1); -error_reporting(E_ALL); +error_reporting(E_ERROR | E_PARSE); $platform = new TestPlatform(); $platform->init('http'); From 0baaf9a627e4435b256038dfb2abf71501b469fd Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 20 May 2024 01:45:42 +0000 Subject: [PATCH 12/14] restructure tests --- phpunit.xml | 1 - tests/Platform/MockResponse.php | 32 ++++++++++ tests/e2e/Client.php | 103 -------------------------------- tests/e2e/HTTPServicesTest.php | 84 +++++++++++++++++++------- tests/e2e/server.php | 23 ------- 5 files changed, 96 insertions(+), 147 deletions(-) create mode 100644 tests/Platform/MockResponse.php delete mode 100644 tests/e2e/Client.php delete mode 100644 tests/e2e/server.php diff --git a/phpunit.xml b/phpunit.xml index de6deb0..ec39a7e 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -10,7 +10,6 @@ > - ./tests/e2e/Client.php ./tests/ diff --git a/tests/Platform/MockResponse.php b/tests/Platform/MockResponse.php new file mode 100644 index 0000000..a8b4040 --- /dev/null +++ b/tests/Platform/MockResponse.php @@ -0,0 +1,32 @@ +sent = true; + $this->end($body); + } + + public function chunk(string $body = '', bool $end = false): void + { + if ($end) { + $this->sent = true; + } + $this->write($body); + if ($end) { + $this->end(); + } + } +} diff --git a/tests/e2e/Client.php b/tests/e2e/Client.php deleted file mode 100644 index 335ddeb..0000000 --- a/tests/e2e/Client.php +++ /dev/null @@ -1,103 +0,0 @@ -baseUrl.$path.(($method == self::METHOD_GET && ! empty($params)) ? '?'.http_build_query($params) : '')); - $responseHeaders = []; - $responseStatus = -1; - $responseType = ''; - $responseBody = ''; - - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); - curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36'); - curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); - curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0); - curl_setopt($ch, CURLOPT_TIMEOUT, 15); - curl_setopt($ch, CURLOPT_HEADERFUNCTION, function ($curl, $header) use (&$responseHeaders) { - $len = strlen($header); - $header = explode(':', $header, 2); - - if (count($header) < 2) { // ignore invalid headers - return $len; - } - - $responseHeaders[strtolower(trim($header[0]))] = trim($header[1]); - - return $len; - }); - - $responseBody = curl_exec($ch); - $responseStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE); - - if ((curl_errno($ch)/* || 200 != $responseStatus*/)) { - throw new Exception(curl_error($ch).' with status code '.$responseStatus, $responseStatus); - } - - curl_close($ch); - - $responseHeaders['status-code'] = $responseStatus; - - if ($responseStatus === 500) { - echo 'Server error('.$method.': '.$path.'. Params: '.json_encode($params).'): '.json_encode($responseBody)."\n"; - } - - return [ - 'headers' => $responseHeaders, - 'body' => $responseBody, - ]; - } -} diff --git a/tests/e2e/HTTPServicesTest.php b/tests/e2e/HTTPServicesTest.php index 7cdc273..77707f9 100644 --- a/tests/e2e/HTTPServicesTest.php +++ b/tests/e2e/HTTPServicesTest.php @@ -3,50 +3,94 @@ namespace Utopia\Tests; use PHPUnit\Framework\TestCase; +use Utopia\App; +use Utopia\Request; -class ResponseTest extends TestCase +class HttpServicesTest extends TestCase { + protected ?App $app = null; + + protected ?string $method; + + protected ?string $uri; + public function setUp(): void { - $this->client = new Client(); + App::reset(); + $platform = new TestPlatform(); + $platform->init('http'); + + $this->app = new App('UTC'); } public function tearDown(): void { - $this->client = null; + $this->app = null; } - /** - * @var Client - */ - protected $client; - public function testRootAction() { - $response = $this->client->call(Client::METHOD_GET, '/'); - $this->assertEquals('Hello World!', $response['body']); + $_SERVER['REQUEST_METHOD'] = 'GET'; + $_SERVER['REQUEST_URI'] = '/'; + + $res = new MockResponse(); + \ob_start(); + $this->app->run(new Request(), $res); + $response = \ob_get_contents(); + \ob_end_clean(); + + $this->assertEquals('Hello World!', $response); } public function testChunkedAction() { - $response = $this->client->call(Client::METHOD_GET, '/chunked'); - $this->assertEquals('Hello World!', $response['body']); + $_SERVER['REQUEST_METHOD'] = 'GET'; + $_SERVER['REQUEST_URI'] = '/chunked'; + + \ob_start(); + $this->app->run(new Request(), new MockResponse()); + $response = \ob_get_contents(); + \ob_end_clean(); + + $this->assertEquals('Hello World!', $response); } public function testRedirectAction() { - $response = $this->client->call(Client::METHOD_GET, '/redirect'); - $this->assertEquals('Hello World!', $response['body']); + $_SERVER['REQUEST_METHOD'] = 'GET'; + $_SERVER['REQUEST_URI'] = '/redirect'; + + $res = new MockResponse(); + $this->app->run(new Request(), $res); + + $this->assertEquals('/', $res->getHeaders()['Location']); } public function testHook() { - $response = $this->client->call(Client::METHOD_GET, '/'); - $this->assertEquals('Hello World!', $response['body']); - $this->assertEquals('init-called', $response['headers']['x-init']); + $_SERVER['REQUEST_METHOD'] = 'GET'; + $_SERVER['REQUEST_URI'] = '/'; + + $res = new MockResponse(); + \ob_start(); + $this->app->run(new Request(), $res); + $response = \ob_get_contents(); + \ob_end_clean(); + + $this->assertEquals('Hello World!', $response); + $this->assertEquals('init-called', $res->getHeaders()['x-init']); + App::reset(); + + $_SERVER['REQUEST_METHOD'] = 'GET'; + $_SERVER['REQUEST_URI'] = '/chunked'; + + $res1 = new MockResponse(); + \ob_start(); + $this->app->run(new Request(), $res1); + $response = \ob_get_contents(); + \ob_end_clean(); - $response = $this->client->call(Client::METHOD_GET, '/chunked'); - $this->assertEquals('Hello World!', $response['body']); - $this->assertEquals('', ($response['headers']['x-init'] ?? '')); + $this->assertEquals('Hello World!', $response); + $this->assertEquals('', ($res1->getHeaders()['x-init'] ?? '')); } } diff --git a/tests/e2e/server.php b/tests/e2e/server.php deleted file mode 100644 index 1514ee8..0000000 --- a/tests/e2e/server.php +++ /dev/null @@ -1,23 +0,0 @@ -init('http'); - -$request = new Request(); -$response = new Response(); - -$app = new App('UTC'); -$app->run($request, $response); From 19215cdc4ddc3996c5a6d8a665522f1c08675c46 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 20 May 2024 01:48:34 +0000 Subject: [PATCH 13/14] fix test scripts --- .github/workflows/tests.yml | 32 ++++++++++++++++---------------- composer.json | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 25fd49f..40629ea 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,27 +2,27 @@ name: "Tests" on: [ pull_request ] jobs: - lint: - name: Tests + test: + name: Tests ${{ matrix.php-versions }} runs-on: ubuntu-latest strategy: matrix: - php-versions: ['8.0', '8.1', '8.2', '8.3'] # add PHP versions as required + php-versions: ['8.0', '8.1', '8.2', '8.3', 'nightly'] steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - fetch-depth: 2 + - name: Checkout repository + uses: actions/checkout@v3 - - run: git checkout HEAD^2 + - name: Setup PHP ${{ matrix.php-versions }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} - - name: Build - run: | - export PHP_VERSION=${{ matrix.php-versions }} - docker compose build - docker compose up -d - sleep 10 + - name: Validate composer.json and composer.lock + run: composer validate --strict + + - name: Compose install + run: composer install --ignore-platform-reqs - - name: Run Tests - run: docker compose exec web vendor/bin/phpunit --configuration phpunit.xml \ No newline at end of file + - name: Run tests + run: composer test \ No newline at end of file diff --git a/composer.json b/composer.json index 704ac5d..99c3d65 100644 --- a/composer.json +++ b/composer.json @@ -28,6 +28,6 @@ "scripts": { "format": "vendor/bin/pint", "lint": "vendor/bin/pint --test", - "test": "docker-compose up -d && sleep 10 && docker-compose exec web vendor/bin/phpunit --configuration phpunit.xml" + "test": "vendor/bin/phpunit --configuration phpunit.xml" } } From ceb169d571a4f2c58c1cc731dfcc941576c08b8b Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 20 May 2024 01:49:44 +0000 Subject: [PATCH 14/14] remove dockerfiles --- Dockerfile-php-8.0 | 53 ----- Dockerfile-php-8.1 | 53 ----- Dockerfile-php-8.2 | 53 ----- Dockerfile-php-8.3 | 53 ----- docker-compose.yml | 12 - tests/docker/nginx.conf | 87 ------- tests/docker/start | 25 --- tests/docker/supervisord.conf | 45 ---- tests/docker/www.conf | 412 ---------------------------------- 9 files changed, 793 deletions(-) delete mode 100644 Dockerfile-php-8.0 delete mode 100644 Dockerfile-php-8.1 delete mode 100644 Dockerfile-php-8.2 delete mode 100644 Dockerfile-php-8.3 delete mode 100644 docker-compose.yml delete mode 100644 tests/docker/nginx.conf delete mode 100644 tests/docker/start delete mode 100644 tests/docker/supervisord.conf delete mode 100644 tests/docker/www.conf diff --git a/Dockerfile-php-8.0 b/Dockerfile-php-8.0 deleted file mode 100644 index fa9b434..0000000 --- a/Dockerfile-php-8.0 +++ /dev/null @@ -1,53 +0,0 @@ -FROM composer:2.0 AS step0 - - -ARG TESTING=true - -ENV TESTING=$TESTING - -WORKDIR /usr/local/src/ - -COPY composer.* /usr/local/src/ - -RUN composer update --ignore-platform-reqs --optimize-autoloader \ - --no-plugins --no-scripts --prefer-dist \ - `if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi` - -FROM php:8.0-fpm-alpine as final -LABEL maintainer="team@appwrite.io" - -ENV DEBIAN_FRONTEND=noninteractive \ - PHP_VERSION=8 - -RUN \ - apk add --no-cache --virtual .deps \ - supervisor nginx bash - - -# Nginx Configuration (with self-signed ssl certificates) -COPY ./tests/docker/nginx.conf /etc/nginx/nginx.conf - -# PHP Configuration -RUN mkdir -p /var/run/php -COPY ./tests/docker/www.conf /etc/php/$PHP_VERSION/fpm/pool.d/www.conf - -# Script -COPY ./tests/docker/start /usr/local/bin/start - -# Add PHP Source Code -COPY ./src /usr/share/nginx/html/src -COPY ./tests /usr/share/nginx/html/tests -COPY ./phpunit.xml /usr/share/nginx/html/phpunit.xml -COPY --from=step0 /usr/local/src/vendor /usr/share/nginx/html/vendor - -# Supervisord Conf -COPY ./tests/docker/supervisord.conf /etc/supervisord.conf - -# Executables -RUN chmod +x /usr/local/bin/start - -EXPOSE 80 - -WORKDIR /usr/share/nginx/html - -CMD ["/bin/bash", "/usr/local/bin/start"] \ No newline at end of file diff --git a/Dockerfile-php-8.1 b/Dockerfile-php-8.1 deleted file mode 100644 index f242fa6..0000000 --- a/Dockerfile-php-8.1 +++ /dev/null @@ -1,53 +0,0 @@ -FROM composer:2.0 AS step0 - - -ARG TESTING=true - -ENV TESTING=$TESTING - -WORKDIR /usr/local/src/ - -COPY composer.* /usr/local/src/ - -RUN composer update --ignore-platform-reqs --optimize-autoloader \ - --no-plugins --no-scripts --prefer-dist \ - `if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi` - -FROM php:8.1-fpm-alpine as final -LABEL maintainer="team@appwrite.io" - -ENV DEBIAN_FRONTEND=noninteractive \ - PHP_VERSION=8.1 - -RUN \ - apk add --no-cache --virtual .deps \ - supervisor nginx bash - - -# Nginx Configuration (with self-signed ssl certificates) -COPY ./tests/docker/nginx.conf /etc/nginx/nginx.conf - -# PHP Configuration -RUN mkdir -p /var/run/php -COPY ./tests/docker/www.conf /etc/php/$PHP_VERSION/fpm/pool.d/www.conf - -# Script -COPY ./tests/docker/start /usr/local/bin/start - -# Add PHP Source Code -COPY ./src /usr/share/nginx/html/src -COPY ./tests /usr/share/nginx/html/tests -COPY ./phpunit.xml /usr/share/nginx/html/phpunit.xml -COPY --from=step0 /usr/local/src/vendor /usr/share/nginx/html/vendor - -# Supervisord Conf -COPY ./tests/docker/supervisord.conf /etc/supervisord.conf - -# Executables -RUN chmod +x /usr/local/bin/start - -EXPOSE 80 - -WORKDIR /usr/share/nginx/html - -CMD ["/bin/bash", "/usr/local/bin/start"] \ No newline at end of file diff --git a/Dockerfile-php-8.2 b/Dockerfile-php-8.2 deleted file mode 100644 index 18e748c..0000000 --- a/Dockerfile-php-8.2 +++ /dev/null @@ -1,53 +0,0 @@ -FROM composer:2.0 AS step0 - - -ARG TESTING=true - -ENV TESTING=$TESTING - -WORKDIR /usr/local/src/ - -COPY composer.* /usr/local/src/ - -RUN composer update --ignore-platform-reqs --optimize-autoloader \ - --no-plugins --no-scripts --prefer-dist \ - `if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi` - -FROM php:8.2-fpm-alpine as final -LABEL maintainer="team@appwrite.io" - -ENV DEBIAN_FRONTEND=noninteractive \ - PHP_VERSION=8.2 - -RUN \ - apk add --no-cache --virtual .deps \ - supervisor nginx bash - - -# Nginx Configuration (with self-signed ssl certificates) -COPY ./tests/docker/nginx.conf /etc/nginx/nginx.conf - -# PHP Configuration -RUN mkdir -p /var/run/php -COPY ./tests/docker/www.conf /etc/php/$PHP_VERSION/fpm/pool.d/www.conf - -# Script -COPY ./tests/docker/start /usr/local/bin/start - -# Add PHP Source Code -COPY ./src /usr/share/nginx/html/src -COPY ./tests /usr/share/nginx/html/tests -COPY ./phpunit.xml /usr/share/nginx/html/phpunit.xml -COPY --from=step0 /usr/local/src/vendor /usr/share/nginx/html/vendor - -# Supervisord Conf -COPY ./tests/docker/supervisord.conf /etc/supervisord.conf - -# Executables -RUN chmod +x /usr/local/bin/start - -EXPOSE 80 - -WORKDIR /usr/share/nginx/html - -CMD ["/bin/bash", "/usr/local/bin/start"] \ No newline at end of file diff --git a/Dockerfile-php-8.3 b/Dockerfile-php-8.3 deleted file mode 100644 index 1bf8a57..0000000 --- a/Dockerfile-php-8.3 +++ /dev/null @@ -1,53 +0,0 @@ -FROM composer:2.0 AS step0 - - -ARG TESTING=true - -ENV TESTING=$TESTING - -WORKDIR /usr/local/src/ - -COPY composer.* /usr/local/src/ - -RUN composer update --ignore-platform-reqs --optimize-autoloader \ - --no-plugins --no-scripts --prefer-dist \ - `if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi` - -FROM php:8.3-fpm-alpine as final -LABEL maintainer="team@appwrite.io" - -ENV DEBIAN_FRONTEND=noninteractive \ - PHP_VERSION=8.3 - -RUN \ - apk add --no-cache --virtual .deps \ - supervisor php-fpm nginx bash - - -# Nginx Configuration (with self-signed ssl certificates) -COPY ./tests/docker/nginx.conf /etc/nginx/nginx.conf - -# PHP Configuration -RUN mkdir -p /var/run/php -COPY ./tests/docker/www.conf /etc/php/$PHP_VERSION/fpm/pool.d/www.conf - -# Script -COPY ./tests/docker/start /usr/local/bin/start - -# Add PHP Source Code -COPY ./src /usr/share/nginx/html/src -COPY ./tests /usr/share/nginx/html/tests -COPY ./phpunit.xml /usr/share/nginx/html/phpunit.xml -COPY --from=step0 /usr/local/src/vendor /usr/share/nginx/html/vendor - -# Supervisord Conf -COPY ./tests/docker/supervisord.conf /etc/supervisord.conf - -# Executables -RUN chmod +x /usr/local/bin/start - -EXPOSE 80 - -WORKDIR /usr/share/nginx/html - -CMD ["/bin/bash", "/usr/local/bin/start"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 6ca27e8..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,12 +0,0 @@ -version: '3' - -services: - web: - build: - context: . - dockerfile: Dockerfile-php-${PHP_VERSION:-8.3} - ports: - - "9020:80" - volumes: - - ./tests:/usr/share/nginx/html/tests - - ./src:/usr/share/nginx/html/src \ No newline at end of file diff --git a/tests/docker/nginx.conf b/tests/docker/nginx.conf deleted file mode 100644 index 32dac62..0000000 --- a/tests/docker/nginx.conf +++ /dev/null @@ -1,87 +0,0 @@ -user www-data; -worker_processes auto; -pid /run/nginx.pid; -daemon off; - -events { - worker_connections 2048; - - # multi_accept on; -} - -http { - # Basic Settings - sendfile on; - tcp_nopush on; - tcp_nodelay on; - keepalive_timeout 65; - types_hash_max_size 2048; - client_max_body_size 10M; - - # server_names_hash_bucket_size 64; - # server_name_in_redirect off; - include /etc/nginx/mime.types; - default_type application/octet-stream; - - # Logging Settings - access_log /var/log/nginx/access.log; - error_log /var/log/nginx/error.log; - - # Virtual Host Configs - server { - listen 80; ## listen for ipv4; this line is default and implied - listen [::]:80 ipv6only=on; ## listen for ipv6 - - root /usr/share/nginx/html/tests/e2e; - index index.php server.php index.html index.htm; - - server_tokens off; - - # Make site accessible from http://localhost/ - #server_name localhost; - - # Disable sendfile as per https://docs.vagrantup.com/v2/synced-folders/virtualbox.html - sendfile off; - - # Add stdout logging - - #error_log /dev/stdout info; - #access_log /dev/stdout; - - access_log off; - - location / { - # First attempt to serve request as file, then - # as directory, then fall back to index.html - try_files $uri $uri/ /server.php?q=$uri&$args; - - } - - # redirect server error pages to the static page /50x.html - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root /usr/share/nginx/html; - } - - # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 - location ~ \.php$ { - try_files $uri =404; - fastcgi_split_path_info ^(.+\.php)(/.+)$; - #fastcgi_pass unix:/var/run/php5-fpm.sock; - fastcgi_pass 127.0.0.1:9000; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param SCRIPT_NAME $fastcgi_script_name; - fastcgi_param HTTP_IF_NONE_MATCH $http_if_none_match; - fastcgi_param HTTP_IF_MODIFIED_SINCE $http_if_modified_since; - fastcgi_read_timeout 600; - fastcgi_index server.php; - include fastcgi_params; - } - - # deny access to . files, for security - location ~ /\.(?!well-known).* { - #log_not_found off; - deny all; - } - } -} \ No newline at end of file diff --git a/tests/docker/start b/tests/docker/start deleted file mode 100644 index 253121f..0000000 --- a/tests/docker/start +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -export PHP_VERSION=$PHP_VERSION - -chown -Rf www-data.www-data /usr/share/nginx/html/ - -# Function to update the fpm configuration to make the service environment variables available -function setEnvironmentVariable() { - if [ -z "$2" ]; then - echo "Environment variable '$1' not set." - return - fi - - # Check whether variable already exists - if ! grep -q "\[$1\]" /etc/php/$PHP_VERSION/fpm/pool.d/www.conf; then - # Add variable - echo "env[$1] = $2" >> /etc/php/$PHP_VERSION/fpm/pool.d/www.conf - fi - - # Reset variable - # sed -i "s/^env\[$1.*/env[$1] = $2/g" /etc/php/$PHP_VERSION/fpm/pool.d/www.conf -} - -# Start supervisord and services -/usr/bin/supervisord -n -c /etc/supervisord.conf \ No newline at end of file diff --git a/tests/docker/supervisord.conf b/tests/docker/supervisord.conf deleted file mode 100644 index 47d791c..0000000 --- a/tests/docker/supervisord.conf +++ /dev/null @@ -1,45 +0,0 @@ -[unix_http_server] -file=/tmp/supervisor.sock ; (the path to the socket file) - -[supervisord] -;logfile=/tmp/supervisord.log ; (main log file;default.conf $CWD/supervisord.log) -logfile=/dev/null -logfile_maxbytes=0 ; (max main logfile bytes b4 rotation;default.conf 50MB) -logfile_backups=10 ; (num of main logfile rotation backups;default.conf 10) -loglevel=info ; (log level;default.conf info; others: debug,warn,trace) -pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default.conf supervisord.pid) -nodaemon=false ; (start in foreground if true;default.conf false) -minfds=1024 ; (min. avail startup file descriptors;default.conf 1024) -minprocs=200 ; (min. avail process descriptors;default.conf 200) -user=root ; - -; the below section must remain in the config file for RPC -; (supervisorctl/web interface) to work, additional interfaces may be -; added by defining them in separate rpcinterface: sections -[rpcinterface:supervisor] -supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface - -[supervisorctl] -serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket - -[program:php-fpm] -command=php-fpm -F -autostart=true -autorestart=true -priority=5 -startretries=10 -redirect_stderr=true -redirect_stdout=true - -[program:nginx] -command=nginx -autostart=true -autorestart=true -priority=10 -stdout_events_enabled=true -stderr_events_enabled=true -startretries=10 -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes = 0 \ No newline at end of file diff --git a/tests/docker/www.conf b/tests/docker/www.conf deleted file mode 100644 index 30dc765..0000000 --- a/tests/docker/www.conf +++ /dev/null @@ -1,412 +0,0 @@ -; Start a new pool named 'www'. -; the variable $pool can we used in any directive and will be replaced by the -; pool name ('www' here) -[www] - -; Per pool prefix -; It only applies on the following directives: -; - 'access.log' -; - 'slowlog' -; - 'listen' (unixsocket) -; - 'chroot' -; - 'chdir' -; - 'php_values' -; - 'php_admin_values' -; When not set, the global prefix (or /usr) applies instead. -; Note: This directive can also be relative to the global prefix. -; Default Value: none -;prefix = /path/to/pools/$pool - -; Unix user/group of processes -; Note: The user is mandatory. If the group is not set, the default user's group -; will be used. -user = www-data -group = www-data - -; The address on which to accept FastCGI requests. -; Valid syntaxes are: -; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on -; a specific port; -; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on -; a specific port; -; 'port' - to listen on a TCP socket to all IPv4 addresses on a -; specific port; -; '[::]:port' - to listen on a TCP socket to all addresses -; (IPv6 and IPv4-mapped) on a specific port; -; '/path/to/unix/socket' - to listen on a unix socket. -; Note: This value is mandatory. -; listen = /var/run/php5-fpm.sock -listen = 127.0.0.1:9000 - -; Set listen(2) backlog. -; Default Value: 65535 (-1 on FreeBSD and OpenBSD) -;listen.backlog = 65535 - -; Set permissions for unix socket, if one is used. In Linux, read/write -; permissions must be set in order to allow connections from a web server. Many -; BSD-derived systems allow connections regardless of permissions. -; Default Values: user and group are set as the running user -; mode is set to 0660 -listen.owner = www-data -listen.group = www-data -;listen.mode = 0660 -; When POSIX Access Control Lists are supported you can set them using -; these options, value is a comma separated list of user/group names. -; When set, listen.owner and listen.group are ignored -;listen.acl_users = -;listen.acl_groups = - -; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. -; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original -; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address -; must be separated by a comma. If this value is left blank, connections will be -; accepted from any ip address. -; Default Value: any -;listen.allowed_clients = 127.0.0.1 - -; Specify the nice(2) priority to apply to the pool processes (only if set) -; The value can vary from -19 (highest priority) to 20 (lower priority) -; Note: - It will only work if the FPM master process is launched as root -; - The pool processes will inherit the master process priority -; unless it specified otherwise -; Default Value: no set -; process.priority = -19 - -; Choose how the process manager will control the number of child processes. -; Possible Values: -; static - a fixed number (pm.max_children) of child processes; -; dynamic - the number of child processes are set dynamically based on the -; following directives. With this process management, there will be -; always at least 1 children. -; pm.max_children - the maximum number of children that can -; be alive at the same time. -; pm.start_servers - the number of children created on startup. -; pm.min_spare_servers - the minimum number of children in 'idle' -; state (waiting to process). If the number -; of 'idle' processes is less than this -; number then some children will be created. -; pm.max_spare_servers - the maximum number of children in 'idle' -; state (waiting to process). If the number -; of 'idle' processes is greater than this -; number then some children will be killed. -; ondemand - no children are created at startup. Children will be forked when -; new requests will connect. The following parameter are used: -; pm.max_children - the maximum number of children that -; can be alive at the same time. -; pm.process_idle_timeout - The number of seconds after which -; an idle process will be killed. -; Note: This value is mandatory. -pm = dynamic - -; The number of child processes to be created when pm is set to 'static' and the -; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. -; This value sets the limit on the number of simultaneous requests that will be -; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. -; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP -; CGI. The below defaults are based on a server without much resources. Don't -; forget to tweak pm.* to fit your needs. -; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' -; Note: This value is mandatory. -pm.max_children = 5 - -; The number of child processes created on startup. -; Note: Used only when pm is set to 'dynamic' -; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 -pm.start_servers = 2 - -; The desired minimum number of idle server processes. -; Note: Used only when pm is set to 'dynamic' -; Note: Mandatory when pm is set to 'dynamic' -pm.min_spare_servers = 1 - -; The desired maximum number of idle server processes. -; Note: Used only when pm is set to 'dynamic' -; Note: Mandatory when pm is set to 'dynamic' -pm.max_spare_servers = 3 - -; The number of seconds after which an idle process will be killed. -; Note: Used only when pm is set to 'ondemand' -; Default Value: 10s -;pm.process_idle_timeout = 10s; - -; The number of requests each child process should execute before respawning. -; This can be useful to work around memory leaks in 3rd party libraries. For -; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. -; Default Value: 0 -;pm.max_requests = 500 - -; The URI to view the FPM status page. If this value is not set, no URI will be -; recognized as a status page. It shows the following informations: -; pool - the name of the pool; -; process manager - static, dynamic or ondemand; -; start time - the date and time FPM has started; -; start since - number of seconds since FPM has started; -; accepted conn - the number of request accepted by the pool; -; listen queue - the number of request in the queue of pending -; connections (see backlog in listen(2)); -; max listen queue - the maximum number of requests in the queue -; of pending connections since FPM has started; -; listen queue len - the size of the socket queue of pending connections; -; idle processes - the number of idle processes; -; active processes - the number of active processes; -; total processes - the number of idle + active processes; -; max active processes - the maximum number of active processes since FPM -; has started; -; max children reached - number of times, the process limit has been reached, -; when pm tries to start more children (works only for -; pm 'dynamic' and 'ondemand'); -; Value are updated in real time. -; Example output: -; pool: www -; process manager: static -; start time: 01/Jul/2011:17:53:49 +0200 -; start since: 62636 -; accepted conn: 190460 -; listen queue: 0 -; max listen queue: 1 -; listen queue len: 42 -; idle processes: 4 -; active processes: 11 -; total processes: 15 -; max active processes: 12 -; max children reached: 0 -; -; By default the status page output is formatted as text/plain. Passing either -; 'html', 'xml' or 'json' in the query string will return the corresponding -; output syntax. Example: -; http://www.foo.bar/status -; http://www.foo.bar/status?json -; http://www.foo.bar/status?html -; http://www.foo.bar/status?xml -; -; By default the status page only outputs short status. Passing 'full' in the -; query string will also return status for each pool process. -; Example: -; http://www.foo.bar/status?full -; http://www.foo.bar/status?json&full -; http://www.foo.bar/status?html&full -; http://www.foo.bar/status?xml&full -; The Full status returns for each process: -; pid - the PID of the process; -; state - the state of the process (Idle, Running, ...); -; start time - the date and time the process has started; -; start since - the number of seconds since the process has started; -; requests - the number of requests the process has served; -; request duration - the duration in µs of the requests; -; request method - the request method (GET, POST, ...); -; request URI - the request URI with the query string; -; content length - the content length of the request (only with POST); -; user - the user (PHP_AUTH_USER) (or '-' if not set); -; script - the main script called (or '-' if not set); -; last request cpu - the %cpu the last request consumed -; it's always 0 if the process is not in Idle state -; because CPU calculation is done when the request -; processing has terminated; -; last request memory - the max amount of memory the last request consumed -; it's always 0 if the process is not in Idle state -; because memory calculation is done when the request -; processing has terminated; -; If the process is in Idle state, then informations are related to the -; last request the process has served. Otherwise informations are related to -; the current request being served. -; Example output: -; ************************ -; pid: 31330 -; state: Running -; start time: 01/Jul/2011:17:53:49 +0200 -; start since: 63087 -; requests: 12808 -; request duration: 1250261 -; request method: GET -; request URI: /test_mem.php?N=10000 -; content length: 0 -; user: - -; script: /home/fat/web/docs/php/test_mem.php -; last request cpu: 0.00 -; last request memory: 0 -; -; Note: There is a real-time FPM status monitoring sample web page available -; It's available in: /usr/share/php5/fpm/status.html -; -; Note: The value must start with a leading slash (/). The value can be -; anything, but it may not be a good idea to use the .php extension or it -; may conflict with a real PHP file. -; Default Value: not set -;pm.status_path = /status - -; The ping URI to call the monitoring page of FPM. If this value is not set, no -; URI will be recognized as a ping page. This could be used to test from outside -; that FPM is alive and responding, or to -; - create a graph of FPM availability (rrd or such); -; - remove a server from a group if it is not responding (load balancing); -; - trigger alerts for the operating team (24/7). -; Note: The value must start with a leading slash (/). The value can be -; anything, but it may not be a good idea to use the .php extension or it -; may conflict with a real PHP file. -; Default Value: not set -;ping.path = /ping - -; This directive may be used to customize the response of a ping request. The -; response is formatted as text/plain with a 200 response code. -; Default Value: pong -;ping.response = pong - -; The access log file -; Default: not set -;access.log = log/$pool.access.log - -; The access log format. -; The following syntax is allowed -; %%: the '%' character -; %C: %CPU used by the request -; it can accept the following format: -; - %{user}C for user CPU only -; - %{system}C for system CPU only -; - %{total}C for user + system CPU (default) -; %d: time taken to serve the request -; it can accept the following format: -; - %{seconds}d (default) -; - %{miliseconds}d -; - %{mili}d -; - %{microseconds}d -; - %{micro}d -; %e: an environment variable (same as $_ENV or $_SERVER) -; it must be associated with embraces to specify the name of the env -; variable. Some exemples: -; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e -; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e -; %f: script filename -; %l: content-length of the request (for POST request only) -; %m: request method -; %M: peak of memory allocated by PHP -; it can accept the following format: -; - %{bytes}M (default) -; - %{kilobytes}M -; - %{kilo}M -; - %{megabytes}M -; - %{mega}M -; %n: pool name -; %o: output header -; it must be associated with embraces to specify the name of the header: -; - %{Content-Type}o -; - %{X-Powered-By}o -; - %{Transfert-Encoding}o -; - .... -; %p: PID of the child that serviced the request -; %P: PID of the parent of the child that serviced the request -; %q: the query string -; %Q: the '?' character if query string exists -; %r: the request URI (without the query string, see %q and %Q) -; %R: remote IP address -; %s: status (response code) -; %t: server time the request was received -; it can accept a strftime(3) format: -; %d/%b/%Y:%H:%M:%S %z (default) -; %T: time the log has been written (the request has finished) -; it can accept a strftime(3) format: -; %d/%b/%Y:%H:%M:%S %z (default) -; %u: remote user -; -; Default: "%R - %u %t \"%m %r\" %s" -;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" - -; The log file for slow requests -; Default Value: not set -; Note: slowlog is mandatory if request_slowlog_timeout is set -;slowlog = log/$pool.log.slow - -; The timeout for serving a single request after which a PHP backtrace will be -; dumped to the 'slowlog' file. A value of '0s' means 'off'. -; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) -; Default Value: 0 -;request_slowlog_timeout = 0 - -; The timeout for serving a single request after which the worker process will -; be killed. This option should be used when the 'max_execution_time' ini option -; does not stop script execution for some reason. A value of '0' means 'off'. -; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) -; Default Value: 0 -;request_terminate_timeout = 0 - -; Set open file descriptor rlimit. -; Default Value: system defined value -;rlimit_files = 1024 - -; Set max core size rlimit. -; Possible Values: 'unlimited' or an integer greater or equal to 0 -; Default Value: system defined value -;rlimit_core = 0 - -; Chroot to this directory at the start. This value must be defined as an -; absolute path. When this value is not set, chroot is not used. -; Note: you can prefix with '$prefix' to chroot to the pool prefix or one -; of its subdirectories. If the pool prefix is not set, the global prefix -; will be used instead. -; Note: chrooting is a great security feature and should be used whenever -; possible. However, all PHP paths will be relative to the chroot -; (error_log, sessions.save_path, ...). -; Default Value: not set -;chroot = - -; Chdir to this directory at the start. -; Note: relative path can be used. -; Default Value: current directory or / when chroot -chdir = / - -; Redirect worker stdout and stderr into main error log. If not set, stdout and -; stderr will be redirected to /dev/null according to FastCGI specs. -; Note: on highloaded environement, this can cause some delay in the page -; process time (several ms). -; Default Value: no -;catch_workers_output = yes - -; Clear environment in FPM workers -; Prevents arbitrary environment variables from reaching FPM worker processes -; by clearing the environment in workers before env vars specified in this -; pool configuration are added. -; Setting to "no" will make all environment variables available to PHP code -; via getenv(), $_ENV and $_SERVER. -; Default Value: yes -;clear_env = no - -; Limits the extensions of the main script FPM will allow to parse. This can -; prevent configuration mistakes on the web server side. You should only limit -; FPM to .php extensions to prevent malicious users to use other extensions to -; exectute php code. -; Note: set an empty value to allow all extensions. -; Default Value: .php -;security.limit_extensions = .php .php3 .php4 .php5 - -; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from -; the current environment. -; Default Value: clean env -;env[HOSTNAME] = $HOSTNAME -;env[PATH] = /usr/local/bin:/usr/bin:/bin -;env[TMP] = /tmp -;env[TMPDIR] = /tmp -;env[TEMP] = /tmp - -; Additional php.ini defines, specific to this pool of workers. These settings -; overwrite the values previously defined in the php.ini. The directives are the -; same as the PHP SAPI: -; php_value/php_flag - you can set classic ini defines which can -; be overwritten from PHP call 'ini_set'. -; php_admin_value/php_admin_flag - these directives won't be overwritten by -; PHP call 'ini_set' -; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. - -; Defining 'extension' will load the corresponding shared extension from -; extension_dir. Defining 'disable_functions' or 'disable_classes' will not -; overwrite previously defined php.ini values, but will append the new value -; instead. - -; Note: path INI options can be relative and will be expanded with the prefix -; (pool, global or /usr) - -; Default Value: nothing is defined by default except the values in php.ini and -; specified at startup with the -d argument -;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com -;php_flag[display_errors] = off -;php_admin_value[error_log] = /var/log/fpm-php.www.log -;php_admin_flag[log_errors] = on -;php_admin_value[memory_limit] = 32M \ No newline at end of file