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


PHP dir::modified方法代碼示例

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


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

示例1: __construct

 function __construct()
 {
     // auto-detect the url if it is not set
     if (!c::get('url')) {
         c::set('url', c::get('scheme') . server::get('http_host'));
     }
     // check if the cache is enabled at all
     $this->cacheEnabled = c::get('cache') && (c::get('cache.html') || c::get('cache.data')) ? true : false;
     if ($this->cacheEnabled) {
         $this->dataCacheEnabled = c::get('cache.data');
         $this->htmlCacheEnabled = c::get('cache.html');
         if (c::get('cache.autoupdate')) {
             $this->modified = dir::modified(c::get('root.content'));
         } else {
             $this->modified = 0;
         }
     }
     $cacheID = 'site.php';
     $cacheModified = time();
     $cacheData = null;
     // data cache
     if ($this->dataCacheEnabled) {
         // find the latest modifed date from all content subdirs
         // if the cache is enabled and autoupdate is activated.
         // otherwise the last modified date will be false so the cache
         // will stay valid forever
         // check when the data cache has been modified
         $cacheModified = cache::modified($cacheID);
         // check if the cache is still valid
         if ($cacheModified >= $this->modified) {
             $cacheData = cache::get($cacheID);
         }
     }
     if (empty($cacheData)) {
         // get the first set of pages
         $this->rootPages();
         // get the additional site info from content/site.txt
         $this->siteInfo();
         if ($this->dataCacheEnabled) {
             cache::set($cacheID, $this->_);
         }
     } else {
         $this->_ = $cacheData;
     }
     // attach the uri after caching
     // this will definitely be variable :)
     $this->uri = new uri();
 }
開發者ID:robeam,項目名稱:kirbycms,代碼行數:48,代碼來源:site.php

示例2: modified

 /**
  * Gets the last modification date of all pages
  * in the content folder. 
  * 
  * @param mixed $format 
  * @param mixed $handler
  * @return mixed
  */
 public function modified($format = null, $handler = null)
 {
     return dir::modified($this->root, $format, $handler ? $handler : $this->kirby->options['date.handler']);
 }
開發者ID:kgchoy,項目名稱:main-portfolio-website,代碼行數:12,代碼來源:site.php

示例3: testModified

 public function testModified()
 {
     $this->assertTrue(is_int(dir::modified(TEST_ROOT)));
 }
開發者ID:LucasFyl,項目名稱:korakia,代碼行數:4,代碼來源:DirTest.php


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