Skip to content

Installation

John James Jacoby edited this page May 27, 2026 · 1 revision

Installation

BerlinDB is distributed as a Composer package.

composer require berlindb/core

Then load Composer's autoloader from your plugin or application if it is not already loaded:

require_once __DIR__ . '/vendor/autoload.php';

Requirements

BerlinDB 3.x development targets modern PHP and WordPress-style database access.

The repository currently configures Composer with PHP 8.2 as its platform for development. The test suite uses PHPUnit 9.6, WordPress test utilities, PHPStan, PHPCS, and WPCS.

WordPress Usage

Inside WordPress, BerlinDB automatically adapts the global $wpdb object through BerlinDB\Database\Adapters\Wpdb.

Avoid creating tables too early in the WordPress bootstrap. Table installation and upgrades usually belong on hooks such as:

add_action( 'admin_init', array( $table, 'maybe_upgrade' ) );

or in plugin activation routines, depending on your plugin's lifecycle.

Development Checkout

From a local clone:

composer install
bin/run-tests.sh

For more details, see Testing and Tooling.

Clone this wiki locally