jimwins / akismet-api
Library for accessing the Akismet API without any framework dependencies.
Fund package maintenance!
jimwins
Requires
- php: >= 8.1
- guzzlehttp/guzzle: ^7.0
- psr/http-message: ^1.1 | ^2.0
Requires (Dev)
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^10.0
This package is auto-updated.
Last update: 2025-04-19 23:05:43 UTC
README
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.
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