File: manual.txt

Recommend this page to a friend!
  Classes of Dave Smith  >  Traffic Jam  >  manual.txt  >  Download  
File: manual.txt
Role: Documentation
Content type: text/plain
Description: Documentation
Class: Traffic Jam
Block unwanted bots based on access speed
Author: By
Last change:
Date: 6 years ago
Size: 1,622 bytes
 

Contents

Class file image Download
Class: trafficjam
Version: 0.1 bets 10/14/2015

Copyright 2015 Wagon Trader, All Rights Reserved


Description:

This class will block unwanted bots and traffic based on speed the page is being accessed.

Configure whitelist of bots allowed which will not be throttled.
Specify length of time an ip will be blocked
Provide friendly notifications in the event a human gets blocked

Files:

trafficjam.class.php - Main class

example.php - Simple application example

jam_100.php - Display notification for access violation

jam_200.php - Display notification for unwanted bot

/history - folder to hold ip history files

Installation:

Upload files to a web accessible location on your server (eg. public_html)


Configuration:

/history folder needs read and write access (666) or (777) on linux servers

You can change the following settings in the class to meet your specific needs...

$humanSpeed - Number of accesses per second a human would access the site. The lower the number, the more
    likely the ip will be jammed.

$jamTime - Time in seconds that an ip will be jammed.

$fileFolder - Name of folder that holds history data. For security purposes, you can change the folder name
    and set this value to the correct folder.

$dataDelim - delimiter used in history files. A complex delimiter avoids the need to manage commas, tabs, etc...

$fileExt = extension history file to use. tjm is the default, so files will be named [ip_number].tjm


Usage:

Refer to example.php file for usage example.

Refer to trafficjam.class.php file for instructions on using methods

Changelog

0.1 beta

Initial beta release
For more information send a message to info at phpclasses dot org.