silverstripe-spamprotection/code/SpamProtectorManager.php

49 lines
1.3 KiB
PHP
Raw Normal View History

2009-02-03 22:29:55 +01:00
<?php
2016-10-10 07:44:28 +02:00
namespace SilverStripe\Spamprotection;
use SilverStripe\Dev\Deprecation;
/**
* @package spamprotection
*
* @deprecated 1.0
2009-02-03 22:29:55 +01:00
*/
2015-11-21 07:15:15 +01:00
class SpamProtectorManager
{
private static $spam_protector = null;
2015-11-21 07:15:15 +01:00
public static function set_spam_protector($protector)
{
Deprecation::notice(
'1.1',
2015-11-21 07:15:15 +01:00
'SpamProtectorManager::set_spam_protector() is deprecated. '.
'Use the new config system. FormSpamProtectorExtension.default_spam_protector'
);
2016-10-10 07:44:28 +02:00
static::$spam_protector = $protector;
2015-11-21 07:15:15 +01:00
}
2015-11-21 07:15:15 +01:00
public static function get_spam_protector()
{
Deprecation::notice(
'1.1',
2015-11-21 07:15:15 +01:00
'SpamProtectorManager::get_spam_protector() is deprecated'.
'Use the new config system. FormSpamProtectorExtension.default_spam_protector'
);
2016-10-10 07:44:28 +02:00
return static::$spam_protector;
2015-11-21 07:15:15 +01:00
}
public static function update_form($form, $before = null, $fieldsToSpamServiceMapping = array(), $title = null, $rightTitle = null)
{
Deprecation::notice(
'1.1',
2015-11-21 07:15:15 +01:00
'SpamProtectorManager::update_form is deprecated'.
'Please use $form->enableSpamProtection() for adding spamprotection'
);
2015-11-21 07:15:15 +01:00
return $form->enableSpamProtection();
}
}