summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2015-06-09 15:09:21 +0200
committerRemi Collet <fedora@famillecollet.com>2015-06-09 15:09:21 +0200
commitd4c2f9c896a5a3bc495ba076d1c08d47c915f509 (patch)
treef02b08ab741d96f3fd3de3a76614f2d324a2cdf5
parent13fbd76b92f0f5daa77f36cd9f8684392e25767c (diff)
php-pecl-apcu: fix for the control panel + new scriptlets
-rw-r--r--apcu-pr.patch78
-rw-r--r--php-pecl-apcu.spec32
2 files changed, 102 insertions, 8 deletions
diff --git a/apcu-pr.patch b/apcu-pr.patch
new file mode 100644
index 0000000..434d9df
--- /dev/null
+++ b/apcu-pr.patch
@@ -0,0 +1,78 @@
+From 896b1643b4295a37fba4e0fb5cb8ffb3c10da851 Mon Sep 17 00:00:00 2001
+From: Remi Collet <fedora@famillecollet.com>
+Date: Tue, 9 Jun 2015 14:34:23 +0200
+Subject: [PATCH 1/2] use ['info'] instead of undefined ['key']
+
+---
+ apc.php | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/apc.php b/apc.php
+index cedf096..119d74e 100644
+--- a/apc.php
++++ b/apc.php
+@@ -915,7 +915,6 @@ function block_sort($array1, $array2)
+ }
+ $fieldname='info';
+ $fieldheading='User Entry Label';
+- $fieldkey='key';
+
+ $cols=6;
+ echo <<<EOB
+@@ -1041,7 +1040,7 @@ function block_sort($array1, $array2)
+ } else if ($MYREQUEST['OB'] == OB_USER_CACHE) {
+
+ echo '<td class="td-last center">';
+- echo '[<a href="', $MY_SELF, '&OB=', $MYREQUEST['OB'], '&DU=', urlencode($entry[$fieldkey]), '">Delete Now</a>]';
++ echo '[<a href="', $MY_SELF, '&OB=', $MYREQUEST['OB'], '&DU=', urlencode($entry[$fieldname]), '">Delete Now</a>]';
+ echo '</td>';
+ } else {
+ echo '<td class="td-last center"> &nbsp; </td>';
+
+From 20c53f1ee86a659d5316977096efe5edf03eb958 Mon Sep 17 00:00:00 2001
+From: Remi Collet <fedora@famillecollet.com>
+Date: Tue, 9 Jun 2015 14:36:25 +0200
+Subject: [PATCH 2/2] silent the fetch, to hide "Warning: Class
+ __PHP_Incomplete_Class has no unserializer in..."
+
+---
+ apc.php | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/apc.php b/apc.php
+index 119d74e..47debee 100644
+--- a/apc.php
++++ b/apc.php
+@@ -1048,7 +1048,7 @@ function block_sort($array1, $array2)
+ echo '</tr>';
+ if ($sh == $MYREQUEST["SH"]) {
+ echo '<tr>';
+- echo '<td colspan="7"><pre>'.htmlentities(print_r(apcu_fetch($entry['info']), 1)).'</pre></td>';
++ echo '<td colspan="7"><pre>'.htmlentities(print_r(@apcu_fetch($entry['info']), 1)).'</pre></td>';
+ echo '</tr>';
+ }
+ $i++;
+From f095923ecaa46a6e3c64bee913cf527077393539 Mon Sep 17 00:00:00 2001
+From: Stanislav Khromov <stanislav.khromov+github@gmail.com>
+Date: Fri, 17 Oct 2014 15:44:20 +0200
+Subject: [PATCH] Scroll to cache entry when clicking on it
+
+---
+ apc.php | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/apc.php b/apc.php
+index efc7eec..cedf096 100644
+--- a/apc.php
++++ b/apc.php
+@@ -1020,8 +1020,8 @@ function block_sort($array1, $array2)
+ $sh=md5($entry["info"]);
+ $field_value = htmlentities(strip_tags($entry[$fieldname],''), ENT_QUOTES, 'UTF-8');
+ echo
+- '<tr class=tr-',$i%2,'>',
+- "<td class=td-0><a href=\"$MY_SELF&OB=",$MYREQUEST['OB'],"&SH=",$sh,"\">",$field_value,'</a></td>',
++ '<tr id="key-'. $sh .'" class=tr-',$i%2,'>',
++ "<td class=td-0><a href=\"$MY_SELF&OB=",$MYREQUEST['OB'],"&SH=",$sh,"#key-". $sh ."\">",$field_value,'</a></td>',
+ '<td class="td-n center">',$entry['num_hits'],'</td>',
+ '<td class="td-n right">',$entry['mem_size'],'</td>',
+ '<td class="td-n center">',date(DATE_FORMAT,$entry['access_time']),'</td>',
diff --git a/php-pecl-apcu.spec b/php-pecl-apcu.spec
index f36d1ef..2999cde 100644
--- a/php-pecl-apcu.spec
+++ b/php-pecl-apcu.spec
@@ -23,12 +23,16 @@
Name: %{?scl_prefix}php-pecl-apcu
Summary: APC User Cache
Version: 4.0.7
-Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}.1
+Release: 2%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
Source1: %{pecl_name}.ini
Source2: %{pecl_name}-panel.conf
Source3: %{pecl_name}.conf.php
+# https://github.com/krakjoe/apcu/pull/90
+# https://github.com/krakjoe/apcu/pull/120
+Patch0: %{pecl_name}-pr.patch
+
License: PHP
Group: Development/Languages
URL: http://pecl.php.net/package/APCu
@@ -38,8 +42,6 @@ BuildRequires: %{?scl_prefix}php-devel
BuildRequires: %{?scl_prefix}php-pear
BuildRequires: pcre-devel
-Requires(post): %{__pecl}
-Requires(postun): %{__pecl}
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
@@ -154,6 +156,7 @@ configuration, available on http://localhost/apcu-panel/
mv %{pecl_name}-%{version} NTS
cd NTS
+%patch0 -p1 -b .pending
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_APCU_VERSION/{s/.* "//;s/".*$//;p}' php_apc.h)
@@ -239,7 +242,7 @@ TEST_PHP_EXECUTABLE=%{_bindir}/php \
TEST_PHP_ARGS="-n -d extension_dir=$PWD/modules -d extension=%{pecl_name}.so" \
NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
-%{_bindir}/php -n run-tests.php
+%{_bindir}/php -n run-tests.php --show-diff
%if %{with_zts}
cd ../ZTS
@@ -252,7 +255,7 @@ TEST_PHP_EXECUTABLE=%{__ztsphp} \
TEST_PHP_ARGS="-n -d extension_dir=$PWD/modules -d extension=%{pecl_name}.so" \
NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
-%{__ztsphp} -n run-tests.php
+%{__ztsphp} -n run-tests.php --show-diff
%endif
@@ -260,18 +263,27 @@ REPORT_EXIT_STATUS=1 \
rm -rf %{buildroot}
-%post
-%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
+# when pear installed alone, after us
+%triggerin -- %{?scl_prefix}php-pear
+if [ -x %{__pecl} ] ; then
+ %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
+fi
+# posttrans as pear can be installed after us
+%posttrans
+if [ -x %{__pecl} ] ; then
+ %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
+fi
%postun
-if [ $1 -eq 0 ] ; then
+if [ $1 -eq 0 -a -x %{__pecl} ] ; then
%{pecl_uninstall} %{pecl_name} >/dev/null || :
fi
%files
%defattr(-,root,root,-)
+%{?_licensedir:%license NTS/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -306,6 +318,10 @@ fi
%changelog
+* Tue Jun 9 2015 Remi Collet <remi@fedoraproject.org> - 4.0.7-2
+- upstream fix for the control panel
+- drop runtime dependency on pear, new scriptlets
+
* Wed Dec 24 2014 Remi Collet <remi@fedoraproject.org> - 4.0.7-1.1
- Fedora 21 SCL mass rebuild