[wp-hackers] WordPress PHP Extension (just information, no actual extension yet)

Jacob Santos wordpress at santosj.name
Sat Mar 8 23:27:08 GMT 2008

I put some four hours into trying to find a solution. The code I thought 
I had written, doesn't appear to be available (and it was very good 
too). Also, after some thought, it also makes sense that in order to 
compile PHP files, you would have to have the PHP files somewhere other 
than the /ext location.

This means you need a process which will move the PHP files into the PHP 
installation for which you can use zend_execute_scripts() to process the 
files. You can use PEAR, if you want to provide a solution. However, on 
some hosts, the include path does not include the PEAR directory. On 
some hosts, they do not allow access to installing PEAR packages or to 
PEAR directory itself.

While thinking about it. I am again of the mind that it would just be 
easier to convert the code to C. The problem with this, even if there 
are a lot of 1:1 relationships between C and PHP. If you deal with only 
PHP/Zend variable structures, then it does become a great deal easier. 
The only other problem then, is that you would have to go through each 
commit from when last library was created and fix all of the bugs that 
were ported over, as well as any bugs which exist in the PHP Extension.

This process of itself is pretty difficult and time consuming, because 
of the fast pace of the WordPress development. You could also do like 
the ADODB library and a CMS, just port the least optimized code over to 
an extension and then if that extension exists, call those functions 
instead in the PHP code.

This is all I have at the moment. The prospect of spending 8 hours 
trying to create a PEAR package and testing it does not seem worth my 
time. However, I just wanted to plug the information, in case anyone 
else wanted to either know or wanted to provide the solution. It will 
fall into performance and probably could only be used by those who are 
on dedicated servers or on hosts which allow access to both PEAR and 
allow you to compile PHP yourself.

PS: You will have to use zend_execute_scripts() [1] to load PHP files in 
a C/C++ PHP extension.



Jacob Santos

http://www.santosj.name - blog
http://funcdoc.wordpress.com - WordPress Documentation Blog/Guide Licensed under GPLv2

Also known as darkdragon and santosj on WP trac.

More information about the wp-hackers mailing list