Home is where the heart is they say and I have two hearts beating in the two cities of Hamburg and Edinburgh. Unfortunately I can not be as much in the latter as I would wish for but until September 5th I will finally return for a long weekend to visit some lovely people and sampling a wee dram or two at a selection of my favourite pubs.
Needless to say that I will not blog for a few days.
31
gjShortUrlPlugin – Creating SEO landing pages and manage redirection of legacy URLs with the symfony and Doctrine plugin
0 Comments | Posted by Christian in The real job
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.
30
Options for setting up a Doctrine database connection when PHPUnit testing symfony plugins
2 Comments | Posted by Christian in The real job
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?
27
Why Doctrine_Core::getTable(‘BarFoo’) is not such a good idea.. when PHPUnit testing a symfony plugin
10 Comments | Posted by Christian in Miscellaneous
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.
26
Applying best practices for PHPUnit testing symfony plugins
3 Comments | Posted by Christian in The right tool
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!
25
[Question] What would you expect of a best practice document when developing symfony 1.4 form widgets?
3 Comments | Posted by Christian in Question
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?
24
[Best practice] How to ship PHPUnit configuration
5 Comments | Posted by Christian in The right tool
PHPUnit offers quite a lot options to be set as arguments on the commandline. However this is tedious when typing over and over again.
For this reason you can create an XML configuration file phpunit.xml that will automatically be used by the phpunit binary.
Now you may want to include this configuration file in your projects sourcecode to be used by all participating developers and your continuous integration server. But how?
(more…)
23
Setting up Continuous Integration for a symfony plugin using Hudson and Sebastian Bergmanns (PHPUnit) Template for Hudson Jobs for PHP Projects
0 Comments | Posted by Christian in The right tool
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…)
20
[workshop] Integrating sfImageTransformExtraPlugin into your symfony backend application – Part 2
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.
19
Quick start guide to install Hudson on Gentoo Linux (or any other)
5 Comments | Posted by Christian in The right tool
Lately I was playing around with my old Hudson installation to try and use Sebastian Bergmanns PHP Hudson template. But in the end I only had it halfway working and was increasingly confused by the number of plugins I had installed.
So I decided to make a backup of everything and start from scratch with a fresh install. Only there are no official ebuild for my Gentoo box..



