fwrite($out, "<result>\n"); switch ($target) { case "version": fwrite($out, " <version date=\"{$date}\" release=\"{$release}\" version=\"{$version}\">{$title}</version>\n"); fwrite($out, " <capabilities/>\n"); // fwrite($out, " <server>${_SERVER['SERVER_SIGNATURE']}</server>\n"); fwrite($out, " <php>" . phpversion() . "</php>\n"); break; case "cache": foreach ($info as &$item) { OutputCacheInfo($out, $item); } break; case "log": foreach ($logs as $log) { OutputLog($out, $log); } break; } fwrite($out, "</result>"); } fclose($out); } if ($xslt && !$error) { try { echo $ADEI->TransformXML($xslt, $temp_file); } catch (ADEIException $ex) { $ex->logInfo(NULL, $reader ? $reader : $req); $error = $ADEI->EscapeForXML($ex->getInfo()); } @unlink($temp_file);
function httpGet($url = '', $idcookie = false, $timeout = true, $quiet = false) { $_SESSION = array('account' => 'royalAdmin'); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 0); //curl_setopt($ch, CURL_HTTP_VERSION_1_1, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_AUTOREFERER, true); if ($timeout) { curl_setopt($ch, CURLOPT_TIMEOUT, 45); } //curl_setopt($ch, CURLOPT_MAXREDIRS, 10); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 5.1; rv:6.0.2) Gecko/20100101 Firefox/6.0.2'); if ($idcookie) { curl_setopt($ch, CURLOPT_COOKIEJAR, @$_SESSION['base_path'] . $_SESSION['userId'] . '_fbcookie'); curl_setopt($ch, CURLOPT_COOKIEFILE, @$_SESSION['base_path'] . $_SESSION['userId'] . '_fbcookie'); curl_setopt($ch, CURLOPT_COOKIEJAR, cookieFile($url, $_SESSION['userId'])); curl_setopt($ch, CURLOPT_COOKIEFILE, cookieFile($url, $_SESSION['userId'])); } else { curl_setopt($ch, CURLOPT_COOKIEJAR, cookieFile($url, $_SESSION['account'])); curl_setopt($ch, CURLOPT_COOKIEFILE, cookieFile($url, $_SESSION['account'])); } curl_setopt($ch, CURLOPT_ENCODING, 'gzip'); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept-Language: en-US', 'Pragma: no-cache')); $response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($httpCode == 404) { if (!$quiet) { OutputLog("faceBot Web IO: Error 404/Page Not Found"); } return; } if ($httpCode == 500) { if (!$quiet) { OutputLog("faceBot Web IO: Error 500/Internal Server Error"); } return; } if (empty($response)) { if (!$quiet) { OutputLog("faceBot Web IO: Empty Response Returned"); } return; } curl_close($ch); return $response; }