Optimizing Symfony applications on Vagrant boxes

Vagrant is an amazing tool for building development environments, and if you are not very familiar with it yet, I suggest you read my last 3 posts, which will guide you well into the Vagrant world. A few months after I started playing around with Vagrant and Puppet, with smaller applications, I had the task to create a box for a Symfony app for the first time. I thought “all right, no problema! this will be a piece of cake, I already know the process, I just need to put it on puppet”. And of course I was wrong. The…
View Post

A beginners guide to Vagrant and Puppet, part 3 – facts, conditionals and modules

Finishing this guide to Vagrant and Puppet, I would like to show some advanced Puppet resources. As I said before, Puppet is really powerful and extensive – I’m covering just the main concepts so you can have a good starting point for creating your Vagrant boxes. If you didn’t see the previous 2 posts, I strongly recommend you to read them. Here they are: Part 1 (Vagrant basics) and Part 2 (provisioning and Puppet) . Facts In the previous part of this guide, we saw a simple example of a Puppet class to install Apache. We saw that we can…
View Post

A beginners guide to Vagrant, part 2 – Provisioning and Puppet

In the first part of this begginer’s guide to Vagrant, we found out how to install Vagrant and get a really basic Ubuntu box up and running. But we need something more: we need to properly set up our development environment, in a fully automated way. It’s time to use provisioners to help us with these tasks. For a better understanding of how provisioners work, lets start using a very basic shell script as a provisioner. Provisioning with Shell The shell provisioner allows you to execute a shell script inside the vagrant box, as root. Lets use this really simple…
View Post

A beginners guide to Vagrant – getting your portable development environment, part 1

If you never heard about Vagrant, this is the right moment to get acquainted to it. Vagrant is getting very popular amongst open source projects, because it provides a portable and reproducible development environment using virtual machines. You will never be hostage of the “works on my machine” statement again; the environment is exactly the same for all the developers, regardless of the operational system running as the host machine (although everything can get messy with Windows). First of all, how it works? If a repository is “vagrant-ready”, you will just run a vagrant up in the repository root (after cloning it),…
View Post

The Dutch Conference 2013 (DPC)

This weekend (6-8 june), Amsterdam hosted the annual Duth PHP Conference, and I attended to a really PHP conference for the first time! I will try to summarize the experience here, because I was one of the (**really**) few women there and it may be funny to read what’s on a [brazilian] women mind (when she is surrounded by all sorts of nerds), anyways 🙂 First of all, we had a Google speaker ( Adewale Oshineye ). That is probably enough to make anything awesome! We also had a speakerholic guy – Anthony, who made me fear even more WordPress (and I will…
View Post

A simple Twig truncate filter – Silex

Sometimes you can get in trouble when dealing with dynamic data with variable length, such as titles and descriptions, so they can fit well in your layout. With Smarty you have the built-in filter “truncate”, but Twig doesn’t have this filter by default. I know there’s some text extensions available, but I didn’t get it to work with Silex easily and I didn’t want to lose more time on this issue, so I made this simple twig truncate filter and it’s working perfectly for truncating strings in the smarty style. Just add this to your bootstrap.php (or whatever initialization file…
View Post

Silex and Localization (i18n/L10n): TranslationServiceProvider

I’ve been using Silex* in a large variety of projects in the last year, and I always find something new to make my life easier. Last week, I was dealing with internationalization / localization (i18n / L10n) – a quite relevant topic when talking about web projects aiming a high audience. This post shows how to make an easy structure who automatically loads language files written in YAML, using the TranslationServiceProvider. Although the post is focused on Silex, I believe it’s also compliant with Symfony 2. If you wanna go directly to the code, there’s a GitHub repo with the…
View Post

Getting started with Silex – the php micro framework based on Symfony 2

This post aims to show the basics, and how to get started with the php micro framework Silex– which, by the way, is my favorite php framework nowadays. It’s based on Symfony 2, but focused on smaller applications. It has a really comprehensive and intelligent schema for url rewriting (so-called “Routes”) that brings to PHP one of the great things you can find in Django. It’s concise, extensible – using Pimple and Composer for dependency management – and secure. Oh, almost forgot: it’s practical, easy to learn and super versatile – according to my own experience with the framework so…
View Post