Php composer's learning path and phpcomposer's path
The introduction of composer please see here http://docs.phpcomposer.com/00-intro.html
I will not introduce the installation process of composer. There is no difference between the installation process and other installation processes in windows. Just keep on going to the next step.
After installation, check whether the installation is successful.
Run cmd, open the command window, and enter composer-v. the following content indicates that the installation is successful:
Otherwise, an error message is displayed.
Then we need to configure it as a domestic image and enter this command:composer config -g repo.packagist composer https://packagist.phpcomposer.com
Just copy it in.
After that, let's take a look at how to import the database file:
First, create a composer. json file in the root directory of the project;
Let us know the library name and version number we introduced, first go to this website to search to view https://packagist.org/
For example, if we want to install smarty, we will search for smarty.
When it comes out, we click the first one to view the details. Because the website is abroad, it will be slow. Please wait;
Here are some usage methods for translation. I will not introduce them;
After you know the Database Name and version number, open the file you just created and enter the code:
{ "require": { "smarty/smarty": "3.1.21" }}
After that, open the command window, go to the root directory of our project, and then enter composer install
A class library is successfully installed;
You will find that there will be an additional folder in your project, and there will be a folder named smarty.
To add more class libraries, you need to add the library name and version number in composer. json as follows:
{ "require": { "smarty/smarty": "3.1.21", "monolog/monolog":"1.23.0" }}
Enter composer update in the Command window.
To delete a class library, enter composer remove smarty/smarty in the naming window.
This will delete the smarty class library.
Come here first. Thank you for watching. If you have any questions or suggestions, please leave a message for us to study together !!