初識Composer

  • 關於vendor name和project name的區別?
    • 包名(package name)包含了供應商名(vendor name)和項目名(project name)是爲了不命名衝突的
  • require包的查找順序是什麼?
    • 會先在composer.json中找到key爲repositories的值
    • 若是找不到,則會到默認的Packagist中去找
  • 分支名前面加dev是什麼意思?
    • 當你須要從VCS(Version Control System)中加載一個庫時,則須要在你的自定義分支名前面加一個"dev-"的前綴
  • 版本前面的波浪號表示什麼意思?好比~2.1
    • it means >=2.1 <3.0
  • 很重要,如何使用composer的幫助命令?
    • composer help + 命令 (composer help update)
  • require和require-dev的區別是什麼?
    • The require-dev packages are packages that aren't necessary for your project to work and shouldn't be included in the production version of your project.Typically, these are packages such as phpunit/phpunit that you would use for unit testing your project.
  • 如何去單獨更新一個pakage?
    • php composer.phar update vendor/package
相關文章
相關標籤/搜索