Help to setup project include paths right way

Hi, i try to setup my project include paths.
Now my libraries structure is

- project root
     - code and stuff
     - ...
     - library
          - Doctrine
          - Symfony
          - Zend
          - Zflib

I want to Exclude frameworks from project source (Doctrine, Symfony, Zend) and only keep my files in Zflib dir
Then i want to setup project include path to can see frameworks code inside External libraries tab

I set my include path (F4-include path) to C:\WebServers\home\wot\library (as in my project) but dont see frameworks
inside External libraries

Is this right way to set every framework dir to excluded and then add every dir into include paths?
C:\WebServers\home\wot\library\Doctrine
C:\WebServers\home\wot\library\Zend
and so on.



Attachment(s):
2012-08-27_200701.jpg
2012-08-27_200645.jpg
1 comment
Comment actions Permalink

Hi Dmitry,

If you want exclude frameworks/libraries from Project Files and include as External Library, then the only valuable option known to me (I'm using this) is to:

  1. Move all these frameworks/libraries outside of the project (e.g. C:\WebServers\home\library)
  2. Add them as External Libraries (Settings | PHP -- just as you were doing)
  3. For your project to still work with old paths to framework/libraries -- create Symbolic link(s) in old locations (e.g. C:\WebServers\home\wot\library\Doctrine ---> C:\WebServers\home\library\Doctrine) and you can mark them as excluded. I personally would recommend to use separate symbolic links for each library instead of one symlink for the whole library folder -- this will allow to use the same approach in other projects where list of libraries may be different, plus you can use multiple versions of libraries/frameworks.


Thing is:

  1. You cannot exclude folder from project and then add it as external library -- it still will be excluded. But the aforementioned approach works as cache/indexes in PhpStorm apparently working with real locations (that's even why if you use it for multiple projects the same library will not be indexed multiple times but only once).
  2. You could just add those folders as External Libraries, but because it is still part of the project, then you would have to use separate custom Scope (Settings | Scopes) everywhere (in Project View panel, when doing global search/replace etc etc -- not really convenient).
0

Please sign in to leave a comment.