1.mkdir App && CD app
2.composer Init
3.VI Composer.json
{ "name": "yourname/yourpro", "description": "desc", "authors": [{ "name": "yourname", "email": "yourname@gmail.com" }], "require": {}, "autoload": { "classmap": [ "lib/" ] }}
4. Create a git library Yourname/yourpro
5.git Remote Add Origin Git@github.com:yourname/yourpro set public key skipped
5.git add .&& git commit-am "init" && git pull orgin master && git push orgin master
6. Create Tag composer package version from Git branch and tag, branch represents dev version (except master), tag stands for stable version
7.git Tag 1.0 && git push Origin--tags
8. Login https://packagist.org/Click Submit in the top corner of the Git repository address
9. Add GitHub Service Hook domain to the address of packagist
10. Installation Library composer require ' yourname/yourpro:1.0.0
If there is an error, perform composer update nothing:
Potential causes: - A typo in the package name - The package is not available in a stable-enough version according to your minimum-stability setting see
for more details.
The above describes the creation of the Packagist Composer Library, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.