Skip to content

2.3.0

Choose a tag to compare

@vendeeglobe vendeeglobe released this 08 Jul 13:05
· 117 commits to master since this release

Version 2.3.0 represents a major architectural overhaul of Bad Behaviour. The core logic has been decoupled from platform-specific global variables and bootstrap scripts, transformed into a modern, self-contained Composer package.

  • PSR-4 Autoloading: Bad Behaviour is now a standard Composer library (composer require badbehaviour/badbehaviour). No more require_once chains across your application.
  • Inversion of Control (Dependency Injection): All host-specific behavior (database queries, escaping, email routing, settings persistence) is now handled via the BadBehaviour\Core\HostAdapterInterface.
  • Provided Adapters: Out-of-the-box support for GenericAdapter, MediaWikiAdapter, and WackoWikiAdapter bridges the gap between the new OOP core and existing platforms.
  • No Global State Leaks: The library never touches global application variables (like $db or $wgDBprefix) without explicit instruction via an adapter.
  • No Side Effects on Load: Requiring the package via Composer or use BadBehaviour\Core\BadBehaviour; no longer triggers screening or calls die(). The host application retains full control over execution flow. Screening only triggers when you explicitly call $bb->run().
  • Backwards Compatible Shims: Existing drop-in integrations (bad-behaviour-generic.php, bad-behaviour-mediawiki.php, etc.) have been retained as thin shims. They now automatically instantiate the new OOP classes internally, meaning existing installs upgrade seamlessly without changing a single line of legacy code.
  • PHPUnit Ready: The codebase is now fully unit-testable. A testing scaffold is included to verify screening logic without HTTP traffic or live databases.

Full Changelog: 2.2.26...2.3.0