为什么要有“build/”?包含 PHP 项目和 phing 的文件夹

发布于 2024-09-08 22:34:52 字数 396 浏览 1 评论 0原文

使用“build/”文件夹放置和“构建”所有源有什么好处?

也许这是一个愚蠢的问题,但我试图理解 PHP 的持续集成。 phing 的 build.xml 的任何示例都使用此类 build/ 文件夹,但是对于 PHP 来说,签出的项目不需要编译,只需要基本配置,这有什么意义。将其全部复制到 build/ 只会使事情变得复杂,因为您将拥有双倍的文件和 +1 文件夹到 Web 根路径(如果您希望有 Web UI 来运行 selenium 测试)

特别是我需要 phing 两个案例:
1)让新用户在工作副本上设置他的第一次安装(或更新旧的)
2)运行unit/func-tests、phpcc、phpcs、phpdoc等(通常在CI服务器上)

我应该为第二个任务使用“build/”吗? PHP 的最佳实践是什么?

What is a benefit of having "build/" folder where all the sources will be placed and "built"?

Maybe it's a silly question, but I'm trying to understand Continuous Integration with PHP. Any example of build.xml for phing uses such build/ folder, but what's a sense in that for PHP where a checked out project doesn't require a compilation, only a basic configuration. Copying it all into build/ will just complicate the things, because you'll have doubled files and +1 folder to the web root path (if you'd like to have web UI to run selenium tests on)

Particularly I need phing for two cases:
1) let new user setup his first installation (or update old), right on a working copy
2) run unit/func-tests, phpcc, phpcs, phpdoc etc (all that usually on CI server)

Should I have "build/" for the second task? What is the best practice for PHP?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

前事休说 2024-09-15 22:34:52

拥有构建目录有几个很好的理由(即部署到多个环境、执行一些文本替换、最小化和组合 CSS 和 JS、优化图像、处理配置文件等)。

但是,这些可能不适用于您的用例。没有规则说你需要这个目录。根据您对生产中测试的想法,构建目录可能是保留此目录的一个很好的理由。

There are several good reasons to have a build directory (i.e., deployment to multiple environments, performing some text replacement, minimizing and combining CSS and JS, optimizing images, handling of config files etc.)

However, these may not apply in your use cases. There is no rule saying you need this directory. Depending on your thinking on testing in production, a build directory may be a good reason to keep this directory.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文