本文整理汇总了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();
}
示例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']);
}
示例3: testModified
public function testModified()
{
$this->assertTrue(is_int(dir::modified(TEST_ROOT)));
}