liil/kint

Kint - PHP开发者使用的清新主题调试助手

v1.0 2014-07-27 15:07 UTC

This package is auto-updated.

Last update: 2024-09-18 23:01:23 UTC


README

Total Downloads

Screenshot

您可以在http://raveren.github.com/kint/找到原始版本

Kint for PHP是一个强大且现代化的、无需配置的替代品,用于替换var_dump()print_r()debug_backtrace()。您会 wonder how you developed without it.

安装和使用

<?php
require '/kint/Kint.class.php';

或者,如果您使用Composer

    "require": {
       ...
       "liil/kint": "v1.0"
    }

就是这样,现在您可以使用Kint调试代码了

<?php
########## DUMP VARIABLE ###########################
Kint::dump($GLOBALS, $_SERVER); // any number of parameters
// or simply use d() as a shorthand:
d($_SERVER);


########## DEBUG BACKTRACE #########################
Kint::trace();
// or via shorthand:
d(1);


########## TEXT-ONLY OUTPUT ########################
s($GLOBALS);


########## MISCELLANEOUS ###########################
// to disable all output
Kint::enabled(false);
// further calls, this one included, will not yield any output
d('Get off my lawn!'); // no effect

// New in 1.0
// Usefull when your working with ajax or rest api request.

\Kint::dump($data, '/www/temp/log.html');

此外

  • sd()dd()分别是s();die;d();die;的缩写。
  • !Kint::dump()!dd()默认展开显示。
  • @Kint::dump()@d()将返回输出而不是显示。

访问项目页面获取文档、配置和更多高级用法示例。

作者

Rokas Šleinius (Raveren)

贡献

如果您在引入更改时分叉了wip分支,我将非常感激。目前它位于此处

https://github.com/raveren/kint/tree/1.0.0-wip

稳定的master分支通常落后,并且很少批量更新测试功能。

许可

MIT许可下授权