Code Completion for Included Class Files |
|
And I forgot to include..
WinXP Pro PhpED 3.3.1 (Build 3356eval) Eval as my company is dragging its feet with the purchase order. |
||||||||||||
|
Site Admin
|
Seems a little problem is there. To make sure what base directory the relative path should be calculated from, IDE should distinguish scripts that can be called using URL from included files that can't be. With current implementation, PHPED takes directory of the script where you call include() and adds relative path of the include statement. It works right for the _base_ files (that can be called via URLs) and does not work right for the files that are included from other scripts that are located in different directories...
|
||||||||||||
|
|
Is there any chance this is going to be fixed anytime soon though? I have the same issues, and it's making me go mad...
1. the auto-code completion thing is a real showstopper if it doesn't work like lagsalot described it (I acually have the exact same structure, which is I believe a very common one ) 2. Also when debugging, the include is always working from the current position.. For instance, take the following example: index.php /includes/genericfunctions.inc.php /includes/securityfunctions.inc.php What i do in index.php is include /includes/genericfunctions.inc.php and then call the initialising function that should do the rest. In that initialiser, I want to include the securityfunctions.inc.php, so I do include_once('includes/securityfunctions.inc.php') which is correct, as the script is being executed as index.php - yet, phpED seems to be searching for /includes/includes/securityfunctions.inc.php in stead... I hope this can be helped soon though This may get me to renew my licenses |
||||||||||||
|
Site Admin
|
Code completion is supposed to work even if nothing is really executed. How would PhpED know what is the so called "current position"
|
||||||||||||
|
|
AS far as I can tell, code completion is only there for functions within the file you are editing, or files that you actually included using include() or include_once()... Regarding your feedback - I'm executing index.php in the root, so it's obvious that all includes should be starting from that location, as this is what PHP does... I'm not sure you're following what I'm trying to say, but then again it might be my English Please let me know if you don't really understand what I'm referring to, and I'll try and explain better... |
||||||||||||||
|
Site Admin
|
Not exactly Let me demonstrate it. what's about the following? file a.php:
file b.php:
should function fun_a() be shown in code completion if you're in b.php ? From the php's perspectives it should. |
||||||||||||||||||
|
|
No, but this is not what I'm referring to...
file a.php:
file b.php:
file c.php:
in the above, code completion will not work when trying to caal fun_c() from within file a.php because it is third level inclusion... if I had a function in file b.php, it does it perfectly well... The second issue I'm talking about: file index.php:
file includes/genericFunctions.inc.php:
-> this will crash in debug, as it is searching for includes/securityFunctions.inc.php based on the location of the includes/genericFunctions.inc.php file; meaning it will go look for includes/includes/securityFunctions.inc.php, where it should actually, from a php perspective, search based on the location of the file that is actually being executed, in this example being index.php, and should include the file starting from that location in the directory tree... I hope this all makes sense now... |
||||||||||||||||||||||
|
Site Admin
|
What do you mean
Who? Debugger? Code Insight Engine?
If you mean Code Insight, please tell me how would it guess what file is being executed when you're just typing your code? If you mean Debugger, it does never seach for anything. Php engine does and always follows its rules. |
||||||||||||||||||
|
|
ddmitrie,
I'm having the feeling that you don't want to understand what I'm telling you. I don't know how I can get this any more clearer to you... I'm talking about utomatic code completion, so Code Insight Engine... It could easily "guess" what file is being executed by having a setting that says what is the root handler file that will call all other files in the project. I believe our setup is very common where we have ONE index.php that is ALWAYS being called when we execute anything withing the project, as this allows us to do general stuff there (such as user authentication, security checkings, license checkings, initialisation of database settings, and more...) I do understand what you're saying, but I really don't know what is so incomprehensible about my explanation... |
||||||||||||
|
Site Admin
|
Personally, I'm not sure why index.php would be considered as a root file to call for all the other project files. For example, in PHPBB you're reading right now there are many such "root" files, namely posting.php, index.php, viewforum.php, search.php, memberlist.php, faq.php, profile.php and many many other files.
Actually, I didn't mean that. You explained what you want and I tried to explain why it's not so easy in Phped 3.3. On the other hand, PHPED 4.0 will come with different approach. It captures all the project files, classes, functions, methods etc etc etc and show you codecompletion without much problems with settings and directories the files are located in. |
||||||||||||||||
|
|
Dmitrie
Speedpacket is using a development method (aka Design Pattern) known as the MVC - Its been used for years in the Java market and has become the defacto standard for designing J2EE powered sites, and now its become increasingly more popular with PHP. http://www.phppatterns.com/docs/design/archive/model_view_controller_pattern Cheers |
||||||||||||
|
Code Completion for Included Class Files |
|
||
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