PHP

PHP5.5: Try/Catch/Finally

February 12, 2013
By

Exception handling is available in PHP since version 5.  It allows you to have a more fine-grained control over code when things go wrong ie, when exceptions occur. But since PHP 5.5, exception handling has finally evolved into what it should have been from the beginning: the “finally” part has been implemented. Let’s start with…

Read more »

Custom symfony2 config loader

January 30, 2013
By
symfony_black_05

It happens more and more: large projects where your symfony2 site is just a small part in the big picture. Lots of additional components might even play a bigger part, especially when you are dealing with asynchronous components  which are connected through message queues for instance. So the question is: we want to make sure…

Read more »

@MultiParamConverter for Symfony2

August 4, 2012
By

If you know Symfony2, you probably are using (or at least, have heard of) the @paramConverter annotation from the SensioFrameworkExtraBundle. This is a really simple way to convert slugs into entities. But lots of times I find myself having multiple slugs inside my routes, and this is something the @paramConverter annotation cannot do. So that’s why…

Read more »

Symfony2: Implementing ACL rules in your Data Fixtures

July 4, 2012
By

Doctrine’s DataFixtures are a great way to add test data to your application. It’s fairly easy to get this going: Create a fixureLoader that extends Doctrine\Common\DataFixtures\AbstractFixture, had a load() method and off you go. However, sometimes you want your data also to be protected by Symfony 2′s ACL layer. Since there isn’t a common way to do this,…

Read more »

SPL: Using the iteratorAggregate interface

December 4, 2011
By

The SPL is one of hardest things to grasp for most PHP developers. But why is this? The lack of documentation inside the manual, the fact that there are not many real-life examples, or maybe it’s just too hard? In this post I will try to explain a bit more about the “iteratorAggregate” interface. Together…

Read more »

Public key encryption on php|architect

March 1, 2011
By

Yesterday the February edition of php|architect came out. I always look forward upon the new release every month, but even more so this month since it features an article about “Public Key Encryption” I’ve written for php|a. It’s more or less a written version of my public key authentication 101 talk and consists of not…

Read more »

Talking at the PHP Benelux 2011

January 23, 2011
By
Talking at the PHP Benelux 2011

As you might know, the PHPBenelux Conference 2011 is right around the corner. Happy to inform you that not only will I attend, but also will be speaking at this event. My talk will be about the awesome things you can do with Sed & Awk. Not necessarily a talk you would expect on a…

Read more »

Using syslog for your php applications

January 12, 2011
By

Linux, and other unices have an excellent system to centralize log events. This is done through syslog. This system removes the need for every application to maintain their own log files and let the syslog server handle all the events. Depending on the type of event that is logged, it can take additional action like…

Read more »

PHP 5.4: RegexIterator::getRegex()

January 6, 2011
By

Recently, my colleague Jeroen van Dijk needed to extend (or better yet: override) the accept() method for the RegexIterator. Turns out this wasn’t as easy as it might sound in practice. So after extending and overriding multiple methods he found an acceptable solution. But there is room for improvement. And starting from PHP 5.4, this…

Read more »

Enrise: Appending the appenditerator

December 26, 2010
By

I’ve posted a blog at the @enrise techblog about enhancing SPL’s appenditerator. This lovely iterator can be useful from time to time but it does not always do what you need. Here’s how you can easily create your own iterator: http://www.enrise.com/2010/12/appending-the-appenditerator/ At Enrise, we decided to start blogging more about our projects, the techniques we…

Read more »