| « Debian 4.0.r4a etchnhalf amd64 - Prima intalnire de la 0 la server cu Debian | Toata lumea are un CMS ! » |
Link: http://pecl.php.net/package/runkit
runkit is a PHP Extension that offers you the posibility to replace, rename and remove functions and classes.
This extension is indeed as they say in the summary: For all those things you.... probably shouldn't have been doing anyway..... But it is also very handy.
The problem
- It is installing ok on PHP 5.1 but not on PHP 5.2 ... god only knows what will happen in 5.3.
Follow up:
For PHP 5.1
[root@radical ~]$ pecl install runkit
Failed to download pecl/runkit within preferred state "stable", latest release is version 0.9, stability "beta", use "channel://pecl.php.net/runkit-0.9" to install
Cannot initialize 'runkit', invalid or missing package file
Package "runkit" is not valid
install failed
Oh well... this is mainly a warning that the extension was not declared "stable" but only "beta" it has been in beta from 2006-06-06. Waaaay to long...
[root@radical ~]$ pecl install channel://pecl.php.net/runkit-0.9
That's about it for PHP 5.1.
For PHP 5.2
Note that in CVS the patch has already been applied.
You will need to download the package, extract, apply a patch then pack it back and run it again. So here we go.
[root@radical ~]$pecl download channel://pecl.php.net/runkit-0.9
Extract the files.
The file that needs a patch is "runkit_import.c". I always make a copy.
[root@radical ~]$cp runkit_import.c runkit_import.c.initial
The patch is simple.
- zend_unmangle_property_name(key, &cname, &pname);
+ zend_unmangle_property_name(key, key_len - 1, &cname, &pname);
As you see there is only one extra argument that you need to add for zend_unmangle_property_name.
The patch is from Bug #10174 Wont build against 5.2.1.
Now to continue using pecl. You will need to repackage the extension.
[root@radical ~]$tar -czpf runkit-0.9.patch-5.2.tgz -C runkit-0.9.patch-5.2 .
[root@radical ~]$pecl install runkit-0.9.patch-5.2.tgz
This is it. For me it worked fine even on a Fedora 6 version and a Debian.
Enjoy.
Trackback address for this post
Trackback URL (right click and copy shortcut/link location)
The forbidden fruit
I recently discovered runkit for PHP and thought it could be a solution for a few problems I ran into during my work on various projects.
At heart runkit allows you do to stuff with PHP you shouldn’t, but eventually want to, d...
I've discovered your tutorial and recently stumbled across runkit. I still have the feel it's beta. Do you use it on production systems? Do you feel safe doing so? I'm just curious.
I have it in production but the systems are isolated using OpenVZ containers.
best regards,
Sebastian