propel-gen 的“convert-conf”目标失败

Posted

技术标签:

【中文标题】propel-gen 的“convert-conf”目标失败【英文标题】:propel-gen's "convert-conf" target fails 【发布时间】:2008-12-11 08:21:18 【问题描述】:

我正在尝试使用最新版本的 php & Propel 1.3 & Phing 从 OSX 10.5 上的 schema.xml 文件生成我的模型。所有的模型类实际上都被创建了,然后它就死了,就在最后一步。我已经试过了

chmod -R 777 ./application/config

但这并没有帮助。我也试过了

propel-gen ./ 反向

propel-gen ./克里奥尔语

两者都产生了相同的错误。这个错误:

propel > convert-conf:
[echo] Output file: models-conf.php
[echo] XMLFile: /application/config/runtime-conf.xml
Execution of target "convert-conf" failed for the following reason: pear/data/propel_generator/build-propel.xml:514:20: No valid xmlConfFile specified.
[phingcall] /pear/data/propel_generator/build-propel.xml:514:20: No valid xmlConfFile specified.

Execution of target "main" failed for the following reason: 
pear/data/propel_generator/build-propel.xml:94:18: Execution of the target buildfile failed. Aborting.
[phing] pear/data/propel_generator/build-propel.xml:94:18: Execution of the target buildfile failed. Aborting.

BUILD FINISHED

这是我的 build.properties 文件:

propel.project = models
propel.database = mysql
propel.database.encoding = utf8
propel.database.url = mysql:host=localhost;dbname=$myDBName
propel.database.user = $myDBuser
propel.database.password = $myDBpass
propel.output.dir  = /application
propel.php.dir     = $propel.output.dir/
propel.sql.dir     = $propel.output.dir/models/sql
propel.schema.dir  = $propel.output.dir/config
propel.conf.dir    = $propel.output.dir/config
propel.phpconf.dir = $propel.output.dir/config
propel.addGenericAccessors = true

有什么想法吗?

【问题讨论】:

【参考方案1】:

我发现我遇到了同样的问题,我必须设置它来解决它

propel.runtime.conf.file=runtime-config.xml

build.properties 文件中。

之后它就完美运行了。

【讨论】:

【参考方案2】:

我不知道这是怎么发生的,但我的 runtime-conf.xml 文件中有一行错误:

<datasource id="models"> <!-- this ID must match <database name=""> in schema.xml -->

看看它怎么说那些必须匹配的东西?我的没有。我一定是在我不注意的时候按了一个键,不小心编辑了它。匹配这些,现在构建正常。唷。

【讨论】:

以上是关于propel-gen 的“convert-conf”目标失败的主要内容,如果未能解决你的问题,请参考以下文章

既是3的倍数又是5的倍数都有哪些

一个三位数既是3的倍数,又是5的倍数。这样的三位数最小是啥

数组的创建,及数组的方法

cnn中的步长的目的和重要性是啥

物质的运动

多态的好处??