Skip to content

Commit

Permalink
Market fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sergejey committed May 17, 2022
1 parent 5271bad commit 324a8aa
Show file tree
Hide file tree
Showing 4 changed files with 255 additions and 263 deletions.
14 changes: 9 additions & 5 deletions lib/common.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,8 @@ function runScheduledJobs()
$jobs[$i]['PROCESSED'] = 1;
$jobs[$i]['STARTED'] = date('Y-m-d H:i:s');

SQLUpdate('jobs', $jobs[$i], array('PROCESSED', 'STARTED'));
//SQLUpdate('jobs', $jobs[$i], array('PROCESSED', 'STARTED'));
SQLExec("UPDATE jobs SET PROCESSED=" . $jobs[$i]['PROCESSED'] . ", STARTED='" . $jobs[$i]['STARTED'] . "' WHERE ID=" . $jobs[$i]['ID']);

if ($jobs[$i]['COMMANDS'] != '') {
$url = BASE_URL . '/objects/?system_call=1&job=' . $jobs[$i]['ID'];
Expand Down Expand Up @@ -507,7 +508,7 @@ function getURLBackground($url, $cache = 0, $username = '', $password = '')
* @param mixed $password Password (default '')
* @return mixed
*/
function getURL($url, $cache = 0, $username = '', $password = '', $background = false)
function getURL($url, $cache = 0, $username = '', $password = '', $background = false, $curl_options = 0)
{
startMeasure('getURL');
$filename_part = preg_replace('/\W/is', '_', str_replace('http://', '', $url));
Expand Down Expand Up @@ -538,7 +539,7 @@ function getURL($url, $cache = 0, $username = '', $password = '', $background =
}

if ($username != '' || $password != '') {
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password);
}

Expand Down Expand Up @@ -579,10 +580,13 @@ function getURL($url, $cache = 0, $username = '', $password = '', $background =
endMeasure('curl_prepare');
startMeasure('curl_exec');

//curl_setopt($ch, CURLOPT_HEADER, 1);
if (is_array($curl_options)) {
foreach ($curl_options as $k => $v) {
curl_setopt($ch, $k, $v);
}
}
$result = curl_exec($ch);

//dprint($result,false);
endMeasure('curl_exec');

startMeasure('curl_post');
Expand Down
11 changes: 2 additions & 9 deletions lib/mysqli.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,18 +267,11 @@ public function Ping()
*/
public function Update($table, $data, $ndx = "ID")
{
$limit_fields = false;
$fields = array();
if (is_array($ndx)) {
$fields = $ndx;
$ndx = 'ID';
$limit_fields = true;
}
if (is_array($ndx)) $ndx='ID';
$qry = "UPDATE `$table` SET ";
$qry_fields = array();
foreach ($data as $field => $value) {
if (is_Numeric($field)) continue;
if ($limit_fields && !in_array($field, $fields)) continue;
if (is_Numeric($field) || $field == $ndx) continue;
if (!is_null($value)) {
$qry_fields[] = "`$field`='" . $this->DBSafe1($value) . "'";
} else {
Expand Down
Loading

0 comments on commit 324a8aa

Please sign in to comment.