cakephpにcomposerを使う2
composerhttps://github.com/composer/composer
Sites以下にexample_appフォルダを作り、移動。
$mkdir sample_app
$cd sample_app
composerをインストール
$curl -sS https://getcomposer.org/installer | php
#!/usr/bin/env php
Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:
えらー。。
phpにoptionをつける
$curl -sS https://getcomposer.org/installer | php -d detect_unicode=off
Composer successfully installed to: Sites/example_app/composer.phar
Use it: php composer.phar
成功!
properties
*name | The name of the package. It consists of vendor name and project name, separated by /. |
---|---|
*require | packge links:All of the following take an object which maps package names to version constraints. |
*repositories | By default composer just uses the packagist repository. By specifying repositories you can get packages from elsewhere. |
*config | A set of configuration options. It is only used for projects. |
composer.jsonファイルを新規作成
$vi example_app/composer.json
{
"name": "example-app",
"repositories": [
{
"type": "pear",
"url": "http://pear.cakephp.org"
}
],
"require": {
"pear-cakephp/cakephp": ">=2.4.1"
},
"config": {
"vendor-dir": "Vendor/"
}
}<<