Introduction - flaupretre/php-ext-gen GitHub Wiki

php-ext-gen is a PHP extension generator.

It takes a set of files containing a synthetic description of an extension, as well as C code blocks to insert, and combines this into a ready-to-compile PHP extension directory.

The objective is that the developer concentrates on value-added development, not the hundreds of lines which are similar in every PHP extensions and can be generated automatically.

Working from a synthetic description also has several benefits : it is much more readable, easier to maintain, and the generated code does not require maintenance.

Another benefit is the possibility to generate C code for different PHP flavors and versions. php-ext-gen generated code is adapted to a specific engine and version. This allows to reduce the amount of #ifdef to include in your code to keep it compatible with different engines. It also greatly reduces the time needed to debug your code on different engines.

A set of compatibility macros are provided. Developers should always use them in their code, as they are guaranteed to work on every supported PHP engine and version. This abstraction layer will be extended in the future to maximize code portability.

The only generator available today is for PHP 5.x. The next ones will be for PHP 7 and HHVM.