tourze/symfony-profiler-markdown-bundle
Composer 安装命令:
composer require tourze/symfony-profiler-markdown-bundle
包简介
A Symfony bundle that exports Symfony Profiler data as Markdown format for easy sharing and archiving
README 文档
README
A Symfony bundle that exports Symfony Profiler data as Markdown format, making it easy to share and archive profiling reports.
🚀 Features
- Markdown Export: Export Symfony Profiler data to well-formatted Markdown
- Multiple Collectors: Supports all standard Symfony profiler collectors (Request, Time, Memory, Security, Doctrine, etc.)
- Extensible Formatters: Customizable formatter system for different data types
- Direct Access: Access profiler reports via
/_profiler/{token}.mdendpoint - Rich Formatting: Includes tables, code blocks, and emoji indicators for better readability
📦 Installation
Install the bundle using Composer:
composer require tourze/symfony-profiler-markdown-bundle
⚙️ Configuration
1. Enable the Bundle
Add the bundle to your config/bundles.php:
// config/bundles.php return [ // ... Tourze\ProfilerMarkdownBundle\ProfilerMarkdownBundle::class => ['all' => true], ];
2. Configure Dependencies
This bundle requires the following bundles:
DoctrineBundle(for database profiling)SecurityBundle(for security profiling)RoutingAutoLoaderBundle(for automatic route loading)
Make sure these are enabled in your application.
🔧 Usage
Basic Usage
Once installed, you can access any profiler report in Markdown format by visiting:
http://your-app.com/_profiler/{token}.md
Replace {token} with the actual profiler token from your Symfony toolbar.
Example URL
http://localhost:8000/_profiler/a1b2c3d.md
This will generate a comprehensive Markdown report including:
- Summary: Request overview with token, URL, method, status, time, IP
- Table of Contents: Navigation links to all collector sections
- Detailed Sections: Formatted data from each profiler collector:
- 📨 Request: HTTP request details, headers, parameters
- ⏱️ Performance: Execution time, timeline data
- 💾 Memory: Memory usage statistics
- 🔒 Security: Authentication and authorization details
- 🗄️ Database: Doctrine queries and performance metrics
- 🎨 Templates: Twig rendering information
- 📋 Logs: Application log entries
- And more...
🎨 Formatters
The bundle includes specialized formatters for different data types:
Built-in Formatters
- RequestFormatter: HTTP request/response data
- TimeFormatter: Performance timing data
- MemoryFormatter: Memory usage statistics
- SecurityFormatter: Security events and decisions
- DoctrineFormatter: Database queries and metrics
- TwigFormatter: Template rendering data
- LoggerFormatter: Log entries with levels and formatting
Custom Formatters
You can create custom formatters by implementing MarkdownFormatterInterface:
<?php use Tourze\ProfilerMarkdownBundle\Formatter\MarkdownFormatterInterface; use Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface; class CustomFormatter implements MarkdownFormatterInterface { public function supports(DataCollectorInterface $collector): bool { return $collector instanceof YourCustomCollector; } public function format(DataCollectorInterface $collector): array { // Return array of Markdown lines return [ "## Custom Data", "", "| Property | Value |", "|----------|-------|", "| Custom Field | Custom Value |", "", ]; } public function getPriority(): int { return 0; // Higher priority = earlier execution } }
🔍 Example Output
# Symfony Profiler Report --- ## 📊 Summary | Property | Value | |----------|-------| | **Token** | `a1b2c3d` | | **URL** | https://example.com/api/users | | **Method** | GET | | **Status** | 200 | | **Time** | 2024-01-15 14:30:25 | | **IP** | 127.0.0.1 | --- ## 📑 Table of Contents - [📨 Request](#request) - [⏱️ Performance](#time) - [💾 Memory](#memory) - [🔒 Security](#security) - [🗄️ Database](#doctrine) --- ## 📨 Request | Property | Value | |----------|-------| | Method | GET | | URI | /api/users | | Parameters | `{}` | | Headers | `{"host":"example.com",...}` |
🛠️ Development
Running Tests
composer test
Code Quality
composer phpstan
📄 Requirements
- PHP 8.1+
- Symfony 7.3+
- Doctrine Bundle
- Security Bundle
- Twig
📝 License
This bundle is licensed under the MIT License. See the LICENSE file for details.
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📞 Support
For issues and questions:
- Create an issue on GitHub
- Check the Symfony Documentation
tourze/symfony-profiler-markdown-bundle 适用场景与选型建议
tourze/symfony-profiler-markdown-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 11 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 tourze/symfony-profiler-markdown-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 tourze/symfony-profiler-markdown-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 25
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-11-14