PHP 5.2.6 Released!

Ilia just noted that PHP 5.2.6 was released yesterday! Lucky for me, as I have been away for a couple of days at a trackday in Sweden (pictures coming to my flickr page within the night). Among notable fixes are added metadata for the reflection API in the DOM classes and a few PDO-fixes for PostgreSQL. Several security vulernabilities were also fixed, and a complete list can be seen in the PHP 5.2.6 Changelog.

Moving to WordPress from Serendipity (s9y)

Oh well, I spent the last evening moving my blog from Serendipity (s9y) over to WordPress. The reason for this is that after Christer and I talked a bit, we discovered that something wasn’t working as it should with the trackbacks and pingbacks. As every good programmer does, I headed into the source instead of reading anything sensible about the subject, and well.. I wasn’t really impressed. As s9y is still catering to those who need PHP4 support, the code was a mess of functions here and functions there and no real separation, including Global variables and other messy things. WordPress isn’t much better in the “silly amount of functions” area, but I’ll leave that for the next blogpost or two about WordPress issues that’s getting on my nerves.

Anyways, after seeing their XML-RPC implementation .. which was a couple of large preg_match statements trying to look for the XML-RPC request, I called it a day and decided this wasn’t fixable to bring it up to my need. I’d very much like to patch it up and submit my own XML-RPC server for them to use, but it’s based on PHP5 and the reflection API, so no go there. All that frustration ended in installing wordpress yet again, so here we are, after spending the night of getting everything up to speed and looking like it was again. I’ll create a post later for those who want to take the same route, and I’ll include the RewriteRules to make all your old links still work in WordPress.

Marco’s Five PHP5 Features You Can’t Ignore

Marco has a neat list up with five different features about PHP5 which people are still not quite catching on to , and I agree with every single item that made it to the list. I’ve been using SimpleXML myself, and except for a few cryptic issues regarding namespaces and iterators (SimpleXML does quite a bit of magic..) it’s a breeze to work with. For simple .. XML .. parsing, it’s ingenious.

For PDO, we’ve already moved all our projects to PDO, and it’s been my preferred method of accessing databases for at least a year and a half already. Great stuff. We’ve also used the json module for quite some time, which neatly ties into jQuery , mootools and other JavaScript APIs. I still haven’t used SPL that much, but that might change soon. Anyways, a good read for anyone who still live in the PHP4 world..

Mikko Posts About Imagick in PHP and Fill Patterns

Mikko is quite active with the development of the Imagick-extension in PHP, possibly the best thing to hit PHP since it’s birth over ten years ago. There’s nothing like the Imagick-extension to make you realize how much you’ve been missing from the GD extension (kindly reworded for Pierre) :-) Anyways: Mikko has a new post up about how to use an image as a fill pattern in Imagick under PHP . Well worth a read!

You should also check out all the other interesting Imagick related posts Mikko has made.

Christer Puts on His Problem Solver Hat

I’m not sure how much sugar Christer got into his system today, but he’s been completely on fire with his blog posts. This one shows how to write a custom Zend_Form_Decorator_Label , which he wrote after someone asked a question about how to do something in particular on the Zend MVC mail list. That guy is amazing.

XRPC_Server – A PHP XML-RPC Server Class

XRPC_Server is a simple as possible XML-RPC server component I wrote for a project a year or two ago, and is a good alternative if you want to try to stay away from large frameworks or complex components. The component is license under the MIT License, so you’re pretty much free to do whatever you want with it. All patches are welcome! The server requires PHP5 and reflection enabled.

Usage is as simple as requiring the php-file into your "gateway" page (the URL you’ll be calling from your XML-RPC clients), and then creating the server object with the functions you want to expose as the argument to the constructor:

$server = new XRPC_Server(array(
    'multiply' => 'test_xmlrpc_multiply',
    'dateTest' => 'test_xmlrpc_date_test',
    'assoc' => 'test_xmlrpc_assoc',
    'array' => 'test_xmlrpc_array',
));

A simple file illustrating the usage is also included, XRPC_Server_Test.php.

You can see the source code of the server at XRPC_Server.phps .

The class can be downloaded from this site: XRPC_Server.tar.bz2

Using Objects with Zend_View’s PartialLoop Helper

Christer has obviously been having a good day today too, as he’s actually made yet ANOTHER blog post about something related to Zend Framework: Using Objects with Zend_View’s PartialLoop Helper. This time he’s examining why some methods suddenly has disappeared in his PartialLoop. I’m a bit surprised his father hasn’t helped him with his view scripts, tho. It’s probably just something he’s saying to don’t appear too incompetent.