php composer工具高速使用教程,超級簡單

來源:互聯網
上載者:User

標籤:http   tco   targe   tom   rar   nbsp   自己   版本   ati   

php依賴管理工具。用於處理packages或者libraries。基於單個工程project,在project的vender目錄下儲存,預設永遠不會全域安裝。須要php 5.3.2+,安裝資源套件時須要git,svn或者hg。


1、下載composer.phar到你的專案檔夾下,是項目打包檔案,裡面有AutoloadGenerator。ClassMapGenerator等。https://getcomposer.org/download/,可在Manual Download以下直接下載,或者使用命令
curl -sS https://getcomposer.org/installer | php
2、執行php composer.phar,能夠得到composer的版本號碼資訊,及一些命令3、建立composer.json檔案,在裡面聲明依賴關係。和npm有點類似4、使用命令composer.install,下載依賴包,一般在vender檔案夾下,並產生composer.lock檔案,此檔案用於鎖定依賴包版本號碼。當 composer.lock 檔案存在的時候, 運行 composer install 命令時, composer 會更新依照 composer.lock 裡的 package 指定版本號碼進行安裝, 假設是運行composer update 的話, 會更新 package版本號碼, 並更新 composer.lock檔案。

5、composer有自己主動載入機制,使用時直接引入require‘vendor/autoload.php‘;6、http://docs.phpcomposer.com/00-intro.html中文文檔     https://getcomposer.org/官網7、包下載一般須要FQ的。使用vpn或者http://my.oschina.net/u/248080/blog/378825建議買個vpn,不貴。

php composer工具高速使用教程,超級簡單

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.