tourze / symfony-profiler-markdown-bundle
A Symfony bundle that exports Symfony Profiler data as Markdown format for easy sharing and archiving
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:symfony-bundle
pkg:composer/tourze/symfony-profiler-markdown-bundle
Requires
- doctrine/doctrine-bundle: ^2.13
- symfony/config: ^7.3
- symfony/dependency-injection: ^7.3
- symfony/doctrine-bridge: ^7.3
- symfony/event-dispatcher: ^7.3
- symfony/finder: ^7.3
- symfony/form: ^7.3
- symfony/framework-bundle: ^7.3
- symfony/http-foundation: ^7.3
- symfony/http-kernel: ^7.3
- symfony/property-access: ^7.3
- symfony/routing: ^7.3
- symfony/security-bundle: ^7.3
- symfony/twig-bundle: ^7.3
- symfony/yaml: ^7.3
- tourze/bundle-dependency: 1.*
- tourze/symfony-dependency-service-loader: 1.0.*
- tourze/symfony-routing-auto-loader-bundle: 1.0.*
- twig/twig: ^3.21
Requires (Dev)
This package is auto-updated.
Last update: 2025-11-16 08:37:07 UTC
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