Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make it possible to build phar #48

Closed
wants to merge 2 commits into from
Closed

make it possible to build phar #48

wants to merge 2 commits into from

Conversation

taoso
Copy link
Contributor

@taoso taoso commented Dec 26, 2016

try to fix #46 #18

  • use system temp path
  • use %tmpDir instead of $rootDir/tmp
  • support additional autoload file by --autoload-file option

* use system temp path
* use %tmpDir instead of $rootDir/tmp
* support additional autoload file by --autoload-file option
@ondrejmirtes
Copy link
Member

Hi, thanks for the effort. The main hurdle for global installation via Composer or usage through phar package is the dependency between libraries used by PHPStan and by the main app. PHP cannot load two versions of a same-named class, so if both PHPStan and the analyzed app use for example Symfony Console, they must use the same version, otherwise PHPStan could report errors even if the app does not really contain any.

The solution to this problem is to prefix all dependencies in the generated phar package. PHPUnit needs to solve the same problem and thanks to them, I stumbled upon a library that aims to solve that: https://github.com/webmozart/php-scoper

So that's the first and main issue that needs to be solved.

As for the tmpDir, I would rather have it be configurable than magically discovering system temp path. So there's need to be a tmpDir in config.neon overridable by project config file.

As for the autoload file, thumbs up! I imagine it's enough to point i to the vendor/autoload.php.

@taoso
Copy link
Contributor Author

taoso commented Dec 26, 2016

@ondrejmirtes good luck.

@taoso taoso closed this Dec 26, 2016
@ondrejmirtes
Copy link
Member

It's a shame to abandon work in progress :) @lvht

OK, I will have to do it myself.

@taoso
Copy link
Contributor Author

taoso commented Dec 26, 2016

@ondrejmirtes I decide to make my own fork. Thanks for you awesome work.

@ondrejmirtes
Copy link
Member

@lvht It would be better to join forces. I have great ideas in the pipeline and it would be better to have joined focus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

phar build
2 participants