使用Zend框架生成迁移-diff失败 [英] generate-migrations-diff failing with Zend framework
本文介绍了使用Zend框架生成迁移-diff失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用Zend Framework使用Doctrine生成迁移脚本。我得到以下内容:
I am trying to generate a migration script using Doctrine with Zend Framework. I am getting the following:
$ php doctrine.php generate-migrations-diff
$ PHP Fatal error: Cannot redeclare class Avo_Model_AccessType in
$ tmp/fromprfx_doctrine_tmp_dirs/AccessType.php on line 16
我可以成功构建了yaml文件的模型。我使用Zend Framework 1.10.5和Doctrine 1.2.2我认为问题可能是与自动装载机和Zend自动加载教条正在尝试重新创建的类的事实。
I can successfully build the models form the yaml file. I am using Zend Framework 1.10.5 and Doctrine 1.2.2 I think the issue might be with the autoloader and the fact that Zend Autoloads the classes that doctrine is trying to re-create.
推荐答案
今天我有同样的错误。问题是在引导我预装了所有的模型与
I've got the same error today. The problem was that in bootstrap I preloaded all models with
Doctrine_Core::loadModels($options['models_path']);
所以,我刚刚删除了这一行,它帮助了。
So, I just removed that line and it helped.
这篇关于使用Zend框架生成迁移-diff失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文