ping删除部分过滤器


Phing remove section filter

是否有一个过滤器,你能给我一个使用ping删除一段代码的例子吗?

。这是我的代码:

function someFunc() {
    // <debug>
    var_dump(func_get_args());
    // </debug>
    doStuff();
}

如何将其简化为:

function someFunc() {
    doStuff();
}

使用Phing ?

我用一个小正则表达式算出来了:

<target name="stripblocks" depends="prepare,clone">
    <property name="stripblocks" value="debug|strict" />
    <reflexive>
        <fileset dir="${buildpath}">
            <include pattern="**/*" />
        </fileset>
        <filterchain>
            <!-- Replace the blocks using regex -->
            <replaceregexp>
                <regexp pattern="//'s&lt;(${stripblocks})&gt;.*?//'s&lt;/(${stripblocks})&gt;" 
                        replace="// &lt;$1/&gt;" 
                        ignoreCase="true" 
                        multiline="true" />
            </replaceregexp>
        </filterchain>
    </reflexive>
</target>

function someFunc() {
    // <debug>
    var_dump(func_get_args());
    // </debug>
    doStuff();
}

function someFunc() {
    // <debug/>
    doStuff();
}