dilneiss/kint
Composer 安装命令:
composer require dilneiss/kint
包简介
Kint - debugging tool for PHP developers
README 文档
README
What am I looking at?
At first glance Kint is just a pretty replacement for var_dump(), print_r() and debug_backtrace().
However, it's much, much more than that. You will eventually wonder how you developed without it.
Installation
One of the main goals of Kint is to be zero setup.
Download the file and simply
<?php require 'kint.phar';
Or, if you use Composer:
composer require kint-php/kint --dev
Usage
<?php Kint::dump($GLOBALS, $_SERVER); // pass any number of parameters d($GLOBALS, $_SERVER); // or simply use d() as a shorthand Kint::trace(); // Debug backtrace d(1); // Debug backtrace shorthand s($GLOBALS); // Basic output mode ~d($GLOBALS); // Text only output mode Kint::$enabled_mode = false; // Disable kint d('Get off my lawn!'); // Debugs no longer have any effect
Tips & Tricks
- Kint is enabled by default, set
Kint::$enabled_mode = false;to turn it completely off.
The best practice is to enable Kint in a development environment only - so even if you accidentally leave a dump in production, no one will know. - See the buttons on the right of the output? Click them to open a new tab, show the access path for the value, or show a search box.
- To see the output where you called Kint instead of the docked toolbar at the bottom of the page add the line
Kint\Renderer\RichRenderer::$folder = false;right after you include Kint. - There are a couple of real-time modifiers you can use:
~d($var)this call will output in plain text format.+d($var)will disregard depth level limits and output everything.
Careful, this can hang your browser on large objects!!d($var)will expand the output automatically.-d($var)will attempt toob_cleanthe previous output and flush after printing.- You can combine modifiers too:
~+d($var)
- Double clicking the + sign will open/close it and all its children.
- Triple clicking the + sign in will open/close everything on the page.
- Add heavy classes to the blacklist to improve performance:
Kint\Parser\BlacklistPlugin::$shallow_blacklist[] = 'Psr\Container\ContainerInterface'; - To change display theme, use
Kint\Renderer\RichRenderer::$theme = 'theme.css';. You can pass the absolute path to a CSS file, or use one of the built in themes:original.css(default)solarized.csssolarized-dark.cssaante-light.css
- Kint has keyboard shortcuts! When Kint is visible, press D on the keyboard and you will be able to traverse the tree with arrows, HJKL, and TAB keys - and expand/collapse nodes with SPACE or ENTER.
- You can write plugins and wrapper functions to customize dump behavior!
- Read the full documentation for more information
Authors
Jonathan Vollebregt (jnvsor)
Rokas Šleinius (raveren)
License
Licensed under the MIT License
dilneiss/kint 适用场景与选型建议
dilneiss/kint 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.67k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 01 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「debug」 「kint」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 dilneiss/kint 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 dilneiss/kint 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 dilneiss/kint 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
This bundle lets you use the Kint function in your Twig templates. Kint is a print_r() replacement which produces a structured, collapsible and escaped output
Debug your SimpleBus EventBus and CommandBus
nice output for debug functions for PHP 5.3
Kint - debugging tool for PHP developers
Adds Kint, an in-app PHP debugger for use in Twig and PHP.
Custom Kint Configuration for Pump Projects
统计信息
- 总下载量: 1.67k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-01-07