<?php

use PhangoApp\PhaUtils\Utils;

include('libraries/Utils.php');
include('libraries/Routes.php');

spl_autoload_register(function ($class_name) {
    
    //include($nombre_clase . '.php';
    //echo $class_name;
    switch($class_name) {
    
        case 'PhangoApp\PDO\MySQL':
        
            include('./libraries/PDO.php');
        
        break;
    
    }
    
});

if(is_file('vendor/autoload.php')) {

    include('vendor/autoload.php');
    
}

ob_start();

Utils::load_config('config');

$path_info=isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : '';

echo \PhangoApp\PhaRouter\get_route($path_info);

ob_end_flush();
