當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。