[PHP 學習筆記] 套件管理系統 Composer
Composer 是 PHP 的套件管理系統,方便你安裝、刪除,管理你的套件(package)。使用安裝(Globally (on OSX via homebrew)):
brew update
brew tap homebrew/homebrew-php
brew tap homebrew/dupes
brew tap homebrew/versions
brew install php55-intl
brew install homebrew/php/composer
故障排除:
若使用 homebrew 安裝上遇到以下問題,可以使用下列解法:
error: Your local changes to the following files would be overwritten by merge:
Library/Formula/anttweakbar.rb
Library/Formula/assimp.rb
Library/Formula/stunnel.rb
Please, commit your changes or stash them before you can merge.
Aborting
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master
在 terminal 輸入下列指令: cd `brew --prefix`
git remote add origin https://github.com/mxcl/homebrew.git
git fetch origin
git reset --hard origin/master
參考文件:
1. Easy Package Management With Composer
2. 官方網站
3. PHP 使用 Composer 管理套件、函式厙
4. Ubuntu 安裝 PHP 的 Composer
5. Composer帮你轻松管理PHP包
6. Cannot "brew update" anymore - fails to git pull formulas #11448
7. Using Composer With Codeigniter
8. Begining Composer
9. 使用 Composer 管理 PHP 套件