PHP code example of e-artspace / pimple-env-provider
1. Go to this page and download the library: Download e-artspace/pimple-env-provider library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
e-artspace / pimple-env-provider example snippets
putenv('DEBUG_APP=false');
$container = new \Pimple\Container([
'debug.app'=> true
]);
$container->register(new \EnvProvider\EnvProvider([
'env.vars'=>[
'debug.app'=>'env.cast.boolean'
]
]);
assert($container['debug.app'] === true);
$container['env.overload']; // this do the magic
assert($container['debug.app'] === false);