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


use boru\boruai\Cli\BoruAICLI;

$cd = getcwd();
if(isset($GLOBALS['_composer_bin_dir'])) {
    $rootDir = realpath($GLOBALS['_composer_bin_dir']."/../../");
} else {
    $dir = __DIR__;
    $myParent = "/vendor/boru/boruai/bin";
    if(substr($dir,-strlen($myParent))==$myParent) {
        //included as a dependency
        $rootDir = realpath($dir."/../../../../");
    } else {
        //in the dhfw repository
        $rootDir = realpath($dir."/../");
    }
}
define("BORUAI_ROOT",$rootDir);
require_once $rootDir."/vendor/autoload.php";
BoruAICLI::parse();