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

/**
 * FOOTUP FRAMEWORK  2021 - 2023
 * *****************************
 * A Rich Featured LightWeight PHP MVC Framework - Hard Coded by Faustfizz Yous
 * 
 * @package Footup
 * @version 0.2
 * @author Faustfizz Yous <youssoufmbae2@gmail.com>
 */

// Valid PHP Version?
$minPHPVersion = '7.4';
if (version_compare(PHP_VERSION, $minPHPVersion, '<'))
{
	die("Your PHP version must be {$minPHPVersion} or higher to run FootUp. Current version: " . PHP_VERSION);
}
unset($minPHPVersion);

if (strpos(PHP_SAPI, 'cgi') === 0)
{
	die("The cli tool is not supported when running php-cgi. It needs php-cli to function!\n\n");
}

// Directory Separator
defined("DS") or define("DS", DIRECTORY_SEPARATOR);

// Path to the front controller
define('BASE_PATH', __DIR__ . '/public' . DS);

// Let's put the fuel and boot our amazing app.
require realpath(BASE_PATH . '../app/Config/Fuel.php');
// Change this accordingly to your app directory

// Load our friend FootUP.
$footup = (require (rtrim(App\Config\Fuel::sysDir, '\\/ ') . DS . 'Boot.php'));

/**
 * On se positionne dans le dossier public
 */
chdir(BASE_PATH);

/**
 * Démarre le console
 */
(new Footup\Cli\Konsole($footup->name(), $footup->version()))->run();