Fix the list of supported shells for completions in a phar#50111
Conversation
Using glob inside a phar does not work (it does not find anything). Using a DirectoryIterator on the other hand works with phars. This allows this command to compute the list of supported shells properly when used inside a phar.
|
Thank you @stof. |
|
FYI this introduced a regression on our side because the folder "Resources" is now mandatory (which was not the case before), so our compiled phar file didn't work anymore because we only included php files in it. Easily fixable on our side by forcing the phar compiler to include these completion files though. |
|
Well, I would say that working with modified source code of the component is not really covered by our BC policy. |
Yes I understand that, it's why i said that it's easily fixable on our side 👍
Actually, when the Resources folder does not exist, the new code logic breaks any command that uses the symfony/console package, not just the command "DumpCompletionCommand" where the code logic was changed. It's because the logic is contained in the method |
Using glob inside a phar does not work (it does not find anything). Using a DirectoryIterator on the other hand works with phars. This allows this command to compute the list of supported shells properly when used inside a phar.
Easy way to reproduce the bug: run
composer completion unsupported(or more realisticallycomposer completionin a zsh shell as zsh is not a supported shell in symfony/console 5.4) with composer 2.5.5 and see that you get this error with an empty list of supported shells: