Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9253173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:09:04+00:00 2026-06-18T11:09:04+00:00

How can I use Ant to execute each php file in a directory? The

  • 0

How can I use Ant to execute each php file in a directory? The output for the php execution should overwrite the original file.

The directory is on a localhost webserver with php installed. I assume the solution would involve GET and have src point to the http equivalent of each file.

Some dynamic version of
c:/webroot/php/file1.php
c:/webroot/php/file2.php

translate into
get src=”localhost/php/file1.php”
get src=”localhost/php/file2.php”

and then have the output overwrite itself.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T11:09:06+00:00Added an answer on June 18, 2026 at 11:09 am

    Why not use the php command line combined with the ANT apply task?

    Something like:

    <apply executable="C:\PHP5\php.exe">
        <arg value="-f"/>
        <fileset dir="c:/webroot/php" includes="*.php"/>
    </apply>
    

    It’s not clear to me why you want to overwrite your source files….

    Update

    Alternatively use an embedded groovy script

    <fileset id="phpfiles" dir="c:/webroot/php" includes="*.php"/>
    
    <groovy>
       project.references.phpfiles.each {
          def file = new File(it.toString())
          ant.get(src:"http://localhost/php/${file.name}", dest:"output/${file.name}")
       }
    </groovy>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can use this maven plugin maven-jaxb-plugin to generate Java Classes from XSD file.
We can use solr range query like: http://localhost:8983/solr/select?q=queryStr&fq=x:[10 TO 100] AND y:[20 TO 300]
Basically what I've asked in the title. How can I use the Ant symlink
in Ant I want to execute a Java task on a fileset. I use
I try to parse a ini file into properties which I can use in
I got solution for ant but how can I execute DOS command through maven
How can I use Ant to download and unpack java jars while only specifying
I want to execute ANT delete target, so that I can delete all files
I understand that we can use the filter ant task to pick up tokens
I know I can use a combination of ant & flex ant tasks for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.