Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How composer can only update and load automatically

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "composer how to do only update automatic load", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "composer how to do only update automatic load" bar!

Specific problem description:

Composer only updates the autoload, not the dependency?

Psr-4 automatic loading has been added to composer.json

Then execute composer update to load the added directory

Dependency packages are always updated when update is executed

How can I just update the autoload and not update the dependency?

Solution:

Composer dump-autoload

Print auto-load index dump-autoload

In some cases you need to update autoloader, such as adding a new class to your package. You can use dump-autoload to do this without having to execute install or update commands.

In addition, it can print an index of classes that are optimized and conform to the PSR-0/4 specification, which is also for performance considerations. In large applications, there will be many kinds of files, and autoloader will take up a large part of the time of each request, so it may not be convenient to use classmaps in development, but it can still get the convenience brought by PSR-0/4 specification while ensuring performance.

Print automatically load Index-Parameter

-- optimize (- o): convert PSR-0/4 autoloading to classmap for faster loading. This is especially suitable for production environments, but it may take some time to run, so it is not currently the default setting.

-- no-dev: disable the autoload-dev rule.

Thank you for your reading, the above is "composer how to do only update automatic loading" of the content, after the study of this article, I believe you have a deeper understanding of how to do composer only update automatically load this problem, the specific use of the situation also needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report