search
HomePHP FrameworkThinkPHPExample record: Problems using Topsdk\Topapi in ThinkPhp5.1

The followingthinkphp frameworkThe tutorial column will introduce to you the problems of using Topsdk\Topapi in ThinkPhp5.1. I hope it will be helpful to friends in need!

Remember that tp5.1 uses Topsdk\Topapi (to connect with Taobao open platform)

#1. The company has a project that needs to be connected to Taobao open platform. First, apply for an account, create an application and download it. Corresponding SDK;

Taobao will generate the corresponding api interface SDK according to the corresponding application permissions. You may need the ability of a certain interface, but there is no corresponding class in the SDK, so you must first apply for the corresponding interface permissions;

2. After downloading it directly (without using composer), it was not easy to put it in the vendor directory and use the vendor function to import it. Later, I found that the vendor function has been abandoned in tp5.1, and the loader class was not easy to use.

2.1 Direct download is as shown in the figure

Example record: Problems using Topsdk\Topapi in ThinkPhp5.1

#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

Add the Topsdk\Topapinq package to composer.json in the project (you can find a new tp5.1 for testing first) as shown in the figure

Example record: Problems using Topsdk\Topapi in ThinkPhp5.1

5. Open the command line and execute composer install or update

Create a controller test

Example record: Problems using Topsdk\Topapi in ThinkPhp5.1

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. Modify the file class name

Example record: Problems using Topsdk\Topapi in ThinkPhp5.1

9. Other pitfalls in the document examples may be related to The SDK code is inconsistent, you can modify it yourself

Recommended study: "thinkPHP Video Tutorial"

The above is the detailed content of Example record: Problems using Topsdk\Topapi in ThinkPhp5.1. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:learnku. If there is any infringement, please contact admin@php.cn delete

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Article

Hot Tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

DVWA

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