The Norwegian PHP TestFest is Done!

Just got back from Oslo after The Norwegian PHP TestFest. We were a total of seven people and Hannes Magnusson (hm, familiar title for that blog: We don’t either.) held an introduction to how to write .phpt tests. I had read a bit about the stuff previously and written at test or two, but I finally got some time to play around with the run-tests.php-script and other small tidbits.

I think everyone had a good time, and according to Flyspray for the PHP TestFest, we managed to write a total of 13 tests. The two tests for similar_text() and the two tests for using sqlite as a session save handler were the product of yours truly. I’ll try to contribute more in the future, I’ll just have to get gcov and a few other tidbits up and running here first.

In regards to writing phpt tests for the session module; anyone have a good idea how to force the garbage collector of a session save handler to be run? I’ve tried both using session.gc_divisor 1 and session.gc_maxlifetime 1 (and then sleep(2)), but didn’t get things working. Any suggestions would be appreciated.

Short Array Syntax for PHP

En route from the aggregated stream of Planet PHP comes a small post from Brian Moon about Stan’s suggestion for introducing the [] syntax for creating lists in PHP.

I like Python. This is like Python. By association, I like this. This would mean that you now could do:

$a = [1, 2, 3];

instead of $a = array(1,2,3); and:

$a = [‘one’ => 1, ‘two’ => 2]

instead of $a = array(‘one’ => 1, ‘two’ => 2);

Syntactial sugar, but still, sweet sugar.

If we just could get [:]-syntax for slicing and dicing too now..

The First Presentations From php|tek Online

php|tek is taking place halfway around half of the world for me, but the first presentations from the conference is beginning to appear online now. The first three presentations are from Brian DeShong and Maggie Nelson:

While Brians two presentations were mostly familiar stuff for me, Maggie’s presentation touched something that has troubled me time over and again, and that Christer and me has been looking for a good solution to. We’re currently experiencing the problems described, and I’ve been searching several times for a good tool to generate sqldiffs (and not for the _values_ of most of the tables). I’m waiting eagerly for the first release, and as soon as things are up and running, I’ll look into if there’s anything I can contribute.

Memcache Stats

Harun Yayli has a post up about a PHP application for retrieving and presenting memcache stats from several servers. The interface is built on the familiar apc.php which is included with APC (Alternative PHP Cache, a PHP bytecode / shared memory storage cache), and should be easy to navigate for anyone who have used apc.php. The stats shown in the application includes total space available, memcache usage, hits, misses, uptime and other interesting information.

Norwegian PHP TestFest

The Norwegian PHP User Group, PHPNorge, is hosting a Norwegian PHP TestFest in two weeks time, at the 29th of May. Haven’t mentioned it to Christer yet as he’s leaving for New York tomorrow morning (and then connecting to Chicago for php|tek). I’m going to the TestFest at the 29th unless something special shows up, and I ask anyone available in the area to join in to make a contribution. See you there!

PHP Norge Meeting Tomorrow (15. May 2008)

There’s a member meet in PHP Norge (the norwegian PHP user group) coming up tomorrow, but seems like I’m not going to make it this time either. Suddenly got a meeting in Fredrikstad that might run late, and Christer is leaving for New York on friday, so he’s not attending either. Too bad, but hopefully all the other guys will have a great time. We’re still on for PHP Vikinger, so I guess we’ll meet there.

All other PHP users in the area are of course encouraged to visit!

Yahoo!, SearchMonkey and Microformats

Both Rasmus and Sara has posts up about a new feature of Yahoo! Search which actually seems to be a step forward in terms of search engine functionality. This will make it possible for 3rd party developers to actually run code on Yahoo!’s servers to enhance their search result for your own page.

The first examples shows how they’ve used Microformats to give a better presentation of businesses available. I’ve previously implemented the hCard microformat at Derdubor, where we have a local directory search for businesses in Norway. All our search hits and profile pages are tagged up in microformats, so that a compliant parser are able to fetch business information and provide it to our users in a proper way. It’s simply great to see Yahoo! add this kind of support for new formats, and I’m already looking forward to playing with it to give better results for pwned.no and a few other projects I’m playing around with.

Christer Goes Bug Hunting

Christer had the pleasure of hunting down a bug in Zend Framework a couple of days ago, and he has just posted a nice article about the bug in Zend MVC Components and how he debugged it. If you’ve never used a debugger before, this article is probably also going to be a bit helpful, and it gives a little insight into how the Zend Framework MVC-components work.

David Cummins on Fulltext Search as a Webservice

David Cummins has a neat little post up about replicating some of Solr’s features in a PHP based solution. His post “Fulltext search as a webservice” should sound familiar to Solr’s approach from the title, and David describes how they built a similiar solution on top of Zend_Search_Lucene (Solr also uses Lucene in the backend). Seems like it would be easier to just set up a dedicated Solr cluster instead, but hey, how often has “it would be easier to do something else” sparked innovation?

I’d also like to note that the coming Solr 1.3 supports php serialization as an output format, so you can just unserialize() the response from Solr. Should provide for even easier integration between PHP and Solr in the future. While on the subject, I’d like to suggest reading Stemming in Zend_Search_Lucene too, an introduction to adding filters to Zend_Search_Lucene. Also worth a look is the Search Tools in PHP presentation from phplondon.

Web Frontends for Xdebug

David Coallier has a post up about a Google Summer of Code project that has been launched to finally get a web frontend for Xdebug, something many people have been requesting for quite some time. Simultaneously Webgrind has been released, another web based frontend that replicates some of the features from kcachegrind in a web based fashion. Here we go several years without a decent front end, and then two gets announced in the same week. Neat! You can check out Webgrind at their Google Code page.