function coder_format_recursive in Coder 5.2
Same name and namespace in other branches
- 5 scripts/coder_format/coder_format.inc \coder_format_recursive()
- 6.2 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 12
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',
);
$files = file_scan_directory($directory, $mask, $nomask, 0, true);
foreach ($files as $file) {
coder_format_file($file->filename, $undo);
}
}