PHPackages                             sn01615/api-gateway-sign-php - 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. [API Development](/categories/api)
4. /
5. sn01615/api-gateway-sign-php

ActiveLibrary[API Development](/categories/api)

sn01615/api-gateway-sign-php
============================

aliyun api gateway request signature demo by php

v1.0(6y ago)028Apache-2.0PHP

Since May 8Pushed 6y agoCompare

[ Source](https://github.com/sn01615/api-gateway-demo-sign-php)[ Packagist](https://packagist.org/packages/sn01615/api-gateway-sign-php)[ RSS](/packages/sn01615-api-gateway-sign-php/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)DependenciesVersions (2)Used By (0)

api-gateway-demo-sign-php
=========================

[](#api-gateway-demo-sign-php)

aliyun api gateway request signature demo by php

智能认证U-Verify SDK

官方的Demo不是Compoer的包，故做成了Compoer的包

安装方法:

```
composer require sn01615/api-gateway-sign-php

```

使用方法：

```
use Aliyun\ApiGatewaySign\Constant\ContentType;
use Aliyun\ApiGatewaySign\Constant\HttpHeader;
use Aliyun\ApiGatewaySign\Constant\HttpMethod;
use Aliyun\ApiGatewaySign\Constant\SystemHeader;
use Aliyun\ApiGatewaySign\Http\HttpClient;

 //域名后、query前的部分
        $path = "/api/v1/mobile/info";
        $request = new \Aliyun\ApiGatewaySign\Http\HttpRequest(
            'https://verify5.market.alicloudapi.com',
            $path, HttpMethod::POST,
            '11111111', # TODO 修改为阿里云参数
            'xxxxxxxxxxxxxxxxx' # TODO 修改为阿里云参数
            );
        //传入内容是json格式的字符串
        $bodyContent = '{
	"token":"1234"
}';

        //设定Content-Type，根据服务器端接受的值来设置
        $request->setHeader(HttpHeader::HTTP_HEADER_CONTENT_TYPE, ContentType::CONTENT_TYPE_JSON);

        //设定Accept，根据服务器端接受的值来设置
        $request->setHeader(HttpHeader::HTTP_HEADER_ACCEPT, ContentType::CONTENT_TYPE_JSON);
        //如果是调用测试环境请设置
        //$request->setHeader(SystemHeader::X_CA_STAG, "TEST");

        //注意：业务header部分，如果没有则无此行(如果有中文，请做Utf8ToIso88591处理)
        //mb_convert_encoding("headervalue2中文", "ISO-8859-1", "UTF-8");
//		$request->setHeader("b-header2", "headervalue2");
//		$request->setHeader("a-header1", "headervalue1");

        //注意：业务query部分，如果没有则无此行；请不要、不要、不要做UrlEncode处理
        $request->setQuery("appkey", "xxxxxxxxx"); # TODO 修改为友盟参数
//		$request->setQuery("a-query1", "queryvalue1");

        //注意：业务body部分，不能设置key值，只能有value
        if (0 < strlen($bodyContent)) {
            $request->setHeader(HttpHeader::HTTP_HEADER_CONTENT_MD5, base64_encode(md5($bodyContent, true)));
            $request->setBodyString($bodyContent);
        }

        //指定参与签名的header
        $request->setSignHeader(SystemHeader::X_CA_TIMESTAMP);
//		$request->setSignHeader("a-header1");
//		$request->setSignHeader("b-header2");

        $response = HttpClient::execute($request);
        print_r($response->getBody());
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

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

Unknown

Total

1

Last Release

2196d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6fd6cb8950d77fdebcef7c1cd1eac849e5610deddf19aa539f76b371ccaee152?d=identicon)[sn01615](/maintainers/sn01615)

---

Top Contributors

[![sn01615](https://avatars.githubusercontent.com/u/7794149?v=4)](https://github.com/sn01615 "sn01615 (2 commits)")[![conan425](https://avatars.githubusercontent.com/u/20337848?v=4)](https://github.com/conan425 "conan425 (1 commits)")

---

Tags

u-verify

### Embed Badge

![Health badge](/badges/sn01615-api-gateway-sign-php/health.svg)

```
[![Health](https://phpackages.com/badges/sn01615-api-gateway-sign-php/health.svg)](https://phpackages.com/packages/sn01615-api-gateway-sign-php)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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