自定义composer包步骤

第一步,创建git仓库,把仓库clone到本地

第二步,进入本地仓库文件夹,执行composer init

第三步,根据命令行提示,填写基本信息,如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#填写作者信息
Author [username <email@qq.com>, n to skip]: username <email@qq.com>
#定义包的稳定性,可用的稳定性标识(按字母排序):dev、alpha、beta、RC、stable
Minimum Stability []: dev
#选择包类型
Package Type (e.g. library, project, metapackage, composer-plugin) []: library
#自定义许可证
License []:
#定义包需要的依赖
Define your dependencies.

Would you like to define your dependencies (require) interactively [yes]?
#搜索需要的包
Search for a package:
#第二次确认
Would you like to define your dev dependencies (require-dev) interactively [yes]?
Search for a package:
#确认json文件的基本信息
{
    "name": "hsx9712/composer_init",
    "description": "composer_init",
    "type": "library",
    "authors": [
        {
            "name": "username",
            "email": "email@qq.com"
        }
    ],
    "minimum-stability": "dev",
    "require": {}
}
#是否确认生成
Do you confirm generation [yes]? yes
#是否把vendor文件夹放到.gitignore文件中
Would you like the vendor directory added to your .gitignore [yes]? yes

创建完成。

第四步、提交到git远程仓库

第五步,复制git地址

第六步、打开https://packagist.org/,如果没有账号,先创建账号

第七步、登录后点右上方的Submit按钮

第八步、在输入框粘贴git地址,并提交

完成

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

对这是我的昵称

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值