Skip to content

Commit

Permalink
GH Actions: set short_open_tag ini setting for PHP 5.3 test run
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jrfnl authored and grogy committed Jan 28, 2022
1 parent 8af5759 commit 5fee9a6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,22 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup ini config
id: set_ini
run: |
# On PHP 5.3, short_open_tag needs to be turned on for short open echo tags to be recognized
# a PHP tags. As this only affects PHP 5.3, this is not something of serious concern.
if [ ${{ matrix.php }} == "5.3" ]; then
echo '::set-output name=PHP_INI::zend.assertions=1, error_reporting=-1, display_errors=On, short_open_tag=On'
else
echo '::set-output name=PHP_INI::zend.assertions=1, error_reporting=-1, display_errors=On'
fi
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: zend.assertions=1, error_reporting=-1, display_errors=On
ini-values: ${{ steps.set_ini.outputs.PHP_INI }}
coverage: none
tools: cs2pr

Expand Down

0 comments on commit 5fee9a6

Please sign in to comment.