Laravel 漂亮的 var_dump(), dd(),不再工作

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27734788/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 10:37:29  来源:igfitidea点击:

Laravel's pretty var_dump(), dd(), not working anymore

laravel

提问by Ortix92

For some reason laravel's dd()function decided to stop functioning. I have no idea how this happened. I tried composer updatealready but I'm not sure what else can be going on. The debugkey is set to truein the config.

由于某种原因,laravel 的dd()功能决定停止运行。我不知道这是怎么发生的。我composer update已经尝试过了,但我不确定还会发生什么。该debug键设置为true在配置。

Where should I look to solve this problem? I'm using Laravel 4.2.16

我应该在哪里解决这个问题?我正在使用 Laravel 4.2.16

NOTE: dd()now simply functions as var_dump(), it doesn't prettify it anymore

注意: dd()现在只是作为var_dump(),它不再美化它

回答by Ortix92

Solved it. I loaded my vagrant machine with the wrong config and was running hhvm instead of regular php-fpm. Hence xdebug, which handles the pretty dd(), was not being loaded. I reloaded my box with the correct settings (without hhvm and hack) and everything started working again

解决了。我用错误的配置加载了我的流浪机器,并且正在运行 hhvm 而不是常规的 php-fpm。因此,处理漂亮的 xdebugdd()没有被加载。我用正确的设置重新加载了我的盒子(没有 hhvm 和 hack),一切又开始工作了

回答by cherrysoft

Is dd the only Laravel helper function that doesn't work? If not then check the contents of vendor/composer/autoload_files.php. The laravel support helpers are loaded here. If the other helper functions are fine you can check the contents of laravel/framework/src/Illuminate/Support/helpers.php to see what's going on - this is where the function is created.

dd 是唯一一个不起作用的 Laravel 辅助函数吗?如果没有,请检查 vendor/composer/autoload_files.php 的内容。Laravel 支持助手在这里加载。如果其他辅助函数没有问题,您可以检查 laravel/framework/src/Illuminate/Support/helpers.php 的内容,看看发生了什么——这是创建函数的地方。