packagist

  1. 作者QQ:67065435 QQ群:821635552

  2. 本站内容全部为作者原创,转载请注明出处!

  3. 登录https://github.com

  4. 点击“Start a project”创建一个项目

  5. 输入项目名称、描述(Description),设为public,并用README初始化这个项目

  6. 点击Create repository完成创建

  7. 进入https://github.com/space/package

  8. 点击Clone or download复制链接地址

  9. 在个人电脑下载这个项目

     git clone https://github.com/space/package.git
    
  10. 进入项目 根目录 执行

    所有选项选择默认,或者参考如下配置: 这里一定注意: name值必须是小写!!

     composer init
    
     {
       "name": "space/package",
       "type": "library",
       "description": "FastDFS client engine.",
       "keywords": [
         "DFS",
         "FastDFS"
       ],
       "homepage": "https://github.com/space/package",
       "license": "MIT",
       "support": {
         "issues": "https://github.com/space/package/issues"
       },
       "authors": [
         {
           "name": "豆包嘿嘿~",
           "email": "2233466866@qq.com",
           "homepage": "http://weibo.com/u/3215774830/home"
         }
       ],
       "require": {
         "php": ">=7.0.1"
       },
       "require-dev": [],
       "suggest": {
         "ext-fastcommon": "https://github.com/happyfish100/libfastcommon/releases",
         "ext-fastdfs_client": "https://github.com/happyfish100/fastdfs/releases"
       },
       "autoload": {
         "classmap": [
           "src/"
         ]
       }
     }
    
  11. composer.json有多种方式引入类文件

     "autoload": {
         "psr-0": {
             "Package1\\": "package1/",
             "Package2\\": "package2/"
         },
         "psr-4": {
             "Package3\\": "package3/",
             "Package4\\": "package4/"
         },
         "classmap": [
             "Package5/",
             "Package6/"
         ],
         "include-path": [
             "Package7/",
             "Package8/"
         ],
         "files": [
             "Package9/MyClass1.php",
             "Package9/MyClass2.php",
             "Package9/MyClass3.php"
         ]
     }
    
  12. 在根目录创建LICENSE,仅供参考

     Copyright (c) 2016-2017 Zhihuan Geng
    
     Permission is hereby granted, free of charge, to any person obtaining a copy
     of this software and associated documentation files (the "Software"), to deal
     in the Software without restriction, including without limitation the rights
     to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
     copies of the Software, and to permit persons to whom the Software is
     furnished to do so, subject to the following conditions:
    
     The above copyright notice and this permission notice shall be included in all
     copies or substantial portions of the Software.
    
     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
     AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
     SOFTWARE.
    
  13. 提交项目文件的更新

     git status
     git commit -a -m "更新项目"
     git checkout -b test
     git push origin test:test
    
  14. https://github.com/space/package 添加Pull request并接受提交

  15. https://github.com/space/package 点击: release->Draft a new release->publish release, 创建1.0发行版本

  16. 登录https://packagist.org,点击submit

  17. 在Repository URL输入https://github.com/space/package

  18. 点击Check检查,防止与其它项目重复,没有问题则Submit该项目

  19. 登录https://packagist.org,点击用户名->Profile->space/package

  20. 会看到你的项目没有开启自动更新,点击“GitHub Service Hook”

  21. 根据“How to update packages?”文档的提示开启更新,如看不懂英文文档,参照下面步骤

    1. https://github.com/space/package ,点击:

      1. Settings->Integrations & services->添加Packagist->Packagist
    2. 填写表单中相关的选项

      1. 其中User为https://packagist.org 用户名

      2. 其中Token为https://packagist.org 首页->用户名->Profile->中的隐藏信息,需要点击“Show API Token”显示

      3. 其中Domain为空或“https://packagist.org”

    3. 填写完成后提交表单,即可完成自动更新

  22. 尝试安装

     composer update nothing
     composer require space/package
    
  23. 官方网站

Copyright © 豆包嘿嘿~ 2012-∞ 冀ICP备17033181号 all right reserved,powered by Gitbook修订: 2020-08-19 14:05:41

results matching ""

    No results matching ""