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


PHP FileCache::is_cached方法代码示例

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


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

示例1: __construct

 public function __construct($search_paths = array())
 {
     $this->paths = $search_paths;
     $this->modules = $this->getModules();
     if (FileCache::is_cached('modules_info', 180)) {
         // cache expire after 3 mins
         $this->modules_info = FileCache::fetch('modules_info', null, 180);
     } else {
         $this->modules_info = array();
         $this->getCNModulesInfo();
         FileCache::store('modules_info', $this->modules_info, 180);
     }
 }
开发者ID:Cyberspace-Networks,项目名称:CoreSystem,代码行数:13,代码来源:CNModulesInfo.php

示例2: unserialize

         $handler_function = 'handle' . $handler_name;
         // check has a module the appropriate method with this name to handle action
         // for example: if form action = "/cndynamic.php?page_id=7&action=AddGroupSubmit"
         //              name of this method will be: handleAddGroupSubmit
         if (method_exists($obj, $handler_function)) {
             $obj->{$handler_function}($app->request_method, $app->getRequestData());
         }
     }
 }
 global $use_theme;
 // Theme name defined in page XML config file
 try {
     $save_page = $app->getRequestParam('save');
     $new_page_settings = $app->getRequestParam('page_settings') ? unserialize(urldecode($app->getRequestParam('page_settings'))) : null;
     $cache_id = "dyn_page_{$req_page}";
     if (FileCache::is_cached($cache_id)) {
         $dynamic_page = FileCache::fetch($cache_id);
         $page_settings = $dynamic_page->buildPageSettings($new_page_settings);
     } else {
         $dynamic_page = new CNDynamicPage($req_page);
         $dynamic_page->initialize();
         $dynamic_page->save_page = $save_page;
         $page_settings = $dynamic_page->buildPageSettings($new_page_settings);
         FileCache::store($cache_id, $dynamic_page, 1200);
     }
     // Force login if we're on a private network, unless we're on login.php, register.php or cnuser_login_index.php
     $login_required = $page_settings['page_mode'] != 'public' ? true : false;
     if (!$login_required && PA::$network_info->is_private() && !$login_never_required) {
         $login_required = TRUE;
     }
     // Check user session / login status, and redirect to login page (or
开发者ID:Cyberspace-Networks,项目名称:CoreSystem,代码行数:31,代码来源:cndynamic.php

示例3: get_pages_default_setting

 /**
  * Generic Function to get record from page settings table
  * Function will take the field_name and value in the form of key => value pair
  */
 public static function get_pages_default_setting($page_type, $only_configurable = true, $from_XML = false)
 {
     global $app;
     Logger::log('Enter: function ModuleSetting::get_pages_default_setting');
     if (FileCache::is_cached($page_type . '_module_default_setting')) {
         $settings = FileCache::fetch($page_type . '_module_default_setting');
         return $settings;
     } else {
         $return = array();
         $results = $app->configObj->query("//*[@section='pages' and contains(@page_type, '{$page_type}')]");
         //echo "Results:<pre>" . print_r($results, 1). "</pre>"; die();
         //      $pages = array_flip(getConstantsByPrefix('PAGE_'));  // function defined in helper_functions.php
         //      foreach($pages as $key => $const_name) {
         foreach ($results as $const_name => $key) {
             if (is_numeric($key)) {
                 $page_settings = self::load_setting($key, PA::$network_info->network_id, $page_type, null, $only_configurable);
                 if ($page_settings) {
                     $cache_id = "dyn_page_{$key}";
                     if (FileCache::is_cached($cache_id)) {
                         $dynamic_page = FileCache::fetch($cache_id);
                     } else {
                         $dynamic_page = new DynamicPage($key);
                         FileCache::store($cache_id, $dynamic_page, 1200);
                     }
                     if (!is_object($dynamic_page) or !$dynamic_page->docLoaded) {
                         throw new Exception("Page XML config file for page ID: {$page_id} - not found!");
                     }
                     $dynamic_page->initialize();
                     if (!$from_XML) {
                         foreach ($page_settings as $section => $value) {
                             $dynamic_page->{$section} = $value;
                         }
                     }
                     // also return the api_id
                     $dynamic_page->api_id = strtolower(preg_replace("/^PAGE_/", '', $const_name));
                     $return[] = $dynamic_page;
                 }
             }
         }
         FileCache::store($page_type . '_module_default_setting', $return, 1200);
     }
     Logger::log('Exit: function ModuleSetting::get_pages_default_setting');
     return $return;
 }
开发者ID:Cyberspace-Networks,项目名称:PeopleAggregator,代码行数:48,代码来源:ModuleSetting.php


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