使用composer_使用Composer脚本进行构建自动化

使用composer

Following Alexander Cogneau’s introduction to dependency management with Composer, you now know that Composer is a resolver for managing external project dependencies and versioning constraints. But is that all it does? In this article I’ll show you how Composer can also be used as a basic build automation tool.

在Alexander Cogneau介绍了Composer的依赖关系管理之后 ,您现在知道Composer是用于管理外部项目依赖关系和版本约束的解析器。 但这就是全部吗? 在本文中,我将向您展示Composer如何也可以用作基本的构建自动化工具。

作曲家脚本 (Composer Scripts)

Any build automation tool worth its salt must provide the ability to script a range of automated tasks – from building, packaging, and running test suites, to deployment on staging and production systems. Phing, for example, is based on Ant and permits you to define such tasks in XML build files.

任何值得一试的构建自动化工具都必须具备编写一系列自动化任务的能力,这些任务从构建,打包和运行测试套件到在登台和生产系统上进行部署。 例如,Phing基于Ant,并允许您在XML构建文件中定义此类任务。

Composer differs in this regard in that it makes no assumptions as to what these tasks are, or if they are to be performed at all. What Composer does instead is expose its pre- and post- install/update/uninstall event hooks during execution which you can callback using “scripts”, much the same way that Pyrus provides the ability to define custom commands in the package.xml via the --plugin option to its install, upgrade, and uninstall commands.

Composer在这方面的不同之处在于,它不对这些任务是什么或是否要执行这些任务做出任何假设。 相反,Composer所做的是在执行期间公开其安装前和安装后/更新/卸载事件挂钩,您可以使用“脚本”进行回调,这与Pyrus通过以下方式

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值