<?php
/*
 * For a proper RESTful webservice, all URL's should be routed to this
 * page.
 * http://www.mywebsite.com/Command/argument1/argument2 should be routed
 * to this page, then Command, argument1 and argument2 can be recovered
 * and fed to the front controller.
 * This would require adding URL Routing to Apache, which we shall avoid.
 * 
 * In our case, we aren't building a proper RESTful web server, and we
 * assume a 'cmd' attribute is provided with the HTTP Request
 * http://www.mywebsite.com?cmd=Command
 */
use \Main\Misc\Registry;
use \Main\Control\Controller;
use \Main\Misc\Request;

require_once 'Registry.php';
require_once 'Request.php';
require_once 'Controller.php';

// Get instance of front controller (using Singleton pattern)
$controller = Controller::Instance();

// Get the Request object and feed it to the front controller
$request = Registry::Instance()->Request;
$controller->HandleRequest($request);
?>