<?php

if (file_exists('settings.php')) {
    require_once('settings.php');
} elseif (file_exists('config.php')) {
    require_once('config.php');
}

if (empty($_SERVER['REQUEST_URI'])) {
    die("Cannot proceed without a server.");
}
 
try{
	$match = $w->router->match();
	// call closure or throw 404 status
	if ($match && is_callable($match['target'])) {
	    call_user_func($match['target'], $match['params']);
	} else {
	    $w->redirectToCmsErrorPage();
	}
} catch(\Exception $e){
	
}

exit;
