henrik/environment

environment

Installs: 33

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/henrik/environment

1.0.1 2019-09-05 11:51 UTC

This package is auto-updated.

Last update: 2025-10-17 08:36:38 UTC


README

The basic usage of library

Here is our simple.ini file

[app]
env=dev
environments[]=dev
environments[]=prod
environments[]=local

[parameters]
basePath = /..
viewDirectory = ${parameters:basePath}/templates
serviceExcludedPaths[] = Core
serviceExcludedPaths[] = Entity
serviceExcludedPaths[] = Repository
sourcesRootPath = ${parameters:basePath}/src
assetsDir = ${parameters:basePath}/public
rootNamespace = \Hk\App
sessionSavePath = ${parameters:basePath}/var/session/
logsSaveDirectory = ${parameters:basePath}/var/logs/
[services]
Hk\App\FignyaInterface = \Hk\App\Fignya
$iniConfigParser = new IniEnvironmentParser();
$env             = new Environment($iniConfigParser);
$env->load(__DIR__.'/stubs/env.ini');

//here parameters is our section name 
//get method returns array of parameters in this point
//and we can work with them as php assoc array
$env->get('parameters')['basePath'];