-
Notifications
You must be signed in to change notification settings - Fork 26
Installation
BerlinDB is distributed as a Composer package.
composer require berlindb/coreThen load Composer's autoloader from your plugin or application if it is not already loaded:
require_once __DIR__ . '/vendor/autoload.php';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.
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.
From a local clone:
composer install
bin/run-tests.shFor more details, see Testing and Tooling.