用 ant 脚本构建 PHP [英] build PHP with ant scripts

查看:52
本文介绍了用 ant 脚本构建 PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想知道如何使用 Ant 构建我用 PHP 编写的 Web 应用程序?我在谷歌上搜索了一下,我看到这是可能的,但没有任何基本思想或任何高级用途的例子.你们有人能帮我吗?

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 examples of the basic idea or any advanced use for them. Can any of you help me out?

谢谢!

推荐答案

虽然 Ant 本身是用 Java 编写的,但您可以使用它来构建您想要的任何类型的应用程序.这是一个基础教程和一个完整手册.除此之外,您需要澄清您想要做什么才能在此处获得更准确的答案.

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.

更新(基于问题澄清):

通过 Ant 可以轻松复制/移动文件/文件夹.浏览我上面链接的Hello World"教程并熟悉 FileSet 概念和复制Mkdir移动 任务以开始.这是另一个教程展示了如何设置基本构建(忽略 javac/war 等特定于 java 的东西).

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).

对数据库进行更改是一个完全不同的主题.如果您准备好alter"脚本,您可以使用 Ant 的 Exec 任务来调用您的数据库的命令行客户端来运行这些脚本(尽管我可能不会在生产中这样做).如果您想使用 Ant 来跟踪这些更改,那么您看错了工具.Liquibase 可以用来做到这一点,而且最近它似乎受到了很大的关注.它很像 Ant,因为它是用 Java 编写的,但可以在任何环境中使用.我不是 PHP 专家,所以我不知道是否有更多适用于 PHP 的东西可用.

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.

这篇关于用 ant 脚本构建 PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆