enjoys / dotenv-writer
description
Installs: 1 008
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=8.0
- enjoys/dotenv: ^3.0
Requires (Dev)
- enjoys/functions: ^2.4
- infection/infection: ^0.26.14
- phpunit/phpunit: ^9.5
- symfony/var-dumper: ^6.0
This package is auto-updated.
Last update: 2025-01-05 02:41:40 UTC
README
$envPath = __DIR__.'/.env'; $dotenvWriter = new \Enjoys\DotenvWriter\DotenvWriter($envPath); $dotenvWriter->addLine( new \Enjoys\Dotenv\Parser\Lines\CommentLine('sdfghj') ); $dotenvWriter->addLine( new \Enjoys\Dotenv\Parser\Lines\EmptyLine() ); $dotenvWriter->addLine( new \Enjoys\Dotenv\Parser\Lines\EnvLine( new \Enjoys\Dotenv\Parser\Env\Key('VAR'), new \Enjoys\Dotenv\Parser\Env\Value('value'), new \Enjoys\Dotenv\Parser\Env\Comment('comment') ) ); $dotenvWriter->addLines([ //... ]); $dotenvWriter->setEnv('KEY', 'Value', 'Comment') $dotenvWriter->setEnvIf('KEY', 'newValue', 'conditionValue') $dotenvWriter->addEnvIfNotExist()