简体   繁体   English

“php artisan dump-autoload”和“composer dump-autoload”有什么区别?

[英]What are the Differences Between “php artisan dump-autoload” and “composer dump-autoload”?

I am pretty new to Laravel 4 and Composer.我对 Laravel 4 和 Composer 很陌生。 While I do Laravel 4 tutorials, I couldn't understand the difference between those two commands;当我做 Laravel 4 教程时,我无法理解这两个命令之间的区别; php artisan dump-autoload and composer dump-autoload What's the difference between them? php artisan dump-autoloadcomposer dump-autoload什么区别?

Laravel's Autoload is a bit different: Laravel's Autoload有点不同:

  1. It will in fact use Composer for some stuff它实际上会使用Composer来处理一些stuff

  2. It will call Composer with the optimize flag它将使用优化flag调用Composer

  3. It will ' recompile ' loads of files creating the huge bootstrap/compiled.php它将“ recompile ”大量文件,创建巨大的bootstrap/compiled.php

  4. And also will find all of your Workbench packages and composer dump-autoload them, one by one.并且还会一一找到您的所有 Workbench 包和composer dump-autoload它们。

php artisan dump-autoload在 Laravel 5 上被弃用,所以你需要使用composer dump-autoload

composer dump-autoload作曲家转储自动加载

PATH vendor/composer/autoload_classmap.php
  • Composer dump-autoload won't download a thing. Composer dump-autoload不会下载任何东西。
  • It just regenerates the list of all classes that need to be included in the project ( autoload_classmap.php ).它只是重新生成需要包含在项目中的所有类的列表 ( 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 autoload_classmap.php还包括config/app.phpproviders

php artisan dump-autoload php artisan 转储自动加载

  • It will call Composer with the optimize flag它将使用优化标志调用Composer
  • It will ' recompile ' loads of files creating the huge bootstrap/compiled.php它将“ recompile ”大量文件,创建巨大的bootstrap/compiled.php

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM