function hook_upgrade_regex_info_alter in Coder 7
Same name and namespace in other branches
- 7.2 coder_upgrade/coder_upgrade.api.php \hook_upgrade_regex_info_alter()
Alters the text of an info file using regular expressions.
Parameters
string $file: The text of the file to convert.
2 functions implement hook_upgrade_regex_info_alter()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- coder_upgrade_upgrade_regex_info_alter in coder_upgrade/
conversions/ regex.inc - Implements hook_upgrade_regex_info_alter().
- your_module_name_upgrade_regex_info_alter in coder_upgrade/
coder_upgrade.api.php - Implements hook_upgrade_regex_info_alter().
1 invocation of hook_upgrade_regex_info_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 387 - Documents hooks provided by this module.
Code
function hook_upgrade_regex_info_alter(&$file) {
$hook = 'info_file';
// Used as the label in the log 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);
}