FeaturesPluginsDocs & SupportCommunityPartners

NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Global Variables Property/Method Hints in PHP Editor.

 
Post new topic   Reply to topic    NetBeans Forums -> PHP Users
View previous topic :: View next topic  
Author Message
mrugendrabhure



Joined: 05 Jan 2009
Posts: 8
Location: INDIA

PostPosted: Sun May 31, 2009 1:27 pm    Post subject: Global Variables Property/Method Hints in PHP Editor. Reply with quote

Hi,

I noticed that variables declared as global are not available for code hints when u type -> over objects, even if type of objects is declared.

Wondering if this is possible.

class database
{
function abc()
{
echo "hello world!";
}
}

$db = new database;

/**
* @global database $db
*/
function testme()
{
global $db;
$db-><No automatic code hint available>
}

Regards,
Mrugendra.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Filip Zamboj
Posted via mailing list.





PostPosted: Sun May 31, 2009 1:59 pm    Post subject: Global Variables Property/Method Hints in PHP Editor. Reply with quote

Hi,

what build are you using, please? Your issue could be related to [1].
Try new build from [2] for most up-to date php build or full ide builds
from [3].

Let us know, please.
Thanks.
Regards,


[1] http://www.netbeans.org/issues/show_bug.cgi?id=162982
[2] http://bertram.netbeans.org/hudson/job/PHP-build
[3] http://bits.netbeans.org/download/trunk/nightly/latest
-------------
Filip Zamboj
Sun Microsystems

http://www.netbeans.org/community/issues.html
http://qa.netbeans.org



mrugendrabhure wrote:
Quote:
Hi,



I noticed that variables declared as global are not available for code hints when u type -> over objects, even if type of objects is declared.



Wondering if this is possible.



class database

{

function abc()

{

echo "hello world!";

}

}



$db = new database;



/**

* @global database $db

*/

function testme()

{

global $db;

$db-><No automatic code hint available>

}



Regards,

Mrugendra.










Back to top
mrugendrabhure



Joined: 05 Jan 2009
Posts: 8
Location: INDIA

PostPosted: Sun May 31, 2009 4:23 pm    Post subject: Reply with quote

Hi,

Thanks for the reply.

I am using:

Product Version: NetBeans IDE 6.5.1 (Build 200903060201)
Java: 1.6.0_13; Java HotSpot(TM) Client VM 11.3-b02
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)

The problem is not related to:

[1] http://www.netbeans.org/issues/show_bug.cgi?id=162982

As other code hints are available, just the global objects method code hints are not.

I will try out the latest build and post a reply on whether or not the issue has been resolved. I used the "Check for updates" button in nb and it said "no updates are available". I guess I will have to reinstall.

Thanks again,

Regards,
Mrugendra Bhure.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
mrugendrabhure



Joined: 05 Jan 2009
Posts: 8
Location: INDIA

PostPosted: Sun May 31, 2009 5:47 pm    Post subject: Reply with quote

I have upgraded to :

Product Version: NetBeans IDE Dev (Build 200905291401)
Java: 1.6.0_13; Java HotSpot(TM) Client VM 11.3-b02
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)

The problem exists but in a slightly different form. If the object class is declared in the same file as the function where global is used, the code hint is available. But if the class definition exists in an include file, the code hint is not available.

Hence, the following does not work:

//************* file1.php ******************
class testclass
{
public function testme()
{
return true;
}
}


//************ file2.php *******************
require_once("file1.php");

$testobject = new testclass();

//************ file3.php *******************
require_once("file2.php");

/**
* global testclass $testobject
*/
function testfunction()
{
global $testobject;
$testobject-> <No code hint available>
}


Please let me know. Thanks again.

Regards,
Mrugendra Bhure.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Filip Zamboj
Posted via mailing list.





PostPosted: Mon Jun 01, 2009 9:08 am    Post subject: Global Variables Property/Method Hints in PHP Editor. Reply with quote

Hi,

thanks for a feedback. I'll have a look on it asap!

Regards,

-------------
Filip Zamboj
Sun Microsystems

http://www.netbeans.org/community/issues.html
http://qa.netbeans.org



mrugendrabhure wrote:
Quote:
I have upgraded to :



Product Version: NetBeans IDE Dev (Build 200905291401)

Java: 1.6.0_13; Java HotSpot(TM) Client VM 11.3-b02

System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)



The problem exists but in a slightly different form. If the object class is declared in the same file as the function where global is used, the code hint is available. But if the class definition exists in an include file, the code hint is not available.



Hence, the following does not work:



//************* file1.php ******************

class testclass

{

public function testme()

{

return true;

}

}





//************ file2.php *******************

require_once("file1.php");



$testobject = new testclass();



//************ file3.php *******************

require_once("file2.php");



/**

* global testclass $testobject

*/

function testfunction()

{

global $testobject;

$testobject-> <No code hint available>

}





Please let me know. Thanks again.



Regards,

Mrugendra Bhure.










Back to top
radek matous
Posted via mailing list.





PostPosted: Mon Jun 01, 2009 2:17 pm    Post subject: Global Variables Property/Method Hints in PHP Editor. Reply with quote

mrugendrabhure wrote:

I've filed issue:
http://www.netbeans.org/nonav/issues/show_bug.cgi?id=166349

-thanks
Radek
Quote:
I have upgraded to :



Product Version: NetBeans IDE Dev (Build 200905291401)

Java: 1.6.0_13; Java HotSpot(TM) Client VM 11.3-b02

System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)



The problem exists but in a slightly different form. If the object class is declared in the same file as the function where global is used, the code hint is available. But if the class definition exists in an include file, the code hint is not available.



Hence, the following does not work:



//************* file1.php ******************

class testclass

{

public function testme()

{

return true;

}

}





//************ file2.php *******************

require_once("file1.php");



$testobject = new testclass();



//************ file3.php *******************

require_once("file2.php");



/**

* global testclass $testobject

*/

function testfunction()

{

global $testobject;

$testobject-> <No code hint available>

}





Please let me know. Thanks again.



Regards,

Mrugendra Bhure.










Back to top
mrugendrabhure



Joined: 05 Jan 2009
Posts: 8
Location: INDIA

PostPosted: Mon Jun 01, 2009 2:40 pm    Post subject: Reply with quote

Dear Mr. Radek,

thank you very much for prompt action and reply. Hope this gets resolved soon.

Your comments on improving the @glo are also welcome. I find the auto complete on items like @property does not work when I type @p.

Regards,
Mrugendra.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Filip Zamboj
Posted via mailing list.





PostPosted: Mon Jun 01, 2009 3:06 pm    Post subject: Global Variables Property/Method Hints in PHP Editor. Reply with quote

Hi mrugendrabhure.

Don't hesitate to submit an issue whenever you realize something is not
working properly as it is with @global, for instance. You can file
issues on http://www.netbeans.org/community/issues.html. You have to
get registered but it will allow you to track and file bugs.

We appreciate your contribution!
Thanks a lot!

-------------
Filip Zamboj
Sun Microsystems

http://www.netbeans.org/community/issues.html
http://qa.netbeans.org



mrugendrabhure wrote:
Quote:
Dear Mr. Radek,



thank you very much for prompt action and reply. Hope this gets resolved soon.



Your comments on improving the @glo are also welcome. I find the auto complete on items like @property does not work when I type @p.



Regards,

Mrugendra.










Back to top
dragostanasie



Joined: 06 Nov 2009
Posts: 1

PostPosted: Fri Nov 06, 2009 3:09 pm    Post subject: Reply with quote

As of Friday Nov 6 2009 this bug is still present. I was looking to switch to NetBeans from Zend but this is one important feature that is still missing due to this bug.

The suggestions don't work for class objects declared in other files which are included in the current file even if the object is declared global or global $myobject is used before.

The bug is perfectly described in the previous posts from above.
Back to top
View user's profile Send private message
radek matous
Posted via mailing list.





PostPosted: Wed Nov 11, 2009 10:57 pm    Post subject: Global Variables Property/Method Hints in PHP Editor. Reply with quote

dragostanasie wrote:
Quote:
As of Friday Nov 6 2009 this bug is still present. I was looking to switch to NetBeans from Zend but this is one important feature that is still missing due to this bug.

The suggestions don't work for class objects declared in other files which are included in the current file even if the object is declared global or global $myobject is used before.

The bug is perfectly described in the previous posts from above.





Should be fixed now:
https://netbeans.org/bugzilla/show_bug.cgi?id=166349

@global supported - type inferred, tested on this example scenario:

/**
* @global testclass $testobject
*/
function testfunction() {
global $testobject;
$testobject->|
}
?>

plus:
- CC for types: * @global testc|
- mark occurences

thanks
Radek
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> PHP Users All times are GMT
Page 1 of 1

 
Jump to:  
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
You can attach files in this forum
You can download files in this forum


Powered by phpBB