-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Completed basic SilverStripe 4 upgrade of package.
- Loading branch information
Nicholas Byfleet
committed
Aug 13, 2019
1 parent
21ff137
commit d8f1a56
Showing
3 changed files
with
29 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,6 @@ | |
"autoload": { | ||
"psr-4": { | ||
"Heyday\\SilverStripe\\HoneyPot\\": "code/" | ||
|
||
} | ||
} | ||
} |