SnipPets » History » Version 2
Simon, 03/25/2010 11:47 AM
| 1 | 1 | Simon | = Snippets = |
|---|---|---|---|
| 2 | |||
| 3 | == Remove trailing whitespaces == |
||
| 4 | |||
| 5 | http://jimbojw.com/wiki/index.php?title=How_to_find_PHP_files_with_trailing_whitespace |
||
| 6 | |||
| 7 | '''Command Line :''' |
||
| 8 | {{{ |
||
| 9 | echo '<?php foreach (glob("**/*.php") as $file){if (preg_match( "/\\?".">\\s\\s+\\Z/m", file_get_contents($file))) echo("$file\n");} ?>' | php |
||
| 10 | }}} |
||
| 11 | |||
| 12 | |||
| 13 | '''PHP file script :''' |
||
| 14 | {{{ |
||
| 15 | <?php |
||
| 16 | foreach (glob('**/*.php') as $file){ |
||
| 17 | if (preg_match('/\\?'.'>\\s\\s+\\Z/m',file_get_contents($file))) |
||
| 18 | echo("$file\n"); |
||
| 19 | } |
||
| 20 | ?> |
||
| 21 | }}} |
||
| 22 | 2 | Simon | |
| 23 | |||
| 24 | == Remove .svn folders on Windows == |
||
| 25 | |||
| 26 | {{{ |
||
| 27 | for /r repository %f in (.svn) do rd /S /Q "%f" |
||
| 28 | }}} |
||
| 29 | |||
| 30 | from : http://www.jonathan-petitcolas.com/fr/supprimer-recursivement-les-dossiers-svn-sous-windows/ |