4 chdir(dirname(__FILE__
));
5 require_once 'common.php';
10 * Removes trailing whitespace from files.
13 chdir(dirname(__FILE__
) . '/..');
16 $files = $FS->globr('.', '{,.}*', GLOB_BRACE
);
17 foreach ($files as $file) {
20 prefix_is('./.git', $file) ||
21 prefix_is('./docs/doxygen', $file) ||
22 postfix_is('.ser', $file) ||
23 postfix_is('.tgz', $file) ||
24 postfix_is('.patch', $file) ||
25 postfix_is('.dtd', $file) ||
26 postfix_is('.ent', $file) ||
27 $file == './library/HTMLPurifier/Lexer/PH5P.php' ||
28 $file == './maintenance/PH5P.php'
30 $contents = file_get_contents($file);
31 $result = preg_replace('/^(.*?)[ \t]+(\r?)$/m', '\1\2', $contents, -1, $count);
32 if (!$count) continue;
34 file_put_contents($file, $result);