本文整理汇总了PHP中cmsFramework::setSessionVar方法的典型用法代码示例。如果您正苦于以下问题:PHP cmsFramework::setSessionVar方法的具体用法?PHP cmsFramework::setSessionVar怎么用?PHP cmsFramework::setSessionVar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cmsFramework
的用法示例。
在下文中一共展示了cmsFramework::setSessionVar方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getVersion
function getVersion()
{
$page = '';
$new_version = 'none';
$session_var = cmsFramework::getSessionVar('new_version', 'jreviews');
if (empty($session_var)) {
if (function_exists('curl_init')) {
// Version checker
$curl_handle = curl_init('http://www.reviewsforjoomla.com/updates_server/files.php');
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
// return instead of echo
@curl_setopt($curl_handle, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl_handle, CURLOPT_HEADER, 0);
$data = curl_exec($curl_handle);
curl_close($curl_handle);
$current_versions = json_decode($data, true);
$this->Config->updater_betas and isset($current_versions['jreviews']['beta']) and $current_versions['jreviews'] = array_merge($current_versions['jreviews'], $current_versions['jreviews']['beta']);
$remoteVersion = $current_versions['components']['jreviews']['version'];
$remoteVersion = (int) str_replace('.', '', $remoteVersion);
$localVersion = (int) str_replace('.', '', strip_tags($this->Config->version));
if ($remoteVersion > $localVersion) {
$new_version = 'new';
}
} else {
$new_version = 'curl';
}
cmsFramework::setSessionVar('new_version', $new_version, 'jreviews');
} else {
$new_version = $session_var;
}
switch ($new_version) {
case 'new':
$page = '<a style="font-weight:normal;font-size:13px;color:red;" href="#updater_version_check" id="updater_notification">' . __a("New version available", true) . '</a>';
break;
case 'curl':
$page = '<span style="font-weight:normal;font-size:13px;color:red;">Version checker requires curl</span>';
break;
default:
$page = '';
break;
}
return $this->ajaxResponse(array(), false, compact('page'));
}
示例2: cacheSessionSetCount
function cacheSessionSetCount($count, $queryData)
{
$conditions = array_filter(array_merge($this->conditions, $queryData['conditions']));
$findCount = cmsFramework::getSessionVar($this->name, 'findCount');
$findCount[md5($this->name . implode('', $conditions))] = $count;
cmsFramework::setSessionVar($this->name, $findCount, 'findCount');
}