generate-migrations-diff failing with Zend framework

只愿长相守 提交于 2020-01-03 06:32:33

问题


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

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.


回答1:


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.



来源:https://stackoverflow.com/questions/3073320/generate-migrations-diff-failing-with-zend-framework

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