<?php

$time_start = microtime(TRUE);

ini_set("error_reporting",E_ALL);
ini_set("display_errors","On");

include "./_cfg.php";
$_root = "./";
include $_root . "_path.php";
include $_root . "_init.php";
include "./_functions.php";

checkPHP5($_cfg['min_php_version']);

$app = new cApp();
ob_start();
echo $app->run();
$str = ob_get_contents();
ob_end_clean();

if ($app->oSession->logged()) $app->oSession->updateLastLogin($app->oSession->idUser);

$time_end = microtime(TRUE);

echo $str;
$time_debug = FALSE;
if (!$time_debug)
	echo "\n" . '<!-- Time: '.($time_end - $time_start).'  -->';
else
	echo "\n" . '<p>Time: '.($time_end - $time_start).'</p>';

?>