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. Create git library yourname/yourpro
5.git remote add origin git@github.com:yourname/yourpro Set the public key Skip
5.git add .&& git commit -am "init" && git pull orgin master && git push orgin master
6. Create tag composer package version comes from git branch and tag, branch represents dev version (except master) , tag represents the stable version
7.git tag 1.0 && git push origin --tags
8. Log in to https://packagist.org/ and click submit in the upper corner to submit the address of the git warehouse
9. Add GitHub Service Hook domain pointing The address of packagist
10. Install library composer require 'yourname/yourpro:1.0.0
If an error is reported, execute 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>
The above has introduced the creation of the packagist composer library, including aspects of it. I hope it will be helpful to friends who are interested in PHP tutorials.