External Libraries doesn't support PHP features - Am I doing this right?

Hello,

I've been having this issue for a year and dealing with it - but I figure there MUST be some better way to work. Maybe someone would have any insight into this: I have a PHPStorm project, but my code is split up into 2 SVN repositories. One contains my main front-end php/html/css, and the second one contains libraries. The libraries are both frameworks like Zend Framework, as well as my own custom code libraries. I use this format because I use the same libraries across a few projects, so I keep Zend+Custom libraries all in the same SVN repo and update it as needed.

The directory structure is basically:

C:\dev\library
C:\dev\project1

My PHPStorm is using the "project1" directory, while "library" directory is added inside "External Libraries"

The problem is that the External Libraries feature seems quite limiting and doesn't have the features I use often in PHPStorm. For example, I don't even have unused local variable detection when editing the library code!

$randomvariable = 3; // not used anywhere in the function

This variable does not appear greyed out like the regular project code would do. Secondly, I can't use Subversion features on External Libraries code.

What can I do to make both of my SVN directories work with full PHP support inside PHPStorm? Is there another feature i should be using instead of "External Libraries" to include my "library" directory in my project?

5 comments
Comment actions Permalink

Hi there,

The External Libraries is for 3rd party code which you should not be modifying, that's why it has no code analysis etc -- it is basically meant to be used for parsing only so that you have code completion etc for such functions/classes in your project (hence the word "external").

If you need to constantly modify such code, then add it as Additional Content Root via "Settings | Directories" instead -- in Project View it will be in upper part (part of the project itself) instead of being under External Libraries branch (as it is now)

0
Comment actions Permalink

Nice, thank you :) The code highlighting works now, but there's no SVN support in the additional content root. Does PHPStorm not support SVN for additional content directories?

0
Comment actions Permalink

I'm not using any VCS so cannot advise here. But I would expect VCS operations to be supported here. Maybe check PhpStorm WebHelp for details.

0
Comment actions Permalink

You can always map your VCS roots at Settings|Version Control

0
Comment actions Permalink

THANK YOU very much, I didn't realize I had to map that! Now I have PHPStorm working perfectly as I always wanted :D < very pleased! I appreciate the help guys.

0

Please sign in to leave a comment.