定制 tourze/symfony-rotate-profile-storage-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

PHP Version License Build Status Code Coverage

English | 中文

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

  1. Install the bundle via Composer
  2. The bundle will automatically register itself in your Symfony application
  3. 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:

  1. When a new profile is written, it checks the current number of stored profiles
  2. If the count exceeds the configured limit, it triggers a cleanup
  3. The cleanup process removes old profiler files to free up disk space
  4. 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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-04-19