Master Symfony2 fundamentals

Be trained by SensioLabs experts (2 to 6 day sessions -- French or English).
trainings.sensiolabs.com

L'audit Qualité par SensioLabs

200 points de contrôle de votre applicatif web.
audit.sensiolabs.com

Call the expert: Using a custom version of Doctrine by Jonathan Wage – January 12, 2009 – 6 comments

Now that the release of Doctrine 1.1 right around the corner their has been a bit of noise about how users can use 1.1 instead of the default bundled 1.0.

With sfDoctrinePlugin it is easy to swap out the version of Doctrine used by simply changing one configuration value.

Below you will find an example of how you can configure sfDoctrinePlugin to use a different version of Doctrine, for example 1.1.

First we need to check out the version of Doctrine we want to use into lib/vendor/doctrine:

$ cd lib/vendor
$ svn co http://svn.doctrine-project.org/branches/1.1/lib doctrine

Now we can configure the sfDoctrinePlugin to use that version of Doctrine instead of the one that comes bundled with the plugin. In your ProjectConfiguration::setup() method you need to change the value of the sfDoctrinePlugin_doctrine_lib_path with sfConfig, like the following:

public function setup()
{
  sfConfig::set('sfDoctrinePlugin_doctrine_lib_path', sfConfig::get('sf_lib_dir') . '/vendor/doctrine/Doctrine.php');
}
 

Now you can enjoy the great features of Doctrine 1.1 without too much work. You can check out what is new in Doctrine 1.1 by reading the upgrade file.

Add a Comment

You must be connected to post a comment.

Comments RSS

  • gravatar
    #1 Fabian said on the 2009/01/12 at 23:20
    much easier than i thought!
  • gravatar
    #2 Sylvain said on the 2009/01/13 at 15:36
    Looks good ! What about the compatibility with Symfony 1.2 ? I'm asking because if there is no problem, why Doctrine 1.1 is not on 1.2.2 ?
  • gravatar
    #3 Jacek Jędrzejewski said on the 2009/01/13 at 17:36
    @Sylvain: 1.1 isn't stable. 1.1 RC1 was released about 1 hour ago...
  • gravatar
    #4 jwage said on the 2009/01/14 at 02:31
    @Sylvain 1.3 will use Doctrine 1.1. 1.2 cannot switch to 1.1 because of backward compatibility.
  • gravatar
    #5 jmacias said on the 2009/03/04 at 16:46
    It's seems to not work because symfony autoload.
  • gravatar
    #6 Jonathan H. Wage said on the 2009/03/04 at 20:14
    This isn't happening for everything. It is an odd behavior. Can you try the fix suggested here: http://trac.symfony-project.org/ticket/5741