<?php

require_once __DIR__ . '/../../../autoload.php';

define('SLIM_APPLICATION_ROOT_PATH',  str_replace('/vendor/gabrielpcruz/slim-framework/bin', '', __DIR__));

use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;

use SlimFramework\Slim;

try {
    if (!Slim::isConsole()) {
        throw new DomainException('Only CLI allowed. Script stopped.');
    }

    Slim::bootstrap();
    die(getConsole()->run());
} catch (Exception|NotFoundExceptionInterface|ContainerExceptionInterface $exception) {
    die($exception->getMessage());
}

