build PHP with ant scripts

后端 未结 4 1133
天命终不由人
天命终不由人 2021-02-14 01:38

I was just wondering how I use Ant to build my web applications that I have written in PHP? I\'ve googled around a bit and I have seen that it is possible but there are not any

4条回答
  •  没有蜡笔的小新
    2021-02-14 02:28

    While Ant itself is written in java, you can use it to build any kind of applications you want. Here's a basic tutorial and a full manual. Beyond that, you need to clarify what is it you want to do to get a more precise answer here.

    Update (based on question clarifications):

    Copying / moving files / folders is easy via Ant. Look through the "Hello World" tutorial I've linked above and Familiarize yourself with FileSet concept and Copy, Mkdir and Move tasks to get started. Here's another tutorial that shows how to set up a basic build (ignore java-specific stuff like javac/war).

    Making changes to the database is an entirely different subject. If you have 'alter' scripts ready, you can use Ant's Exec task to invoke your DB's command-line client to run those scripts (though I probably wouldn't do it in production). If you want to use Ant to track those changes, then you're looking at the wrong tool. Liquibase can be used to do that and it seems to be getting a lot of traction lately. It's quite like Ant in the sense that it's written in Java but can be used in any environment. I'm no PHP expert so I wouldn't know if there's something more PHP-geared available.

提交回复
热议问题