gpt4 book ai didi

php - 创建composer包时,我应该选择什么 "Package Type"

转载 作者:行者123 更新时间:2023-12-03 00:06:39 34 4
gpt4 key购买 nike

我正在创建我的第一个 PHP Composer 包(以下 these instructions )。我已经跑了

$ composer init

正在填写详细信息,现在要求我提供

Package Type (e.g. library, project, metapackage, composer-plugin) []:

我认为这只是一个人类可识别的标签,用于对不同的包进行分类?

我想知道某处是否有包类型的定义?

最佳答案

我发现这是发布问题:

Composer Package Types

Out of the box, Composer supports four types:

  • library: This is the default. It will simply copy the files to /vendor.

  • project: This denotes a project rather than a library. For example application shells like the Symfony standard edition, CMSs like the SilverStripe installer or full fledged applications distributed as packages.

  • metapackage: An empty package that contains requirements and will trigger their installation, but contains no files and will not write anything to the filesystem.

  • composer-plugin: A package of type composer-plugin may provide an installer for other packages that have a custom type. Only use a custom type if you need custom logic during installation.

Package types are used for custom installation logic. If you have a package that needs some special logic, you can define a custom type. This could be a symfony-bundle, a wordpress-plugin or a typo3-cms-extension. These types will all be specific to certain projects, and they will need to provide an installer capable of installing packages of that type.

来源:https://getcomposer.org/doc/04-schema.md

关于php - 创建composer包时,我应该选择什么 "Package Type",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42125598/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com