Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance PHP 8 compatibility #8051

Merged
merged 1 commit into from
Nov 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .composer-require-checker.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

"curl", "gd", "intl", "mbstring", "mysqli", "zlib",

"apcu", "exif", "ldap", "pcntl", "sodium", "xmlrpc"
"apcu", "exif", "ldap", "pcntl", "sodium"
],
"symbol-whitelist": [
"// PHP symbols",
Expand All @@ -31,6 +31,9 @@
"// apache function",
"getallheaders",

"// LDAP extension function removed in PHP 8.0",
"ldap_control_paged_result", "ldap_control_paged_result_response",

"// OPCache extension (not installed on testing env)",
"opcache_get_status", "opcache_invalidate", "opcache_reset",

Expand All @@ -40,6 +43,9 @@
"// XHProf PECL extension",
"XHProfRuns_Default", "xhprof_disable", "xhprof_enable", "XHPROF_PATH", "XHPROF_URL",

"// XMLRPC extension (not available on PHP 8)",
"xmlrpc_decode", "xmlrpc_decode_request", "xmlrpc_encode_request",

"// phpCAS library",
"CAS_VERSION_2_0", "phpCAS"
],
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
include:
- {php-version: "7.2"} # Lint on lower PHP version to detected too early usage of new syntaxes
- {php-version: "7.4"} # Lint on higher PHP version to detected deprecated elements usage
- {php-version: "8.0-rc"}
steps:
- name: "Cancel previous runs"
uses: "styfle/[email protected]"
Expand Down Expand Up @@ -82,7 +83,8 @@ jobs:
run: |
docker exec app rm composer.lock
docker exec app composer config --unset platform
docker exec app bin/console dependencies install --composer-options="--prefer-dist --no-progress"
if [[ "${{ matrix.php-version }}" =~ ^.+-rc$ ]]; then export COMPOSER_ADD_OPTS=--ignore-platform-reqs; fi
docker exec app bin/console dependencies install --composer-options="$COMPOSER_ADD_OPTS --prefer-dist --no-progress"
- name: "PHP Parallel Lint"
run: |
docker exec app vendor/bin/parallel-lint --exclude ./files/ --exclude ./plugins/ --exclude ./tools/vendor/ --exclude ./vendor/ .
Expand Down Expand Up @@ -110,6 +112,7 @@ jobs:
- {php-version: "7.4", db-image: "mariadb:10.5", always: true}
- {php-version: "7.2", db-image: "mariadb:10.5", always: false}
- {php-version: "7.3", db-image: "mariadb:10.5", always: false}
- {php-version: "8.0-rc", db-image: "mariadb:10.5", always: true}
- {php-version: "7.4", db-image: "mariadb:10.1", always: false}
- {php-version: "7.4", db-image: "mysql:5.6", always: false}
- {php-version: "7.4", db-image: "mysql:8.0", always: false}
Expand Down Expand Up @@ -174,7 +177,8 @@ jobs:
run: |
docker exec app rm composer.lock
docker exec app composer config --unset platform
docker exec app bin/console dependencies install --composer-options="--prefer-dist --no-progress"
if [[ "${{ matrix.php-version }}" =~ ^.+-rc$ ]]; then export COMPOSER_ADD_OPTS=--ignore-platform-reqs; fi
docker exec app bin/console dependencies install --composer-options="$COMPOSER_ADD_OPTS --prefer-dist --no-progress"
- name: "PHP Parallel Lint"
if: env.skip != 'true'
run: |
Expand Down
8 changes: 5 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
},
"require-dev": {
"ext-xml": "*",
"atoum/atoum": "^3.4",
"atoum/atoum": "4.x-dev",
"consolidation/robo": "^2.0",
"glpi-project/coding-standard": "^0.7",
"maglnet/composer-require-checker": "^2.0",
Expand Down Expand Up @@ -95,10 +95,12 @@
"cs": "vendor/bin/phpcs -d memory_limit=512M --cache -p --extensions=php --standard=vendor/glpi-project/coding-standard/GlpiStandard/ --ignore=\"/.git/,^$(pwd)/(config|files|lib|marketplace|node_modules|plugins|tests/config|vendor)/\" ./",
"lint": "vendor/bin/parallel-lint --exclude files --exclude marketplace --exclude plugins --exclude vendor --exclude tools/vendor .",
"post-install-cmd": [
"@php -r \"file_put_contents('.composer.hash', sha1_file('composer.lock'));\""
"@php -r \"file_put_contents('.composer.hash', sha1_file('composer.lock'));\"",
"patch -f -p1 -d vendor/tecnickcom/tcpdf/ < tools/tcpdf-php8-compat.patch || echo 'Error applying patch, deprecation warnings related to TCPDF lib may pollute logs'"
],
"post-update-cmd": [
"@php -r \"file_put_contents('.composer.hash', sha1_file('composer.lock'));\""
"@php -r \"file_put_contents('.composer.hash', sha1_file('composer.lock'));\"",
"patch -f -p1 -d vendor/tecnickcom/tcpdf/ < tools/tcpdf-php8-compat.patch || echo 'Error applying patch, deprecation warnings related to TCPDF lib may pollute logs'"
]
},
"repositories": {
Expand Down
Loading