olivernybroe / phpinsights-intellij

The IntelliJ integration of phpinsights
MIT License
18 stars 2 forks source link

[Feat] Add ability to use it in docker #12

Open zolotov88 opened 4 years ago

zolotov88 commented 4 years ago

Use it with remoute php interpreter or with bash script

#!/bin/sh

docker-compose exec app ./vendor/bin/phpinsights "$@"

Like that: Снимок экрана от 2020-02-12 18-37-43

olivernybroe commented 4 years ago

Thanks for requesting the feature.

It should be possible to run it with a bash script, I just tried it out with a simple bash script

#!/bin/sh

path-to/phpinsights "$@"

and it worked for me.

The way the plugin runs the tool is simply by running the file you supply to it and passing the arguments to the path specified.

It does not try to execute it as a php script.

zolotov88 commented 4 years ago

Bash script can run phpinsights in container. But it dont works. It even dont validates. I think that there is 2 problems:

  1. Container with phpinsights do not contains /tmp/phpinsights_temp.tmp[N]/path-to files inside.
  2. Paths to a checking file in host system and in container are not equals. It can be that checking file not conteins at container at all.

When I use remote php from docker in phpstorm it makes phpstorm_helpescontainer[SOME-ADDITIONAL-INFO]. Maybe it needs to to solve these problems.

zolotov88 commented 4 years ago

I cant find this file. Where it can be? Снимок экрана от 2020-02-14 17-03-33

olivernybroe commented 4 years ago

Allright, so I'll try adding support for selecting the php interpreter from the list you have set in phpstorm, that might fix this for you. Something like this I think would be suitable image

The way all external tools in intellij works, is that they run themself on a tmp file of the one you want to run on. When the tool has ran on the file, the file is deleted from the tmp folder.