Dotclear


Ignore:
Timestamp:
03/08/18 17:58:39 (8 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Code formatting (PSR-2)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • build-tools/min-js.php

    r2566 r3730  
    1414try 
    1515{ 
    16      $js = (!empty($_SERVER['argv'][1])) ? $_SERVER['argv'][1] : null; 
     16    $js = (!empty($_SERVER['argv'][1])) ? $_SERVER['argv'][1] : null; 
    1717 
    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    } 
    2121 
    22      require dirname(__FILE__).'/jsmin-1.1.1.php'; 
     22    require dirname(__FILE__) . '/jsmin-1.1.1.php'; 
    2323 
    24      $content = file_get_contents($js); 
    25      $res = JSMin::minify($content); 
     24    $content = file_get_contents($js); 
     25    $res    = JSMin::minify($content); 
    2626 
    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); 
    3735} 
    3836?> 
Note: See TracChangeset for help on using the changeset viewer.

Sites map