How to set up PEAR so code completion works... |
|
I'm not absolutely sure (I do not work for nusphere ), but the code completion feature depens - or say respects - the files require()d or include()d by your script.
Please try both of the following: 1. Include the file (DB.php?) with a full relative path from your script and see if it works. 2. Point the "include path" setting in your project's properties to the PEAR folder containing the DB.php file and require 'DB.php'. Maybe this thread might also be helpful: code-completion-for-project-code-snippet-search-t1096.html |
||||||||||||
|
|
No luck. I tried it both ways.
I also went through all of the topics, FAQs and documentation I could find. It seems like it will only work with classes if the files exist under the project root directly. Any other ideas? Thanks |
||||||||||||
|
|
From the "project settings" help:
I'm almost sure that should be what you are looking for? |
||||||||||||||
|
|
Nope. I have the path to PEAR in the "Include Path" of the project settings. If I don't have it there, then the page(s) can't be previewed or debugged.
That is why I'm stumped... |
||||||||||||
|
|
Strange. A while ago, I had a similar problem and wanted to require some files located out of the project root with a file require"file.php" (without a path).
I had to modify the php.ini include_path for that, setting the project properties include path did not help. As I understood it that time, this setting only affects code completion, but does not affect php. (Without having tested that, that setting from the project properties probably won't show up in the output of a phpinfo() call?) |
||||||||||||
|
Site Admin
|
Please make sure you understand that the Include Path mentioned is in the PROJECT SETTINGS, not the one in php.ini.
|
||||||||||||
|
|
Yes, the include path is set in the PROJECT SETTINGS...
Here is a sample of the code I'm working with, if it helps:
Thanks. |
||||||||||||||
|
Site Admin
|
From the code you shown it's impossible to guess what class type (if even class at all) ::connect() method returns. Therefore type of $db variable is unknown and Code Completion can not show you any methods for it.
|
||||||||||||
|
|
Is there a way around this? The syntax used is right out of the PEAR docs...
Thanks. |
||||||||||||
|
Site Admin
|
Yes the syntax is correct. But it's the php typeless nature... From the source text it's not known what type of the value is returned by a function, except plain and strightforward situations.
|
||||||||||||
|
|
Maybe one could think of a way to work around this by interpreting PHPDoc inline documentation or at least considering them as a hint?
The problem is that most PEAR classes "exploit" PHPs typeless nature by either returning "business" objects or error objects - it's up to you to check what the returned object. Btw, does PHP5 type hinting only work for the method parameters - that is, you cannot hint to the type being returned? So type hinting would not help here... |
||||||||||||
|
How to set up PEAR so code completion works... |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by