| ezpdo with symfony [message #325] |
Fri, 11 November 2005 23:27  |
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 #395 is a reply to message #337 ] |
Tue, 15 November 2005 19:21   |
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  |
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!
|
|
|