本文整理匯總了PHP中openSRS_base::send_cmd方法的典型用法代碼示例。如果您正苦於以下問題:PHP openSRS_base::send_cmd方法的具體用法?PHP openSRS_base::send_cmd怎麽用?PHP openSRS_base::send_cmd使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類openSRS_base
的用法示例。
在下文中一共展示了openSRS_base::send_cmd方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: opensrs_TransferSync
function opensrs_TransferSync($params)
{
$regusername = $params['Username'];
$regpassword = $params['Password'];
$regprivatekey = $params['PrivateKey'];
if ($params['TestMode']) {
$mode = "test";
$protocol = "XCP";
} else {
$mode = "live";
$protocol = "XCP";
}
$server_ip = isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : $_SERVER['LOCAL_ADDR'];
require_once dirname(__FILE__) . "/openSRS_base.php";
$domainid = $params['domainid'];
$domain = $params['domain'];
$username = opensrs_getusername($domain);
$password = opensrs_getpassword($domainid, $domain);
$O = new openSRS_base($mode, $protocol, $regusername, $regprivatekey);
$opensrscookie = "";
$error = "";
$cmd = array("object" => "COOKIE", "action" => "SET", "registrant_ip" => $server_ip, "attributes" => array("domain" => $domain, "reg_username" => $username, "reg_password" => $password));
$result = $O->send_cmd($cmd);
logModuleCall("opensrssync", "Get Domain Info", $cmd, $result, "", array($username, $password));
if ($result['is_success'] != "1") {
return array("error" => $result['response_text']);
}
$opensrscookie = $result['attributes']['cookie'];
$expirydate = $result['attributes']['expiredate'];
$expirydate = explode(" ", $expirydate);
$expirydate = $expirydate[0];
$rtn = array();
$rtn['active'] = true;
$rtn['expirydate'] = $expirydate;
return $rtn;
}