You are here

function _backup_migrate_list_files in Backup and Migrate 5

Same name and namespace in other branches
  1. 6 backup_migrate.module \_backup_migrate_list_files()

List the previously created backup files.

1 string reference to '_backup_migrate_list_files'
backup_migrate_menu in ./backup_migrate.module
Implementation of hook_menu().

File

./backup_migrate.module, line 970
Create (manually or scheduled) and restore backups of your Drupal MySQL database with an option to exclude table data (f.e. cache_*)

Code

function _backup_migrate_list_files($mode = "manual") {
  $files = array();
  if ($dir = _backup_migrate_check_destination_dir($mode)) {
    if ($handle = opendir($dir)) {
      while (FALSE !== ($file = readdir($handle))) {
        $filepath = $dir . "/" . $file;
        if ($info = _backup_migrate_file_info($filepath)) {
          $files[$file] = array(
            $file,
            format_date($info['filemtime']),
            format_size($info['filesize']),
            l(t("Download"), "system/files/" . $filepath),
            user_access('restore from backup') ? l(t("Restore"), "admin/content/backup_migrate/restorefile/" . $filepath) : '',
            user_access('delete backup files') ? l(t("Delete"), "admin/content/backup_migrate/delete/" . $filepath) : '',
          );
        }
      }
    }
  }
  krsort($files);
  return theme("table", array(), $files);
}