JsCompile.php
authorAlan Knowles <alan@akbkhome.com>
Thu, 28 Jul 2011 14:39:23 +0000 (22:39 +0800)
committerAlan Knowles <alan@akbkhome.com>
Thu, 28 Jul 2011 14:39:23 +0000 (22:39 +0800)
JsCompile.php

index ad26719..d657891 100644 (file)
@@ -69,14 +69,14 @@ class Pman_Core_JsCompile  extends Pman
      *
      * @param {String} basedir absolute path to files
      * @param {Array}  list of files (ontop of basedir) 
-     * @param {String|false} output url (path to basedir basically), or false
+     * @param {String} output url (path to basedir basically), or false
      *                  to not compile
      *
      *
      */
     
     
-    function packScript($basedir, $files,  $output_url)
+    function packScript($basedir, $files,  $output_url, $no_compile=false)
     {
         // this outputs <script tags..>
         // either for just the original files,
@@ -103,11 +103,11 @@ class Pman_Core_JsCompile  extends Pman
         
         $output = md5(serialize($arfiles)) .'.js';
         
-        if ( $output_url && !file_exists($basedir.'/_cache_/'.$output)) {
+        if ( !$no_compile && !file_exists($basedir.'/_cache_/'.$output)) {
             $this->pack($arfiles,$basedir.'/_cache_/'.$output);
         }
         
-        if ($output_url && file_exists($basedir.'/_cache_/'.$output)) {
+        if (!$no_compile && file_exists($basedir.'/_cache_/'.$output)) {
             
             echo '<script type="text/javascript" src="'.$output_url.'/_cache_/'. $output.'"></script>';
             return;