我一直在尝试使用 SpiffyDoctrine 库将 ZF2 与 Doctrine 2 集成。
文档建议将 module.spiffy_doctrine_orm.config.php 放入应用程序的 config/autoload 中。但是,当我这样做时,我收到一个错误:
Warning: Cannot modify header information - headers already sent by (output started at ~/zf2tutorial-doc/config/autoload/module.spiffy_doctrine_orm.config.php:1) in ~/zf2/library/Zend/Http/PhpEnvironment/Response.php on line 40
但是,如果我删除了该文件并将其内容放入 local.config.php(这似乎是数据库登录详细信息的好地方)或 global.config.php,那么就没有问题了。
我的问题是,为什么会这样?我找不到任何解释这个自动加载文件夹的 ZF2 文档,除了所有文件都是自动运行的。