DataObjects/Core_notify_recur.php
[Pman.Core] / JsCompile.php
index 3c74319..6c88bcf 100644 (file)
@@ -86,6 +86,8 @@ class Pman_Core_JsCompile  extends Pman
         // or the compressed version.
         // first expand files..
         
+        echo "<!-- compiling   $basedir  -->\n";
+        
         $arfiles = array();
         $ofiles = array();
         foreach($files as $f) {
@@ -119,9 +121,9 @@ class Pman_Core_JsCompile  extends Pman
             echo '<script type="text/javascript" src="'.$output_url.'/'.$f.'"></script>'."\n";
             
         }
-         
-        
+          
     }
+    
     function packCss($basedir, $files,   $output_url)
     {
         // this outputs <script tags..>
@@ -239,15 +241,15 @@ class Pman_Core_JsCompile  extends Pman
             return false;
             
         }
-        $targetm = file_exists($output) ? filemtime($output) : 0;
+        $targetm = file_exists($output) && filesize($output) ? filemtime($output) : 0;
         $max = 0;
         $ofiles = array();
         foreach($files as $f => $mt) {
             $max = max($max,$mt);
             $ofiles[] = escapeshellarg($f);
         }
-        if ($max < $targetm)
-            echo '<!--  cached time  is less that outputtime -->';
+        if ($max < $targetm) {
+            echo '<!--  use cached compile. -->';
             return true;
         }
         //var_dump($output);
@@ -283,7 +285,7 @@ class Pman_Core_JsCompile  extends Pman
         //exit;
         file_put_contents($output.'.log', $cmd."\n\n". $res);
         // since this only appears when we change.. it's ok to dump it out..
-          echo "<!-- Compiled javascript
+        echo "<!-- Compiled javascript
             " . htmlspecialchars($res) . "
             -->";