diff --git a/lib/settings-common.php b/lib/settings-common.php index 650404d..640ce7e 100644 --- a/lib/settings-common.php +++ b/lib/settings-common.php @@ -179,4 +179,40 @@ if (!function_exists('array_replace_recursive')) { return $base; } } + +// Get number of versions total for a file +function getVersionsCount($fileLoc,$fileName) { + $count = 0; + // 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); + // Get rid of . and .. from date dirs array + for ($i=0; $i