phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: phpgwapi/inc functions.inc.php,1.127,1.128


From: Dan Kuykendall <address@hidden>
Subject: [Phpgroupware-cvs] CVS: phpgwapi/inc functions.inc.php,1.127,1.128
Date: Thu, 14 Feb 2002 13:57:13 -0500

Update of /cvsroot/phpgroupware/phpgwapi/inc
In directory subversions:/tmp/cvs-serv25557/phpgwapi/inc

Modified Files:
        functions.inc.php 
Log Message:
extending print_debug() to be able to trap the data and toss it into a database 
as an option

Index: functions.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/functions.inc.php,v
retrieving revision 1.127
retrieving revision 1.128
diff -C2 -r1.127 -r1.128
*** functions.inc.php   14 Feb 2002 07:29:26 -0000      1.127
--- functions.inc.php   14 Feb 2002 18:57:11 -0000      1.128
***************
*** 73,78 ****
        function print_debug($message,$var = 'messageonly',$part = 'app', 
$level = 3)
        {
!               if (($part == 'app' && DEBUG_APP == True) || ($part == 'api' && 
DEBUG_API == True))
                {
                        if ($level >= DEBUG_LEVEL)
                        {
--- 73,82 ----
        function print_debug($message,$var = 'messageonly',$part = 'app', 
$level = 3)
        {
!               if (($part == 'app' && EXP_DEBUG_APP == True) || ($part == 
'api' && DEBUG_API == True))
                {
+                       if (!defined('DEBUG_OUTPUT'))
+                       {
+                               define('DEBUG_OUTPUT', 1);
+                       }
                        if ($level >= DEBUG_LEVEL)
                        {
***************
*** 83,100 ****
                                                if (!DEBUG_DATATYPES)
                                                {
!                                                       echo 
"$message\n$var<br>\n";
                                                }
                                                else
                                                {
!                                                       echo "$message\n$var is 
a ".gettype($var)."<br>\n";
                                                }
                                        }
                                        else
                                        {
!                                               echo "$message<br>\n";
                                        }
                                }
                                else
                                {
                                        echo "<pre>\n$message\n";
                                        print_r($var);
--- 87,132 ----
                                                if (!DEBUG_DATATYPES)
                                                {
!                                                       $output = 
"$message\n$var";
                                                }
                                                else
                                                {
!                                                       $output = 
"$message\n$var is a ".gettype($var);
                                                }
                                        }
                                        else
                                        {
!                                               $output = $message;
!                                       }
! 
!                                       /* Bit 1 means to output to screen */
!                                       if (!!(DEBUG_OUTPUT & 1))
!                                       {
!                                               echo "$output<br>\n";
!                                       }
!                                       /* Bit 2 means to output to sql */
!                                       if (!!(DEBUG_OUTPUT & 2))
!                                       {
!                                               /* Need to flesh this out 
still. I dont have a table to dump this in yet.*/
!                                               /* So the SQL statement will go 
here*/
                                        }
+ 
+                                       /* Example of how this can be extended 
to output to other locations as well. This example uses a COM object */
+                                       /*
+                                       if (!!(DEBUG_OUTPUT & 32))
+                                       {
+                                               $obj_debug = new 
COM('Some_COM_App.Class','localhost');
+                                               if (is_object($obj_debug))
+                                               {
+                                                       $DebugMessage_return = 
$obj_debug->DebugMessage($output);
+                                               }
+                                       }
+                                       */
                                }
                                else
                                {
+                                       if (floor(phpversion()) > 3 && 
!!(DEBUG_OUTPUT & 2))
+                                       {
+                                               ob_start();
+                                       }
                                        echo "<pre>\n$message\n";
                                        print_r($var);
***************
*** 103,107 ****
                                                while(list($key, $value) = 
each($var))
                                                {
-                                                       //echo 'Array['.$key.'] 
is a '.gettype($var[$key])."\n";
                                                        if (is_array($value))
                                                        {
--- 135,138 ----
***************
*** 117,120 ****
--- 148,162 ----
                                        }
                                        echo "\n<pre>\n";
+                                       if (floor(phpversion()) > 3 && 
!!(DEBUG_OUTPUT & 2))
+                                       {
+                                               $output .= ob_get_contents();
+                                               ob_end_clean();
+                                               /* Need to flesh this out 
still. I dont have a table to dump this in yet.*/
+                                               /* So the SQL statement will go 
here*/
+                                               if (!!(DEBUG_OUTPUT & 1))
+                                               {
+                                                       echo "$output<br>\n";
+                                               }
+                                       }
                                }
                        }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]