Oct18

sfPropel13Plugin - The power of Propel 1.3

Propel is the ORM engine of Symfony.

Version 1.2 is based on Creole and its the weakness of Symfony Framework.
Version 1.3 will use PDO instead of Creole and rumors say that its 100% faster than the previous version and 30% faster of Doctrine.

In this post we can have a look over the differences in Performance from Propel 1.2 and Propel 1.3:
http://notjosh.com/blog/archives/34-Propel-1.3-beta-in-Symfony!.html

The 1.3 version its in beta version and it seems that it will be the new ORM engine of next Symfony Framework.

This article explain how to install sfPropel13Plugin plugin on a sandBox installation of Symfony.

Mauro Casula.
Symfony-Framework.com

For me has been impossible to complete the normal installation successfully.
I successfully try this plugin with the following steps:

1. Download the last plugin pakage.

Download the last version of Plugin.
http://trac.symfony-project.com/wiki/sfPropel13Plugin/ (bottom of the page)

2. Copy the content of the archive in the directory:
<project>/plugins/sfPropel13Plugin/…
The directory must be named sfPropel13Plugin! Is a must.

3. Modify config/database.yml (example of configuration for mysql)

all:
propel:
class: sfPropel13Database
param:
phptype: mysql
hostspec: localhost
dsn: mysql:dbname=DATABASENAME;host=localhost
database: DATABASENAME
username: USERNAME
password: PASSWORD


4. Modify config/profel.ini with the following:

propel.targetPackage = lib.model
propel.packageObjectModel = true
propel.project = sf_sandbox
propel.database = mysql
propel.database.driver = mysql
propel.database.user = USERNAME
propel.database.password = PASSWORD
propel.database.url = mysql:dbname=DATABASENAME;host=localhost
propel.database.creole.url = mysql://USERNAME:PASSWORD@localhost/DATABASENAME
propel.database.buildUrl = mysql:DATABASENAME=USERNAME;host=PASSWORD

propel.addGenericAccessors = true
propel.addGenericMutators = true
propel.addTimeStamp = false

propel.schema.validate = false

; directories
propel.home = .
propel.output.dir = /home/production/symfony-for-release/sf_sandbox
propel.schema.dir = ${propel.output.dir}/config
propel.conf.dir = ${propel.output.dir}/config
propel.phpconf.dir = ${propel.output.dir}/config
propel.sql.dir = ${propel.output.dir}/data/sql
propel.runtime.conf.file = runtime-conf.xml
propel.php.dir = ${propel.output.dir}
propel.default.schema.basename = schema
propel.datadump.mapper.from = *schema.xml
propel.datadump.mapper.to = *data.xml

; builder settings
;propel.builder.peer.class = addon.propel.builder.SfPeerBuilder
;propel.builder.object.class = addon.propel.builder.SfObjectBuilder
propel.builder.peer.class = plugins.sfPropel13Plugin.lib.propel.builder.SfPeerBuilder
propel.builder.object.class = addon.propel.builder.SfObjectBuilder

propel.builder.objectstub.class = addon.propel.builder.SfExtensionObjectBuilder
propel.builder.peerstub.class = addon.propel.builder.SfExtensionPeerBuilder
propel.builder.objectmultiextend.class = addon.propel.builder.SfMultiExtendObjectBuilder
propel.builder.mapbuilder.class = addon.propel.builder.SfMapBuilderBuilder
propel.builder.interface.class = propel.engine.builder.om.php5.PHP5InterfaceBuilder
propel.builder.node.class = propel.engine.builder.om.php5.PHP5NodeBuilder
propel.builder.nodepeer.class = propel.engine.builder.om.php5.PHP5NodePeerBuilder
propel.builder.nodestub.class = propel.engine.builder.om.php5.PHP5ExtensionNodeBuilder
propel.builder.nodepeerstub.class = propel.engine.builder.om.php5.PHP5ExtensionNodePeerBuilder

propel.builder.addIncludes = false
propel.builder.addComments = false

propel.builder.addBehaviors = false

5. Add this exentions to PHP: php_pdo,php_pdo_mysql

6. PAKE COMMANDS:

If all has gone well, we can execute these commands from the consolle:

symfony propel-13-build-schema > symfony propel-13-build-model > symfony propel-13-init-admin backend ModuleName ModelName

The Generator have a BUG:

In the action.class.php file, in the executeEdit function we have to change this line:

$this->getUser()->setFlash(’notice’, ‘Your modifications have been saved’);

with that one:

$this->setFlash(’notice’, ‘Your modifications have been saved’);

Now you can Enjoy with the new Propel engine…

NOTICE: I have had some problem with that plugin installed. Its good for try the new Propel features, but not for production environments.


No Responses to “sfPropel13Plugin - The power of Propel 1.3”

You can leave a response, or trackback from your own site.

 

Leave a Reply

 

Recent Posts

Popular Categories

No categories

About

We are a group of programmers with the passion of Object Oriented Programming and PHP5… We hope to help the Symfony comunity to grow, we hope to help Php programmers to switch to MVC world and we wish you can find in this blog all you answers… Welcome to Symfony-Framework.com.

<<The Administrators>>