Help us understand the problem. What is going on with this article?

Codeigniter3.0の翻訳ファイルをComposerでお手軽に自動化

More than 3 years have passed since last update.

通常Composerで、Projectタイプをインストールする時には
php composer.phar create-project "codeigniter/framework:3.0"
以上のようにしますが、これはCodeigniter3.0がComposerに対応しているからこそ簡単にできるわけです。

そして、Codeigniter3.0の公式翻訳ファイルはcomposer.json作られてないので、インストールもちょっと面倒なんですよね。

そこで、半ば強引に対応させて、ダウンロードもファイルのインストールもComposerで、やってみました。

本体のインストール後、composer.json作成

以下のcomposer.jsonを作成して、php composer.phar update

composer.json
{
    "repositories": [
        {
            "type":"package",
            "package": {
                "name": "bcit-ci/codeigniter3-translations",
                "version": "3.0.0",
                "source": {
                    "url": "https://github.com/bcit-ci/codeigniter3-translations",
                    "type": "git",
                    "reference": "3.0.0"
                }
            }
        }
    ],
    "require": {
        "bcit-ci/codeigniter3-translations": "3.0.0"
    },
    "scripts": {
        "pre-autoload-dump": [
            "mkdir -p system/language/japanese",
            "rm -Rf system/language/japanese",
            "cp -Rf vendor/bcit-ci/codeigniter3-translations/language/japanese system/language/"
        ]
    }
}

すると、翻訳ファイルがCloneされ、scriptのシェルコマンドによりlanguage/japaneseパッケージだけが、system/language/へcopyされます。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away