How to work with Symfony 1.1(dev) and Doctrine 1.0

21 11 2007

For running Symfony 1.1 development version in parallel to your 1.0.x installation you may refer to http://www.symforc.com/post/2006/08/01/Testing-Symfony-11. It explains everything you need in great detail.

For running a 1.1Dev version only project you do:

cd /usr/share/pear/
svn co http://svn.symfony-project.com/trunk/lib symfony
svn co http://svn.symfony-project.com/trunk/data data/symfony

In my case I use /usr/share/php/ rather than /usr/share/php.

Now you have to choose whether to run a real symfony installation or to just run a sandbox.

For a sandbox:

Go to the directory where you want to place your sandbox and run:

$ /usr/share/pear/data/symfony/bin/create_sandbox.sh

For a real installation:

Make a softlink from /usr/bin/symfony to /usr/share/pear/data/symfony/bin/symfony Go to the directory you want to start your project in and run:

$ symfony generate:project <your_project_name>

Now install sfDoctrinePlugin:

In your projects root directory you checkout the trunk of sfDoctrinePlugin by running:

$ svn co http://svn.symfony-project.com/plugins/sfDoctrinePlugin/trunk plugins/sfDoctrinePlugin

This will effectively install the correct version of doctrine corresponding to your Symfony installation.

Beware sometimes you can get the following error:

Fatal error: Class 'sfDoctrineBaseTask' not found in
/var/www/localhost/plugins/sfDoctrinePlugin/lib/task/
sfDoctrineInitCrudTask.class.php on line 18

To solve this you have to remove all files from /tmp that have ’sf’ or ’symfony’ or ‘cache’ in their name. this is a bug in Symfony 1.1 that keeps some informations persistent in /tmp that are no longer valid.

Not too much information here but it took me a while to figure it out. ;)

Thanks to Ian P. Christian for pointing me towards the /tmp solution!

Powered by ScribeFire.

, ,


Routing international URLs in Symfony

29 08 2007

Symfonys I18n support is pretty neat once you’ve got the hang of it. The one thing I always missed was to have a set of URLs per culture in order to name the urls in different languages.

Consider the following: You have to build an application that is served in English, French and German.

Now you would probably name your starting page ‘homepage’. But then it would be nice to call it ‘pagedaccueil’ for your french visitors and ’startseite’ for the german speaking, wouldn’t it?

For example with this routing you can achieve just that.

homepage:
  url:
    de:   /startseite
    en:   /homepage
    fr:   /pagedaccueil
  params: [ module: home, action: index ]

Well with a bit of tweaking I managed to find a way to achieve this. It’s currently not too easy to extend the originally shipped sfRouting,you have to use a filter to achieve that but from there it’s easy.

The slightly enhanced UrlHelper functions are not yet well documented and probably not very complete either but then again I will come round to better them as time will come and request will be made.

Oh and of course you can still have your old routes working as before. I18n routes are an optional feature you get with this plugin.

Find out more about csI18nRoutingPlugin here.

, , , , , , ,


sfTwitterPlugin - Microblogging in Symfony

25 07 2007

to be completed soon..

Powered by ScribeFire.