本文整理汇总了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;
}