Location: PHPKode > projects > DIY Blog > diy-blog/frontend.php
<?php

/**
 * Includes classes required by the frontend application and runs the frontend Controller.
 * Handles all HTTP requests for frontend. Base frontend URL should be rewritten to be handled by this file.
 * @package diy-blog
 * @author	Martynas Jusevicius <hide@address.com>
 * @link	http://www.xml.lt
 */

$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$begintime = $time;

require("common.php");

define("APP_DIR", MAIN_DIR."frontend/");
define("APP_CONTR_DIR", APP_DIR."controller/");
define("APP_VIEW_DIR", APP_DIR."view/");

// VIEWS

require(APP_VIEW_DIR."notFound/NotFoundView.class.php");
require(APP_VIEW_DIR."error/ErrorView.class.php");
require(APP_VIEW_DIR."postList/PostListView.class.php");
require(APP_VIEW_DIR."postListYearly/YearlyPostListView.class.php");
require(APP_VIEW_DIR."postListMonthly/MonthlyPostListView.class.php");
require(APP_VIEW_DIR."postRead/ReadPostView.class.php");
require(APP_VIEW_DIR."pageRead/ReadPageView.class.php");
require(APP_VIEW_DIR."search/SearchView.class.php");
require(APP_VIEW_DIR."rss/RSSView.class.php");

// Autoloading

function __autoload($classname)
{
	if (file_exists(MAIN_DIR."view/".$classname.".class.php")) require(MAIN_DIR."view/".$classname.".class.php");

	if (file_exists(APP_CONTR_DIR.$classname.".class.php")) require(APP_CONTR_DIR.$classname.".class.php");
	if (file_exists(APP_CONTR_DIR."forms/".$classname.".class.php")) require(APP_CONTR_DIR."forms/".$classname.".class.php");
	if (file_exists(APP_CONTR_DIR."exceptions/".$classname.".class.php")) require(APP_CONTR_DIR."exceptions/".$classname.".class.php");
	if (file_exists(APP_VIEW_DIR.$classname.".class.php")) require(APP_VIEW_DIR.$classname.".class.php");

	if (file_exists(MODEL_DIR.$classname.".php")) require(MODEL_DIR.$classname.".php");

	DIYFrameworkLoader::__autoload($classname, "lib/diy-framework/classes/diy-framework/");
}

// Runs controller

FrontEndController::getInstance()->process(Request::getInstance(), Response::getInstance(), FrontEndMapping::getInstance());

$time = microtime();
$time = explode(" ", $time);
$time = $time[1] + $time[0];
$endtime = $time;
$totaltime = ($endtime - $begintime);
//print "PHP parsed this page in ".$totaltime." seconds.";

?>
Return current item: DIY Blog