-
Notifications
You must be signed in to change notification settings - Fork 15
Global install is not working #12
Comments
This happens if you have both |
In this case, it's another very valuable argument about removing direct phpstan dependencies from plugins: phpstan/phpstan-phpunit#11 (comment) Currently, we just can't use phpstan globally at all with extension, if I understood well. |
You have to install phpstan extensions alongside phpstan - so both globally or both locally. Mixing globally installed PHPStan and locally installed extension will not work well... |
What about docker image in this case? BTW, the docker image works because it's not a phpstan-shim install. There is thing to do about that for sure. It's hard to use it on CI tools if we can't use it globally with local plugins. 😕 Could this issue be re-considered? Maybe not your top priority but I could do some search to find a solution on my free-time. |
BTW, maybe #7 would fit the need? :-) |
There's already a custom way we do namespace prefixing using https://github.com/fprochazka/phpstan-compiler. There's also been added a way how PHPStan extensions can be used within the official Docker image to the README yesterday, see: https://github.com/phpstan/docker-image/commit/74ec0aca4900da0d56908273ad8f8dfb4550b5fd |
In this case, I don't technically understand why I have this issue. 🤔
Well, I saw this doc part but it does not fit the need: I need to build a phpstan image, usable on any user projects which include local phpstan-extension. I'm not aware of the project content so I need to be flexible. I'll do some search about how to solve it, thanks for your time. |
It's probably some weird Composer autoloader issue
I understand that you're building this for FlintCI. I'm fine with that, PHPStan is open-source so anyone is free to build anything with it, but beware: PHPStan in the current form can execute userland code because of how it works: It uses native PHP reflection so it needs to load classes at runtime. And if a file with a class contains something else besides class declaration, that code is executed. So right now it's unsafe to run PHPStan analysis of someone else's code on your own server. More about that here: phpstan/phpstan#67 I'm also planning to launch PHPStan SaaS in 2018 with a lot of extra features but that's just in the embryo phase 😊 |
This is why I run it on a container. 😉 But you are right, we have to be careful. That's indeed for FlintCI integration, I'll see what I can do!
Can't wait! Good luck! 👍 |
Just after a fresh install with
composer global require
, I have this:The text was updated successfully, but these errors were encountered: