本文整理汇总了PHP中cache_delete函数的典型用法代码示例。如果您正苦于以下问题:PHP cache_delete函数的具体用法?PHP cache_delete怎么用?PHP cache_delete使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cache_delete函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cron_run
function cron_run($force = 0)
{
global $conf, $time, $forumlist, $runtime;
$cron_1_last_date = runtime_get('cron_1_last_date');
$cron_2_last_date = runtime_get('cron_2_last_date');
$t = $time - $cron_1_last_date;
if ($t > 300 || $force) {
$lock = cache_get('cron_lock_1');
if ($lock === NULL) {
cache_set('cron_lock_1', 1, 10);
// 设置 10 秒超时
// 清理在线
online_gc();
runtime_set('cron_1_last_date', $time);
cache_delete('cron_lock_1');
}
}
$t = $time - $cron_2_last_date;
if ($t > 86400 || $force) {
$lock = cache_get('cron_lock_2');
// 高并发下, mysql 机制实现的锁锁不住,但是没关系
if ($lock === NULL) {
cache_set('cron_lock_2', 1, 10);
// 设置 10 秒超时
// 每日统计清 0
runtime_set('todayposts', 0);
runtime_set('todaythreads', 0);
runtime_set('todayusers', 0);
foreach ($forumlist as $fid => $forum) {
forum__update($fid, array('todayposts' => 0, 'todaythreads' => 0));
}
forum_list_cache_delete();
// 清理最新发帖,只保留 100 条。
thread_new_gc();
thread_lastpid_gc();
// 清理在线
online_gc();
// 清理临时附件
attach_gc();
// 清空每日 IP 限制
ipaccess_truncate();
// 清理游客喜欢限制
guest_agree_truncate();
list($y, $n, $d) = explode(' ', date('Y n j', $time));
// 0 点
$today = mktime(0, 0, 0, $n, $d, $y);
// -8 hours
runtime_set('cron_2_last_date', $today, TRUE);
// 加到1天后
// 每日生成最新的 sitemap
thread_new_sitemap();
// 往前推8个小时,尽量保证在前一天
table_day_cron($time - 8 * 3600);
cache_delete('cron_lock_2');
}
}
}
示例2: thread_top_cache_delete
function thread_top_cache_delete()
{
global $conf;
static $deleted = FALSE;
if ($deleted) {
return;
}
cache_delete('thread_top_list');
$deleted = TRUE;
}
示例3: user_delete
function user_delete($uid)
{
global $conf;
// 清理用户资源
$threadlist = mythread_find_by_uid($uid, 1, 1000);
foreach ($threadlist as $thread) {
thread_delete($thread['tid']);
}
$r = user__delete($uid);
$conf['cache']['type'] != 'mysql' and cache_delete("user-{$uid}");
// 全站统计
runtime_set('users-', 1);
return $r;
}
示例4: delete_admin
function delete_admin($username)
{
$r = $this->get_one($username);
if ($r) {
if ($r['userid'] == $this->founderid) {
return $this->_('创始人不可删除');
}
if ($r['admin'] == 1 && $this->count_admin() < 2) {
return $this->_('系统最少需要保留一位超级管理员');
}
$userid = $r['userid'];
$groupid = $r['regid'] ? $r['regid'] : 6;
$this->db->query("UPDATE {$this->pre}member SET groupid={$groupid},admin=0,role='',aid=0 WHERE userid={$userid}");
$this->db->query("UPDATE {$this->pre}company SET groupid={$groupid} WHERE userid={$userid}");
$this->db->query("DELETE FROM {$this->pre}admin WHERE userid={$userid}");
cache_delete('menu-' . $userid . '.php');
cache_delete('right-' . $userid . '.php');
return true;
} else {
return $this->_('会员不存在');
}
}
示例5: pdo_fetchcolumn
$id = pdo_fetchcolumn("SELECT id FROM " . tablename('uni_group') . " WHERE uniacid = :uniacid", array(':uniacid' => $uniacid));
if (empty($id)) {
pdo_insert('uni_group', $data);
} else {
pdo_update('uni_group', $data, array('id' => $id));
}
} else {
pdo_delete('uni_group', array('uniacid' => $uniacid));
}
cache_delete("unisetting:{$uniacid}");
cache_delete("unimodules:{$uniacid}:1");
cache_delete("unimodules:{$uniacid}:");
cache_delete("uniaccount:{$uniacid}");
cache_delete("accesstoken:{$acid}");
cache_delete("jsticket:{$acid}");
cache_delete("cardticket:{$acid}");
load()->model('module');
module_build_privileges();
if (!empty($_GPC['from'])) {
message('公众号权限修改成功', url('account/post-step/', array('uniacid' => $uniacid, 'step' => 3, 'from' => 'list')), 'success');
} else {
header("Location: " . url('account/post-step/', array('uniacid' => $uniacid, 'acid' => $acid, 'step' => 4)));
exit;
}
}
$unigroups = uni_groups();
$settings = uni_setting($uniacid, array('notify'));
$notify = $settings['notify'] ? $settings['notify'] : array();
$ownerid = pdo_fetchcolumn("SELECT uid FROM " . tablename('uni_account_users') . " WHERE uniacid = :uniacid AND role = 'owner'", array(':uniacid' => $uniacid));
if (!empty($ownerid)) {
$owner = user_single(array('uid' => $ownerid));
示例6: define
<?php
define('APP_NAME', 'test');
chdir(getcwd() . '/../');
$conf = (include './conf/conf.php');
$conf['cache']['type'] = 'memcached';
include './xiunophp/xiunophp.php';
$r = cache_get('test2');
x('cache_get test2:', $r, NULL);
$r = cache_set('test', array('123'));
x('cache_set', $r, true);
$r = cache_get('test');
x('cache_get', $r[0], '123');
$r = cache_delete('test');
x('cache_delete', $r, TRUE);
$r = cache_get('test');
x('cache_get', $r, NULL);
$r = cache_truncate();
x('cache_truncate', $r, TRUE);
function x($info, $a, $b)
{
echo "{$info}: ... " . ($a === $b ? '[ok]' : var_export($a, 1) . ", except:" . var_export($b, 1)) . "\r\n";
}
示例7: message
}
if ($pieces[0] == IMS_RELEASE_DATE) {
$ds[$k]['current'] = true;
}
}
$foo = $_GPC['foo'];
if ($foo == 'manual') {
$ver = $_GPC['version'];
if ($ds[$ver] && $ds[$ver]['current']) {
$file = IA_ROOT . "/data/update/update({$ver}).php";
$evalret = (include $file);
if (!$evalret) {
message('自动升级执行失败, 请联系开发人员解决.');
}
cache_build_fans_struct();
cache_build_setting();
cache_build_modules();
}
cache_delete('upgrade');
message('升级成功, 请删除此升级.', referer());
}
if ($foo == 'delete') {
$ver = $_GPC['version'];
if ($ds[$ver] && $ds[$ver]['error']) {
$file = IA_ROOT . "/data/update/update({$ver}).php";
@unlink($file);
}
message('执行成功.', referer());
}
}
template('cloud/upgrade');
示例8: release_lock
function release_lock($key)
{
if (locks($key)) {
$res = cache_delete($key);
locks($key, false);
return $res;
}
return false;
}
示例9: message
break;
case '2':
message('您已经购买过此升级版本,系统将直接跳转至升级界面。', url('cloud/process', array('m' => $auth['name'], 'is_upgrade' => 1, 'is_buy' => 1)), 'success');
break;
case '1':
message('购买模块升级版本成功,系统将直接跳转至升级界面。', url('cloud/process', array('m' => $auth['name'], 'is_upgrade' => 1, 'is_buy' => 1)), 'success');
exit;
break;
}
message($response['message']['message']);
}
if ($do == 'callback') {
$secret = $_GPC['token'];
if (strlen($secret) == 32) {
$cache = cache_read('cloud:auth:transfer');
cache_delete('cloud:auth:transfer');
if (!empty($cache) && $cache['secret'] == $secret) {
$site = array_elements(array('key', 'token'), $cache);
setting_save($site, 'site');
$auth['key'] = $site['key'];
$auth['password'] = md5($site['key'] . $site['token']);
$auth['forward'] = 'profile';
header('location: ' . __to($auth));
exit;
}
}
message('访问错误.');
}
template('cloud/frame');
function __to($auth)
{
示例10: message
if (empty($_GPC['dir'])) {
message('请选择要扫描的目录', referer(), 'success');
}
foreach ($_GPC['dir'] as $k => $v) {
if (in_array(basename($v), $ignore)) {
unset($_GPC['dir'][$k]);
}
}
$info['file_type'] = 'php|js';
$info['func'] = trim($_GPC['func']) ? trim($_GPC['func']) : 'com|system|exec|eval|escapeshell|cmd|passthru|base64_decode|gzuncompress';
$info['code'] = trim($_GPC['code']) ? trim($_GPC['code']) : 'weidongli|sinaapp';
$info['md5_file'] = trim($_GPC['md5_file']);
$info['dir'] = $_GPC['dir'];
cache_delete('scan:config');
cache_delete('scan:file');
cache_delete('scan:badfile');
cache_write('scan:config', iserializer($info));
message("配置保存完成,开始文件统计。。。", url('system/tools/scan', array('op' => 'count')), 'success');
}
}
if ($op == 'count') {
load()->func('file');
set_time_limit(0);
$files = array();
$config = iunserializer(cache_read('scan:config'));
if (empty($config)) {
message('获取扫描配置失败', url('system/tools/scan'), 'error');
}
$config['file_type'] = explode('|', $config['file_type']);
$list_arr = array();
foreach ($config['dir'] as $v) {
示例11: error_code
public function error_code($code)
{
$errors = array('-1' => '系统繁忙', '0' => '请求成功', '40001' => '获取access_token时AppSecret错误,或者access_token无效', '40002' => '不合法的凭证类型', '40003' => '不合法的OpenID', '40004' => '不合法的媒体文件类型', '40005' => '不合法的文件类型', '40006' => '不合法的文件大小', '40007' => '不合法的媒体文件id', '40008' => '不合法的消息类型', '40009' => '不合法的图片文件大小', '40010' => '不合法的语音文件大小', '40011' => '不合法的视频文件大小', '40012' => '不合法的缩略图文件大小', '40013' => '不合法的APPID', '40014' => '不合法的access_token', '40015' => '不合法的菜单类型', '40016' => '不合法的按钮个数', '40017' => '不合法的按钮个数', '40018' => '不合法的按钮名字长度', '40019' => '不合法的按钮KEY长度', '40020' => '不合法的按钮URL长度', '40021' => '不合法的菜单版本号', '40022' => '不合法的子菜单级数', '40023' => '不合法的子菜单按钮个数', '40024' => '不合法的子菜单按钮类型', '40025' => '不合法的子菜单按钮名字长度', '40026' => '不合法的子菜单按钮KEY长度', '40027' => '不合法的子菜单按钮URL长度', '40028' => '不合法的自定义菜单使用用户', '40029' => '不合法的oauth_code', '40030' => '不合法的refresh_token', '40031' => '不合法的openid列表', '40032' => '不合法的openid列表长度', '40033' => '不合法的请求字符,不能包含\\uxxxx格式的字符', '40035' => '不合法的参数', '40038' => '不合法的请求格式', '40039' => '不合法的URL长度', '40050' => '不合法的分组id', '40051' => '分组名字不合法', '41001' => '缺少access_token参数', '41002' => '缺少appid参数', '41003' => '缺少refresh_token参数', '41004' => '缺少secret参数', '41005' => '缺少多媒体文件数据', '41006' => '缺少media_id参数', '41007' => '缺少子菜单数据', '41008' => '缺少oauth code', '41009' => '缺少openid', '42001' => 'access_token超时', '42002' => 'refresh_token超时', '42003' => 'oauth_code超时', '43001' => '需要GET请求', '43002' => '需要POST请求', '43003' => '需要HTTPS请求', '43004' => '需要接收者关注', '43005' => '需要好友关系', '44001' => '多媒体文件为空', '44002' => 'POST的数据包为空', '44003' => '图文消息内容为空', '44004' => '文本消息内容为空', '45001' => '多媒体文件大小超过限制', '45002' => '消息内容超过限制', '45003' => '标题字段超过限制', '45004' => '描述字段超过限制', '45005' => '链接字段超过限制', '45006' => '图片链接字段超过限制', '45007' => '语音播放时间超过限制', '45008' => '图文消息超过限制', '45009' => '接口调用超过限制', '45010' => '创建菜单个数超过限制', '45015' => '回复时间超过限制', '45016' => '系统分组,不允许修改', '45017' => '分组名字过长', '45018' => '分组数量超过上限', '46001' => '不存在媒体数据', '46002' => '不存在的菜单版本', '46003' => '不存在的菜单数据', '46004' => '不存在的用户', '47001' => '解析JSON/XML内容错误', '48001' => 'api功能未授权', '50001' => '用户未授权该api', '40070' => '基本信息baseinfo中填写的库存信息SKU不合法。', '41011' => '必填字段不完整或不合法,参考相应接口。', '40056' => '无效code,请确认code长度在20个字符以内,且处于非异常状态(转赠、删除)。', '43009' => '无自定义SN权限,请参考开发者必读中的流程开通权限。', '43010' => '无储值权限,请参考开发者必读中的流程开通权限。', '43011' => '无积分权限,请参考开发者必读中的流程开通权限。', '40078' => '无效卡券,未通过审核,已被置为失效。', '40079' => '基本信息base_info中填写的date_info不合法或核销卡券未到生效时间。', '45021' => '文本字段超过长度限制,请参考相应字段说明。', '40080' => '卡券扩展信息cardext不合法。', '40097' => '基本信息base_info中填写的url_name_type或promotion_url_name_type不合法。', '49004' => '签名错误。', '43012' => '无自定义cell跳转外链权限,请参考开发者必读中的申请流程开通权限。', '40099' => '该code已被核销。');
$code = strval($code);
if ($code == '40001' || $code == '42001') {
$cachekey = "accesstoken:{$this->account['acid']}";
cache_delete($cachekey);
return '微信公众平台授权异常, 系统已修复这个错误, 请刷新页面重试.';
}
if ($errors[$code]) {
return $errors[$code];
} else {
return '未知错误';
}
}
示例12: form_text
$sitebrief = $setting['sitebrief'];
// 站点介绍
$input['seo_title'] = form_text('seo_title', $setting['seo_title'], '100%');
$input['seo_keywords'] = form_text('seo_keywords', $setting['seo_keywords'], '100%');
$input['seo_description'] = form_text('seo_description', $setting['seo_description'], '100%');
$input['footer_code'] = form_textarea('footer_code', $setting['footer_code'], '100%', '50px');
include './admin/view/setting.htm';
} else {
$sitebrief = param('sitebrief', '', FALSE);
$seo_title = param('seo_title', '', FALSE);
$seo_keywords = param('seo_keywords', '', FALSE);
$seo_description = param('seo_description', '', FALSE);
$footer_code = param('footer_code', '', FALSE);
$setting = array('sitebrief' => $sitebrief, 'seo_title' => $seo_title, 'seo_keywords' => $seo_keywords, 'seo_description' => $seo_description, 'footer_code' => $footer_code);
kv_set('setting', $setting);
cache_delete('setting');
empty($readable) and message(-1, '配置文件 conf/conf.php 不可写,请手工修改。');
$sitename = param('sitename', '', FALSE);
$runlevel = param('runlevel', 0);
$conf['sitename'] = $sitename;
$conf['runlevel'] = $runlevel;
conf_save();
message(0, '修改成功');
}
/*
} elseif($action == 'smtp') {
if($method == 'GET') {
$mailconf = kv_get('smtp');
$sendtype = &$mailconf['sendtype'];
$smtplist = &$mailconf['smtplist'];
示例13: post_list_cache_delete
function post_list_cache_delete($tid)
{
global $conf;
return cache_delete("postlist_{$tid}");
}
示例14: isset
$tableid = isset($tableid) ? $tableid - 1 : 0;
$startfrom = isset($startfrom) ? intval($startfrom) : 0;
$tablenumber = count($tables);
for ($i = $tableid; $i < $tablenumber && strlen($sqldump) < $sizelimit * 1000; $i++) {
$sqldump .= sql_dumptable($tables[$i], $startfrom, strlen($sqldump));
$startfrom = 0;
}
if (trim($sqldump)) {
$sqldump = "# Destoon V" . DT_VERSION . " R" . DT_RELEASE . " http://www.destoon.com\n# " . timetodate($DT_TIME, 6) . "\n# --------------------------------------------------------\n\n\n" . $sqldump;
$tableid = $i;
$filename = $random . '/' . $fileid . '.sql';
file_put($D . $filename, $sqldump);
$fid = $fileid;
msg('分卷 <strong>#' . $fileid++ . '</strong> 备份成功.. 程序将自动继续...' . progress(0, $fid, $tid), '?file=' . $file . '&sizelimit=' . $sizelimit . '&sqlcompat=' . $sqlcompat . '&sqlcharset=' . $sqlcharset . '&tableid=' . $tableid . '&fileid=' . $fileid . '&fileid=' . $fileid . '&tid=' . $tid . '&startfrom=' . $startrow . '&random=' . $random . '&backup=1');
} else {
cache_delete($_username . '_backup.php');
$db->query("DELETE FROM {$DT_PRE}setting WHERE item='destoon' AND item_key='backtime'");
$db->query("INSERT INTO {$DT_PRE}setting (item,item_key,item_value) VALUES('destoon','backtime','{$DT_TIME}')");
msg('数据库备份成功', '?file=' . $file . '&action=import');
}
} else {
$dtables = $tables = $C = $T = array();
$i = $j = $dtotalsize = $totalsize = 0;
$result = $db->query("SHOW TABLES FROM `" . $CFG['db_name'] . "`");
while ($rr = $db->fetch_row($result)) {
if (!$rr[0]) {
continue;
}
$T[$rr[0]] = $rr[0];
}
uksort($T, 'strnatcasecmp');
示例15: defined
<?php
defined('IN_DESTOON') or exit('Access Denied');
$tab = isset($tab) ? intval($tab) : 0;
$all = isset($all) ? intval($all) : 0;
$all = isset($all) ? intval($all) : 0;
if ($submit) {
if ($setting['split']) {
$setting['fulltext'] = 0;
cache_write($moduleid . '.part', $moduleid);
} else {
cache_delete($moduleid . '.part');
}
foreach ($setting as $k => $v) {
if (strpos($k, 'seo_') === false) {
continue;
}
seo_check($v) or msg('SEO信息包含非法字符');
}
update_setting($moduleid, $setting);
cache_module($moduleid);
if ($setting['php_list_urlid'] != $MOD['php_list_urlid'] || $setting['htm_list_urlid'] != $MOD['htm_list_urlid'] || $setting['htm_list_prefix'] != $MOD['htm_list_prefix'] || $setting['list_html'] != $MOD['list_html']) {
$_MOD = $MOD;
$MOD = $setting;
$result = $db->query("SELECT * FROM {$DT_PRE}category WHERE moduleid={$moduleid}");
while ($r = $db->fetch_array($result)) {
update_category($r);
}
cache_category($moduleid);
$MOD = $_MOD;
}