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

What is the concept of extending the package source repository in a computer?

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article will explain in detail what is the concept of the extended package source warehouse in the computer. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Concept

Before we can understand the different types of repositories that already exist, we need to understand some of the basic concepts of Composer builds.

Bag

Composer is a dependency manager. It can install the package locally. The essence of a package is a directory that contains a series of source files. In general, the files in a package are mainly a bunch of PHP code files, but in theory a package can include any type of file, one of which is the file in the package that describes the name and version information of the package. The name and version are the unique identities of the package.

In fact, Composer internally believes that each version is a separate package, which is not important when using Composer to manage dependencies, but it is important when you want to change something in the package or when you make some custom options.

In addition, in addition to name and version information, there is also some other useful metadata. The most relevant information when installing a package is the definition of the package source, which is used to tell where to get the actual contents of the package. There are two sources: dist and source.

Dist: the package from dist is a packaged distribution. It is usually a stable version that has been released.

Source: packages from source sources are often used for development. It is usually a source code repository, such as git. When you want to modify the downloaded package, you can choose to use this source.

The package can provide any source option, or both. The final choice depends on some factors, such as the specified options provided by the user and the stability identification of the package.

Warehouse

The warehouse is the source of the bag. It provides a list of packages and versions. Composer looks through all the warehouse sources defined in your configuration to find and introduce the packages you need in your project.

Composer uses Packagist as the repository for global default lookups. Of course, you can also add additional warehouse source configuration to your project configuration file, composer.json.

All the configuration information for the warehouse source is only valid in the source package (root package), and the configuration information for the warehouse source in the package relied on in the package will no longer be used by Composer as the basis for finding the target warehouse of the package. You can read FAQ entry for more specific reasons.

This is the end of the article on "what is the concept of the extended package source warehouse in the computer". I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, please share it for more people to see.

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