Bug 148009 - [patch] port graphics/pear-Image_Graph fix php53 issues part2
Summary: [patch] port graphics/pear-Image_Graph fix php53 issues part2
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Martin Wilke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-20 14:40 UTC by Olli Hauer
Modified: 2010-07-12 07:40 UTC (History)
1 user (show)

See Also:


Attachments
patch_pear-Image_Graph_2010-06-12.txt (1.95 KB, text/plain)
2010-06-20 14:40 UTC, Olli Hauer
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Olli Hauer 2010-06-20 14:40:04 UTC
I was ask by a view others to extend my last patch, since not
all Issues where fixed. I send them this patch and got positive
feedback so it seems the Issues are fixed.


Fix details:

Use DOS2UNIX_REGEX (do not modify images!)

Fix some issues with pear-Image_Graph in combination with php5.3
 PHP Deprecated messages
  - Assigning the return value of new by reference
  - Call-time pass-by-reference has been deprecated

  - In Graph.php 's|=& new|= new|g' (was overseen in last patch)
  - replace ereg with preg_match (extra-patch)
  - additional in all patched files 's|PHP versions 4 and 5|PHP version 5|'
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2010-06-20 14:40:13 UTC
Responsible Changed
From-To: freebsd-ports-bugs->miwi

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Olli Hauer 2010-06-20 15:09:55 UTC
Arrrg, please use this patch.
It replace additional 's|PHP versions 4 and 5|PHP version 5|g'
in all php source files.

This is no functionality change but if someone looks into the patched
source it is clean to not use them with php4.


--- patch_pear-Image_Graph_2010-06-13.txt begins here ---
Index: files/extra-patch-Graph__Layout.php
===================================================================
--- files/extra-patch-Graph__Layout.php	(revision 0)
+++ files/extra-patch-Graph__Layout.php	(revision 3)
@@ -0,0 +1,11 @@
+--- ./Graph/Layout.php.orig	2010-06-14 17:05:41.000000000 +0200
++++ ./Graph/Layout.php	2010-06-14 17:06:24.000000000 +0200
+@@ -175,7 +175,7 @@
+     function _push($edge, $size = '100%')
+     {
+         $result = array();
+-        if (ereg("([0-9]*)\%", $size, $result)) {
++        if (preg_match("/([0-9]*)\%/", $size, $result)) {
+             $this->_alignSize[$edge] = array(
+                 'value' => min(100, max(0, $result[1])),
+                 'unit' => 'percentage'

Index: Makefile
===================================================================
--- Makefile	(revision 1)
+++ Makefile	(working copy)
@@ -7,7 +7,7 @@
 
 PORTNAME=	Image_Graph
 PORTVERSION=	0.7.2
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	graphics www pear
 
 MAINTAINER=	miwi@FreeBSD.org
@@ -19,6 +19,7 @@
 
 USE_PHP=	yes
 USE_DOS2UNIX=	yes
+DOS2UNIX_REGEX=	.*php$$
 
 CATEGORY=	Image
 FILES=		Graph.php Graph/Axis.php Graph/Common.php Graph/Config.php \
@@ -179,9 +180,27 @@
 .if ${PHP_VER} != 4
 .for file in ${FILES}
 	@if ${ECHO_CMD} ${file} | ${GREP} -q -e "php$$" ; then \
-		${REINPLACE_CMD} -e 's|parent::Image[^(]*|parent::__construct|' ${WRKSRC}/${file}; \
+		${REINPLACE_CMD} -e 's|parent::Image[^(]*|parent::__construct|' \
+			-e 's|PHP versions 4 and 5|PHP version 5|' ${WRKSRC}/${file}; \
 	fi
 .endfor
+# fix PHP Deprecated messages
+# - Assigning the return value of new by reference
+# - Call-time pass-by-reference has been deprecated
+.for file in ${DOCS}
+	@if ${ECHO_CMD} ${file} | ${GREP} -q -e "php$$" ; then \
+		${REINPLACE_CMD} -e 's|=& |= |g' -e 's| &\$$| \$$|g' \
+		${WRKSRC}/docs/${file}; \
+	fi
+.endfor
+.for file in ${TESTS}
+	@if ${ECHO_CMD} ${file} | ${GREP} -q -e "php$$" ; then \
+		${REINPLACE_CMD} -e 's|PHP versions 4 and 5|PHP version 5|' \
+		${WRKSRC}/tests/${file}; \
+	fi
+.endfor
+	@${REINPLACE_CMD} -e 's|=& new|= new|g' ${WRKSRC}/Graph.php
+EXTRA_PATCHES+= ${FILESDIR}/extra-patch-Graph__Layout.php
 .endif
 
 .include "${PORTSDIR}/devel/pear/bsd.pear.mk"
--- patch_pear-Image_Graph_2010-06-13.txt ends here ---
Comment 3 Martin Wilke freebsd_committer freebsd_triage 2010-07-12 07:40:09 UTC
State Changed
From-To: open->closed

Committed. Thanks!