本文整理汇总了PHP中ccurl::NoLocalProxy方法的典型用法代码示例。如果您正苦于以下问题:PHP ccurl::NoLocalProxy方法的具体用法?PHP ccurl::NoLocalProxy怎么用?PHP ccurl::NoLocalProxy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ccurl
的用法示例。
在下文中一共展示了ccurl::NoLocalProxy方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add_node
function add_node()
{
$sock = new sockets();
$ArticaMetaAddNewServ = unserialize($sock->GET_INFO("ArticaMetaAddNewServ"));
$ArticaMetaHost = $ArticaMetaAddNewServ["ArticaMetaHost"];
$ArticaMetaPort = $ArticaMetaAddNewServ["ArticaMetaPort"];
$ArticaMetaUsername = $ArticaMetaAddNewServ["ArticaMetaUsername"];
$ArticaMetaPassword = $ArticaMetaAddNewServ["ArticaMetaPassword"];
$change_uuid = $ArticaMetaAddNewServ["change_uuid"];
echo "ArticaMetaHost.........: {$ArticaMetaHost}\n";
echo "ArticaMetaPort.........: {$ArticaMetaPort}\n";
echo "ArticaMetaUsername.....: {$ArticaMetaUsername}\n";
echo "Testing authentication...\n";
add_node_progress("Authenticate to {$ArticaMetaHost}:{$ArticaMetaPort}", 10);
$array["username"] = $ArticaMetaUsername;
$array["password"] = $ArticaMetaPassword;
$ident = urlencode(base64_encode(serialize($array)));
$curl = new ccurl("https://{$ArticaMetaHost}:{$ArticaMetaPort}/artica.meta.listener.php?test-local-ident={$ident}");
$curl->NoHTTP_POST = true;
$curl->NoLocalProxy();
$curl->Timeout = 120;
if (!$curl->get()) {
echo @implode("\n", $curl->errors);
add_node_progress("{$curl->error}", 110);
die;
}
if (!preg_match("#<ARTICA_META>(.+?)</ARTICA_META>#is", $curl->data, $re)) {
echo "Expected <ARTICA_META>Someting...</ARTICA_META>";
add_node_progress("Communication: {failed}", 110);
die;
}
if ($re[1] != "SUCCESS") {
add_node_progress("Authenticate: {failed}", 110);
die;
}
echo "Testing authentication - success -...\n";
if ($change_uuid == 1) {
echo "Ask to remote server to change UUID...\n";
add_node_progress("{change_uuid}", 20);
$curl = new ccurl("https://{$ArticaMetaHost}:{$ArticaMetaPort}/artica.meta.listener.php?local-ident={$ident}&chuuid=yes");
$curl->NoHTTP_POST = true;
$curl->NoLocalProxy();
$curl->Timeout = 120;
if (!$curl->get()) {
echo @implode("\n", $curl->errors);
add_node_progress("{$curl->error}", 110);
die;
}
if (!preg_match("#<ARTICA_META>(.+?):(.+?)</ARTICA_META>#is", $curl->data, $re)) {
add_node_progress("{change_uuid}: Communication: {failed}", 110);
die;
}
add_node_progress("{change_uuid}:{$re[2]} {success}", 25);
echo "Ask to remote server to change UUID - success -...\n";
}
echo "Ask UUID to remote server...\n";
add_node_progress("{uuid}:", 30);
$curl = new ccurl("https://{$ArticaMetaHost}:{$ArticaMetaPort}/artica.meta.listener.php?local-ident={$ident}&GetYourUUID=yes");
$curl->NoHTTP_POST = true;
$curl->NoLocalProxy();
$curl->Timeout = 120;
if (!$curl->get()) {
echo @implode("\n", $curl->errors);
add_node_progress("{$curl->error}", 110);
die;
}
if (!preg_match("#<ARTICA_META>(.+?):(.+?)</ARTICA_META>#is", $curl->data, $re)) {
add_node_progress("{uuid}: Communication: {failed}", 110);
die;
}
$RESULT = $re[1];
$uuid = $re[2];
echo "UUID results:\n---------------------------------------------\n{$uuid}\n{$RESULT}\n---------------------------------------------\n";
if ($RESULT == "SUCCESS") {
add_node_progress("{uuid}: {$uuid} {success}", 35);
} else {
add_node_progress("{uuid}: {failed}", 110);
return;
}
echo "Ask to remote server to register to Artica Meta server ...\n";
add_node_progress("{order}: -> {register}", 50);
$ArticaMetaServerUsername = $sock->GET_INFO("ArticaMetaServerUsername");
$ArticaMetaServerPassword = $sock->GET_INFO("ArticaMetaServerPassword");
$ArticaMetaAddNewServ["ArticaMetaUsername"] = $ArticaMetaServerUsername;
$ArticaMetaAddNewServ["ArticaMetaPassword"] = $ArticaMetaServerPassword;
if ($GLOBALS["VERBOSE"]) {
$verbosed = "&verbose=yes";
}
$ArticaMetaAddNewServ_enc = urlencode(base64_encode(serialize($ArticaMetaAddNewServ)));
$curl = new ccurl("https://{$ArticaMetaHost}:{$ArticaMetaPort}/artica.meta.listener.php?local-ident={$ident}®isterby={$ArticaMetaAddNewServ_enc}{$verbosed}");
$curl->NoHTTP_POST = true;
$curl->NoLocalProxy();
$curl->Timeout = 120;
if (!$curl->get()) {
echo @implode("\n", $curl->errors);
add_node_progress("{$curl->error}", 110);
die;
}
if ($GLOBALS["VERBOSE"]) {
echo "***********************************\n{$curl->data}\n***********************************\n";
//.........这里部分代码省略.........
示例2: GetTargetedSize
function GetTargetedSize($URI)
{
$ExpectedSize = 0;
$curl = new ccurl($URI);
$curl->NoLocalProxy();
$Headers = $curl->getHeaders();
if (isset($Headers["Content-Length"])) {
return $Headers["Content-Length"];
}
if ($ExpectedSize == 0) {
if (isset($Headers["download_content_length"])) {
return $Headers["download_content_length"];
}
}
return 0;
}
示例3: register_lic
//.........这里部分代码省略.........
$LicenseInfos["license_number"] = null;
}
echo "License number:{$LicenseInfos["license_number"]}\n";
@mkdir($WORKDIR, 640, true);
if (isset($LicenseInfos["UNLOCKLIC"])) {
if (strlen($LicenseInfos["UNLOCKLIC"]) > 4) {
if (isset($LicenseInfos["license_number"])) {
if (strlen($LicenseInfos["license_number"]) > 4) {
$manulic = aef00vh567($uuid) . "-" . aef00vh567($LicenseInfos["license_number"]);
if ($manulic == $LicenseInfos["UNLOCKLIC"]) {
@file_put_contents($WORKPATH, "TRUE");
$LicenseInfos["license_status"] = "{license_active}";
$LicenseInfos["TIME"] = time();
$sock->SaveConfigFile(base64_encode(serialize($LicenseInfos)), "LicenseInfos");
if ($cmdADD != null) {
shell_exec($cmdADD);
}
build_progress("{license_active}", 80);
CheckLic($LicenseInfos, $WizardSavedSettings);
return;
}
}
}
}
}
$unix = new unix();
$URIBASE = $unix->MAIN_URI();
$URIBASE = str_replace("articatech.net", "artica.fr", $URIBASE);
$verbosed = "?VERBOSE=yes&time=" . time();
build_progress("Checking license on the cloud server...", 40);
echo "Contacting {$URIBASE}\n";
$curl = new ccurl("{$URIBASE}/shalla-orders.php", false, null, true);
echo "Set to not use Local proxy\n";
$curl->NoLocalProxy();
if ($GLOBALS["VERBOSE"]) {
$curl->parms["VERBOSE"] = yes;
}
$curl->parms["REGISTER-LIC"] = base64_encode(serialize($LicenseInfos));
$curl->parms["REGISTER-OLD"] = base64_encode(serialize($WizardSavedSettings));
echo "Send request... please wait...\n";
if (!$curl->get()) {
build_progress("Failed to contact cloud server", 110);
echo "Error: " . $curl->error . "\n";
echo @implode("\n", $curl->errors);
$LicenseInfos["TIME"] = time();
$LicenseInfos["license_status"] = "{registration_failed} {$curl->error}";
$sock->SaveConfigFile(base64_encode(serialize($LicenseInfos)), "LicenseInfos");
return;
}
echo "Request passed\n";
build_progress("Cheking license on the cloud server done.", 50);
if ($GLOBALS["VERBOSE"]) {
echo "***** {$curl->data} ****\n";
}
if (preg_match("#REGISTRATION_OK:\\[(.+?)\\]#s", $curl->data, $re)) {
build_progress("{waiting_approval} {success}", 100);
$LicenseInfos["license_status"] = "{waiting_approval}";
$LicenseInfos["license_number"] = $re[1];
$LicenseInfos["TIME"] = time();
$sock->SaveConfigFile(base64_encode(serialize($LicenseInfos)), "LicenseInfos");
@unlink($WORKPATH);
if ($cmdADD != null) {
shell_exec($cmdADD);
}
shell_exec("/usr/share/artica-postfix/bin/process1 --force --verbose " . time() . " >/dev/null 2>&1");
return;
示例4: register_lic
//.........这里部分代码省略.........
}
echo "License number:{$LicenseInfos["license_number"]}\n";
@mkdir($WORKDIR, 640, true);
if (isset($LicenseInfos["UNLOCKLIC"])) {
if (strlen($LicenseInfos["UNLOCKLIC"]) > 4) {
if (isset($LicenseInfos["license_number"])) {
if (strlen($LicenseInfos["license_number"]) > 4) {
$manulic = aef00vh567($uuid) . "-" . aef00vh567($LicenseInfos["license_number"]);
if ($manulic == $LicenseInfos["UNLOCKLIC"]) {
@file_put_contents($WORKPATH, "TRUE");
$LicenseInfos["license_status"] = "{license_active}";
$LicenseInfos["TIME"] = time();
$sock->SaveConfigFile(base64_encode(serialize($LicenseInfos)), "LicenseInfos");
if ($cmdADD != null) {
shell_exec($cmdADD);
}
build_progress("{license_active}", 80);
CheckLic($LicenseInfos, $WizardSavedSettings);
return;
}
}
}
}
}
$unix = new unix();
$URIBASE = $unix->MAIN_URI();
$URIBASE = str_replace("articatech.net", "artica.fr", $URIBASE);
$verbosed = "?VERBOSE=yes&time=" . time();
build_progress("Checking license on the cloud server...", 40);
echo "Contacting {$URIBASE}\n";
$curl = new ccurl("{$URIBASE}/shalla-orders.php", false, null);
if ($ArticaProxyServerEnabled != "yes") {
echo "* * * Set to not use Local proxy * * *\n";
$curl->NoLocalProxy();
}
if ($GLOBALS["VERBOSE"]) {
$curl->parms["VERBOSE"] = yes;
}
$curl->parms["REGISTER-LIC"] = base64_encode(serialize($LicenseInfos));
$curl->parms["REGISTER-OLD"] = base64_encode(serialize($WizardSavedSettings));
echo "Send request... please wait...\n";
if (!$curl->get()) {
build_progress("Failed to contact cloud server", 110);
echo "Error: " . $curl->error . "\n";
echo @implode("\n", $curl->errors);
$LicenseInfos["TIME"] = time();
$LicenseInfos["license_status"] = "{registration_failed} {$curl->error}";
$sock->SaveConfigFile(base64_encode(serialize($LicenseInfos)), "LicenseInfos");
if (!is_file("/etc/artica-postfix/REGISTRATION_FAILED_TIME")) {
@file_put_contents("/etc/artica-postfix/REGISTRATION_FAILED_TIME", time());
$sock->SaveConfigFile(base64_encode(serialize($LicenseInfos)), "LicenseInfos");
return;
}
$LastTime = intval(@file_get_contents("/etc/artica-postfix/REGISTRATION_FAILED_TIME"));
if ($LastTime == 0) {
@file_put_contents("/etc/artica-postfix/REGISTRATION_FAILED_TIME", time());
$sock->SaveConfigFile(base64_encode(serialize($LicenseInfos)), "LicenseInfos");
return;
}
$TimeMin = $unix->time_min($LastTime);
if ($TimeMin > 10080) {
if (is_file($WORKPATH)) {
@unlink($WORKPATH);
squid_admin_mysql(0, base64_decode("Q2Fubm90IGNvbnRhY3QgY2xvdWQgc2VydmVyIHNpbmNlIDcgZGF5cywgdHVybiB0byBDb21tdW5pdHkgRWRpdGlvbg=="), $function_ghost, $line_ghost);
$LicenseInfos["license_status"] = $error1;
$LicenseInfos["license_number"] = "";
示例5: register_lic_kaspersky
function register_lic_kaspersky()
{
$sock = new sockets();
$unix = new unix();
$WizardSavedSettings = unserialize(base64_decode($sock->GET_INFO("WizardSavedSettings")));
if ($GLOBALS["VERBOSE"]) {
echo __FUNCTION__ . "::" . __LINE__ . "\n";
}
$uuid = $unix->GetUniqueID();
if ($GLOBALS["VERBOSE"]) {
echo " *************** \n\n UUID : {$uuid} \n\n ***************\n";
}
if ($uuid == null) {
if ($GLOBALS["VERBOSE"]) {
echo "No system ID !\n";
}
return;
}
$WizardSavedSettings["UUID"] = $uuid;
$unix = new unix();
$URIBASE = $unix->MAIN_URI();
$URIBASE = str_replace("articatech.net", "artica.fr", $URIBASE);
$verbosed = null;
$php = $unix->LOCATE_PHP5_BIN();
$nohup = $unix->find_program("nohup");
$KasperskyAskQuoteResults = $sock->GET_INFO("KasperskyAskQuoteResults");
if ($KasperskyAskQuoteResults == "KEY_OK") {
return;
}
if (is_file("/etc/artica-postfix/artica-iso-first-reboot")) {
$zDate = filemtime("/etc/artica-postfix/artica-iso-first-reboot");
$WizardSavedSettings["INSTALL_DATE"] = date("Y-m-d H:i:s", $zDate);
} else {
$zDate = filemtime("/etc/artica-postfix/.");
$WizardSavedSettings["INSTALL_DATE"] = date("Y-m-d H:i:s", $zDate);
}
$curl = new ccurl("{$URIBASE}/shalla-orders.php{$verbosed}", false, null);
$curl->NoLocalProxy();
if ($GLOBALS["VERBOSE"]) {
$curl->parms["VERBOSE"] = yes;
}
$curl->parms["REGISTER_KAV4PROXY"] = base64_encode(serialize($WizardSavedSettings));
$curl->get();
if ($GLOBALS["VERBOSE"]) {
echo "***** {$curl->data} ****\n";
}
if (preg_match("#INVALID_TEMP_LICENSE#is", $curl->data)) {
$sock->SET_INFO("KasperskyAskQuoteResults", "INVALID_TEMP_LICENSE");
return false;
}
if (preg_match("#CLOUD_ERROR#is", $curl->data)) {
$sock->SET_INFO("KasperskyAskQuoteResults", "CLOUD_ERROR");
return false;
}
if (preg_match("#TEMP_LICENSE=\\[(.+?)\\]#is", $curl->data, $re)) {
$sock->SET_INFO("KasperskyAskQuoteResults", "waiting_order");
$WizardSavedSettings["license_kav4Proxy_temp"] = $re[1];
$sock->SaveConfigFile(base64_encode(serialize($WizardSavedSettings)), "WizardSavedSettings");
return true;
}
if (preg_match("#<LICENSE_K>(.*?)</LICENSE_K>#is", $curl->data, $re)) {
$ldata = $re[1];
@file_put_contents("/tmp/kl", $ldata);
exec("/opt/kaspersky/kav4proxy/bin/kav4proxy-licensemanager -a /tmp/kl 2>&1", $results);
@unlink("/tmp/kl");
while (list($table, $none) = each($results)) {
if (!preg_match("#successfully registered#", $none)) {
if ($GLOBALS["VERBOSE"]) {
echo "{$none}\n";
}
continue;
}
$sock->SET_INFO("KasperskyAskQuoteResults", "KEY_OK");
shell_exec("{$php} /usr/share/artica-postfix/exec.keepup2date.php --update");
shell_exec("{$nohup} {$php} /usr/share/artica-postfix/exec.kav4proxy.php --license --force >/dev/null 2>&1 &");
break;
}
}
}