コード例 #1
0
ファイル: TestAssets.php プロジェクト: alle/assets-merger
 public function test_needs_recompile()
 {
     $file = $this->data_dir() . 'js' . DIRECTORY_SEPARATOR . 'test.js';
     $mtime = filemtime($file);
     $this->assertTrue(Assets::is_modified_later($file, $mtime + 100));
     $this->assertFalse(Assets::is_modified_later($file, $mtime - 100));
 }
コード例 #2
0
ファイル: Assets.php プロジェクト: alle/assets-merger
 /**
  * Determine if file was modified later then source or it has changed
  *
  * @param string $file
  * @param string $source_modified_time
  * @param string $source_file
  *
  * @return bool
  */
 public static function has_changed($file, $source_modified_time, $source_file)
 {
     return Assets::is_modified_later($file, $source_modified_time) or md5_file($file) != md5_file($source_file);
 }
コード例 #3
0
ファイル: Collection.php プロジェクト: alle/assets-merger
 /**
  * Determine if recompilation is needed
  *
  * @return bool
  */
 public function needs_recompile()
 {
     return Assets::is_modified_later($this->destination_file(), $this->last_modified());
 }
コード例 #4
0
ファイル: Asset.php プロジェクト: boomcms/asset-merger
 /**
  * Determine if recompilation is needed
  *
  * @return bool
  */
 public function needs_recompile()
 {
     // Always compile less files in development environment since an included file may have been changed.
     return Assets::is_modified_later($this->destination_file(), $this->last_modified()) or in_array('less', $this->_engines) and Kohana::$environment == Kohana::DEVELOPMENT;
 }