Use an INI-style configuration file

Replace web/lib/config.inc.php with an INI-style configuration file.
This allows us to get rid of several globals and makes it easier to use
the same configuration file in external scripts.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2014-10-24 08:31:47 +02:00
parent a0a5230708
commit 76343fb915
24 changed files with 200 additions and 216 deletions

View file

@ -8,10 +8,14 @@ if (empty($dir)) {
}
set_include_path(get_include_path() . PATH_SEPARATOR . "$dir/lib");
include("config.inc.php");
include("confparser.inc.php");
$user = config_get('database', 'user');
$password = config_get('database', 'password');
$name = config_get('database', 'name');
exec($dir . "/../scripts/aurblup/aurblup " .
"-S /var/run/mysqld/mysqld.sock " .
"-u " . escapeshellarg(AUR_db_user) . " " .
"-p " . escapeshellarg(AUR_db_pass) . " " .
"-D " . escapeshellarg(AUR_db_name));
"-u " . escapeshellarg($user) . " " .
"-p " . escapeshellarg($password) . " " .
"-D " . escapeshellarg($name));