ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); header('Access-Control-Allow-Origin: *'); header ('Content-type: text/html; charset=utf-8'); header("Expires: on, 01 Jan 1970 00:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); date_default_timezone_set('America/Sao_Paulo'); ob_start(); include('vendor/autoload.php'); include('src/Rest/Routes.php'); include('src/Rest/BaseUrl.php'); include('src/Assets/global/php/myFunctions.php'); //include("src/Services/mpdf/mpdf.php"); //include('src/Services/phpmailer/PHPMailerAutoload.php'); $base=base_url(); //$GLOBALS['base_project']="/src/0-Presentation/"; $GLOBALS['base_project']="src/"; $GLOBALS['base_dir']=$base.$GLOBALS['base_project']; $GLOBALS['base_site']=$base; $GLOBALS['base_view']="Views/"; // print_r($GLOBALS['base_site']); // exit; $nome_url=explode('/',$_SERVER['REQUEST_URI']); $controller =$nome_url[count($nome_url)-2]; session_cache_expire(60); session_start(); if(!isset($routes[$controller])) $controller =$nome_url[count($nome_url)-3]; if(!isset($routes[$controller])) { //header("Location: ".$GLOBALS['base_site']."index.php/".$routes['default']."/"); // print_r("Location: ".$GLOBALS['base_site']."".$routes['default']."/"); // exit; header("Location: ".$GLOBALS['base_site']."".$routes['default']."/"); } else { include($GLOBALS['base_project']."Controllers/".$routes[$controller]); } ?>