Download the PHP package linko/spamfilter without Composer

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

Spam Detector

Spam Filter is a simple library for detecting spam messages. It follows the open closed principle by introducing Spam Detectors which are just separate classes used to extend the spam filter detecting capabilities.

Build Status

Installation

Spam Filter library can be loaded into your projects using Composer or by loading the inbuilt autoloader.

Composer Installation

You can define the spam filter as a dependency in your project. Below is a minimal setup required

Using autoload.php

If you are not using composer for your dependency (which you should) there is a simple autoloader packaged with this library which you can just 'include()' into your project files

Setup

This should be done once throughout your app

Usage

Each time you call the check() method on a string, it returns a SpamResult Object which holds the ... hmm ... spam check result.

You could provide more information about the entity trying to perform the action you are checking against the spam detector.

<?php

$check = $spamDetector->check(array(
    'name' => 'johndoe',
    'email' => '[email protected]',
    'text' => 'Hello, this is some clean comment John Doe is trying to post'
));

if ($check->passed()) {
    // Post comment
}

Some detectors will require these extra information to `perform`...

Currently Supported Spam Detectors

1. BlackList Detector:

The black list detector flags a string as a spam if it contains any of one or more words that has been added to the black list. Strings could be formed from Regular Expressions or a Character Sequence.

2. LinkRife Detector:

The link rifle detector checks if a text contains too many links based on the max links allowed and the percentage ratio of links to words.. You can also modify these values to your taste.

Creating your own custom Detector

You create a detector simply by creating a class that implements the SpamDetectorInterface which defines the following contract.

interface SpamDetectorInterface
{
    public function detect($data);
}

The prepared data passed as the argument is made up of an array with these values.

If your detector returns true then the text is flagged as spam otherwise not spam if false is returned.

Below is an example of a "fantastic" spam detector that checks if a text is above 200 words and flags it as spam.

Its not usable, its just an example.

After creating your spam detector, you add it using the registerDetector() method in the SpamFilter

Licence

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

Enjoy!!


All versions of spamfilter with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.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 linko/spamfilter contains the following files

Loading the files please wait ....