AssetTrait.php
[Pman.Core] / AssetTrait.php
index 9c492a1..2d4b900 100644 (file)
@@ -224,11 +224,14 @@ trait Pman_Core_AssetTrait {
         }
         
          
-        // no sorting???
-        //$lsort = create_function('$a,$b','return strlen($a) > strlen($b) ? 1 : -1;');
-        //usort($files, $lsort);
         
         
+        // yes sort... if includes are used - they have to be in the first file...
+        $lsort = create_function('$a,$b','return strlen($a) > strlen($b) ? 1 : -1;');
+        usort($files, $lsort);
+        usort($relfiles,$lsort);
+        print_R($relfiles);
+        
         if (!empty($this->bootLoader->isDev) && !empty($_REQUEST['isDev'])) {
             echo "<!-- CSS compile turned off (isDev on) -->\n";
             $this->assetArrayToHtml($files,'css');
@@ -244,9 +247,9 @@ trait Pman_Core_AssetTrait {
         
         // where are we going to write all of this..
         // This has to be done via a 
-        if (true || !file_exists($compiledir.'/'.$output) || !filesize($compiledir.'/'.$output)) {
-            
+        if (!file_exists($compiledir.'/'.$output) || !filesize($compiledir.'/'.$output)) {
             
+            //print_r($relfiles);
             
             require_once 'HTML/CSS/Minify.php';
             $x = new HTML_CSS_Minify(substr($relpath,0,-1), $dir, $relfiles);