Composer

出自ProgWiki
跳至導覽 跳至搜尋

Composer,參照:『維基百科~Composer_(software)

  • Composer is a dependency manager for PHP

FAQ

安裝

$ php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
$ php -r "if (hash_file('sha384', 'composer-setup.php') === 'e5325b19b381bfd88ce90a5ddb7823406b2a38cff6bb704b0acc289a09c8128d4a8ce2bbafcd1fcbdc38666422fe2806') {   echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
$ php composer-setup.php
$ php -r "unlink('composer-setup.php');"

使用方法

#安裝套件(建立composer.json)
 $ composer require moduleName
#安裝套件(根據composer.json)
 $ composer install
#更新套件(根據composer.json)
 $ composer update
#移除套件(根據composer.json)
 $ composer remove

尋找套件