Posts Tagged ‘ 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 »

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 »

PHPShout : a shoutcast streamer in PHP: Part 2

March 24, 2012
By

In the last post, we created a template extension for our shout class. Next up, we need to do the actual implementation.

Read more »

PHPShout : a shoutcast streamer in PHP: Part 1

March 24, 2012
By
PHPShout : a shoutcast streamer in PHP:  Part 1

To continue our journey in pointless, but nevertheless fun things to create, I’ve created a simple PHP extension that allows you stream music data to an IceCast server in pure PHP. For this I’m using the libshout3 library which can stream both MP3 or OGG/Vorbis data to multiple stream servers (including IceCast, ShoutCast etc). In…

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 »

Creating MCollective clients in PHP – The hard way

October 1, 2011
By

If you haven’t heard of MCollective, think of.. The Borg.. Except without the laser-eye, or the spaceship-cube, or the scary voices. Come to think of it,.. it doesn’t really have anything to do with the Borg, except they are both a collective, and you are in charge.. just like the Borg-queen. And everything else is…

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 »