From cca3b041a52b1a0b9b02de4237e049db6b988550 Mon Sep 17 00:00:00 2001 From: Regis Houssin <regis@dolibarr.fr> Date: Mon, 19 Oct 2009 19:10:51 +0000 Subject: [PATCH] Fix: Deprecated since php 5.3.0, syslog variables no longer need to be initialized --- htdocs/install/inc.php | 5 ++++- htdocs/lib/functions.lib.php | 1 - htdocs/support/inc.php | 5 ++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index 7fe2fb39c2a..d39b58452d6 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -46,7 +46,10 @@ if (isset($_SERVER["DOCUMENT_URI"]) && $_SERVER["DOCUMENT_URI"]) // Definition des constantes syslog if (function_exists("define_syslog_variables")) { - define_syslog_variables(); + if (version_compare(PHP_VERSION, '5.3.0', '<')) + { + define_syslog_variables(); // Deprecated since php 5.3.0, syslog variables no longer need to be initialized + } } else { diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index cf956be5784..7e217e117fd 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -293,7 +293,6 @@ function dol_syslog($message, $level=LOG_INFO) { $facility = LOG_USER; - //define_syslog_variables(); already defined in master.inc.php if (defined("SYSLOG_FACILITY") && SYSLOG_FACILITY) { // Exemple: SYSLOG_FACILITY vaut LOG_USER qui vaut 8. On a besoin de 8 dans $facility. diff --git a/htdocs/support/inc.php b/htdocs/support/inc.php index 65ed8d12480..d2f48c0c87b 100644 --- a/htdocs/support/inc.php +++ b/htdocs/support/inc.php @@ -44,7 +44,10 @@ if (isset($_SERVER["DOCUMENT_URI"]) && $_SERVER["DOCUMENT_URI"]) // Definition des constantes syslog if (function_exists("define_syslog_variables")) { - define_syslog_variables(); + if (version_compare(PHP_VERSION, '5.3.0', '<')) + { + define_syslog_variables(); // Deprecated since php 5.3.0, syslog variables no longer need to be initialized + } } else { -- GitLab