Version Control - .iml File - PHARS?

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

.idea/dataSources.ids
.idea/dataSources.xml
.idea/workspace.xml
.idea/shelf

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">
<CLASSES>
<root url="phar://C:/jenkins-php-tools/vendor/symfony/dependency-injection/Tests/Fixtures/includes/ProjectWithXsdExtensionInPhar.phar/" />
</CLASSES>
<SOURCES>
<root url="phar://C:/jenkins-php-tools/vendor/symfony/dependency-injection/Tests/Fixtures/includes/ProjectWithXsdExtensionInPhar.phar/" />
</SOURCES>
</library>
</orderEntry>

What causes this? 

14 comments

Hello,

Is the listed PHAR file location correct?

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

0

"Is the listed PHAR file location correct?"

Yes, those files exist.

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

No.

 

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

1

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

0

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

No.

"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.

1

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.

0

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?

1

Please use Exclude phar from project action in Project View

0

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

1

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

0

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.

1

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

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

 

0

Please sign in to leave a comment.