Skip to content

Development introduction

Jefferson González edited this page Mar 17, 2014 · 5 revisions

For those interested on helping improve this extension this section explains the basics of how it works. Almost every subdirectory contains a README file explaining its content so be sure to check them all ;)

Code is auto generated

Almost all the wxPHP extension source code is generated by a set of php scripts except app.h, app.cpp, references.h and references.cpp. Even config files (config.m4, config.w32) are re-generated to update the list of source files that need to be compiled. The PHP script that generates the source code uses as input the xml files produced by doxygen from the official wxWidgets docs. This xml files are parsed by another tool and then converted into json files for easy mapping into php arrays using json_decode function.

XML Parser

On the tools directory you will find the script on charge of parsing the xml files and converting them to json files. This script uses the xml files on the root xml directory. In order to regenerate this xml files with the most recent changes in wxWidgets you would need a copy of wxWidgets source code then inside of the wxWidgets directory:

cd docs\doxygen
./ xml

This will produce hundreds of xml files that constitute the wxWidgets documentation. You would need to copy all the files on out/xml to the xml directory on the root directory of wxPHP. Then you will need to run the json_generator from the sources root directory of wxPHP as follows:

php tools/json_generator.php

After running json_generator.php some json files will be generated on the json dir, this files are:

classes.json, consts.json, global_variables.json, typedef.json
class_groups.json, enums.json, includes.json, class_variables.json,

NOTE: For some other details check the README file on the xml, json and tools directories.