How can I properly switch the newly installed Symfony 1.4 framework from Doctrine (that it is configured for by default) to Propel?
4 Answers
If you create new (fresh) project...
symfony generate:project xxx --orm=Propel
The easiest thing :)
If you want to change existing project - you have to dig in configuration file and enable propel plugin.
Your configuration file should look similar to:
// config/ProjectConfiguration.class.php
public function setup()
{
$this->enablePlugins('sfPropelPlugin');
...
}
(based on Symfony page, you should dig it next time - especially Practical Symfony)

- 3,273
- 23
- 28
-
2BTW, if you're starting new project, I **strongly** recommend Doctrine. It's better. – Tomasz Struczyński Dec 03 '09 at 14:01
-
1I agree with Tomasz. Don't use Propel. – Priidik Vaikla Dec 05 '09 at 17:37
-
3and Priidik: at least please give a few arguments, links etc. telling precisely why Doctrine is better than Propel (however after more than one year, arguments have certainly changed...). – Maxime Pacary Mar 08 '11 at 11:10
-
As a quick comment - it's probably better for Symfony as it is now the default ORM in Symfony and both teams works closely. At times I did research, Doctrine was much more actively developed (although Propel development fasten since that). – Tomasz Struczyński Mar 11 '11 at 10:03
-
I did the changes you mentioned, but after building the Propel DB, I get an error that "**could no open propel.ini**". In fact, I don't have that file (nevertheless, I have the _doctrine.ini_ so, I guess, it was created when building all the project). Is there a way to fix this **without** creating a new project?. So far, haven't created tables in the DB. (**EDIT**:I'm using Symfony 1.4) (Also, following, but _backwards_ this: http://trac.symfony-project.org/wiki/ConvertingPropelProjectToDoctrine) – Feb 02 '12 at 17:04
-
1I guess you should create propel.ini file. You can find the skeleton in folder lib/plugins/sfPropelPlugin/config/skeleton/config/propel.ini of your symfony installation - or here: http://trac.symfony-project.org/browser/branches/1.4/lib/plugins/sfPropelPlugin/config/skeleton/config/propel.ini – Tomasz Struczyński Feb 27 '12 at 14:09
If you like chained object method calls that look like SQL statements, use Doctrine. If you like real objects that hide SQL, use Propel.
If you like creating criteria objects that then render themselves as WHERE clauses, use Propel. If you like creating WHERE clauses similar to SQL, use Doctrine.
You can use both at the same time, too. Not recommended, but if you use plugins like apostrophe that only use Doctrine, you might not have a choice.

- 3,366
- 2
- 32
- 42
Replying to the contributors here who wholly recommend Doctrine: the decision is not clear cut, in my view. Propel now also supports chainable query methods, so if you like that approach then both are still in play. Also, the Propel team maintain that the generated nature of model objects makes it faster to run for most use-cases than Doctrine.

- 19,824
- 17
- 99
- 186