首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >composer dump-autoload - command

composer dump-autoload - command
EN

Stack Overflow用户
提问于 2015-02-06 09:01:39
回答 2查看 4.3K关注 0票数 3

我不理解composer dump-autoload命令的描述:

代码语言:javascript
运行
复制
If you need to update the autoloader because of new classes in a classmap package for example, you can use "dump-autoload" to do that without having to go through an install or update.
Additionally, it can dump an optimized autoloader that converts PSR-0/4 packages into classmap ones for performance reasons. In large applications with many classes, the autoloader can take up a substantial portion of every request's time. Using classmaps for everything is less convenient in development, but using this option you can still use PSR-0/4 for convenience and classmaps for performance. 

为什么上面写的是dump ... for performance reasons?为什么要转储优化的加载器?是“出于性能原因而转储”还是“出于性能原因而转换”?

如果它是“为了性能而转储”,那么为什么它会说classmaps for performance

如果是“性能转换”,为什么要丢弃自动加载器呢?

我很困惑。

EN

回答 2

Stack Overflow用户

发布于 2015-02-06 17:37:10

它转储自动加载器使用的类映射。这样,自动加载器就不需要搜索整个文件系统来找到正确的文件,它已经知道该文件了。这将节省时间。

票数 4
EN

Stack Overflow用户

发布于 2015-02-07 05:57:15

Classmap并不是在所有情况下都更快。在将其用于生产之前,要小心并衡量您将从中获得的好处。

详情请看我的答案:Why use a PSR-0 or PSR-4 autoload in composer if classmap is actually faster?

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28356893

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档