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


PHP f::modified方法代码示例

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


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

示例1: sync

 /**
  * Resets store if necessary to stay in sync with content file
  */
 public function sync()
 {
     $file = $this->structure->model()->textfile();
     $ageModel = f::exists($file) ? f::modified($file) : 0;
     $ageStore = s::get($this->id() . '_age');
     if ($ageStore < $ageModel) {
         $this->reset();
         $this->age = $ageModel;
     } else {
         $this->age = $ageStore;
     }
 }
开发者ID:nsteiner,项目名称:kdoc,代码行数:15,代码来源:store.php

示例2: testModified

 public function testModified()
 {
     $site = $this->siteInstance();
     $page = new Page($site, '1-a');
     $modified = f::modified($page->root());
     $this->assertEquals($modified, $page->modified());
     $this->assertEquals(date('Y-m-d', $modified), $page->modified('Y-m-d'));
     // switch the date handler
     $kirby = $this->kirbyInstance(array('date.handler' => 'strftime'));
     $site = $this->siteInstance($kirby);
     $page = new Page($site, '1-a');
     $this->assertEquals($modified, $page->modified());
     $this->assertEquals(strftime('%Y-%m-%d', $modified), $page->modified('%Y-%m-%d'));
 }
开发者ID:LucasFyl,项目名称:korakia,代码行数:14,代码来源:PageTest.php

示例3: testModified

 public function testModified()
 {
     $page = $this->siteInstance()->page('tests/file-extension-case-test');
     $file = $page->file('a.json');
     $modified = f::modified($file->root());
     $this->assertEquals($modified, $file->modified());
     $this->assertEquals(date('Y-m-d', $modified), $file->modified('Y-m-d'));
     // switch the date handler
     $kirby = $this->kirbyInstance(array('date.handler' => 'strftime'));
     $site = $this->siteInstance($kirby);
     $page = $site->page('tests/file-extension-case-test');
     $file = $page->file('a.json');
     $this->assertEquals($modified, $file->modified());
     $this->assertEquals(strftime('%Y-%m-%d', $modified), $file->modified('%Y-%m-%d'));
 }
开发者ID:LucasFyl,项目名称:korakia,代码行数:15,代码来源:FileTest.php

示例4: modified

 /**
  * Get the file's last modification time.
  *
  * @return int
  */
 public function modified($format = null, $handler = 'date')
 {
     return f::modified($this->root, $format, $handler);
 }
开发者ID:kgchoy,项目名称:main-portfolio-website,代码行数:9,代码来源:media.php

示例5: modified

 /**
  * Returns the timestamp when the page
  * has been modified
  *
  * @return int
  */
 public function modified($format = null, $handler = null)
 {
     return f::modified($this->root, $format, $handler ? $handler : $this->kirby->options['date.handler']);
 }
开发者ID:LucasFyl,项目名称:korakia,代码行数:10,代码来源:page.php

示例6: download

 public static function download($file, $name = null)
 {
     // stop the download if the file does not exist or is not readable
     if (!is_file($file) or !is_readable($file)) {
         return false;
     }
     header::download(array('name' => $name ? $name : f::filename($file), 'size' => f::size($file), 'mime' => f::mime($file), 'modified' => f::modified($file)));
     die(f::read($file));
 }
开发者ID:chrishiam,项目名称:LVSL,代码行数:9,代码来源:f.php

示例7: modified

 /**
  * Returns the timestamp when the page
  * has been modified
  *
  * @return int
  */
 public function modified($format = null)
 {
     return f::modified($this->root, $format);
 }
开发者ID:williampan,项目名称:w,代码行数:10,代码来源:page.php

示例8: isThere

 /**
  * Checks if the thumbnail already exists
  * and is newer than the original file
  *
  * @return boolean
  */
 public function isThere()
 {
     if ($this->options['overwrite'] === true) {
         return false;
     }
     // if the thumb already exists and the source hasn't been updated
     // we don't need to generate a new thumbnail
     if (file_exists($this->destination->root) and f::modified($this->destination->root) >= $this->source->modified()) {
         return true;
     }
     return false;
 }
开发者ID:aoimedia,项目名称:kosmonautensofa,代码行数:18,代码来源:thumb.php

示例9: kirby

$jsHandler = kirby()->option('js.handler');
$kirby->options['css.handler'] = function ($url, $media = false) use($cssHandler, $kirby) {
    if (is_array($url)) {
        $css = array();
        foreach ($url as $u) {
            $css[] = call($kirby->options['css.handler'], $u);
        }
        return implode(PHP_EOL, $css) . PHP_EOL;
    }
    $file = $kirby->roots()->index() . DS . $url;
    if (file_exists($file)) {
        $mod = f::modified($file);
        $url = dirname($url) . '/' . f::name($url) . '.' . $mod . '.css';
    }
    return call($cssHandler, array($url, $media));
};
$kirby->options['js.handler'] = function ($src, $async = false) use($jsHandler, $kirby) {
    if (is_array($src)) {
        $js = array();
        foreach ($src as $s) {
            $js[] = call($kirby->options['js.handler'], $s);
        }
        return implode(PHP_EOL, $js) . PHP_EOL;
    }
    $file = $kirby->roots()->index() . DS . $src;
    if (file_exists($file)) {
        $mod = f::modified($file);
        $src = dirname($src) . '/' . f::name($src) . '.' . $mod . '.js';
    }
    return call($jsHandler, array($src, $async));
};
开发者ID:achoukah,项目名称:151201-anwarchoukah,代码行数:31,代码来源:cachebuster.php

示例10: testModified

 public function testModified()
 {
     $this->assertEquals(filemtime($this->contentFile), f::modified($this->contentFile));
 }
开发者ID:aoimedia,项目名称:kosmonautensofa,代码行数:4,代码来源:FTest.php

示例11: fileExist

 public function fileExist()
 {
     if ($this->data[self::ARRAY_ATTR][self::PARA_OVERWRITE] === true) {
         return false;
     }
     if (file_exists($this->data[self::ARRAY_ATTR][self::PARA_IMG_OUTPUT_ROOT]) && \f::modified($this->data[self::ARRAY_ATTR][self::PARA_IMG_OUTPUT_ROOT]) >= $this->data[self::ARRAY_ATTR][self::PARA_IMG_SOURCE_MODIFIED]) {
         return true;
     }
     return false;
 }
开发者ID:muten84,项目名称:luigibifulco.it,代码行数:10,代码来源:kirbycms-extension-image-lib-block-image.php


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