It's Almost 2014 and We Are Still Committing Broken Code
Dispite testcases, syntax errors still find their way into our commits. - Maybe it was a change in that bash script that wasn't covered by tests. Too bad our deploys relied on it....
A collection of 33 posts
Dispite testcases, syntax errors still find their way into our commits. - Maybe it was a change in that bash script that wasn't covered by tests. Too bad our deploys relied on it....
In loosely typed languages such as JavaScript or PHP, using == to compare values is bad practice because it doesn't account for type, hence false == 0 == '' == null == undefined, e...
PHP's strrev is not safe to use on utf-8 strings because it reverses a string one byte at a time. So if a character consists of multiple bytes it cannot be preserved as an entity i...
> "Simplicity is prerequisite for reliability." Edsger W. Dijkstra As our experience grows, we learn from past mistakes and discover what's truely important in relia...
This article in 50 words: I used to prefer spaces vs tabs, now I don't care so much, think it's more important that you can easily switch on a per-project basis. Have some thoughts...
When I started this techblog in 2007 and got my first 500 real visitors, I was in the clouds. If you told me then I'd hit the 5,000,000 visitor milestone 3 years later, I would hav...
Here the notes I took during the Dutch PHP conference 2010 (#dpc10). They're not a representative summary of the event's highlights cause I could only attend 1 of 4 talks at any gi...
Don't know Redis? Think Memcache, with support for for lists, and disk-based storage. You can use Redis as a database, queue, cache server or all of those combined. Let's see how y...
I still got sites running Apache, but all new projects are launched with Nginx. I don't need many of the features that Apache offers, and the speed gain of Nginx is just tremendous...
At our company we have a lot of uses for a solid API. We can use it to distribute config files, have servers report in, let customers edit DNS records using their own interface, et...
The core of our new project runs on Node.js. With Node you can write very fast JavaScript programs serverside. It's pretty easy to install Node, code your program, and run it. But...
Hi. Have you met KvzHTML? It's a standalone PHP Class for generating HTML. It's been hiding deep inside the caverns of my secret GitHub repo: kvzlib - a collection of code snippe...
PHP 5.3 is a big leap forward for PHP and brings of a lot of neat features. However, big leaps can also mean big changes and potentially big breakage when it comes to backwards com...
Looking back at a great CakeFest in Berlin, I learned a lot about CakePHP and met many nice and inspiring people. Here are some conference notes I took that where particularly usef...
IDs are often numbers. Unfortunately there are only 10 digits to work with, so if you have a lot of records, IDs tend to get very lengthy. For computers that's OK. But human beings...
Sometimes MySQL needs to work hard. I've been working on an import script that fires a lot of INSERTs. Normally our database server handles 1,000 inserts / sec. That wasn't enough....
Sorry folks, this article was based on flawed benchmark results, I will soon post an update!
If you've written a PEAR package, it's probably a good idea to submit some end user documentation. Here's how to do it.
So I've been learning CakePHP the last few days. Bit by bit I've been trying to port a lecagy admininistration app to Cake. 'Secretly' linking menuitems to finished Cake parts as w...
Everyone knows PHP can be used to create websites. But it can also be used to create desktop applications and commandline tools. And now with a class called System_Daemon, you can...
In another article I've told you about how I would like to see one rule removed from the PEAR Coding Standards. This rule would allow developers a bit more flexibility, while stayi...
Working with trees When working with tree data structures you often need to craft them in different ways. PHP offers a lot of functions to change the shape of arrays, but often th...
Working With Trees When working with tree data structures you often need to craft them in different ways. PHP offers a lot of functions to change the shape of arrays, but often th...
Since a couple of months now, I've been involved with PEAR as a contributor. Contributing to PEAR means adhering to the PEAR Coding Standards. Their standards have actually been th...
In PHP, sessions can keep track of authenticated in users. They are an essential building block in today's websites with big communities and a lot of user activity. Without session...
I tried to do some Image Magick with PHP recently on an Ubuntu Feisty machine, and even though I had the required package: 'php5-imagick' installed, and I updated my php.ini with i...
Or: How to convert multipage TIFF to PDF in PHP.
I recently faced a programming challenge that almost broke my brain. I needed to create a function that could explode any single-dimensional array into a full blown tree structure,...
Recently two of my articles reached the Digg frontpage at the same day. My web server isn't state of the art and it had to handle gigantic amounts of traffic. But still it served p...
Every time a request hits your server, PHP has to do a lot of processing, all of your code has to be compiled & executed for every single visit. Even though the outcome of all...
Not everyone knows about PHP's capabilities of making SSH connections and executing remote commands, but it can be very useful. I've been using it a lot in PHP CLI applications tha...
You want your website to be as safe as possible. So you'll typically want Open Basedir and Safe Mode to be on. When you're in a shared hosting environment, you'll find that any ser...
I ran accross php value, php flag, php admin value and php admin flag in a couple of .htaccess files, and I've used them sometimes as well by just pasting an example, but I've neve...