Sending GPS coordinates through url using Symfony 1.4

I’ve been developing an API using Symfony 1.4.18 version and I’ve noticed that you can’t send “dots” as part of the url.
Basically if you have something like this in your routing.yml:

checkin_hotel:
 url: /checkin/hotel/:minLon/:minLat/:maxLon/:maxLat
 param: { module: service, action: checkin, type: hotel }

and you try to call this url:

http://myurl/checkin/hotel/-9.15794/39.34242/-8.95677/42.34532

This wont work!

This happens because by default symfony interpret “.” and “/” as separators and so the route “checkin_hotel” wont be called.

To fix this you should specify directly that it should only use “/” as separator:

checkin_hotel:
 url: /checkin/hotel/:minLon/:minLat/:maxLon/:maxLat
 param: { module: service, action: checkin, type: hotel }
 options:
   segment_separators: [/]

Best regards,
Daniel Botelho

Running symfony task using bash script

I’m working in a project that uses a lot of symfony tasks to migrate an ancient database to a new one.
Due to some PHP garbage collection issues, we had to do some tricks so the script would run completely . This was done, using a bash script that was responsible to call symfony tasks one at a time, avoiding memory leaking from PHP.

In the script header I’ve put this:

#!/bin/bash
path=”/var/www/palcomigrator”
php=”/usr/bin/php”
symfony=”${php} ${path}/symfony”

runtask()
{
for TASK in “$@”
do
$symfony $TASK
done
}

Here I’ve put the project path location (variable “path”), the php location (variable “php”) and the symfony script location path (variable symfony). I’ve also created an function that is responsible to run a symfony task called “runtask()”.

Now If I wanted to run the symfony task’s “migratePhotos” and “migrateComments” I would create an script like this:

#!/bin/bash
path=”/var/www/palcomigrator”
php=”/usr/bin/php”
symfony=”${php} ${path}/symfony”

runtask()
{
for TASK in “$@”
do
$symfony $TASK
done
}

runtask migratePhotos migrateComments