code snippet

Lorna Mitchell's Blog: Locale-Sensitive Dates in PHP

PHPDeveloper.org  Wed, 11/05/2008 - 08:48

Lorna Mitchell shares a quick code snippet she's worked up to make handling local-sensitive dates in PHP a bit easier (via the strftime function).


 

Creating custom PHPUnit assertions - Raphael Stolt

Planet PHP  Mon, 07/28/2008 - 12:02

While developing PHP applications and applying developer testing the applications safety net will grow along the timeline, and as normal code, test code should be in a fresh, odour free state too.

A common test code smell, amongst others, is the duplication of assertion logic which can reduce reusability, readability and thereby obscure the specific verification intention of tests.

To subdue this special smell several patterns and refactorings are available to acquaint the test code with the DRY principle.


 

Encoding issue with XMLHttpRequest and Firefox 3 - Christian Sto...

Planet PHP  Wed, 06/25/2008 - 04:41

In Firefox 3.0.0 there is a "strange" regression issue regarding the encoding of XMLHttpRequest requests.

It's not a bug per se, it's just different behavior, which we ran into (and no other browser does it this way)

What we basically do on the client side in JavaScript:

this.data = new XMLHttpRequest(); this.data.open('POST', dataURI); this.data.send(xml);

where "xml" is a DOMDocument Object.

In Firefox 2.0 this request came with a


 

ThinkPHP Blog: Put out the age of a date in words

PHPDeveloper.org  Fri, 04/11/2008 - 10:37

On the ThinkPHP blog today, Annika Rabea shares a method for outputting dates in words rather than in the usual numbers most applications use.