In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you how to learn composer, I hope you will learn something after reading this article. Let's discuss it together.
I heard that you also want to learn the introduction to composer-.
As a dependency management tool, composer is used frequently. Especially for lazy programmers like me, they are determined not to repeat the wheels themselves when they have ready-made wheels. It is similar to package management tools in other programming languages, such as java's maven,js 's npm, and is very different to use.
It mainly consists of three parts: command line tools, package warehouse, code base. Package warehouse is what we often call composer source, and you can also publish your own package on it. I will introduce the release process in the following actual combat; code base, such as the more common github,gitlab, etc.; command-line tools such as windows's cmd,mac terminal, and so on.
Installation mode
There are two main ways to install composer, one is global installation, the other is local installation, the specific installation method can be Baidu or Google (if there are problems in the installation process, you can leave a message).
After the global installation, you can run the composer command anywhere with the command line tool:
> composer-V
After partial installation, you need to put the composer.phar package file in the root directory of the project where you need to run composer.
> php composer.phar-V mirror switching
The download speed of composer default image sources is often slow for some reasons. In order to improve our development efficiency, we need to switch images. It is recommended to switch images globally (Aliyun image is used in the example):
Composer config-g repos.packagist composer https://mirrors.aliyun.com/composer/
You can use the following command to see if the setting is successful:
Composer config-g-l is easy to use
The most common usage scenario for composer is to install dependency packages.
For example, daily development often needs to use the log function, at this time, it may be troublesome and time-consuming to conceive, design and implement a log function, so we will find other people's developed packages in github or some open source communities to use them directly, such as monolog/monolog.
Of course, there are others, such as SDKovertrue/wechat developed by Wechat, payment-related yansongda/pay, and so on. The specific installation methods are as follows:
> composer require monolog/monolog
Another common usage scenario is to initialize a project.
Friends who use laravel should know that when we initialize a laravel project, we often use the following command:
> composer create-project-prefer-dist laravel/laravel blog has finished reading this article. I believe you have some understanding of "how to learn composer". If you want to know more about it, please follow the industry information channel. Thank you for reading!
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.