This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » support » General discussion » ezpdo with symfony
ezpdo with symfony [message #325] Fri, 11 November 2005 23:27 Go to next message
michaek  is currently offline michaek
Messages: 10
Registered: November 2005
Junior Member
i'm interested in using ezpdo for object persistence with symfony instead of propel. i'm curious what it might take for me to enable ezpdo support. any information/assistance would be helpful. (in the meantime, i'm going to delve into this myself, and i'll post whatever progress i make on this thread.) thanks,

-m
Re: ezpdo with symfony [message #337 is a reply to message #325 ] Sat, 12 November 2005 15:00 Go to previous messageGo to next message
fabien  is currently offline fabien
Messages: 484
Registered: October 2005
Faithful Member
Administrator
The Propel integration is done at several places in symfony:

- wrapper of the Phing/build.xml in the pakefile.php (so build-model and build-sql are available in the symfony command line)
- autoloading of Propel only when needed
- all model classes in lib/model and configuration in autoload.yml so you don't have to require your model classes

I think this is it. So, I think ezpdo integration can be quite simple and I'll be glad to help you with this task.
Re: ezpdo with symfony [message #395 is a reply to message #337 ] Tue, 15 November 2005 19:21 Go to previous messageGo to next message
michaek  is currently offline michaek
Messages: 10
Registered: November 2005
Junior Member
hi, fabien. you were right - it was pretty easy to get things working. here's what i did:

---

copied ezpdo directory to symfony lib dir
[on my install: /usr/share/php/symfony/ezpdo ]

placed ezpdo config.xml file in project config dir
- enter appropriate database connection settings in config.xml
- leave "source_dirs" and "compiled_dir" blank in config.xml

copied ezpdo/ezpdo_runtime.php to symfony/addon/ezpdo/sfEzpdoAutoload.php as a custom ezpdo loader
in sfEzpdoAutoload.php:
- edited basic src/lib definition include to
include_once('ezpdo/ezpdo.php');
- added the following lines to epLoadConfig() function declaration, before the instance()->setCongig($cfg) call:
$cfg->set('source_dirs', SF_LIB_DIR.DS.SF_MODEL_DIR_NAME);
$cfg->set('compiled_dir', SF_BASE_CACHE_DIR);
- edited epLoadConfig() call to
epLoadConfig(SF_ROOT_DIR.DS.'config'.DS.'config.xml');

added this line to autoload.yml
[on my install: /usr/share/php/data/symfony/config/autoload.yml ]
below "symfony core classes (continued)" referencing the ezpdo loader:
Ezpdo: %SF_SYMFONY_LIB_DIR%/symfony/addon/ezpdo/sfEzpdoAutoload.php

---

now changes to ezpdo classes and orm declarations are happily loaded by symfony and available for use by ezpdo in symfony actions and templates!

however, though ezpdo is configured to "auto flush" - to save all altered data - it's not doing this under symfony. apparently, its shutdown function isn't registering. i'm not that concerned, because a manual flush is easy, but it seems like it might be worth working out at some point.

also, i haven't touched pakefile.php yet - i'll post an update when i head in that direction.

thanks for your help, fabien! (feel free to let me know if there's anything here you see a problem with.)

[Updated on: Tue, 10 January 2006 20:21]

Re: ezpdo with symfony [message #398 is a reply to message #395 ] Tue, 15 November 2005 22:57 Go to previous message
fabien  is currently offline fabien
Messages: 484
Registered: October 2005
Faithful Member
Administrator
Very interesting indeed.

When you'll finish integration, perhaps we can create a symfony addon PEAR package (symfony/ezpdo), so people can use ezpdo with symfony with just 2 commands:

pear install symfony/symfony
pear install symfony/ezpdo


Nice!
Previous Topic:Is the RSS feed down?
Next Topic:Fallback mechanisms
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software