From e86c10e2f554ba60e95f745b3b062262b37c7188 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Wed, 10 Aug 2022 09:36:54 +0200 Subject: Composer require php extensions (#4497) #fix https://github.com/FreshRSS/FreshRSS/discussions/4494 --- composer.json | 28 +++++++++++++++++++++++++- composer.lock | 39 +++++++++++++++++++++++++++--------- docs/en/developers/02_First_steps.md | 2 +- p/ext.php | 1 + 4 files changed, 59 insertions(+), 11 deletions(-) diff --git a/composer.json b/composer.json index 30ca61c01..a8d1b64ad 100644 --- a/composer.json +++ b/composer.json @@ -17,10 +17,36 @@ "WebSub" ], "require": { - "php": ">=7.0" + "php": ">=7.0", + "ext-ctype": "*", + "ext-curl": "*", + "ext-dom": "*", + "ext-fileinfo": "*", + "ext-gmp": "*", + "ext-intl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "ext-openssl": "*", + "ext-pcre": "*", + "ext-pdo_sqlite": "*", + "ext-session": "*", + "ext-simplexml": "*", + "ext-xml": "*", + "ext-xmlreader": "*", + "ext-zend-opcache": "*", + "ext-zip": "*", + "ext-zlib": "*" + }, + "suggest": { + "ext-iconv": "*", + "ext-pdo_mysql": "*", + "ext-pdo_pgsql": "*" }, "require-dev": { "php": ">=8.0", + "ext-phar": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", "phpstan/phpstan": "~1.7.14", "phpunit/phpunit": "^9", "squizlabs/php_codesniffer": "^3.7" diff --git a/composer.lock b/composer.lock index 4434af211..d9bc8ed02 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": "a51faa9a0e83f4566bf5f07e33483e6a", + "content-hash": "b52a52e72b9449a7d252d92ccc62c826", "packages": [], "packages-dev": [ { @@ -532,16 +532,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.7.14", + "version": "1.7.15", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "e6f145f196a59c7ca91ea926c87ef3d936c4305f" + "reference": "cd0202ea1b1fc6d1bbe156c6e2e18a03e0ff160a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e6f145f196a59c7ca91ea926c87ef3d936c4305f", - "reference": "e6f145f196a59c7ca91ea926c87ef3d936c4305f", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/cd0202ea1b1fc6d1bbe156c6e2e18a03e0ff160a", + "reference": "cd0202ea1b1fc6d1bbe156c6e2e18a03e0ff160a", "shasum": "" }, "require": { @@ -567,7 +567,7 @@ "description": "PHPStan - PHP Static Analysis Tool", "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.7.14" + "source": "https://github.com/phpstan/phpstan/tree/1.7.15" }, "funding": [ { @@ -587,7 +587,7 @@ "type": "tidelift" } ], - "time": "2022-06-14T13:09:35+00:00" + "time": "2022-06-20T08:29:01+00:00" }, { "name": "phpunit/php-code-coverage", @@ -2144,10 +2144,31 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.0" + "php": ">=7.0", + "ext-ctype": "*", + "ext-curl": "*", + "ext-dom": "*", + "ext-fileinfo": "*", + "ext-gmp": "*", + "ext-intl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "ext-openssl": "*", + "ext-pcre": "*", + "ext-pdo_sqlite": "*", + "ext-session": "*", + "ext-simplexml": "*", + "ext-xml": "*", + "ext-xmlreader": "*", + "ext-zend-opcache": "*", + "ext-zip": "*", + "ext-zlib": "*" }, "platform-dev": { - "php": ">=8.0" + "php": ">=8.0", + "ext-phar": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*" }, "plugin-api-version": "2.2.0" } diff --git a/docs/en/developers/02_First_steps.md b/docs/en/developers/02_First_steps.md index 929f92a57..bc6361167 100644 --- a/docs/en/developers/02_First_steps.md +++ b/docs/en/developers/02_First_steps.md @@ -104,7 +104,7 @@ yum install -y git make npm php-cli php-curl php-mbstring php-xml php-pdo unzip ### Alpine Linux ```sh -apk add git make npm php-cli php-curl php-ctype php-dom php-mbstring php-openssl php-phar php-simplexml php-xml php-pdo php-tokenizer php-xmlwriter unzip wget +apk add git make npm php-cli php-curl php-ctype php-dom php-mbstring php-openssl php-phar php-simplexml php-xml php-pdo php-tokenizer php-xmlreader php-xmlwriter unzip wget ``` ### Partial fixes & tests diff --git a/p/ext.php b/p/ext.php index aa6972d83..b4d32f7ed 100644 --- a/p/ext.php +++ b/p/ext.php @@ -60,6 +60,7 @@ function is_valid_path_extension($path, $extensionPath, $isStatic = true) { // Static files to serve must be under a `ext_dir/static/` directory. $path_relative_to_ext = substr($path, strlen($real_ext_path) + 1); + // @phpstan-ignore-next-line list(,$static,$file) = sscanf($path_relative_to_ext, '%[^/]/%[^/]/%s'); if (null === $file || 'static' !== $static) { return false; -- cgit v1.2.3