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.
PhpEnvReader/tests/test.php

23 lines
541 B
PHP

<?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'));