Config file location can be configured by ENV var
This commit is contained in:
parent
0aeb74d63d
commit
5844e0ef54
|
@ -4,8 +4,7 @@ spl_autoload_register(function ($class) {
|
||||||
if (file_exists("lib/$class.php")) { require_once("lib/$class.php"); }
|
if (file_exists("lib/$class.php")) { require_once("lib/$class.php"); }
|
||||||
});
|
});
|
||||||
|
|
||||||
Config::load('../config/config.ini');
|
Config::load();
|
||||||
|
|
||||||
Logger::init();
|
Logger::init();
|
||||||
MailNotify::init();
|
MailNotify::init();
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
|
|
||||||
class Config {
|
class Config {
|
||||||
private static $name='Evoadmin Mail', $mail='root@localhost', $log_level='error', $ldap=array();
|
private static $name='Evoadmin Mail', $mail='root@localhost', $log_level='error', $ldap=array();
|
||||||
public static function load($file) {
|
public static function load() {
|
||||||
|
$file = getenv("EVOADMINMAIL_CONFIG_FILE") or $file = '../config/config.ini';
|
||||||
$ini = parse_ini_file($file, true);
|
$ini = parse_ini_file($file, true);
|
||||||
self::$name = $ini['global']['name'];
|
self::$name = $ini['global']['name'];
|
||||||
self::$mail = $ini['global']['mail'];
|
self::$mail = $ini['global']['mail'];
|
||||||
|
|
Loading…
Reference in New Issue