PHP 5.4: RegexIterator::getRegex()
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...
View ArticleUsing syslog for your php applications
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...
View ArticleTalking 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...
View ArticleCreating MCollective clients in PHP – The hard way
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...
View ArticleSPL: Using the iteratorAggregate interface
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...
View ArticlePHPShout : 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...
View ArticlePHPShout : a shoutcast streamer in PHP: Part 2
In the last post, we created a template extension for our shout class. Next up, we need to do the actual implementation. Part 3: create initial functionality. Let’s take a look at the source from this...
View ArticleSymfony2: Implementing ACL rules in your Data Fixtures
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...
View ArticleCustom symfony2 config loader
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...
View ArticlePHP5.5: Try/Catch/Finally
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...
View ArticlePHP’s Resources and garbage collection
Today, I’ve found a nice bug/feature/whatsmathing in PHP. I was playing around with writing a daemon and if you have any experience writing daemons (in any language), there are a few rules you have to...
View ArticleDynamic form modification in Symfony2
Sometimes (or actually, a lot of the time), handling forms will go beyond the basics. And even though symfony2 gives you out-of-the-box a really clean way of creating forms, it sometimes just isn’t...
View ArticleThrottle your API calls: RateLimitBundle
A web application is not complete without an API nowadays. APIs allow third parties – or just end users – to use the data from the platform for whatever they want. But by allowing applications to make...
View ArticleInternal PHP function usage: revisited
A small update on the blogpost about PHP’s internal function usages: https://www.adayinthelifeof.nl/2014/07/25/internal-php-function-usage/ A lot of people are asking about functions like isset, empty,...
View ArticleSymfony2: logging out
One of the “golden rules” of symfony2 is to never hardcode urls or paths inside your code or templates. And letting symfony deal with the generation of your urls and paths makes your life a lot easier...
View ArticleDeepdive into the symfony2 security component: part 1
Once in a while I like diving into code and see how things work under the hood. And as the symfony2 framework consists of many different components, bundles and bridges, there is a lot to discover. But...
View ArticleAdvanced user switching
A really neat trick in the Symfony Security component is the fact that you can impersonate or “switch” users. This allows you to login as another user, without supplying their password. Suppose a...
View ArticleUnderstanding Symfony2 Forms
To actually use Symfony2 forms, all you need to do is read some documentation, a few blog posts and you’ll be up and running in a couple of minutes. Understanding Symfony2 forms however, is a whole...
View ArticleIncrementing values in PHP
Incrementing values in PHP Take a variable, increment it with 1. That sounds like a simple enough job right? Well.. from a PHP developer point of view that might seem the case, but is it really? There...
View Article
More Pages to Explore .....