You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
684 B
PHP
23 lines
684 B
PHP
<?php
|
|
/** @noinspection PhpIllegalPsrClassPathInspection */
|
|
|
|
require_once __DIR__ . '/../vendor/autoload.php';
|
|
require_once __DIR__ . '/TestEnum.php';
|
|
|
|
use jrosset\EnvReader\EnvConfig;
|
|
|
|
class Env extends EnvConfig {
|
|
protected function initialProperties (): array {
|
|
return [
|
|
'WEBSITE_MODE' => 'DEV',
|
|
'WEBSITE_NAME' => 'Generic site',
|
|
];
|
|
}
|
|
public function getConfigFilePath (): string {
|
|
return __DIR__ . '/.env';
|
|
}
|
|
}
|
|
|
|
var_dump(Env::getInstance()->getProperties());
|
|
var_dump(Env::getInstance()->getProperty('db_host', 'localhost'));
|
|
var_dump(Env::getInstance()->getPropertyAsEnum('test', TestEnum::class, TestEnum::Test1)); |