Phing echo filename specific extension

157 views Asked by At

Is there a way in phing on which I can echo all the filenames inside specific folder specifying to get all ".php" extensions?

folder-to-check
  |
   - file-to-get1.php
   - file-to-get2.php
   - otherfile.avi
   - otherfolder
1

There are 1 answers

0
klipach On

Here is an example of build.xml which echo all *.php files in specific folder:

<?xml version="1.0"?>
<project name="build" default="build">
    <target name="build">
        <foreach param="filename" absparam="absfilename" target="subtask">
            <fileset dir="path/to/folder">
                <include name="*.php"/>
            </fileset>
        </foreach>
    </target>

    <target name="subtask">
        <echo msg="${absfilename}" />
    </target>
</project>