You are here

private static function Terms::normalizeFileName in Hook Update Deploy Tools 7

Normalizes a path name to be the filename. Overrides HudtInternal method.

Parameters

string $quasi_name: A path to normalize and create a filename from.

Return value

string A string resembling a filename with hyphens and .txt.

2 calls to Terms::normalizeFileName()
Terms::export in src/Terms.php
Exports a single term based on its tid. (Typically called from Drush).
Terms::import in src/Terms.php
Perform the unique steps necessary to import terms items from export files.

File

src/Terms.php, line 237

Class

Terms
Public methods for dealing with Vocabularies.

Namespace

HookUpdateDeployTools

Code

private static function normalizeFileName($quasi_name) {
  $items = array(
    // Remove spaces.
    ' ' => 'sSs',
    // Convert to separator.
    '|' => 'zZz',
  );
  $file_name = str_replace(array_keys($items), array_values($items), $quasi_name);
  $file_name = "{$file_name}.txt";
  return $file_name;
}