enjoys / dotenv-writer
description
0.1.4
2023-01-22 17:30 UTC
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: 2024-11-05 02:18:09 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()