<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ##一 前言 因為最近自己還有同事大家在開發過程中,積累了不少質量比較高而且比較實用的代碼,這些代碼都是經過幾年的打磨才出來的,有的幾十行甚至上百行,每次項目需要用到這些代碼的時候,總不能走到哪,拷到哪,于是打算上傳到github上,湊巧項目中用到了composer,那么就直接把這個打成一個Composer包,在這里記錄一下這個過程,以后用到回來翻翻,作為一個web開發者,每天打交道的東西有數,有些東西長期不碰難免會忘,特別是一些偏運維的東西,甚至是命令或者一些高數理論,好記性不如爛筆頭,記錄一下還是比較好的,順便分享給需要他的人。 ##二 準備 : 注冊[github](https://github.com/)賬號,注冊 [Packagist](https://packagist.org/) 賬號 ##三 github 創建倉庫 ![](https://img.kancloud.cn/3d/73/3d73ee74d45394b84dd1ef471494a3b9_800x311.png) ![](https://img.kancloud.cn/29/34/293497ac3ed17d28d859fa266a17cebb_800x382.png) ##四 將代碼克隆到本地 $ git clone https://github.com/xxxx/xxxx.git ![](https://img.kancloud.cn/85/ab/85ab8570d1dc9a3cd9a770f9b73016c7_561x137.png) ##五 創建 Composer 配置文件 進入項目根目錄,創建 Composer 配置文件 composer.json,可以使用命令 compser init 創建也可以手動創建,最終文件內容大體如下: ``` { "name": "xxx/xxx", "description": "xxxx", "authors": [ { "name": "xxxx" } ], "require": { "php": ">=7.0" }, "autoload": { "psr-4": { "xxxx": "xxxx" } } } ``` .getignore文件編輯一下 ``` /vendor/ .idea composer.lock ``` ## 六 發布包到 Packagist 登錄 Packagist,檢出 https://github.com/xxxxx/xxx.git 倉庫的代碼,系統會根據倉庫中 composer.json 文件自動設置包的相關信息。 ![](https://img.kancloud.cn/94/b5/94b51e67c54e55c6d75a394c1dbd5c03_800x235.png) 5. 設置 Packagist 中的包自動更新 如果不設置自動同步,每次 Github 中的代碼更新,需要在對應包中手動更新,所以建議設置自動更新。 官方文檔如下[how-to-update-packages](https://packagist.org/about#how-to-update-packages) 根據文檔第一步 如果您已經有一個未連接到GitHub的帳戶,您可以在您的個人資料上連接它 [connect it on your profile][4](https://packagist.org/profile/edit) ![](https://img.kancloud.cn/09/9f/099fe40bb29408984be5662e70436e54_800x370.png) 根據文檔第二步 看一下 github 與 Packagist連接 ![](https://img.kancloud.cn/96/df/96df1008b9b7e02852733bfa1285c47d_800x308.png) 已經設置自動更新 ![](https://img.kancloud.cn/2c/1e/2c1efce369dcaaca37c3627a5e8daffe_800x347.png)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看