vencakrecl / nette-env
ENV variables helper for Nette framework
Installs: 76
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
pkg:composer/vencakrecl/nette-env
Requires
- php: >=5.6
- nette/di: ^2.3
Requires (Dev)
- phpunit/phpunit: ^5.7.9
This package is auto-updated.
Last update: 2025-11-19 23:21:13 UTC
README
Installation
composer install vencakrecl/nette-env
Usage
- bootstrap.php
use Nette\Configurator; use NetteEnv\NetteEnv; $configurator = new Configurator(); $envs = new NetteEnv(); $envs ->add('MYSQL_HOST', 'mariadb') ->add('MYSQL_PORT', '3306') ->add('MYSQL_USER', 'root') ->add('MYSQL_PASSWORD', 'root') ->add('MYSQL_DBNAME', 'test'); $configurator->addDynamicParameters($envs->getEnvs());
- config.neon
database: dsn: 'mysql:host=%MYSQL_HOST%:%MYSQL_PORT%;dbname=%MYSQL_DBNAME%' user: %MYSQL_USER% password: %MYSQL_PASSWORD%