emiliomg/debug
最新稳定版本:1.0.0
Composer 安装命令:
composer require emiliomg/debug
包简介
Pretty Print Debug Messages with backtrace
README 文档
README
Examples
Small Pretty-Printer for debug outputs incl. information about the calling file:line.
Short demonstration:
foo.php:
<?php
require('vendor/autoload.php');
kd('Hello World');
kdd('Hello World, Bye!'); // kdd is short for kd die"
kd('I will not work, because a die was called the line before');
A run of foo.php outputs:
------------------------------------------------------------
/pfad/zu/foo.php:3
------------------------------------------------------------
Hello World
------------------------------------------------------------
------------------------------------------------------------
/pfad/zu/foo.php:4
------------------------------------------------------------
Hello World, Bye!
------------------------------------------------------------
A little more complexity
foo.php:
<?php
require('vendor/autoload.php');
require('bar.php');
kd('Hello from Foo!', 'Title from Foo');
$bar = new Bar();
$bar->baz();
bar.php:
<?php
class Bar
{
public function baz()
{
$text = array(
'One' => 'Hello',
'Two' => 'from',
'Three' => 'Bar',
'Four' => '!'
);
kd($text, 'The title in Bar');
}
}
A run of foo.php renders:
------------------------------------------------------------
/pfad/zu/foo.php:5
------------------------------------------------------------
--Text from Foo--
Title from Foo!
------------------------------------------------------------
------------------------------------------------------------
/pfad/zu/bar.php:13
------------------------------------------------------------
--The title in Bar--
Array
(
[One] => Hello
[Two] => from
[Three] => Bar
[Four] => !
)
------------------------------------------------------------
统计信息
- 总下载量: 825
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-05-15