LoginSignup
6
6

More than 5 years have passed since last update.

composerでgithubのコードをインストール

Posted at

概要

phpのcomposerを使って、自分のコードをインストールしてみたのでメモを残しておきます。

対象のコードを作成する

[配布側のcomposer.json]

{
    "name": "{パッケージ名}",
    "description": "{説明文}",
    "keywords": ["authentication","{キーワード...}"],
    "homepage": "https://github.com/{ユーザー名}/{リポジトリ名}",
    "license": "MIT",
    "authors": [
        {
            "name": "{名前}",
            "homepage": "{ホームページのURL}"
        }
    ],
    "require": {
        "php": ">=5.6.0"
    },
    "autoload": {
        "psr-0": {
            "": "."
        }
    }
}

[インストール側のcomposer.json]

json:composer.json
{
    "require": {
        "{パッケージ名}": "{バージョン}"
    },
    "repositories": [
        {
            "type": "vcs",
            "url": "git@github.com:{ユーザー名}/{リポジトリ}.git"
        }
    ]
}

以上

6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6