繁体   English   中英

Symfony 4转储功能无法正常工作

[英]Symfony 4 dump function doesn't work properly

我正在开发一些REST APIS并且转储功能在我的dev env中停止工作,它没有显示任何有关任何信息或返回通常的输出

function (from the file) and the function with the same results: it doesn't show anything or throw a php exception. 我尝试使用函数(来自文件)和函数进行结果:它没有显示任何内容或抛出php异常。

) and reinstall the debug-bundle 此外,我尝试了两种方法:使用常规调试命令(即 )并重新安装debug-bundle

在这个例子中,我的程序返回一个通知:

$foo = array("asdads", "czxcxzc");
dump($foo);

在另一个示例中,响应为空

$foo = "bar";
dump($foo);

我只需要这个函数的常规输出:对调试非常有用,看看我的程序是怎么回事

我想我已经弄明白了。

问题是我在主控制器类(App \\ Controller)上添加了__destruct()方法

应用程序\\控制器

abstract class Controller implements ContainerAwareInterface
{

use ContainerAwareTrait;
use ControllerTrait;    
...
public function __destruct()
{
   //Some stuffs here
}

我不知道为什么,但这种方法避免加载一些这些调试方法(也许一些其他功能,但不确定)

解决方案(现在)将此__destruct()方法移动到我的应用程序主控制器。 现在一切都像魅力一样

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM