| View previous topic :: View next topic |
| Author |
Message |
mrugendrabhure
Joined: 05 Jan 2009 Posts: 8 Location: INDIA
|
Posted: Sun May 31, 2009 1:27 pm Post subject: Global Variables Property/Method Hints in PHP Editor. |
|
|
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 |
|
 |
Filip Zamboj Posted via mailing list.
|
|
| Back to top |
|
 |
mrugendrabhure
Joined: 05 Jan 2009 Posts: 8 Location: INDIA
|
Posted: Sun May 31, 2009 4:23 pm Post subject: |
|
|
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 |
|
 |
mrugendrabhure
Joined: 05 Jan 2009 Posts: 8 Location: INDIA
|
Posted: Sun May 31, 2009 5:47 pm Post subject: |
|
|
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 |
|
 |
Filip Zamboj Posted via mailing list.
|
Posted: Mon Jun 01, 2009 9:08 am Post subject: Global Variables Property/Method Hints in PHP Editor. |
|
|
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.
|
Posted: Mon Jun 01, 2009 2:17 pm Post subject: Global Variables Property/Method Hints in PHP Editor. |
|
|
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
|
Posted: Mon Jun 01, 2009 2:40 pm Post subject: |
|
|
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 |
|
 |
Filip Zamboj Posted via mailing list.
|
Posted: Mon Jun 01, 2009 3:06 pm Post subject: Global Variables Property/Method Hints in PHP Editor. |
|
|
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
|
Posted: Fri Nov 06, 2009 3:09 pm Post subject: |
|
|
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 |
|
 |
radek matous Posted via mailing list.
|
Posted: Wed Nov 11, 2009 10:57 pm Post subject: Global Variables Property/Method Hints in PHP Editor. |
|
|
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 |
|
 |
|