logocomune/debug

此包已被弃用且不再维护。未建议替代包。
关于此包最新版本(1.1.0)没有提供许可证信息。

一个简单的调试工具,用于打印关于变量的可读信息。

1.1.0 2015-05-13 18:02 UTC

This package is not auto-updated.

Last update: 2020-08-21 19:59:47 UTC


README

此软件是一个简单的调试工具,当从CLI模式执行时,它会打印关于变量的可读信息,或者以HTML或纯文本形式打印。

安装

使用 composer require logocomune/debug 安装最新版本

或者,您可以在项目中现有的 composer.json 文件中将 Debug 指定为一个依赖项

{
 "require-dev": {
    "logocomune/debug": "~1.1"
 }
}

用法

基本示例

// debug() or d() just display a variable
debug(['test'=>1,'d'=>'ok']);

// debug and exit
de(['test'=>1,'d'=>'ok']);

可用功能

// Disable debug
\Logocomune\Debug\Debug::disable();

// Enable backtrace
\Logocomune\Debug::backtrace();

// Disable backtrace
\Logocomune\Debug::backtraceOff();

// Dump a variable with

// print_r (default mode)
\Logocomune\Debug::renderAsPrintR();

// var_dump
\Logocomune\Debug::renderAsVarDump();


// var_export
\Logocomune\Debug::renderAsVarExport();


// Symfony mechanism for exploring and dumping PHP variables
\Logocomune\Debug::renderAsSymVarDump();