Is it possible to run Ant’s build.xml from PHP or a web page?
Sometimes BAs wants to do the build and deployment and I want to make this available via MediaWiki page.Mediawiki is running on windows XAMPP.
Are there any MediaWiki plugin or any better solution for that?
Down the line I would like to pass some build.xml variables too.
Is it possible to run Ant’s build.xml from PHP or a web page? Sometimes
Share
PHP’s shell_exec() function can be used to call a command in the shell. So you could write a simple shell script that cd’d to the right directory, set any environment variables and triggered the build, then call that from PHP:
do_build.sh (lives at /home/user/bin/do_build.sh)
myscript.php (invoked via web page)
UPDATE: Since you said that you’re on Windows, here’s the Windows-equivalent, using a batch file:
do_build.bat (lives in C:\do_build.bat)
myscript.php (invoked via web page)