ruudk/deprecation-contracts-with-backtrace
Composer 安装命令:
composer require ruudk/deprecation-contracts-with-backtrace
包简介
A generic function and convention to trigger deprecation notices
README 文档
README
A drop-in replacement for symfony/deprecation-contracts that includes a backtrace in deprecation messages.
The Problem
When Symfony or other packages trigger deprecation warnings, you often see messages like:
Since symfony/framework-bundle 6.4: The "foo" option is deprecated.
But where is this deprecation triggered from? Without a backtrace, you have to search your entire codebase to find the source.
The Solution
This package adds a backtrace to every deprecation message, so you'll see:
Since symfony/framework-bundle 6.4: The "foo" option is deprecated.
/var/www/app/src/Controller/MyController.php:42
/var/www/app/src/Service/MyService.php:87
/var/www/app/vendor/symfony/framework-bundle/Controller/AbstractController.php:123
...
Now you can immediately see where the deprecation is being triggered.
Installation
composer require ruudk/deprecation-contracts-with-backtrace
That's it! The package uses Composer's replace directive to automatically replace symfony/deprecation-contracts. No configuration needed.
How it Works
This package provides the same trigger_deprecation() function as Symfony's deprecation-contracts, but appends a backtrace (up to 10 frames) to the deprecation message. Since it declares "replace": {"symfony/deprecation-contracts": "self.version"} in its composer.json, Composer will use this package instead of the original.
License
MIT License - see the LICENSE file for details.
Based on symfony/deprecation-contracts by Fabien Potencier and the Symfony Community.
ruudk/deprecation-contracts-with-backtrace 适用场景与选型建议
ruudk/deprecation-contracts-with-backtrace 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 32.89k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 12 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 ruudk/deprecation-contracts-with-backtrace 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ruudk/deprecation-contracts-with-backtrace 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 32.89k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 31
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-18