Home > Development Tools > composer > How to use composer command to load third-party class library in vendor

How to use composer command to load third-party class library in vendor

藏色散人
Release: 2019-10-17 16:17:54
forward
3445 people have browsed it

Below, the composer usage tutorial column will introduce to you how to use the composer command to load the third-party class library in the vendor. I hope it will be helpful to friends in need!

How to use composer command to load third-party class library in vendor

1. First download the required third-party class library and place it in the vendor folder under the TP framework.

2. Provide the third-party class library SDK Write the namespace. The namespace is the name corresponding to the folder of the class library

How to use composer command to load third-party class library in vendor

3. Add the third-party class library that needs to be loaded in the composer.json file

4. Open cmd, enter the project root directory, use the composer command to load the third-party class library, and execute composer dump-autoload as follows. If successful,

How to use composer command to load third-party class library in vendor

5. Use

to directly use use to reference the required third-party class library where it is used.

You must use "sina\\": "vendor/sina" in Article 3 (sina is the namespace, vendor/sina is the corresponding file location), and the command in Article 4 can be used use to introduce, otherwise you can only use the vendor() method to introduce

The above is the detailed content of How to use composer command to load third-party class library in vendor. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:jb51.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template