I'm trying to remove all white space and code comments from my .php files by using the -W flag available from the PHP CLI. I'm using a batch file to recursively loop through each php file in my project. The batch command looks like:
FOR /F "tokens=*" %%G IN ('DIR /B /A-D /S *.php') DO "%php-exe-path%/php.exe" -w %%G > %%G
This just produces blank .php files (using the '>' redirector), however using the appending redirector ('>>') works fine. I'm not sure if this is an issue with PHP locking the files or some problem with my batch command.
Can anyone help?