Publishing Packages

  杨宗威   2018-11-16 10:47:31  0  391  
关注 喜欢 鲜花 收藏 评论

Define Your Package

Put a file named composer.json at the root of your package's repository, containing this information:

{
    "name": "your-vendor-name/package-name",
    "description": "A short description of what your package does",
    "require": {
        "php": "^5.3.3 || ^7.0",
        "another-vendor/package": "1.*"
    }
}

This is the strictly minimal information you have to give.

For more details about package naming and the fields you can use to document your package better, see the about page.

Commit The File

Add the composer.json to your git or other VCS repository and commit it.

Publish It

Login or register on this site, then hit the submit button in the menu.

Once you entered your public repository URL in there, your package will be automatically crawled periodically. You just have to make sure you keep the composer.json file up to date.

Sharing Private Code

Use Private Packagist if you want to share private code as a Composer package with colleagues or customers without publishing it for everyone on Packagist.org. Private Packagist allows you to manage your own private Composer repository with per-user authentication, team management and integration in version control systems.


评论
请先登录后再发布评论
全部评论