Asset.php
[Pman.Core] / Asset.php
index 3f25a66..8014aac 100644 (file)
--- a/Asset.php
+++ b/Asset.php
@@ -204,7 +204,7 @@ trait Pman_Core_Asset_Trait {
             clearstatcache();
             if (!file_exists($compiledir.'/'.$output) ||
                 !filesize($compiledir.'/'.$output)) {
-                echo "<!-- compile did not generate files : {$compiledir}/{$output} -->\n";
+                echo "<!-- compile did not generate files : ". basename($compiledir)  ."/{$output} -->\n";
                 $this->assetArrayToHtml($files,'js');
                 return;
             } 
@@ -275,7 +275,7 @@ trait Pman_Core_Asset_Trait {
         //$path = $this->rootURL ."/Pman/$mod/";
         
         //print_R($ar);exit;
-        
+        $missing_files  = false;
         $files = array();
         $arfiles = array();
         $relfiles = array(); // array of files without the path part...
@@ -285,6 +285,14 @@ trait Pman_Core_Asset_Trait {
             $relfiles[] = substr($fn, strlen($dir)+1);
             $f = basename($fn);
             // got the 'module file..'
+            
+            if (!file_exists($dir . '/'. $f)) {
+                echo "<!-- missing {$relpath}{$f} -->\n";
+                $files[] = $relpath  . $f . '?ts=0';
+                $missing_files = true;
+                continue;
+            }
+            
             $mtime = filemtime($dir . '/'. $f);
             $maxtime = max($mtime, $maxtime);
             $arfiles[$fn] = $mtime;
@@ -293,6 +301,12 @@ trait Pman_Core_Asset_Trait {
             
             
         }
+        if ($missing_files) {
+            $this->assetArrayToHtml($files, 'css');
+            return;
+            
+        }
+        
          
         //print_r($relfiles);
         
@@ -338,7 +352,7 @@ trait Pman_Core_Asset_Trait {
             clearstatcache();
             if (!file_exists($compiledir.'/'.$output) ||
                 !filesize($compiledir.'/'.$routput)) {
-                echo "<!-- compile did not generate files : {$compiledir}/{$output} -->\n";
+                echo "<!-- compile did not generate files : " . basename($compiledir) . "/{$output} -->\n";
                 $this->assetArrayToHtml($files,'css');
                 return;
             }