Skip to content

Installation

vendeeglobe edited this page Jul 8, 2026 · 3 revisions

Installation

Choose the blog, forum, wiki or CMS you are using for specific installation instructions.

Modern Installation via Composer (Recommended)

For modern frameworks (Laravel, Symfony, modern MediaWiki, etc.), Bad Behaviour 2.3.0+ is completely Composer-ready.

  1. Install the package via Composer:

    composer require badbehaviour/badbehaviour
  2. 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();

Legacy Drop-In Installation

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.

  1. Upload the badbehaviour directory to your project.
  2. 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';

For complete documentation and installation instructions, please visit the User Guide.

Clone this wiki locally