PHPackages                             james.xue/ali-safe-api - 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. james.xue/ali-safe-api

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

james.xue/ali-safe-api
======================

阿里内容检测，包括文本、关键词文本检测以及对图片涉黄、暴恐、敏感检测、广告、二维码等

v2.1.3(1y ago)664.8k↓50%16[1 PRs](https://github.com/xiaoxuan6/aliyun-safe/pulls)1MITPHPCI passing

Since Jan 23Pushed 3mo agoCompare

[ Source](https://github.com/xiaoxuan6/aliyun-safe)[ Packagist](https://packagist.org/packages/james.xue/ali-safe-api)[ Docs](https://github.com/xiaoxuan6/aliyun-safe.git)[ Fund](https://james.dmzfa.com/about#pay)[ RSS](/packages/jamesxue-ali-safe-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (15)Used By (1)

AliGreen
========

[](#aligreen)

阿里内容检测服务

阿里内容检测服务封装，包括垃圾文本、关键词文本检测以及对图片涉黄、暴恐、敏感检测

### 安装：

[](#安装)

```
composer require james.xue/ali-safe-api

```

### laravel 应用

[](#laravel-应用)

发布 config

```
php artisan vendor:publish --tag=aliyun

```

### lumen 应用

[](#lumen-应用)

1. 在 `bootstrap/app.php` 中添加：

```
$app->register(\James\AliGreen\AliGreenServiceProvider::class);
```

2 如果你习惯使用 `config/aliyun.php` 来配置的话，将 `vendor/james.xue/ali-safe-api/src/config/aliyun.php` 拷贝到`项目根目录/config`目录下。

### 使用方法：

[](#使用方法)

```
前提：配置config/aliyun.php

use James\AliGreen\AliGreen;

$ali = AliGreen::getInstance();

```

\------------字符串---------------

```
$ali->checkText("约炮");

$ali->checkImg("http://nos.netease.com/yidun/2-0-0-4f903f968e6849d3930ef0f50af74fc2.jpg");

```

\------------数组---------------

文本检测

```
$textArr = array("测试", "约炮");

$ali->checkText($textArr);

```

图片检测

```
$imgArr = array("http://nos.netease.com/yidun/2-0-0-4f903f968e6849d3930ef0f50af74fc2.jpg", "http://blog.jstm365.com/images/page_bg.jpg");

$result = $ali->checkImg($imgArr);

```

### 注意事项

[](#注意事项)

只有 version`1.3.2`以后才支持`lumen`

###  Health Score

50

—

FairBetter than 96% of packages

Maintenance66

Regular maintenance activity

Popularity35

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 54.5% 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 ~207 days

Recently: every ~289 days

Total

12

Last Release

394d ago

Major Versions

1.3.2 → 2.0.02022-02-14

### Community

Maintainers

![](https://www.gravatar.com/avatar/2f8fdd2069c7594101452a5c802ae01209a31109d67a9299a67320752c30a1de?d=identicon)[xiaoxuan6](/maintainers/xiaoxuan6)

---

Top Contributors

[![xiaoxuan6](https://avatars.githubusercontent.com/u/32762220?v=4)](https://github.com/xiaoxuan6 "xiaoxuan6 (24 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (11 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (9 commits)")

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/jamesxue-ali-safe-api/health.svg)

```
[![Health](https://phpackages.com/badges/jamesxue-ali-safe-api/health.svg)](https://phpackages.com/packages/jamesxue-ali-safe-api)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

20917.2M158](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9346.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

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