1. Go to this page and download the library: Download gmazzap/gea 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/ */
$gea->load(); # ok
$gea->load(); # throw an exception
$gea->write('A_VAR', 'A value'); # ok
$gea->write('A_VAR', 'Another value'); # throw an exception
$gea->discard('FOO');
unset($gea['FOO']);
$gea['FOO'] = 'First Value';
echo $gea['FOO']; # print 'First Value'
unset($gea['FOO']); # Without this an exception had been thrown on next line
$gea['FOO'] = 'Second Value';
echo $gea['FOO']; # Print 'Second Value'
namespace MyApp;
class App {
public function run(\ArrayAccess $configs) {
// bootstrap the application here
}
}
$gea = getenv('APP_ENV') === 'production'
? Gea\Gea::noLoaderInstance() # in production we load nothing
: Gea\Gea::instance(__DIR__); # in development we load .env file
$gea->addFilter(['DB_NAME', 'DB_USER', 'DB_PASS'] '