本文整理汇总了PHP中pw_var_export函数的典型用法代码示例。如果您正苦于以下问题:PHP pw_var_export函数的具体用法?PHP pw_var_export怎么用?PHP pw_var_export使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pw_var_export函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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+');
}
示例2: 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?>";
writeover(D_P . 'data/bbscache/bg_config.php', $blogdb);
}
示例3: exportThemeConfig
function exportThemeConfig($theme)
{
$invokeDB = $this->_getInvokeDB();
$invokePieceDB = $this->_getInvokePieceDB();
$invokes = $this->_getThemeInvokes($theme);
$defaultInvokes = $invokeDB->getDatesByNames_2($invokes);
$defaultInvokePieces = $invokePieceDB->getDatasByInvokeNames($invokes);
$temp_str = "<?php\r\n!defined('P_W') && exit('Forbidden');\r\n";
$temp_str .= '$defaultInvokes=' . pw_var_export($defaultInvokes) . ";\r\n";
$temp_str .= '$defaultInvokePieces=' . pw_var_export($defaultInvokePieces) . ";\r\n?>";
$this->_exportHeader($temp_str);
}
示例4: updatecache_sm
function updatecache_sm()
{
global $db;
$hk_name = $hk_value = '';
$query = $db->query("SELECT * FROM pw_hack WHERE hk_name LIKE 'sm_%'");
$configdb = "<?php\r\n";
while (@extract($db->fetch_array($query))) {
$hk_name = key_cv($hk_name);
$configdb .= "\${$hk_name}=" . pw_var_export($hk_value) . ";\r\n";
}
$configdb .= "?>";
pwCache::setData(D_P . 'data/bbscache/sm_config.php', $configdb);
}
示例5: appsUpdateCache
function appsUpdateCache($apps)
{
$filename = "data/bbscache/apps_list_cache.php";
if ($apps && is_array($apps)) {
$cache = "<?php\r\n\$appsdb=";
$cache .= pw_var_export($apps);
$cache .= ";\r\n?>";
writeover(D_P . $filename, $cache);
return new ApiResponse(true);
} else {
return new ApiResponse(false);
}
}
示例6: update_index_forum
function update_index_forum($config)
{
global $m;
@(include_once D_P . 'data/bbscache/mode_' . $m . '_index_forum.php');
foreach ($index_forum as $key => $value) {
$config_fids = array_keys($config);
if (!in_array($key, $config_fids)) {
unset($index_forum[$key]);
continue;
}
foreach ($value as $k => $v) {
if (!in_array($k, $config[$key])) {
unset($index_forum[$key][$k]);
}
}
}
writeover(Pcv(D_P . 'data/bbscache/mode_' . $m . '_index_forum.php'), "<?php\r\n\$index_forum=" . pw_var_export($index_forum) . ";\r\n?>");
}
示例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: arr_unique
$mark = $sorttype[$step];
$db->update("DELETE FROM pw_elements WHERE type='usersort' AND mark=" . S::sqlEscape($mark));
$step++;
$_usersort = $getinfo->userSort($mark, $db_sortnum, false);
$_usersort = arr_unique($_usersort);
if (is_array($_usersort) && count($_usersort) == $db_sortnum) {
$tmpdate = end($_usersort);
$usersort_judge[$mark] = $tmpdate['value'];
} else {
$usersort_judge[$mark] = 0;
}
if ($_usersort) {
$sql = "REPLACE INTO pw_elements(id,value,addition,type,mark) VALUES" . S::sqlMulti($_usersort, false);
$db->update($sql);
}
pwCache::setData(D_P . 'data/bbscache/usersort_judge.php', "<?php\r\n\$usersort_judge=" . pw_var_export($usersort_judge) . ";\r\n?>");
adminmsg('updatecache_total_step', "{$basename}&action=update&type=usersort&step={$step}");
}
} elseif ($type == 'newsubject') {
$step = intval(S::getGP('step'));
//* require_once pwCache::getPath(D_P.'data/bbscache/forum_cache.php');
pwCache::getData(D_P . 'data/bbscache/forum_cache.php');
$arr_forumkeys = array_keys($forum);
if (!$step) {
$step = 0;
$db->query("DELETE FROM pw_elements WHERE type='newsubject'");
}
$total = count($arr_forumkeys);
for ($i = 0; $i < 5; $i++) {
if ($step < $total) {
$fourmid = $arr_forumkeys[$step];
示例10: array
$nf_newinfodb[$key][$k] = array('id' => $v['addition']['uid'], 'name' => $v['title'], 'value' => $v['value']);
}
} elseif (in_array($val['type'], array('todaypost', 'rvrc', 'postnum', 'onlinetime', 'monthpost', 'monoltime', 'money', 'digests', 'currency', 'credit')) || array_key_exists($val['type'], $_CREDITDB)) {
$nf_newinfodb[$key] = $element->userSort($val['type']);
foreach ($nf_newinfodb[$key] as $k => $v) {
$nf_newinfodb[$key][$k] = array('id' => $v['addition']['uid'], 'name' => $v['title'], 'value' => $v['value']);
}
} elseif (in_array($val['type'], array('topic', 'article', 'tpost'))) {
$nf_newinfodb[$key] = $element->forumSort($val['type']);
foreach ($nf_newinfodb[$key] as $k => $v) {
$nf_newinfodb[$key][$k] = array('id' => $v['addition']['fid'], 'name' => $v['title'], 'value' => $v['value']);
}
}
$nf_order[$key]['cachetime'] = $timestamp;
uasort($nf_order, 'cacheTimeCmp');
pwCache::setData(D_P . 'data/bbscache/newinfo_config.php', "<?php\r\n\$nf_config=" . pw_var_export($nf_config) . ";\r\n\$nf_newinfodb=" . pw_var_export($nf_newinfodb) . ";\r\n\$nf_order=" . pw_var_export($nf_order) . ";\r\n?>");
break;
}
}
uasort($nf_order, 'orderCmp');
function cacheTimeCmp($row1, $row2)
{
$first = strcmp($row1['cachetime'], $row2['cachetime']);
if ($first) {
return $first;
} elseif ($row2['order'] > $row1['order']) {
return 1;
} elseif ($row2['order'] < $row1['order']) {
return -1;
} else {
return 0;
示例11: setTidsCache
function setTidsCache($type)
{
global $db, $fid, $timestamp, $_filename, $t;
$useIndex = "";
$orderby = '';
$where = "WHERE " . ($fid ? " fid= " . pwEscape($fid) : "fid IN (" . getFidsForWap() . ")") . " AND specialsort=0 AND ifcheck=1";
if ($type == 'digest') {
$where .= " AND digest>0";
$orderby = "ORDER BY topped DESC,lastpost DESC";
} elseif ($type == 'hot') {
$time = (int) 3600 * 24 * 30;
if ($t == '1') {
$time = (int) 3600 * 24;
} elseif ($t == '2') {
$time = (int) 3600 * 24 * 3;
} elseif ($t == '3') {
$time = (int) 3600 * 24 * 7;
} elseif ($t == '4') {
$time = (int) 3600 * 24 * 30;
}
$where .= " AND postdate>" . (int) ($timestamp - $time);
$orderby = "ORDER BY replies DESC";
} elseif ($type == 'new') {
$useIndex = 'USE INDEX (' . getForceIndex('idx_postdate') . ')';
$orderby = "ORDER BY postdate DESC";
} else {
$orderby = "ORDER BY specialsort DESC,lastpost DESC";
}
$limit = "LIMIT 0,500";
$query = $db->query("SELECT tid FROM pw_threads {$useIndex} {$where} {$orderby} {$limit}");
$result = array();
$result['uptime'] = $timestamp;
while ($rt = $db->fetch_array($query)) {
$result['tids'] .= $rt['tid'] . ',';
}
if (is_file($_filename)) {
include $_filename;
}
$tidsCache[$type] = $result;
writeover($_filename, "<?php\r\n\$tidsCache=" . pw_var_export($tidsCache) . "\r\n?>");
return $result['tids'];
}
示例12: GetPcatetable
}
}
if ($postcatepcids) {
//团购活动
$pcvaluetable = GetPcatetable($pcid);
$query = $db->query("SELECT * FROM {$pcvaluetable} WHERE tid IN (" . pwImplode($postcatepcids) . ")");
while ($rt = $db->fetch_array($query)) {
$threaddb[$rt['tid']]['topic'] = $rt;
}
}
if ($updatetop) {
require_once R_P . 'require/updateforum.php';
updatetop();
}
if ($fcache == 1) {
writeover(D_P . "data/bbscache/fcache_{$fid}_{$page}.php", "<?php\r\n\$threaddb=" . pw_var_export($threaddb) . ";\r\n?>");
}
unset($tpcdb, $query, $topadd, $searchadd, $sql, $limit2, $R, $p_status, $updatetop, $rewids, $arrStatus);
} else {
include_once D_P . "data/bbscache/fcache_{$fid}_{$page}.php";
if ($page == 1 && !$ifsort) {
foreach ($threaddb as $key => $value) {
$value['topped'] && ($ifsort = 1);
break;
}
}
}
$db_threadshowpost == 1 && $groupid != 'guest' && ($fastpost = 'fastpost');
$psot_sta = $titletop1 = '';
$t_exits = 0;
$t_typedb = $t_subtypedb = array();
示例13: setFileCache
function setFileCache()
{
$jobDao = $this->_getJobDao();
$jobs = $jobDao->getAll();
$jobLists = "\$jobLists=" . pw_var_export($jobs) . ";";
pwCache::setData($this->getCacheFileName(), "<?php\r\n" . $jobLists . "\r\n?>");
return $jobs;
}
示例14: 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');
示例15: updateDatanalyse
if ($db_ifpwcache & 1024) {
$elementupdate->hotfavorUpdate($tid, $fid);
}
updateDatanalyse($tid, 'threadFav', 1);
//End Here
Showmsg('job_favor_success');
} elseif ($action == 'tag') {
$cachetime = pwFilemtime(D_P . "data/bbscache/tagdb.php");
if (!file_exists(D_P . "data/bbscache/tagdb.php") || $timestamp - $cachetime > 3600) {
$tagnum = max($db_tagindex, 200);
$tagdb = array();
$query = $db->query("SELECT * FROM pw_tags WHERE ifhot='0' ORDER BY num DESC" . pwLimit($tagnum));
while ($rs = $db->fetch_array($query)) {
$tagdb[$rs['tagname']] = $rs['num'];
}
writeover(D_P . "data/bbscache/tagdb.php", "<?php\r\n\$tagdb=" . pw_var_export($tagdb) . ";\r\n?>");
} else {
include_once D_P . "data/bbscache/tagdb.php";
}
foreach ($tagdb as $key => $num) {
echo $key . ',' . $num . "\t";
}
ajax_footer();
} elseif ($action == 'relatetag') {
InitGP(array('tagname'));
$rs = $db->get_one("SELECT tagid,num FROM pw_tags WHERE tagname=" . pwEscape($tagname));
if (!$rs || $rs['num'] < 1) {
Showmsg('tag_limit');
}
$query = $db->query("SELECT tg.tid,t.subject FROM pw_tagdata tg LEFT JOIN pw_threads t USING(tid) WHERE tg.tagid=" . pwEscape($rs['tagid']) . " LIMIT 5");
$readdb = array();