<?php
/*
Copyright (C) 2001-2004 ZZOSS GbR, http://www.zzoss.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/**
@version $Id: Debug.php,v 1.1 2003/12/22 17:48:33 ordnas Exp $
@copyright Copyright © 2001-2004 ZZ/OSS GbR, http://www.zzoss.com
@license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License
*/
require_once 'System.php';
class ZZOSS_Debug {
function setOptions($options)
{
if(!isset($options['indent'])){
PEAR::raiseError('No indent defined');
return false;
}
$ZZOSS_Debug =& $GLOBALS['ZZOSS_Debug'][$options['indent']];
$ZZOSS_Debug['dir'] = $options['dir'];
}
function log($indent, $msg, $file = NULL, $line = NULL, $function = NULL, $class = NULL)
{/*
if(!isset($GLOBALS['ZZOSS_Debug'][$indent]['file'])){
return $GLOBALS['ZI']['setup_obj'];*/
$logfile = System::tmpdir().DIRECTORY_SEPARATOR.'zzoss_debug.log';
$log = "\n".'['.date('Y-m-d H:i:s').'] '.$indent.' '."\n";
$log .= " Message: ".$msg."\n";
if(!is_null($function)){
$log .= " Function: ";
if(!is_null($class)){
$log .= $class.'::';
}
$log .= $function.'() '."\n";
}
$log .= ' File: '.$file."\n".
" Line: ".$line."\n";
$fp = fopen($logfile,"a");
fputs($fp,$log);
fclose($fp);
}
}
?>