本文整理汇总了PHP中writeover函数的典型用法代码示例。如果您正苦于以下问题:PHP writeover函数的具体用法?PHP writeover怎么用?PHP writeover使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了writeover函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: invokeApiFileEot
function invokeApiFileEot($id)
{
$file = $this->getInvokeApiFile($id);
if (!file_exists($file)) {
writeover($file, "<?php\r\nprint <<<EOT\r\n" . $invokeInfo['parsecode'] . "\r\nEOT;\r\n?>");
}
}
示例2: config
function config()
{
global $db, $imgpath, $db_bbsurl;
$content .= "\$cheatopen=\"0\";\r\n";
$content .= "\$cheatopenmsg=\"管理员把去探宝的地图弄丢啦,快去找他要\";\r\n";
$content .= "\$fish_groups=\",3,4,5,8,16,9,10,11,12,13,14,15,\";\r\n";
$content .= "\$guestview=\"0\";\r\n";
$content .= "\$fish1money=\"10\";\r\n";
$content .= "\$fish2money=\"50\";\r\n";
$content .= "\$fish3money=\"50\";\r\n";
$content .= "\$fish4money=\"30\";\r\n";
$content .= "\$fish5money=\"30\";\r\n";
$content .= "\$fish6money=\"20\";\r\n";
$content .= "\$fish7money=\"20\";\r\n";
$content .= "\$fish8money=\"20\";\r\n";
$content .= "\$fish9money=\"20\";\r\n";
$content .= "\$fish10money=\"20\";\r\n";
$content .= "\$fish11money=\"20\";\r\n";
$content .= "\$fish12money=\"20\";\r\n";
$content .= "\$fish13money=\"20\";\r\n";
$content .= "\$fish14money=\"20\";\r\n";
$content .= "\$vtime=\"1\";\r\n";
$content .= "\$cview=\"0\";\r\n";
$content .= "\$cutime=\"20\";";
writeover(D_P . "data/bbscache/fish/config.php", "<?php\r\n" . $content . "\r\n?>");
}
示例3: area_static_deal
function area_static_deal($op, $params = array())
{
global $area_static_ifon, $area_static_next, $area_static_step;
global $timestamp, $db_htmdir, $area_need_dynamic, $area_refresh_static;
$area_data_file = R_P . $db_htmdir . '/area_index.htm';
if ($op == "isNeedDynamic") {
$area_need_dynamic = isset($_GET['getdynamic']) && $_GET['getdynamic'];
if (!$area_static_ifon) {
$area_need_dynamic = true;
}
return $area_need_dynamic;
} elseif ($op == "getStaticContent") {
if ($area_need_dynamic) {
return;
}
$area_refresh_static = $timestamp >= $area_static_next || !file_exists($area_data_file);
if ($area_refresh_static) {
$area_need_dynamic = true;
} else {
$area_index_content = file_get_contents($area_data_file);
if ('' == $area_index_content) {
$area_need_dynamic = true;
}
}
return $area_index_content;
} elseif ($op == "saveStaticContent") {
if ("" == $params['content']) {
return;
}
writeover($area_data_file, $params['content']);
updateAreaStaticRefreshTime($timestamp + $area_static_step * 60);
}
}
示例4: download
/**
* 下载一个远程文件
* @param string $url
*/
function download($url, $bhv)
{
if (!$url || !PwDownload::checkUrl($url)) {
return false;
}
$filetype = PwDownload::getFileExt($url);
$filename = PwDownload::getFileName($url);
if (!$filetype || !$filename) {
return false;
}
//文件类型判定
if (!$filetype || !isset($bhv->ftype[$filetype])) {
return false;
}
$fileContent = PwDownload::getContents($url);
//文件尺寸判定
$fileSize = strlen($fileContent);
if ($fileSize < 1 || $fileSize > $bhv->ftype[$filetype] * 1024) {
unset($fileContent, $fileSize);
return false;
}
//init
$array = array('id' => 0, 'attname' => 'download', 'name' => $filename, 'size' => intval($fileSize), 'type' => 'zip', 'ifthumb' => 0, 'fileuploadurl' => '', 'ext' => $filetype);
//保存
list($saveFilename, $saveDir) = $bhv->getFilePath($array);
$source = PwUpload::savePath($bhv->ifftp, $saveFilename, $saveDir);
$tmpname = tempnam(DOWNLOAD_TEMP_PATH, DOWNLOAD_FILE_PREFIX);
writeover($tmpname, $fileContent);
if (!PwDownload::downloadMove($tmpname, $source)) {
showUploadMsg('upload_error');
}
$array['fileuploadurl'] = $saveDir . $saveFilename;
PwUpload::operateAttach($source, $saveFilename, $saveDir, $array, $bhv);
return $array;
}
示例5: 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);
}
示例6: _writeover
function _writeover()
{
$this->_keyword = trim($this->_filterCheckKeyword($this->_keyword));
if (!$this->_keyword) {
return false;
}
writeover($this->_filePath, $this->_parsetxt($this->_keyword), 'ab+');
return true;
}
示例7: generate
function generate($rss_path)
{
$all = $this->rssHeader;
$all .= $this->rssChannel;
$all .= $this->rssImage;
$all .= $this->rssItem;
$all .= "</channel></rss>";
writeover($rss_path, $all);
}
示例8: dblog
function dblog($msg)
{
$msg = str_replace(array("\n", "\r", "<"), array('', '', '<'), $msg);
if (file_exists(D_P . 'data/bbscache/dblog.php')) {
writeover(D_P . 'data/bbscache/dblog.php', "{$msg}\n", 'ab');
} else {
writeover(D_P . 'data/bbscache/dblog.php', "<?php die;?>\n{$msg}\n");
}
}
示例9: adminlog
function adminlog($op, $an1 = '', $an2 = '', $an3 = '')
{
global $now, $cuser;
$alfile = GAME_ROOT . './gamedata/adminlog.php';
if ($op) {
$aldata = "{$now},{$cuser},{$op},{$an1},{$an2},{$an3},\n";
writeover($alfile, $aldata, 'ab+');
}
return;
}
示例10: updatemedal_list
function updatemedal_list()
{
global $db;
$query = $db->query("SELECT uid FROM pw_medaluser GROUP BY uid");
$medaldb = '<?php die;?>0';
while ($rt = $db->fetch_array($query)) {
$medaldb .= ',' . $rt['uid'];
}
writeover(D_P . 'data/bbscache/medals_list.php', $medaldb);
}
示例11: writeover_array
function writeover_array($file, $arr)
{
$s = '';
$in = sizeof($arr);
for ($i = 0; $i < $in; $i++) {
if (strlen($arr[$i]) > 4) {
$s .= $arr[$i] . "\n";
}
}
$s = str_replace("\n\n", "\n", $s);
writeover($file, $s);
}
示例12: 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);
}
示例13: copyFile
function copyFile($source, $dest)
{
if (@copy($source, $dest)) {
return true;
}
if (is_readable($source)) {
writeover($dest, readover($source));
if (file_exists($dest)) {
return true;
}
}
return false;
}
示例14: 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);
}
}
示例15: get_title
function get_title($t, $n)
{
global $gamecfg, $name, $db, $tablepre;
require config("gamecfg", $gamecfg);
$result = $db->query("SELECT nicks FROM {$tablepre}users WHERE username = '{$n}'");
$k = $db->result($result, 0);
if (strpos($k, $t) === false) {
$cf = GAME_ROOT . './gamedata/clearlog.php';
$d = "{$n}" . ',' . "{$t}\n";
writeover($cf, $d, 'ab+');
$k = $k . '/' . $t;
}
$db->query("UPDATE {$tablepre}users SET nicks='{$k}' WHERE username='" . $n . "'");
}