Download the PHP package whalesky-labs/kwaishop-php-sdk without Composer

On this page you can find all versions of the php package whalesky-labs/kwaishop-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package kwaishop-php-sdk

KwaiShopSDK

KwaiShopSDK

快手电商开放平台 PHP SDK。

PHP SDK · 快手电商开放平台 · Composer 包 · API 集成

Composer

简体中文 | English


🚀 快手电商 PHP SDK - 为 PHP 开发者提供完整的快手电商 API 集成解决方案

概述

在技术蓬勃发展的当下,快手电商开放平台的 KwaiShopSDK,本应是普惠所有开发者的得力工具,涵盖快手电商相关开放能力,从 Token 获取到请求封装、响应解释,每个环节都暗藏助力高效开发的玄机。

其本地化设计,理应为开发者开辟便捷通道,无论经验如何,都能借它在 API 调用之路上畅行无阻。可现实却令人咋舌,面对 PHP 这片高手云集、活力满满的领域,官方竟然缺失 PHP 版本的 SDK!

这简直荒谬至极。PHP 开发者们为互联网立下汗马功劳,如今却像被抛弃的孩子。看着其他语言开发者仗着官方 SDK 大步快跑,自己只能徒手在荆棘中挣扎,太不公平!好比马拉松赛场,别人装备精良、补给充足,自己却赤脚前行、无水可饮。

幸有补救性 SDK,让 PHP 开发者不至于掉队,能凭本事搭起投放管理系统,但背后是他们付出的诸多额外心血。官方这种"偏心"做法,实在该反省,给 PHP 开发者们一个交代!

功能特性

使用条件

开发者条件

SDK 目录

说明:

安装

快速开始

KwaiShopClient 统一通过 new KwaiShopClient($appKey, $appSecret, $signSecret, $options) 创建。

当前 1.0.0 已完成可稳定复用的 SDK 底座,并按官方文档分类提供接口封装。

Hyperf 集成(推荐)

如果你的项目运行在 Hyperf / Swoole Coroutine 场景,建议在项目里封装一个初始化类,统一管理凭据和运行时选项,业务代码只拿现成客户端。

这样业务层只需要依赖这个工厂;如果你的 Hyperf 项目已经自行管理协程 hook 或运行时策略,可以在 options 中把 autoDetectRuntime 设为 false

运行环境

本 SDK 以 FPMSwoole Coroutine 双运行时为目标进行约束设计。

Swoole Coroutine 示例

如果你明确不希望 SDK 自动处理运行时识别,可以关闭:

认证与授权

快手电商开放平台接入时常用的核心凭据包括:

SDK 当前提供的 OAuth 能力包括:

以上方法通过 $client->oauth() 返回的 OAuth 客户端调用,例如:

如果你需要本地联调 OAuth 或功能测试,可以再结合项目中的测试脚本使用。

常见问题

1. 没有官方 PHP SDK,可以直接用于生产吗?

可以。本项目就是为 PHP 场景补齐快手电商开放平台 SDK 能力而设计,已提供签名、鉴权、请求封装、响应解析和官方接口分类封装。

2. SDK 会自动帮我申请接口权限吗?

不会。SDK 只负责接口调用封装,具体能否调用成功,取决于你的应用是否已经获得对应权限组,以及当前商家是否完成授权。

3. 所有接口都需要传 accessToken 吗?

不是。需商家授权的接口需要 accessToken,无商家授权要求的接口则按开放平台文档要求调用。推荐在初始化 Config 时传入默认 accessToken

4. SDK 会主动读取项目里的 .env 吗?

不会。.env.example.env 仅用于测试与本地联调脚本,SDK 运行时不会主动加载环境变量文件。

5. 如何确认某个接口是否已经封装?

优先到 src/Api/* 对应分类目录中检索,类名通常与官方接口名保持一致,例如 open.shop.info.get 对应 OpenShopInfoGet

贡献指南

提交规范

Pull Request 规范

发布流程

运行测试

测试目录说明:

运行默认测试集:

执行完成后会自动生成 HTML 测试报告:

运行单元测试:

运行集成测试:

运行功能测试:

运行指定测试:

代码风格检查:

说明:

开源协议

本项目基于 MIT License 开源。


All versions of kwaishop-php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-json Version *
guzzlehttp/guzzle Version ^7.9
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package whalesky-labs/kwaishop-php-sdk contains the following files

Loading the files please wait ...