tourze/symfony-rotate-profile-storage-bundle
最新稳定版本:0.1.1
Composer 安装命令:
composer require tourze/symfony-rotate-profile-storage-bundle
包简介
A Symfony bundle that provides automatic rotation and cleanup for Symfony Profiler storage files to prevent disk space issues
README 文档
README
A Symfony bundle that provides automatic rotation and cleanup for Symfony Profiler storage files to prevent disk space issues.
Installation
composer require tourze/symfony-rotate-profile-storage-bundle
Quick Start
This bundle automatically decorates the default Symfony profiler storage and provides automatic cleanup of old profiler files when the number of profiles exceeds a configurable limit.
Basic Usage
- Install the bundle via Composer
- The bundle will automatically register itself in your Symfony application
- Configure the rotation settings (optional)
Configuration
You can configure the rotation behavior using environment variables:
# Set the maximum number of profiles to keep (default: 1000)
ROTATE_PROFILE_STORAGE_KEEP_SIZE=1000
Features
- Automatic Rotation: Automatically cleans up old profiler files when the limit is reached
- Configurable Limits: Set custom limits for the number of profiles to keep
- Transparent Integration: Works seamlessly with existing Symfony profiler functionality
- Error Handling: Gracefully handles cleanup errors without affecting application performance
Example
// The bundle works automatically once installed // No manual configuration required // Optional: Set environment variable for custom limits $_ENV['ROTATE_PROFILE_STORAGE_KEEP_SIZE'] = 500;
How It Works
The bundle uses a decorator pattern to wrap the default Symfony profiler storage:
- When a new profile is written, it checks the current number of stored profiles
- If the count exceeds the configured limit, it triggers a cleanup
- The cleanup process removes old profiler files to free up disk space
- All operations are delegated to the original storage implementation
Requirements
- PHP 8.1 or higher
- Symfony 7.3 or higher
License
This bundle is released under the MIT License. See the LICENSE file for details.
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-04-19