Symfony

Don’t rely entity setters (order)

What this code does?

It’s a simple class that represent a DateTimeInterval with a flag named allDayLong that let an object of DateTimeInterval class to fill all day. You can see that setFrom and setTo are affected from allDayLong flag: if is set, time of these DateTime are changed in order to fill all day. But…

PHPSpec – Array of mocks in constructor: a practical example

If you know PHPSpec a bit, you certainly are aware of let function.

that helps you to define “automagic” mocks handled directly by PHPSpec and that you can pass to your example

If type and name of your mock is the same of let function, then the mock is the…

Symfony Day 2016 (Italy, Rome)

Good news mates: we were selected as speakers for Symfony Day 2016 (Italy) that will take place in Rome (tickets available here). Samuele  and Matteo  sent out their talk proposals and both were picked (checkout program here: all talks are in italian language). Matteo’s proposal is entitled “Scaling Symfony apps” and will start at…

Scaling Symfony sessions with Memcached

Sessions are one of the main building blocks of a login-based web application. We’re going to see what they are, what Symfony offers us to handle them and how to scale when you have ton of them. What’s a session? As you know the HTTP protocol is stateless: each request is independent from…

Assets versioning with Symfony and Capifony

Just a quick tip for assets versioning with Symfony2. Let’s imagine you have an asset, called “beautifulAsset.js”, in your app. As soon as it’s requested, the user browser caches it. So far so good. Problems arise when you change the code inside “beautifulAsset.js” and deploy your application. If you don’t…

1 2