Building AIR Applications with the NetBeans PHP IDE

A user of the NetBeans PHP IDE published a tutorial on how to setup a project for developing rich AJAX/HTML Desktop Applications using NetBeans and Adobe AIR SDK.

Comments:

Thanx a lot.
Please write a tutorial on using netbeans-php for developing projects based on cakephp or zend framework. It will be of immense help.
Is it possible for NB to offer code completion for cakephp in built classes and functions?

Posted by Kiran on August 08, 2008 at 04:13 AM CEST #

I've got another question, if I compile my own php module written in C - can I somehow use header file to get code completion for my custom functions in NetBeans? It would be a great feature...
Cheers!

Posted by Azrael Valedhel on August 08, 2008 at 05:32 AM CEST #

Hi Kiran,

I haven't time to look at cake php in deep. I have tried only small tutorials so far. I expect that there will be tutorial how to set up NB in such case soon.

Regarding code completion for cakephp in built classes and functions. These are defined in PHP files (not in binary libraries) what I saw. So if I'm right and you don't have these files in your sources, then you can add the folder with these files into project Iclude path (Project Properties -> Include Path). Then cc will work.

Let me know, whether it helps you.

Thanks,
Petr

Posted by Petr on August 08, 2008 at 06:24 AM CEST #

Hi Azrael,

we don't support code completion from c header files. Can you send me example of such header file?

The solution it would be to have a php signature file for your module and this signature file you can put on the project or global Include (in the IDE) path as I mentioned in my comment above. You can write this signature file by hand, or generate though a script.

We have a php script which finds out all php registered modules and generate signature files for these modules. This script is bigger, because it also put PHP doc into signature files.

I think writing php file, which will translate a header file to the php signature file should be simple. Probably it can be a part of NB as well.

Let me know, what you think or whether I can help you.

Thanks,
Petr

Posted by Petr on August 08, 2008 at 06:39 AM CEST #

I just thought about adding /\*\* \*/ phpdoc-style blocks that would be parsed to add parameters and other info (since the "prototypes" are not exactly what we see normally).
This is an example header file for building php module:
http://pastebin.com/m2dda9e4f
Now, to add some info besides cc of function name:
http://pastebin.com/m24f053d9

...OR we could parse .C file, and that would be even better:
http://pastebin.com/m23e40db
We could get the args, the exact types, the return type and if there are optional parameters - we would know it.

These files are based on basic "hello world" module:
http://devzone.zend.com/node/view/id/1021

Given some time I would probably do something like it myself, but I'm kind of out of time lately... And it would be a nice feature I think - for module developers at least, but not only.

Posted by Azrael Valedhel on August 08, 2008 at 07:36 AM CEST #

So the signature file for the mentioned example should look like:

<?php
/\*\*
\* Funkcja zwracaj&#261;ca opis modu&#322;u
\* @return true
\*/
function astro_About () {}

/\*\*
\* astro_Resonance - oblicza rezonans dwoch planet
\* @param double $x
\* @param double $orb
\* @return double 0..1
\*/
function astro_Resonance ($x, $orb) {}
?>

Is this OK? I have written this by hand. Writing a java file or php file, which will do it, shouldn't be hard.

How do you generate the PHP documentation for your library?

Thanks,
Petr

Posted by Petr on August 08, 2008 at 08:08 AM CEST #

Yes Petr, it's "@return true" there, I just copied it from my files and that would be the old ver. with returning void (null), and I'm still at the very beginning of making this. I think I changed returning value from null to true while writing that comment ;)
I generally use phpdoc for php and will use phpdoc for php modules, as it is supported by NB and can be nicely exported.

Posted by Azrael Valedhel on August 08, 2008 at 08:45 AM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

This blogs is written by NetBeans developers who contribute to the PHP support mainly.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today