You are here

public static function HudtInternal::normalizeFileName in Hook Update Deploy Tools 8

Same name and namespace in other branches
  1. 7 src/HudtInternal.php \HookUpdateDeployTools\HudtInternal::normalizeFileName()

Normalizes a machine or file name to be the filename.

Parameters

string $quasi_name: An machine name or a export file name to be normalized.

Return value

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

5 calls to HudtInternal::normalizeFileName()
PageManager::export in src/PageManager.php
Exports a single PageManager page (typically called from Drush).
PageManager::import in src/PageManager.php
Imports Page Manager pages using the panels module & template.
Redirects::import in src/Redirects.php
Imports a set of redirects from an import csv file.
Rules::export in src/Rules.php
Exports a single Rule when called (typically called from Drush).
Rules::import in src/Rules.php
Imports rules using the rule_import module & template.

File

src/HudtInternal.php, line 233

Class

HudtInternal
Methods for processes internal to Hook Deploy Update Tools.

Namespace

HookUpdateDeployTools

Code

public static function normalizeFileName($quasi_name) {
  $items = array(
    '-export.txt' => '',
    '_' => '-',
  );
  $file_name = str_replace(array_keys($items), array_values($items), $quasi_name);
  $file_name = "{$file_name}-export.txt";
  return $file_name;
}