mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Fix: Removed warning when FirePHP is on
This commit is contained in:
parent
72e6e954f6
commit
cd04d51ea7
|
|
@ -35,6 +35,7 @@ $error=0; $mesg='';
|
|||
$action = GETPOST("action");
|
||||
$syslog_file_on=(defined('SYSLOG_FILE_ON') && constant('SYSLOG_FILE_ON'))?1:0;
|
||||
$syslog_syslog_on=(defined('SYSLOG_SYSLOG_ON') && constant('SYSLOG_SYSLOG_ON'))?1:0;
|
||||
$syslog_firephp_on=(defined('SYSLOG_FIREPHP_ON') && constant('SYSLOG_FIREPHP_ON'))?1:0;
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -48,6 +49,7 @@ if ($action == 'set')
|
|||
|
||||
$res = dolibarr_del_const($db,"SYSLOG_FILE_ON",0);
|
||||
$res = dolibarr_del_const($db,"SYSLOG_SYSLOG_ON",0);
|
||||
$res = dolibarr_del_const($db,"SYSLOG_FIREPHP_ON",0);
|
||||
|
||||
if (! $error && GETPOST("filename"))
|
||||
{
|
||||
|
|
@ -93,6 +95,12 @@ if ($action == 'set')
|
|||
}
|
||||
}
|
||||
|
||||
if (! $error && isset($_POST['SYSLOG_FIREPHP_ON'])) // If firephp no available, post is not present
|
||||
{
|
||||
$syslog_firephp_on=GETPOST('SYSLOG_FIREPHP_ON');
|
||||
if (! $error) $res = dolibarr_set_const($db,"SYSLOG_FIREPHP_ON",$syslog_firephp_on,'chaine',0,'',0);
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
|
|
@ -165,19 +173,40 @@ print "</tr>\n";
|
|||
$var=true;
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="140"><input '.$bc[$var].' type="checkbox" name="SYSLOG_FILE_ON" '.$option.' value="1" '.($syslog_file_on?" checked":"").'> '.$langs->trans("SyslogSimpleFile").'</td>';
|
||||
print '<tr '.$bc[$var].'><td width="140"><input '.$bc[$var].' type="checkbox" name="SYSLOG_FILE_ON" '.$option.' value="1" '.($syslog_file_on?' checked="checked"':'').'> '.$langs->trans("SyslogSimpleFile").'</td>';
|
||||
print '<td width="250" nowrap="nowrap">'.$langs->trans("SyslogFilename").': <input type="text" class="flat" name="filename" '.$option.' size="60" value="'.$defaultsyslogfile.'">';
|
||||
print '</td>';
|
||||
print "<td align=\"left\">".$html->textwithpicto('',$langs->trans("YouCanUseDOL_DATA_ROOT"));
|
||||
print '</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="140"><input '.$bc[$var].' type="checkbox" name="SYSLOG_SYSLOG_ON" '.$option.' value="1" '.($syslog_syslog_on?" checked":"").'> '.$langs->trans("SyslogSyslog").'</td>';
|
||||
print '<tr '.$bc[$var].'><td width="140"><input '.$bc[$var].' type="checkbox" name="SYSLOG_SYSLOG_ON" '.$option.' value="1" '.($syslog_syslog_on?' checked="checked"':'').'> '.$langs->trans("SyslogSyslog").'</td>';
|
||||
print '<td width="250" nowrap="nowrap">'.$langs->trans("SyslogFacility").': <input type="text" class="flat" name="facility" '.$option.' value="'.$defaultsyslogfacility.'">';
|
||||
print '</td>';
|
||||
print "<td align=\"left\">".$html->textwithpicto('','Only LOG_USER supported on Windows');
|
||||
print '</td></tr>';
|
||||
|
||||
try
|
||||
{
|
||||
set_include_path('/usr/share/php/');
|
||||
@require_once('FirePHPCore/FirePHP.class.php');
|
||||
restore_include_path();
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="140"><input '.$bc[$var].' type="checkbox" name="SYSLOG_FIREPHP_ON" '.$option.' value="1" ';
|
||||
if (class_exists('FirePHP')) print ' disabled="disabled"';
|
||||
else print ($syslog_firephp_on?' checked="checked"':"");
|
||||
print '> '.$langs->trans("FirePHP").'</td>';
|
||||
print '<td width="250" nowrap="nowrap">';
|
||||
print '</td>';
|
||||
print "<td align=\"left\">".$html->textwithpicto('','FirePHP must be installed onto PHP and FirePHP plugin for Firefox must also be installed');
|
||||
print '</td></tr>';
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
// Do nothing
|
||||
print '<!-- FirePHP no available into PHP -->'."\n";
|
||||
}
|
||||
|
||||
print "</table>\n";
|
||||
print "</form>\n";
|
||||
|
||||
|
|
|
|||
|
|
@ -487,10 +487,20 @@ function dol_syslog($message, $level=LOG_INFO)
|
|||
// Check if log is to syslog (SYSLOG_FIREPHP_ON defined)
|
||||
if (defined("SYSLOG_FIREPHP_ON") && constant("SYSLOG_FIREPHP_ON"))
|
||||
{
|
||||
require_once(SYSLOG_FIREPHP_PATH.'FirePHPCore/FirePHP.class.php');
|
||||
ob_start();
|
||||
$firephp = FirePHP::getInstance(true);
|
||||
$firephp->log($message);
|
||||
try
|
||||
{
|
||||
// Warning FirePHPCore must be into PHP include path. It is not possible to use into require_once() a constant from
|
||||
// database or config file because we must be able to log data before database or config file read.
|
||||
set_include_path('/usr/share/php/');
|
||||
require_once('FirePHPCore/FirePHP.class.php');
|
||||
restore_include_path();
|
||||
ob_start();
|
||||
$firephp = FirePHP::getInstance(true);
|
||||
$firephp->log($message);
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user