【ThinkPHP 5】解决ThinkPHP5与Xdebug dump命令冲突
在安装了 Xdebug 后发现,原本 ThinkPHP dump
命令输出样式发生了改变,变成了:
E:\xxxx\xxxx\thinkphp\library\think\Debug.php:226:
object(app\common\paginator\Zui)[41]
protected 'simple' => boolean false
protected 'items' =>
object(think\model\Collection)[42]
protected 'items' =>
array (size=1)
0 =>
object(app\xxxxx\model\Order)[44]
...
protected 'currentPage' => int 1
protected 'lastPage' => int 1
protected 'total' => int 1
protected 'listRows' => int 20
protected 'hasMore' => boolean false
protected 'options' =>
array (size=6)
'var_page' => string 'page' (length=4)
'path' => string '/xxxxx/xxxxxx/xxxxxx.html' (length=34)
'query' =>
array (size=0)
empty
'fragment' => string '' (length=0)
'type' => string '\app\common\paginator\Zui' (length=25)
'list_rows' => int 20
虽然有些不习惯,但也不觉得有太大影响,就没管,后来要 dump 一个模型对象(即上面的),它把查询结果集给省略了,这就不好玩了,上网查阅得知,在 php.ini
文件添加一行即可用回 ThinkPHP 原本的 dump
:
[XDebug]
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
...
xdebug.overload_var_dump = 0 ;添加这一行
Reboot the Nginx or Apache
上次更新: 2022/01/05, 22:36:44