Version: current

     1 <?php
     2 /**
     3  * @package cms
     4  * @subpackage comments
     5  */
     6 class SSAkismet extends Akismet {
     7     private static $apiKey;
     8     private static $saveSpam = true;
     9
    10     static function setAPIKey($key) {
    11         self::$apiKey = $key;
    12     }
    13
    14     static function isEnabled() {
    15         return (self::$apiKey != null) ? true : false;
    16     }
    17
    18     static function setSaveSpam($save = true) {
    19         SSAkismet::$saveSpam = $save;
    20     }
    21
    22     static function getSaveSpam() {
    23         return SSAkismet::$saveSpam;
    24     }
    25
    26     public function __construct() {
    27         parent::__construct(Director::absoluteBaseURL(), self::$apiKey);
    28     }
    29 }
    30 ?>

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -