In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article introduces what PHP developers must know about Composer, the content is very detailed, interested friends can refer to, hope to be helpful to you.
Composer is a very popular PHP package dependency management tool, which has replaced the PEAR package manager. It is necessary for PHP developers to master Composer.
Composer is very simple for users, with a simple command to download the required code package to the vendor directory, and then developers can introduce the package and use it.
The key is that your project definition of composer.json, you can define the project needs to rely on packages (there may be multiple), while dependent packages may rely on other packages (this is the benefit of components), these do not bother you, Composer will automatically download everything you need, it all depends on the definition of composer.json.
Composer is very transparent to users, but the idea behind it still needs to be understood, and its birth is not accidental. Thanks to the rapid development of Github, the PHP language is becoming more and more modern and classy.
To understand Composer, take a rough look at its structure:
The structure of Composer
Composer command line tool:
This understanding is relatively simple, through the user-defined Composer.json to download the code you need, if you simply use Composer, then you can master some specific commands
Autoloading code loader:
With Composer, developers can use it in a variety of ways, the key of which lies in the concept of PHP namespaces and the development of the PSR-4 standard. Composer has only developed an automatic code loader based on these two.
Github:
With Github,PHP developers can host open source code on this, and Composer's development stems from the fact that Github,Composer essentially downloads code on Github locally.
Packagist:
For users, Composer command line tools are used, so how do command line tools know how many packages can be used by users? this mainly depends on that Packagist,Packagist is a main package information repository of Composer. Package developers host specific code on Github and submit package information to Packagist, so that users can use it through Composer.
Composer queries the Packagist,Packagist according to the locally defined composer.json information and parses the Composer.json/Package.json information, and finally corresponds to the github repository. When Composer finally downloads the code, it also depends on the Composer.json on the Github repository. Here three types of composer.json are involved, and the meaning is different.
This is the end of what PHP developers must know about Composer. I hope the above content can be of some help and learn more knowledge. If you think the article is good, you can 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.