コード例 #1
0
 /**
  * Gets whether a new generation of the optimized file is necessairy
  * @param zibo\library\filesystem\File $optimizedFile The file of the optimized source
  * @param array $files Array with File objects of the files to optimize
  * @return boolean True if a new generation is necessairy, false otherwise
  */
 private function isGenerateNecessairy(File $optimizedFile, array $files)
 {
     if (!$optimizedFile->exists()) {
         $parent = $optimizedFile->getParent();
         if (!$parent->exists()) {
             $parent->create();
         }
         return true;
     }
     $cacheTime = $optimizedFile->getModificationTime();
     foreach ($files as $file) {
         if ($file->getModificationTime() >= $cacheTime) {
             return true;
         }
     }
     return false;
 }