tourze / env-manage-bundle
环境变量管理
Installs: 9
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^8.1
- doctrine/dbal: ^3.7.0 || ^4.0
- doctrine/doctrine-bundle: ^2.13
- doctrine/orm: ^2.20 || ^3.0
- doctrine/persistence: ^3.1 || ^4
- psr/log: ^3|^2|^1
- symfony/cache-contracts: ^3
- symfony/config: ^6.4
- symfony/console: ^6.4
- symfony/dependency-injection: ^6.4
- symfony/dotenv: ^6.4
- symfony/event-dispatcher: ^6.4
- symfony/framework-bundle: ^6.4
- symfony/http-kernel: ^6.4
- symfony/messenger: ^6.4
- tourze/arrayable: 0.0.*
- tourze/doctrine-indexed-bundle: 0.0.*
- tourze/doctrine-ip-bundle: 0.0.*
- tourze/doctrine-snowflake-bundle: 0.0.*
- tourze/doctrine-timestamp-bundle: 0.0.*
- tourze/doctrine-track-bundle: 0.0.*
- tourze/doctrine-user-bundle: 0.0.*
- tourze/easy-admin-attribute: 0.0.*
- twig/twig: ^3.13|^4.0
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^10.0
This package is auto-updated.
Last update: 2025-04-25 19:23:57 UTC
README
A Symfony bundle for managing environment variables in the database, supporting runtime loading, synchronization, and auditing.
Features
- Manage environment variables in database with full audit trail
- Runtime loading of variables for HTTP, CLI, and worker contexts
- Fine-grained control: enable/disable, sync control, remarks
- Snowflake ID, user/IP/time tracking for all changes
- Easy integration with Symfony events and Messenger
- Extensible via admin interface attributes
Installation
Requirements
- PHP >= 8.1
- Symfony >= 6.4
- Doctrine ORM >= 2.20
Install via Composer
composer require tourze/env-manage-bundle
Enable the Bundle
Usually auto-registered via Symfony Flex. If not, add to config/bundles.php
:
Tourze\EnvManageBundle\EnvManageBundle::class => ['all' => true],
Quick Start
- Run database migrations for the
base_env
table (see entity design in ENTITY_DESIGN.md) - Use the admin interface or Doctrine to add/edit environment variables
- On app start, HTTP request, CLI, or worker, variables are loaded and injected into
$_ENV
Example: Fetching Public Variables
/** @var \Tourze\EnvManageBundle\Service\EnvService $service */ $vars = $service->fetchPublicArray();
Documentation
- Entity Design
- Workflow (Mermaid)
- All variables are tracked for audit and can be filtered/synchronized as needed
- See code for advanced extension points and admin attributes
Contribution Guide
- Issues and PRs are welcome!
- Follow PSR coding standards
- Run tests and PHPStan before submitting
License
MIT License. Copyright (c) tourze
Changelog
See Releases for version history and upgrade notes.