1. Go to this page and download the library: Download silverstripe/akismet library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
silverstripe / akismet example snippets
use SilverStripe\Akismet\AkismetSpamProtector;
AkismetSpamProtector::singleton()->setApiKey('5555dddd55d5d');
use SilverStripe\Akismet\AkismetSpamProtector;
use SilverStripe\Control\Director;
use SilverStripe\Core\Config\Config;
if (!Director::isLive()) {
Config::modify()->remove(AkismetSpamProtector::class, 'bypass_permission');
Config::modify()->remove(AkismetSpamProtector::class, 'bypass_members');
}