本文整理匯總了PHP中utility::arr2xml方法的典型用法代碼示例。如果您正苦於以下問題:PHP utility::arr2xml方法的具體用法?PHP utility::arr2xml怎麽用?PHP utility::arr2xml使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類utility
的用法示例。
在下文中一共展示了utility::arr2xml方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _doRegister
/**
* Register the new install with the LC API
*
* @access private
* @return string
*/
private function _doRegister($data)
{
global $lC_Database, $lC_Cache;
if (isset($data['activation_email']) && $data['activation_email'] != NULL) {
$storeEmail = $data['activation_email'];
} else {
$storeEmail = STORE_OWNER_EMAIL_ADDRESS;
}
if (isset($data['activation_serial']) && $data['activation_serial'] != NULL) {
$storeSerial = $data['activation_serial'];
} else {
$storeSerial = '';
}
// register the install with LC API
$registerArr = array('serial' => $storeSerial, 'storeName' => STORE_NAME, 'storeEmail' => $storeEmail, 'storeWWW' => HTTP_SERVER . DIR_WS_HTTP_CATALOG, 'storeSSL' => HTTPS_SERVER . DIR_WS_HTTPS_CATALOG, 'systemMetaData' => base64_encode(json_encode(lc_get_system_information())), 'serverMetaData' => isset($_SERVER) && is_array($_SERVER) ? base64_encode(json_encode($_SERVER)) : NULL, 'envMetaData' => isset($_ENV) && is_array($_ENV) ? base64_encode(json_encode($_ENV)) : NULL);
$checksum = hash('sha256', json_encode($registerArr));
$registerArr['checksum'] = $checksum;
$api_version = defined('API_VERSION') && API_VERSION != NULL ? API_VERSION : '1_0';
$registerArr['ver'] = utility::getVersion();
$request_type = getRequestType();
$resultXML = transport::getResponse(array('url' => $request_type . '://api.loadedcommerce.com/' . $api_version . '/register/install/', 'method' => 'post', 'parameters' => $registerArr, 'timeout' => 10));
$newInstallationID = preg_match("'<installationID[^>]*?>(.*?)</installationID>'i", $resultXML, $regs) == 1 ? $regs[1] : NULL;
$products = preg_match("'<products[^>]*?>(.*?)</products>'i", $resultXML, $regs) == 1 ? $regs[1] : NULL;
if (lC_Server_info_Admin::updateInstallID($newInstallationID)) {
return utility::arr2xml(array('error' => FALSE, 'installationID' => $newInstallationID, 'products' => $products));
} else {
return utility::arr2xml(array('error' => TRUE, 'message' => 'error processing the request'));
}
}