Example #1
0
*
* This is a modified BSD license (the third clause has been removed).
* The BSD license may be found here:
* 
* http://www.opensource.org/licenses/bsd-license.php
*
*/
// include heavy metal
include '../sys/sys.php';
// init the framework
init(dirname(dirname(__FILE__) . "..") . "/");
uses('sys.app.http.http_dispatcher');
uses('sys.app.config');
// load the environment
Config::LoadEnvironment();
// start buffering
ob_start();
// dispatch the request
try {
    $dispatcher = new HTTPDispatcher();
    print trim($dispatcher->dispatch());
} catch (DispatcherException $ex) {
    ob_end_clean();
    header('HTTP/1.0 404 Not Found');
} catch (ErrorResponseException $ex) {
    ob_end_clean();
    header('HTTP/1.0 ' . $ex->error_code());
}
Config::ShutdownEnvironment();
// flush the buffer
ob_flush();