test.ical.ly | getting PHP by the balls

TAG | symfony

At my work place at Gruner+Jahr I had to find a simple yet effective solution to the requirement of redirecting old legacy URLs to new and shiny symfony URLs after a relaunch.

Another requirement was to be able to build campaign and SEO landing pages that redirect to and article or search result or whatsit.

As a result of just a few hours of writing routing related code there is now a new kid in town: gjShortUrlPlugin.

(more…)

, , , , ,

It is rarely the case that your unit tests actually test your database. It is however not so rare that the code your unit test tries to cover needs a database connection of some sorts.

In symfony 1.x you will find quite some tightly coupled code. Together with Doctrines (1.x) implementation of the active record pattern you will get a lot of exceptions complaining about no open database connection.

So if your tests need a database connection how should you do that?

(more…)

, , , , , , ,

If you have a look at the symfony and Doctrine documentation you will notice that whenever you want to get the table object for a model you will call Doctrine_Core::getTable(‘ModelName’).

Apparently this is considered a best practice however I came to thing quite the opposite.

(more…)

, ,

By now I have been writing quite a bit about how to utilise PHPUnit when developing symfony plugins. But symfony is of course still bundled with lime so before starting right away every plugin needs to be prepared with small changes like adjusting the bootstrap.

And because all these little changes have to be repeated over and over again for every plugin you start they tend to get tedious.

But I’ve got an idea! ;)

(more…)

, , , , ,

I am currently working on some symfony form customisation which includes writing widgets or better still extending existing ones.

However this proves to be much more complicated as I thought it would as the functionality for validating, form elements, object saving, dynamic javascripts and so forth seem to be scattered all over the place. A lot of non default widgets that you can find are hard to extend as they often do not separate javascript not HTML.

So what should be the best practice form/widget development guidelines?

(more…)

, , , ,

I must admit that I have been lazy with my efforts on continuous integration lately. Eventually my server crashed unnoticed and I didn’t get any emails about broken builds anymore and by now I think I’ve stacked up some work to do.

First of course I’ve got to get my CI server up and running again, that’s why I installed Hudson again.

But there is room for improvement too. Sebastian Bergmann of PHPUnit fame spent some time on a template Hudson job for PHP projects that includes much more than PHPUnit. So I decided to use that!

(more…)

, , , , , , , , ,

In the first part of this two part workshop series I demonstrated how you can easily integrate sfimageTransformExtraPlugin in your administrative backend application.

But you will have realised that all images generated have ugly path and file names. That might not matter much to your backend application but it will to what the user sees. So today I will focus on those nice URLs.

I’m going to use Doctrine in this post but everything will work exactly the same for Propel.

(more…)

, ,

Now after I finally implemented a way to remove outdated thumbnails it is time to put it to use and integrate it in our symfony backend application.

In this part I will focus on a rather simple integration with the following requirements:

  • Show thumbnails generated by sfImageTransformExtraPlugin in edit form instead of the original
  • Show thumbnails generated by sfImageTransformExtraPlugin in list instead of the original
  • Automatically remove outdated thumbnails when the source has changed

(more…)

, ,

As I promised yesterday there is a new version of sfImageTransformExtraPlugin out which not only allows you to selectively delete generated thumbnails manually using a symfony task but also provides a generic API for doing this automatically using the symfony event dispatcher.

(more…)

,

I am flattered. Benjamin Steininger (Robo47) uses my symfony plugin sfImageTransformExtraPlugin and blogged about it.

He was looking for a solution to delete the generated images again, when for example the source changes with a new upload. And this is actually where I felt bad..

(more…)

,

Older posts >>

Find it!

Theme Design by devolux.org