Ground Sunlight

Windowsで作る - PHPプログラミングの開発環境

ユーザ用ツール

サイト用ツール


packagist:publish

文書の過去の版を表示しています。



Warning: Undefined array key "ol" in /home/soffice/y2sunlight.com/public_html/ground/lib/plugins/extlist/syntax.php on line 185

Warning: Undefined array key "num" in /home/soffice/y2sunlight.com/public_html/ground/lib/plugins/extlist/syntax.php on line 276

Warning: Undefined array key "num" in /home/soffice/y2sunlight.com/public_html/ground/lib/plugins/extlist/syntax.php on line 278

Warning: Undefined array key "ol" in /home/soffice/y2sunlight.com/public_html/ground/lib/plugins/extlist/syntax.php on line 185

Warning: Undefined array key "num" in /home/soffice/y2sunlight.com/public_html/ground/lib/plugins/extlist/syntax.php on line 276

Warning: Undefined array key "num" in /home/soffice/y2sunlight.com/public_html/ground/lib/plugins/extlist/syntax.php on line 278

Warning: Undefined array key "ol" in /home/soffice/y2sunlight.com/public_html/ground/lib/plugins/extlist/syntax.php on line 185

Warning: Undefined array key "num" in /home/soffice/y2sunlight.com/public_html/ground/lib/plugins/extlist/syntax.php on line 276

Warning: Undefined array key "num" in /home/soffice/y2sunlight.com/public_html/ground/lib/plugins/extlist/syntax.php on line 278

Warning: Undefined array key "ol" in /home/soffice/y2sunlight.com/public_html/ground/lib/plugins/extlist/syntax.php on line 185

Warning: Undefined array key "num" in /home/soffice/y2sunlight.com/public_html/ground/lib/plugins/extlist/syntax.php on line 276

Warning: Undefined array key "num" in /home/soffice/y2sunlight.com/public_html/ground/lib/plugins/extlist/syntax.php on line 278

Warning: Undefined array key "ol" in /home/soffice/y2sunlight.com/public_html/ground/lib/plugins/extlist/syntax.php on line 185

Warning: Undefined array key "ol" in /home/soffice/y2sunlight.com/public_html/ground/lib/plugins/extlist/syntax.php on line 185

Warning: Undefined array key "num" in /home/soffice/y2sunlight.com/public_html/ground/lib/plugins/extlist/syntax.php on line 276

Warning: Undefined array key "num" in /home/soffice/y2sunlight.com/public_html/ground/lib/plugins/extlist/syntax.php on line 278

Warning: Undefined array key "ol" in /home/soffice/y2sunlight.com/public_html/ground/lib/plugins/extlist/syntax.php on line 185

Warning: Undefined array key "num" in /home/soffice/y2sunlight.com/public_html/ground/lib/plugins/extlist/syntax.php on line 276

Warning: Undefined array key "num" in /home/soffice/y2sunlight.com/public_html/ground/lib/plugins/extlist/syntax.php on line 278

Warning: Undefined array key "ol" in /home/soffice/y2sunlight.com/public_html/ground/lib/plugins/extlist/syntax.php on line 185
編集中

Packagist パッケージの登録方法

— y2sunlight 2020-07-13

Packagist に戻る

本章では、Packagistでのパッケージの登録方法を Apricot を例に説明します。本章の前提条件としては以下が必要になります。

また、Composerによるプロジェクトの作成方法についても言及します。

関連記事

リンク


パッケージの提出

Packagistにログインして、画面右上のメニュー[Submit]をクリックします。

■ [Repository URL]を入力します。
(ここでは例として、https://github.com/y2sunlight/apricot を入力しています)
■ [Check]ボタンを押して下さい。

■ Repository URLからリポジトリが正しく見つかった時は上の画面が表示されます。
■ [Submit]ボタンを押して下さい。

■ Submitが終了すると画面が変わり、リポジトリのクロールが開始されます。
(その間 [Update]ボタンが風車の表示になります)
■ クロールが終了すると上画面のようになります。


GitHubとの連携

本編「Packagist アカウントの作成」で説明したようにgithubと接続していれば、パッケージはGitHubにプッシュ後に即座に更新されます。GitHub側でリポジトリ毎にWebhookを手動で構成する必要はありません。

GitHub側でリポジトリ毎にPackagistと連携をしたい場合

Packagist側でgithubと接続しておらず、リポジトリ毎に連携をしたい場合は以下の手順に従って下さい:

  1. PackagistのProfile画面からAPI Tokenを取得します。
  2. GitHubのリポジトリの[Settints]画面の左サイドから[Webhooks]を選択します。
  3. 上記の[Payload URL], [Content type], [Secret]を入力します。
  4. [Which events would you like to trigger this webhook?] に対して [Just the push event] を選択します。
  5. [Active]にチェックして、[Add webhook]ボタンを押して下さい。


Composerによるプロジェクトの作成方法

Apricotを例に composerコマンドでパッケージを取得する方法について説明します。composer install などのcomposer.jsonに基づく使い方については、本編の「composer:1.9:command-list|Composer コマンド一覧」を参照して下さい。

パッケージの検索

composer search コマンドを使用すると、パッケージリポジトリ(packagist)を検索できます。このコマンドでは検索ワードが使用でき、スペース区切りによるAND検索もできます。

php composer.phar search apricot
php composer.phar search y2sunlight apricot  # AND検索

プロジェクトの作成

composer create-project コマンドを使用すると、Composerを使用して、既存のパッケージから新しいプロジェクトを作成できます。

composer create-project y2sunlight/apricot project1             # 最新のパッケージをproject1フォルダに作成する
composer create-project y2sunlight/apricot:dev-master project1  # ブランチ(master)を指定する    
composer create-project y2sunlight/apricot:v1.0.0 project1      # タグを指定する
composer create-project y2sunlight/apricot project1 "1.1.*"     # バージョン番号を指定する
  • プロジェクトフォルダ(上例では project1)を省略するとリポジトリ名と同じ名前でプロフェクトフォルダが作成されます。

composer create-project コマンドは、以下の事を手動でするのと同じです:

  1. cd project1
  2. composer install

これにはいくつかの用途があります。

  • アプリケーションパッケージを展開できます。
  • たとえば、パッケージをチェックアウトして、パッチの開発を開始できます。
  • 複数の開発者がいるプロジェクトは、この機能を使用して、開発用の初期アプリケーションをブートストラップできます。


packagist/publish.1594867357.txt.gz · 最終更新: by y2sunlight