diff options
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); |