You are here

public function backup_migrate_destination::list_files in Backup and Migrate 7.3

Same name and namespace in other branches
  1. 8.2 includes/destinations.inc \backup_migrate_destination::list_files()
  2. 8.3 includes/destinations.inc \backup_migrate_destination::list_files()
  3. 6.3 includes/destinations.inc \backup_migrate_destination::list_files()
  4. 6.2 includes/destinations.inc \backup_migrate_destination::list_files()
  5. 7.2 includes/destinations.inc \backup_migrate_destination::list_files()

List all the available files in the given destination.

Includes their destination specific id.

3 calls to backup_migrate_destination::list_files()
backup_migrate_destination::count_files in includes/destinations.inc
Count all the available files in the given destination.
backup_migrate_destination::file_exists in includes/destinations.inc
Check if the file exists in the list of available files.
backup_migrate_destination_files::get_file in includes/destinations.file.inc
Get the file object for the given file.

File

includes/destinations.inc, line 876

Class

backup_migrate_destination
A base class for creating destinations.

Code

public function list_files() {
  $files = NULL;
  if ($this->cache_files) {
    $files = $this
      ->file_cache_get();
  }
  if ($files === NULL) {
    require_once dirname(__FILE__) . '/files.inc';
    $files = $this
      ->_list_files();
    $files = $this
      ->load_files_info($files);
    if ($this->cache_files) {
      $this
        ->file_cache_set($files);
    }

    // Clean up any previous abandoned tmp files before going further.
    _backup_migrate_temp_files_delete();
  }
  $out = array();
  if (is_array($files)) {
    foreach ($files as $id => $file) {
      if ($file
        ->is_recognized_type()) {
        $out[$id] = $file;
        $out[$id]->destination =& $this;
      }
    }
  }
  return $out;
}