Revision 2566:9bf417837888,
893 bytes
checked in by franck <carnet.franck.paul@…>, 12 years ago
(diff) |
Add some people in CREDITS, remove trailing spaces and tabs.
|
|
Rev | Line | |
---|
[0] | 1 | #!/usr/bin/env php |
---|
| 2 | <?php |
---|
| 3 | # -- BEGIN LICENSE BLOCK --------------------------------------- |
---|
| 4 | # |
---|
| 5 | # This file is part of Dotclear 2. |
---|
| 6 | # |
---|
[1179] | 7 | # Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear |
---|
[0] | 8 | # Licensed under the GPL version 2.0 license. |
---|
| 9 | # See LICENSE file or |
---|
| 10 | # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
---|
| 11 | # |
---|
| 12 | # -- END LICENSE BLOCK ----------------------------------------- |
---|
| 13 | |
---|
| 14 | try |
---|
| 15 | { |
---|
| 16 | $js = (!empty($_SERVER['argv'][1])) ? $_SERVER['argv'][1] : null; |
---|
[2566] | 17 | |
---|
[0] | 18 | if (!$js || !is_file($js)) { |
---|
| 19 | throw new Exception(sprintf("File %s does not exist",$js)); |
---|
| 20 | } |
---|
[2566] | 21 | |
---|
[0] | 22 | require dirname(__FILE__).'/jsmin-1.1.1.php'; |
---|
[2566] | 23 | |
---|
[0] | 24 | $content = file_get_contents($js); |
---|
| 25 | $res = JSMin::minify($content); |
---|
[2566] | 26 | |
---|
[0] | 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); |
---|
| 37 | } |
---|
[2566] | 38 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.