Search code examples
phpantglob

Copy file into all subfolders


I have one php.ini file that is supposed to activate PHP compression (global settings can't be set on my server). Unfortunately, the settings made in that file only apply to files in that exact same folder. In order to apply those settings to all my files in that project I need to copy that php.ini file into all subdirectories.

Now after I build my project with Ant I am looking for a solution that Ant supports...

Is there a way of doing that glob(IS_DIR)-style?


Solution

  • thanks for pointing me into the right direction!

    the target i am using now looks like this:

    <target name="enable.compression">
        <apply executable="cp">
            <arg value="php.ini" />
            <dirset dir="">
                <include name="*/**" />
            </dirset>
        </apply>
    </target>
    

    and it does excactly what it is supposed to do...

    using just <dirset dir=""> resulted in the file trying to overwrite itself because of the root directory which was included in that approach