当前位置: 首页>>代码示例>>PHP>>正文


PHP dkcache函数代码示例

本文整理汇总了PHP中dkcache函数的典型用法代码示例。如果您正苦于以下问题:PHP dkcache函数的具体用法?PHP dkcache怎么用?PHP dkcache使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了dkcache函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: dropCache

 /**
  * 删除缓存数据
  */
 public function dropCache()
 {
     $this->cachedData = null;
     $this->gcForCacheModel = null;
     dkcache('gc_class');
     dkcache('all_categories');
 }
开发者ID:ff00x0,项目名称:shopnc,代码行数:10,代码来源:goods_class.model.php

示例2: clearOp

 /**
  * 清理缓存
  */
 public function clearOp()
 {
     if (!chksubmit()) {
         Tpl::showpage('cache.clear');
         return;
     }
     $lang = Language::getLangContent();
     // 清理所有缓存
     if ($_POST['cls_full'] == 1) {
         foreach ($this->cacheItems as $i) {
             dkcache($i);
         }
         // 表主键
         Model::dropTablePkArrayCache();
         // 商品分类
         dkcache('gc_class');
         dkcache('all_categories');
         dkcache('goods_class_seo');
         dkcache('class_tag');
         // 广告
         Model('adv')->makeApAllCache();
         // 首页
         Model('web_config')->getWebHtml('index', 1);
         delCacheFile('index');
     } else {
         $todo = (array) $_POST['cache'];
         foreach ($this->cacheItems as $i) {
             if (in_array($i, $todo)) {
                 dkcache($i);
             }
         }
         // 表主键
         if (in_array('table', $todo)) {
             Model::dropTablePkArrayCache();
         }
         // 商品分类
         if (in_array('goodsclass', $todo)) {
             dkcache('gc_class');
             dkcache('all_categories');
             dkcache('goods_class_seo');
             dkcache('class_tag');
         }
         // 广告
         if (in_array('adv', $todo)) {
             Model('adv')->makeApAllCache();
         }
         // 首页
         if (in_array('index', $todo)) {
             Model('web_config')->getWebHtml('index', 1);
             delCacheFile('index');
         }
     }
     $this->log(L('cache_cls_operate'));
     showMessage($lang['cache_cls_ok']);
 }
开发者ID:flying3615,项目名称:chuniang,代码行数:58,代码来源:cache.php

示例3: ajaxOp

 /**
  * ajax操作
  */
 public function ajaxOp()
 {
     switch ($_GET['branch']) {
         case 'state':
             $model_brand = Model('express');
             $update_array = array();
             $update_array['id'] = intval($_GET['id']);
             $update_array[$_GET['column']] = trim($_GET['value']);
             $model_brand->update($update_array);
             dkcache('express');
             $this->log(L('nc_edit,express_name,express_state') . '[ID:' . intval($_GET['id']) . ']', 1);
             echo 'true';
             exit;
             break;
         case 'order':
             $_GET['value'] = $_GET['value'] == 0 ? 2 : 1;
             $model_brand = Model('express');
             $update_array = array();
             $update_array['id'] = intval($_GET['id']);
             $update_array[$_GET['column']] = trim($_GET['value']);
             $model_brand->update($update_array);
             dkcache('express');
             $this->log(L('nc_edit,express_name,express_state') . '[ID:' . intval($_GET['id']) . ']', 1);
             echo 'true';
             exit;
             break;
         case 'e_zt_state':
             $model_brand = Model('express');
             $update_array = array();
             $update_array['id'] = intval($_GET['id']);
             $update_array[$_GET['column']] = trim($_GET['value']);
             $model_brand->update($update_array);
             dkcache('express');
             $this->log(L('nc_edit,express_name,express_state') . '[ID:' . intval($_GET['id']) . ']', 1);
             echo 'true';
             exit;
             break;
     }
     dkcache('express');
 }
开发者ID:noikiy,项目名称:shopnc-minion,代码行数:43,代码来源:express.php

示例4: updateSetting

 /**
  * 更新信息
  *
  * @param array $param 更新数据
  * @return bool 布尔类型的返回结果
  */
 public function updateSetting($param)
 {
     if (empty($param)) {
         return false;
     }
     if (is_array($param)) {
         foreach ($param as $k => $v) {
             $tmp = array();
             $specialkeys_arr = array('statistics_code');
             $tmp['value'] = in_array($k, $specialkeys_arr) ? htmlentities($v, ENT_QUOTES) : $v;
             $where = " name = '" . $k . "'";
             $result = Db::update('setting', $tmp, $where);
             if ($result !== true) {
                 return $result;
             }
         }
         dkcache('setting');
         return true;
     } else {
         return false;
     }
 }
开发者ID:Maplecms,项目名称:shopnc-api,代码行数:28,代码来源:setting.model.php

示例5: update_cacheOp

 /**
  * 更新圈子成员等级缓存
  */
 public function update_cacheOp()
 {
     dkcache('circle_level');
     showMessage(L('nc_common_op_succ'), 'index.php?act=circle_memberlevel');
 }
开发者ID:noikiy,项目名称:cunkou,代码行数:8,代码来源:circle_memberlevel.php

示例6: dropCachedData

 /**
  * 删除缓存
  *
  * @param string $key 缓存键
  */
 public function dropCachedData($key)
 {
     unset($this->cachedData[$key]);
     dkcache($key);
 }
开发者ID:flying3615,项目名称:chuniang,代码行数:10,代码来源:groupbuy.model.php

示例7: store_grade_delOp

 /**
  * 删除等级
  */
 public function store_grade_delOp()
 {
     /**
      * 读取语言包
      */
     $lang = Language::getLangContent();
     $model_grade = Model('store_grade');
     if (intval($_GET['sg_id']) > 0) {
         //判断是否默认等级,默认等级不能删除
         if ($_GET['sg_id'] == 1) {
             //showMessage('默认等级不能删除 ','index.php?act=store_grade&op=store_grade');
             showMessage($lang['default_store_grade_no_del'], 'index.php?act=store_grade&op=store_grade');
         }
         //判断该等级下是否存在店铺,存在的话不能删除
         if (!$this->isable_delGrade(intval($_GET['sg_id']))) {
             showMessage($lang['del_gradehavestore'], 'index.php?act=store_grade&op=store_grade');
         }
         /**
          * 删除分类
          */
         $model_grade->del(intval($_GET['sg_id']));
         dkcache('store_grade');
         $this->log(L('nc_del,store_grade') . '[ID:' . intval($_GET['sg_id']) . ']', 1);
         showMessage($lang['nc_common_del_succ'], 'index.php?act=store_grade&op=store_grade');
     } else {
         showMessage($lang['nc_common_del_fail'], 'index.php?act=store_grade&op=store_grade');
     }
 }
开发者ID:noikiy,项目名称:ejia,代码行数:31,代码来源:store_grade.php

示例8: rec_edit_saveOp


//.........这里部分代码省略.........
         } else {
             showMessage(Language::get('param_error'));
         }
     } elseif ($_POST['rec_type'] == 2 && $_POST['pic_type'] == 1) {
         //本地图片上传
         if (is_array($_FILES['pic']['tmp_name'])) {
             foreach ($_FILES['pic']['tmp_name'] as $k => $v) {
                 //未上传新图的,还用老图
                 if (empty($v) && !empty($_POST['opic'][$k])) {
                     $array['body'][$k]['title'] = str_ireplace(UPLOAD_SITE_URL . '/', '', $_POST['opic'][$k]);
                     $array['body'][$k]['url'] = preg_match($pattern, $_POST['urlup'][$k]) ? $_POST['urlup'][$k] : '';
                 }
                 $ext = strtolower(pathinfo($_FILES['pic']['name'][$k], PATHINFO_EXTENSION));
                 if (in_array($ext, array('jpg', 'jpeg', 'gif', 'png', 'bmp'))) {
                     $filename = substr(md5(microtime(true)), 0, 16) . rand(100, 999) . $k . '.' . $ext;
                     if ($_FILES['pic']['size'][$k] < 1024 * 1024) {
                         move_uploaded_file($v, BASE_UPLOAD_PATH . '/' . ATTACH_REC_POSITION . '/' . $filename);
                     }
                     if ($_FILES['pic']['error'][$k] != 0) {
                         showMessage(Language::get('nc_common_save_fail'));
                     }
                     //删除老图
                     $old_file = str_ireplace(array(UPLOAD_SITE_URL, '..'), array(BASE_UPLOAD_PATH, ''), $_POST['opic'][$k]);
                     if (is_file($old_file)) {
                         @unlink($old_file);
                     }
                     $array['body'][$k]['title'] = ATTACH_REC_POSITION . '/' . $filename;
                     $array['body'][$k]['url'] = preg_match($pattern, $_POST['urlup'][$k]) ? $_POST['urlup'][$k] : '';
                     $data['pic_type'] = 1;
                 }
             }
             //最后删除数据库里有但没有POST过来的图片
             $model = Model('rec_position');
             $oinfo = $model->where(array('rec_id' => $_POST['rec_id']))->find();
             $oinfo = unserialize($oinfo['content']);
             foreach ($oinfo['body'] as $k => $v) {
                 if (!in_array(UPLOAD_SITE_URL . '/' . $v['title'], (array) $_POST['opic'])) {
                     if (is_file(BASE_UPLOAD_PATH . '/' . $v['title'])) {
                         @unlink(BASE_UPLOAD_PATH . '/' . $v['title']);
                     }
                 }
             }
             unset($oinfo);
         }
         //如果是上传图片,则取原图片地址
         if (empty($array)) {
             if (is_array($_POST['opic'])) {
                 foreach ($_POST['opic'] as $k => $v) {
                     $array['body'][$k]['title'] = $v;
                     $array['body'][$k]['url'] = preg_match($pattern, $_POST['urlup'][$k]) ? $_POST['urlup'][$k] : '';
                 }
             }
         }
     } elseif ($_POST['rec_type'] == 2 && $_POST['pic_type'] == 2) {
         //远程图片
         if (is_array($_POST['pic'])) {
             foreach ($_POST['pic'] as $k => $v) {
                 if (!preg_match("/^(http\\:\\/\\/)/i", $v)) {
                     continue;
                 }
                 $ext = strtolower(pathinfo($v, PATHINFO_EXTENSION));
                 if (in_array($ext, array('jpg', 'jpeg', 'gif', 'png', 'bmp'))) {
                     $c = count($array['body']);
                     $array['body'][$c]['title'] = $v;
                     $array['body'][$c]['url'] = preg_match($pattern, $_POST['urlremote'][$k]) ? $_POST['urlremote'][$k] : '';
                     $data['pic_type'] = 2;
                 }
             }
         }
     } else {
         showMessage(Language::get('param_error'));
     }
     if ($_POST['rec_type'] != 1) {
         $array['width'] = is_numeric($_POST['rwidth']) ? $_POST['rwidth'] : '';
         $array['height'] = is_numeric($_POST['rheight']) ? $_POST['rheight'] : '';
     }
     $array['target'] = intval($_POST['rtarget']);
     $data['title'] = $_POST['rtitle'];
     $data['content'] = serialize($array);
     $model = Model('rec_position');
     //如果是把本地上传类型改为文字或远程,则先取出原来上传的图片路径,待update成功后,再删除这些图片
     if ($_POST['opic_type'] == 1 && ($_POST['pic_type'] == 2 || $_POST['rec_type'] == 1)) {
         $oinfo = $model->where(array('rec_id' => $_POST['rec_id']))->find();
         $oinfo = unserialize($oinfo['content']);
     }
     $result = $model->where(array('rec_id' => $_POST['rec_id']))->update($data);
     if ($result) {
         if ($oinfo) {
             foreach ($oinfo['body'] as $v) {
                 if (is_file(BASE_UPLOAD_PATH . '/' . $v['title'])) {
                     @unlink(BASE_UPLOAD_PATH . '/' . $v['title']);
                 }
             }
         }
         dkcache("rec_position/{$_POST['rec_id']}");
         showMessage(Language::get('nc_common_save_succ'), 'index.php?act=rec_position&op=rec_list');
     } else {
         showMessage(Language::get('nc_common_save_fail'), 'index.php?act=rec_position&op=rec_list');
     }
 }
开发者ID:dotku,项目名称:shopnc_cnnewyork,代码行数:101,代码来源:rec_position.php

示例9: dropCachedOwnShopIds

 /**
  * 删除缓存自营店铺的ID
  */
 public function dropCachedOwnShopIds()
 {
     $this->ownShopIds = null;
     dkcache('own_shop_ids');
 }
开发者ID:dotku,项目名称:shopnc_cnnewyork,代码行数:8,代码来源:store.model.php

示例10: slider_clearOp

 /**
  * 幻灯片清空
  */
 public function slider_clearOp()
 {
     $model_setting = Model('setting');
     $update = array();
     $update['live_pic1'] = '';
     $update['live_link1'] = '';
     $update['live_pic2'] = '';
     $update['live_link2'] = '';
     $update['live_pic3'] = '';
     $update['live_link3'] = '';
     $update['live_pic4'] = '';
     $update['live_link4'] = '';
     $res = $model_setting->updateSetting($update);
     if ($res) {
         dkcache('setting');
         $this->log('清空抢购幻灯片设置', 1);
         echo json_encode(array('result' => 'true'));
     } else {
         echo json_encode(array('result' => 'false'));
     }
     exit;
 }
开发者ID:noikiy,项目名称:shopnc-minion,代码行数:25,代码来源:groupbuy.php

示例11: dropCache

 /**
  * 删除缓存数据
  */
 public function dropCache()
 {
     $this->cachedData = null;
     dkcache('area');
 }
开发者ID:1290800466,项目名称:mac_win,代码行数:8,代码来源:area.model.php

示例12: dropTablePkArrayCache

 /**
  * 删除表主键缓存
  */
 public static function dropTablePkArrayCache()
 {
     dkcache('field/_pk');
 }
开发者ID:ff00x0,项目名称:shopnc,代码行数:7,代码来源:model.php

示例13: rec_edit_saveOp


//.........这里部分代码省略.........
             if (in_array($ext, array('jpg', 'jpeg', 'gif', 'png'))) {
                 $filename = substr(md5(microtime(true)), 0, 16) . rand(100, 999) . '.' . $ext;
                 if ($_FILES['article_pic']['size'] < 1024 * 1024) {
                     move_uploaded_file($_FILES['article_pic']['tmp_name'], BASE_UPLOAD_PATH . '/' . ATTACH_REC_POSITION . '/' . $filename);
                 }
                 if ($_FILES['article_pic']['error'] != 0) {
                     showMessage(Language::get('nc_common_op_fail'));
                 }
             }
         }
         $array['body']['targetid'] = $_REQUEST['article_id'];
         $array['body']['contenttype'] = 'sms_article';
         $array['body']['imageurl'] = $filename;
         $array['body']['requesturl'] = '/cms/index.php?act=article&op=article_detail&article_id=' . $_REQUEST['article_id'];
         //$array['width']				= is_numeric($_POST['rwidth']) ? $_POST['rwidth'] : '';
         //$array['height']			= is_numeric($_POST['rheight']) ? $_POST['rheight'] : '';
         $array['body']['cat_id'] = $_REQUEST['article_class'];
         //}
         //if (empty($array)) showMessage(Language::get('param_error'));
         $data['content'] = serialize($array);
     } else {
         if ($_POST['rec_type'] == 2 && $_POST['pic_type'] == 3) {
             //showMessage(Language::get('param_error'));
         } else {
             if ($_POST['rec_type'] == 2 && $_POST['pic_type'] == 4) {
                 //平台活动
                 if (empty($_FILES['actiity_pic']['name'])) {
                     $filename = $_REQUEST['default_img'];
                 } else {
                     $ext = strtolower(pathinfo($_FILES['actiity_pic']['name'], PATHINFO_EXTENSION));
                     if (in_array($ext, array('jpg', 'jpeg', 'gif', 'png'))) {
                         $filename = substr(md5(microtime(true)), 0, 16) . rand(100, 999) . '.' . $ext;
                         if ($_FILES['actiity_pic']['size'] < 1024 * 1024) {
                             move_uploaded_file($_FILES['actiity_pic']['tmp_name'], BASE_UPLOAD_PATH . '/' . ATTACH_REC_POSITION . '/' . $filename);
                         }
                         if ($_FILES['actiity_pic']['error'] != 0) {
                             showMessage(Language::get('nc_common_op_fail'));
                         }
                     }
                 }
                 if ($_REQUEST['activity_type'] == 'pf_goods') {
                     $activity = Model('activity');
                     //$act_condition['field']='item_id';
                     $act_condition['opening'] = true;
                     $act_condition['activity_id'] = $_POST['activity_id'];
                     $act_list = $activity->getJoinList($act_condition);
                     $array1 = array();
                     foreach ($act_list as $key => $value) {
                         $array1[] = $value['item_id'];
                     }
                     $string = implode(',', $array1);
                     $array['body']['imageurl'] = $filename;
                     $array['body']['contenttype'] = 'pf_goods';
                     $array['body']['targetid'] = $_REQUEST['activity_id'];
                     $array['body']['goodsid'] = $string;
                     $array['body']['requesturl'] = PG_R_PATH;
                 } else {
                     $array['body']['title'] = $_REQUEST['ad_title'];
                     //$array['body']['imageurl'] 	= ATTACH_REC_POSITION.'/'.$_SESSION['store_id'].'/'.$filename;
                     $array['body']['imageurl'] = $filename;
                     $array['body']['requesturl'] = '/mobile/index.php?act=activity&op=sa_datail&activity_id=' . $_REQUEST['activity_id'];
                     $array['body']['targetid'] = $_REQUEST['activity_id'];
                     $array['body']['contenttype'] = $_REQUEST['activity_type'];
                 }
                 $data['content'] = serialize($array);
             }
         }
     }
     $data['pic_type'] = $_POST['rec_type'];
     $data['pic_width'] = $_POST['rwidth'];
     $data['pic_height'] = $_POST['rheight'];
     $data['rec_app'] = $_POST['rec_app'];
     $data['rec_state'] = $_POST['rec_state'];
     $data['rec_start_time'] = strtotime($_POST['stime']);
     $data['rec_stop_time'] = strtotime($_POST['etime']);
     $data['rec_position'] = $_POST['rec_position'];
     $data['rec_content_type'] = $_POST['pic_type'];
     $array['target'] = intval($_POST['rtarget']);
     $data['title'] = $_POST['rtitle'];
     $model = Model('rec_position');
     //如果是把本地上传类型改为文字或远程,则先取出原来上传的图片路径,待update成功后,再删除这些图片
     if ($_POST['opic_type'] == 1 && ($_POST['pic_type'] == 2 || $_POST['rec_type'] == 1)) {
         $oinfo = $model->where(array('rec_id' => $_POST['rec_id']))->find();
         $oinfo = unserialize($oinfo['content']);
     }
     $result = $model->where(array('rec_id' => $_POST['rec_id']))->update($data);
     if ($result) {
         if ($oinfo) {
             foreach ($oinfo['body'] as $v) {
                 if (is_file(BASE_UPLOAD_PATH . '/' . $v['title'])) {
                     @unlink(BASE_UPLOAD_PATH . '/' . $v['title']);
                 }
             }
         }
         dkcache("rec_position/{$_POST['rec_id']}");
         showMessage(Language::get('nc_common_save_succ'), 'index.php?act=rec_position&op=rec_list');
     } else {
         showMessage(Language::get('nc_common_save_fail'), 'index.php?act=rec_position&op=rec_list');
     }
 }
开发者ID:lehman3087,项目名称:wanhaoshop,代码行数:101,代码来源:rec_position.php

示例14: ajaxOp

 /**
  * ajax操作
  */
 public function ajaxOp()
 {
     switch ($_GET['branch']) {
         /**
          * 页面导航 排序
          */
         case 'nav_sort':
             $model_navigation = Model('navigation');
             $update_array = array();
             $update_array['nav_id'] = intval($_GET['id']);
             $update_array[$_GET['column']] = trim($_GET['value']);
             $result = $model_navigation->update($update_array);
             dkcache('nav');
             echo 'true';
             exit;
             break;
     }
 }
开发者ID:noikiy,项目名称:ejia,代码行数:21,代码来源:navigation.php

示例15: dropApCacheByAdvIds

 /**
  * 删除缓存
  */
 public function dropApCacheByAdvIds($advIds)
 {
     $apIds = array_keys((array) Model()->table('adv')->field('ap_id')->where(array('adv_id' => array('in', (array) $advIds)))->key('ap_id')->select());
     foreach ($apIds as $apId) {
         $apId = (int) $apId;
         dkcache("adv/{$apId}");
     }
 }
开发者ID:noikiy,项目名称:shopnc-minion,代码行数:11,代码来源:adv.model.php


注:本文中的dkcache函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。