0

I have a file ga-code.txt which contains analytics code. I want to use phing in a build to replace this token @ga-code@ in index.php with the contents of ga-code.txt

Is this possible with phing?

serenesat
  • 4,611
  • 10
  • 37
  • 53
Sam Luther
  • 1,170
  • 3
  • 18
  • 38

1 Answers1

0

Yes, I can do it with Phing's replacetokenswithfile

The following would replace html comment <!--@@ga-code@@--> with the contents of a file named ga-code.txt

<replacetokenswithfile begintoken="&lt;!--@@" endtoken="@@--&gt;" dir="${builddir}/production/" postfix=".txt" translatehtml="false" />
Sam Luther
  • 1,170
  • 3
  • 18
  • 38