From ea938707d8dc4b99a4eaef4f027b1659706974c5 Mon Sep 17 00:00:00 2001 From: Colin Smith Date: Tue, 10 May 2005 03:11:36 +0000 Subject: Whoops. We still need those functions ;) --- etc/inc/config.inc | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/etc/inc/config.inc b/etc/inc/config.inc index bc77e84..262aaf4 100644 --- a/etc/inc/config.inc +++ b/etc/inc/config.inc @@ -931,5 +931,31 @@ function system_start_ftp_helpers() { echo "Done.\n"; } - +function cleanup_backupcache() { + $baktimes = array(); + foreach(glob("/conf/backup/*") as $backup) { + if(stristr($backup, 'backup.cache')) continue; + $baktimes[] = array_shift(explode('.', array_pop(explode('-', $backup)))); + } + sort($baktimes); + $cacheout = fopen("/conf/backup/backup.cache", "w"); + fwrite($cacheout, implode("\n", $baktimes)); + fclose($cacheout); + return true; +} + +function get_backups() { + if(file_exists("/conf/backup/backup.cache")) { + $confvers = array_reverse(file("/conf/backup/backup.cache")); + foreach($confvers as $index => $toproc) { + if(trim($toproc) == $config['revision']['time']) { + array_splice($confvers, $index, 0, array(trim($toproc))); + } + } + } else { + print_info_box("No backups found."); + return false; + } + return $confvers; +} ?> -- cgit v1.1