-
Notifications
You must be signed in to change notification settings - Fork 1
Installation
vendeeglobe edited this page Jul 8, 2026
·
3 revisions
Choose the blog, forum, wiki or CMS you are using for specific installation instructions.
For modern frameworks (Laravel, Symfony, modern MediaWiki, etc.), Bad Behaviour 2.3.0+ is completely Composer-ready.
-
Install the package via Composer:
composer require badbehaviour/badbehaviour
-
Initialize the library using your preferred adapter:
Generic Applications:
require 'vendor/autoload.php';
use BadBehaviour\Core\BadBehaviour;
use BadBehaviour\Core\Adapter\GenericAdapter;
$custom = ['strict' => true];
$adapter = new GenericAdapter();
$bb = new BadBehaviour($adapter, $custom);
$bb->run();MediaWiki (e.g. LocalSettings.php):
require "$IP/vendor/autoload.php";
use BadBehaviour\Core\BadBehaviour;
use BadBehaviour\Core\Adapter\MediaWikiAdapter;
$db = wfGetDB(DB_MASTER);
$adapter = new MediaWikiAdapter($db, $wgDBprefix, $wgEmergencyContact, $wgScript);
$bb = new BadBehaviour($adapter);
$bb->run();WackoWiki:
require 'vendor/autoload.php';
use BadBehaviour\Core\BadBehaviour;
use BadBehaviour\Core\Adapter\WackoWikiAdapter;
$adapter = new WackoWikiAdapter($db);
$bb = new BadBehaviour($adapter);
$bb->run();If you maintain an existing site and simply wish to upgrade from 2.2.x without refactoring your integration, the legacy entry points continue to function exactly as before. They now act as forwarding shims over the new OOP architecture internally.
- Upload the
badbehaviourdirectory to your project. - Include the legacy bootstrap file as you always have:
- MediaWiki:
include( './extensions/Bad-Behaviour/bad-behaviour-mediawiki.php' ); - Generic:
require_once 'bad-behaviour-generic.php';
- MediaWiki:
For complete documentation and installation instructions, please visit the User Guide.