| Revision 3731:3770620079d4,
            726 bytes
            checked in by franck <carnet.franck.paul@…>, 8 years ago
            (diff) | 
        
        
          | 
               
Simplify licence block at the beginning of each file 
 
           | 
        
        
          | 
            
           | 
        
      
      
        
  | Line |   | 
|---|
| 1 | #!/usr/bin/env php | 
|---|
| 2 | <?php | 
|---|
| 3 | /** | 
|---|
| 4 |  * @package Dotclear | 
|---|
| 5 |  * @subpackage Core | 
|---|
| 6 |  * | 
|---|
| 7 |  * @copyright Olivier Meunier & Association Dotclear | 
|---|
| 8 |  * @copyright GPL-2.0-only | 
|---|
| 9 |  */ | 
|---|
| 10 |  | 
|---|
| 11 | try | 
|---|
| 12 | { | 
|---|
| 13 |     $js = (!empty($_SERVER['argv'][1])) ? $_SERVER['argv'][1] : null; | 
|---|
| 14 |  | 
|---|
| 15 |     if (!$js || !is_file($js)) { | 
|---|
| 16 |         throw new Exception(sprintf("File %s does not exist", $js)); | 
|---|
| 17 |     } | 
|---|
| 18 |  | 
|---|
| 19 |     require dirname(__FILE__) . '/jsmin-1.1.1.php'; | 
|---|
| 20 |  | 
|---|
| 21 |     $content = file_get_contents($js); | 
|---|
| 22 |     $res     = JSMin::minify($content); | 
|---|
| 23 |  | 
|---|
| 24 |     if (($fp = fopen($js, 'wb')) === false) { | 
|---|
| 25 |         throw new Exception(sprintf('Unable to open file %s', $js)); | 
|---|
| 26 |     } | 
|---|
| 27 |     fwrite($fp, $res); | 
|---|
| 28 |     fclose($fp); | 
|---|
| 29 | } catch (Exception $e) { | 
|---|
| 30 |     fwrite(STDERR, $e->getMessage() . "\n"); | 
|---|
| 31 |     exit(1); | 
|---|
| 32 | } | 
|---|
| 33 | ?> | 
|---|
       
      Note: See 
TracBrowser
        for help on using the repository browser.