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庫yourname/yourpro
5.git remote add origin 建立git庫略過
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的地址
如果報錯,執行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教程有興趣的朋友有所幫助。
🎜 🎜