This article is provided by the thinkphp tutorial column to introduce you to tp5.1 related knowledge, which mainly records how tp5.1 uses Topsdk\Topapi (docking with Taobao open platform). I hope it will be helpful to friends who need it. Helps!
1. The company has a project that needs to be connected to the Taobao open platform. First, apply for an account, create an application, and download the corresponding SDK;
Taobao will generate the corresponding api interface SDK based on the corresponding application permissions. You may need a certain If you have the ability to interface an interface, but there is no corresponding class in the sdk, you must first apply for the corresponding interface permission;
2. After downloading it directly (without using composer), it is not easy to put it in the vendor directory and use the vendor function to introduce it. , and later found that tp5.1 has abandoned the vendor function, and the loader class is not easy to use.
2.1 When downloading directly, it is as shown in the figure
#3. We want to automatically load and use the corresponding classes directly, and return to using the composer package; go to packagist.org/ Search Topsdk\Topapi; find its package version v1.1
4. Add the Topsdk\Topapinq package to composer.json in the project (you can find a new tp5.1 first) Test) As shown in the figure
5. Open the command line and execute composer install or update
6. Create a controller test
7. Test OK Delete the package just downloaded by composer (it is only for basic capability classes), and copy the package originally downloaded in the application to the vendor directory.
8. During use, it may be reported that the xxx class cannot be found. Please modify the file class name.
9. For other pitfalls, the documentation examples may be inconsistent with the SDK code. Please watch and modify it yourself
The above is the detailed content of Record how thinkphp5.1 uses Topsdk\Topapi (picture and text). For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 Chinese version
Chinese version, very easy to use

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Dreamweaver Mac version
Visual web development tools
