wpsinc/wps-php-sdk
最新稳定版本:0.0.3
Composer 安装命令:
composer require wpsinc/wps-php-sdk
包简介
The official PHP SDK for the WPS API
README 文档
README
This is a simple PHP Client that can connect to the WPS API. This package was developed to be used with Laravel 5.1 but can also be used stand alone as well.
Installation
Just add this to your composer.json and then run composer update
"wpsinc/wps-php-sdk": "dev-master"
You can also simply add it like this
composer require "wpsinc/wps-php-sdk:dev-master"
Laravel Setup
This sdk comes with support for Laravel 5.1. This includes a service provider as well as a facade for easy access. Once this package is pulled into your project just add this to your config/app.php file.
'providers' => [
...
\Wps\WpsServiceProvider::class,
],
and then add the facade to your aliases array
'aliases' => [
...
'Wps' => \Wps\Facades\Wps::class,
],
Configuration
If you are using Laravel then add a teamwork array to your config/services.php file
...
'wps' => [
'base_uri'=>env('WPS_BASE_URI'),
'username'=>env('WPS_USER'),
'password'=>env('WPS_PASS'),
],
Use
If you are using the Facade with Laravel you can easily access WPS like this
Wps::product()->all();
Configuration Without Laravel
If you are not using Laravel you can instantiate the class like this
require "vendor/autoload.php";
use Wps\Sdk;
$wps = new Sdk([
'auth' => ['username', 'password']
]);
$wps->product()->all();
View the tests for other examples as the documentation continues to be developed.
统计信息
- 总下载量: 942
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-06-23