Pman.php
authorAlan Knowles <alan@akbkhome.com>
Tue, 9 Nov 2010 08:08:20 +0000 (16:08 +0800)
committerAlan Knowles <alan@akbkhome.com>
Tue, 9 Nov 2010 08:08:20 +0000 (16:08 +0800)
Pman.php

index ed2d47e..769926e 100644 (file)
--- a/Pman.php
+++ b/Pman.php
@@ -558,7 +558,20 @@ class Pman extends HTML_FlexyFramework_Page
         if (file_exists($cfile)) {
            // $ctime = max(filemtime($cfile), filectime($cfile));
             // otherwise use compile dfile..
-            $cfile = basename(array_pop(glob($cfile . '/' . $mod . '*.js')));
+            $maxm = 0;
+            $ar = glob($cfile . '/' . $mod . '*.js');
+            // default to first..
+            $cfile = basename($ar[count($ar) -1]);
+            foreach($ar as $fn) {
+                if (filemtime($fn) > $maxm) {
+                    $cfile = basename($fn);
+                    $maxm = filemtime($fn);
+                }
+                
+            }
+            
+            
+            //$cfile = basename(array_pop(glob($cfile . '/' . $mod . '*.js')));
             
             $files = array( $this->rootURL. "/_compiled_/".$mod . "/" . $cfile);
             if (file_exists($lfile)) {