News

New Developer!

We welcome Don Bauer to our team! He is actually working on code completion support of wxPHP on eclipse as setup file for windows which will include everything you need to start developing on that platform, also he is test building in all main platforms meaning we could have some packages for easy installation on systems like ubuntu and mac as other things. Hes help will bring a boost to wxPHP so we are really happy! Segmentation Bug Fixed Also I take the time to let you all know (if some one is actually following this blog :D) that the segmentation bug caused when loading the wxPHP extension from the php.ini is now fixed. After running php thru valgrind it rapidly pointed me ...

Many Issues Fixed

After almost 3 months of inactivity, today I committed some fixes to the code to suppress the megalithic compilation warnings caused by the usage of #define element "string" and "string" on function calls since older version of wxPHP. These practices has been deprecated from c++ while completely legal on plain c, but since this extension needs the c++ compiler in order to bind the wxWidgets library, adjustments were needed. Also I fixed the type casting errors that I introduced to the code after adding newer features and migrating the code to use wxWidgets 2.9.x branch. As I mentioned one post before, there is a tag on doxygen xml output named <array> for function parameters declared as type varname[] so I fixed ...

Fixing Explicit Casting Issues

Hi everyone! I'm working on fixing some compile warnings and errors in order to be able to compile on windows. Most of the compilation errors are fixed, but on the way I discovered some bugs. One of them is that I missed the <array> element for method parameters on the doxygen xml output. So I need to fix the xml parser in order to retrieve this data correctly and sync the new output with the current classes.json that stores the binded classes that are working correctly. Thanks to Andrea (RedTide) that pointed out another element <onlyfor> added by the documentation team of wxWidgets to indicate on which platforms a method or class is implemented. This element consist of a comma separated list ...

Implemented __get and correct object destruction

Today I have committed another set of changes and enabled 2 more classes : wxSystemOptions and wxSystemSettings in order for wxPHP to work better with the generated code of wxFormBuilder. __get Magic Method I have introduced the code generation of the magic method __get for wxWidgets classes that contain public or private properties. So for example, wxPoint has x and y as properties one could do: $point = new wxPoint(5, 10); print $point.x . ":" . $point.y; output: 5:10 Memory Management Also I have implemented correct handling of objects destruction since on the old code the destruction handler was declared, but not used resulting in a lot of memory leaks. Just deleting the pointer of the deleted objects resulted in a lot of segmentation faults since they ...

Commit of New Version

Today I commited the newest code based on wxWidgets 2.9.3 to the main trunk directory and created a tag of the old code based on wxWidgets 2.8.12 This new version binds about 471 classes including new additions to wxWidgets like wxRibbon. Also the new source maker generates code for global functions sow now about 100+ functions are binded. We have implemented a custom zend function to register global object variables so now we have constant access support for variables like wxNORMAL_FONT and others. Summarized list of new features Code generation for global functions Code generation for global object variables Automatic addition of needed header files to common.h Template system to write custom code for functions and class methods Better handling of virtual ...

Functions Code Generator

On the effort to improve the extension code generator readability I have started writing some code to generate the php function wrappers of wxWidgets global functions. The idea is to create some kind of template system that can be also applied to the generation of class methods. The file that serves as a template and the file that store the functions could be used as follows: $function_code = ""; foreach($defFunctions as $function_name=>$function_data) { ob_start(); include("templates/function.php"); $function_code .= ob_get_contents(); ob_end_clean(); } if($res =preg_match("/(.*?\/\/ functions --->)[^<]+(\/\/ <--- functions[^§]+)/sm",$data,$matches)) { $data = $matches[1] . "\n" . $function_code . $matches[2]; $hd = fopen("wxwidgets.cpp","w"); fwrite($hd,$data); fclose($hd); } The doxygen docs xml extractor was modified to obtain function information. By far I have only used wxMessageBox as a test case and the generated code is working pretty well. The generated code should take care of ...

Some code Refactoring

Extension Generator Finally I took the time to re-analyze the generator and started some refactoring, since the current code has many obscure variable names making it harder to understand and update. Also I'm cleaning the traits of old code that isn't used anymore as I have seen by studying the source. Thanks to this and some research of the sparse documentation available to develop PHP extensions my understanding is becoming much clearer. Other minor change but important was to the config.m4 file, so that passing the DIR (--with-wxwidgets=[DIR]) where wxWidgets is installed really works, as added a new flag (--enable-wxwidgets-debug) to enable debugging code on wxPHP to help troubleshooting of wrong method calls and logical errors on the generated code. Doxygen XML ...

wxPHP on wxFormBuilder trunk

Just writing to let everyone know that the patch that adds php support on wxFormBuilder is already on the svn trunk, so the next official version of wxFormBuilder should arrive with wxPHP support :-D In another news, we have been really busy with work and as a consequence wxPHP development has slow down. Still our plans to use wxWidgets doxygen xml files to auto-generate the php extension are up and once theres some more free time development should re-initiate. For the meantime wxPHP supports most of the features of wxWidgets 2.8.12 so building an application with it isn't out of the scope. I'm even developing an accounting software with it and works great :) when I find the time I will create ...

Work in Progress...

Posting just to keep everyone informed about wxPHP progress. Since wxWidgets 2.9.x now uses doxygen as the main documentation platform, we are working on a new code generator that will use the xml output of doxygen in order to get all the classes information as enumerations and definitions. As you may have read on the docs gccxml was used previously in order to extract wxWidgets details to generate the php extension source code. But the output gccxml gave wasn't very precise and easy to parse. Actually wxWidgets has more than 700 classes and thousands of constants (motive for code generator) Some class interfaces aren't compiling with current code generator and some fixes are needed. Here is the first xml extractor written in ...

New Release v1.1!

Version 1.1 has been released. Check the download section for window builds. If you want to contribute a linux distro package contact us. The following is a brief of changes from svn log: August 2011 Change log: -revision 41: Added date to the footer of the reference generator, ASCII artwork to README file as new site address and brief introduction. -revision 40: The generated code now compiles on 64 bits and 32 bits platforms, also it compiles on windows except for a small change needed to the wxIcon constructor on frame.h line 1922. -revision 39: Some changes to the code generator to change long unsigned int declarations to size_t for crossplatform compatibility. Also changed instructions of gccxml to ...