I tried producing a mapping of the following form to populate the options array with a replacement task for a string in a file:
<mapping name="replacements">
<element key="file path">
<element key="type" value="file type"/>
<element key="from" value="to replace"/>
<element key="to" value="with this"/>
</element>
</mapping>
This didn't seem to work for me so I knocked up a quick solution by adding another exception case for replacements in the task itself which simply calls the relevent PEAR method and adds the file path as another child element:
<mapping name="replacements">
<element>
<element key="path" value="path"/>
<element key="type" value="type"/>
<element key="from" value="to replace"/>
<element key="to" value="with this"/>
</element>
</mapping>
If I am being silly here please let me know. Otherwise I have attached a patch file that will add my modification to the PearPackage2Task.