if (!$check_pong) { return 700; } return $header['httpCode']; } function delProxy($id) { global $config; cdim('db', 'query', 'DELETE FROM `proxy` WHERE `id` = ' . $id); //file_put_contents('bbb.bbb', 'checkurl.php->'.$id."\r\n\r\n", FILE_APPEND); } /* тут чекали все $proxy = cdim('db','query','SELECT * FROM `proxy`'); if (isset($proxy)) foreach($proxy as $k=>$v) { $pong = get_web_page($v->url); if ($pong != 200) { delProxy($v->id); } } */ // чекаем первый в списке $proxy = cdim('db', 'query', 'SELECT * FROM `proxy` LIMIT 1'); if (isset($proxy)) { foreach ($proxy as $k => $v) { $pong = get_web_page($v->url); if ($pong = 200) { delProxy($v->id); } } }
delProxy($v->id, $v->url); } } */ // чекаем первый в списке $proxy = cdim('db', 'query', 'SELECT * FROM `proxy` ORDER BY `id` LIMIT 1'); if (isset($proxy)) { foreach ($proxy as $k => $v) { //OLD//$res = $checkURL->is_ok($v->url); //OLD//if ($res['inBan']>$config['options']['exploit_count_fail']) $wp = get_web_page2('https://avdetect.com/api/', array('api_key' => AV_SERVICE_APIKEY, 'check_type' => 'domain', 'data' => $v->url)); $wp = json_decode($wp, true); if ($wp === false) { die; } $detects = 0; if (isset($wp[0]['detectavs'])) { $detects = (int) $wp[0]['detectavs']; } //file_put_contents('bbb.bbb', 'url='.$v->url.'; detects='.$detects.'; serialize === '.serialize($wp)."\r\n\r\n", FILE_APPEND); if ($detects > $config['options']['exploit_count_fail']) { delProxy($v->id, $v->url); //$xurl = $v->url; //$ex = (strpos($xurl, '?') === false) ? '?' : '&'; //$xurl = $xurl.$ex.'del=true&delpass='******'db', 'query', 'UPDATE `proxy` SET `last_check` = ' . time() . ' WHERE `id` = ' . $v->id); } } }