Hello, I tried to compile EasyCodingStandard as a phar file for using it standalone but it doesn't work.
I opened discussion on StackOverflow. There are also print-screens of my problem. Can you check it please? Thank you.
https://stackoverflow.com/questions/50052815/phar-doesnt-work-after-compiling
Hey, what issue do you try to solve?
Building phar is very complicated thing for Symfony-based applications, see very similar architecture at Rector:
@TomasVotruba I think for ECS it might be actually easier, as I think there will be no exceptions with namespace prefixing. Still I think he should think of prefixing only as it is much easier than fixing PHAR incompatibilities.
I see no prefixing in original question.
I assume he is creating PHAR coz of dependency conflicts.
I think problem with $skip is caused by incompatibility of glob PHP method.
Thank you for replies guys. It seems that the problem is in symfony/dependency-injection. I'm gonna write them to the issues. Maybe they will fix it :-)
I found it!
Workaround is quite easy. This commit will fix the problem with PHAR. So you can just download the code via composer, then manually update the file based on that commit and that's all. After building PHAR (I recommend MacFJA/PharBuilder - it's awesome) it will works :-)
@zener05 Wow, that's awesome! :rocket:
Thanks for sharing this with use, we got stuck on the very same problem
The PR in Symfony for reference: https://github.com/symfony/symfony/pull/26845
@TomasVotruba would it be possible to add a prebuild phar file to the github release page of EasyCodingStandard (like in https://github.com/phpstan/phpstan/releases)?
Hi, why not!
Feel free to send PR. I'd be happy to merge it
Good news everyone, the ecs.phar is here:
https://github.com/Symplify/Symplify/pull/1734
Most helpful comment
I found it!
Workaround is quite easy. This commit will fix the problem with PHAR. So you can just download the code via composer, then manually update the file based on that commit and that's all. After building PHAR (I recommend MacFJA/PharBuilder - it's awesome) it will works :-)