coder_format_recursive($directory, $undo = false)Recursively process .module and .inc files in directory with coder_format_file().
$directory Path to a directory to process recursively.
$undo Boolean whether or not to undo batch replacements.
sites/all/modules/coder/scripts/coder_format/coder_format.inc, line 12
<?php
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);
}
}
?>