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


PHP Timer::mtime方法代码示例

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


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

示例1: concat

 /**
  * combine an array of files into one file
  *
  * @param array array An array of absolute file locations, which we want to combine into a single file
  *
  * @return object
  */
 public function concat($array)
 {
     //make sure we have work to do
     if (empty($array) or !is_array($array)) {
         return false;
     }
     //check our file is within the cache duration and none of the files have been updated
     if (self::cacheValid($this->file, $this->duration) and !self::filesUpdated($this->file, $array)) {
         //if our files havent been updated and our cache time is valid, swap the file path to a uri
         $this->file = self::pathToUri($this->file);
         //return self to skip the following steps
         return $this;
     }
     //create the new handle with our css file
     $handle = fopen($this->file, 'w');
     //loop the array of css files, adding them to the cache file
     foreach ($array as $concat_file) {
         //check if we have been passed in URLs which we cant use, so swap
         $concat_file = self::uriToPath($concat_file);
         if (!file_exists($concat_file)) {
             continue;
         }
         $content = " \n\n /* ====== " . self::pathToUri($concat_file) . " ====== " . Timer::mtime() . " */ \n\n " . file_get_contents($concat_file);
         fwrite($handle, $content);
     }
     //close the conntection
     fclose($handle);
     //return the location of the file we've been working on
     $this->file = self::pathToUri($this->file);
     return $this;
 }
开发者ID:prwhitehead,项目名称:meagr,代码行数:38,代码来源:cache.php

示例2: add

 /**
  * add our data to log
  *
  * @return string
  */
 function add($array)
 {
     $array['timestamp'] = date('H:i:s d/m');
     $array['memory'] = $this->memory();
     $array['interval'] = Timer::convert(round(Timer::mtime() - $this->microtime, $this->time_precision));
     $this->time = Timer::mtime();
     $this->log[] = $array;
 }
开发者ID:prwhitehead,项目名称:meagr,代码行数:13,代码来源:debug.php


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