SallyCMS 插件,提供访问 akismet api 的接口。

安装: 3

依赖项: 0

建议者: 0

安全: 0

类型:sallycms-addon

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 插件,提供访问 akismet api 的接口。

Akismet 或 Automattic Kismet [sic] 邮件过滤服务

最新版本

1.0.0

安装

Akismet 与 Composer 兼容。

  1. 更新你的 composer.json,以便 composer 可以找到 akismet 及其所有依赖项
"require": {
    "mediastuttgart/akismet": "~1.0"
}
  1. 安装 akismet 及其依赖项
php composer.phar update

使用方法

验证你的 akismet apikey。

<?php

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

让 akismet 识别一些垃圾邮件。

<?php

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

如果你愿意,也可以设置更多的 参数

<?php

$akismet = Akismet::getService();

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

$akismet->isSpam('viagra');

SallyCMS akismet 插件支持事件并通知监听器关于垃圾邮件的信息。

事件

<?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 许可证

SallyCMS akismet 插件在 MIT 许可证 下发布。