Project

General

Profile

SnipPets » History » Revision 2

Revision 1 (Simon, 10/14/2009 06:19 PM) → Revision 2/7 (Simon, 03/25/2010 11:47 AM)

= Snippets =  

 == Remove trailing whitespaces == 

 http://jimbojw.com/wiki/index.php?title=How_to_find_PHP_files_with_trailing_whitespace 

 '''Command Line :'''  
 {{{ 
 echo '<?php foreach (glob("**/*.php") as $file){if (preg_match( "/\\?".">\\s\\s+\\Z/m", file_get_contents($file))) echo("$file\n");} ?>' | php 
 }}} 


 '''PHP file script :''' 
 {{{ 
 <?php 
 foreach (glob('**/*.php') as $file){ 
   if (preg_match('/\\?'.'>\\s\\s+\\Z/m',file_get_contents($file))) 
     echo("$file\n"); 
 } 
 ?> 
 }}} 


 == Remove .svn folders on Windows == 

 {{{ 
 for /r repository %f in (.svn) do rd /S /Q "%f" 
 }}} 

 from : http://www.jonathan-petitcolas.com/fr/supprimer-recursivement-les-dossiers-svn-sous-windows/