Propel 1.6 - 配置示例?
我是 Propel ORM 的新手。我已经生成了代码,现在正在尝试将运行时与我的 PHP 项目集成。我正在努力初始化主 Propel
类。看起来用法应该是:
require_once('propel/runtime/lib/Propel.php');
Propel::configure('/path/to/runtime/config.php');
Propel::initialize();
除了这个之外,我找不到任何关于运行时配置内容的文档:
http://www.propelorm.org/wiki/Documentation/1.6/RuntimeConfiguration
但是,此文档显示的是 XML 文件,不是 PHP 文件。有什么想法吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要实际运行生成器,如下所示:
然后,这将解析 XML 并将其转换为 php 数组。这些都在文档的运行时连接设置部分中进行了描述。如果您还没有阅读的话,您可能需要阅读整个“构建时间”部分。
You need to actually run the generator on it like:
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.
我写了一篇HOWTO不久前开始 - 也许这可能有用?
I wrote a HOWTO on getting started some while ago - perhaps that might be useful?