valksor / php-spx-profiler
A Symfony profiler data collector for the SPX PHP profiler, which collects and displays profiling data for PHP applications
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/valksor/php-spx-profiler
This package is auto-updated.
Last update: 2025-11-09 02:27:08 UTC
README
A Symfony profiler data collector for the SPX PHP profiler, which collects and displays detailed profiling data for PHP applications. This component integrates SPX profiling directly into the Symfony web profiler for easy access to performance metrics during development.
Installation
Install the package via Composer:
composer require valksor/php-spx-profiler
Requirements
- PHP 8.4 or higher
- SPX PHP extension installed and configured
- Symfony Framework (7.2.0 or higher)
- Valksor Bundle for automatic configuration
Configuration
The SpxProfiler component has a simple configuration with a single user-configurable option:
# config/packages/valksor.yaml valksor: spx_profiler: enabled: true # Enable/disable the SPX profiler integration
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
enabled |
boolean | true |
Enable or disable the SPX profiler data collector |
See: SpxProfilerConfiguration.php for the complete configuration schema.
Features
The SpxProfiler component provides comprehensive profiling integration for Symfony applications:
- Symfony Profiler Integration: Seamless integration with Symfony's web profiler toolbar
- SPX Data Collection: Automatic collection and display of detailed SPX profiling metrics
- Real-time Performance Metrics: Wall time, memory usage, call graphs, and execution traces
- Request Matching: Automatic matching of SPX reports with Symfony profiler requests
- Development Workflow: Streamlined profiling setup for development environments
Viewing Profiling Data
Once the component is installed and enabled, you can view profiling data in the Symfony web profiler:
- Enable SPX profiling for a request by adding the SPX_KEY parameter to the URL or setting the SPX_ENABLED cookie to 1
- Make a request to your application
- Open the Symfony web profiler for that request
- Click on the SPX tab to view the profiling data
Prerequisites
The SpxProfiler component requires the SPX PHP extension to be installed and configured separately. For SPX extension setup instructions, see the SPX documentation.
Contributing
Contributions are welcome!
- Code style requirements (PSR-12)
- Testing requirements for PRs
- One feature per pull request
- Development setup instructions
To contribute to SpxProfiler component:
- Fork the repository
- Create a feature branch (
git checkout -b feature/spx-enhancement) - Implement your enhancement following existing patterns
- Add comprehensive tests for new functionality
- Ensure all tests pass and code style is correct
- Submit a pull request
Adding New Profiling Features
When adding new profiling functionality:
- Extend the data collector to capture additional metrics
- Update Twig templates for displaying new data
- Add configuration options for new features
- Test integration with SPX extension
- Update documentation with examples
Security
If you discover any security-related issues, please email us at packages@valksor.com instead of using the issue tracker.
Support
- Documentation: Full documentation
- Issues: GitHub Issues for bug reports and feature requests
- Discussions: GitHub Discussions for questions and community support
- Stack Overflow: Use tag
valksor-php-spx-profiler - SPX Extension: SPX GitHub for extension-specific issues
Credits
- Original Author - Creator and maintainer
- All Contributors - Thank you to all who contributed
- SPX Author - Creator of the SPX PHP profiler extension
- Symfony Profiler Team - Profiler framework and best practices inspiration
- Valksor Project - Part of the larger Valksor PHP ecosystem
License
This package is licensed under the BSD-3-Clause License.
About Valksor
This package is part of the valksor/php-valksor project - a comprehensive PHP library and Symfony bundle that provides a collection of utilities, components, and integrations for Symfony applications.
The main project includes:
- Various utility functions and components
- Doctrine ORM tools and extensions
- API Platform integrations
- Symfony bundle for easy configuration
- And much more
If you find this SpxProfiler component useful, you might want to check out the full Valksor project for additional tools and utilities that can enhance your Symfony application development.
To install the complete package:
composer require valksor/php-valksor