You are here

static function RealisticDummyContentEnvironment::SortCandidateFiles_ in Realistic Dummy Content 7

Given a list of candidate files, sort them by names and parts.

Parameters

$candidate_files: An array keyed by filename which contains drupal file objects. See SortCandidateFiles().

$extensions = NULL: If set, extensions to filter by. See SortCandidateFiles().

Return value

A sorted array. See SortCandidateFiles().

Throws

Exception

1 call to RealisticDummyContentEnvironment::SortCandidateFiles_()
RealisticDummyContentEnvironment::SortCandidateFiles in api/includes/RealisticDummyContentEnvironment.inc
Given a list of candidate files, sort them by names and parts.

File

api/includes/RealisticDummyContentEnvironment.inc, line 245
Define RealisticDummyContentLiveEnvironment autoload class.

Class

RealisticDummyContentEnvironment
The abstract base environment.

Code

static function SortCandidateFiles_($candidate_files, $extensions = NULL) {
  $return = array();
  foreach ($candidate_files as $candidate_filename => $candidate_file) {
    if (self::validCandidateFilename($candidate_filename, $extensions)) {
      self::addFileToArray($return, $candidate_filename, $candidate_file);
    }
  }

  // We expect the files to be sorted alphabetically, which is not the case on all
  // systems.
  ksort($return);
  return $return;
}