1.mkdir app && cd app
2.composer init
3.vi composer.json
<code>{
"name": "yourname/yourpro",
"description": "desc",
"authors": [{
"name": "yourname",
"email": "yourname@gmail.com"
}],
"require": {},
"autoload": {
"classmap": [
"lib/"
]
}
}</code>4.创建git库yourname/yourpro
5.git remote add origin git@github.com:yourname/yourpro 设置公钥略过
5.git add .&& git commit -am "init" && git pull orgin master && git push orgin master
6.创建tag composer包版本来自于git分支和tag,分支代表dev版本(除master外),tag代表stable版本
7.git tag 1.0 && git push origin --tags
8.登录https://packagist.org/ 点击由上角的submit提交git仓库的地址
9.添加 GitHub Service Hook domain 指向packagist的地址

10.安装库 composer require 'yourname/yourpro:1.0.0
如果报错,执行composer update nothing:
<code>Potential causes: - A typo in the package name - The package is not available in a stable-enough version according to your min imum-stability setting see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> f or more details.</code>
以上就介绍了创建packagist composer库,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号