Skip to content

Commit 5fee9a6

Browse files
jrfnlgrogy
authored andcommitted
GH Actions: set short_open_tag ini setting for PHP 5.3 test run
The tests for this PR were failing after support for PHP 5.3 had been added back. Reason being that the short PHP open echo tags `<?=` are only recognized as such with the ini setting `short_open_tag` turned on in PHP 5.3. I would normally add this to the matrix to do a complete test run with and without `short_open_tag`, but as this only affects PHP 5.3, I think that's a little over the top. Instead this commit adds a tweak to the test workflow to turn that ini setting on for the PHP 5.3 test run. Ref: https://www.php.net/manual/en/ini.core.php#ini.short-open-tag
1 parent 8af5759 commit 5fee9a6

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

.github/workflows/test.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,22 @@ jobs:
3232
- name: Checkout code
3333
uses: actions/checkout@v2
3434

35+
- name: Setup ini config
36+
id: set_ini
37+
run: |
38+
# On PHP 5.3, short_open_tag needs to be turned on for short open echo tags to be recognized
39+
# a PHP tags. As this only affects PHP 5.3, this is not something of serious concern.
40+
if [ ${{ matrix.php }} == "5.3" ]; then
41+
echo '::set-output name=PHP_INI::zend.assertions=1, error_reporting=-1, display_errors=On, short_open_tag=On'
42+
else
43+
echo '::set-output name=PHP_INI::zend.assertions=1, error_reporting=-1, display_errors=On'
44+
fi
45+
3546
- name: Setup PHP
3647
uses: shivammathur/setup-php@v2
3748
with:
3849
php-version: ${{ matrix.php }}
39-
ini-values: zend.assertions=1, error_reporting=-1, display_errors=On
50+
ini-values: ${{ steps.set_ini.outputs.PHP_INI }}
4051
coverage: none
4152
tools: cs2pr
4253

0 commit comments

Comments
 (0)