summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-solarium-pr479.patch352
-rw-r--r--php-solarium.spec33
2 files changed, 11 insertions, 374 deletions
diff --git a/php-solarium-pr479.patch b/php-solarium-pr479.patch
deleted file mode 100644
index 4c9bcb3..0000000
--- a/php-solarium-pr479.patch
+++ /dev/null
@@ -1,352 +0,0 @@
-From 188b80f45facf9f8c4ad584b12ff7c62a569e8ed Mon Sep 17 00:00:00 2001
-From: Remi Collet <fedora@famillecollet.com>
-Date: Thu, 2 Feb 2017 12:58:32 +0100
-Subject: [PATCH] fix for PHP 5.3 (as still set as supported)
-
----
- library/Solarium/Core/Client/Adapter/Guzzle3.php | 8 +--
- .../Select/ResponseParser/Component/Grouping.php | 2 +-
- .../Tests/Core/Client/Adapter/Guzzle3Test.php | 38 ++++++-------
- .../Tests/Core/Client/Adapter/GuzzleTest.php | 62 +++++++++++-----------
- 4 files changed, 55 insertions(+), 55 deletions(-)
-
-diff --git a/library/Solarium/Core/Client/Adapter/Guzzle3.php b/library/Solarium/Core/Client/Adapter/Guzzle3.php
-index 752141f..fa5b7db 100644
---- a/library/Solarium/Core/Client/Adapter/Guzzle3.php
-+++ b/library/Solarium/Core/Client/Adapter/Guzzle3.php
-@@ -74,10 +74,10 @@ public function execute($request, $endpoint)
- $endpoint->getBaseUri() . $request->getUri(),
- $this->getRequestHeaders($request),
- $this->getRequestBody($request),
-- [
-+ array(
- 'timeout' => $endpoint->getTimeout(),
- 'connecttimeout' => $endpoint->getTimeout(),
-- ]
-+ )
- );
-
- // Try endpoint authentication first, fallback to request for backwards compatibility
-@@ -96,7 +96,7 @@ public function execute($request, $endpoint)
- $guzzleResponse = $guzzleRequest->getResponse();
-
- $responseHeaders = array_merge(
-- ["HTTP/1.1 {$guzzleResponse->getStatusCode()} {$guzzleResponse->getReasonPhrase()}"],
-+ array("HTTP/1.1 {$guzzleResponse->getStatusCode()} {$guzzleResponse->getReasonPhrase()}"),
- $guzzleResponse->getHeaderLines()
- );
-
-@@ -155,7 +155,7 @@ private function getRequestBody(Request $request)
- */
- private function getRequestHeaders(Request $request)
- {
-- $headers = [];
-+ $headers = array();
- foreach ($request->getHeaders() as $headerLine) {
- list($header, $value) = explode(':', $headerLine);
- if ($header = trim($header)) {
-diff --git a/library/Solarium/QueryType/Select/ResponseParser/Component/Grouping.php b/library/Solarium/QueryType/Select/ResponseParser/Component/Grouping.php
-index b365e75..27be278 100644
---- a/library/Solarium/QueryType/Select/ResponseParser/Component/Grouping.php
-+++ b/library/Solarium/QueryType/Select/ResponseParser/Component/Grouping.php
-@@ -82,7 +82,7 @@ public function parse($query, $grouping, $data)
- $matches = (isset($result['matches'])) ? $result['matches'] : null;
- $groupCount = (isset($result['ngroups'])) ? $result['ngroups'] : null;
- if ($grouping->getFormat() === GroupingComponent::FORMAT_SIMPLE) {
-- $valueGroups = [$this->extractValueGroup($valueResultClass, $documentClass, $result, $query)];
-+ $valueGroups = array($this->extractValueGroup($valueResultClass, $documentClass, $result, $query));
- $groups[$field] = new FieldGroup($matches, $groupCount, $valueGroups);
- continue;
- }
-diff --git a/tests/Solarium/Tests/Core/Client/Adapter/Guzzle3Test.php b/tests/Solarium/Tests/Core/Client/Adapter/Guzzle3Test.php
-index 0133fc3..9976d32 100644
---- a/tests/Solarium/Tests/Core/Client/Adapter/Guzzle3Test.php
-+++ b/tests/Solarium/Tests/Core/Client/Adapter/Guzzle3Test.php
-@@ -91,11 +91,11 @@ public function executeGet()
- $this->assertSame('OK', $response->getStatusMessage());
- $this->assertSame('200', $response->getStatusCode());
- $this->assertSame(
-- [
-+ array(
- 'HTTP/1.1 200 OK',
- 'Content-Type: application/json',
- 'X-PHPUnit: response value',
-- ],
-+ ),
- $response->getHeaders()
- );
- $this->assertSame($guzzleResponse->getBody(true), $response->getBody());
-@@ -138,11 +138,11 @@ public function executePostWithFile()
- $this->assertSame('OK', $response->getStatusMessage());
- $this->assertSame('200', $response->getStatusCode());
- $this->assertSame(
-- [
-+ array(
- 'HTTP/1.1 200 OK',
- 'Content-Type: application/json',
- 'X-PHPUnit: response value',
-- ],
-+ ),
- $response->getHeaders()
- );
- $this->assertSame($guzzleResponse->getBody(true), $response->getBody());
-@@ -187,11 +187,11 @@ public function executePostWithRawBody()
- $this->assertSame('OK', $response->getStatusMessage());
- $this->assertSame('200', $response->getStatusCode());
- $this->assertSame(
-- [
-+ array(
- 'HTTP/1.1 200 OK',
- 'Content-Type: application/json',
- 'X-PHPUnit: response value',
-- ],
-+ ),
- $response->getHeaders()
- );
- $this->assertSame($guzzleResponse->getBody(true), $response->getBody());
-@@ -239,11 +239,11 @@ public function executeGetWithAuthentication()
- $this->assertSame('OK', $response->getStatusMessage());
- $this->assertSame('200', $response->getStatusCode());
- $this->assertSame(
-- [
-+ array(
- 'HTTP/1.1 200 OK',
- 'Content-Type: application/json',
- 'X-PHPUnit: response value',
-- ],
-+ ),
- $response->getHeaders()
- );
- $this->assertSame($guzzleResponse->getBody(true), $response->getBody());
-@@ -280,9 +280,9 @@ public function executeRequestException()
- $request->setMethod(Request::METHOD_GET);
-
- $endpoint = new Endpoint(
-- [
-+ array(
- 'scheme' => 'silly', //invalid protocol
-- ]
-+ )
- );
-
- $this->adapter->execute($request, $endpoint);
-@@ -296,12 +296,12 @@ public function executeRequestException()
- private function getValidResponse()
- {
- $body = json_encode(
-- [
-- 'response' => [
-+ array(
-+ 'response' => array(
- 'numFound' => 10,
- 'start' => 0,
-- 'docs' => [
-- [
-+ 'docs' => array(
-+ array(
- 'id' => '58339e95d5200',
- 'author' => 'Gambardella, Matthew',
- 'title' => "XML Developer's Guide",
-@@ -309,13 +309,13 @@ private function getValidResponse()
- 'price' => 44.95,
- 'published' => 970372800,
- 'description' => 'An in-depth look at creating applications with XML.',
-- ],
-- ],
-- ],
-- ]
-+ ),
-+ ),
-+ ),
-+ )
- );
-
-- $headers = ['Content-Type' => 'application/json', 'X-PHPUnit' => 'response value'];
-+ $headers = array('Content-Type' => 'application/json', 'X-PHPUnit' => 'response value');
- return new Response(200, $headers, $body);
- }
- }
-diff --git a/tests/Solarium/Tests/Core/Client/Adapter/GuzzleTest.php b/tests/Solarium/Tests/Core/Client/Adapter/GuzzleTest.php
-index dbc526c..2b6fdd4 100644
---- a/tests/Solarium/Tests/Core/Client/Adapter/GuzzleTest.php
-+++ b/tests/Solarium/Tests/Core/Client/Adapter/GuzzleTest.php
-@@ -75,15 +75,15 @@ public function setUp()
- public function executeGet()
- {
- $guzzleResponse = $this->getValidResponse();
-- $mockHandler = new MockHandler([$guzzleResponse]);
-+ $mockHandler = new MockHandler(array($guzzleResponse));
-
-- $container = [];
-+ $container = array();
- $history = Middleware::history($container);
-
- $stack = HandlerStack::create($mockHandler);
- $stack->push($history);
-
-- $adapter = new GuzzleAdapter(['handler' => $stack]);
-+ $adapter = new GuzzleAdapter(array('handler' => $stack));
-
- $request = new Request();
- $request->setMethod(Request::METHOD_GET);
-@@ -96,11 +96,11 @@ public function executeGet()
- $this->assertSame('OK', $response->getStatusMessage());
- $this->assertSame('200', $response->getStatusCode());
- $this->assertSame(
-- [
-+ array(
- 'HTTP/1.1 200 OK',
- 'Content-Type: application/json',
- 'X-PHPUnit: response value',
-- ],
-+ ),
- $response->getHeaders()
- );
- $this->assertSame((string)$guzzleResponse->getBody(), $response->getBody());
-@@ -121,15 +121,15 @@ public function executeGet()
- public function executePostWithFile()
- {
- $guzzleResponse = $this->getValidResponse();
-- $mockHandler = new MockHandler([$guzzleResponse]);
-+ $mockHandler = new MockHandler(array($guzzleResponse));
-
-- $container = [];
-+ $container = array();
- $history = Middleware::history($container);
-
- $stack = HandlerStack::create($mockHandler);
- $stack->push($history);
-
-- $adapter = new GuzzleAdapter(['handler' => $stack]);
-+ $adapter = new GuzzleAdapter(array('handler' => $stack));
-
- $request = new Request();
- $request->setMethod(Request::METHOD_POST);
-@@ -143,11 +143,11 @@ public function executePostWithFile()
- $this->assertSame('OK', $response->getStatusMessage());
- $this->assertSame('200', $response->getStatusCode());
- $this->assertSame(
-- [
-+ array(
- 'HTTP/1.1 200 OK',
- 'Content-Type: application/json',
- 'X-PHPUnit: response value',
-- ],
-+ ),
- $response->getHeaders()
- );
- $this->assertSame((string)$guzzleResponse->getBody(), $response->getBody());
-@@ -169,15 +169,15 @@ public function executePostWithFile()
- public function executePostWithRawBody()
- {
- $guzzleResponse = $this->getValidResponse();
-- $mockHandler = new MockHandler([$guzzleResponse]);
-+ $mockHandler = new MockHandler(array($guzzleResponse));
-
-- $container = [];
-+ $container = array();
- $history = Middleware::history($container);
-
- $stack = HandlerStack::create($mockHandler);
- $stack->push($history);
-
-- $adapter = new GuzzleAdapter(['handler' => $stack]);
-+ $adapter = new GuzzleAdapter(array('handler' => $stack));
-
- $request = new Request();
- $request->setMethod(Request::METHOD_POST);
-@@ -192,11 +192,11 @@ public function executePostWithRawBody()
- $this->assertSame('OK', $response->getStatusMessage());
- $this->assertSame('200', $response->getStatusCode());
- $this->assertSame(
-- [
-+ array(
- 'HTTP/1.1 200 OK',
- 'Content-Type: application/json',
- 'X-PHPUnit: response value',
-- ],
-+ ),
- $response->getHeaders()
- );
- $this->assertSame((string)$guzzleResponse->getBody(), $response->getBody());
-@@ -219,15 +219,15 @@ public function executePostWithRawBody()
- public function executeGetWithAuthentication()
- {
- $guzzleResponse = $this->getValidResponse();
-- $mockHandler = new MockHandler([$guzzleResponse]);
-+ $mockHandler = new MockHandler(array($guzzleResponse));
-
-- $container = [];
-+ $container = array();
- $history = Middleware::history($container);
-
- $stack = HandlerStack::create($mockHandler);
- $stack->push($history);
-
-- $adapter = new GuzzleAdapter(['handler' => $stack]);
-+ $adapter = new GuzzleAdapter(array('handler' => $stack));
-
- $request = new Request();
- $request->setMethod(Request::METHOD_GET);
-@@ -241,11 +241,11 @@ public function executeGetWithAuthentication()
- $this->assertSame('OK', $response->getStatusMessage());
- $this->assertSame('200', $response->getStatusCode());
- $this->assertSame(
-- [
-+ array(
- 'HTTP/1.1 200 OK',
- 'Content-Type: application/json',
- 'X-PHPUnit: response value',
-- ],
-+ ),
- $response->getHeaders()
- );
- $this->assertSame((string)$guzzleResponse->getBody(), $response->getBody());
-@@ -277,9 +277,9 @@ public function executeRequestException()
- $request->setMethod(Request::METHOD_GET);
-
- $endpoint = new Endpoint(
-- [
-+ array(
- 'scheme' => 'silly', //invalid protocol
-- ]
-+ )
- );
- $endpoint->setTimeout(10);
-
-@@ -294,12 +294,12 @@ public function executeRequestException()
- private function getValidResponse()
- {
- $body = json_encode(
-- [
-- 'response' => [
-+ array(
-+ 'response' => array(
- 'numFound' => 10,
- 'start' => 0,
-- 'docs' => [
-- [
-+ 'docs' => array(
-+ array(
- 'id' => '58339e95d5200',
- 'author' => 'Gambardella, Matthew',
- 'title' => "XML Developer's Guide",
-@@ -307,13 +307,13 @@ private function getValidResponse()
- 'price' => 44.95,
- 'published' => 970372800,
- 'description' => 'An in-depth look at creating applications with XML.',
-- ],
-- ],
-- ],
-- ]
-+ ),
-+ ),
-+ ),
-+ )
- );
-
-- $headers = ['Content-Type' => 'application/json', 'X-PHPUnit' => 'response value'];
-+ $headers = array('Content-Type' => 'application/json', 'X-PHPUnit' => 'response value');
- return new Response(200, $headers, $body);
- }
- }
diff --git a/php-solarium.spec b/php-solarium.spec
index 4835c41..92b94eb 100644
--- a/php-solarium.spec
+++ b/php-solarium.spec
@@ -6,7 +6,7 @@
#
# Please, preserve the changelog entries
#
-%global gh_commit 06e957a9060afd200cd66fef61125108bd66874a
+%global gh_commit c353babec89fdbe8c64054bfec8e77bcb5da6705
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner solariumphp
%global gh_project solarium
@@ -14,7 +14,7 @@
Name: php-%{gh_project}
Summary: Solarium PHP Solr client library
-Version: 3.8.0
+Version: 3.8.1
Release: 1%{?dist}
URL: http://www.solarium-project.org/
@@ -23,10 +23,6 @@ Group: Development/Libraries
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz
Source1: %{name}-autoload.php
-# https://github.com/solariumphp/solarium/pull/479
-# fix for PHP 5.3 (EPEL-6)
-Patch0: %{name}-pr479.patch
-
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
%if %{with_tests}
@@ -86,7 +82,6 @@ Documentation: http://wiki.solarium-project.org/
%prep
%setup -q -n %{gh_project}-%{gh_commit}
-%patch0 -p1
rm examples/.gitignore
@@ -111,28 +106,19 @@ cat << 'EOF' | tee vendor/autoload.php
require_once '%{buildroot}%{_datadir}/php/Solarium/autoload.php';
\Fedora\Autoloader\Dependencies::required(array(
array(
- '%{_datadir}/php/Guzzle/autoload.php',
'%{_datadir}/php/GuzzleHttp6/autoload.php',
+ '%{_datadir}/php/Guzzle/autoload.php',
),
));
EOF
: Run upstream test suite against installed library
-# remirepo:11
-run=0
ret=0
-if which php56; then
- php56 %{_bindir}/phpunit || ret=1
- run=1
-fi
-if which php71; then
- php71 %{_bindir}/phpunit || ret=1
- run=1
-fi
-if [ $run -eq 0 ]; then
-%{_bindir}/phpunit --verbose
-# remirepo:2
-fi
+for cmd in php56 php70 php71 php; do
+ if which $cmd; then
+ $cmd %{_bindir}/phpunit || ret=1
+ fi
+done
exit $ret
%else
: Skip upstream test suite
@@ -148,6 +134,9 @@ exit $ret
%changelog
+* Thu Feb 2 2017 Remi Collet <remi@fedoraproject.org> - 3.8.1-1
+- update to 3.8.1
+
* Wed Feb 1 2017 Remi Collet <remi@fedoraproject.org> - 3.8.0-1
- update to 3.8.0
- open https://github.com/solariumphp/solarium/pull/479