From cc1c2872365f7830275e91f7c87c548051f61bd9 Mon Sep 17 00:00:00 2001 From: Yann <yann@cactuspro.com> Date: Wed, 20 Jun 2018 08:30:14 +0200 Subject: [PATCH 1/4] Update syslog.class.php Typo fix --- syslog.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syslog.class.php b/syslog.class.php index 306dab7..d4eada0 100644 --- a/syslog.class.php +++ b/syslog.class.php @@ -2,7 +2,7 @@ /** * The Syslog class is a syslog client implementation in PHP * following the RFC 3164, 5424, 5425, 5426 rules. - * This class is compatible with PHP logger constants for serverity and facility. + * This class is compatible with PHP logger constants for severity and facility. * Default value are UDP connection with RFC3164 mode * * Facility values: From 0e48e281b05b0d3d41467f1cf2eb0ccf32f8802b Mon Sep 17 00:00:00 2001 From: alexnas <a.naschekin@mypsw.ru> Date: Mon, 20 Feb 2023 19:34:38 +0300 Subject: [PATCH 2/4] syslog.class.php 618 - if($this->_rfc == NET_SYSLOG_RFC542X && $this->protocol == NET_SYSLOG_TLS) { + if($this->_rfc == NET_SYSLOG_RFC542X && $this->_protocol == NET_SYSLOG_TLS) { --- syslog.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syslog.class.php b/syslog.class.php index d4eada0..e67f2de 100644 --- a/syslog.class.php +++ b/syslog.class.php @@ -615,7 +615,7 @@ public function logger($priority = 133, $content = "Default content", $this->openSocket(); // RFC 5425 - if($this->_rfc == NET_SYSLOG_RFC542X && $this->protocol == NET_SYSLOG_TLS) { + if($this->_rfc == NET_SYSLOG_RFC542X && $this->_protocol == NET_SYSLOG_TLS) { $message = strlen($message)." ".$message; } From 6aea60957b72a2da322838347177b53e8a6a4d55 Mon Sep 17 00:00:00 2001 From: alexnas <a.naschekin@mypsw.ru> Date: Mon, 20 Feb 2023 19:37:52 +0300 Subject: [PATCH 3/4] https://github.com/leirn/php.syslog.class/blob/master/syslog.class.php 305 - public function Net_Syslog($hostname = "", $appname = NET_SYSLOG_NILVALUE, + public function __construct($hostname = "", $appname = NET_SYSLOG_NILVALUE, PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Net_Syslog has a deprecated constructor in php.syslog.class-master/syslog.class.php on line 218 --- syslog.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syslog.class.php b/syslog.class.php index e67f2de..8951fb9 100644 --- a/syslog.class.php +++ b/syslog.class.php @@ -302,7 +302,7 @@ class Net_Syslog * @access public * @see Net_Syslog */ - public function Net_Syslog($hostname = "", $appname = NET_SYSLOG_NILVALUE, + public function __construct($hostname = "", $appname = NET_SYSLOG_NILVALUE, $protocol = NET_SYSLOG_UDP, $procid = NET_SYSLOG_NILVALUE ) { $this->_rfc = NET_SYSLOG_RFC3164; From 38d08f25c6c7629d10b4bff61c2a6596c3e7ea72 Mon Sep 17 00:00:00 2001 From: leirn <laurent@vromman.org> Date: Fri, 10 Mar 2023 12:23:49 +0100 Subject: [PATCH 4/4] Indentation issue --- syslog.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/syslog.class.php b/syslog.class.php index 8951fb9..fa079b4 100644 --- a/syslog.class.php +++ b/syslog.class.php @@ -610,13 +610,13 @@ public function logger($priority = 133, $content = "Default content", if(strlen($this->_appname) > 0) $tag = substr($this->_appname, 0 , 32).": "; $message = substr($header.$tag.$content, 0, 1024); - } + } - $this->openSocket(); + $this->openSocket(); - // RFC 5425 - if($this->_rfc == NET_SYSLOG_RFC542X && $this->_protocol == NET_SYSLOG_TLS) { - $message = strlen($message)." ".$message; + // RFC 5425 + if($this->_rfc == NET_SYSLOG_RFC542X && $this->_protocol == NET_SYSLOG_TLS) { + $message = strlen($message)." ".$message; } fwrite($this->_socket, $message);