You are here

function hook_upgrade_regex_install_alter in Coder 7

Same name and namespace in other branches
  1. 7.2 coder_upgrade/coder_upgrade.api.php \hook_upgrade_regex_install_alter()

Alters the text of an install file using regular expressions.

Parameters

string $file: The text of the file to convert.

1 invocation of hook_upgrade_regex_install_alter()
coder_upgrade_apply_regex in coder_upgrade/includes/main.inc
Applies regular expression conversion routines to a file.

File

coder_upgrade/coder_upgrade.api.php, line 409
Documents hooks provided by this module.

Code

function hook_upgrade_regex_install_alter(&$file) {
  $hook = 'info_file';

  // Used as the label in the log file.
  $cur = $file;
  $new = $cur;
  $from = array();
  $to = array();

  // Do something to $file.
  $from[] = '/(your_module_name)/';
  $to[] = "\$1";
  coder_upgrade_do_conversions($from, $to, $new);
  coder_upgrade_save_changes($cur, $new, $file, $hook);
}