Propel 1.6 - Configuration Example?

◇◆丶佛笑我妖孽 提交于 2019-12-08 04:57:16

问题


I'm new to using Propel ORM. I have generated code and am now trying to integrate the runtime with my PHP project. I am struggling with initializing the main Propel class. It appears that the usage should be:

require_once('propel/runtime/lib/Propel.php');
Propel::configure('/path/to/runtime/config.php');
Propel::initialize();

I cannot find any documentation on what the contents on the runtime configuration should be, other than this:

http://www.propelorm.org/wiki/Documentation/1.6/RuntimeConfiguration

However, this document shows an XML file, not a PHP file. Any ideas?


回答1:


You need to actually run the generator on it like:

$ cd /path/to/project
$ propel-gen convert-conf

This will then parse the XML and convert it to the php array. This is all described in the Runtime Connection Settings section of the docs. You probably need to read the entire Build Time section though if you havent already.




回答2:


I wrote a HOWTO on getting started some while ago - perhaps that might be useful?



来源:https://stackoverflow.com/questions/7034908/propel-1-6-configuration-example

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!