mirror of
https://github.com/silverstripe/silverstripe-spamprotection.git
synced 2024-10-22 14:05:59 +02:00
SilverStripe 4 and Namespacing
This commit is contained in:
parent
5f8d2af0d1
commit
b757c3dc6d
@ -8,4 +8,7 @@
|
|||||||
*
|
*
|
||||||
* @package spamprotection
|
* @package spamprotection
|
||||||
*/
|
*/
|
||||||
Deprecation::notification_version('1.1', 'spamprotection');
|
|
||||||
|
use SilverStripe\Dev\Deprecation;
|
||||||
|
|
||||||
|
Deprecation::notification_version('3.0', 'spamprotection');
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: spamprotection
|
name: spamprotection
|
||||||
---
|
---
|
||||||
Form:
|
SilverStripe\Forms\Form:
|
||||||
extensions:
|
extensions:
|
||||||
- FormSpamProtectionExtension
|
- SilverStripe\Spamprotection\FormSpamProtectionExtension
|
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace SilverStripe\Spamprotection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Editable Spam Protecter Field. Used with the User Defined Forms module (if
|
* Editable Spam Protecter Field. Used with the User Defined Forms module (if
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace SilverStripe\Spamprotection;
|
||||||
|
|
||||||
|
use SilverStripe\Dev\Deprecation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @package spamprotection
|
* @package spamprotection
|
||||||
@ -18,7 +21,7 @@ class SpamProtectorManager
|
|||||||
'Use the new config system. FormSpamProtectorExtension.default_spam_protector'
|
'Use the new config system. FormSpamProtectorExtension.default_spam_protector'
|
||||||
);
|
);
|
||||||
|
|
||||||
self::$spam_protector = $protector;
|
static::$spam_protector = $protector;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function get_spam_protector()
|
public static function get_spam_protector()
|
||||||
@ -29,7 +32,7 @@ class SpamProtectorManager
|
|||||||
'Use the new config system. FormSpamProtectorExtension.default_spam_protector'
|
'Use the new config system. FormSpamProtectorExtension.default_spam_protector'
|
||||||
);
|
);
|
||||||
|
|
||||||
return self::$spam_protector;
|
return static::$spam_protector;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function update_form($form, $before = null, $fieldsToSpamServiceMapping = array(), $title = null, $rightTitle = null)
|
public static function update_form($form, $before = null, $fieldsToSpamServiceMapping = array(), $title = null, $rightTitle = null)
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace SilverStripe\Spamprotection;
|
||||||
|
|
||||||
|
use SilverStripe\Core\Extension;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Apply the spam protection to the comments module if it is installed.
|
* Apply the spam protection to the comments module if it is installed.
|
||||||
*
|
*
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace SilverStripe\Spamprotection;
|
||||||
|
|
||||||
|
use SilverStripe\Core\Config\Config;
|
||||||
|
use SilverStripe\Core\Extension;
|
||||||
|
use SilverStripe\Core\Injector\Injector;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An extension to the {@link Form} class which provides the method
|
* An extension to the {@link Form} class which provides the method
|
||||||
@ -76,6 +81,7 @@ class FormSpamProtectionExtension extends Extension
|
|||||||
* Activates the spam protection module.
|
* Activates the spam protection module.
|
||||||
*
|
*
|
||||||
* @param array $options
|
* @param array $options
|
||||||
|
* @return Object
|
||||||
*/
|
*/
|
||||||
public function enableSpamProtection($options = array())
|
public function enableSpamProtection($options = array())
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace SilverStripe\Spamprotection;
|
||||||
|
|
||||||
|
use SilverStripe\Forms\FormField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SpamProtector base interface.
|
* SpamProtector base interface.
|
||||||
|
@ -11,15 +11,18 @@
|
|||||||
"email": "will@fullscreen.io"
|
"email": "will@fullscreen.io"
|
||||||
}],
|
}],
|
||||||
"require": {
|
"require": {
|
||||||
"silverstripe/framework": "~3.1"
|
"silverstripe/framework": "^4@dev"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/PHPUnit": "~3.7@stable"
|
"phpunit/phpunit": "^5.7",
|
||||||
|
"squizlabs/php_codesniffer": "^3.0"
|
||||||
},
|
},
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "3.0.x-dev"
|
"dev-master": "3.0.x-dev"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"license": "BSD-3-Clause"
|
"license": "BSD-3-Clause",
|
||||||
|
"minimum-stability": "dev",
|
||||||
|
"prefer-stable": true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user