Index: trunk/index.php
===================================================================
diff -u -N -r875 -r1566
--- trunk/index.php (.../index.php) (revision 875)
+++ trunk/index.php (.../index.php) (revision 1566)
@@ -1,127 +1,34 @@
Init();
+$application->Run();
+$application->Done();
-if (!file_exists($pathtoroot."config.php")) {
- echo "In-Portal is probably not installed, or configuration file is missing.
";
- echo "Please use the installation script to fix the problem.
";
- echo "Go to installation script
";
- flush();
- die();
+$end = getmicrotime();
+
+if (defined('DEBUG_MODE')) {
+ echo '
Memory used: '.round(memory_get_usage()/1024/1024, 1).' Mb
';
+ echo 'Time used: '.round(($end - $start), 5).' Sec
';
}
-//ob_start();
-$FrontEnd=1;
+//print_pre(get_included_files());
-$indexURL="../../index.php"; //Set to relative URL from the theme directory
-
-/* initalize the in-portal system */
-include_once("kernel/startup.php");
-
-LogEntry("System Init Complete\n");
-/* load the current front-end language set */
-
-//$objLanguageCache->LoadLanguage($objSession->Get("Language"),0);
-
-$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path");
-
-//$secureURL = "https://".ThisDomain().$objConfig->Get("Site_Path");
-$secureURL = $rootURL;
-
-$html="No Template";
-
-if( !$var_list['t'] ) $var_list['t'] = 'index';
-
-if( !isset($CurrentTheme) ) $CurrentTheme = null;
-if( !is_object($CurrentTheme) ) $CurrentTheme = $objThemes->GetItem($m_var_list["theme"]);
-
-if(is_object($CurrentTheme))
-{
- if(!$CurrentTheme->Get("Enabled"))
- {
- $CurrentTheme = $objThemes->GetItem($objThemes->GetPrimaryTheme());
- }
- if((int)$CurrentTheme->Get("ThemeId")>0)
- {
- $timeout = $CurrentTheme->Get("CacheTimeout");
- $objLanguageCache->LoadTemplateCache($var_list["t"],$timeout,$CurrentTheme->Get("ThemeId"));
- $objLanguageCache->LoadCachedVars($objSession->Get("Language"));
-
- LogEntry("Language Set Loaded\n");
-
- $TemplateRoot = $CurrentTheme->ThemeDirectory()."/";
-
- LogEntry("Parsing Templates in $TemplateRoot\n");
- $objTemplate = new clsTemplateList($TemplateRoot);
- $html = $objTemplate->ParseTemplate($var_list["t"]);
- }
- else
- {
- echo "No Primary Theme Selected";
- die();
- }
-}
-else
-{
- echo "No Primary Theme Selected\n";
- die();
+function getmicrotime()
+{
+ list($usec, $sec) = explode(" ", microtime());
+ return ((float)$usec + (float)$sec);
}
-
-if(is_object($objSession))
-{
-
- $objSession->SetVariable("Template_Referer", $_local_t);
-}
-if($objTemplate->ErrorNo == -1)
-{
- $html = $objTemplate->ParseTemplate('error_template');
-}
-//$html = replacePngTags($html);
-LogEntry("Output Start\n");
-$html .= "";
-if( IsDebugMode() )
-{
- if($Action) $debugger->setHTMLByIndex(1,'Front Action: '.$Action.'','append');
- $html = 'Show Debugger
'.$html;
-}
-else
-{
- header("Content-length: ".strlen($html));
-}
-header("Connection-Type: Keep-Alive");
-echo $html;
-
-LogEntry("Output End\n");
-
-if( isset($template) && $template->ErrorNo != 0 )
-{
- print "\n(".$objTemplate->ErrorNo.") ".$objTemplate->ErrorStr."\n";
-}
-
-LogEntry("Output Complete\n");
-$objLanguageCache->SaveTemplateCache();
-LogEntry("Templates Cached\n");
-
-//if($objSession->SessionEnabled())
-// $objSession->SaveSessionData();
-//echo "Cookie: "; print_r($_COOKIE); echo "
\n";
-//ob_end_flush();
-$timeend = getmicrotime();
-$diff = $timeend - $timestart;
-
-LogEntry("\nTotal Queries Executed: $sqlcount in $totalsql seconds\n");
-LogEntry("\nPage Execution Time: $diff seconds\n", true);
-if($LogFile)
- fclose($LogFile);
-
-
-?>
+?>
\ No newline at end of file