Explicit PHP6?

Some days ago I read Fabien Potencier’s post ‘What for PHP 6’ pointing me to some features that might be implemented in PHP6. Two of those would have been nice in a project I’m currently working on where I’ve been experimenting with ‘domain objects’ having ‘scalar’ or ‘value’ objects as properties (more on that later). The first is scalar type hinting and hinted return values. The other is a __cast() method that replaces (or complements __toString()). Now that sounds quite java-ish and one of PHP merits is it’s flexibility but having the option to be more strict in my opinion is a good thing: If I feed my application with garbage I don’t blame it for being equally blunt.

Keep reading

Zend_Test, Zend_Layout and the need to reset

In a recent Zend Framework project I’ve used Zend_Test to test the functioning of the website ‘as a whole’. So besides testing the separate (authorization) components, the website was tested in the same way a visitor would use it. This is especially useful for testing login scenarios, so I added the test below:

public function testLogoutShouldDenyAccess()
{
    $this->login();

         // verify that profile page now doesn't contain login form
    $this->dispatch('/profile');
    $this->assertQueryCount('form#login', 0);

        // dispatch logout page
    $this->dispatch('/login/logout');

        // verify that profile now holds login form
    $this->dispatch('/profile');
    $this->assertQueryCount('form#login', 1);
    $this->assertNotController('profile');
}

This failed on the last assertQueryCount() which left me puzzled. Performing above steps manually seemed to work fine so I was overlooking something either in my app-code or the test-code.

Keep reading

Installing PHPUnit on XAMPP Lite (Windows)

At my work PHPUnit is ‘just there’ but it’s not on my home machine where I’m running an out of the box XAMPP Lite setup. So I visited the PHPUnit installation manual and all looked easy:

pear channel-discover pear.phpunit.de
pear install phpunit/PHPUnit

But what I got was a message saying my pear installer was out of date, 1.7.1 was needed. Running ‘pear -V’ showed:

E:\Xampplite\php>pear -V
PEAR Version: 1.4.5
PHP Version: 5.2.5
Zend Engine Version: 2.2.0
Running on: Windows NT T1720 6.0 build 6000

Allright, upgrading PEAR it is. That was not as straightforward as hoped.

Keep reading

Fixing Netbeans after Ubuntu 9 upgrade

This morning I upgraded my Ubuntu machine using the auto-update. As I just recently started using Ubuntu I’m very pleased at how some features work compared to Vista. (Vista users will probably be familiar with the auto-update restart that has a terrific feel for timing by always presenting you the choice for postponing the restart when you have several documents opened and are away for a coffee break.) After my self initiated restart everything worked like a charm, OpenOffice is updated to version 3 (nice for the docx workflow) but… Netbeans didn’t start.…

Keep reading

Annoying banners: A plea for quality

Banners play an essential role in many site’s business models so they are an inevitable price paid for all the free content that is available on the internet. To get a user’s attention a lot of practices are employed like animation, placement or sound (horrible). Today I stumbled on a T-mobile advert on the site nu.nl that indeed attracts a lot of attention but does so in a questionable way: It makes using the visited site almost impossible.…

Keep reading

Dutch PHP Conference 2009

Today I ordered my ticket for Dutch PHP Conference. Last year’s edition was great and this year it’s twice as long. This year I’ll skip the tutorial day though. For me the money is better spent on reading material. Anyone interested in going can save some money by registering before April 30th. My ‘usability and PHP’ paper didn’t make it but on the less PHP focused topics there is accessibility. And a lot of other interesting topics.…

Keep reading

Linux-Fu @ phpGG

Last night there was a phpGG (dutch php user group) meeting in Utrecht with a presentation by Lorna Jane titled ‘Linux-Fu’. Attended by about 10 people, console basics � tricks were addressed. I’m not unfamiliar with Linux so the basics weren’t that new. For development I mainly use IDE’s so I just use the console to edit the occasional config file, create some symlinks, that kind of stuff. For those tasks I find myself sticking to set of commands I’ve learned and just occasionally taking the time to do an in-depth google search for better ways to get the job done.…

Keep reading

Jumping in and out of jQuery land

Recently I started using jQuery in some projects. In past projects I have mainly been using Prototype and the fact that jQuery also has a $() function made me feel at home right away. That same fact put me a bit off-guard as both functions are in fact quite different: Prototype extends the selected HTML node with added functionality and returns it. Argument should be a HTML node or element id.…

Keep reading

Internet Explorer 8

Yesterday Internet Explorer 8 is released. I consider that a good things as it will move more people farther away from the severe case of release abuse called IE6. Improvements include integrated developer tools for css analysis and script profiling and debugging. And there is ‘Compatibility View’. Developers can specify, by adding a specific meta tag, that IE7 rendering should be used. There seem to be some tricky aspects related to Compatibility View:…

Keep reading

Fronteers: Meeting march 10th

At the PHPgg Frontend Special I first heard of Fronteers, an association of dutch front-end developers. Past tuesday they had a meeting at Media College in Amsterdam. As meetings are open for non(yet)-members it was a nice opportunity to get to know more about Fronteers. Two topics were scheduled: jQuery and SUAVE. jQuery Until now I have mainly used the Prototype framework for Javascript projects. As the prototype library, escpecially when bundled with scriptaculous, is quite ‘big’ I was interested in hearing some more about the ‘lean and mean’ jQuery.…

Keep reading