<?php

// Change current directory to script location
$BaseDir = substr($_SERVER['SCRIPT_FILENAME'], 0, strrpos($_SERVER['SCRIPT_FILENAME'], '/'));
if($BaseDir != '') chdir($BaseDir);

include_once(dirname(__FILE__).'/Base/HTTP.php');

// Is executed from command line?
if(!isset($_SERVER['REMOTE_ADDR']))
{
  $HTTP = new HTTP();
  $_GET = $HTTP->GetQueryStringArray($_SERVER['argv'][1]);
}

include_once(dirname(__FILE__).'/Application/Application.php');

$Application = new Application();
$Application->Run();
