NipGeihou's blog NipGeihou's blog
  • Java

    • 开发规范
    • 进阶笔记
    • 微服务
    • 快速开始
    • 设计模式
  • 其他

    • Golang
    • Python
    • Drat
  • Redis
  • MongoDB
  • 数据结构与算法
  • 计算机网络
  • 应用

    • Grafana
    • Prometheus
  • 容器与编排

    • KubeSphere
    • Kubernetes
    • Docker Compose
    • Docker
  • 组网

    • TailScale
    • WireGuard
  • 密码生成器
  • 英文单词生成器
🍳烹饪
🧑‍💻关于
  • 分类
  • 标签
  • 归档

NipGeihou

我见青山多妩媚,料青山见我应如是
  • Java

    • 开发规范
    • 进阶笔记
    • 微服务
    • 快速开始
    • 设计模式
  • 其他

    • Golang
    • Python
    • Drat
  • Redis
  • MongoDB
  • 数据结构与算法
  • 计算机网络
  • 应用

    • Grafana
    • Prometheus
  • 容器与编排

    • KubeSphere
    • Kubernetes
    • Docker Compose
    • Docker
  • 组网

    • TailScale
    • WireGuard
  • 密码生成器
  • 英文单词生成器
🍳烹饪
🧑‍💻关于
  • 分类
  • 标签
  • 归档
  • 【ThinkPHP 5】解决ThinkPHP5与Xdebug dump命令冲突

NipGeihou
2019-7-29
PHP

【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

#PHP#ThinkPHP#TP5#Xdebug
上次更新: 2022/01/05, 22:36:44
最近更新
01
元器件
05-23
02
iSCSI服务搭建
05-10
03
磁盘管理与文件系统
05-02
更多文章>
Theme by Vdoing | Copyright © 2018-2025 NipGeihou | 友情链接
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式