PHPackages                             timerlau/aliyun-afs-php-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. timerlau/aliyun-afs-php-sdk

ActivePackage[Utility &amp; Helpers](/categories/utility)

timerlau/aliyun-afs-php-sdk
===========================

阿里AFS人机校验服务SDK For PHP

2.3(7y ago)1961MITPHPPHP &gt;=5.3.0

Since Aug 29Pushed 7y ago1 watchersCompare

[ Source](https://github.com/timerlau/aliyun-afs-php-sdk)[ Packagist](https://packagist.org/packages/timerlau/aliyun-afs-php-sdk)[ Docs](https://github.com/timerlau/aliyun-afs-php-sdk.git)[ RSS](/packages/timerlau-aliyun-afs-php-sdk/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (13)Used By (0)

AliyunAFS
=========

[](#aliyunafs)

阿里云人机验证服务SDK封装 for PHP

系统要求
====

[](#系统要求)

```
php >= 5.3

```

说明
==

[](#说明)

- 基于 afs的sdk开发，没有对原sdk做任何修改
- 代码可以运行在任意项目中

安装
==

[](#安装)

```
composer require timerlau/aliyun-afs-php-sdk

```

如果使用 packagist 源安装不了，请该用 github 源安装
===================================

[](#如果使用-packagist-源安装不了请该用-github-源安装)

```
{
    "repositories": {
        "packagist": {
            "type": "composer",
            "url": "https://packagist.phpcomposer.com"
        },
        "timerlau/aliyun-afs-php-sdk": {
            "type": "git",
            "url": "https://github.com/timerlau/aliyun-afs-php-sdk.git"
        }
    },
    "require": {
        "timerlau/aliyun-afs-php-sdk": "^1.0"
    }
}

```

使用
==

[](#使用)

```
use Timerlau\AliyunAfs\Afs;

// 创建配置
$config = [];
$config['app_key'] = 'xxx';
$config['app_secret'] = 'xxxx';
$config['request_api'] = 'http://xxxx/response.jsonp';
// 可选配置
$config['selector_button_class'] = 'afs_button';
$config['selector_form_class'] = 'afs_form';
$config['selector_nvc_class'] = 'afs_nvc';
$config['selector_nvc_name'] = 'afs_nvc';

// 具体都有哪些配置，可以看config/Base.php

// demo 为 config 下必须存在的类, 里面的代码对应你在阿里云服务器上创建的配置里「系统集成代码」
$afs = new Afs('demo', $config);

// 获取html代码， 此处可以使用该方法获取，也可以直接在前端写，不强求
$html = $afs->html();

// 服务端验证 （基于 Laravel 实现的返回jsonp方式）
// $request->a 为前端获取到都 vnc ，并且是通过参数 a 传递过来的
$ret = [];
$ret['result']['code'] = $afs->validate($request->a);
return response()->jsonp($request->callback, $ret);

```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity64

Established project with proven stability

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

12

Last Release

2799d ago

Major Versions

1.7 → v2.02018-09-13

### Community

Maintainers

![](https://www.gravatar.com/avatar/9f4b78adf346df1a5bb44ec3c9a2119e01c5dda632869e7f5bb14c66c6d1414c?d=identicon)[timerlau](/maintainers/timerlau)

---

Tags

sdk阿里AFS服务SDKaliyun afs php sdk

### Embed Badge

![Health badge](/badges/timerlau-aliyun-afs-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/timerlau-aliyun-afs-php-sdk/health.svg)](https://phpackages.com/packages/timerlau-aliyun-afs-php-sdk)
```

###  Alternatives

[aws/aws-crt-php

AWS Common Runtime for PHP

416300.1M4](/packages/aws-aws-crt-php)[zumba/amplitude-php

PHP SDK for Amplitude

409.5M5](/packages/zumba-amplitude-php)[ennnnny/tbk

简约优雅的淘宝客SDK

29016.1k1](/packages/ennnnny-tbk)[anilcancakir/laravel-ai-sdk-skills

A skill system for Laravel AI SDK agents. Define reusable AI capabilities with SKILL.md files.

151.1k](/packages/anilcancakir-laravel-ai-sdk-skills)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
