[geeklog-cvs] geeklog: Updated lib-common to work with test suite (require ord...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Thu Jul 30 15:17:03 EDT 2009


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/d39f57b6372d
changeset: 7211:d39f57b6372d
user:      Sean Clark <sc1245 at messiah.edu>
date:      Thu Jul 30 15:17:04 2009 -0400
description:
Updated lib-common to work with test suite (require order altered) and COM_debug fixed

diffstat:

 public_html/lib-common.php |  62 ++++++++++++-------------------
 1 files changed, 24 insertions(+), 38 deletions(-)

diffs (100 lines):

diff -r 45b48a8521db -r d39f57b6372d public_html/lib-common.php
--- a/public_html/lib-common.php	Thu Jul 30 21:00:35 2009 +0200
+++ b/public_html/lib-common.php	Thu Jul 30 15:17:04 2009 -0400
@@ -70,7 +70,7 @@
 *
 * Must make sure that the function hasn't been disabled before calling it.
 *
-*/
+*/ 
 if (function_exists('set_error_handler')) {
     if (PHP_VERSION >= 5) {
         /* Tell the error handler to use the default error reporting options.
@@ -159,6 +159,14 @@
     }
 }
 
+/**
+* Include plugin class.
+* This is a poorly implemented class that was not very well thought out.
+* Still very necessary
+*
+*/
+
+require_once( $_CONF['path_system'] . 'lib-plugins.php' );
 
 /**
 * Include page time -- used to time how fast each page was created
@@ -187,15 +195,6 @@
 require_once( $_CONF['path_system'] . 'classes/template.class.php' );
 
 /**
-* This is the database library.
-*
-* Including this gives you a working connection to the database
-*
-*/
-
-require_once( $_CONF['path_system'] . 'lib-database.php' );
-
-/**
 * This is the security library used for application security
 *
 */
@@ -231,15 +230,6 @@
 require_once( $_CONF['path_system'] . 'lib-custom.php' );
 
 /**
-* Include plugin class.
-* This is a poorly implemented class that was not very well thought out.
-* Still very necessary
-*
-*/
-
-require_once( $_CONF['path_system'] . 'lib-plugins.php' );
-
-/**
 * Session management library
 *
 */
@@ -1801,25 +1791,21 @@
 * under the GPL.  This is not used very much in the code but you can use it
 * if you see fit
 *
-* @param        array       $A      Array to loop through and print values for
-* @return   string  Formated HTML List
-*
-*/
-
-function COM_debug( $A )
-{
-    if( !empty( $A ))
-    {
-        $retval .= LB . '<pre><p>---- DEBUG ----</p>';
-
-        for( reset( $A ); $k = key( $A ); next( $A ))
-        {
-            $retval .= sprintf( "<li>%13s [%s]</li>\n", $k, $A[$k] );
-        }
-
-        $retval .= '<p>---------------</p></pre>' . LB;
-    }
-
+* @param    array   $array    Array to loop through and print values for
+* @return   string  $retval    Formatted HTML List
+*
+*/
+
+function COM_debug($array)
+{
+    $retval = '';    
+    if(!empty($array)) {
+        $retval = '<ul><pre><p>---- DEBUG ----</p>';
+        foreach($array as $k => $v) { 
+            $retval .= sprintf("<li>%13s [%s]</li>\n", $k, $v);
+        }
+        $retval .= '<p>---------------</p></pre></ul>';
+    }    
     return $retval;
 }
 



More information about the geeklog-cvs mailing list