Download the PHP package lovevivi/hyperf-sensitive-words without Composer

On this page you can find all versions of the php package lovevivi/hyperf-sensitive-words. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package hyperf-sensitive-words

Hyperf 敏感词过滤组件

基于确定有穷自动机算法(DFA)的敏感词过滤 Hyperf 组件,高效、灵活,支持协程环境。支持表情符号处理、变形文本检测和动态白名单管理。

特性亮点

安装

发布配置

配置

配置文件位于 config/autoload/sensitive_words.php

使用方式

1. 使用服务方式

php

SensitiveHelper (主类) ├── FilterManager (过滤器管理器) │ ├── BoundaryFilter (边界检测过滤器) │ ├── LengthFilter (长度过滤器) │ └── ContextFilter (上下文过滤器) └── FuzzyMatcher (模糊匹配器)

tests/ ├── Cases/ │ ├── SensitiveHelperTest.php # SensitiveHelper 核心功能测试 │ ├── SensitiveWordsManagerTest.php # SensitiveWordsManager 管理器测试 │ └── WhitelistManagementTest.php # 白名单功能专项测试 └── AbstractTestCase.php # 测试基类 bash

运行所有测试

composer test

或者使用 PHPUnit 直接运行

./vendor/bin/phpunit

运行特定测试文件

./vendor/bin/phpunit tests/Cases/SensitiveWordsManagerTest.php

运行特定测试方法

./vendor/bin/phpunit tests/Cases/SensitiveWordsManagerTest.php::testGetAllSensitiveWords

显示详细输出

./vendor/bin/phpunit --verbose

生成代码覆盖率报告(需要安装 xdebug)

./vendor/bin/phpunit --coverage-html coverage/



### 测试统计

- **总测试数**: 52个测试 (包含架构重构后的所有功能测试)
- **总断言数**: 313个断言 
- **测试覆盖**: 核心功能100%覆盖,包括模糊匹配和模块化架构
- **测试类型**: 单元测试、集成测试、性能测试、模糊匹配专项测试
- **架构测试**: 过滤器策略、依赖注入、缓存管理等模块化功能全面测试

### 添加新测试

如果你需要添加新的测试用例,请遵循以下规范:

1. **测试文件命名**: 使用 `*Test.php` 后缀
2. **测试方法命名**: 使用 `test*` 前缀,方法名要清晰描述测试内容
3. **测试分组**: 按功能模块分组,相关测试放在同一个测试类中
4. **断言使用**: 使用具体的断言方法,如 `assertStringContainsString` 而不是通用的 `assertTrue`
5. **测试数据**: 使用有意义的测试数据,包含中英文、特殊字符等各种情况

### 持续集成

项目配置了完整的测试流程,每次代码提交都会自动运行全部测试,确保代码质量。

All versions of hyperf-sensitive-words with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3
hyperf/framework Version ~2.2.0|~3.0.0
hyperf/di Version ~2.2.0|~3.0.0
hyperf/config Version ~2.2.0|~3.0.0
hyperf/contract Version ~2.2.0|~3.0.0
hyperf/utils Version ~2.2.0|~3.0.0
hyperf/http-server Version ~2.2.0|~3.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lovevivi/hyperf-sensitive-words contains the following files

Loading the files please wait ....