Download the PHP package hashyoo/sensitive-words without Composer

On this page you can find all versions of the php package hashyoo/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 sensitive-words

简单敏感词过滤组件,采用 DFA 算法。

我们的应用往往要营造良好的交流氛围,或因一些政策上的原因,我们需要限制输出用户的某些输入内容(我们称之为敏感词),但用户的输入是不确定的,一般的我们都会对用户的输入进行二次处理,将一些敏感词进行过滤替换的操作。 如果你也有这方面的需要的话,那这个包可以很方便的实现这一功能。

基本用法

替换操作

首先你需要构建一个敏感词库,这个包中没有另外提供,你需要根据你自己的需要来创建。你可以选择保存在文件中,也可以存入到数据库中,但最终你需要将它们编成一个数组,类似这样:

然后你就可以像这样简单的使用:

检测操作

在某些情况下,我们不需要替换文本中的敏感词,只需要程序检测出是否有敏感词即可。 比如在用户注册时候填写的昵称,为了防止用户冒充官方人员对用户进行诈骗,一般会设置一些不能注册的昵称作为敏感词。 这时我们可以使用 scan 方法,它会返回一个数组,包含所有被检测的到敏感词:

关于性能问题

License

The MIT License (MIT). Please see License File for more information.


All versions of sensitive-words with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
ext-mbstring Version *
illuminate/support Version *
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 hashyoo/sensitive-words contains the following files

Loading the files please wait ....