Sunday, July 7, 2013

A CSV-to-CSV converter using Symfony Console application skeleton

A common problem when dealing with received CSV files is that often its structure and/or contents need to be converted in order to be fed to some existing application. A real life example is when we have is a list of items to be imported into an online shop (sent by a provider using a predefined CSV structure), and we discover that the import module of our online shop needs another predefined CSV structure and/or contents. We could solve the problem by adapting our import software, but then we will be facing the same problem again when the next provider sends its predefined format...

So instead we will write a generic CSV-to-CSV converter using the our Symfony Console Skeleton to solve the problem.

Sunday, May 5, 2013

A basic skeleton for Symfony Console applications


Symfony provides a great infrastructure for writing console-oriented applications. But, as the lazy person I must confess I am, it feels like a great deal starting from scratch with a of a lot of code just for a "tiny" utility.

Thursday, August 23, 2012

How to access configuration values inside an entity in Symfony2


So you have an entity class (let's say, Post) and you need to access a configuration value (let's say, my_bundle.upload_dir). Well, you can't. Or, better, you can but you may end breaking several good practices in the process.

Sunday, July 22, 2012

Anchor links and JQuery Mobile

So you need to link to an anchor inside a JQuery Mobile page, and things aren't working? Look no more, here is the answer!!!

Tuesday, July 10, 2012

Yet another look at Symfony2 functional testing


Functional testing Symfony2 controllers is not that hard once you get the idea. The real problem comes to light when you need to optimize those brilliant functional tests you just wrote because they are slow as hell.

So let's start at the beginning.

Monday, July 9, 2012

MakeGood and Symfony2



A few days ago I was looking for an easier way for automating my PHPUnit testing in Symfony2 and stumbled into this totally awesome tool: MakeGood.

So, what does it do? If a few words, it is a "continuous testing tool", meaning that it is able to execute all your tests in background whenever any file in the project changes (as this is a potential cpu-killer feature, it can be easily disconnected and you will still be able to launch the tests manually).

It is fully integrated with Symfony2 but I stumbled into a few pitfalls while trying to make it work. I finally I succeeded and fell like writing it down, both for future reference and to help out others.