function coder_format_recursive in Coder 6.2
Same name and namespace in other branches
- 5.2 scripts/coder_format/coder_format.inc \coder_format_recursive()
- 5 scripts/coder_format/coder_format.inc \coder_format_recursive()
- 6 scripts/coder_format/coder_format.inc \coder_format_recursive()
- 7.2 scripts/coder_format/coder_format.inc \coder_format_recursive()
- 7 scripts/coder_format/coder_format.inc \coder_format_recursive()
Recursively process .module and .inc files in directory with coder_format_file().
Parameters
$directory: Path to a directory to process recursively.
$undo: Boolean whether or not to undo batch replacements.
1 call to coder_format_recursive()
- coder_format.php in scripts/
coder_format/ coder_format.php - Coder format shell invocation script.
File
- scripts/
coder_format/ coder_format.inc, line 16 - Coder format helper functions.
Code
function coder_format_recursive($directory, $undo = FALSE) {
// Convert Windows paths (only cosmetical).
$directory = str_replace('\\', '/', $directory);
// Check if directory exists.
if (!file_check_directory($directory)) {
drupal_set_message(t('%directory not found.', array(
'%directory' => $directory,
)), 'error');
return FALSE;
}
// Fetch files to process.
$mask = '\\.php$|\\.module$|\\.inc$|\\.install|\\.profile$';
$nomask = array(
'.',
'..',
'CVS',
'.svn',
'.git',
);
$files = file_scan_directory($directory, $mask, $nomask, 0, TRUE);
foreach ($files as $file) {
coder_format_file($file->filename, $undo);
}
}