Home

Benjamin VanEvery edited this page Feb 11, 2016 · 20 revisions

Welcome to the bart wiki!

Purpose

Bart is a PHP project. It originally began its life as a collection of Build and Release Tools used internally at Box. Over time, it's grown into a collection of critical pieces of our PHP frameworks.

Using It

We use Composer to bundle Bart into our other projects. Below is the quick composer.json snippet.

     "require": {
        "box/bart" : "dev-master"
     }

Then we'll typically have a bootstrap file that requires Bart's bootstrap file.

<?php
$bartSrc = self::root() . '/vendor/box/bart/src';
$bartCommon = "$bartSrc/Bart/bart-common.php";

if (!file_exists($bartCommon))
{
    echo <<<HELP
Cannot find required Bart code in the local path.
Have you run `composer install`?

See documentation on Bart and Composer

HELP;

    exit(1);
}

require_once $bartCommon;

\Bart\Autoloader::register_autoload_path($bartSrc);

Conventions

Bart was originally written using an internal style guide. In late 2012, the choice was made to adopt the PHP Framework Interoperability Group standards. There are still non-minimal remnants of the non-FIG coding styles throughout the code base. All new code should be written in adherence to the FIG styles.

Development Environment

Bart was developed primarily using IntelliJ on Mac Darwin 11.4.2 with PHP 5.3.15.

As of March 2014, Bart requires PHP 5.4 or higher.

Key Classes

Bart is structured using PHP Namespaces. All classes in Bart are defined within the parent Bart namespace.

See Pages for a full list.

Unit Testing

See the Unit Testing page.

Logging

Bart initially used a home grown class called Witness to deal with reporting output back to standard out. It was a sad attempt and we eventually decided to replace it with Log4PHP. See Bart Log4PHP for some enhancements Bart provides to Log4PHP, as well as a sample configuration.