Download the PHP package tbetool/spam-doctor without Composer

On this page you can find all versions of the php package tbetool/spam-doctor. 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 spam-doctor

PHP Library: Spam Doctor

Check your email content for spam possibilities before being spammed. PHP Library to check if content contains spam words.


Using the Library

Installation

Intall library in PHP project using composer

Using Library

check() parameters

  1. text_content: Text content to check for spam. You can pass both plain text and html content
  2. is_html (boolean): if text_content is HTML, set second parameter to true. Default: false.

Get output

returns array of spam keyword and their count of occurrences.


returns array of positions of the spam items in ascending order.


returns complete string with spam keywords highlighted in red color. If HTML content is provided to check, this will return only the text of the HTML content.
To get HTML content highlighted, pass true as parameter.


returns complete HTML content with spam keywords highlighted.


returns array of complete list of words used to detect spam contents.


Replace Rule

Library also support replace rule which can be used to replace spamming text on the go. You can pass json rule in key-value pair where key in the spam text is replaced by the corresponding value.

To set the replace rule, use following function before calling check()

Above example will replace o and O (upper and lowercase of O) with 0 (zero)

You can also pass common letter to replace with if letter in replace_rule is not found by passing * key with appropriate value.

For example, in above example if a spam word contains o or *O will be replaced with 0 otherwise will add _ (underscore) to random place in the word.


Self Learning

This library learns itself as it processes the spam contents. It generates a dictionary file in data directory name spam_data.txt.

You can also teach the doctor by passing json data to the teachDoctor() function.

NOTE: Json data can be upto 2-Dimensional array


Exception Handling

Ex:


Bug Reporting

If you found any bug, create an issue.


Support and Contribution

Something is missing?


All versions of spam-doctor with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5
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 tbetool/spam-doctor contains the following files

Loading the files please wait ....