#!/usr/bin/env php
<?php
$dir = __DIR__;
$i = 0;
while (!is_dir($dir.'/vendor/') and $i < 5) {
	$dir .= '/..';
	$i++;
}

if (is_file($dir.'/vendor/autoload.php')) {
	require $dir.'/vendor/autoload.php';
	define('APPPATH', $dir);

	$reactor = new D2G\Reactor\Reactor($_SERVER['argv'], '\\D2G\\Reactor\\Commands\\Reactor', 'create_command');

	$reactor->ignite();
}
else{
	echo "could not find autoload file... ";
	exit(1);
}