本文整理汇总了PHP中pwCache类的典型用法代码示例。如果您正苦于以下问题:PHP pwCache类的具体用法?PHP pwCache怎么用?PHP pwCache使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了pwCache类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTopicCache
function getTopicCache()
{
//* @include pwCache::getPath(D_P.'data/bbscache/topic_config.php');
extract(pwCache::getData(D_P . 'data/bbscache/topic_config.php', false));
$this->topiccatedb =& $topiccatedb;
$this->topicmodeldb =& $topicmodeldb;
}
示例2: aliasStatic
function aliasStatic($alias)
{
$file = S::escapePath(AREA_PATH . $alias . '/index.html');
$output = cookTemplate();
pwCache::writeover($file, $output);
ob_clean();
}
示例3: getCardData
/**
* 组装小名片数据
*
* @param int $uid 用户ID
* @param int $winduid 当前用户id
* @param bool $username 用户名
* @return array
*/
function getCardData($uid, $winduid, $username)
{
extract(pwCache::getData(R_P . "data/bbscache/level.php", false));
if ($uid < 1 && !trim($username) || $username == '游客' || $username == '匿名') {
return array('username' => '游客', 'memtitle' => $ltitle[2]);
}
$userService = L::loadClass('UserService', 'user');
if ($uid) {
$userInfo = $userService->get($uid, true, true);
} elseif ($username) {
$userInfo = $userService->getByUserName($username, true, true);
}
if (!S::isArray($userInfo)) {
return array();
}
require_once R_P . 'require/showimg.php';
list($faceimage) = showfacedesign($userInfo['icon'], 1, 's');
$userInfo['groupid'] == '-1' && ($userInfo['groupid'] = $userInfo['memberid']);
!array_key_exists($userInfo['groupid'], (array) $lpic) && ($userInfo['groupid'] = 8);
$online = checkOnline($userInfo['thisvisit']);
$onlineRead = $online ? getOnlineViewing($userInfo['uid'], $userInfo['username']) : array();
$user = array('mine' => $userInfo['uid'] == $winduid || !$winduid ? 0 : 1, 'uid' => $userInfo['uid'], 'username' => $userInfo['username'], 'icon' => $faceimage, 'memtitle' => $ltitle[$userInfo['groupid']], 'genderClass' => $userInfo['gender'], 'viewTid' => isset($onlineRead['tid']) && $onlineRead['tid'] ? $onlineRead['tid'] : '', 'viewFid' => isset($onlineRead['fid']) && $onlineRead['fid'] ? $onlineRead['fid'] : '', 'online' => $online ? 1 : 0);
$user['medals'] = getMedalsByUid($userInfo['uid']);
// 勋章
$memberTagsService = L::loadClass('memberTagsService', 'user');
$user['memberTags'] = $memberTagsService->makeClassTags($memberTagsService->getMemberTagsByUid($userInfo['uid']));
//标签
$attentionSerivce = L::loadClass('Attention', 'friend');
/* @var $attentionSerivce PW_Attention */
$user['attention'] = $attentionSerivce->isFollow($winduid, $userInfo['uid']) ? 1 : 0;
//关注
return $user;
}
示例4: creatguestcache
function creatguestcache($output)
{
global $fid, $tid, $timestamp, $db_guestdir, $page;
switch (SCR) {
case 'thread':
if (!is_dir(D_P . "{$db_guestdir}/T_{$fid}")) {
@mkdir(D_P . "{$db_guestdir}/T_{$fid}");
@chmod(D_P . "{$db_guestdir}/T_{$fid}", 0777);
}
pwCache::writeover(D_P . "{$db_guestdir}/T_{$fid}/{$fid}_{$page}.html", $output);
break;
case 'read':
$tmp = 'R_' . intval($tid / 500);
if (!is_dir(D_P . "{$db_guestdir}/{$tmp}")) {
@mkdir(D_P . "{$db_guestdir}/{$tmp}");
@chmod(D_P . "{$db_guestdir}/{$tmp}", 0777);
}
pwCache::writeover(D_P . "{$db_guestdir}/{$tmp}/{$tid}_{$page}.html", $output);
break;
case 'index':
$indexpath = getguestIndexpath();
pwCache::writeover($indexpath, $output);
break;
}
}
示例5: setActCache
function setActCache()
{
//* include pwCache::getPath(D_P.'data/bbscache/activity_config.php');
extract(pwCache::getData(D_P . 'data/bbscache/activity_config.php', false));
$this->activitycatedb = $activity_catedb;
$this->activitymodeldb = $activity_modeldb;
}
示例6: getByTid
function getByTid($tid)
{
global $attachpath, $db_windpost, $foruminfo, $fid, $forumset, $pwforum, $db_hits_store;
$tid = intval($tid);
if ($tid <= 0) {
return $this->buildResponse(THREAD_INVALID_PARAMS);
}
$GLOBALS['tid'] = $tid;
$threadData = $this->_getThread($tid, true);
if (empty($threadData)) {
return $this->buildResponse(0);
}
$fid = $threadData['fid'];
$user = $this->getCurrentUser();
$user->initRight();
$this->getCustomizedCommonService()->getReadRight($user);
$GLOBALS['tpc_buy'] = $threadData['buy'];
$GLOBALS['tpc_author'] = $threadData['author'];
L::loadClass('forum', 'forum', false);
$pwforum = new PwForum($fid);
$foruminfo = $pwforum->foruminfo;
$forumset = $pwforum->forumset;
list($windVersion) = explode(',', WIND_VERSION);
if ($windVersion == '8.0') {
$threadData = $this->_isMyFavoredForEarly($tid, $threadData);
} else {
$threadData = $this->_isMyFavoredForAfter($tid, $threadData);
}
$udb = $this->_getUDb($threadData);
$bandb = $pwforum->forumBan($udb);
isset($bandb[$threadData['uid']]) && ($threadData['groupid'] = 6);
$_attachList = array();
if ($threadData['aid']) {
$query = $GLOBALS['db']->query('SELECT * FROM pw_attachs WHERE tid=' . pwEscape($tid) . ' AND pid=0');
while ($rt = $GLOBALS['db']->fetch_array($query)) {
$_attachList[] = $rt;
}
}
$imgsInContent = $this->getCustomizedCommonService()->parseImgInContent($threadData);
$threadData['content'] = $this->getCustomizedCommonService()->parsePostContent($threadData);
$threadData['content'] = $this->getCustomizedCommonService()->clearHtmlTag($threadData['content'], '<br>');
$threadData['content'] = $this->getCustomizedCommonService()->parseEmotionInContent($threadData['content']);
$threadData['attachlist'] = $this->getCustomizedCommonService()->getAttachWithThumblist($_attachList);
$threadData['attachlist'] = array_merge($imgsInContent, $threadData['attachlist']);
$this->getCustomizedCommonService()->clearAttachSign($_attachList, &$threadData['content']);
$threadData['icon'] = $this->getCustomizedCommonService()->getUserIcon($threadData['icon']);
if ($db_hits_store == 0) {
$GLOBALS['db']->update('UPDATE pw_threads SET hits=hits+1 WHERE tid=' . pwEscape($tid));
} elseif ($db_hits_store == 1) {
$GLOBALS['db']->update('UPDATE pw_hits_threads SET hits=hits+1 WHERE tid=' . pwEscape($tid));
} elseif ($db_hits_store == 2) {
if (class_exists("pwCache") && method_exists("pwCache", "writeover")) {
pwCache::writeover(D_P . 'data/bbscache/hits.txt', $tid . "\t", 'ab');
} else {
writeover(D_P . 'data/bbscache/hits.txt', $tid . "\t", 'ab');
}
}
return $this->buildResponse(0, $threadData);
}
示例7: writeCache
/**
* @param $tag
* @param $result
* @return unknown_type
*/
function writeCache($result)
{
$cache = '';
$cache .= "<?php\r\n";
$cache .= "\$_result=" . var_export($result, TRUE) . ";\r\n";
$cache .= "?>\r\n";
pwCache::setData($this->filepath, $cache);
}
示例8: _initFileModuleIds
function _initFileModuleIds($file, $name)
{
@chmod($file, 0777);
$fileString = pwCache::readover($file);
$moduleConfigService = L::loadClass('moduleconfigservice', 'area');
$newString = $moduleConfigService->cookModuleIds($fileString, $name);
pwCache::writeover($file, $newString);
}
示例9: includefile
function includefile($file)
{
list($windVersion) = explode(',', WIND_VERSION);
if ($windVersion && $windVersion < '8.5') {
include_once $file;
} else {
pwCache::getData($file);
}
}
示例10: writeLog
/**
* 记录错误信息
*/
function writeLog($method = 'rb+')
{
$logFile = D_P . 'data/error.log';
if (!$this->_logs) {
return false;
}
$temp = pw_var_export($this->_logs);
pwCache::writeover($logFile, $temp, 'rb+');
}
示例11: dblog
function dblog($msg)
{
$msg = str_replace(array("\n", "\r", "<"), array('', '', '<'), $msg);
if (file_exists(D_P . 'data/bbscache/dblog.php')) {
pwCache::writeover(D_P . 'data/bbscache/dblog.php', "{$msg}\n", 'ab');
} else {
pwCache::writeover(D_P . 'data/bbscache/dblog.php', "<?php die;?>\n{$msg}\n");
}
}
示例12: getGroupsCreditset
function getGroupsCreditset($type)
{
global $o_groups_creditset;
//* include_once pwCache::getPath(D_P.'data/bbscache/o_config.php');
extract(pwCache::getData(D_P . 'data/bbscache/o_config.php', false));
$creditset = array_filter($creditset[$type], "group_filter");
$creditset = is_array($creditset) ? $creditset : array();
return $creditset;
}
示例13: _cookData
/**
*
* 获取查询结果
* @param unknown $query 查询结果
* @return array
*/
function _cookData($query)
{
//* include pwCache::getPath(D_P . 'data/bbscache/topic_config.php');
extract(pwCache::getData(D_P . 'data/bbscache/topic_config.php', false));
while ($row = $this->_db->fetch_array($query)) {
$row['modelname'] = $topicmodeldb[$row['modelid']]['name'];
$posts[] = $row;
}
return $posts;
}
示例14: loadWords
function loadWords()
{
if (!is_array($this->fbwords)) {
//* include pwCache::getPath(D_P."data/bbscache/wordsfb.php");
extract(pwCache::getData(D_P . "data/bbscache/wordsfb.php", false));
$this->fbwords = (array) $wordsfb;
$this->replace = (array) $replace;
$this->alarm = (array) $alarm;
}
}
示例15: updatecache_bg
function updatecache_bg()
{
global $db;
$query = $db->query("SELECT * FROM pw_hack WHERE hk_name LIKE 'bg_%'");
$blogdb = "<?php\r\n";
while (@extract($db->fetch_array($query))) {
$hk_name = key_cv($hk_name);
$blogdb .= "\${$hk_name}=" . pw_var_export($hk_value) . ";\r\n";
}
$blogdb .= "\n?>";
pwCache::setData(D_P . 'data/bbscache/bg_config.php', $blogdb);
}