summaryrefslogtreecommitdiffstats
path: root/scripts/aurblup/aurblup-wrapper
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2014-10-24 08:31:47 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2014-10-24 10:03:54 +0200
commit76343fb91511b9f53e58b6c01b258bfe00ddb4c6 (patch)
tree60eb4d3727bae159a1807915a58348b210ead206 /scripts/aurblup/aurblup-wrapper
parenta0a523070847230565c2ad5993ee058ff475a8e1 (diff)
downloadaur-76343fb91511b9f53e58b6c01b258bfe00ddb4c6.tar.gz
aur-76343fb91511b9f53e58b6c01b258bfe00ddb4c6.tar.xz
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>
Diffstat (limited to 'scripts/aurblup/aurblup-wrapper')
-rwxr-xr-xscripts/aurblup/aurblup-wrapper12
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/aurblup/aurblup-wrapper b/scripts/aurblup/aurblup-wrapper
index b056030d..c7b20afe 100755
--- a/scripts/aurblup/aurblup-wrapper
+++ b/scripts/aurblup/aurblup-wrapper
@@ -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));