commit
205cc4869d
|
@ -331,6 +331,8 @@ public static function cleandir($directory)
|
||||||
*/
|
*/
|
||||||
public static function latest($directory, $options = fIterator::SKIP_DOTS)
|
public static function latest($directory, $options = fIterator::SKIP_DOTS)
|
||||||
{
|
{
|
||||||
|
$latest = null;
|
||||||
|
|
||||||
$time = 0;
|
$time = 0;
|
||||||
|
|
||||||
$items = new fIterator($directory, $options);
|
$items = new fIterator($directory, $options);
|
||||||
|
@ -340,7 +342,11 @@ public static function latest($directory, $options = fIterator::SKIP_DOTS)
|
||||||
// with a UNIX timestamp greater than the latest one.
|
// with a UNIX timestamp greater than the latest one.
|
||||||
foreach ($items as $item)
|
foreach ($items as $item)
|
||||||
{
|
{
|
||||||
if ($item->getMTime() > $time) $latest = $item;
|
if ($item->getMTime() > $time)
|
||||||
|
{
|
||||||
|
$latest = $item;
|
||||||
|
$time = $item->getMTime();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $latest;
|
return $latest;
|
||||||
|
|
Loading…
Reference in New Issue