mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
26 lines
509 B
PHP
26 lines
509 B
PHP
|
<?php
|
||
|
class SSAkismet extends Akismet {
|
||
|
private static $apiKey;
|
||
|
private static $saveSpam = false;
|
||
|
|
||
|
static function setAPIKey($key) {
|
||
|
self::$apiKey = $key;
|
||
|
}
|
||
|
|
||
|
static function isEnabled() {
|
||
|
return (self::$apiKey != null) ? true : false;
|
||
|
}
|
||
|
|
||
|
static function setSaveSpam($save = true) {
|
||
|
SSAkismet::$saveSpam = $save;
|
||
|
}
|
||
|
|
||
|
static function getSaveSpam() {
|
||
|
return SSAkismet::$saveSpam;
|
||
|
}
|
||
|
|
||
|
public function __construct() {
|
||
|
parent::__construct(Director::absoluteBaseURL(), self::$apiKey);
|
||
|
}
|
||
|
}
|
||
|
?>
|