summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2020-04-10 14:40:24 +0200
committerRemi Collet <remi@remirepo.net>2020-04-10 14:40:24 +0200
commit7666a8c8f1b73a76e2031a4e8510b7179f5f4887 (patch)
tree9977174fbbdcda431ab4563a16abf67505c8d7fa
parent6e45c14ad198dfcbd7ef9c529d1bf55d4b3d478a (diff)
add upstream patch for 8.0
-rw-r--r--12845d5957b8af7c356e31f0d1be3d72986aab26.patch56
-rw-r--r--php-pecl-apcu.spec16
2 files changed, 67 insertions, 5 deletions
diff --git a/12845d5957b8af7c356e31f0d1be3d72986aab26.patch b/12845d5957b8af7c356e31f0d1be3d72986aab26.patch
new file mode 100644
index 0000000..a01267d
--- /dev/null
+++ b/12845d5957b8af7c356e31f0d1be3d72986aab26.patch
@@ -0,0 +1,56 @@
+From 12845d5957b8af7c356e31f0d1be3d72986aab26 Mon Sep 17 00:00:00 2001
+From: Nikita Popov <nikita.ppv@gmail.com>
+Date: Sat, 15 Feb 2020 11:09:22 +0100
+Subject: [PATCH] Fork test for PHP 8
+
+---
+ tests/apc_store_reference.phpt | 2 ++
+ tests/apc_store_reference_php8.phpt | 26 ++++++++++++++++++++++++++
+ 2 files changed, 28 insertions(+)
+ create mode 100644 tests/apc_store_reference_php8.phpt
+
+diff --git a/tests/apc_store_reference.phpt b/tests/apc_store_reference.phpt
+index 2228899..d2cb991 100644
+--- a/tests/apc_store_reference.phpt
++++ b/tests/apc_store_reference.phpt
+@@ -4,6 +4,8 @@ The outermost value should always be a value, not a reference
+ apc.enabled=1
+ apc.enable_cli=1
+ apc.serializer=default
++--SKIPIF--
++<?php if (PHP_VERSION_ID >= 80000) die('skip Requires PHP < 8.0.0'); ?>
+ --FILE--
+ <?php
+
+diff --git a/tests/apc_store_reference_php8.phpt b/tests/apc_store_reference_php8.phpt
+new file mode 100644
+index 0000000..1eae4bb
+--- /dev/null
++++ b/tests/apc_store_reference_php8.phpt
+@@ -0,0 +1,26 @@
++--TEST--
++The outermost value should always be a value, not a reference
++--INI--
++apc.enabled=1
++apc.enable_cli=1
++apc.serializer=default
++--SKIPIF--
++<?php if (PHP_VERSION_ID < 80000) die('skip Requires PHP >= 8.0.0'); ?>
++--FILE--
++<?php
++
++/* The output is different for the php serializer, because it does not replicate the
++ * cycle involving the top-level value. Instead the cycle is placed one level lower.
++ * I believe this is a bug in the php serializer. */
++
++$value = [&$value];
++apcu_store(["key" => &$value]);
++$result = apcu_fetch("key");
++var_dump($result);
++
++?>
++--EXPECT--
++array(1) {
++ [0]=>
++ *RECURSION*
++}
diff --git a/php-pecl-apcu.spec b/php-pecl-apcu.spec
index e111306..1047fb5 100644
--- a/php-pecl-apcu.spec
+++ b/php-pecl-apcu.spec
@@ -3,7 +3,7 @@
#
# Fedora spec file for php-pecl-apcu
#
-# Copyright (c) 2013-2019 Remi Collet
+# Copyright (c) 2013-2020 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
@@ -30,19 +30,20 @@
Name: %{?sub_prefix}php-pecl-apcu
Summary: APC User Cache
Version: 5.1.18
+License: PHP
+URL: https://pecl.php.net/package/APCu
%if 0%{?gh_date:1}
Release: 0.7.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{pecl_name}-%{version}-%{gh_short}.tar.gz
%else
-Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
-Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
+Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz
%endif
Source1: %{pecl_name}-5.1.2.ini
Source2: %{pecl_name}-panel.conf
Source3: %{pecl_name}.conf.php
-License: PHP
-URL: http://pecl.php.net/package/APCu
+Patch0: https://github.com/krakjoe/apcu/commit/12845d5957b8af7c356e31f0d1be3d72986aab26.patch
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel > 7
@@ -157,6 +158,8 @@ mv %{pecl_name}-%{version} NTS
%{?_licensedir:sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml}
cd NTS
+%patch0 -p1 -b .up
+
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_APCU_VERSION/{s/.* "//;s/".*$//;p}' php_apc.h)
if test "x${extver}" != "x%{version}%{?prever}%{?gh_date:-dev}"; then
@@ -322,6 +325,9 @@ fi
%changelog
+* Fri Apr 10 2020 Remi Collet <remi@remirepo.net> - 5.1.18-2
+- add upstream patch for 8.0
+
* Mon Oct 28 2019 Remi Collet <remi@remirepo.net> - 5.1.18-1
- update to 5.1.18