Version Control - .iml File - PHARS?

We commit the .idea folder to Git, except for these files:


Works great, except that recently the .iml file has this section now appear and disappear at times and we don't know why:

<orderEntry type="module-library">
<library name="PHARS">
<root url="phar://C:/jenkins-php-tools/vendor/symfony/dependency-injection/Tests/Fixtures/includes/ProjectWithXsdExtensionInPhar.phar/" />
<root url="phar://C:/jenkins-php-tools/vendor/symfony/dependency-injection/Tests/Fixtures/includes/ProjectWithXsdExtensionInPhar.phar/" />

What causes this? 


"Is the listed PHAR file location correct?"

Yes, those files exist.

"Did you change include paths in Settings\Preferences | Languages & Frameworks | PHP?"



I guess I knew how to add those myself, I could figure out what is causing it.


"Does anyone from your team use IDEA and not PHPStorm?"


"What does git log show when the section appears?"

Right now, it's committed, so I can only see when it's being removed. I'm not sure what you mean, as there is no commit for this when it's added or removed, the file shows up as changed.


But we don't use these Phars (it's the same ones that appear and disappear). How do we exclude these from the Project View altogether?


I don't have that in my Project View Menu. Where is that in the commands structure so that I can add it?


This is happening again with a new PHAR file (PHPUnit). I hate having to have all of my developers manually exclude these files from their workstations, and so I thought I would try again. I committed the changed .IML file, push it to origin, and as soon as I did, the entry was removed from the IML file (the file still exists in the project). I'm filing a bug.

Vladimir Luchansky


Is the listed PHAR file location correct?

Did you change include paths in Settings\Preferences | Languages & Frameworks | PHP?


What does git log show when the section appears?
Does anyone from your team use IDEA and not PhpStorm?


This is side-effect of making phar content visible inside project. Local file system file file://myPhar.phar is useless, but  instance of phar file system file phar://myPhar.phar it is added as library, read and used. It should not disappear, while phars are in project, and not excluded with special action in Project View.


Please use Exclude phar from project action in Project View


After Delete... action. Please make sure only phars are selected, and then you can use action from Ctrl(Cmd)+Shift+A (Find Action)


I think the solution that worked for me was to just delete the phars, bash/git-bash (Windows):

find vendor -name "*.phar" -exec rm "{}" \;



Please sign in to leave a comment.