简体   繁体   English

作曲家Laravel的require和require-dev依赖关系

[英]require and require-dev dependencies of composer Laravel

I have a Laravel App and I want to install require dependencies but I was wondering how does composer know whether to load dev dependencies or production dependencies? 我有一个Laravel App,我想安装需要依赖项,但是我想知道作曲家如何知道是加载开发依赖项还是生产依赖项?

just got confused by this concept so if somebody could clarify this concept for me than that would be of great help. 只是对这个概念感到困惑,因此,如果有人可以为我澄清这个概念,那将大有帮助。

The regular require dependencies are such packages that you will ALWAYS use, meaning that the framework itself (in this case Laravel), your application code and/or other 3rd party code is dependent on such packages. 常规的require依赖关系是您将始终使用的此类软件包,这意味着框架本身(在本例中为Laravel),您的应用程序代码和/或其他第三方代码均依赖于此类软件包。 These dependencies are often referred as prod dependencies since you use them in production (because without them, your app wouldn't run) 这些依赖项通常称为prod依赖项,因为您在生产中使用了它们(因为没有它们,您的应用程序将无法运行)

The require-dev dependencies are "optional", in the sense that your core application logic would run, but you would not be able to run "development" stuff, such as Unit tests ( phpunit/phpunit package) and instantiate fake data ( fzaninotto/faker ). 在您的核心应用程序逻辑可以运行的意义上, require-dev依赖项是“可选的”,但您将无法运行“开发”的东西,例如单元测试( phpunit/phpunit软件包)和实例化伪造的数据( fzaninotto/faker )。

I hope this helps! 我希望这有帮助!

When you run composer install --dev , composer installs all packages including require-dev . 运行composer install --dev ,composer将安装所有软件包,包括require-dev This is the default behaviour, exclusion of the flag would result in the same action. 这是默认行为,排除标志将导致相同的操作。

When you run composer install --no-dev , composer skips the require-dev packages. 当您运行composer install --no-dev ,composer会跳过require-dev软件包。

Also, composer will not install the require-dev package of a required package unless you specifically ask it to do so 此外,除非您明确要求,composer不会安装required软件包的require-dev软件包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Composer require-dev需要不同包中的依赖项require-dev - Composer require-dev requireing dependencies in different packages require-dev 作曲家需求开发问题 - Composer require-dev problems 作曲家将laravel 5.5更新为laravel 5.6时由于更新依赖项(包括require-dev)而挂起 - composer update laravel 5.5 to laravel 5.6 gets hangs with updating dependencies (including require-dev) 对Composer的require和require-dev的怀疑 - Doubts about require and require-dev of Composer 不推荐使用 composer require-dev 安装 phpunit? - Install phpunit with composer require-dev not recommended? Composer 仅安装 require 和 require-dev 块中的内容,而不是使用本地存储库时的依赖项 - Composer installs only what's in the require and require-dev blocks and not the dependencies when using local repository 如何将Composer依赖关系从require-dev移到require? - How to move composer dependency from require-dev to require? 如何编写器安装最新的require-dev和最低的require - How to composer install latest of require-dev and lowest for require 使用包信息加载composer存储库更新依赖关系(包括require-dev) - Loading composer repositories with package information Updating dependencies (including require-dev) 避免在生产中安装作曲家的require-dev库 - Avoid installing composer's require-dev libraries in production
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM