Skip to content

Commit

Permalink
Completed basic SilverStripe 4 upgrade of package.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Byfleet committed Aug 13, 2019
1 parent 21ff137 commit d8f1a56
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 deletions.
35 changes: 29 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,38 @@
# SilverStripe honeypot
# SilverStripe Honey Pot

For a SilverStripe `2.4` compatible version use the branch `1.0`
A SilverStripe 4.x compatible version of camspiers/honeypot

## Installation (with composer)

$ composer require camspiers/honeypot
$ composer require heyday/silverstripe-honeypot

Set the default spam protector in *mysite/_config/spamprotection.yml*
Set the default spam protector in *app/_config/spamprotection.yml*

---
name: spamprotection
---
FormSpamProtectionExtension:
default_spam_protector: HoneyPotSpamProtector
SilverStripe\SpamProtection\Extension\FormSpamProtectionExtension:
default_spam_protector: Heyday\SilverStripe\HoneyPot\HoneyPotSpamProtector

Or, on a form by form basis

use Heyday\SilverStripe\HoneyPot\HoneyPotField;
use SilverStripe\Forms\Form;
use SilverStripe\Control\Controller;
use SilverStripe\Forms\FieldList;

/**
* Class SomeForm
*/
class SomeForm extends Form
{
/**
* @param Controller $controller
*/
public function __construct(Controller $controller)
{
$fields = new FieldList();
$fields->push(new HoneyPotField('Website')); // 'Website' here can be any old string
...
}
}
File renamed without changes.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"autoload": {
"psr-4": {
"Heyday\\SilverStripe\\HoneyPot\\": "code/"

}
}
}

0 comments on commit d8f1a56

Please sign in to comment.