Test emails with Symfony

Symfony 4 brought us the awesome Mailer Component. Something that you may not know about it, is how to test if an email has been sent. This is something not well known, but actually easy! Let's see together how to do it with PHPUnit, but also with Behat - since…

How to get the real PHP memory usage on macOS

PHP provides the function memory_get_usage(), this is very helpful whenever you find your code using a lot of RAM. But this method has a significant limitation: it only counts memory used by your code directly and nothing out of the zend engine. The problem is that you may…

Debunking btrfs

btrfs means no evil! btrfs is awesome! A few weeks ago I listened to one of the Linux Unplugged podcasts about btrfs. It was a reminder that btrfs is great. I have been using btrfs for a few months now, so here is my comment. For those who aren't familiar…

Simple strategy pattern with Symfony

The strategy pattern is a very easy implementation with the DIC from Symfony. Here is how: First let's define an interface for our strategies: namespace App\Domain\CustomProcess; interface MyStrategyInterface { public function execute(Whatever $input); public function supports(Whatever $input); } Then, we will add the tag app.my_strategy in…

Easy locks with Symfony

The Symfony documentation describes quite well how locks actually work, that's why this article will not describe why you should use a lock and how it actually works. But it says nothing about the short time installation it requires to set it up and run! Let's see that together. Install…

Welcome to the Swag Industries

We made a blog! Maxime V. and Gaby O. have teamed up to found the swag industries, an IT-oriented blog. As we wanted to write our thoughts about computing, help people and make a few short tutorials, we decided to have a blog. So here you are! This is our…