SallyCMS addOn providing an interface to the akismet api.

v1.0.0 2013-08-11 09:18 UTC

This package is not auto-updated.

Last update: 2020-08-17 09:39:57 UTC


README

SallyCMS addOn providing an interface to the akismet api.

Akismet or Automattic Kismet [sic] spam filtering service

Latest version

1.0.0

Install

Akismet works with Composer.

  1. Update your composer.json so composer can find akismet and all its dependencies
"require": {
    "mediastuttgart/akismet": "~1.0"
}
  1. Install akismet and its dependencies
php composer.phar update

Usage

Verify your akismet apikey.

<?php

$akismet = Akismet::getService();
$akismet->verifyKey();

Let akismet detect some spam.

<?php

$akismet = Akismet::getService();
$akismet->isSpam('viagra');

You can also set more parameters if you like

<?php

$akismet = Akismet::getService();

$akismet->setUserIp($ip);
$akismet->setSiteUrl($url);
$akismet->setAuthor($author);
$akismet->setAuthorEmail($authorEmail);

$akismet->isSpam('viagra');

The SallyCMS akismet addOn supports events and notifies listeners about spam.

Events

<?php

$dispatcher = sly_Core::getContainer()->getDispatcher();
$dispatcher->register('M_AKISMET_FOUND_SPAM', function ($params) {
    $content = $params['subject'];
    $service = $params['service'];

    $service->getUserIp();
    $service->getAuthorEmail();
});

MIT License

The SallyCMS akismet addOn is released under the MIT License.