function coder_upgrade_upgrade_regex_info_alter in Coder 7
Same name and namespace in other branches
- 7.2 coder_upgrade/conversions/regex.inc \coder_upgrade_upgrade_regex_info_alter()
Implements hook_upgrade_regex_info_alter().
Alters the text of a code file using regular expressions.
Module Info / Install http://drupal.org/node/224333#info_core_7 (this anchor does not exist on the chronological page)
Parameters
string $file: The text of the file to convert.
File
- coder_upgrade/
conversions/ regex.inc, line 165 - Miscellaneous conversion routine file for the coder_upgrade module. These routines upgrade text using simple regular expressions.
Code
function coder_upgrade_upgrade_regex_info_alter(&$file) {
cdp("inside " . __FUNCTION__);
$hook = 'info_file';
$cur = $file;
$new = $cur;
$from = array();
$to = array();
// Info file should specify core = 7.x.
$from[] = '@^core\\s+=\\s+.*?$@m';
$to[] = 'core = 7.x';
coder_upgrade_do_conversions($from, $to, $new);
coder_upgrade_save_changes($cur, $new, $file, $hook);
}