From ee18da9b73f94153de48eb8abaa7f49d156a912c Mon Sep 17 00:00:00 2001 From: helmut Date: Tue, 16 Oct 2012 21:08:58 +1200 Subject: [PATCH 1/2] Update laravel/file.php Fixed bug that was causing the latest function to return the 'last' file rather than the actual 'latest' file. --- laravel/file.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/laravel/file.php b/laravel/file.php index d2022268..26672291 100644 --- a/laravel/file.php +++ b/laravel/file.php @@ -340,7 +340,11 @@ class File { // with a UNIX timestamp greater than the latest one. foreach ($items as $item) { - if ($item->getMTime() > $time) $latest = $item; + if ($item->getMTime() > $time) + { + $latest = $item; + $time = $item->getMTime(); + } } return $latest; From 1d725b2788a24a2f151820b9241debe3fa9b8864 Mon Sep 17 00:00:00 2001 From: helmut Date: Mon, 22 Oct 2012 10:09:53 +1200 Subject: [PATCH 2/2] Update laravel/file.php Yep... good pick up jason. --- laravel/file.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/laravel/file.php b/laravel/file.php index 26672291..5ac39cac 100644 --- a/laravel/file.php +++ b/laravel/file.php @@ -331,6 +331,8 @@ class File { */ public static function latest($directory, $options = fIterator::SKIP_DOTS) { + $latest = null; + $time = 0; $items = new fIterator($directory, $options);