benji07/akismet-bundle

There is no license information available for the latest version (dev-master) of this package.

Symfony Benji07 AkismetBundle

Installs: 45 487

Dependents: 0

Suggesters: 0

Security: 0

Stars: 5

Watchers: 3

Forks: 2

Open Issues: 0

Type:symfony-bundle

dev-master 2012-03-11 10:17 UTC

This package is not auto-updated.

Last update: 2024-11-03 03:38:50 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);