You are here

public static function RealisticDummyContentEnvironment::lowercaseRadicalNoExtension in Realistic Dummy Content 7.2

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

Returns the part of a string before the extension, in lowercase.

Parameters

string $filename: A filename string, e.g. rEadmE.txt.

Return value

string The lowercase radical without the extension, e.g. readme

1 call to RealisticDummyContentEnvironment::lowercaseRadicalNoExtension()
RealisticDummyContentEnvironment::validCandidateFilename in api/src/includes/RealisticDummyContentEnvironment.php
Checks if a filename is valid.

File

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

Class

RealisticDummyContentEnvironment
The abstract base environment.

Namespace

Drupal\realistic_dummy_content_api\includes

Code

public static function lowercaseRadicalNoExtension($filename) {
  return self::strToLower(trim(preg_replace('/\\.[^\\.]*$/', '', $filename)));
}