jobmetric/laravel-env-modifier
最新稳定版本:2.2.1
Composer 安装命令:
composer require jobmetric/laravel-env-modifier
包简介
This is a package for env modification the contents of different Laravel projects.
README 文档
README
Laravel Env Modifier
Manage .env Files. Safely and Easily.
Laravel Env Modifier simplifies working with .env files in Laravel applications. Stop managing environment files manually and start automating configuration management with confidence. It provides a clean API to create, read, merge, update, back up, restore, and delete .env files safely and predictably—perfect for deployment scripts, environment management, and configuration automation. This is where powerful file management meets developer-friendly simplicity—giving you complete control over your environment configuration without the complexity.
Why Laravel Env Modifier?
Safe File Operations
Laravel Env Modifier uses atomic writes with LOCK_EX to prevent race conditions when multiple processes access the same .env file. It also includes protection mechanisms to prevent accidental deletion of your main application .env file.
Smart Value Handling
The package automatically handles value normalization, escaping, and quoting. It intelligently quotes values containing spaces, special characters, or newlines, and properly handles booleans, arrays, and JSON data.
Preserves Comments and Formatting
Unlike many .env manipulation tools, Laravel Env Modifier preserves comments and blank lines in your .env files. It only modifies the specific keys you target, leaving the rest of your file structure intact.
Multiple File Support
Work with multiple .env files simultaneously. Create environment-specific files (.env.staging, .env.testing), merge configurations from templates, and manage different environments without code changes.
What is Env File Management?
Env file management is the process of programmatically reading, writing, and modifying environment configuration files. Traditional approaches often involve manual editing or fragile string manipulation, but Laravel Env Modifier provides a robust, safe solution:
- Atomic Operations: All file writes use exclusive locks to prevent corruption
- Key-Level Operations: Read, write, rename, and delete individual keys without affecting others
- File-Level Operations: Create, backup, restore, and delete entire
.envfiles - Merge Capabilities: Combine configurations from multiple files with filtering options
- Value Normalization: Automatically handles quoting, escaping, and type conversion
Consider a deployment script that needs to update environment variables based on the deployment environment. With Laravel Env Modifier, you can create environment-specific files, merge configurations from templates, set defaults, create backups before risky operations, and restore if something goes wrong. The power of env file management lies not only in programmatic access but also in making it safe, predictable, and easy to use throughout your application.
What Awaits You?
By adopting Laravel Env Modifier, you will:
- Automate deployments - Programmatically configure environments during deployment
- Simplify environment management - Manage multiple environments with ease
- Improve safety - Atomic writes and main
.envprotection prevent accidents - Preserve file structure - Comments and formatting remain intact
- Handle complex values - Automatic normalization for booleans, arrays, and JSON
- Maintain clean code - Simple, intuitive API that follows Laravel conventions
Quick Start
Install Laravel Env Modifier via Composer:
composer require jobmetric/laravel-env-modifier
Documentation
Ready to transform your Laravel applications? Our comprehensive documentation is your gateway to mastering Laravel Env Modifier:
The documentation includes:
- Getting Started - Quick introduction and installation guide
- EnvModifier - Complete API reference for file and key operations
- File Operations - Create, backup, restore, delete, and merge
.envfiles - Key Operations - Read, write, rename, delete, and check existence of keys
- Value Normalization - Automatic handling of booleans, arrays, JSON, and special characters
- Helper Functions - Convenient global helpers for common operations
- Real-World Examples - See how it works in practice
Contributing
Thank you for participating in laravel-env-modifier. A contribution guide can be found here.
License
The laravel-env-modifier is open-sourced software licensed under the MIT license. See License File for more information.
jobmetric/laravel-env-modifier 适用场景与选型建议
jobmetric/laravel-env-modifier 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 24 次下载、GitHub Stars 达 8, 最近一次更新时间为 2023 年 12 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「package」 「laravel」 「env」 「jobmetric」 「env file」 「env modifier」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 jobmetric/laravel-env-modifier 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jobmetric/laravel-env-modifier 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 jobmetric/laravel-env-modifier 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
An environment variable convenience library extension for vlucas/phpdotenv
Laravel dotenv manager
Utils to load, parse and work with configuration on Mezzio projects
Simple ASCII output of array data
Env builder is a package which collects different env files within a specified directory and compiles them into one single .env file, useful when you have different .env files laying around in different folders and you want to have one single big file that you can load with Symfony's DotEnv loader o
统计信息
- 总下载量: 24
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 22
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-12-19