phpdependency-injectiondoctrinephar

PHAR doesn't work after compiling


I'm trying to compile Symplify/EasyCodingStandard to PHAR.

I tried automatic PHAR compiler MacFJA/PharBuilder which is great and works for other packages. But there is a problem with EasyCodingStandard package. Compiling is OK. But when I try to run compiled PHAR file, I get an error.

Unused binding "$skip" in service "Symplify\EasyCodingStandard\Console\Application".

enter image description here

There is probably problem in doctrine Dependency Injection. Do you have any ideas how to fix it? Thank you!


Solution

  • The problem is in symfony/dependency-injection. PHAR doesn't support glob (source) which symfony/dependency-injection uses.

    Workaround is quite easy. This commit will fix the problem with PHAR in symfony/dependency-injection. 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 it will works.