#!/bin/sh
mainDir=../app

for file in `find $mainDir -type f \( -name '*.php' \) -print`; do

 if [ `expr $file : '.*\/lib\/GeSHi/\geshi.php'` -gt 0 \
   -o `expr $file : '.*\/lib\/GeSHi/\langFiles'` -gt 0 ]; then
  continue;
 fi;

 echo "vim magic for $file"
 /d/vim/vim71/gvim -s reformat.vim $file
 rm -f $file~

 echo "replacing some texts"
 sed -e '/[\t ]*\/\/==\+/d' \
  -e '/#END CLASS/d' $file > $file.tmp
 mv $file.tmp $file

done

