Ejemplo n.º 1
0
 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));
 }
Ejemplo n.º 2
0
 /**
  * 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);
 }
Ejemplo n.º 3
0
 /**
  * Determine if recompilation is needed
  *
  * @return bool
  */
 public function needs_recompile()
 {
     return Assets::is_modified_later($this->destination_file(), $this->last_modified());
 }
Ejemplo n.º 4
0
 /**
  * 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;
 }