<?php

namespace eftec;

// this code only runs on CLI but only if routeonecli.php is called directly and via command line.
use eftec\routeone\RouteOne;
use eftec\routeone\RouteOneCli;
include_once __DIR__ . '/RouteOneCli.php';
if (!defined('PHPUNIT_COMPOSER_INSTALL') && !defined('__PHPUNIT_PHAR__')
    && isset($_SERVER['PHP_SELF']) &&
    !http_response_code() &&
    (basename($_SERVER['PHP_SELF']) === 'RouteOne.php' || basename($_SERVER['PHP_SELF']) === 'routeonecli')
) {

    // we also excluded it if it is called by phpunit.
    $path = RouteOneCli::findVendorPath();
    include_once __DIR__ . '/' . $path . '/autoload.php';


    $inst = new RouteOneCli();
} else {
    @http_response_code(404);
}

