Propel 1.6 - 配置示例? [英] Propel 1.6 - Configuration Example?

查看:48
本文介绍了Propel 1.6 - 配置示例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Propel ORM 的新手.我已经生成了代码,现在正在尝试将运行时与我的 PHP 项目集成.我正在努力初始化主 Propel 类.看来用法应该是:

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

但是,此文档显示的是 XML 文件,不是 PHP 文件.有什么想法吗?

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

推荐答案

你需要像下面这样实际运行生成器:

You need to actually run the generator on it like:

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

这将解析 XML 并将其转换为 php 数组.这一切都在文档的运行时连接设置部分中进行了描述.如果您还没有,您可能需要阅读整个构建时间部分.

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.

这篇关于Propel 1.6 - 配置示例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆