Changeset 823


Ignore:
Timestamp:
05/01/07 22:24:47 (12 years ago)
Author:
ray
Message:

Ticket #127 Entities.js file corrupt

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/contrib/compress.php

    r746 r823  
    11<? 
    2 die("Run this script to batch-compress the current Xinha snapshot. To run the script, open the file and uncomment the die() command"); 
     2die("Run this script to batch-compress the current Xinha snapshot. To run the script, open the file and comment out the die() command"); 
    33 
    44error_reporting(E_ALL); 
     
    5656        copy($file,$file."_uncompr.js"); 
    5757        exec("java -jar ${cwd}/dojo_js_compressor.jar -c ${file}_uncompr.js > $file 2>&1"); 
    58         unlink($file."_uncompr.js"); 
     58        if (preg_match('/js: ".*?", line \d+:/',file_get_contents($file))) 
     59        { 
     60                unlink($file); 
     61                rename($file."_uncompr.js",$file); 
     62        } 
     63        else 
     64        { 
     65                unlink($file."_uncompr.js"); 
     66        } 
    5967} 
    6068print "Operation complete." 
Note: See TracChangeset for help on using the changeset viewer.