承接 hackerpro536/kint 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hackerpro536/kint

Composer 安装命令:

composer require hackerpro536/kint

包简介

Kint - debugging helper for PHP developers. Version edited by Hackerpro536

README 文档

README

Installation and Usage

One of the main goals of Kint is to be zero setup.

Download the archive and simply

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

Or, if you use Composer:

"require": {
   "hackerpro536/kint": "^1.0"
}

Or just run composer require hackerpro536/kint

That's it, you can now use Kint to debug your code:

########## DUMP VARIABLE ###########################
Kint::dump($GLOBALS, $_SERVER); // pass any number of parameters

// or simply use d() as a shorthand:
d($_SERVER);


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


############# BASIC OUTPUT #########################
# this will show a basic javascript-free display
s($GLOBALS);


######### WHITESPACE FORMATTED OUTPUT ##############
# this will be garbled if viewed in browser as it is whitespace-formatted only
~d($GLOBALS); // just prepend with the tilde


########## MISCELLANEOUS ###########################
# this will disable kint completely
Kint::enabled(false);

ddd('Get off my lawn!'); // no effect

Kint::enabled(true);
ddd( 'this line will stop the execution flow because Kint was just re-enabled above!' );

Note, that Kint does have configuration (like themes and IDE integration!), but it's in need of being rewritten, so I'm not documenting it yet.

Tips & Tricks

  • Kint is enabled by default, call Kint::enabled(false); to turn its funcionality completely off. The best practice is to enable Kint in DEVELOPMENT environment only (or for example Kint::enabled($_SERVER['REMOTE_ADDR'] === '<your IP>');) - so even if you accidentally leave a dump in production, no one will know.
  • sd() and ddd() are shorthands for s();die; and d();die; respectively.
    • Important: The older shorthand dd() is deprecated due to compatibility issues and will eventually be removed. Use the analogous ddd() instead.
  • When looking at Kint output, press D on the keyboard and you will be able to traverse the tree with arrows and tab keys - and expand/collapse nodes with space or enter.
  • Double clicking the [+] sign in the output will expand/collapse ALL nodes; triple clicking big blocks of text will select it all.
  • Clicking the tiny arrows on the right of the output open it in a separate window where you can keep it for comparison.
  • To catch output from Kint just assign it to a variablebeta
$o = Kint::dump($GLOBALS); 
// yes, the assignment is automatically detected, and $o 
// now holds whatever was going to be printed otherwise.

// it also supports modifiers (read on) for the variable:
~$o = Kint::dump($GLOBALS); // this output will be in whitespace
  • 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 huge objects)
    • !d($var) will show expanded rich output.
    • -d($var) will attempt to ob_clean the previous output so if you're dumping something inside a HTML page, you will still see Kint output. You can combine modifiers too: ~+d($var)
  • To force a specific dump output type just pass it to the Kint::enabled() method. Available options are: Kint::MODE_RICH (default), Kint::MODE_PLAIN, Kint::MODE_WHITESPACE and Kint::MODE_CLI:
Kint::enabled(Kint::MODE_WHITESPACE);
$kintOutput = Kint::dump($GLOBALS); 
// now $kintOutput can be written to a text log file and 
// be perfectly readable from there
  • To change display theme, use Kint::$theme = '<theme name>'; where available options are: 'original' (default), 'solarized', 'solarized-dark' and 'aante-light'. Here's an (outdated) preview:
  • Kint also includes a naïve profiler you may find handy. It's for determining relatively which code blocks take longer than others:
Kint::dump( microtime() ); // just pass microtime()
sleep( 1 );
Kint::dump( microtime(), 'after sleep(1)' );
sleep( 2 );
ddd( microtime(), 'final call, after sleep(2)' );

hackerpro536/kint 适用场景与选型建议

hackerpro536/kint 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 19 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 08 月 19 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「php」 「debug」 「kint」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 hackerpro536/kint 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 hackerpro536/kint 我们能提供哪些服务?
定制开发 / 二次开发

基于 hackerpro536/kint 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 19
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 10
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-08-19