Home > Backend Development > PHP Tutorial > Create packagist composer library

Create packagist composer library

WBOY
Release: 2016-07-29 09:06:55
Original
1615 people have browsed it

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>
Copy after login

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

Create packagist composer library
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>
Copy after login

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.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template