[pLog-svn] r3411 - in plog/trunk: . class class/controller

oscar at devel.lifetype.net oscar at devel.lifetype.net
Sun May 14 10:09:03 GMT 2006


Author: oscar
Date: 2006-05-14 10:09:01 +0000 (Sun, 14 May 2006)
New Revision: 3411

Added:
   plog/trunk/class/bootstrap.php
Modified:
   plog/trunk/admin.php
   plog/trunk/class/controller/controller.class.php
   plog/trunk/index.php
   plog/trunk/summary.php
Log:
added class/bootstrap.php, that executes all the required code to get an application started. I've moved the inclusion of the Exception class in there and made it optional (for PHP 4.x only) summary.php, admin.php and index.php now all call bootstrap.php as the first thing


Modified: plog/trunk/admin.php
===================================================================
--- plog/trunk/admin.php	2006-05-13 17:41:47 UTC (rev 3410)
+++ plog/trunk/admin.php	2006-05-14 10:09:01 UTC (rev 3411)
@@ -6,12 +6,12 @@
         define( "PLOG_CLASS_PATH", dirname(__FILE__)."/");
     }
 
+    include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
     include_once( PLOG_CLASS_PATH."class/controller/admincontroller.class.php" );
     include_once( PLOG_CLASS_PATH."class/net/http/session/sessionmanager.class.php" );
     include_once( PLOG_CLASS_PATH."class/dao/userinfo.class.php" );
     include_once( PLOG_CLASS_PATH."class/dao/bloginfo.class.php" );
     include_once( PLOG_CLASS_PATH."class/plugin/pluginmanager.class.php" );
-    include_once( PLOG_CLASS_PATH."class/misc/info.class.php" );
     include_once( PLOG_CLASS_PATH.'class/template/templatesets/templatesets.class.php' );
 
     ini_set("arg_seperator.output", "&");

Added: plog/trunk/class/bootstrap.php
===================================================================
--- plog/trunk/class/bootstrap.php	2006-05-13 17:41:47 UTC (rev 3410)
+++ plog/trunk/class/bootstrap.php	2006-05-14 10:09:01 UTC (rev 3411)
@@ -0,0 +1,15 @@
+<?php
+
+    /**
+     * This file provides all the code needed for bootstraping an application
+     * based on the LT framework such as setting error handles, loading base
+     * classes, etc
+     */
+    
+    // load the Exception class and set the needed error handlers for PHP 4.x
+    if(PHP_VERSION < 5)
+	    include_once( PLOG_CLASS_PATH."class/object/exception.class.php" );
+	    
+    // for performance logging purposes
+    include_once( PLOG_CLASS_PATH."class/misc/info.class.php" );    
+?>
\ No newline at end of file

Modified: plog/trunk/class/controller/controller.class.php
===================================================================
--- plog/trunk/class/controller/controller.class.php	2006-05-13 17:41:47 UTC (rev 3410)
+++ plog/trunk/class/controller/controller.class.php	2006-05-14 10:09:01 UTC (rev 3411)
@@ -13,12 +13,9 @@
      * There is also a dynamic class loader (ResourceClassLoader) that takes care of loading action classes 
      * from a certain set of folders.
      */
-
-
     
     include_once( PLOG_CLASS_PATH."class/action/action.class.php" );
 	include_once( PLOG_CLASS_PATH."class/controller/resourceclassloader.class.php" );
-    include_once( PLOG_CLASS_PATH."class/object/exception.class.php" );	
 
     //
     // various constants that will come handy

Modified: plog/trunk/index.php
===================================================================
--- plog/trunk/index.php	2006-05-13 17:41:47 UTC (rev 3410)
+++ plog/trunk/index.php	2006-05-14 10:09:01 UTC (rev 3411)
@@ -9,14 +9,15 @@
     if (!defined( "PLOG_CLASS_PATH" )) {
         define( "PLOG_CLASS_PATH", dirname(__FILE__)."/");
     }
-    
+
+    include_once( PLOG_CLASS_PATH."class/bootstrap.php" );    
     include_once( PLOG_CLASS_PATH."class/controller/blogcontroller.class.php" );
     include_once( PLOG_CLASS_PATH."class/net/http/session/sessionmanager.class.php" );
     include_once( PLOG_CLASS_PATH."class/dao/userinfo.class.php" );
     include_once( PLOG_CLASS_PATH."class/dao/bloginfo.class.php" );
     include_once( PLOG_CLASS_PATH."class/plugin/pluginmanager.class.php" );
     include_once( PLOG_CLASS_PATH."class/data/timestamp.class.php" );
-    include_once( PLOG_CLASS_PATH."class/misc/info.class.php" );
+
     
     // start gathering statistics
     Info::startMetrics();    

Modified: plog/trunk/summary.php
===================================================================
--- plog/trunk/summary.php	2006-05-13 17:41:47 UTC (rev 3410)
+++ plog/trunk/summary.php	2006-05-14 10:09:01 UTC (rev 3411)
@@ -8,7 +8,8 @@
      * Script that shows a summary page with the 'n' most recent additions
      * of all blogs in one page. Therefore, it is called a "Summary" :)
      */
-     
+
+    include_once( PLOG_CLASS_PATH."class/bootstrap.php" );     
     include_once( PLOG_CLASS_PATH."class/controller/controller.class.php" );
     include_once( PLOG_CLASS_PATH."class/net/http/httpvars.class.php" );
     include_once( PLOG_CLASS_PATH."class/misc/version.class.php" );
@@ -87,4 +88,7 @@
     //// main part ////
     $controller = new SummaryController();
     $controller->process( HttpVars::getRequest());
+    
+    // log statistics, only for debugging purposes
+    Info::logMetrics();
 ?>



More information about the pLog-svn mailing list