當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CacheUtil::load方法代碼示例

本文整理匯總了PHP中CacheUtil::load方法的典型用法代碼示例。如果您正苦於以下問題:PHP CacheUtil::load方法的具體用法?PHP CacheUtil::load怎麽用?PHP CacheUtil::load使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CacheUtil的用法示例。


在下文中一共展示了CacheUtil::load方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: ipBanned

 public static function ipBanned($onlineip)
 {
     CacheUtil::load("ipbanned");
     $ipBanned = Ibos::app()->setting->get("cache/ipbanned");
     if (empty($ipBanned)) {
         return false;
     } else {
         if ($ipBanned["expiration"] < TIMESTAMP) {
             CacheUtil::update("ipbanned");
             CacheUtil::load("ipbanned", true);
             $ipBanned = Ibos::app()->setting->get("cache/ipbanned");
         }
         return preg_match("/^(" . $ipBanned["regexp"] . ")\$/", $onlineip);
     }
     return preg_match("/^(" . $ipBanned["regexp"] . ")\$/", $onlineip);
 }
開發者ID:AxelPanda,項目名稱:ibos,代碼行數:16,代碼來源:EnvUtil.php

示例2: createStaticJs

 private static function createStaticJs()
 {
     CacheUtil::load(array("department", "position"), true);
     $unit = Ibos::app()->setting->get("setting/unit");
     $department = DepartmentUtil::loadDepartment();
     $users = UserUtil::loadUser();
     $position = PositionUtil::loadPosition();
     $positionCategory = PositionUtil::loadPositionCategory();
     $companyData = self::initCompany($unit);
     $deptData = self::initDept($department);
     $userData = self::initUser($users);
     $posData = self::initPosition($position);
     $posCatData = self::initPositionCategory($positionCategory);
     $default = file_get_contents(PATH_ROOT . "/static/js/src/org.default.js");
     if ($default) {
         $patterns = array("/\\{\\{(company)\\}\\}/", "/\\{\\{(department)\\}\\}/", "/\\{\\{(position)\\}\\}/", "/\\{\\{(users)\\}\\}/", "/\\{\\{(positioncategory)\\}\\}/");
         $replacements = array($companyData, $deptData, $posData, $userData, $posCatData);
         $new = preg_replace($patterns, $replacements, $default);
         FileUtil::createFile("data/org.js", $new);
         CacheUtil::update("setting");
     }
 }
開發者ID:AxelPanda,項目名稱:ibos,代碼行數:22,代碼來源:OrgUtil.php

示例3: array

        $replace = array(time(), strtotime('-1 hour'), strtotime('+1 hour'), strtotime(date('Y-m-d')), strtotime('-1 day', strtotime(date('Y-m-d'))));
        $sql = str_replace($search, $replace, $sqlData);
        executeSql($sql);
        unset($_SESSION['extData']);
    }
    // 安裝工作流數據
    if (getIsInstall('workflow')) {
        $sqlFlowData = file_get_contents(PATH_ROOT . './install/data/installFlow.sql');
        executeSql($sqlFlowData);
    }
    session_destroy();
    $cacheArr = array('AuthItem', 'CreditRule', 'Department', 'Ipbanned', 'Nav', 'NotifyNode', 'Position', 'PositionCategory', 'Setting', 'UserGroup');
    foreach ($cacheArr as $cache) {
        CacheUtil::update($cache);
    }
    CacheUtil::load('usergroup');
    // 要注意小寫
    CacheUtil::update('Users');
    // 因為用戶緩存要依賴usergroup緩存,所以放在最後單獨更新
    file_put_contents(PATH_ROOT . 'data/install.lock', '');
    $configfile = CONFIG_PATH . 'config.php';
    $config = (require $configfile);
    include 'extInfo.php';
    exit;
} elseif ($option == 'tablepreCheck') {
    $dbHost = $_POST['dbHost'];
    $dbAccount = $_POST['dbAccount'];
    $dbPassword = $_POST['dbPassword'];
    $dbName = $_POST['dbName'];
    $tablePre = $_POST['tablePre'];
    if (!function_exists('mysql_connect')) {
開發者ID:AxelPanda,項目名稱:ibos,代碼行數:31,代碼來源:index.php

示例4: afterDelete

 public function afterDelete()
 {
     CacheUtil::update("department");
     CacheUtil::load("department");
     parent::afterDelete();
 }
開發者ID:AxelPanda,項目名稱:ibos,代碼行數:6,代碼來源:Department.php

示例5: afterSave

 public function afterSave()
 {
     $pk = $this->getPrimaryKey();
     if ($pk) {
         $category = Yii::app()->setting->get("officialdoccategory");
         $attr = $this->getAttributes();
         $category[$pk] = $attr;
         Syscache::model()->modify("officialdoccategory", $category);
         CacheUtil::load("officialdoccategory", true);
     }
     parent::afterSave();
 }
開發者ID:AxelPanda,項目名稱:ibos,代碼行數:12,代碼來源:OfficialdocCategory.php

示例6: makeCache

 public function makeCache($users)
 {
     Syscache::model()->modify("users", $users);
     CacheUtil::load("users");
 }
開發者ID:AxelPanda,項目名稱:ibos,代碼行數:5,代碼來源:User.php

示例7: wrapUserInfo

 public static function wrapUserInfo($user)
 {
     $user["group_title"] = "";
     $user["next_group_credit"] = $user["upgrade_percent"] = 0;
     $currentGroup = !empty($user["groupid"]) ? UserGroup::model()->fetchByPk($user["groupid"]) : array();
     if (!empty($currentGroup)) {
         $user["group_title"] = $currentGroup["title"];
         if ($currentGroup["creditslower"] !== "0") {
             $user["upgrade_percent"] = round((double) $user["credits"] / $currentGroup["creditslower"] * 100, 2);
         }
         $user["next_group_credit"] = (int) $currentGroup["creditslower"];
     }
     $user["level"] = self::getUserLevel($user["groupid"]);
     CacheUtil::load(array("department", "position"));
     $position = PositionUtil::loadPosition();
     $department = DepartmentUtil::loadDepartment();
     if (0 < $user["deptid"]) {
         $relatedDeptId = DepartmentRelated::model()->fetchAllDeptIdByUid($user["uid"]);
         $deptIds = array_merge((array) $relatedDeptId, array($user["deptid"]));
         $user["alldeptid"] = implode(",", array_unique($deptIds));
         $user["allupdeptid"] = Department::model()->queryDept($user["alldeptid"]);
         $user["alldowndeptid"] = Department::model()->fetchChildIdByDeptids($user["alldeptid"]);
         $user["relatedDeptId"] = implode(",", $relatedDeptId);
         $user["deptname"] = isset($department[$user["deptid"]]) ? $department[$user["deptid"]]["deptname"] : "";
     } else {
         $user["alldeptid"] = $user["allupdeptid"] = $user["alldowndeptid"] = $user["relatedDeptId"] = $user["deptname"] = "";
     }
     if (0 < $user["positionid"]) {
         $relatedPosId = PositionRelated::model()->fetchAllPositionIdByUid($user["uid"]);
         $posIds = array_merge(array($user["positionid"]), (array) $relatedPosId);
         $user["allposid"] = implode(",", array_unique($posIds));
         $user["relatedPosId"] = implode(",", $relatedPosId);
         $user["posname"] = isset($position[$user["positionid"]]) ? $position[$user["positionid"]]["posname"] : "";
     } else {
         $user["allposid"] = $user["relatedPosId"] = $user["posname"] = "";
     }
     $user["space_url"] = "?r=user/home/index&uid=" . $user["uid"];
     $user["avatar_middle"] = "avatar.php?uid={$user["uid"]}&size=middle&engine=" . ENGINE;
     $user["avatar_small"] = "avatar.php?uid={$user["uid"]}&size=small&engine=" . ENGINE;
     $user["avatar_big"] = "avatar.php?uid={$user["uid"]}&size=big&engine=" . ENGINE;
     $user["bg_big"] = "bg.php?uid={$user["uid"]}&size=big&engine=" . ENGINE;
     $user["bg_small"] = "bg.php?uid={$user["uid"]}&size=small&engine=" . ENGINE;
     $profile = UserProfile::model()->fetchByUid($user["uid"]);
     $user = array_merge($user, (array) $profile);
     return $user;
 }
開發者ID:AxelPanda,項目名稱:ibos,代碼行數:46,代碼來源:UserUtil.php

示例8: getRule

 public function getRule($action)
 {
     if (empty($action)) {
         return false;
     }
     CacheUtil::load("creditrule");
     $caches = Ibos::app()->setting->get("cache/creditrule");
     $extcredits = $this->getExtCredits();
     $rule = false;
     if (is_array($caches[$action])) {
         $rule = $caches[$action];
         for ($i = 1; $i <= 5; $i++) {
             if (empty($extcredits[$i])) {
                 unset($rule["extcredits" . $i]);
                 continue;
             }
             $rule["extcredits" . $i] = intval($rule["extcredits" . $i]);
         }
     }
     return $rule;
 }
開發者ID:AxelPanda,項目名稱:ibos,代碼行數:21,代碼來源:CreditUtil.php

示例9: getCreditLog

 protected function getCreditLog()
 {
     CacheUtil::load(array("creditrule"));
     $creditRule = CreditRule::model()->fetchAllSortByPk("rid");
     $credits = Ibos::app()->setting->get("setting/extcredits");
     $relateRules = CreditRuleLog::model()->fetchAllByAttributes(array("uid" => $this->getUid()));
     $criteria = array("condition" => "`uid` = :uid", "params" => array(":uid" => $this->getUid()), "order" => "dateline DESC");
     $count = CreditLog::model()->count($criteria);
     $pages = PageUtil::create($count, 20);
     $criteria["limit"] = 20;
     $criteria["offset"] = $pages->getOffset();
     $creditLog = CreditLog::model()->fetchAll($criteria);
     return array("creditLog" => $creditLog, "relateRules" => $relateRules, "credits" => $credits, "creditRule" => $creditRule, "pages" => $pages);
 }
開發者ID:AxelPanda,項目名稱:ibos,代碼行數:14,代碼來源:HomeController.php


注:本文中的CacheUtil::load方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。