Home > Article > Development Tools > How to use composer command to load third-party class library in vendor
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!
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
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,
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!