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


PHP Helpers::file_cache方法代码示例

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


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

示例1: create_hash

 function create_hash() {
   # .htaccess file
   $htaccess = file_exists('./.htaccess') ? '.htaccess:'.filemtime('./.htaccess') : '';
   # serialize the file cache
   $file_cache = serialize(Helpers::file_cache());
   # create an md5 of the two collections
   return md5($htaccess.$file_cache);
 }
开发者ID:nsfmc,项目名称:Stacey-HTML5-Boilerplate,代码行数:8,代码来源:cache.inc.php

示例2: collate_partials

 static function collate_partials($dir = './templates/partials') {
   foreach(Helpers::file_cache($dir) as $file) {
     if($file['is_folder']) {
       self::collate_partials($file['path']);
     } else {
       self::$partials[] = $file['path'];
     }
   }
 }
开发者ID:nsfmc,项目名称:Stacey-HTML5-Boilerplate,代码行数:9,代码来源:template-parser.inc.php

示例3: collate_partials

 static function collate_partials($dir = false)
 {
     if (!$dir) {
         $dir = Config::$templates_folder . '/partials';
     }
     foreach (Helpers::file_cache($dir) as $file) {
         if ($file['is_folder']) {
             self::collate_partials($file['path']);
         } else {
             self::$partials[] = $file['path'];
         }
     }
 }
开发者ID:andreaspada,项目名称:cindy,代码行数:13,代码来源:template-parser.inc.php

示例4: __construct

 function __construct($file_path, $template_file)
 {
     # generate an md5 hash from the file_path
     $this->path_hash = $this->generate_hash($file_path);
     # generate an md5 hash from the current state of the site content
     $htaccess = file_exists(Config::$root_folder . '.htaccess') ? '.htaccess:' . filemtime(Config::$root_folder . '.htaccess') : '';
     $file_cache = serialize(Helpers::file_cache());
     $content_hash = $this->generate_hash($htaccess . $file_cache);
     # combine the two hashes to create a cachefile name
     $this->cachefile = Config::$cache_folder . '/pages/' . $this->cache_prefix . $this->path_hash . '-' . $content_hash;
     # store the hash
     $this->hash = $this->cache_prefix . $this->path_hash . '-' . $content_hash;
 }
开发者ID:nnennajohn,项目名称:stacey,代码行数:13,代码来源:cache.inc.php

示例5: create_full_cache

 function create_full_cache($pages = null)
 {
     $search_fields = array('url', 'file_path', 'title', 'author', 'content');
     $store = array();
     if (!isset($pages)) {
         $pages = Helpers::file_cache('./content');
     }
     foreach ($pages as $page) {
         if ($page['is_folder']) {
             $current_page = AssetFactory::get($page['path']);
             # Skip for password protected pages
             if ($current_page['password_protect'] || $current_page['hide_from_search']) {
                 continue;
             }
             # Only save search field data
             foreach ($current_page as $key => $value) {
                 if (!in_array($key, $search_fields)) {
                     unset($current_page[$key]);
                 }
             }
             $store[] = $current_page;
             $children = self::create_full_cache(Helpers::file_cache($page['path']));
             if (is_array($children)) {
                 $store = array_merge($store, $children);
             }
         }
     }
     return $store;
 }
开发者ID:puleddu,项目名称:italocalvino.it,代码行数:29,代码来源:cache.inc.php

示例6: create_full_cache

 function create_full_cache($pages = null)
 {
     $search_fields = array('url', 'file_path', 'title', 'author', 'content', 'object_name', 'designer', 'builder', 'category', 'tags', 'contributors', 'realisation_place', 'required_hardware', 'license', 'client');
     $store = array();
     if (!isset($pages)) {
         $pages = Helpers::file_cache('./content');
     }
     foreach ($pages as $page) {
         if ($page['is_folder']) {
             $current_page = AssetFactory::get($page['path']);
             # Skip for password protected pages
             if (isset($current_page['password_protect']) || isset($current_page['hide_from_search'])) {
                 continue;
             }
             # Only save search field data
             foreach ($current_page as $key => $value) {
                 if (!in_array($key, $search_fields)) {
                     unset($current_page[$key]);
                 }
             }
             $store[] = $current_page;
             $children = self::create_full_cache(Helpers::file_cache($page['path']));
             if (is_array($children)) {
                 $store = array_merge($store, $children);
             }
         }
     }
     return $store;
 }
开发者ID:carlesgutierrez,项目名称:libreobjet.org,代码行数:29,代码来源:cache.inc.php


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