PHPackages                             tegic/security - 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. tegic/security

ActiveLibrary[Security](/categories/security)

tegic/security
==============

security package for PHP

v2.0.1(10mo ago)0101MITPHPPHP ^8.0

Since Jul 29Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/teg1c/security)[ Packagist](https://packagist.org/packages/tegic/security)[ RSS](/packages/tegic-security/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (2)Versions (6)Used By (0)

阿里云绿网内容审核/腾讯云内容审核
=================

[](#阿里云绿网内容审核腾讯云内容审核)

运行环境
----

[](#运行环境)

- php &gt;= 8.0
- composer

安装
--

[](#安装)

```
composer require tegic/security
```

说明
--

[](#说明)

### 使用

[](#使用)

```
$config = [
    'access_key_id' => 'LTAI5tE***********',
    'access_key_secret' => 'ybdyNZ69kU7dRA***********',
    'region_id' => 'cn-shanghai',
    'endpoint' => 'green-cip.cn-shanghai.aliyuncs.com'
];

try {
    //普通方式调用 传入配置
    $client = Security::instance('ali', $config);
    $client->setOption([
        'service' => 'ugc_moderation_byllm'
    ]);****
    //hyperf 调用 默认使用配置文件
//    $client = \Tegic\Security\Security::instance('tencent');
    $result = $client->text('测试');// true 为内容通过
    var_dump($result ?? '');
} catch (\Tegic\Security\Exception\ContentErrorException $exception) {
    //内容审核不通过，$exception->getData() 可以获取 sdk 返回的内容
    var_dump("不通过", $exception->getData());
} catch (\Tegic\Security\Exception\SecurityException $securityException) {
    //系统错误，如 配置不正确等等..
    var_dump("系统错误", $securityException->getMessage());
}
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance53

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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 ~475 days

Total

4

Last Release

328d ago

Major Versions

v1.0.1 → v2.0.02025-05-08

PHP version history (2 changes)v1.0.0PHP ^7.3

v2.0.0PHP ^8.0

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/tegic-security/health.svg)

```
[![Health](https://phpackages.com/badges/tegic-security/health.svg)](https://phpackages.com/packages/tegic-security)
```

###  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)
