Skip to content

Commit 728ba9e

Browse files
authored
PHP 8.1 Compatibility (#41)
* Unify templated files A lot of files are identical throughout the different packages. This is the base for unifying them for easier handling. * Adjust tests path Some packages use 'tests' as tests directory, while other use 'Tests'. The reference in phpunit.xml.dist is adjusted accordingly. * Build: Ignore PHP 5.4 and 5.5 The images used for tests with these versions have problems with using composer (giving curl error 60), so they are removed for now, until a solution is found. * Build: Introducing loose and strict code style check As some packages irreversibly violate our code style by using underscores in variable and method names, the loose check will let names with underscore pass. This check must pass. The strict check is applied without any exceptions, but allowed to fail, so we still get informed about these violations. * Build: Check for PHP 8.1 compatibility Since the CMS has expressed a need for PHP 8.1 compatible versions of the packages from Framework 1, compatibility should also be tested. * Tests: Don't use phpunit.xml to provide PHP values The phpunit.xml should only specify values that are required by the test environment. Everything that the tests themselves require should be made available via bootstrap.php. * Tests: Provide separate tests for PHP < 7.1 and PHP 7.1+
1 parent e7e62c6 commit 728ba9e

19 files changed

+2178
-113
lines changed

.appveyor.yml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
build: false
2+
platform:
3+
- x64
4+
clone_folder: C:\projects\filesystem
5+
6+
branches:
7+
except:
8+
- gh-pages
9+
10+
## Build matrix for lowest and highest possible targets
11+
environment:
12+
PHPBuild: "x64"
13+
VC: "vc15"
14+
WINCACHE: "2.0.0.8"
15+
matrix:
16+
- php_ver_target: 5.3.10
17+
- php_ver_target: 5.3.29
18+
- php_ver_target: 5.4.45
19+
- php_ver_target: 7.0.33
20+
- php_ver_target: 7.1.33
21+
- php_ver_target: 7.2.34
22+
- php_ver_target: 7.3.33
23+
- php_ver_target: 7.4.27
24+
- php_ver_target: 8.0.15
25+
- php_ver_target: 8.1.2
26+
27+
init:
28+
- SET PATH=C:\Program Files\OpenSSL;C:\tools\php;%PATH%
29+
- SET COMPOSER_NO_INTERACTION=1
30+
- SET PHP=1 # This var relates to caching the php install
31+
- SET ANSICON=121x90 (121x90)
32+
33+
## Install PHP and composer, and run the appropriate composer command
34+
install:
35+
- IF EXIST C:\tools\php (SET PHP=0)
36+
- ps: >-
37+
If ($env:PHP -eq "1") {
38+
appveyor-retry cinst php --version=$env:php_ver_target --package-parameters='""/InstallDir:C:\tools\php""' --ignore-checksums -y --no-progress --limit-output
39+
}
40+
- cd C:\tools\php
41+
- IF %PHP%==1 copy php.ini-production php.ini /Y
42+
- IF %PHP%==1 echo date.timezone="UTC" >> php.ini
43+
- IF %PHP%==1 echo extension_dir=ext >> php.ini
44+
- IF %PHP%==1 echo extension=php_openssl.dll >> php.ini
45+
- IF %PHP%==1 echo extension=php_mbstring.dll >> php.ini
46+
- IF %PHP%==1 echo extension=php_fileinfo.dll >> php.ini
47+
- IF %PHP%==1 echo extension=php_ftp.dll >> php.ini
48+
- IF %PHP%==1 echo extension=php_gd2.dll >> php.ini
49+
- IF %PHP%==1 echo extension=php_gmp.dll >> php.ini
50+
- IF %PHP%==1 echo extension=php_pgsql.dll >> php.ini
51+
- IF %PHP%==1 echo extension=php_curl.dll >> php.ini
52+
- IF %PHP%==1 echo zend_extension=php_opcache.dll >> php.ini
53+
- IF %PHP%==1 echo opcache.enable_cli=1 >> php.ini
54+
- IF %PHP%==1 echo @php %%~dp0composer.phar %%* > composer.bat
55+
- IF %PHP%==1 php -r "readfile('http://getcomposer.org/installer');" | php
56+
- cd C:\projects\filesystem
57+
- IF NOT %php_ver_target%=="8.0.0" composer update --prefer-stable --no-progress
58+
- IF %php_ver_target%=="8.0.0" composer update --prefer-stable --no-progress --ignore-platform-req=php
59+
60+
test_script:
61+
- cd C:\projects\filesystem
62+
- vendor\bin\phpunit

.drone.jsonnet

+15-8
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,13 @@ local composer(phpversion, params) = {
1818
volumes: volumes,
1919
commands: [
2020
"php -v",
21-
"composer --version",
2221
"composer update " + params,
2322
]
2423
};
2524

2625
local phpunit(phpversion) = {
2726
name: "PHPUnit",
2827
image: "joomlaprojects/docker-images:php" + phpversion,
29-
[if phpversion == "8.0" then "failure"]: "ignore",
3028
commands: ["vendor/bin/phpunit"]
3129
};
3230

@@ -52,17 +50,27 @@ local pipeline(name, phpversion, params) = {
5250
volumes: volumes,
5351
commands: [
5452
"php -v",
55-
"composer update",
53+
"composer update --prefer-stable",
5654
"composer require phpmd/phpmd phpstan/phpstan"
5755
]
5856
},
5957
{
60-
name: "phpcs",
58+
name: "phpcs (loose)",
6159
image: "joomlaprojects/docker-images:php7.4",
6260
depends: [ "composer" ],
6361
commands: [
6462
"vendor/bin/phpcs --config-set installed_paths vendor/joomla/coding-standards",
65-
"vendor/bin/phpcs -p --report=full --extensions=php --standard=ruleset.xml src/"
63+
"vendor/bin/phpcs -p --report=full --extensions=php --standard=ruleset.xml src/Inflector.php src/Normalise.php src/String.php src/StringHelper.php"
64+
]
65+
},
66+
{
67+
name: "phpcs (strict)",
68+
image: "joomlaprojects/docker-images:php7.4",
69+
depends: [ "composer" ],
70+
failure: "ignore",
71+
commands: [
72+
"vendor/bin/phpcs --config-set installed_paths vendor/joomla/coding-standards",
73+
"vendor/bin/phpcs -p --report=full --extensions=php --standard=Joomla src/Inflector.php src/Normalise.php src/String.php src/StringHelper.php"
6674
]
6775
},
6876
{
@@ -126,13 +134,12 @@ local pipeline(name, phpversion, params) = {
126134
]
127135
},
128136
pipeline("5.3", "5.3", "--prefer-stable"),
129-
pipeline("5.4", "5.4", "--prefer-stable"),
130-
pipeline("5.5", "5.5", "--prefer-stable"),
131137
pipeline("5.6", "5.6", "--prefer-stable"),
132138
pipeline("7.0", "7.0", "--prefer-stable"),
133139
pipeline("7.1", "7.1", "--prefer-stable"),
134140
pipeline("7.2", "7.2", "--prefer-stable"),
135141
pipeline("7.3", "7.3", "--prefer-stable"),
136142
pipeline("7.4", "7.4", "--prefer-stable"),
137-
pipeline("8.0", "8.0", "--ignore-platform-reqs --prefer-stable")
143+
pipeline("8.0", "8.0", "--prefer-stable"),
144+
pipeline("8.1", "8.1", "--prefer-stable")
138145
]

0 commit comments

Comments
 (0)