Changeset 787
- Timestamp:
- 08/09/07 11:56:27 (1 year ago)
- Files:
-
- trunk/lib/jsmin-1.1.0.php (moved) (moved from trunk/src/main/php/info/phing/tasks/jsmin-1.1.0.php)
- trunk/src/main/php/info/phing/tasks/stubJsMinTask.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/info/phing/tasks/stubJsMinTask.php
r773 r787 12 12 require_once 'phing/Task.php'; 13 13 /** 14 * Uses the jsmin PHP port15 */16 require_once dirname(__FILE__) . '/jsmin-1.1.0.php';17 /**18 14 * Task to minimy javascript files. 19 15 * … … 23 19 class stubJsMinTask extends Task 24 20 { 21 /** 22 * path to JSmin 23 * 24 * @var string 25 */ 26 protected $jsMinPath; 25 27 /** 26 28 * the source files … … 42 44 */ 43 45 protected $targetDir; 46 47 /** 48 * sets the path where JSmin can be found 49 * 50 * @param string $jsMinPath 51 */ 52 public function setJsMinPath($jsMinPath) 53 { 54 $this->jsMinPath = $jsMinPath; 55 } 44 56 45 57 /** … … 77 89 public function init() 78 90 { 79 // nothing to do here91 return true; 80 92 } 81 93 … … 85 97 public function main() 86 98 { 99 if (class_exists('JSMin', false) == false) { 100 require_once $this->jsMinPath; 101 } 102 87 103 $error = false; 88 104 foreach ($this->filesets as $fs) { … … 93 109 $this->log('Minifying file ' . $file); 94 110 try { 95 $target = $this->targetDir . '/' . str_replace($fullPath, '', $file);111 $target = $this->targetDir . '/' . str_replace($fullPath, '', str_replace('.js', '-min.js', $file)); 96 112 if (file_exists(dirname($target)) == false) { 97 113 mkdir(dirname($target), 0700, true);
