在针对zf-api问题和zf-rest的module.config.php文件中,它表示您可以覆盖应用程序配置中的"display_exceptions",以在响应中获取异常堆栈跟踪。
'view_manager' => array(
// Enable this in your application configuration in order to get full
// exception stack traces in your API-Problem responses.
'display_exceptions' => false,
),
我在Application module.config.php(来自骨架应用程序)中将display_exceptions设置为true,但当所有配置合并时,它会被覆盖。当我在''ZF''ApiProblem''Listener''SendApiResponseListener中查看配置的状态时,其中正在构造ApiProblemResponse,"display_exceptions"设置为false。
它是否在应用程序配置后合并zf-api问题和zf-rest配置并覆盖它?
如何在供应商模块中启用display_exceptions而不进行更改?
当您启用开发模式时,apigility会将./config/development.config.php.dist
复制到./config/development.config.php
。这将与其他配置合并。因此,编辑.dist文件,并禁用和启用开发模式。
您可能是对的,设置被另一个配置覆盖。请尝试更改应用程序模块的顺序。所以在你的application.config.php
:
<?php
return array(
'modules' => array(
'ZF'Hal',
'ZF'Rest',
'ZF'ApiProblem',
... more modules ...
'My'Custom'Module' // --> Set your 'display_exceptions' => true
// in the module.config.php of this module
)
)