Changeset 3730:5c45a5df9a59 for build-tools/min-js.php
- Timestamp:
- 03/08/18 17:58:39 (8 years ago)
- Branch:
- default
- File:
-
- 1 edited
-
build-tools/min-js.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
build-tools/min-js.php
r2566 r3730 14 14 try 15 15 { 16 $js = (!empty($_SERVER['argv'][1])) ? $_SERVER['argv'][1] : null;16 $js = (!empty($_SERVER['argv'][1])) ? $_SERVER['argv'][1] : null; 17 17 18 if (!$js || !is_file($js)) {19 throw new Exception(sprintf("File %s does not exist",$js));20 }18 if (!$js || !is_file($js)) { 19 throw new Exception(sprintf("File %s does not exist", $js)); 20 } 21 21 22 require dirname(__FILE__).'/jsmin-1.1.1.php';22 require dirname(__FILE__) . '/jsmin-1.1.1.php'; 23 23 24 $content = file_get_contents($js);25 $res= JSMin::minify($content);24 $content = file_get_contents($js); 25 $res = JSMin::minify($content); 26 26 27 if (($fp = fopen($js,'wb')) === false) { 28 throw new Exception(sprintf('Unable to open file %s',$js)); 29 } 30 fwrite($fp,$res); 31 fclose($fp); 32 } 33 catch (Exception $e) 34 { 35 fwrite(STDERR,$e->getMessage()."\n"); 36 exit(1); 27 if (($fp = fopen($js, 'wb')) === false) { 28 throw new Exception(sprintf('Unable to open file %s', $js)); 29 } 30 fwrite($fp, $res); 31 fclose($fp); 32 } catch (Exception $e) { 33 fwrite(STDERR, $e->getMessage() . "\n"); 34 exit(1); 37 35 } 38 36 ?>
Note: See TracChangeset
for help on using the changeset viewer.
