Bad Behavior Porting Guide
(Draft)
If you want to install Bad Behavior to a system other than those to which it has already been ported, you will almost certainly need some knowledge of PHP or some assistance by someone who does have such knowledge. These notes should get you in the right direction.
By default Bad Behavior can provide protection to any PHP script out of the box, but it cannot provide logging. If you are willing to live without Bad Behavior’s detailed logs, simply install the Bad Behavior folder somewhere on your server, and then call require_once("/path/to/Bad-Behavior/bad-behavior-generic.php"); from your PHP script. I recommend placing this function call in a common piece of PHP code which is loaded from all parts of your PHP-based software, so that it can provide protection to all parts of your software.
Please note that Bad Behavior relies on its database logging for some parts of its spam protection, and thus will run in a degraded mode when no logging is available.
If you just can’t live without logging, you will need to provide a database connection. Bad Behavior uses callbacks whenever it needs to run a database query; in order to provide this functionality, you will need to provide the appropriate hooks into your PHP-based software’s database and add them into the bad-behavior-generic.php file. The code has stub functions which show what is needed, and you can use the bad-behavior-wordpress.php file as an example to work from, though your implementation will necessarily be different.
As people port Bad Behavior to other PHP-based software, I will provide code and pointers here. If you have ported Bad Behavior to another PHP-based system, let me know.

1 Response to “Bad Behavior Porting Guide”
Bad Behavior on Drupal 7 « Mike Beach
Pingback on Nov 13th, 2011 at 11:47 pm