Search code examples
phpphingbuild-script

Phing copy contents of folder


I'm trying to move the contents of a folder to another destination in Phing. I can't directly download the contents from SVN, because they're in a zip. After the file is unzipped, I want to move the contents.

I found this syntax, but it doesn't work: Copy a whole directory with phing

Thanks!


Solution

  • Etiher the post you've linked is wrong or there where changes in Phing since that answer.

    Here comes a working build.xml that copies test to test2 (expect of .svn folders). The syntax is as follows:

    <?xml version="1.0" encoding="UTF-8"?>
    <project name="Hexdump" default="build">
      <target name="build">
        <copy todir="test2">
            <fileset dir="test">
                <include name="**"></include>
                <exclude name="**/.svn/**"></exclude>
            </fileset>
        </copy>
      </target>
    </project>
    

    You can refer to the Phing Core Tasks Documentation