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

/**
 * Basic console application
 * @author Telmo Riofrio <telmo.riofrio@funiber.org>
 *
 * Maybe some weird stuff happens into some files, the output console
 * shows php code, probably its the short tags <? ?> into the code
 */

$app = require __DIR__ . '/index.php';

use CTDesarrollo\Console\Console;
use CTFramework\Framework\System\Application;

try{
    //boot ctFramework
    Application::boot(realpath(__DIR__));

    //boot console app
    $app = Console::boot();

    //run the thing
    $app->run();
}
catch (Exception $ex){
    //something went wrong :(
    echo "The console can't start because of {$ex->getMessage()}\n";
}

return $app;
