You are here

public static function RealisticDummyContentEnvironment::validCandidateFilename in Realistic Dummy Content 3.x

Same name and namespace in other branches
  1. 8.2 api/src/includes/RealisticDummyContentEnvironment.php \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentEnvironment::validCandidateFilename()
  2. 7.2 api/src/includes/RealisticDummyContentEnvironment.php \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentEnvironment::validCandidateFilename()

Checks if a filename is valid.

1 call to RealisticDummyContentEnvironment::validCandidateFilename()
RealisticDummyContentEnvironment::implementSortCandidateFiles in api/src/includes/RealisticDummyContentEnvironment.php
Given a list of candidate files, sort them by names and parts.

File

api/src/includes/RealisticDummyContentEnvironment.php, line 264

Class

RealisticDummyContentEnvironment
The abstract base environment.

Namespace

Drupal\realistic_dummy_content_api\includes

Code

public static function validCandidateFilename($name, $extensions = NULL) {
  if (self::lowercaseRadicalNoExtension($name) == 'readme') {
    return FALSE;
  }
  if (!$extensions) {
    return TRUE;
  }
  $filparts = self::getFileParts($name);
  return in_array($filparts['base_extension'], $extensions);
}