PHPackages                             haokeed/aliyun-green - 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. [Security](/categories/security)
4. /
5. haokeed/aliyun-green

ActiveLibrary[Security](/categories/security)

haokeed/aliyun-green
====================

扩展类库：基于Aliyun的内容安全扩展

1.2(6y ago)013MITPHP

Since Nov 22Pushed 6y ago1 watchersCompare

[ Source](https://github.com/haokeed/aliyun-green)[ Packagist](https://packagist.org/packages/haokeed/aliyun-green)[ RSS](/packages/haokeed-aliyun-green/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

阿里云Green内容安全扩展
==============

[](#阿里云green内容安全扩展)

PhalApi 2.x扩展类库，基于Aliyun的内容安全扩展。

安装和配置
-----

[](#安装和配置)

执行`composer require haokeed/aliyun-green`。

安装成功后，将config文件夹下的aliyun\_green.php文件复制到项目的config目录下面,然后进行设置：

```
return array(
    /**
     * 相关配置
     */
    'AliyunGreen' => array(
        'accessKeyId' => '',
        'accessKeySecret' => '',
        'regionId' => 'cn-hangzhou',
        #  允许通过的文本
        #  normal：正常文本 spam：含垃圾信息 ad：广告 politics：涉政 terrorism：暴恐 abuse：辱骂 porn：色情 flood：灌水 contraband：违禁 meaningless：无意义 customized：自定义（例如命中自定义关键词）
        #  这里填写正常文本之外的值
        'text_allow_labels' => [],
        #  允许通过的图片
        /**
         * 图片智能鉴黄    识别图片中的色情内容。    porn [normal：正常图片，无色情内容 sexy：性感图片 porn：色情图片]
         * 图片暴恐涉政识别    识别图片中的暴恐涉政内容。    terrorism [normal：正常图片 bloody：血腥 explosion：爆炸烟光 outfit：特殊装束 logo：特殊标识 weapon：武器 politics：涉政 violence ： 打斗 crowd：聚众 parade：游行 carcrash：车祸现场 flag：旗帜 location：地标 others：其他
         * 图文违规识别    识别图片中的广告以及文字违规信息。    ad [normal：正常图片 politics：文字含涉政内容 porn：文字含涉黄内容 abuse：文字含辱骂内容 terrorism：文字含暴恐内容 contraband：文字含违禁内容 spam：文字含其他垃圾内容 npx：牛皮藓广告 qrcode：包含二维码 programCode：包含小程序码 ad：其他广告]
         * 图片二维码识别    识别图片中的二维码。    qrcode [normal：正常图片 qrcode：含二维码的图片 programCode：含小程序码的图片]
         * 图片不良场景识别    识别直播或视频中出现的黑屏、黑边、昏暗画面，画中画，抽烟，打架等不良场景图片。    live [normal：正常图片 meaningless：无意义图片 PIP：画中画 smoking：吸烟 drivelive：车内直播]
         * 图片logo识别    识别图片中的logo信息，例如台标，商标等。    logo [normal：正常图片 TV：带有管控logo的图片 trademark：商标]
         */
        'image_allow_labels' => [
            //'porn',
            //'porn.',
            //'porn.sexy',
        ],
    ),
);
```

并根据自己的情况修改填充。

注册
--

[](#注册)

在/application/provider.php文件中，注册：

```
return [
    'contentgreen'      =>\Haokeed\AliyunGreen\Think51Provider::class
];
```

使用
--

[](#使用)

使用方式：

```
  // 简易文本检测结果  直接返回bool
  app('contentgreen')->simpleTextScan('测试内容');
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Every ~3 days

Total

3

Last Release

2357d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20221245?v=4)[haokeed](/maintainers/haokeed)[@haokeed](https://github.com/haokeed)

---

Top Contributors

[![haokeed](https://avatars.githubusercontent.com/u/20221245?v=4)](https://github.com/haokeed "haokeed (4 commits)")

### Embed Badge

![Health badge](/badges/haokeed-aliyun-green/health.svg)

```
[![Health](https://phpackages.com/badges/haokeed-aliyun-green/health.svg)](https://phpackages.com/packages/haokeed-aliyun-green)
```

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[roave/security-advisories

Prevents installation of composer packages with known security vulnerabilities: no API, simply require it

2.9k97.3M6.4k](/packages/roave-security-advisories)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

86917.5M63](/packages/bjeavons-zxcvbn-php)[illuminate/encryption

The Illuminate Encryption package.

9229.7M280](/packages/illuminate-encryption)

PHPackages © 2026

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