benji07 / akismet-bundle
Symfony Benji07 AkismetBundle
Installs: 45 487
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 3
Forks: 2
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.3.2
- symfony/framework-bundle: 2.*
This package is not auto-updated.
Last update: 2024-12-15 04:11:34 UTC
README
#Benji07AkismetBundle
Bundle to use akismet api in Symfony2
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);