Asset.php
[Pman.Core] / Asset.php
index 77377d6..2a38a2e 100644 (file)
--- a/Asset.php
+++ b/Asset.php
@@ -244,6 +244,7 @@ trait Pman_Core_Asset_Trait {
     
     function outputCssDir($path)
     {
+          
         $relpath = $this->rootURL . '/' . $path .'/';
         $ff = HTML_FlexyFramework::get();
         $dir =   $this->rootDir.'/' . $path;
@@ -274,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...
@@ -284,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='.$mtime;
+                $missing_files = true;
+                continue;
+            }
+            
             $mtime = filemtime($dir . '/'. $f);
             $maxtime = max($mtime, $maxtime);
             $arfiles[$fn] = $mtime;
@@ -292,6 +301,12 @@ trait Pman_Core_Asset_Trait {
             
             
         }
+        if ($missing_files) {
+            $this->assetArrayToHtml($files, 'css');
+            return;
+            
+        }
+        
          
         //print_r($relfiles);