コード例 #1
0
ファイル: FileCache.php プロジェクト: phaldan/asset-builder
 /**
  * @param $key
  */
 public function deleteEntry($key)
 {
     $filePath = $this->getFilePath($key);
     if ($this->fileSystem->exists($filePath)) {
         $this->fileSystem->deleteFile($filePath);
     }
 }
コード例 #2
0
 private function checkFileChanged($file, $lastModified)
 {
     if (isset($this->fileChanges[$file])) {
         return $this->fileChanges[$file];
     }
     $time = $this->fileSystem->getModifiedTime($file);
     $changed = !empty($time->diff($lastModified)->format('%r'));
     $this->fileChanges[$file] = $changed;
     return $changed;
 }
コード例 #3
0
 /**
  * @param $filePath
  * @return DateTime
  */
 protected function processLastModified($filePath)
 {
     return $this->fileSystem->getModifiedTime($filePath);
 }
コード例 #4
0
 private function hasChanged($file, DateTime $dateTime)
 {
     $lastModified = $this->fileSystem->getModifiedTime($file);
     return !empty($lastModified->diff($dateTime)->format('%r'));
 }
コード例 #5
0
 /**
  * Resolve pattern and returns file list
  * @param $pattern
  * @return array
  */
 protected function resolvePattern($pattern)
 {
     return $this->fileSystem->resolveGlob($pattern);
 }