hasnrizvee/dep-reaper
Composer 安装命令:
composer require hasnrizvee/dep-reaper
包简介
DepReaper: The ultimate PHP static analysis tool to find and remove unused Composer dependencies. Optimize your vendor directory with the Dependency Analyzer.
README 文档
README
Stop Bloating Your PHP Apps: Meet DepReaper
"Reap the dead weight from your PHP projects."
Dependency Bloat costs you money and time. It causes slower Docker builds, larger server images, and opens you up to security vulnerabilities in unused code.
DepReaper is the ultimate solution. It goes beyond binary used/unused status by providing deep recursive analysis, health scores, security surface reports, and GitHub Actions native outputs.
Why DepReaper?
Compared to traditional tools like composer-unused, DepReaper introduces several next-generation features:
- The Analysis Engine: A high-performance symbol extractor that identifies classes, functions, and constants without executing the code.
- XDebug Stealth Mode: Automatically detects and bypasses XDebug to prevent performance bottlenecks and segmentation faults during analysis.
- Shadow Dependency Detection: Identifies packages that are required but never actually imported or utilized in the codebase.
- Ghost Filters: Advanced exclusion rules (Named and Pattern-based) to ignore legitimate "invisible" dependencies like polyfills or dev-tooling.
Benchmarks
DepReaper is aggressively optimized for speed. By automatically utilizing XDebug Stealth Mode, it achieves a scanning speed up to 10x faster than running with XDebug overhead on typical manual audits.
Installation
Download the PHAR directly and run it anywhere:
curl -LO https://github.com/rizvee/dep-reaper/releases/latest/download/dep-reaper.phar chmod +x dep-reaper.phar mv dep-reaper.phar /usr/local/bin/dep-reaper
How to remove unused PHP packages
Run the analyzer from the root of your project:
dep-reaper --output=compact
Or run with auto-remove (dry run prompt included):
dep-reaper --fix
Configuration
Use a dep-reaper.php file in your project root to configure the DependencyAnalyzer. You can exclude specific folders or internal packages from the analysis:
<?php use DepReaper\Engine\Configuration\Configuration; use DepReaper\Engine\Filter\NamedFilter; use DepReaper\Engine\Filter\PatternFilter; return static function (Configuration $config): void { // Tell the analyzer to ignore a specific package $config->addNamedFilter(NamedFilter::fromString('symfony/dotenv')); // Tell the analyzer to ignore all packages by an org $config->addPatternFilter(PatternFilter::fromString('/symfony\/.*/')); // Exclude additional files $config->setAdditionalFilesFor('my/package', [__DIR__ . '/bootstrap/app.php']); };
Speed up GitHub Actions by cleaning Composer dependencies
DepReaper runs natively in CI/CD pipelines, automatically detecting GITHUB_ACTIONS to output native error annotations (::error::).
- run: dep-reaper --output=github
Credits
dep-reaper is created and maintained by Hasan Rizvee.
Inspired by the original composer-unused by Andreas Frömer and contributors. This project is an independent reimagination with a different scope, architecture, and feature set. Logo and brand by Hasan Rizvee.
Built on top of nikic/php-parser, Symfony Console, and composer-unused/symbol-parser.
License: MIT.
hasnrizvee/dep-reaper 适用场景与选型建议
hasnrizvee/dep-reaper 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「dependency」 「composer」 「Audit」 「cleanup」 「unused」 「dead code」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 hasnrizvee/dep-reaper 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 hasnrizvee/dep-reaper 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 hasnrizvee/dep-reaper 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Log adding/updating/deleting of elements
Doctrine ORM provider for the auditor audit-log library.
PB Web Media Audit Bundle for Symfony
A fast and intuitive dependency injection container.
This composer plugin enables installation of GravityForms WordPress plugin and its addons.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 46
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-22