#!/usr/bin/php
<?php

namespace Flagrow\Console;

$autoloaders = [
    // inside vendor/bin
    __DIR__.'/../autoload.php' => __DIR__.'/../../',
    // inside vendor/flagrow/console/bin
    __DIR__.'/../../../autoload.php' => __DIR__ .'/../../../../',
    // inside workbench/*/bin
    __DIR__.'/../../../vendor/autoload.php' => __DIR__.'/../../../',
];

foreach ($autoloaders as $autoload => $basePath) {
    if (file_exists($autoload)) {
        require_once $autoload;
        break;
    }
}

$server = new Console\Server(realpath($basePath));

$server->listen();
