#!/usr/bin/env php
<?php

require __DIR__.'/bootstrap.php';

// Prepare the DB
with(new CategoryMigrator)->up();
with(new ClusterMigrator)->up();

// Seed the database with some data
// ...

// Set up a custom inspector for our models
class BaumNodeInspector extends \Boris\ColoredInspector {
  public function objectVars($value) {
    if ( $value instanceof Baum\Node )
      return array_merge($value->getAttributes(), get_object_vars($value));

    return parent::objectVars($value);
  }
}

// Start-up boris REPL and import any defined var (in scope) which happens to be
// a Baum\Node instance into the context
$boris = new \Boris\Boris('> ');

$boris->setInspector(new BaumNodeInspector);

$boris->setLocal(array_filter(get_defined_vars(), function($var) {
  return $var instanceof Baum\Node; }));

$boris->start();
