summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-aws-sdk3-upstream-pull-request-1298.patch134
-rw-r--r--php-aws-sdk3.spec59
2 files changed, 173 insertions, 20 deletions
diff --git a/php-aws-sdk3-upstream-pull-request-1298.patch b/php-aws-sdk3-upstream-pull-request-1298.patch
new file mode 100644
index 0000000..1d116c2
--- /dev/null
+++ b/php-aws-sdk3-upstream-pull-request-1298.patch
@@ -0,0 +1,134 @@
+From 634ba5285ced6c01b0824c5c22baeef17e04d33c Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Sat, 27 May 2017 08:12:19 +0200
+Subject: [PATCH 1/3] fix count(): Parameter must be an array or an object that
+ implements Countable (php 7.2)
+
+---
+ src/History.php | 2 +-
+ src/LruArrayCache.php | 9 +++++++--
+ tests/S3/BatchDeleteTest.php | 2 +-
+ 3 files changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/src/History.php b/src/History.php
+index 89e278a72..d9feee8a0 100644
+--- a/src/History.php
++++ b/src/History.php
+@@ -11,7 +11,7 @@
+ class History implements \Countable, \IteratorAggregate
+ {
+ private $maxEntries;
+- private $entries;
++ private $entries = array();
+
+ /**
+ * @param int $maxEntries Maximum number of entries to store.
+diff --git a/src/LruArrayCache.php b/src/LruArrayCache.php
+index 39ff7fc04..aef2dd537 100644
+--- a/src/LruArrayCache.php
++++ b/src/LruArrayCache.php
+@@ -11,13 +11,13 @@
+ * cache, if the number of cached items exceeds the allowed number, the first
+ * N number of items are removed from the array.
+ */
+-class LruArrayCache implements CacheInterface
++class LruArrayCache implements CacheInterface, \Countable
+ {
+ /** @var int */
+ private $maxItems;
+
+ /** @var array */
+- private $items;
++ private $items = array();
+
+ /**
+ * @param int $maxItems Maximum number of allowed cache items.
+@@ -71,4 +71,9 @@ public function remove($key)
+ {
+ unset($this->items[$key]);
+ }
++
++ public function count()
++ {
++ return count($this->items);
++ }
+ }
+diff --git a/tests/S3/BatchDeleteTest.php b/tests/S3/BatchDeleteTest.php
+index 7934379af..dda2641b5 100644
+--- a/tests/S3/BatchDeleteTest.php
++++ b/tests/S3/BatchDeleteTest.php
+@@ -206,7 +206,7 @@ public function testWithNoMatchingObjects()
+ $batch->delete();
+ $last = $mock->getLastCommand();
+ $this->assertEquals('ListObjects', $last->getName());
+- $this->assertEquals(0, count($last['Delete']['Objects']));
++ $this->assertFalse(isset($last['Delete']['Objects']));
+ $this->assertEquals('foo', $last['Bucket']);
+ }
+ }
+
+From 5dc49b75e05b43fc250d8dd949d583287ce1b2a0 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Sat, 27 May 2017 08:41:21 +0200
+Subject: [PATCH 2/3] fix session_set_save_handler(): Cannot change save
+ handler when headers already sent (php 7.2)
+
+---
+ tests/DynamoDb/DynamoDbClientTest.php | 1 +
+ tests/DynamoDb/SessionHandlerTest.php | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/tests/DynamoDb/DynamoDbClientTest.php b/tests/DynamoDb/DynamoDbClientTest.php
+index 1b549921e..1bec6759b 100644
+--- a/tests/DynamoDb/DynamoDbClientTest.php
++++ b/tests/DynamoDb/DynamoDbClientTest.php
+@@ -12,6 +12,7 @@
+
+ /**
+ * @covers \Aws\DynamoDb\DynamoDbClient
++ * @runTestsInSeparateProcesses
+ */
+ class DynamoDbClientTest extends \PHPUnit_Framework_TestCase
+ {
+diff --git a/tests/DynamoDb/SessionHandlerTest.php b/tests/DynamoDb/SessionHandlerTest.php
+index 07915e652..62c4a97a9 100644
+--- a/tests/DynamoDb/SessionHandlerTest.php
++++ b/tests/DynamoDb/SessionHandlerTest.php
+@@ -6,6 +6,7 @@
+
+ /**
+ * @covers Aws\DynamoDb\SessionHandler
++ * @runTestsInSeparateProcesses
+ */
+ class SessionHandlerTest extends \PHPUnit_Framework_TestCase
+ {
+
+From 93ba536daac90e15a5c91eb6e7d8507cf4546406 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Sat, 27 May 2017 08:52:22 +0200
+Subject: [PATCH 3/3] enable nightly (7.2)
+
+---
+ .travis.yml | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/.travis.yml b/.travis.yml
+index 4160ad7de..68b0646ac 100644
+--- a/.travis.yml
++++ b/.travis.yml
+@@ -5,6 +5,7 @@ php:
+ - 5.6
+ - 7.0
+ - 7.1
++ - nightly
+ - hhvm
+
+ sudo: false
+@@ -16,6 +17,7 @@ env:
+ matrix:
+ allow_failures:
+ - php: hhvm
++ - php: nightly
+ fast_finish: true
+
+ install:
diff --git a/php-aws-sdk3.spec b/php-aws-sdk3.spec
index 5e7b4bf..be89dea 100644
--- a/php-aws-sdk3.spec
+++ b/php-aws-sdk3.spec
@@ -56,7 +56,7 @@
Name: php-aws-sdk3
Version: %{github_version}
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Amazon Web Services framework for PHP
Group: Development/Libraries
@@ -68,13 +68,25 @@ URL: http://aws.amazon.com/sdkforphp
Source0: %{name}-%{github_version}-%{github_commit}.tar.gz
Source1: %{name}-get-source.sh
+# Fix for PHP 7.2
+# https://github.com/aws/aws-sdk-php/pull/1298
+# https://github.com/aws/aws-sdk-php/pull/1298.patch
+Patch0: %{name}-upstream-pull-request-1298.patch
+
BuildArch: noarch
# Library version value and autoloader check
-BuildRequires: php-cli >= %{php_min_ver}
-BuildRequires: php-composer(guzzlehttp/guzzle) >= 6
-BuildRequires: php-composer(guzzlehttp/promises) >= %{guzzle_promises_min_ver}
-BuildRequires: php-composer(guzzlehttp/psr7) >= %{guzzle_psr7_min_ver}
+BuildRequires: php-cli
+## composer.json
+BuildRequires: php(language) >= %{php_min_ver}
+BuildRequires: php-composer(guzzlehttp/guzzle) < %{guzzle_max_ver}
+BuildRequires: php-composer(guzzlehttp/guzzle) >= 6
+BuildRequires: php-composer(guzzlehttp/promises) < %{guzzle_promises_max_ver}
+BuildRequires: php-composer(guzzlehttp/promises) >= %{guzzle_promises_min_ver}
+BuildRequires: php-composer(guzzlehttp/psr7) < %{guzzle_psr7_max_ver}
+BuildRequires: php-composer(guzzlehttp/psr7) >= %{guzzle_psr7_min_ver}
+BuildRequires: php-composer(mtdowling/jmespath.php) < %{jmespath_max_ver}
BuildRequires: php-composer(mtdowling/jmespath.php) >= %{jmespath_min_ver}
+## Autoloader
BuildRequires: php-composer(fedora/autoloader)
# Tests
%if %{with_tests}
@@ -85,13 +97,13 @@ BuildRequires: php-composer(andrewsville/php-token-reflection) < %{tokenreflect
BuildRequires: php-composer(andrewsville/php-token-reflection) >= %{tokenreflection_min_ver}
BuildRequires: php-composer(aws/aws-php-sns-message-validator) < %{aws_sns_message_validator_max_ver}
BuildRequires: php-composer(aws/aws-php-sns-message-validator) >= %{aws_sns_message_validator_min_ver}
-BuildRequires: php-composer(doctrine/cache) < %{doctrine_cache_max_ver}
-BuildRequires: php-composer(doctrine/cache) >= %{doctrine_cache_min_ver}
-BuildRequires: php-composer(nette/neon) < %{nette_neon_max_ver}
-BuildRequires: php-composer(nette/neon) >= %{nette_neon_min_ver}
+BuildRequires: php-composer(doctrine/cache) < %{doctrine_cache_max_ver}
+BuildRequires: php-composer(doctrine/cache) >= %{doctrine_cache_min_ver}
+BuildRequires: php-composer(nette/neon) < %{nette_neon_max_ver}
+BuildRequires: php-composer(nette/neon) >= %{nette_neon_min_ver}
BuildRequires: php-composer(phpunit/phpunit)
-BuildRequires: php-composer(psr/cache) < %{psr_cache_max_ver}
-BuildRequires: php-composer(psr/cache) >= %{psr_cache_min_ver}
+BuildRequires: php-composer(psr/cache) < %{psr_cache_max_ver}
+BuildRequires: php-composer(psr/cache) >= %{psr_cache_min_ver}
BuildRequires: php-dom
BuildRequires: php-json
BuildRequires: php-openssl
@@ -113,13 +125,13 @@ BuildRequires: php-xmlwriter
%endif
# composer.json
-Requires: php(language) >= %{php_min_ver}
-Requires: php-composer(guzzlehttp/guzzle) < %{guzzle_max_ver}
-Requires: php-composer(guzzlehttp/guzzle) >= %{guzzle_min_ver}
-Requires: php-composer(guzzlehttp/promises) < %{guzzle_promises_max_ver}
-Requires: php-composer(guzzlehttp/promises) >= %{guzzle_promises_min_ver}
-Requires: php-composer(guzzlehttp/psr7) < %{guzzle_psr7_max_ver}
-Requires: php-composer(guzzlehttp/psr7) >= %{guzzle_psr7_min_ver}
+Requires: php(language) >= %{php_min_ver}
+Requires: php-composer(guzzlehttp/guzzle) < %{guzzle_max_ver}
+Requires: php-composer(guzzlehttp/guzzle) >= %{guzzle_min_ver}
+Requires: php-composer(guzzlehttp/promises) < %{guzzle_promises_max_ver}
+Requires: php-composer(guzzlehttp/promises) >= %{guzzle_promises_min_ver}
+Requires: php-composer(guzzlehttp/psr7) < %{guzzle_psr7_max_ver}
+Requires: php-composer(guzzlehttp/psr7) >= %{guzzle_psr7_min_ver}
Requires: php-composer(mtdowling/jmespath.php) < %{jmespath_max_ver}
Requires: php-composer(mtdowling/jmespath.php) >= %{jmespath_min_ver}
# phpcompatinfo (computed from version 3.30.0)
@@ -163,6 +175,9 @@ Autoloader: %{phpdir}/Aws3/autoload.php
%prep
%setup -qn %{github_name}-%{github_commit}
+: Fix for PHP 7.2
+%patch0 -p1
+
%build
: Create autoloader
@@ -239,10 +254,9 @@ export AWS_ACCESS_KEY_ID=foo
export AWS_SECRET_ACCESS_KEY=bar
: Upstream tests
-# 7.2: There were 8 errors:
RETURN_CODE=0
PHPUNIT=$(which phpunit)
-for PHP_EXEC in "" php56 php70 php71; do
+for PHP_EXEC in "" php56 php70 php71 php72; do
if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then
$PHP_EXEC $PHPUNIT -d memory_limit=1G --verbose --testsuite=unit \
--bootstrap bootstrap.php || RETURN_CODE=1
@@ -265,6 +279,11 @@ exit $RETURN_CODE
%changelog
+* Sat Jun 24 2017 Shawn Iwinski <shawn@iwin.ski> - 3.30.0-2
+- Add patch to fix PHP 7.2 failures
+- Add php72 to SCL tests
+- Add max versions to some additional BuildRequires dependencies
+
* Wed Jun 21 2017 Shawn Iwinski <shawn@iwin.ski> - 3.30.0-1
- Updated to 3.30.0 (RHBZ #1449422)