<?php

require_once "components/import/updatefunctions.php";
HandleInputArguments();

if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match('/^(curl|wget)/i', $_SERVER['HTTP_USER_AGENT'])) {
    require_once "includes/update.php";
} else if($running_from_command_line==true || (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')) {	
	// just let the updater to it's job
	require_once "includes/update.php";
} else {
	// load the ui
	require_once "includes/loader.php";
	$page = new PageLoader();

	$page->views = array(
			"html" => "templates/logaholic_6/default-template.php",			
			".content" => "app/views/UpdateProgress.php"
		);
	// $page->styles = array(
	// 		array("src" => "templates/logaholic_6/Update.css")
	// 	);
	$page->scripts = array(
		"app/controller/Update.min.js"
	);
	$page->Display();
}
?>