[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: phpgwapi/inc functions.inc.php,1.122,1.123
From: |
Dan Kuykendall <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: phpgwapi/inc functions.inc.php,1.122,1.123 |
Date: |
Tue, 12 Feb 2002 04:10:44 -0500 |
Update of /cvsroot/phpgroupware/phpgwapi/inc
In directory subversions:/tmp/cvs-serv25344/phpgwapi/inc
Modified Files:
functions.inc.php
Log Message:
fixed header to use and added my debug constants along with my replacement for
print_debug
Index: functions.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/functions.inc.php,v
retrieving revision 1.122
retrieving revision 1.123
diff -C2 -r1.122 -r1.123
*** functions.inc.php 9 Feb 2002 21:19:22 -0000 1.122
--- functions.inc.php 12 Feb 2002 09:10:39 -0000 1.123
***************
*** 1,4 ****
<?php
- /* $GLOBALS['debugme'] = "on"; */
/**************************************************************************\
* phpGroupWare API - phpgwapi loader
*
--- 1,3 ----
***************
*** 46,49 ****
--- 45,87 ----
/*!
+ @function print_debug
+ @abstract print debug data only when debugging mode is turned on.
+ @author seek3r
+ @discussion This function is used to debugging data.
+ @syntax print_debug('message', $somevar);
+ @example print_debug('this is some debugging data',$somevar);
+ */
+ 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)
+ {
+ if (!is_array($var))
+ {
+ if ($var != 'messageonly')
+ {
+ echo "$message is a
".gettype($var)."<br>\n";
+ }
+ else
+ {
+ echo "$message<br>\n";
+ }
+ }
+ else
+ {
+ echo "<pre>\n$message\n";
+ print_r($var);
+ while(list($key, $value) = each($var))
+ {
+ echo 'Array['.$key.'] is a
'.gettype($var[$key])."\n";
+ }
+ echo "\n<pre>\n";
+ }
+ }
+ }
+ }
+
+ /*!
@function sanitize
@abstract Validate data.
***************
*** 467,494 ****
}
function _debug_array($array)
{
! if(floor(phpversion()) == 4)
! {
! ob_start();
! echo '<pre>'; print_r($array); echo '</pre>';
! $contents = ob_get_contents();
! ob_end_clean();
! echo $contents;
! // return $contents;
! }
! else
! {
! echo '<pre>'; var_dump($array); echo '</pre>';
! }
! }
!
! function print_debug($text='')
! {
! if (isset($GLOBALS['debugme']) &&
! $GLOBALS['debugme'] == 'on')
! {
! echo 'debug: '.$text.'<br>';
! }
}
--- 505,512 ----
}
+ /* Just a wrapper to my new print_r() function I added to the php3
support file. Seek3r */
function _debug_array($array)
{
! print_r($array);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: phpgwapi/inc functions.inc.php,1.122,1.123,
Dan Kuykendall <address@hidden> <=