承接 ftven/sdk-common 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ftven/sdk-common

Composer 安装命令:

composer require ftven/sdk-common

包简介

SDK COMMON Classes

README 文档

README

Build Status

PHP SDK COMMON provide foundation for the native PHP API SDK for consuming FTVEN APIs.

Usage

Add the dependency in your composer.json :

...
"require": {
    ...
    "ftven/sdk-common": "1.*"
}

Then update your dependency :

$ ./composer.phar update ftven/sdk-common

Then you can use it directly in your scripts :

<?php

// ...

require_once '/path/to/vendor/autoload.php';

$sdk = new Ftven\Sdk\Sdk();

$result = $sdk->getApi('xyz')->myApiMethod();

// ...

As an alternative, you can use functions :

$result = ftven_sdk_api('xyz', 'methodName', 'arg1', 'arg2', '...');

By default, API are autoloaded from the Ftven\Sdk\Api namespace, but you can add extra namespaces :

$sdk = new Ftven\Sdk\Sdk(['My\\Other\\Namespace']);

$sdk->getApi('xyz')->...

Some APIs require that you set identities before using them :

$sdk->setIdentity(['login' => 'me', 'pass' => 'mypass']);

...

Depending on the APIs you use, multiple identities are supported (only one per APIs) :

$sdk->setIdentity([...], 'identityType1');
$sdk->setIdentity([...], 'identityType2');

By default, API calls are directed to 'prod' environment, but you can change to an other environment :

$sdk->setEnvironment('preprod');

Depending on the APIs you use, multiple environments are supported (only one per APIs) :

$sdk->setEnvironment('preprod', 'api1');
$sdk->setEnvironment('prod'); // fallback

Enjoy !

FTVEN Build Team.

统计信息

  • 总下载量: 7.47k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 17
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-07-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固