Skip to content

vencakrecl/nette-env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ENV variables helper for Nette framework

Packagist version License Last test status

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%

About

Env variables helper for Nette Framework

Resources

License

Stars

Watchers

Forks

Packages

No packages published