composer.json中require-dev和require的区别

1.composer.json文件中的require和require-dev中存放的均是package

2.两者的区别在于require中所引用的包在线上线下的项目中均会使用,require-dev中的包只在本地开发的时候使用。 "require": { "php": ">=5.6.0", "topthink/framework": "5.1.*", "workerman/gatewayclient": "^3.0", "qcloudsms/qcloudsms_php": "^0.1.4", "qcloud/cos-sdk-v5": "^1.3" }, "require-dev": { "topthink/think-testing": "2.0.*" } 当只要引入require中的依赖时候执行 composer install --no-dev 二者都要引入时这不需要 --no-dev。

转载于:https://my.oschina.net/u/2291709/blog/3097556

你可能感兴趣的:(composer.json中require-dev和require的区别)