gpt4 book ai didi

composer-php - Composer 转储自动加载 - 命令

转载 作者:行者123 更新时间:2023-12-04 02:03:44 26 4
gpt4 key购买 nike

我不明白composer dump-autoload命令的描述:

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

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

我很困惑。

最佳答案

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

关于composer-php - Composer 转储自动加载 - 命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28356893/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com