From 6658f58a77f8b5129e7d5a3b8adb0747d35fa771 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Tue, 9 Nov 2010 16:08:20 +0800 Subject: [PATCH] Pman.php --- Pman.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Pman.php b/Pman.php index ed2d47e..769926e 100644 --- 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)) { -- 2.39.2