phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] api/class.msgbox.php, 1.1.1.1.2.8


From: nomail
Subject: [Phpgroupware-cvs] api/class.msgbox.php, 1.1.1.1.2.8
Date: Thu, 20 May 2004 16:07:28 -0000

Update of /api
Modified Files:
        Branch: proposal-branch
          class.msgbox.php

date: 2004/04/16 20:59:48;  author: seek3r;  state: Exp;  lines: +27 -18

Log Message:
bringing savannah cvs back up to date with what we were doing on our private 
cvs server. We will not be doing dev from this cvs tree
=====================================================================
No syntax errors detected in -
=====================================================================
Index: api/class.msgbox.php
diff -u api/class.msgbox.php:1.1.1.1.2.7 api/class.msgbox.php:1.1.1.1.2.8
--- api/class.msgbox.php:1.1.1.1.2.7    Sat Jan 31 19:07:22 2004
+++ api/class.msgbox.php        Fri Apr 16 20:59:48 2004
@@ -35,15 +35,24 @@
                */
 
                //function add()
-               function add($text, $line, $file, $type='notice',$debug_data = 
'##NOTSET##')
+               function add($text, $type='notice', $debug_data = NOTSET ,$file 
= NOTSET ,$line = NOTSET)
                {
+                       if($file == NOTSET && $line == NOTSET)
+                       {
+                               $backtrace = debug_backtrace();
+                               $file = $backtrace[0]['file'];
+                               $line = $backtrace[0]['line'];
+                               $class = $backtrace[1]['class'];
+                               $function = $backtrace[1]['function'];
+                       }
+
                        /*
                        $args = new safe_args();
-                       $args->set('text', '##NOTSET##', 'string');
-                       $args->set('line', '##REQUIRED##', 'number');
-                       $args->set('file', '##REQUIRED##', 'file');
+                       $args->set('text', NOTSET, 'string');
+                       $args->set('line', REQUIRED, 'number');
+                       $args->set('file', REQUIRED, 'file');
                        $args->set('type','notice', 'text');
-                       $args = $args->get(func_get_args(),__LINE__,__FILE__);
+                       $args = $args->get(func_get_args());
                        $this->data[] = $args;
                        */
 
@@ -55,7 +64,7 @@
                                case 'fatal':
                                        $this->data[] = array('text'=>$text, 
'line'=>$line, 'file'=>$file, 'type'=>$type);
                                        
$GLOBALS['phpgw']->add_xsl('api.phpgw_empty');
-                                       $GLOBALS['phpgw']->finish(False);
+                                       $GLOBALS['phpgw']->finish(false);
                                        break;
                                case 'debug':
                                        if(is_array($debug_data) || 
is_object($debug_data))
@@ -82,11 +91,11 @@
                                        if($type == 'fataldebug')
                                        {
                                                
$GLOBALS['phpgw']->add_xsl('api.phpgw_empty');
-                                               
$GLOBALS['phpgw']->finish(False);
+                                               
$GLOBALS['phpgw']->finish(false);
                                        }
                                        break;
                                default:
-                                       $this->data[] = array('text'=>$text, 
'line'=>$line, 'file'=>$file, 'type'=>$type);
+                                       $this->data[] = array('text'=>$text, 
'line'=>$line, 'file'=>$file, 'type'=>$type, 'class'=>$class, 
'function'=>$function);
                        }
                }
 
@@ -104,19 +113,19 @@
                                {
                                        case 'error':
                                                $prefix = 'Error';
-                                               $withdebug = True;
+                                               $withdebug = true;
                                                break;
                                        case 'fatal':
                                                $prefix = 'Fatal error';
-                                               $withdebug = True;
+                                               $withdebug = true;
                                                break;
                                        case 'warning':
                                                $prefix = 'Warning';
-                                               $withdebug = True;
+                                               $withdebug = true;
                                                break;
                                                default :
                                                $prefix = 'Notice';
-                                               $withdebug = False;
+                                               $withdebug = false;
                                }
                                echo $prefix.': '.$val['text']; 
                                if($withdebug) { echo ' On line: 
'.$val['line'].' of '.$val['file']; }
@@ -133,19 +142,19 @@
                                {
                                        case 'error':
                                                $prefix = 'Error';
-                                               $withdebug = True;
+                                               $withdebug = true;
                                                break;
                                        case 'fatal':
                                                $prefix = 'Fatal error';
-                                               $withdebug = True;
+                                               $withdebug = true;
                                                break;
                                        case 'warning':
                                                $prefix = 'Warning';
-                                               $withdebug = True;
+                                               $withdebug = true;
                                                break;
                                                default :
                                                $prefix = 'Notice';
-                                               $withdebug = False;
+                                               $withdebug = false;
                                }
                                echo $prefix.': '.$val['text']; 
                                if($withdebug) { echo ' On line: 
'.$val['line'].' of '.$val['file']; }




reply via email to

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