What’s Twig If you use Symfony you also probably use Twig (http://twig.sensiolabs.org/). It is a very flexible layout system and it makes it really easy to: extend a base layout include external sublayouts Even though Twig requires you to learn a slightly different syntax, I feel it’s well worth it and I am completely happy with it. Let’s take a […]
So, I had to build an API layer on top of an existing legacy (but well-known) codebase. Sounds easy, huh? Yep, that’s what I thought, too. Unfortunately, things were not that easy: as I started going into details, I found a few traps.
tl;dr Install the php5-sybase package This will install on Ubuntu the drivers required to connect to a Microsoft SQL Server. Test connection from PHP We want to make sure PHP is working before moving on to Doctrine. See below for a sample test PHP script. Install the leaseweb/doctrine-pdo-dblib bundle Doctrine out of the box does not support connecting to a […]
A while ago the Symfony project published a “Best Practices” book. This is a source of excellent suggestions and it’s written by the people who wrote Symfony in the first place, so we decided to stick to it as much as possible, even in those few cases where the benefits where not immediately clear. But after a few more Symfony […]
Monolog Monolog is a logging library. It is extremely powerful and most of the time only a tiny subset of its features are actually used. Just to mention a few extra features: we can define different and complex logging strategies to keep only really interesting stuff we can define to send our log to DB, to mail, to webservices we […]
In your Symfony application there are bound to exist many assets (JS, CSS, and so on) either created by you or provided by third-party bundles. As part of your deploy procedure, you usually have to use some Symfony console command to actually make the assets available to the frontend of your application. Let’s start with the most basic solution: the […]
The request was simple: one of my customer wanted to have a Symfony app available as a subfolder of an existing site, i.e. http://www.example.com/myapp/ Googling for it, I found lots of tutorials but each one of them failed to meet two specific requirements: I don’t want to edit the virtual host configuration the application folders (“app”, “bin”, “src”, “vendor”) must […]