Reverse engineer PHP extension for code completion? |
|
Hi,
I'm doing some extensive programming against the MapGuide Open Source Web API. As you can see from the graphical class hierarchy (start from MgObject) this is a fairly large extension: https://mapguide.osgeo.org/documentation.html I've read about how to add code completion for the SPL library, and understand that I could do this, but I'm not really all that enthusiastic about manually creating the prototype file for this extension. Does anyone know how I could generate this kind of prototype automatically from the DLL or the C/C++ source code? Thanks, Jason |
||||||||||||
|
Site Admin
|
if a library is written in a language other than php, you need to write prototypes yourself or ask library developers for it. I see no other other ways.
Certainly you can create a tool say in shell script or awk or perl and parse C or C++ sources, but it's not easy. I'd recommend you to check how php develerps are parsing php-engine sources for this: http://cvs.php.net/viewvc.cgi/functable/ .It's where you'll see some phpXproto.awk files, they are grepping prototypes. |
||||||||||||
_________________ The PHP IDE team |
Site Admin
|
probably you ask about code completion in PhpED.
This is a valid php until you try to load (include) modules defining functions with the same name. Even if you load them at once, you can be safe by checking if function is defined. Ever heard of this? Look for a sample below: fileA.php:
fileB.php:
although it's not a very clean or recommended way, it's supported in PhpED. |
||||||||||||||||||
_________________ The PHP IDE team |
|
Does PhpED actually parse the prototype files using PHP? I'm not worried about PHP parsing the files, I'm worried about PhpED parsing the files for code completion. So... if I do something like this, will PhpED identify the multiple overloads for code completion?
If not, it would be great if PhpED had some way of parsing an external (XML?) file instead of php files for class, method, property definitions. Jason |
||||||||||||||||
|
Site Admin
|
I'm not sure what you're trying to accomplish.
In order to parse an XML file, I'd recommend you to consider a way of transforming that XML into another format using XSLT or similar techniques available out there. PhpED has nothing to do with XMLs (at least at the moment) |
||||||||||||
_________________ The PHP IDE team |
Guru master
|
I think he means that it would be cool if phpED would be able to get it's autocompletion info for such an extension from an extra file in XML format
|
||||||||||||
|
Site Admin
|
Did you ever try to open any cfg file in phped's directory?
I'd recommend you to try func.cfg (yet it only for functions, not for objects) |
||||||||||||
_________________ The PHP IDE team |
Reverse engineer PHP extension for code completion? |
|
||
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