When svn merge doesn’t quite cut it

Anyone that works with subversion will know that merging 2 branches is not always easy. Most of the time there is no issue, and you can merge one or multiple changes from one branch to another, but sometimes you end up with conflicts left right and center. This is done with the standard merge commands:

Continue reading When svn merge doesn’t quite cut it

Quick one-liner to set up a new SVN project with a trunk, branches and tags

When creating a new project in SVN one recognised standard is to set up a trunk, branches, and tags directory structure. Where I’m working at the moment, we also have a release directory placed under tags and branches. Which I’ve also started to do on some of my other projects out side of work as well (those that are under SVN anyway)

Continue reading Quick one-liner to set up a new SVN project with a trunk, branches and tags

Fantastic alternative to lorem ipsum

I was introduced to a fantastic alternative to Lorem Ipsum today thanks to one of the developers I work with. Rather then use the same block text on your web sites and applications you can now use quotes from Samuel L Jackson, curtsey of Samuel L Ipsum.

Some of the more choice phrases have been taken from films like Pulp Fiction, while the more child friendly quotes are from Unbreakable. There is still an option for the classis Lorem Ipsum, but that’s not that much fun really.

I know what I’ll be using from now on when working with sample content…

Creating a search tool with the Searchable behaviour in Doctrine

Once you’ve set up a searchable behaviour on a doctrine model, and have indexed all the keywords on the model, you are going to want to build a search tool. First we should create a simple symfony form.

Continue reading Creating a search tool with the Searchable behaviour in Doctrine

Re-indexing a doctrine object with a symfony task

Yesterday I explained how to add the Searchable behaviour to a doctrine object,  to I’ll cover that how to create a symfony task to re-index all the existing objects. The basic idea of the task is to retrieve all the objects from your database, mark them as dirty and re-save them. If you don’t mark them as dirty, nothing will update when you save, which is what you would expect from doctrine.

Continue reading Re-indexing a doctrine object with a symfony task

Adding the Searchable behaviour to a Doctrine model in Symfony

The searchable behaviour within Doctrine is a brilliant and powerful way to add a quick and simple search to your symfony code. The basics of this behaviour are to create an index table for your given model, which contains 4 things, a keyword, the field it was in, the position and the object id it was in.

Continue reading Adding the Searchable behaviour to a Doctrine model in Symfony

Using grep, awk and sed to list files containing a string

This week I was trying to locate which files in the codebase use a specific class method while debugging some code. This method however has been used a lot, when I say a lot I mean 10 to 20 times per file, and in lots of templates. This is mainly because it is a template helper to generate complex links within the page. Anyway, a simple use of grep wasn’t all that much help, so I refreshed my memory on how to use sed to make the output a little more readable.

Continue reading Using grep, awk and sed to list files containing a string