function getVar($url, $url_comment, $url_changes, $id, $con) { $content = file_get_contents($url); $json = json_decode($content, true); $creator_email = $json['bugs'][0]['creator_detail']['email']; $component = $json['bugs'][0]['component']; $assigned_email = $json['bugs'][0]['assigned_to_detail']['email']; $priority = $json['bugs'][0]['priority']; $severity = $json['bugs'][0]['severity']; $platform = $json['bugs'][0]['platform']; $op_sys = $json['bugs'][0]['op_sys']; $resolution = $json['bugs'][0]['resolution']; $status = $json['bugs'][0]['status']; $creation_time = $json['bugs'][0]['creation_time']; $last_change_time = $json['bugs'][0]['last_change_time']; $target_milestone = $json['bugs'][0]['target_milestone']; $nr_cc_detail = count($json['bugs'][0]['cc_detail']); $json_c = getComments($url_comment); $nr_comments = count($json_c['bugs'][$id]['comments']); $json_ch = getChanges($url_changes); $nr_history = count($json_ch['bugs'][0]['history']); //insert into mysql table $sql = "INSERT INTO bug\n VALUES('{$id}', '{$creator_email}', '{$component}', '{$assigned_email}', '{$priority}', '{$severity}', '{$platform}', '{$op_sys}', '{$resolution}', '{$status}', '{$creation_time}', '{$last_change_time}', '{$target_milestone}', '{$nr_cc_detail}','{$nr_comments}','{$nr_history}')"; if (!mysql_query($sql, $con)) { die('Error : ' . mysql_error()); } else { echo 'inserito'; echo '<br>'; } /* (id, creator_email, component, assigned_email, priority, platform, op_sys, resolution, status, creation_time, last_change_time, target_milestone, nr_cc_detail, nr_comments, nr_history)*/ }
function getVar($url, $url_comment, $url_changes, $id, $con, $collection) { $json = acquisisci($url); //richiama la curl $creator_email = $json['bugs'][0]['creator_detail']['email']; $component = $json['bugs'][0]['component']; $assigned_email = $json['bugs'][0]['assigned_to_detail']['email']; $priority = $json['bugs'][0]['priority']; $severity = $json['bugs'][0]['severity']; $platform = $json['bugs'][0]['platform']; $op_sys = $json['bugs'][0]['op_sys']; $resolution = $json['bugs'][0]['resolution']; $status = $json['bugs'][0]['status']; $creation_time = $json['bugs'][0]['creation_time']; $last_change_time = $json['bugs'][0]['last_change_time']; $target_milestone = $json['bugs'][0]['target_milestone']; $nr_cc_detail = count($json['bugs'][0]['cc_detail']); $json_c = getComments($url_comment); $nr_comments = count($json_c['bugs'][$id]['comments']); $json_ch = getChanges($url_changes); $nr_history = count($json_ch['bugs'][0]['history']); /*insert into mysql table $sql = "INSERT INTO bug VALUES('$id', '$creator_email', '$creator_email', '$assigned_email', '$priority', '$severity', '$platform', '$op_sys', '$resolution', '$status', '$creation_time', '$last_change_time', '$target_milestone', '$nr_cc_detail','$nr_comments','$nr_history')"; if(!mysql_query($sql,$con)) { die('Error : ' . mysql_error()); } else { echo 'inserito'; echo '<br>'; } */ $collection->insert($json); /* //inserisco un documento nella collection appena selezionata $document = array( "id" => $id, "creator_email" => $creator_email, "assigned_email" => $assigned_email, "priority" => $priority, "severity", $severity, "platform" => $platform, "op_sys" => $op_sys, "resolution" => $resolution, "status" => $status, "creation_time" => $creation_time, "last_change_time" => $last_change_time, "target_milestone" => $target_milestone, "nr_cc_detail" => $nr_cc_detail, "nr_comments" => $nr_comments, "nr_history" => $nr_history ); $collection->insert($document); echo "<br>Document inserted successfully"; */ }
//Lets get to work! include 'upload.php'; $build = $_GET['buildid']; $branch = $_GET['branch']; $version = $_GET['version']; include '../build/function.php'; updateval($branch); if ($build == "" || $branch == "" || $version == "") { die('Invalid'); } //Don't upload dev builds atm. if ($branch == "bt2") { die; } sleep(60); $changes = getChanges($build, $branch); //uploadit($build, $branch, 'Essentials.jar', $version, $changes); //sleep(1); //uploadit($build, $branch, 'EssentialsChat.jar', $version, $changes); //sleep(1); //uploadit($build, $branch, 'EssentialsSpawn.jar', $version, $changes); //sleep(1); //uploadit($build, $branch, 'EssentialsProtect.jar', $version, $changes); //sleep(1); //uploadit($build, $branch, 'EssentialsXMPP.jar', $version, $changes); //sleep(1); //uploadit($build, $branch, 'EssentialsGeoIP.jar', $version, $changes); uploadit($build, $branch, 'Essentials.zip', $version, $changes); sleep(1); uploadit($build, $branch, 'Essentials-extra.zip', $version, $changes); ?>