benji07 / akismet-bundle
此包最新版本(dev-master)没有可用的许可信息。
Symfony Benji07 AkismetBundle
dev-master
2012-03-11 10:17 UTC
Requires
- php: >=5.3.2
- symfony/framework-bundle: 2.*
This package is not auto-updated.
Last update: 2024-09-22 03:08:52 UTC
README
#Benji07AkismetBundle
用于在Symfony2中使用akismet api的Bundle
配置
[yml]
benji_akismet
key: your key
blog: your site homepage
使用方法
[php]
$data = array(
'user_ip' => $comment->getUserIp(),
'user_agent' => $comment->getUserAgent(),
'referrer' => $comment->getReferrer(),
'comment_type' => 'comment',
'comment_author' => $comment->getUsername(),
'comment_author_email' => $comment->getEmail(),
'comment_content' => $comment->getContent()
);
// check if $comment is a spam
$this['akismet']->isSpam($data);
// submit a spam
$this['akismet']->submitSpam($data);
// submit a ham
$this['akismet']->submitHam($data);