Difference between require and install vs create-project in composer

后端 未结 1 1378
误落风尘
误落风尘 2020-12-03 10:33

I don\'t get how the create-project works in composer. Lets take Laravel as example.

I can install this PHP framework with the following command:

相关标签:
1条回答
  • 2020-12-03 11:03

    require will add a dependency to the composer.json file and load it into the vendor directory as you have correctly noticed.

    create-project on the other hand will clone the dependency, i.e. use the dependency as a template for a new project. Take a look at the repository behind laravel/laravel: https://github.com/laravel/laravel

    0 讨论(0)
提交回复
热议问题