lonnieezell/codeigniter-forensics
最新稳定版本:v1.1
Composer 安装命令:
composer require lonnieezell/codeigniter-forensics
包简介
A high-powered, customizable Profiler replacement for CodeIgniter.
README 文档
README
Forensics is a high-powered, completely customizable replacement for the CodeIgniter Profiler.
What's New?
Forensics adds a few things to the stock Profiler that should make your life as a developer a bit easier. At least when it comes to debugging.
- The Profiler output is now completely skinnable. If you've read the comments in the Profiler class before, this is something that the EllisLab devs have said for a while it would be nice to do. Congrats. It's done.
- The output now also includes a list of all files that your CodeIgniter app includes, as well as their location (relative to your FCPATH).
- Output also has the ability to log items and track memory in your project via a new console class.
- Any variables sent to the view are shown in the bar.
- Forensics now provides a detailed look at queries run via Illuminate Database.
The default look, and some of the additional functionality, was heavily inspired by ParticleTree's PHP Quick Profiler.
Installing
Forensics is intended to be used as a Spark. However, it is best installed using Composer.
Create a composer.json file in your application's root (alongside the application and spark folders). Add the following text in the new file:
{ "require": { "lonnieezell/codeigniter-forensics": "dev-master" } } Thanks to the magic of compwright/composer-installers the files are transferred to your application's third_party folder. In your application, you will first need to load the newly installed package. This is done easily through the autoloader, but could also be done in your controller with an environment check for maximum optimization.
$autoload['packages'] = array(APPPATH.'third_party/codeigniter-forensics'); Then, just enable the profiler like normal.
$this->output->enable_profiler(true); Forensics Logging
In addition to the normal information that CI's Profiler provides, you now have two new logging commands at your disposal that work with the Forensics Profiler:
Console::log($data)
This function accepts any data type and simply creates a pretty, readable output of the variable, using print_r(). Very handy for logging where you are in the script execution, or outputting the contents of an array, or stdObject to your new 'console'.
Console::log_memory($variable, $name)
The log_memory function has two uses.
-
When no parameters are passed in, it will record the current memory usage of your script. This is perfect for watching a loop and checking for memory leaks.
-
If you pass in the $variable and $name parameters, will output the amount of memory that variable is using to the console.
In order to use either of these functions, you must be sure to load the Console library before you use it.
Illuminate Database Queries
In addition to CodeIgniter database queries, Forensics can display information about any queries run by Illuminate Database models or the Eloqeunt query builder. This feature is disabled by default. To enable this feature, change the config setting for eloquent in config/profiler.php. If you're using Illuminate Database in your project, note that this feature requires Capsule\Manager.
Other Tips
You can change the location of the profiler bar by changing the $bar_location variable at the top of the profiler_template view to one of the following locations:
- top-right
- top-left
- bottom-left
- bottom-right
- top
- bottom
lonnieezell/codeigniter-forensics 适用场景与选型建议
lonnieezell/codeigniter-forensics 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 40.62k 次下载、GitHub Stars 达 197, 最近一次更新时间为 2026 年 01 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「debug」 「codeigniter」 「profiler」 「spark」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 lonnieezell/codeigniter-forensics 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 lonnieezell/codeigniter-forensics 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 lonnieezell/codeigniter-forensics 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
g4 application profiler package
Debug your SimpleBus EventBus and CommandBus
nice output for debug functions for PHP 5.3
The CodeIgniter Redis package
Analysis module for finding problematical shop data.
Twig extensions for Tracy Debugger
统计信息
- 总下载量: 40.62k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 199
- 点击次数: 44
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-04