Browse Source

Config file location can be configured by ENV var

tags/1.0.0
Victor Laborie 8 months ago
parent
commit
5844e0ef54
2 changed files with 3 additions and 3 deletions
  1. 1
    2
      htdocs/index.php
  2. 2
    1
      htdocs/lib/Config.php

+ 1
- 2
htdocs/index.php View File

@@ -4,8 +4,7 @@ spl_autoload_register(function ($class) {
if (file_exists("lib/$class.php")) { require_once("lib/$class.php"); }
});

Config::load('../config/config.ini');

Config::load();
Logger::init();
MailNotify::init();


+ 2
- 1
htdocs/lib/Config.php View File

@@ -2,7 +2,8 @@

class Config {
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);
self::$name = $ini['global']['name'];
self::$mail = $ini['global']['mail'];

Loading…
Cancel
Save