parent
5b3260e669
commit
a2565e945f
@ -0,0 +1,5 @@
|
||||
WEBSITE_NAME=Foo
|
||||
|
||||
DB_NAME=Bar
|
||||
DB_LOGIN=Bar
|
||||
DB_PASS=*****
|
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/** @noinspection PhpIllegalPsrClassPathInspection */
|
||||
|
||||
require_once __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use jrosset\EnvReader\BaseEnv;
|
||||
|
||||
class Env extends BaseEnv {
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
protected const PATH_ENV = __DIR__ . '/.env';
|
||||
|
||||
protected function initProperties (): array {
|
||||
return [
|
||||
'WEBSITE_MODE' => 'DEV',
|
||||
'WEBSITE_NAME' => 'Generic site',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
var_dump(Env::getInstance()->getProperties());
|
||||
var_dump(Env::getInstance()->getProperty('db_host', 'localhost'));
|
Loading…
Reference in New Issue