PHP 构建/集成工具:您使用它们吗?

2022-01-12 00:00:00 continuous-integration build php phing xinc

阅读 php|architect 杂志 2008 年 11 月版 其中讨论了单元测试(phpUnit),构建工具(Phing) 和持续集成 (Xinc),我受到启发,希望了解更多关于 PHP 可用的一些工具,尤其是 Phing.

After reading the "Modern PHP workflow" article in the November 2008 edition of php|architect magazine which discussed unit testing (phpUnit), build tools (Phing) and continuous integration (Xinc), I'm inspired the learn more about some of the tooling available for PHP, especially Phing.

过去,我经常通过将实时站点作为颠覆工作副本运行并简单地在生产机器上运行svn update"来部署最新版本的代码来处理到生产服务器的部署.

In the past I've often handled deployment to a production server by running the live site as a subversion working copy and simply running an "svn update" on the production box to deploy the latest version of the code.

您是否为 PHP 代码使用构建工具?您认为与直接从 subversion 部署相比,它们提供了哪些优势?我应该注意什么,或者我可能会遇到什么问题?

Do you use build tools for PHP code? What advantages you you believe they offer over deploying direct from subversion? What should I look out for, or what gotchas might I face?

推荐答案

我用过 Phing 和 Ant 并且更喜欢后者.我最初选择 Phing 是因为它是用 PHP 编写的,但老实说它不像 Ant 那样成熟.最后,拥有一个拥有庞大社区的成熟构建系统更有价值.

I have used both Phing and Ant and prefer the latter much more. I initially went with Phing due to it being written in PHP but to be honest it isn't as mature as Ant. In the end, having a mature buildsystem with a large community is worth more.

用 Ant/Phing 完成的事情:

Things done with Ant/Phing:

  1. 从基本结帐 loalize 到特定语言,确保存在依赖项(其他库、目录等)
  2. 如果有,编译模板等
  3. 将目标数据库升级到所需版本,具体取决于签出的代码版本
  4. 运行单元测试等

相关文章