Reject the existence of corpnet updates, some minor changes

This commit is contained in:
whatever127
2019-07-27 19:43:02 +02:00
parent 0af760d408
commit dbd8b5f9c9
5 changed files with 28 additions and 7 deletions

View File

@ -1,6 +1,6 @@
<?php
/*
Copyright 2018 UUP dump API authors
Copyright 2019 whatever127
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -54,6 +54,11 @@ function genUUID() {
function sendWuPostRequest($url, $postData) {
$req = curl_init($url);
$proxy = uupDumpApiGetDebug();
if(isset($proxy['proxy'])) {
curl_setopt($req, CURLOPT_PROXY, $proxy['proxy']);
}
curl_setopt($req, CURLOPT_HEADER, 0);
curl_setopt($req, CURLOPT_POST, 1);
curl_setopt($req, CURLOPT_RETURNTRANSFER, 1);
@ -99,4 +104,12 @@ function consoleLogger($message, $showTime = 1) {
$msg = $currTime.$message;
fwrite(STDERR, $msg."\n");
}
?>
function uupDumpApiGetDebug() {
if(!file_exists('debug.ini')) {
return null;
}
$data = parse_ini_file('debug.ini');
return $data;
}