Archive for February, 2009

Creating a simple abstract model to reduce boilerplate code

Saturday, February 28th, 2009

In a usual scenario involving models in PHP, you will have some repeating things: You will usually need getters and setters for the model's properties, you will need to be able to construct the model from an SQL query or such, and you'll also need to write SQL queries for ...

Ajax, high latency and user experience

Thursday, February 26th, 2009

Most of us probably have used at least one website which bases some major functionality on Ajax. But have you ever used a such site, done something, then moved on to another page, only to come back later to realize what you just did was never saved? What happens to XMLHttpRequests ...

Looking back: Best of 2007

Tuesday, February 24th, 2009

I've been blogging over 2 years already. In 2007, I was blogging at my.opera, and later that year moved to this site. Let's take a look at some of the best posts of 2007!

Closures coming in PHP 5.3 and that’s a Good Thing

Friday, February 20th, 2009

PHP 5.3 will be introducing closures to PHP. Closures, also known as anonymous functions, will allow you to declare functions "inline" and store them in variables. While the syntax may seem a bit weird compared to how it is in languages like JavaScript, closures will be a useful addition to ...

Zend_Acl part 3: creating and storing dynamic ACLs

Wednesday, February 18th, 2009

In this third post of the series, I'll talk about using dynamic ACLs: How to store an ACL in a database, and construct it from there when needed. This post builds on the things introduced in part 1 and part 2. We will first look at a simple example with users ...

Practical uses for reflection

Monday, February 16th, 2009

You may have heard about the reflection feature in PHP. Simply put, it's a way to get a list of methods in a class, a methods parameters, or other "internal" things like that. But how is this actually useful for any common task in application development?

Functional programming and Haskell

Friday, February 13th, 2009

I've been learning some Haskell for fun. Haskell is a functional language, so it's quite different from other languages I know like PHP or C#. One of the main "ideas" of functional programming is immutability - in other words, you can't change the value of a variable after you've defined ...

Zend_Acl part 2: different roles and resources, more on access

Wednesday, February 11th, 2009

First a quick announcement: please let me know if the blog seems slow/sluggish. I have been experiencing some slowness, and I recently installed WP Super Cache which seems to have helped, but let me know if you encounter anything! Now, the post: This time, we'll look at Zend_Acl a bit deeper ...

Asus Eee PC 901

Monday, February 9th, 2009

I recently bought myself an Asus Eee PC 901 netbook, with Linux preinstalled. It's a fine piece of machinery, and here are some thoughts on its hardware, software and how it worked together with my other devices, which are mainly Windows based.

Zend_Acl part 1: Misconceptions and simple ACLs

Friday, February 6th, 2009

I'm going to be writing a weekly series of posts on Zend_Acl. This first post will clear up some common misconceptions regarding Zend_Acl, introduce creating ACLs for simple applications, and give some examples on using the ACL in both non-Zend Framework and Zend Framework applications. Later in the post series I'll ...