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


PHP CacheUtil::save方法代码示例

本文整理汇总了PHP中CacheUtil::save方法的典型用法代码示例。如果您正苦于以下问题:PHP CacheUtil::save方法的具体用法?PHP CacheUtil::save怎么用?PHP CacheUtil::save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CacheUtil的用法示例。


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

示例1: updateTableIds

 public static function updateTableIds($tableDriver)
 {
     $tableIds = $tableDriver["mainTable"]::model()->fetchTableIds();
     Setting::model()->updateSettingValueByKey($tableDriver["tableId"], $tableIds);
     CacheUtil::save($tableDriver["tableId"], $tableIds);
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:6,代码来源:ArchiveSplitUtil.php

示例2: actionIndex

 public function actionIndex()
 {
     $mod = EnvUtil::getRequest("mod");
     $modList = array("email", "diary");
     if (!in_array($mod, $modList)) {
         foreach ($modList as $module) {
             if (ModuleUtil::getIsEnabled($module)) {
                 $mod = $module;
                 break;
             }
         }
     }
     if (!ModuleUtil::getIsEnabled($mod)) {
         $this->error(Ibos::lang("Module not installed"));
     }
     $operation = EnvUtil::getRequest("op");
     if (!in_array($operation, array("manage", "move", "movechoose", "droptable", "addtable"))) {
         $operation = "manage";
     }
     $data = array();
     if ($mod == "email") {
         $tableDriver = array("tableId" => "emailtableids", "tableInfo" => "emailtable_info", "mainTable" => "Email", "bodyTable" => "EmailBody", "bodyIdField" => "bodyid");
     } else {
         $tableDriver = array("tableId" => "diarytableids", "tableInfo" => "diarytable_info", "mainTable" => "Diary", "bodyTable" => "DiaryRecord", "bodyIdField" => "diaryid");
     }
     $setting = Setting::model()->fetchSettingValueByKeys($tableDriver["tableId"] . "," . $tableDriver["tableInfo"], true);
     $tableIds = $setting[$tableDriver["tableId"]] ? $setting[$tableDriver["tableId"]] : array();
     $tableInfo = $setting[$tableDriver["tableInfo"]] ? $setting[$tableDriver["tableInfo"]] : array();
     $formSubmit = EnvUtil::submitCheck("archiveSubmit");
     if ($formSubmit) {
         if ($operation == "manage") {
             $info = array();
             $_POST["memo"] = !empty($_POST["memo"]) ? $_POST["memo"] : array();
             $_POST["displayname"] = !empty($_POST["displayname"]) ? $_POST["displayname"] : array();
             foreach (array_keys($_POST["memo"]) as $tableId) {
                 $info[$tableId]["memo"] = $_POST["memo"][$tableId];
             }
             foreach (array_keys($_POST["displayname"]) as $tableId) {
                 $info[$tableId]["displayname"] = $_POST["displayname"][$tableId];
             }
             Setting::model()->updateSettingValueByKey($tableDriver["tableInfo"], $info);
             CacheUtil::save($tableDriver["tableInfo"], $info);
             ArchiveSplitUtil::updateTableIds($tableDriver);
             CacheUtil::update(array("setting"));
             $this->success(Ibos::lang("Archivessplit manage update succeed"), $this->createUrl("split/index", array("op" => "manage", "mod" => $mod)));
         } elseif ($operation == "movechoose") {
             $conditions = array("sourcetableid" => EnvUtil::getRequest("sourcetableid"), "timerange" => intval(EnvUtil::getRequest("timerange")));
             $showDetail = intval($_POST["detail"]);
             $count = ArchiveSplitUtil::search($conditions, $tableDriver, true);
             $data["count"] = $count;
             $data["sourceTableId"] = $conditions["sourcetableid"];
             $data["tableInfo"] = $tableInfo;
             if ($showDetail) {
                 $list = ArchiveSplitUtil::search($conditions, $tableDriver);
                 !empty($list) && ($data["list"] = $list);
                 $data["detail"] = 1;
             } else {
                 $data["readyToMove"] = $count;
                 $data["detail"] = 0;
             }
             $data["conditions"] = serialize($conditions);
             $data = array_merge($data, ArchiveSplitUtil::getTableStatus($tableIds, $tableDriver));
             $this->render($mod . "MoveChoose", $data);
         } elseif ($operation == "moving") {
             $tableId = intval(EnvUtil::getRequest("tableid"));
             $step = intval(EnvUtil::getRequest("step"));
             $sourceTableId = intval(EnvUtil::getRequest("sourcetableid"));
             $detail = intval(EnvUtil::getRequest("detail"));
             if (!$tableId) {
                 $this->error(Ibos::lang("Archivessplit no target table"));
             }
             $continue = false;
             $readyToMove = intval(EnvUtil::getRequest("readytomve"));
             $bodyIdArr = !empty($_POST["bodyidarray"]) ? $_POST["bodyidarray"] : array();
             if (empty($bodyIdArr) && !$detail && !empty($_POST["conditions"])) {
                 $conditions = unserialize($_POST["conditions"]);
                 $maxMove = intval($_POST["pertime"]) ? intval($_POST["pertime"]) : self::DEFAULT_ARCHIVE_MOVE;
                 $list = ArchiveSplitUtil::search($conditions, $tableDriver, false, $maxMove);
                 $bodyIdArr = ConvertUtil::getSubByKey($list, $tableDriver["bodyIdField"]);
             } else {
                 $readyToMove = count($bodyIdArr);
             }
             if (!empty($bodyIdArr)) {
                 $continue = true;
             }
             if ($tableId == $sourceTableId) {
                 $this->error(Ibos::lang("Archivessplit source cannot be the target"), $this->createUrl("split/index", array("op" => "move", "mod" => $mod)));
             }
             if ($continue) {
                 $cronArchiveSetting = Setting::model()->fetchSettingValueByKeys("cronarchive", true);
                 $tableTarget = intval($tableId);
                 $tableSource = $_POST["sourcetableid"] ? $_POST["sourcetableid"] : 0;
                 $tableDriver["mainTable"]::model()->moveByBodyId($bodyIdArr, $tableSource, $tableTarget);
                 $tableDriver["bodyTable"]::model()->moveByBodyid($bodyIdArr, $tableSource, $tableTarget);
                 if (!$step) {
                     if ($_POST["setcron"] == "1") {
                         $cronArchiveSetting[$mod] = array("sourcetableid" => $tableSource, "targettableid" => $tableTarget, "conditions" => unserialize($_POST["conditions"]));
                     } else {
                         unset($cronArchiveSetting[$mod]);
                     }
//.........这里部分代码省略.........
开发者ID:AxelPanda,项目名称:ibos,代码行数:101,代码来源:SplitController.php


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