本文整理匯總了PHP中CASHSystem::simpleXOR方法的典型用法代碼示例。如果您正苦於以下問題:PHP CASHSystem::simpleXOR方法的具體用法?PHP CASHSystem::simpleXOR怎麽用?PHP CASHSystem::simpleXOR使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CASHSystem
的用法示例。
在下文中一共展示了CASHSystem::simpleXOR方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setSettings
/**
*
*
* @param {array} settings_data: settings data as associative array
* @return boolean
*/
public function setSettings($settings_name, $settings_type, $settings_data, $connection_id = false)
{
$settings_data = json_encode($settings_data);
if ($connection_id) {
$settings_condition = array('id' => array('condition' => '=', 'value' => $connection_id));
$allow_action = true;
} else {
$settings_condition = false;
$allow_action = $this->checkUniqueName($settings_name, $settings_type);
}
if ($allow_action) {
$result = $this->db->setData('connections', array('name' => $settings_name, 'type' => $settings_type, 'user_id' => $this->user_id, 'data' => base64_encode(CASHSystem::simpleXOR($settings_data))), $settings_condition);
return $result;
} else {
// error: you must specify unique a name when adding settings
return false;
}
}
示例2: updateSettings
/**
*
*
* @param {array} settings_data: settings data as associative array
* @return boolean
*/
public function updateSettings($settings_data)
{
$settings_data = json_encode($settings_data);
$result = $this->db->setData('connections', array('data' => base64_encode(CASHSystem::simpleXOR($settings_data))), array('id' => array('condition' => '=', 'value' => $this->connection_id)));
return $result;
}