Fix: [ bug #648 ] Warning into instalation

Install must use new log modules.
This commit is contained in:
Laurent Destailleur 2012-12-27 15:22:40 +01:00
parent f9700dc941
commit c7b3f2099e

View File

@ -200,7 +200,6 @@ if (constant('DOL_DATA_ROOT') && file_exists($lockfile))
// Force usage of log file for install and upgrades // Force usage of log file for install and upgrades
$conf->syslog->enabled=1; $conf->syslog->enabled=1;
$conf->global->SYSLOG_LEVEL=constant('LOG_DEBUG'); $conf->global->SYSLOG_LEVEL=constant('LOG_DEBUG');
if (! defined('SYSLOG_FILE_ON')) define('SYSLOG_FILE_ON',1);
if (! defined('SYSLOG_FILE')) // To avoid warning on systems with constant already defined if (! defined('SYSLOG_FILE')) // To avoid warning on systems with constant already defined
{ {
if (@is_writable('/tmp')) define('SYSLOG_FILE','/tmp/dolibarr_install.log'); if (@is_writable('/tmp')) define('SYSLOG_FILE','/tmp/dolibarr_install.log');
@ -211,6 +210,26 @@ if (! defined('SYSLOG_FILE')) // To avoid warning on systems with constant alrea
//print 'SYSLOG_FILE='.SYSLOG_FILE;exit; //print 'SYSLOG_FILE='.SYSLOG_FILE;exit;
} }
if (! defined('SYSLOG_FILE_NO_ERROR')) define('SYSLOG_FILE_NO_ERROR',1); if (! defined('SYSLOG_FILE_NO_ERROR')) define('SYSLOG_FILE_NO_ERROR',1);
// We init log handler for install
$handlers = array('mod_syslog_file');
foreach ($handlers as $handler)
{
$file = DOL_DOCUMENT_ROOT.'/core/modules/syslog/'.$handler.'.php';
if (!file_exists($file))
{
throw new Exception('Missing log handler file '.$handler.'.php');
}
require_once $file;
$loghandlerinstance = new $handler();
if (!$loghandlerinstance instanceof LogHandlerInterface)
{
throw new Exception('Log handler does not extend LogHandlerInterface');
}
$conf->loghandlers[]=$loghandlerinstance;
}
// Removed magic_quotes // Removed magic_quotes
if (function_exists('get_magic_quotes_gpc')) // magic_quotes_* removed in PHP 5.4 if (function_exists('get_magic_quotes_gpc')) // magic_quotes_* removed in PHP 5.4