From c5996f7b23f1614ec4574e0c0035f82b5bbca426 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Thu, 8 Oct 2015 09:25:11 +0100 Subject: [PATCH] Returns count and array now, rev scandir order --- lib/settings-common.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/settings-common.php b/lib/settings-common.php index 640ce7e..63073ad 100644 --- a/lib/settings-common.php +++ b/lib/settings-common.php @@ -183,10 +183,11 @@ if (!function_exists('array_replace_recursive')) { // Get number of versions total for a file function getVersionsCount($fileLoc,$fileName) { $count = 0; + $dateCounts = array(); // Establish the base, host and date dirs within... $backupDirBase = str_replace("\\","/",dirname(__FILE__))."/../backups/"; $backupDirHost = isset($ftpSite) ? parse_url($ftpSite,PHP_URL_HOST) : "localhost"; - $backupDateDirs = scandir($backupDirBase.$backupDirHost); + $backupDateDirs = scandir($backupDirBase.$backupDirHost,1); // Get rid of . and .. from date dirs array for ($i=0; $i $count, + "dateCounts" => $dateCounts + ); } ?>