本文整理汇总了PHP中clear_auto_cache函数的典型用法代码示例。如果您正苦于以下问题:PHP clear_auto_cache函数的具体用法?PHP clear_auto_cache怎么用?PHP clear_auto_cache使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了clear_auto_cache函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreverdelete
public function foreverdelete()
{
//彻底删除指定记录
$ajax = intval($_REQUEST['ajax']);
$id = $_REQUEST['id'];
if (isset($id)) {
$condition = array('id' => array('in', explode(',', $id)));
$rel_data = M(MODULE_NAME)->where($condition)->findAll();
foreach ($rel_data as $data) {
$info[] = $data['name'];
}
if ($info) {
$info = implode(",", $info);
}
$list = M(MODULE_NAME)->where($condition)->delete();
if ($list !== false) {
clear_auto_cache("cache_shop_cate");
save_log($info . l("FOREVER_DELETE_SUCCESS"), 1);
$this->success(l("FOREVER_DELETE_SUCCESS"), $ajax);
} else {
save_log($info . l("FOREVER_DELETE_FAILED"), 0);
$this->error(l("FOREVER_DELETE_FAILED"), $ajax);
}
} else {
$this->error(l("INVALID_OPERATION"), $ajax);
}
}
示例2: update
public function update()
{
$conf_res = M("Conf")->where("is_effect = 1 and is_conf = 1")->findAll();
foreach ($conf_res as $k => $v) {
conf($v['name'], $_REQUEST[$v['name']]);
if ($v['name'] == 'URL_MODEL' && $v['value'] != $_REQUEST[$v['name']]) {
clear_auto_cache("byouhui_filter_nav_cache");
clear_auto_cache("cache_shop_acate_tree");
clear_auto_cache("cache_shop_cate_tree");
clear_auto_cache("cache_youhui_cate_tree");
clear_auto_cache("city_list_result");
clear_auto_cache("fyouhui_filter_nav_cache");
clear_auto_cache("get_help_cache");
clear_auto_cache("page_image");
clear_auto_cache("tuan_filter_nav_cache");
clear_auto_cache("youhui_page_recommend_youhui_list");
clear_auto_cache("ytuan_filter_nav_cache");
clear_auto_cache("store_filter_nav_cache");
clear_dir_file(get_real_path() . "public/runtime/app/data_caches/");
clear_dir_file(get_real_path() . "public/runtime/app/tpl_caches/");
clear_dir_file(get_real_path() . "public/runtime/app/tpl_compiled/");
clear_dir_file(get_real_path() . "public/runtime/app/data_caches/");
clear_dir_file(get_real_path() . "public/runtime/data/page_static_cache/");
clear_dir_file(get_real_path() . "public/runtime/data/dynamic_avatar_cache/");
}
}
//开始写入配置文件
$sys_configs = M("Conf")->findAll();
$config_str = "<?php\n";
$config_str .= "return array(\n";
foreach ($sys_configs as $k => $v) {
$config_str .= "'" . $v['name'] . "'=>'" . addslashes($v['value']) . "',\n";
}
$config_str .= ");\n ?>";
$filename = get_real_path() . "public/sys_config.php";
if (!($handle = fopen($filename, 'w'))) {
$this->error(l("OPEN_FILE_ERROR") . $filename);
}
if (fwrite($handle, $config_str) === FALSE) {
$this->error(l("WRITE_FILE_ERROR") . $filename);
}
fclose($handle);
save_log(l("CONF_UPDATED"), 1);
//clear_cache();
write_timezone();
$this->success(L("UPDATE_SUCCESS"));
}
示例3: clear_data_file
private function clear_data_file()
{
@unlink(get_real_path() . "public/runtime/app/deal_cate_conf.js");
clear_dir_file(get_real_path() . "public/runtime/app/deal_region_conf/");
if (intval($_REQUEST['is_all']) == 0) {
//数据缓存
clear_dir_file(get_real_path() . "public/runtime/app/data_caches/");
clear_dir_file(get_real_path() . "public/runtime/app/db_caches/");
clear_dir_file(get_real_path() . "public/runtime/mapi/data_caches/");
$GLOBALS['cache']->clear();
clear_dir_file(get_real_path() . "public/runtime/app/tpl_caches/");
clear_dir_file(get_real_path() . "public/runtime/app/tpl_compiled/");
clear_dir_file(get_real_path() . "public/runtime/wap/tpl_caches/");
clear_dir_file(get_real_path() . "public/runtime/wap/tpl_compiled/");
@unlink(get_real_path() . "public/runtime/app/lang.js");
//删除相关未自动清空的数据缓存
clear_auto_cache("page_image");
} else {
clear_dir_file(get_real_path() . "public/runtime/data/");
clear_dir_file(get_real_path() . "public/runtime/app/data_caches/");
clear_dir_file(get_real_path() . "public/runtime/app/db_caches/");
clear_dir_file(get_real_path() . "public/runtime/mapi/data_caches/");
$GLOBALS['cache']->clear();
clear_dir_file(get_real_path() . "public/runtime/app/tpl_caches/");
clear_dir_file(get_real_path() . "public/runtime/app/tpl_compiled/");
clear_dir_file(get_real_path() . "public/runtime/wap/tpl_caches/");
clear_dir_file(get_real_path() . "public/runtime/wap/tpl_compiled/");
@unlink(get_real_path() . "public/runtime/app/lang.js");
//后台
clear_dir_file(get_real_path() . "public/runtime/admin/Cache/");
clear_dir_file(get_real_path() . "public/runtime/admin/Data/_fields/");
clear_dir_file(get_real_path() . "public/runtime/admin/Temp/");
clear_dir_file(get_real_path() . "public/runtime/admin/Logs/");
@unlink(get_real_path() . "public/runtime/admin/~app.php");
@unlink(get_real_path() . "public/runtime/admin/~runtime.php");
@unlink(get_real_path() . "public/runtime/admin/lang.js");
@unlink(get_real_path() . "public/runtime/app/config_cache.php");
$GLOBALS['db']->query("update " . DB_PREFIX . "deal_log set comment_data_cache = '',deal_info_cache=''");
$GLOBALS['db']->query("update " . DB_PREFIX . "deal set deal_extra_cache = ''");
$GLOBALS['db']->query("update " . DB_PREFIX . "deal_comment set deal_info_cache=''");
}
}
示例4: clear_data
public function clear_data()
{
set_time_limit(0);
es_session::close();
@unlink(get_real_path() . "public/runtime/app/deal_cate_conf.js");
clear_dir_file(get_real_path() . "public/runtime/app/deal_region_conf/");
if (intval($_REQUEST['is_all']) == 0) {
//数据缓存
clear_dir_file(get_real_path() . "public/runtime/app/data_caches/");
clear_dir_file(get_real_path() . "public/runtime/app/db_caches/");
$GLOBALS['cache']->clear();
clear_dir_file(get_real_path() . "public/runtime/app/tpl_caches/");
clear_dir_file(get_real_path() . "public/runtime/app/tpl_compiled/");
@unlink(get_real_path() . "public/runtime/app/lang.js");
//删除相关未自动清空的数据缓存
clear_auto_cache("page_image");
} else {
clear_dir_file(get_real_path() . "public/runtime/data/");
clear_dir_file(get_real_path() . "public/runtime/app/data_caches/");
clear_dir_file(get_real_path() . "public/runtime/app/db_caches/");
$GLOBALS['cache']->clear();
clear_dir_file(get_real_path() . "public/runtime/app/tpl_caches/");
clear_dir_file(get_real_path() . "public/runtime/app/tpl_compiled/");
@unlink(get_real_path() . "public/runtime/app/lang.js");
//后台
clear_dir_file(get_real_path() . "public/runtime/admin/Cache/");
clear_dir_file(get_real_path() . "public/runtime/admin/Data/_fields/");
clear_dir_file(get_real_path() . "public/runtime/admin/Temp/");
clear_dir_file(get_real_path() . "public/runtime/admin/Logs/");
@unlink(get_real_path() . "public/runtime/admin/~app.php");
@unlink(get_real_path() . "public/runtime/admin/~runtime.php");
@unlink(get_real_path() . "public/runtime/admin/lang.js");
@unlink(get_real_path() . "public/runtime/app/config_cache.php");
}
header("Content-Type:text/html; charset=utf-8");
exit("<div style='line-height:50px; text-align:center; color:#f30;'>" . L('CLEAR_SUCCESS') . "</div><div style='text-align:center;'><input type='button' onclick='\$.weeboxs.close();' class='button' value='关闭' /></div>");
}
示例5: syn_data
public function syn_data()
{
set_time_limit(0);
es_session::close();
//同步,supplier_location表, deal表, youhui表, event表 , supplier 表
//总数
$page = intval($_REQUEST['p']) == 0 ? 1 : intval($_REQUEST['p']);
if ($page == 1) {
syn_dealing();
}
$page_size = 5;
$location_total = M("SupplierLocation")->count();
$deal_total = M("Deal")->count();
$youhui_total = M("Youhui")->count();
$event_total = M("Event")->count();
$supplier_total = M("Supplier")->count();
$rebid_total = M("Rebid_submit")->where("status=1")->count();
$count = max(array($location_total, $deal_total, $youhui_total, $event_total, $supplier_total, $rebid_total));
$limit = ($page - 1) * $page_size . "," . $page_size;
$location_list = M("SupplierLocation")->limit($limit)->findAll();
foreach ($location_list as $v) {
syn_supplier_location_match($v['id']);
}
$supplier_list = M("Supplier")->limit($limit)->findAll();
foreach ($supplier_list as $v) {
syn_supplier_match($v['id']);
}
$deal_list = M("Deal")->limit($limit)->findAll();
foreach ($deal_list as $v) {
syn_deal_match($v['id']);
}
$youhui_list = M("Youhui")->limit($limit)->findAll();
foreach ($youhui_list as $v) {
syn_youhui_match($v['id']);
}
$event_list = M("Event")->limit($limit)->findAll();
foreach ($youhui_list as $v) {
syn_event_match($v['id']);
}
$rebid_list = M("Rebid_submit")->where("status=1")->limit($limit)->findAll();
foreach ($rebid_list as $v) {
syn_rebid_match($v['id']);
}
if ($page * $page_size >= $count) {
$this->assign("jumpUrl", U("Cache/index"));
$ajax = intval($_REQUEST['ajax']);
clear_auto_cache("cache_deal_cart");
$data['status'] = 1;
$data['info'] = "<div style='line-height:50px; text-align:center; color:#f30;'>同步成功</div><div style='text-align:center;'><input type='button' onclick='\$.weeboxs.close();' class='button' value='关闭' /></div>";
header("Content-Type:text/html; charset=utf-8");
exit(json_encode($data));
} else {
$total_page = ceil($count / $page_size);
$data['status'] = 0;
$data['info'] = "共" . $total_page . "页,当前第" . $page . "页,等待更新下一页记录";
$data['url'] = U("Cache/syn_data", array("p" => $page + 1));
header("Content-Type:text/html; charset=utf-8");
exit(json_encode($data));
}
}
示例6: set_default
public function set_default()
{
$id = intval($_REQUEST['id']);
$info = M(MODULE_NAME)->where("id=" . $id)->getField("name");
M(MODULE_NAME)->setField("is_default", 0);
M(MODULE_NAME)->where("id=" . $id)->setField("is_default", 1);
clear_auto_cache("city_list_result");
save_log($info . l("SET_DEFAULT"), 1);
$this->success(L("UPDATE_SUCCESS"));
}
示例7: insert
public function insert()
{
B('FilterString');
$ajax = intval($_REQUEST['ajax']);
$data = M("RegionConf")->create();
//开始验证有效性
$this->assign("jumpUrl", u("RegionConf" . "/add"));
if (!check_empty($data['name'])) {
$this->error(L("CITY_NAME_EMPTY_TIP"));
}
if (!check_empty($data['py'])) {
$this->error("请输入拼音");
}
// 更新数据
$log_info = $data['name'];
$list = M("RegionConf")->add($data);
if (false !== $list) {
//成功提示
$this->updateRegionJS();
save_log($log_info . L("INSERT_SUCCESS"), 1);
clear_auto_cache("city_list_result");
clear_auto_cache("deal_city_belone_ids");
$this->success(L("INSERT_SUCCESS"));
} else {
//错误提示
$DBerr = M()->getDbError();
save_log($log_info . L("INSERT_FAILED") . $DBerr, 0);
$this->error(L("INSERT_FAILED") . $DBerr);
}
}
示例8: foreverdelete
public function foreverdelete()
{
//删除指定记录
$ajax = intval($_REQUEST['ajax']);
$id = $_REQUEST['id'];
if (isset($id)) {
$condition = array('id' => array('in', explode(',', $id)));
$rel_data = M(MODULE_NAME)->where($condition)->findAll();
foreach ($rel_data as $data) {
$info[] = $data['name'];
}
if ($info) {
$info = implode(",", $info);
}
$list = M(MODULE_NAME)->where($condition)->delete();
if ($list !== false) {
M("SupplierLocationBrandLink")->where(array('brand_id' => array('in', explode(',', $id))))->delete();
M("Deal")->where(array('brand_id' => array('in', explode(',', $id))))->setField("brand_id", 0);
M("Youhui")->where(array('brand_id' => array('in', explode(',', $id))))->setField("brand_id", 0);
clear_auto_cache("static_goods_info");
save_log($info . l("DELETE_SUCCESS"), 1);
$this->success(l("DELETE_SUCCESS"), $ajax);
} else {
save_log($info . l("DELETE_FAILED"), 0);
$this->error(l("DELETE_FAILED"), $ajax);
}
} else {
$this->error(l("INVALID_OPERATION"), $ajax);
}
}
示例9: set_sort
public function set_sort()
{
$id = intval($_REQUEST['id']);
$sort = intval($_REQUEST['sort']);
$log_info = M(MODULE_NAME)->where("id=" . $id)->getField("field_name");
if (!check_sort($sort)) {
$this->error(l("SORT_FAILED"), 1);
}
M(MODULE_NAME)->where("id=" . $id)->setField("sort", $sort);
clear_auto_cache("user_field_list");
save_log($log_info . l("SORT_SUCCESS"), 1);
$this->success(l("SORT_SUCCESS"), 1);
}
示例10: youhui_insert
//.........这里部分代码省略.........
if ($v != '') {
$deal_attr_item['deal_id'] = $list;
$deal_attr_item['goods_type_attr_id'] = $goods_type_attr_id;
$deal_attr_item['name'] = $v;
$deal_attr_item['price'] = $deal_attr_price[$goods_type_attr_id][$k];
$deal_attr_item['is_checked'] = intval($deal_attr_stock_hd[$goods_type_attr_id][$k]);
M("DealAttr")->add($deal_attr_item);
}
}
}
//开始创建属性库存
$stock_cfg = $_REQUEST['stock_cfg_num'];
$attr_cfg = $_REQUEST['stock_attr'];
$attr_str = $_REQUEST['stock_cfg'];
foreach ($stock_cfg as $row => $v) {
$stock_data = array();
$stock_data['deal_id'] = $list;
$stock_data['stock_cfg'] = $v;
$stock_data['attr_str'] = $attr_str[$row];
$attr_cfg_data = array();
foreach ($attr_cfg as $attr_id => $cfg) {
$attr_cfg_data[$attr_id] = $cfg[$row];
}
$stock_data['attr_cfg'] = serialize($attr_cfg_data);
M("AttrStock")->add($stock_data);
}
if (intval($_REQUEST['free_delivery']) == 1) {
$delivery_ids = $_REQUEST['delivery_id'];
$free_counts = $_REQUEST['free_count'];
foreach ($delivery_ids as $k => $v) {
$free_conf = array();
$free_conf['delivery_id'] = $delivery_ids[$k];
$free_conf['free_count'] = $free_counts[$k];
$free_conf['deal_id'] = $list;
M("FreeDelivery")->add($free_conf);
}
}
if (intval($_REQUEST['define_payment']) == 1) {
$payment_ids = $_REQUEST['payment_id'];
foreach ($payment_ids as $k => $v) {
$payment_conf = array();
$payment_conf['payment_id'] = $payment_ids[$k];
$payment_conf['deal_id'] = $list;
M("DealPayment")->add($payment_conf);
}
}
$delivery_ids = $_REQUEST['forbid_delivery_id'];
foreach ($delivery_ids as $k => $v) {
$delivery_conf = array();
$delivery_conf['delivery_id'] = $delivery_ids[$k];
$delivery_conf['deal_id'] = $list;
M("DealDelivery")->add($delivery_conf);
}
//开始创建筛选项
$filter = $_REQUEST['filter'];
foreach ($filter as $filter_group_id => $filter_value) {
$filter_data = array();
$filter_data['filter'] = $filter_value;
$filter_data['filter_group_id'] = $filter_group_id;
$filter_data['deal_id'] = $list;
M("DealFilter")->add($filter_data);
$filter_array = preg_split("/[ ,]/i", $filter_value);
foreach ($filter_array as $filter_item) {
$filter_row = M("Filter")->where("filter_group_id = " . $filter_group_id . " and name = '" . $filter_item . "'")->find();
if (!$filter_row) {
$filter_row = array();
$filter_row['name'] = $filter_item;
$filter_row['filter_group_id'] = $filter_group_id;
M("Filter")->add($filter_row);
}
}
}
foreach ($_REQUEST['deal_cate_type_id'] as $type_id) {
$link_data = array();
$link_data['deal_cate_type_id'] = $type_id;
$link_data['deal_id'] = $list;
M("DealCateTypeDealLink")->add($link_data);
}
foreach ($_REQUEST['location_id'] as $location_id) {
$link_data = array();
$link_data['location_id'] = $location_id;
$link_data['deal_id'] = $list;
M("DealLocationLink")->add($link_data);
}
//成功提示
syn_deal_status($list);
foreach ($_REQUEST['location_id'] as $location_id) {
recount_supplier_data_count($location_id, "daijin");
}
syn_deal_match($list);
clear_auto_cache("byouhui_filter_nav_cache");
save_log($log_info . L("INSERT_SUCCESS"), 1);
$this->success(L("INSERT_SUCCESS"));
} else {
//错误提示
$dbErr = M()->getDbError();
save_log($log_info . L("INSERT_FAILED") . $dbErr, 0);
$this->error(L("INSERT_FAILED") . $dbErr);
}
}
示例11: foreverdelete
public function foreverdelete()
{
//彻底删除指定记录
$ajax = intval($_REQUEST['ajax']);
$id = $_REQUEST['id'];
if (isset($id)) {
$condition = array('id' => array('in', explode(',', $id)));
if (M("SupplierLocationDp")->where(array('supplier_location_id' => array('in', explode(',', $id))))->count() > 0) {
$this->error("请先清空商户的点评", $ajax);
}
$rel_data = M(MODULE_NAME)->where($condition)->findAll();
foreach ($rel_data as $data) {
$info[] = $data['name'];
}
if ($info) {
$info = implode(",", $info);
}
$list = M(MODULE_NAME)->where($condition)->delete();
//删除相关预览图
// foreach($rel_data as $data)
// {
// @unlink(get_real_path().$data['preview']);
// }
if ($list !== false) {
clear_auto_cache("store_filter_nav_cache");
M("SupplierTagGroupPreset")->where(array('supplier_location_id' => array('in', explode(',', $id))))->delete();
M("SupplierTag")->where(array('supplier_location_id' => array('in', explode(',', $id))))->delete();
M("SupplierLocationPointResult")->where(array('supplier_location_id' => array('in', explode(',', $id))))->delete();
M("DealLocationLink")->where(array('location_id' => array('in', explode(',', $id))))->delete();
M("YouhuiLocationLink")->where(array('location_id' => array('in', explode(',', $id))))->delete();
M("DealCateTypeLocationLink")->where(array('location_id' => array('in', explode(',', $id))))->delete();
M("SupplierAccountLocationLink")->where(array('location_id' => array('in', explode(',', $id))))->delete();
M("TagUserVote")->where(array('location_id' => array('in', explode(',', $id))))->delete();
M("SupplierLocationImages")->where(array('supplier_location_id' => array('in', explode(',', $id))))->delete();
M("SupplierLocationAreaLink")->where(array('location_id' => array('in', explode(',', $id))))->delete();
M("SupplierLocationBrandLink")->where(array('location_id' => array('in', explode(',', $id))))->delete();
clear_auto_cache("static_goods_info");
save_log($info . l("FOREVER_DELETE_SUCCESS"), 1);
$this->success(l("FOREVER_DELETE_SUCCESS"), $ajax);
} else {
save_log($info . l("FOREVER_DELETE_FAILED"), 0);
$this->error(l("FOREVER_DELETE_FAILED"), $ajax);
}
} else {
$this->error(l("INVALID_OPERATION"), $ajax);
}
}
示例12: uninstall
public function uninstall()
{
$ajax = intval($_REQUEST['ajax']);
$id = intval($_REQUEST['id']);
$data = M(MODULE_NAME)->getById($id);
if ($data) {
$info = $data['name'];
$list = M(MODULE_NAME)->where(array('id' => $data['id']))->delete();
if ($list !== false) {
save_log($info . l("UNINSTALL_SUCCESS"), 1);
clear_auto_cache("group_array_cache");
$this->success(l("UNINSTALL_SUCCESS"), $ajax);
} else {
save_log($info . l("UNINSTALL_FAILED"), 0);
$this->error(l("UNINSTALL_FAILED"), $ajax);
}
} else {
$this->error(l("INVALID_OPERATION"), $ajax);
}
}
示例13: update
public function update()
{
B('FilterString');
$data = M(MODULE_NAME)->create();
$log_info = M(MODULE_NAME)->where("id=" . intval($data['id']))->getField("name");
//开始验证有效性
$this->assign("jumpUrl", u(MODULE_NAME . "/edit", array("id" => $data['id'])));
if (!check_empty($data['name'])) {
$this->error(L("SUPPLIER_NAME_EMPTY_TIP"));
}
// 更新数据
$list = M(MODULE_NAME)->save($data);
if (false !== $list) {
syn_supplier_match($data['id']);
clear_auto_cache("static_goods_info");
//成功提示
save_log($log_info . L("UPDATE_SUCCESS"), 1);
$this->success(L("UPDATE_SUCCESS"));
} else {
//错误提示
save_log($log_info . L("UPDATE_FAILED"), 0);
$this->error(L("UPDATE_FAILED"), 0, $log_info . L("UPDATE_FAILED"));
}
}
示例14: update
public function update()
{
$data = M(MODULE_NAME)->create();
//开始验证有效性
$this->assign("jumpUrl", u(MODULE_NAME . "/add"));
if (!check_empty($data['name'])) {
$this->error(L("TAGNAME_EMPTY_TIP"));
}
$this->assign("jumpUrl", u(MODULE_NAME . "/edit", array("id" => $data['id'])));
$log_info = $data['name'];
// 更新数据
$list = M(MODULE_NAME)->save($data);
if (false !== $list) {
//成功提示
M("TagGroupLink")->where("tag_group_id=" . $data['id'])->delete();
foreach ($_REQUEST['cate_id'] as $cate_id) {
if (intval($cate_id) > 0) {
$link_data = array();
$link_data['category_id'] = intval($cate_id);
$link_data['tag_group_id'] = $data['id'];
M("TagGroupLink")->add($link_data);
}
}
clear_auto_cache("store_filter_nav_cache");
save_log($log_info . L("UPDATE_SUCCESS"), 1);
$this->success(L("UPDATE_SUCCESS"));
} else {
//错误提示
save_log($log_info . L("UPDATE_FAILED"), 0);
$this->error(L("UPDATE_FAILED"), 0, $log_info . L("UPDATE_FAILED"));
}
}
示例15: set_effect
public function set_effect()
{
$id = intval($_REQUEST['id']);
$ajax = intval($_REQUEST['ajax']);
$info = M(MODULE_NAME)->where("id=" . $id)->getField("title");
$c_is_effect = M(MODULE_NAME)->where("id=" . $id)->getField("is_effect");
//当前状态
$n_is_effect = $c_is_effect == 0 ? 1 : 0;
//需设置的状态
M(MODULE_NAME)->where("id=" . $id)->setField("is_effect", $n_is_effect);
save_log($info . l("SET_EFFECT_" . $n_is_effect), 1);
clear_auto_cache("get_help_cache");
$this->ajaxReturn($n_is_effect, l("SET_EFFECT_" . $n_is_effect), 1);
}