Zend Framework classes flagged as undefined

I have just started using PhpStorm and I'm working on a ZF1 project. Any classes from the ZF library are highlighted in the editor as undefined as shown in the attachment.

How do I get phpstorm to recognize classes in the zend library and get rid of this annoying highlighting?

Thanks!



Attachment(s):
phpstorm.jpg
4 comments
Comment actions Permalink

Hi there,

First of all -- do you have those Zend Framework files in your project? Can you show some screenshots (whole IDE please):
1) file that has problems
2) that Zend Framework file

If you do -- maybe it included twice somehow (e.g. symbolic links somewhere)?

0
Comment actions Permalink

Hi, thanks

The files are not in the project but they are included through the index.php file and everything works as expected in the browser. Screenshot of index and full IDE window attached. At the bottom of the class Zend_Application in the line $application = new Zend_Application() is highlighted as an undefined class i.e. if I hover the cursor over it the message says "Undefined class Zend_Application".

I thought including the path to the library in the index might be enough but not so apparently!

Shane

0
Comment actions Permalink
Screenshot of index and full IDE window attached.

There is no files attached to the post.

I thought including the path to the library in the index might be enough but not so apparently!

IDE does not really care about include/require statements, at least in this sense.

If ZF files are not in the project then you have to reference them in some way: It could be:
1) Just symbolic link from somewhere in your project to ZF folder
2) "Settings | Languages & Frameworks | PHP | Include files" -- same sort of idea as PHP's own include_path; such folders will be listed under External Libraries branch in Project View
3) As Additional Content Root (Settings | Project | Directories --> Add Content Root)

If you do not plan to edit ZF files from IDE then #2 will be the best to include such 3rd party libraries.

0
Comment actions Permalink

#2 seems to have done the trick, thanks a lot, that's a great help!

0

Please sign in to leave a comment.