2017 © Pedro Peláez
 

symfony-bundle antispam-bundle

Provides Anti-Spam capabilities to Symfony in an easy to use package..

image

sithous/antispam-bundle

Provides Anti-Spam capabilities to Symfony in an easy to use package..

  • Saturday, December 16, 2017
  • by skylord123
  • Repository
  • 1 Watchers
  • 2 Stars
  • 533 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

AntiSpamBundle

Provides Anti-Spam capabilities to Symfony in an easy to use package., (*1)

Check us out on packagist! https://packagist.org/packages/sithous/antispam-bundle, (*2)

We recommend using fixtures to load in your SithousAntiSpamTypes so they can be moved to the production server or vice versa., (*3)

Requirements

  • => PHP 5.3.2
  • => Symfony 2.3
  • => Symfony Console 2.3
  • Doctrine

Installation

Step 1: Add to composer

add the bundle to your root composer.json file under the require section, (*4)

"sithous/antispam-bundle": "1.0.*"

After adding that run composer to fetch the package into your vendors folder, (*5)

php composer.phar update

Step 2: Enable the bundle

Enable the bundle by adding the following to the app/config/appKernel.php, (*6)

new Sithous\AntiSpamBundle\SithousAntiSpamBundle(),

Step 3: Update database

First, verify the SQL to make sure nothing will break, (*7)

php app/console doctrine:schema:update --dump-sql

If everything looks good, execute the schema update., (*8)

php app/console doctrine:schema:update --force

Configuration

By default the AntiSpamBundle runs garbage collection every time a verify() call is made. You can change this to run in a cron every couple minutes by setting active_gc to true., (*9)

# app/config/config.yml
sithous_anti_spam:
    active_gc: true   # set to false to use cron garbage collection

If you want to use cron garbage collection you will need to make a cron job run the following command:, (*10)

php app/console sithous:antispambundle:gc

Example Usage

A good example is if you want users to be able to vote on something but only want the user and IP of user to vote once a day. To do this you would first generate the SithousAntiSpamType using the following command:, (*11)

$ php app/console sithous:antispam:generate
Please enter the ID for this type: vote_protection
Track IP [Y/N]? Y
Track User [Y/N]? Y
Max Time to track action (seconds): 86400
Max Calls that can happin in MaxTime: 1

ID: vote_protection
trackIp: true
trackUser: true
maxTime: 86400 seconds
maxCalls: 1

Is the above information correct [Y/N]? Y
Successfully added SithousAntiSpamType "vote_protection"

Now in your controller function you will run the verify command before submitting the vote, (*12)

    public function submitVoteAction(Request $request)
    {
        // somewhere in your code...

        $spamCheck = $this->get('sithous.antispam');
        if(!$spamCheck->setType('vote_protection')->verify())
        {
            return new JsonResponse(array(
                'result'  => 'error',
                'message' => $spamCheck->getErrorMessage()
            ));
        }
    }

If you later want to remove a SithousAntiSpamType run the following command:, (*13)

$ php app/console sithous:antispam:delete
Enter the SithousAntiSpamType ID to delete: vote_protection
Successfully removed SithousAntiSpamType "vote_protection"

The Versions

16/12 2017

dev-master

9999999-dev http://github.com/sithous

Provides Anti-Spam capabilities to Symfony in an easy to use package..

  Sources   Download

MIT

The Requires

 

protection brute force anti spam

16/12 2017

1.0.3

1.0.3.0 http://github.com/sithous

Provides Anti-Spam capabilities to Symfony in an easy to use package..

  Sources   Download

MIT

The Requires

 

protection brute force anti spam

14/12 2017

1.0.2

1.0.2.0 http://github.com/sithous

Provides Anti-Spam capabilities to Symfony in an easy to use package..

  Sources   Download

MIT

The Requires

 

protection brute force anti spam

22/10 2015

1.0.1

1.0.1.0 http://github.com/sithous

Provides Anti-Spam capabilities to Symfony in an easy to use package..

  Sources   Download

MIT

The Requires

 

protection brute force anti spam

22/10 2015

dev-skylord123-patch-1

dev-skylord123-patch-1 http://github.com/sithous

Provides Anti-Spam capabilities to Symfony in an easy to use package..

  Sources   Download

MIT

The Requires

 

protection brute force anti spam

02/09 2014

v1.0.0

1.0.0.0 http://github.com/sithous

Provides Anti-Spam capabilities to Symfony in an easy to use package..

  Sources   Download

MIT

The Requires

 

protection brute force anti spam

29/08 2014

dev-development

dev-development http://github.com/sithous

Provides Anti-Spam capabilities to Symfony in an easy to use package..

  Sources   Download

MIT

The Requires

 

protection brute force anti spam