Download the PHP package tourze/env-manage-bundle without Composer
On this page you can find all versions of the php package tourze/env-manage-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tourze/env-manage-bundle
More information about tourze/env-manage-bundle
Files in tourze/env-manage-bundle
Package env-manage-bundle
Short Description Symfony环境变量管理束,支持数据库存储和动态加载环境变量配置
License MIT
Informations about the package env-manage-bundle
Env Manage Bundle
中文
A Symfony bundle for managing environment variables in the database, supporting runtime loading, synchronization, and auditing.
This bundle provides a secure and flexible way to manage application configuration through database-stored environment variables, with automatic loading for HTTP requests, CLI commands, and message workers.
Table of Contents
- Features
- Requirements
- Installation
- Install via Composer
- Enable the Bundle
- Quick Start
- Configuration
- Security Configuration
- Admin Interface
- Caching
- Events and Extension Points
- Advanced Usage
- Documentation
- Testing
- Contributing
- Security
- Credits
- License
- Changelog
Features
- Database-driven Configuration: Store and manage environment variables in the database
- Runtime Loading: Automatically load variables for HTTP requests, CLI commands, and message workers
- Security First: Built-in protection against dangerous environment variables (LDPRELOAD, APP*, etc.)
- Full Audit Trail: Track all changes with Snowflake IDs, user, IP, and timestamps
- Fine-grained Control: Enable/disable individual variables, add remarks, control synchronization
- Cache Layer: High-performance caching with automatic invalidation on changes
- Admin Interface: Ready-to-use EasyAdmin CRUD controller for management
- JSON-RPC Support: Built-in procedure for fetching public configuration
- Twig Integration: Access environment variables directly in templates
Requirements
- PHP >= 8.1
- Symfony >= 6.4
- Doctrine ORM >= 2.20
Installation
Install via Composer
Enable the Bundle
Usually auto-registered via Symfony Flex. If not, add to config/bundles.php:
Quick Start
1. Create the Database Table
2. Add Environment Variables
3. Access Variables
Configuration
Security Configuration
The bundle automatically blocks dangerous environment variables:
LD_PRELOAD- Prevents injection attacksAPP_*- Protects Symfony core configurationDATABASE_*- Prevents database credential overrideREDIS_*- Protects cache configurationJWT_*- Secures authentication tokensMESSENGER_*- Protects message queue configurationLOCK_*- Prevents lock mechanism tampering
Admin Interface
Add to your EasyAdmin dashboard:
Caching
Environment variables are cached for 24 hours and automatically invalidated when:
- Any environment variable is created, updated, or deleted
- Cache is manually cleared
- Application is deployed
Events and Extension Points
Event Listeners
The bundle listens to:
KernelEvents::REQUEST- Load variables for HTTP requestsWorkerStartedEvent- Load variables for message workersConsoleEvents::COMMAND- Load variables for CLI commands (except cache commands)
Entity Events
Doctrine entity listeners automatically clear cache on:
postPersist- After creating new variablespostUpdate- After updating variablespostRemove- After deleting variables
Advanced Usage
Custom Environment Service
JSON-RPC Integration
Documentation
- Entity Design - Database schema and entity details
- Workflow - Visual workflow diagrams
- API Reference - Complete API documentation
Testing
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Development Standards
- Follow PSR-12 coding standards
- Write tests for new features
- Run PHPStan (level 5) before submitting
- Update documentation as needed
- Add meaningful commit messages
Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
Credits
- Tourze Team
- All Contributors
License
The MIT License (MIT). Copyright (c) tourze. Please see License File for more information.
Changelog
See Releases for version history and upgrade notes.
All versions of env-manage-bundle with dependencies
doctrine/doctrine-bundle Version ^2.13
doctrine/doctrine-fixtures-bundle Version ^4.0
doctrine/orm Version ^3.0
doctrine/persistence Version ^4.1
easycorp/easyadmin-bundle Version ^4
knplabs/knp-menu Version ^3.7
monolog/monolog Version ^3.1
psr/log Version ^3|^2|^1
symfony/cache Version ^7.3
symfony/cache-contracts Version ^3
symfony/config Version ^7.3
symfony/console Version ^7.3
symfony/dependency-injection Version ^7.3
symfony/doctrine-bridge Version ^7.3
symfony/dotenv Version ^7.3
symfony/event-dispatcher Version ^7.3
symfony/framework-bundle Version ^7.4
symfony/http-foundation Version ^7.4
symfony/http-kernel Version ^7.3
symfony/messenger Version ^7.3
symfony/property-access Version ^7.3
symfony/routing Version ^7.3
symfony/security-core Version ^7.3
symfony/twig-bundle Version ^7.3
symfony/yaml Version ^7.3
tourze/arrayable Version 1.*
tourze/bundle-dependency Version 1.*
tourze/doctrine-helper Version 1.0.*
tourze/doctrine-indexed-bundle Version 1.0.*
tourze/doctrine-ip-bundle Version 1.1.*
tourze/doctrine-snowflake-bundle Version 1.1.*
tourze/doctrine-timestamp-bundle Version 1.1.*
tourze/doctrine-track-bundle Version 1.1.*
tourze/doctrine-user-bundle Version 1.0.*
tourze/easy-admin-menu-bundle Version 1.0.*
tourze/json-rpc-cache-bundle Version 2.0.*
tourze/json-rpc-core Version 2.0.*
twig/twig Version ^3.21