symfony-bundle akismet-bundle
Symfony Benji07 AkismetBundle
benji07/akismet-bundle
Symfony Benji07 AkismetBundle
- Sunday, March 11, 2012
- by benji07
- Repository
- 2 Watchers
- 5 Stars
- 41,251 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 1 Forks
- 0 Open issues
- 1 Versions
- 2 % Grown
Benji07AkismetBundle
Bundle to use akismet api in Symfony2, (*1)
Configuration
[yml]
benji_akismet
key: your key
blog: your site homepage
Usage
[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);