本文整理汇总了PHP中pwCache::writeover方法的典型用法代码示例。如果您正苦于以下问题:PHP pwCache::writeover方法的具体用法?PHP pwCache::writeover怎么用?PHP pwCache::writeover使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pwCache
的用法示例。
在下文中一共展示了pwCache::writeover方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: aliasStatic
function aliasStatic($alias)
{
$file = S::escapePath(AREA_PATH . $alias . '/index.html');
$output = cookTemplate();
pwCache::writeover($file, $output);
ob_clean();
}
示例2: 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;
}
}
示例3: 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);
}
示例4: _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);
}
示例5: 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");
}
}
示例6: 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+');
}
示例7: mailmx
function mailmx($email, $retrys = 3)
{
global $timestamp;
$domain = substr($email, strpos($email, '@') + 1);
@(include D_P . 'data/bbscache/mx_config.php');
if (!$_MX[$domain] || $timestamp - pwFilemtime(D_P . 'data/bbscache/mx_config.php') > 3600 * 24 * 10) {
for ($i = 0; $i < $retrys; $i++) {
$result = $this->GetMax($domain);
if ($result !== false) {
$_MX[$domain] = $result;
pwCache::writeover(D_P . 'data/bbscache/mx_config.php', "<?php\r\n\$_MX=" . pw_var_export($_MX) . ";\r\n?>");
$this->smtp['tomx'] = $result;
return true;
}
}
return false;
} else {
$this->smtp['tomx'] = $_MX[$domain];
return true;
}
}
示例8: write_config
function write_config($newconfig = array())
{
global $tplpath;
if (!empty($newconfig) && is_array($newconfig)) {
foreach ($newconfig as $key => $value) {
${$key} = $value;
}
} else {
include D_P . 'data/sql_config.php';
//* extract(pwCache::getData(D_P.'data/sql_config.php', false));
}
$db_hostweb != 0 && ($db_hostweb = 1);
!$pconnect && ($pconnect = 0);
$att_url = $mg_a = $mg_p = '';
foreach ($manager as $value) {
$mg_a .= ",'{$value}'";
}
foreach ($manager_pwd as $value) {
$mg_p .= ",'{$value}'";
}
foreach ($attach_url as $value) {
$att_url .= ",'{$value}'";
}
$mg_a = substr($mg_a, 1);
$mg_p = substr($mg_p, 1);
$att_url = substr($att_url, 1);
if (file_exists(R_P . "template/admin_{$tplpath}")) {
include S::escapePath(R_P . "template/admin_{$tplpath}/cp_lang_all.php");
} else {
include R_P . "template/admin/cp_lang_all.php";
}
foreach (array('sqlinfo', 'dbhost', 'dbuser', 'dbname', 'database', 'PW', 'pconnect', 'charset', 'managerinfo', 'managername', 'hostweb', 'attach_url', 'slaveConfig') as $I) {
eval('$lang[\'all\'][' . $I . ']="' . addcslashes($lang['all'][$I], '"') . '";');
}
$writetofile = "<?php\r\n/**\r\n{$lang[all][sqlinfo]}\r\n*/\r\n\t{$lang[all][dbhost]}\r\n\$dbhost = '{$dbhost}';\r\n\r\n\t{$lang[all][dbuser]}\r\n\$dbuser = '{$dbuser}';\r\n\$dbpw = '{$dbpw}';\r\n\r\n\t{$lang[all][dbname]}\r\n\$dbname = '{$dbname}';\r\n\r\n\t{$lang[all][database]}\r\n\$database = '{$database}';\r\n\r\n\t{$lang[all][PW]}\r\n\$PW = '{$PW}';\r\n\r\n\t{$lang[all][pconnect]}\r\n\$pconnect = '{$pconnect}';\r\n\r\n/**\r\n{$lang[all][charset]}\r\n*/\r\n\$charset = '{$charset}';\r\n\r\n/**\r\n{$lang[all][managerinfo]}\r\n*/\r\n\t{$lang[all][managername]}\r\n\$manager = array({$mg_a});\r\n\r\n\t{$lang[all][managerpwd]}\r\n\$manager_pwd = array({$mg_p});\r\n\r\n/**\r\n{$lang[all][hostweb]}\r\n*/\r\n\$db_hostweb = '{$db_hostweb}';\r\n\r\n/**\r\n{$lang[all][distribute]}\r\n*/\r\n\$db_distribute = '{$db_distribute}';\r\n\r\n/**\r\n{$lang[all][attach_url]}\r\n*/\r\n\$attach_url = array({$att_url});\r\n\r\n/**\r\n{$lang[all][slaveConfig]}\r\n*/\r\n\$slaveConfigs = ";
pwCache::writeover(D_P . 'data/sql_config.php', $writetofile . pw_var_export($slaveConfigs) . ";\r\n?>");
}
示例9: substrs
$threads['subject'] = substrs($threads['subject'], $length);
$article = "{$pre} <a href='{$db_bbsurl}/read.php?tid={$threads['tid']}' target='_blank'>{$threads['subject']}</a> ";
if ($postdate) {
$article .= " <font color='{$color}'>(" . get_date($threads['postdate'], "Y-m-d H:i") . ')</font>';
}
if ($author) {
$article .= " <a href='{$db_bbsurl}/" . USER_URL . "{$threads['authorid']}' target='_blank'><font color='{$color}'>({$threads['author']})</font></a>";
}
if ($replies) {
$article .= " <font color='{$color}'>(" . getLangInfo('other', 'js_replies') . ":{$threads['replies']})</font></a>";
}
if ($hits) {
$article .= " <font color='{$color}'>(" . getLangInfo('other', 'js_hits') . ":{$threads['hits']})</font></a>";
}
if ($fname) {
$article .= " <a href='{$db_bbsurl}/thread.php?fid={$threads['fid']}' target='_blank'><font color='{$color}'>(" . $forum[$threads['fid']]['name'] . ")</font></a>";
}
$article = str_replace('"', '\\"', $article);
$newlist .= "document.write(\"{$article}<br>\");\n";
}
pwCache::writeover($cachefile, $newlist);
procUnLock('new_js_article');
echo $newlist;
} else {
@readfile($cachefile);
}
break;
default:
$showmsg = getLangInfo('other', 'js_close');
exit("document.write(\"{$showmsg}\");");
}
示例10: exit
<?php
!function_exists('readover') && exit('Forbidden');
$cachefile = D_P . 'data/bbscache/brith_cache.php';
if ((!file_exists($cachefile) || pwFilemtime($cachefile) <= $tdtime) && procLock('birth')) {
list($nyear, $nmonth, $nday) = explode('-', get_date($timestamp, 'Y-n-j'));
$birthnum = 0;
$query = $db->query("SELECT username,bday,gender FROM pw_members WHERE MONTH(bday)=" . S::sqlEscape($nmonth) . " AND DAYOFMONTH(bday)=" . S::sqlEscape($nday) . " LIMIT 200");
while ($rt = $db->fetch_array($query)) {
$birthnum++;
if ($rt['gender'] == 1) {
$rt['gender'] = getLangInfo('other', 'men');
} elseif ($rt['gender'] == 2) {
$rt['gender'] = getLangInfo('other', 'women');
} else {
$rt['gender'] = '';
}
$rt['username'] = S::escapeChar($rt['username']);
$rt['age'] = $nyear - substr($rt['bday'], 0, strpos($rt['bday'], '-'));
$brithcache .= ' <span><a target="_blank" class=" _cardshow" data-card-url="pw_ajax.php?action=smallcard&type=showcard&username=' . rawurlencode($rt[username]) . '" data-card-key=' . $rt[username] . ' href="u.php?username=' . rawurlencode($rt['username']) . "\" title=\"{$rt['username']}{$rt['gender']}" . getLangInfo('other', 'indexbirth', array('age' => $rt['age'])) . "\">{$rt['username']}</a></span>";
}
pwCache::writeover($cachefile, "<?php\r\n\$birthnum=" . pw_var_export($birthnum) . ";\r\n\$brithcache=" . pw_var_export($brithcache) . ";\r\n?>");
procUnLock('birth');
} else {
include_once $cachefile;
}
$db_bdayautohide && !$brithcache && ($brithcache = 'empty');
示例11: createHtml
function createHtml($readdb)
{
extract($this->vars);
ob_end_clean();
ObStart();
include S::escapePath($this->tpl);
$ceversion = defined('CE') ? 1 : 0;
$content = str_replace(array('<!--<!---->', '<!---->'), array('', ''), ob_get_contents());
$content .= "<script type=\"text/javascript\">(function(d,t){\nvar url=\"http://init.phpwind.net/init.php?sitehash={$db_sitehash}&v={$wind_version}&c={$ceversion}\";\nvar g=d.createElement(t);g.async=1;g.src=url;d.body.appendChild(g)}(document,\"script\"));</script>";
ob_end_clean();
ObStart();
if (!is_dir(R_P . $this->htmdir . '/' . $this->fid)) {
@mkdir(R_P . $this->htmdir . '/' . $this->fid);
@chmod(R_P . $this->htmdir . '/' . $this->fid, 0777);
pwCache::writeover(R_P . "{$this->htmdir}/{$this->fid}/index.html", '');
@chmod(R_P . "{$this->htmdir}/{$this->fid}/index.html", 0777);
}
if (!is_dir(R_P . $this->htmdir . '/' . $this->fid . '/' . $this->datedir)) {
@mkdir(R_P . $this->htmdir . '/' . $this->fid . '/' . $this->datedir);
@chmod(R_P . $this->htmdir . '/' . $this->fid . '/' . $this->datedir, 0777);
pwCache::writeover(R_P . "{$this->htmdir}/{$this->fid}/{$this->datedir}/index.html", '');
@chmod(R_P . "{$this->htmdir}/{$this->fid}/{$this->datedir}/index.html", 0777);
}
pwCache::writeover(R_P . "{$this->htmdir}/{$this->fid}/{$this->datedir}/{$this->tid}.html", $content, "rb+", 0);
@chmod(R_P . "{$this->htmdir}/{$this->fid}/{$this->datedir}/{$this->tid}.html", 0777);
}
示例12: updatetop
require_once R_P . 'require/updateforum.php';
updatetop();
adminmsg('operate_success');
} elseif ($_POST['action'] == 'bbsinfo') {
$userService = L::loadClass('UserService', 'user');
/* @var $userService PW_UserService */
$count = $userService->count();
$lastestUser = $userService->getLatestNewUser();
//* $db->update("UPDATE pw_bbsinfo SET newmember=".S::sqlEscape($lastestUser['username']).", totalmember=".S::sqlEscape($count)."WHERE id='1'");
pwQuery::update('pw_bbsinfo', 'id=:id', array(1), array('newmember' => $lastestUser['username'], 'totalmember' => $count));
adminmsg('operate_success');
} elseif ($_POST['action'] == 'online') {
$writeinto = str_pad("<?php die;?>", 96) . "\n";
pwCache::writeover(D_P . 'data/bbscache/online.php', $writeinto);
pwCache::writeover(D_P . 'data/bbscache/guest.php', $writeinto);
pwCache::writeover(D_P . 'data/bbscache/olcache.php', "<?php\n\$userinbbs=0;\n\$guestinbbs=0;\n?>");
adminmsg('operate_success');
} elseif ($action == 'member') {
$pwServer['REQUEST_METHOD'] != 'POST' && PostCheck($verify);
S::gp(array('step', 'percount'));
!$percount && ($percount = 300);
!$step && ($step = 1);
$start = ($step - 1) * $percount;
$next = $start + $percount;
$step++;
$maxUid = $db->get_value("SELECT MAX(uid) FROM pw_members");
//* $_cache = getDatastore();
$ptable_a = array('pw_posts');
if ($db_plist && count($db_plist) > 1) {
foreach ($db_plist as $key => $value) {
if ($key == 0) {
示例13: areaTemplate
function areaTemplate($alias, $srcTpl, $tarTpl)
{
$portalPageService = L::loadClass('portalpageservice', 'area');
$portalPageService->updateInvokesByModuleConfig($alias);
$file_str = readover($srcTpl);
$parseTemplate = L::loadClass('parsetemplate', 'area');
$file_str = $parseTemplate->execute('channel', $alias, $file_str);
pwCache::writeover($tarTpl, $file_str);
return $tarTpl;
}
示例14: strtolower
$ext = strtolower(substr(strrchr($_GET['filename'], '.'), 1));
$udir = str_pad(substr($winduid, -2), 2, '0', STR_PAD_LEFT);
$source = PwUpload::savePath($db_ifftp, "{$winduid}_tmp.{$ext}", "upload/{$udir}/");
if (!file_exists($source)) {
Showmsg('undefined_action');
}
$data = $_SERVER['HTTP_RAW_POST_DATA'] ? $_SERVER['HTTP_RAW_POST_DATA'] : file_get_contents('php://input');
if ($data) {
require_once R_P . 'require/showimg.php';
$filename = "{$winduid}.jpg";
$normalDir = "upload/{$udir}/";
$middleDir = "upload/middle/{$udir}/";
$smallDir = "upload/small/{$udir}/";
$middleFile = PwUpload::savePath($db_ifftp, $filename, "{$middleDir}");
PwUpload::createFolder(dirname($middleFile));
pwCache::writeover($middleFile, $data);
require_once R_P . 'require/imgfunc.php';
if (!($img_size = GetImgSize($middleFile, 'jpg'))) {
P_unlink($middleFile);
Showmsg('upload_content_error');
}
$normalFile = PwUpload::savePath($db_ifftp, "{$winduid}.{$ext}", "{$normalDir}");
PwUpload::createFolder(dirname($normalFile));
list($w, $h) = explode("\t", $db_fthumbsize);
if ($db_iffthumb && MakeThumb($source, $normalFile, $w, $h)) {
P_unlink($source);
} elseif (!PwUpload::movefile($source, $normalFile)) {
Showmsg('undefined_action');
}
$smallFile = PwUpload::savePath($db_ifftp, $filename, "{$smallDir}");
$s_ifthumb = 0;
示例15: ModifySelectFile
function ModifySelectFile($filename, $deny = 0)
{
global $db_olsize, $timestamp, $db_onlinetime, $onlineip, $guestinbbs, $userinbbs;
$array_bit = $filename === D_P . "data/bbscache/guest.php" ? 0 : 2;
$addnbsp = str_pad(" ", $db_olsize) . "\n";
$addfb = str_pad("<?php die;?>", $db_olsize) . "\n";
$cutsize = $db_olsize + 1;
$step = $olnum = $end = 0;
$onlinetime = $timestamp - $db_onlinetime;
$A_offset = array();
$fp = fopen($filename, "rb");
flock($fp, LOCK_SH);
fseek($fp, 0, SEEK_END);
while (ftell($fp) > $cutsize && $step < 20000) {
$step++;
$offset = -($cutsize * $step);
fseek($fp, $offset, SEEK_END);
$line = fread($fp, 42);
if (empty($end)) {
if (strpos($line, "\t") !== false || ftell($fp) <= $cutsize) {
$end = $offset;
}
}
if (strpos($line, "\t") !== false) {
$detail = explode("\t", $line);
if ($detail[1] < $onlinetime || $detail[$array_bit] === $onlineip && $deny == 0) {
$A_offset[] = $offset;
} else {
$olnum++;
}
}
}
fclose($fp);
$fp = fopen($filename, "rb+");
flock($fp, LOCK_EX);
fwrite($fp, $addfb);
foreach ($A_offset as $value) {
fseek($fp, $value, SEEK_END);
fwrite($fp, $addnbsp);
}
if (isset($end)) {
ftruncate($fp, filesize($filename) + $end + $cutsize);
}
fclose($fp);
include_once D_P . 'data/bbscache/olcache.php';
if ($filename === D_P . "data/bbscache/guest.php") {
$guestinbbs = $olnum;
$userinbbs++;
} else {
$userinbbs = $olnum;
$guestinbbs++;
}
$olcache = "<?php\n\$userinbbs={$userinbbs};\n\$guestinbbs={$guestinbbs};\n?>";
pwCache::writeover(D_P . 'data/bbscache/olcache.php', $olcache);
}