mediastuttgart / akismet
SallyCMS addOn providing an interface to the akismet api.
This package's canonical repository appears to be gone and the package has been frozen as a result.
v1.0.0
2013-08-11 09:18 UTC
Requires
- php: >=5.3.0
- sallycms/composer-installer: ~1.1
- sallycms/sallycms: >0.7,<0.9
- webvariants/developer-utils: ~5.1
- webvariants/global-settings: ~5.5
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.
- Update your composer.json so composer can find akismet and all its dependencies
"require": {
"mediastuttgart/akismet": "~1.0"
}
- 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.