composerによるcakePHPのインストール

http://book.cakephp.org/2.0/ja/installation/advanced-installation.html
composer.jsonに
{
    "name": "example-app",
    "repositories": [
        {
            "type": "pear",
            "url": "http://pear.cakephp.org"
        }
    ],
    "require": {
        "cakephp/cakephp": ">=2.4.9"
    },
    "config": {
        "vendor-dir": "Vendor/"
    }
}

あとは
$php composer.phar install
とするだけ

requireの書き方を以前
"pear-cakephp/cakephp": "2.*"
このような形でかいていたんだけど
vagrantでprovisionしたときに
Your requirements could not be resolved to an installable set of packages.

 Problem 1
 - The requested package pear-cakephp/cakephp could not be found in any version, there may be a typo in the package name.
とのエラーが出たため

requreを
"cakephp/cakephp": ">=2.4.9"
とすることで実行可能だった

 

Published by

kashioka

有限会社アリウープ 代表取締役社長 PHPユーザ会の発起人の一人。いちばんやさしいPHPの教本(インプレス),PHPハンドブック(ソフトバンククリエイティブ)著者。PHPカンファレンス実行委員 明日の開発カンファレンス開催 認定スクラムマスター。近年、PHPに限らずサーバレス環境でのPythonなども書いたりしている。 http://alleyoop.jp

%d人のブロガーが「いいね」をつけました。