You are here

function backup_migrate_destination::list_files in Backup and Migrate 8.3

Same name and namespace in other branches
  1. 8.2 includes/destinations.inc \backup_migrate_destination::list_files()
  2. 6.3 includes/destinations.inc \backup_migrate_destination::list_files()
  3. 6.2 includes/destinations.inc \backup_migrate_destination::list_files()
  4. 7.3 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 with their destination specific id.

3 calls to backup_migrate_destination::list_files()
backup_migrate_destination::count_files in includes/destinations.inc
List all the available files in the given destination with their destination specific id.
backup_migrate_destination::file_exists in includes/destinations.inc
Check if a file exists in the given destination.
backup_migrate_destination_files::get_file in includes/destinations.file.inc
Get the file object for the given file.

File

includes/destinations.inc, line 838

Class

backup_migrate_destination
A base class for creating destinations.

Code

function list_files() {
  $files = NULL;
  if ($this->cache_files) {
    $files = $this
      ->file_cache_get();
  }
  if ($files === NULL) {
    $files = $this
      ->_list_files();
    $files = $this
      ->load_files_info($files);
    if ($this->cache_files) {
      $this
        ->file_cache_set($files);
    }
  }
  $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;
}