deployphp / deployer

The PHP deployment tool with support for popular frameworks out of the box
https://deployer.org
MIT License
10.56k stars 1.48k forks source link

Fix version variables in Contao recipe #3735

Closed ameotoko closed 10 months ago

ameotoko commented 10 months ago

This PR fixes default values of config variables contao_version and symfony_version.

Context:

When installed, Contao overrides output of Symfony's console command bin/console --version, so that it returns Contao's version instead of Symfony's. The only way the get Symfony's version in this case is to run bin/console about.

In addition, bin/console contao:version command is deprecated since Contao 4.13 (current LTS), and no longer works in Contao 5.2 (current latest). Thus, in Contao 4.13 both console --version and console contao:version show Contao's version and neither of them shows Symfony's. In Contao 5.2, console --version shows Contao's version, and console contao:version fails.

This PR fixes it by parsing output of bin/console --version into contao_version variable, and bin/console about – into symfony_version. The fix works for both Contao 4.13 and Contao 5.2 versions. The parsing is done in the same way as in the bare Symfony's recipe:

https://github.com/deployphp/deployer/blob/a0a21e22a33860356d94bb14b67ecd37673bd1b8/recipe/symfony.php#L8-L12