diff options
author | Liam McLoughlin <hexxeh@hexxeh.net> | 2011-07-24 03:10:52 +0100 |
---|---|---|
committer | Liam McLoughlin <hexxeh@hexxeh.net> | 2011-07-24 03:34:15 +0100 |
commit | bc79e5240cd4544c9f953c48ecafdf4693bd1d64 (patch) | |
tree | bc892a47d623cb16459dc60a8e4e890351ad0a0d /client.php | |
parent | Use config file, defines to control settings, more Zend standards work (diff) | |
download | gentoaster-bc79e5240cd4544c9f953c48ecafdf4693bd1d64.tar.gz gentoaster-bc79e5240cd4544c9f953c48ecafdf4693bd1d64.tar.bz2 gentoaster-bc79e5240cd4544c9f953c48ecafdf4693bd1d64.zip |
Adding RECAPTCHA, more standards work
Diffstat (limited to 'client.php')
-rw-r--r-- | client.php | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -3,7 +3,11 @@ // Gentoaster build daemon client // Licensed under GPL v3, see COPYING file - if(!isset($argv[1])) die("No config file provided\n"); + require_once "config.php"; + + if (!isset($argv[1])) { + die("No config file provided\n"); + } $client= new GearmanClient(); $client->addServer(); @@ -17,9 +21,11 @@ echo "Job sent, handle was ".$handle." - hash ".$handlehash."\n"; - $db = mysql_connect("localhost", "gentoaster", ""); - if(!$db) die("Could not connect to database ".mysql_error()); - mysql_select_db("gentoaster"); + $db = mysql_connect(MYSQL_HOSTNAME, MYSQL_USERNAME, MYSQL_PASSWORD); + if (!$db) { + die("Could not connect to database ".mysql_error()); + } + mysql_select_db(MYSQL_DATABASE); $query = "INSERT INTO builds (id, handle)". ." VALUES('".$handlehash."','".$handle."')"; mysql_query($query); |