/akismet-api

Library for accessing the Akismet API without any framework dependencies

Primary LanguagePHPMIT LicenseMIT

PHP Akismet API

This is a simple PHP library for accessing the Akismet API without any framework dependencies. Spam checking does require a PSR-7 ServerRequest but one can easily be faked using GuzzleHttp.

Source Build Status Total Downloads Latest Stable Version

Installation

This is installable and autoloadable via Composer as jimwins/akismet-api. If you aren't familiar with the Composer Dependency Manager for PHP, you should read this first.

$ composer require jimwins/akismet-api --prefer-dist

Sample Usage

<?php
$api = new \Akismet\API("{Your Akismet API Key}", "{{ your site/blog URL }}");

if (!$api->verifyKey()) {
  die("That API key could not be verified.");
}

$api->commentCheck($values, $request);

$api->submitSpam($values);

$api->submitHam($values);

$api->keySites();

$api->usageLimit();

Unit Testing

$ vendor/bin/phpunit