What are differences between “php artisan dump-autoload” and “composer dump-autoload”

匿名 (未验证) 提交于 2019-12-03 01:12:01

问题:

I am pretty new to Laravel4 and Composer. While I do laravel 4 tutorials, I couldn't understand between those two commands; php artisan dump-autoload and composer dump-autoload What are difference between them ??

回答1:

Laravel's Autoload is a bit different:

1) It will in fact use Composer for some stuff

2) It will call Composer with the optimize flag

3) It will 'recompile' loads of files creating the huge bootstrap/compiled.php

4) And also will find all of your Workbench packages and composer dump-autoload them, one by one.



回答2:

composer dump-autoload

PATH vendor/composer/autoload_classmap.php 
  • Composer dump-autoload won’t download a thing.
  • It just regenerates the list of all classes that need to be included in the project (autoload_classmap.php).
  • Ideal for when you have a new class inside your project.
  • autoload_classmap.php also includes the providers in config/app.php

php artisan dump-autoload

  • It will call Composer with the optimize flag
  • It will 'recompile' loads of files creating the huge bootstrap/compiled.php


回答3:

php artisan dump-autoload was deprecated on Laravel 5, so you need to use composer dump-autoload



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!