[Pkg-monitoring-maintainers] Bug#839789: loganalyzer: update for syntax removals in PHP7.0

Nishanth Aravamudan nish.aravamudan at canonical.com
Tue Oct 4 22:39:05 UTC 2016


Package: loganalyzer
Version: 3.6.6+dfsg-3
Severity: important
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu yakkety ubuntu-patch

Dear Maintainer,

In Ubuntu, the attached patch was applied to achieve the following:

  * debian/patches/update_for_php7_removals.patch: PHP7.0 has removed
    same-named constructors and the \e modifier to preg_replace.  Closes
    LP: #1575543.

Thanks for considering the patch.

*** /tmp/tmpms9N8N/loganalyzer_3.6.6+dfsg-3ubuntu1.debdiff
diff -Nru loganalyzer-3.6.6+dfsg/debian/patches/series loganalyzer-3.6.6+dfsg/debian/patches/series
--- loganalyzer-3.6.6+dfsg/debian/patches/series	2016-05-22 01:05:53.000000000 -0700
+++ loganalyzer-3.6.6+dfsg/debian/patches/series	2016-10-04 15:13:22.000000000 -0700
@@ -1 +1,2 @@
 01-remove-tracking-image.patch
+update_for_php7_removals.patch
diff -Nru loganalyzer-3.6.6+dfsg/debian/patches/update_for_php7_removals.patch loganalyzer-3.6.6+dfsg/debian/patches/update_for_php7_removals.patch
--- loganalyzer-3.6.6+dfsg/debian/patches/update_for_php7_removals.patch	1969-12-31 16:00:00.000000000 -0800
+++ loganalyzer-3.6.6+dfsg/debian/patches/update_for_php7_removals.patch	2016-10-04 15:13:31.000000000 -0700
@@ -0,0 +1,68 @@
+Description: PHP7.0 has removed same-named constructors and the \e modifier to preg_replace
+Author: Nishanth Aravamudan <nish.aravamudan at canonical.com>
+Bug: https://github.com/rsyslog/loganalyzer/issues/14
+Bug-Ubuntu: https://launchpad.net/bugs/1575543
+
+--- a/src/classes/class_template.php
++++ b/src/classes/class_template.php
+@@ -59,7 +59,7 @@
+ 	var $extension  = '';
+ 	var $template,  $vars,  $page;
+ 
+-	function Template ($fname = '') {
++	function __construct ($fname = '') {
+ 		if ($fname)
+ 			$this->filename  =  $fname;
+ 	}
+@@ -200,7 +200,7 @@
+ 						$template = str_replace('{'.$k.'}',  "$v",  $template);
+ 
+ 						// Replace variables with options, use Callback function!
+-						$template = preg_replace( '/{'.$k.':(.*?):(.*?)}/ie', 'InsertTemplateVariable("$v", "\\1", "\\2")', $template );
++						$template = preg_replace_callback( '/{'.$k.':(.*?):(.*?)}/i', function ($m) { return InsertTemplateVariable("$v", "$m[1]", "$m[2]"); }, $template );
+ 					}
+ 				}
+ 			}
+@@ -334,4 +334,4 @@
+ 	return $szResult; 
+ }
+ 
+-?>
+\ No newline at end of file
++?>
+--- a/src/classes/logstreamdisk.class.php
++++ b/src/classes/logstreamdisk.class.php
+@@ -63,7 +63,7 @@
+ 	private $_lastPageUID = -1;
+ 
+ 	// Constructor
+-	public function LogStreamDisk($streamConfigObj) {
++	public function __construct($streamConfigObj) {
+ 		$this->_logStreamConfigObj = $streamConfigObj;
+ 	}
+ 
+@@ -1086,4 +1086,4 @@
+ 		$this->_p_buffer = -1;
+ 	}
+ }
+-?>
+\ No newline at end of file
++?>
+--- a/src/classes/logstreamlineparsersyslog.class.php
++++ b/src/classes/logstreamlineparsersyslog.class.php
+@@ -52,7 +52,7 @@
+ //	protected $_arrProperties = null;
+ 
+ 	// Constructor
+-	public function LogStreamLineParsersyslog() {
++	public function __construct() {
+ 		return; // Nothing
+ 	}
+ 
+@@ -148,4 +148,4 @@
+ 
+ }
+ 
+-?>
+\ No newline at end of file
++?>


-- System Information:
Debian Release: stretch/sid
  APT prefers yakkety
  APT policy: (500, 'yakkety'), (400, 'yakkety-proposed')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.8.0-17-generic (SMP w/4 CPU cores)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

-- 
Nishanth Aravamudan
Ubuntu Server
Canonical Ltd



More information about the Pkg-monitoring-maintainers mailing list