Skip to content

Installation

Muhammet Şafak edited this page Jun 11, 2026 · 1 revision

Installation

Requirements

Requirement Version / Notes
PHP 8.1 or higher
ext-pdo Required
PDO driver pdo_mysql, pdo_sqlite or pdo_pgsql for your database
ext-json Required (used to read barbarian.json)
initphp/console ^2.1 (installed automatically)

Install with Composer

composer require initphp/barbarian

This installs the library and exposes the CLI entry point at vendor/bin/barbarian.

Verify the installation

vendor/bin/barbarian help

You should see the command listing:

init     : Generates a barbarian.json configuration file.
create   : Creates a new migration class.
status   : Shows the status of each migration.
up       : Runs the up() method of the migrations.
down     : Runs the down() method of the migrations.

Autoloading and migrations

The library itself is autoloaded through Composer's PSR-4 mapping (InitPHP\Barbarian\src/).

Your migration files, however, are discovered by globbing Migration_*.php inside the configured folder and are required directly — they do not need to be registered with Composer's autoloader. If your migration classes declare a namespace, tell Barbarian about it via the namespace option.

Next steps

Clone this wiki locally