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

Showing Source By URL in Firefox

A simple question popped up on IRC today: How to get Firefox to show the source of a webpage given by the URL instead of having to show the page and then selecting "View source". The solution is to use the view-source:-qualifier: view-source:http://en.wikipedia.org/wiki/ to see the HTML source for Wikipedia’s front page. The solution was presented over at Stuart Langridge’s blog where he also presents a simple bookmarklet for swapping source view on and off in the current window.

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.

New Times Ahead, Baby!

As the most observant people out there probably have noticed, I’ve given the site a little face lift to bring it into the next century (so bring it on, 2100!!!11). The illustration was done by the very talented Anette Heiberg – Children’s Book Illustrator – which also is the one single person that manages to live together with me. A neat little coincidence there!

Anyways, the new design is dark, but I’ve decided to use the inverse header for each post as it makes visually scanning the page with your eyes to find the items _very_ effective. I like it, so it stays.

Happy Happy Joy Joy!

Christer and His Quest For More Zend_Form-age

I finally found out why Christer had been so quiet all day: he’s obviously been writing the largest post seen in the history of blogs. His introduction to Translating Zend Form Error Messages is enormous and a giant of a beast, and will give a thorough introduction to the concept of using Zend_Translate together with Zend_Form to use resource files to present an user interface in several localized versions.

Solving UTF-8 Problems With Solr and Tomcat

Came across an issue with searching for UTF-8 characters in Solr today; the search worked just as it should (probably since we’re using a phonetic field to search), but our facets and limitations didn’t work as they should. This happened as soon as we had a value with an UTF-8 character (> 127 in ascii value), in our case the norwegian letters Æ, Ø or Å.

The solution was presented by Charlie Jackson at the Solr-user mailing list and is quite simply to add URIEncoding="UTF-8" to the appropriate connector in the Tomcat server.xml file. This is also documented on the Solr on Tomcat page in the Solr Wiki .