NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Code completion and duplicated classes


Joined: 29 Mar 2009
Posts: 3
Reply with quote
I have this architecture on project:
root
|
---core/finalClasses/catalog.php
|
---finalClasses/catalog.php

when a call
$catalog = new catalog();
system go throw __autoload() which search catalog class in include_path.
Order of paths in include_path is: finalClasses;core/finalClasses
so if file not exists in finalClasses than script look in core/finalClasses.

phped always find catalog.php in core/finalClasses.

Is any ability set order of path to phped?

PS sorry for my bad english, hope that problem is clear Smile
View user's profileFind all posts by vavrSend private message
Guru master

Joined: 05 Jul 2004
Posts: 659
Location: Belgium
Reply with quote
The problem is clear but the solution isn't. I've ran into a similar problem myself but unfortunately there is no method to fix this at this point afaik. The thread here is the discussion about it.
View user's profileFind all posts by BlizzSend private messageVisit poster's website


Joined: 31 Aug 2005
Posts: 44
Location: Bamberg, Germany
Reply with quote
Aloha, I have a code completion problem, too. It is not the same as mentioned above (I think), but since the topic fits perfectly, I will add my post here.

In short, Code Completion sometimes works, sometimes not. Let me describe the problem in detail:
I use a central configuration file which loads some required classes and instantiates them. This simply looks like that:
Code:
require_once 'class.Player.php';
$player = new Player();


In this configuration file I also instantiate a dummy class, which is defined within the file. This looks like that:
Code:
class foo {
  public function _() {
    //some payload
  }
}
$t = new foo();


Now, what happens with this instances? While $t offers code completion throughout the project, $player doesn't. Code completion for $player is only available in the config file. I'm pretty sure this has to do something with the configuration on my side, but I can't find a solution for this. If I try to jump to the definition of a method of $player, phped says: "unable to find class of "$player" member, (declared as int)"

Any ideas on how to fix this?

TIA
Marcus

_________________
Smile
View user's profileFind all posts by MarcusSchwarzSend private messageVisit poster's websiteICQ Number
Guru master

Joined: 05 Jul 2004
Posts: 659
Location: Belgium
Reply with quote
If it says "declared as int" that probably means you declared an int somewhere else that hides the global $player variable imho.
View user's profileFind all posts by BlizzSend private messageVisit poster's website


Joined: 31 Aug 2005
Posts: 44
Location: Bamberg, Germany
Reply with quote
Since the project is a fork from another project here this most likely could be the problem. Will be funny to find that declaration somewhere in over 500 files... Thank god phped offers a code explorer Laughing Thank you again, this was the relevant information, sometimes you don't see the wood for the trees...

_________________
Smile
View user's profileFind all posts by MarcusSchwarzSend private messageVisit poster's websiteICQ Number
Site Admin

Joined: 13 Jul 2003
Posts: 8335
Reply with quote
Quote:
Order of paths in include_path is: finalClasses;core/finalClasses


Order of includes makes no sense for code completion. If two files are included, it does not matter in which order they are included. The resulting set of functions and classes will be the same. (although the output may vary depending on the code executed).

Conditional statements around include() calls can't be evaluated anyway, so the IDE does not know that some of the includes are bypassed.


Quote:
phped always find catalog.php in core/finalClasses.
Is any ability set order of path to phped?


Having duplicated classes is not helpful for codecompletion. I'd recommend you to hide core/finalClasses directory in the project and refresh Code Explorer.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 29 Mar 2009
Posts: 3
Reply with quote
Quote:

Having duplicated classes is not helpful for codecompletion. I'd recommend you to hide core/finalClasses directory in the project and refresh Code Explorer.


Its excellent idea! Smile 10x
View user's profileFind all posts by vavrSend private message
Code completion and duplicated classes
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic