Download the PHP package fangcloud/fangcloud-php-sdk without Composer

On this page you can find all versions of the php package fangcloud/fangcloud-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 fangcloud-php-sdk

亿方云PHP SDK

安装

通过composer安装(推荐)

你可以通过composer.phar安装亿方云php sdk

你也可以在已有的composer.json文件中加入亿方云php sdk的依赖

安装完成后,require composer的autoload文件以使用亿方云php sdk

通过phar安装

前往release页面下载对应版本fangcloud-php-sdk.phar文件

使用时直接require该文件

通过autoload.php安装

前往release页面下载对应版本fangcloud-php-sdk.zip压缩文件

解压后require fangcloud-autoload.php

创建应用

目前企业管理员可在企业控制台中申请开放平台应用,经平台审核通过以后会得到一组client_id和client_secret。

在使用本sdk使,用户需要使用这些信息初始化应用

其中$callbackUri是用户申请应用时必须填写的回调地址。

快速上手

API调用

其中$options为用户可配置的参数,可以参考Fangcloud\YfyClientOptions中的注释

进行授权

本sdk也包括了授权部分的操作(即如何获取access token)

使用授权码模式

本sdk提供了两个方法帮助用户简化授权码流程的交互

本sdk提供了一个web-demo帮助用户更好理解授权码模式的流程

下载本sdk源码

进入example/web-demo目录,修改YfyClientFactory.php文件,填入你注册的应用信息。

起一个php built-in server

打开http://localhost:8000以使用该demo,根据提示操作即可

需要注意,在授权码模式中,由于需要校验state参数,需要对用户生成的state参数进行存储,该操作由Fangcloud\PersistentData\PersistentDataHandler调用,PersistentDataHandler的默认实现会将state参数存入php的$_SESSION中,因此需要用户开启session,假如用户有自己的需求,则需要实现自己的PersistenDataHandler(推荐做法)。

使用密码模式

可定制化组件

PersistentDataHandler

主要用于实现state参数的存储以及读取,默认实现会将其存入php的$_SESSION中,因此需要用户开启session,假如用户有自己的需求,则需要实现自己的PersistenDataHandler(推荐做法)。

RandomStringGenerator

用于生成state参数,提供了random_bytes、mcrypt、openssl、urandom四种实现,若用户没有显示指定实现,默认会检测支持哪一种实现,优先级random_bytes>mcrypt>openssl>urandom,用户可以通过Fangcloud\RandomString\RandomStringGeneratorFactory创建指定实现的实例,并且通过option的方式传入YfyClient的构造函数。

当然,用户也可以选择自己实现RandomStringGenerator。

其他文档


All versions of fangcloud-php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5
guzzlehttp/guzzle Version ^6.2.3
firebase/php-jwt Version ^5.0
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 fangcloud/fangcloud-php-sdk contains the following files

Loading the files please wait ....