From 49299aedbd47205b3bd7a458544bb2fc89b4feeb Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Jul 05 2019 05:29:58 +0000 Subject: v2.5.0 --- diff --git a/0001-fix-Wimplicit-function-declaration.patch b/0001-fix-Wimplicit-function-declaration.patch deleted file mode 100644 index 826862a..0000000 --- a/0001-fix-Wimplicit-function-declaration.patch +++ /dev/null @@ -1,24 +0,0 @@ -From c07233b6975099d928ab487eb1dad929cca43531 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Fri, 12 Oct 2018 13:49:25 +0200 -Subject: [PATCH 1/5] fix [-Wimplicit-function-declaration] - ---- - src/php7/php_solr.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/php7/php_solr.h b/src/php7/php_solr.h -index 0d32864..3704ec0 100644 ---- a/src/php7/php_solr.h -+++ b/src/php7/php_solr.h -@@ -642,6 +642,7 @@ PHP_SOLR_API void solr_collapse_function_register_class_constants(zend_class_ent - PHP_SOLR_API void solr_response_register_class_properties(zend_class_entry *ce TSRMLS_DC); - PHP_SOLR_API void solr_response_register_class_constants(zend_class_entry *ce TSRMLS_DC); - PHP_SOLR_API void solr_exception_register_class_properties(zend_class_entry *ce TSRMLS_DC); -+PHP_SOLR_API void solr_input_document_register_class_constants(zend_class_entry *ce TSRMLS_DC); - - PHP_SOLR_API void solr_set_response_object_properties(zend_class_entry *scope, zval *response_object, const solr_client_t *client, const solr_string_t *request_url, zend_bool success TSRMLS_DC); - PHP_SOLR_API void solr_throw_exception_ex(zend_class_entry *exception_ce, long code TSRMLS_DC, const char *filename, int file_line, const char *function_name, char *format, ...); --- -2.14.4 - diff --git a/0003-Fix-Wincompatible-pointer-types-with-7.3.patch b/0003-Fix-Wincompatible-pointer-types-with-7.3.patch deleted file mode 100644 index 925b213..0000000 --- a/0003-Fix-Wincompatible-pointer-types-with-7.3.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 9bdca9aaf4e6aa1ae61f43bb6be77f4540789374 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Fri, 12 Oct 2018 13:55:42 +0200 -Subject: [PATCH 3/5] Fix [-Wincompatible-pointer-types] with 7.3 - ---- - src/php7/solr_functions_helpers.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/php7/solr_functions_helpers.c b/src/php7/solr_functions_helpers.c -index 2ac1fe0..eb32808 100644 ---- a/src/php7/solr_functions_helpers.c -+++ b/src/php7/solr_functions_helpers.c -@@ -1427,7 +1427,11 @@ static inline int solr_pcre_replace_into_buffer(solr_string_t *buffer, char * se - { - zend_string *result; - int limit = -1; -+#if PHP_VERSION_ID >= 70300 -+ size_t replace_count = -1; -+#else - int replace_count = -1; -+#endif - zend_string *regex_str = zend_string_init(search, strlen(search), 0); - zend_string *subject_str = zend_string_init(buffer->str, buffer->len, 0); - #if PHP_VERSION_ID >= 70200 --- -2.14.4 - diff --git a/0005-fix-segfault-in-013.solrclient_getByIds.sh.patch b/0005-fix-segfault-in-013.solrclient_getByIds.sh.patch deleted file mode 100644 index 109b604..0000000 --- a/0005-fix-segfault-in-013.solrclient_getByIds.sh.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 9c0e23403876814f2812b4bad04989873194c91f Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Fri, 12 Oct 2018 14:10:54 +0200 -Subject: [PATCH 5/5] fix segfault in 013.solrclient_getByIds.sh - ---- - src/php7/php_solr_client.c | 26 ++++++++++++++------------ - 1 file changed, 14 insertions(+), 12 deletions(-) - -diff --git a/src/php7/php_solr_client.c b/src/php7/php_solr_client.c -index 3c76f52..8bad5df 100644 ---- a/src/php7/php_solr_client.c -+++ b/src/php7/php_solr_client.c -@@ -1346,22 +1346,24 @@ PHP_METHOD(SolrClient, getByIds) - - solr_string_init(&query_string); - solr_string_appends(&query_string, "ids=", sizeof("ids=")-1); -- SOLR_HASHTABLE_FOR_LOOP(ids) -- { -- zval *id_zv = NULL; -- id_zv = zend_hash_get_current_data(ids); -- if (Z_TYPE_P(id_zv) == IS_STRING && Z_STRLEN_P(id_zv)) { -- solr_string_appends(&query_string, Z_STRVAL_P(id_zv), Z_STRLEN_P(id_zv)); -- solr_string_appendc(&query_string, ','); -- } else { -- invalid_param = 1; -- goto solr_getbyids_exit; -+ -+ if (ids->nNumOfElements) { -+ SOLR_HASHTABLE_FOR_LOOP(ids) -+ { -+ zval *id_zv = NULL; -+ id_zv = zend_hash_get_current_data(ids); -+ if (Z_TYPE_P(id_zv) == IS_STRING && Z_STRLEN_P(id_zv)) { -+ solr_string_appends(&query_string, Z_STRVAL_P(id_zv), Z_STRLEN_P(id_zv)); -+ solr_string_appendc(&query_string, ','); -+ } else { -+ invalid_param = 1; -+ goto solr_getbyids_exit; -+ } -+ current_position++; - } -- current_position++; - } - - -- - solr_getbyids_exit: - if (invalid_param) { - solr_string_free(&query_string); --- -2.14.4 - diff --git a/php-pecl-solr2.spec b/php-pecl-solr2.spec index 27d0cca..435f906 100644 --- a/php-pecl-solr2.spec +++ b/php-pecl-solr2.spec @@ -1,6 +1,6 @@ # Fedora spec file for php-pecl-solr2 # -# Copyright (c) 2011-2018 Remi Collet +# Copyright (c) 2011-2019 Remi Collet # Copyright (c) 2010 Johan Cwiklinski # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ @@ -23,19 +23,14 @@ Summary: Object oriented API to Apache Solr Name: php-pecl-solr2 -Version: 2.4.0 -Release: 12%{?dist} +Version: 2.5.0 +Release: 1%{?dist} License: PHP URL: http://pecl.php.net/package/solr Source0: http://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz -Patch0: upstream.patch -Patch1: 0001-fix-Wimplicit-function-declaration.patch -Patch2: 0003-Fix-Wincompatible-pointer-types-with-7.3.patch -Patch3: 0005-fix-segfault-in-013.solrclient_getByIds.sh.patch - -BuildRequires: php-devel +BuildRequires: php-devel > 7 BuildRequires: php-pear BuildRequires: php-curl BuildRequires: php-json @@ -92,11 +87,6 @@ sed -e 's/role="test"/role="src"/' \ mv %{pecl_name}-%{version}%{?prever} NTS cd NTS -%patch0 -p1 -b .upstream -%patch1 -p1 -b .up1 -%patch2 -p1 -b .up2 -%patch3 -p1 -b .up3 - # Check version DIR=src/php$(%{__php} -r 'echo PHP_MAJOR_VERSION;') extver=$(sed -n '/#define PHP_SOLR_VERSION /{s/.* "//;s/".*$//;p}' $DIR/php_solr_version.h) @@ -110,7 +100,7 @@ cd .. # Create configuration file cat > %{ini_name} << 'EOF' ; Enable Solr extension module -extension=%{pecl_name}.so +extension=%{pecl_name} EOF %if %{with_zts} @@ -165,8 +155,8 @@ sed -e '/SOLR_SERVER_CONFIGURED/s/true/false/' \ : Minimal load test for NTS installed extension %{__php} \ -n \ - -d extension=curl.so \ - -d extension=json.so \ + -d extension=curl \ + -d extension=json \ -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ -m | grep %{pecl_name} @@ -182,14 +172,14 @@ TEST_PHP_EXECUTABLE=%{__php} \ : Minimal load test for ZTS installed extension %{__ztsphp} \ -n \ - -d extension=curl.so \ - -d extension=json.so \ + -d extension=curl \ + -d extension=json \ -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ -m | grep %{pecl_name} : Upstream test suite for ZTS extension cd ../ZTS -TEST_PHP_ARGS="-n -d extension=curl.so -d extension=json.so -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \ +TEST_PHP_ARGS="-n -d extension=curl -d extension=json -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \ REPORT_EXIT_STATUS=1 \ NO_INTERACTION=1 \ TEST_PHP_EXECUTABLE=%{__ztsphp} \ @@ -212,6 +202,9 @@ TEST_PHP_EXECUTABLE=%{__ztsphp} \ %changelog +* Fri Jul 5 2019 Remi Collet - 2.5.0-1 +- update to 2.5.0 + * Sat Feb 02 2019 Fedora Release Engineering - 2.4.0-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild diff --git a/sources b/sources index 1c77e7f..8260902 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -2c9accf66681a3daaaf371bc07e44902 solr-2.4.0.tgz +SHA512 (solr-2.5.0.tgz) = 5b24366942aa6eb0227da9d3d95bd0a9fd23a8163859e833c248cdab8f83391dc54df9fdae490ad9bc9bc5074b0b0c2c637918bc2f1738d5028f5e23c4d060cc diff --git a/upstream.patch b/upstream.patch deleted file mode 100644 index de020f2..0000000 --- a/upstream.patch +++ /dev/null @@ -1,100 +0,0 @@ -From 744e32915d5989101267ed2c84a407c582dc6f31 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Fri, 23 Jun 2017 16:25:50 +0200 -Subject: [PATCH] Fix for 7.2: - ZEND_ACC_CLONE have been removed, and was not - used in previous versions - fix php_pcre_replace call - ---- - src/php7/php_solr.c | 8 ++++---- - src/php7/solr_functions_helpers.c | 15 ++++++++++++++- - 2 files changed, 18 insertions(+), 5 deletions(-) - -diff --git a/src/php7/php_solr.c b/src/php7/php_solr.c -index 568b7c5..297f444 100644 ---- a/src/php7/php_solr.c -+++ b/src/php7/php_solr.c -@@ -566,7 +566,7 @@ static zend_function_entry solr_document_methods[] = { - SOLR_CTOR(SolrDocument, __construct, SolrDocument__construct_args) - SOLR_DTOR(SolrDocument, __destruct, Solr_no_args) - -- PHP_ME(SolrDocument, __clone, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CLONE) -+ PHP_ME(SolrDocument, __clone, NULL, ZEND_ACC_PUBLIC) - PHP_ME(SolrDocument, __set, SolrDocument_addField_args, ZEND_ACC_PUBLIC) - PHP_ME(SolrDocument, __get, SolrDocument_getField_args, ZEND_ACC_PUBLIC) - PHP_ME(SolrDocument, __isset, SolrDocument_fieldExists_args, ZEND_ACC_PUBLIC) -@@ -609,7 +609,7 @@ static zend_function_entry solr_document_methods[] = { - static zend_function_entry solr_input_document_methods[] = { - SOLR_CTOR(SolrInputDocument, __construct, SolrInputDocument__construct_args) - SOLR_DTOR(SolrInputDocument, __destruct, Solr_no_args) -- PHP_ME(SolrInputDocument, __clone, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CLONE) -+ PHP_ME(SolrInputDocument, __clone, NULL, ZEND_ACC_PUBLIC) - PHP_ME(SolrInputDocument, __sleep, Solr_no_args, ZEND_ACC_PUBLIC) - PHP_ME(SolrInputDocument, __wakeup, NULL, ZEND_ACC_PUBLIC) - PHP_ME(SolrInputDocument, setBoost, SolrInputDocument_setBoost_args, ZEND_ACC_PUBLIC) -@@ -645,7 +645,7 @@ static zend_function_entry solr_client_methods[] = { - SOLR_DTOR(SolrClient, __destruct, Solr_no_args) - PHP_ME(SolrClient, __sleep, Solr_no_args, ZEND_ACC_PUBLIC) - PHP_ME(SolrClient, __wakeup, NULL, ZEND_ACC_PUBLIC) -- PHP_ME(SolrClient, __clone, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CLONE) -+ PHP_ME(SolrClient, __clone, NULL, ZEND_ACC_PUBLIC) - PHP_ME(SolrClient, getOptions, Solr_no_args, ZEND_ACC_PUBLIC) - PHP_ME(SolrClient, getDebug, Solr_no_args, ZEND_ACC_PUBLIC) - PHP_ME(SolrClient, setServlet, SolrClient_setServlet_args, ZEND_ACC_PUBLIC) -@@ -722,7 +722,7 @@ static zend_function_entry solr_params_methods[] = { - PHP_ME(SolrParams, getParams, Solr_no_args, ZEND_ACC_PUBLIC) - PHP_ME(SolrParams, getParam, SolrParams_getParam_args, ZEND_ACC_PUBLIC) - PHP_ME(SolrParams, getPreparedParams, Solr_no_args, ZEND_ACC_PUBLIC) -- PHP_ME(SolrParams, __clone, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CLONE) -+ PHP_ME(SolrParams, __clone, NULL, ZEND_ACC_PUBLIC) - PHP_ME(SolrParams, serialize, NULL, ZEND_ACC_PUBLIC) - PHP_ME(SolrParams, unserialize, SolrParams_unserialize_args, ZEND_ACC_PUBLIC) - PHP_MALIAS(SolrParams, add, addParam, SolrParams_addParam_args, ZEND_ACC_PUBLIC) -diff --git a/src/php7/solr_functions_helpers.c b/src/php7/solr_functions_helpers.c -index b249a99..6d24ff4 100644 ---- a/src/php7/solr_functions_helpers.c -+++ b/src/php7/solr_functions_helpers.c -@@ -1404,19 +1404,28 @@ PHP_SOLR_API long solr_get_json_last_error(TSRMLS_D) - static inline int solr_pcre_replace_into_buffer(solr_string_t *buffer, char * search, char *replace) - { - zend_string *result; -- zval replace_val; - int limit = -1; - int replace_count = -1; - zend_string *regex_str = zend_string_init(search, strlen(search), 0); - zend_string *subject_str = zend_string_init(buffer->str, buffer->len, 0); -+#if PHP_VERSION_ID >= 70200 -+ zend_string *replace_str = zend_string_init(replace, strlen(replace), 0); -+#else -+ zval replace_val; - ZVAL_STRING(&replace_val, replace); -+#endif -+ - result = php_pcre_replace( - regex_str, - subject_str, - buffer->str, - buffer->len, -+#if PHP_VERSION_ID >= 70200 -+ replace_str, -+#else - &replace_val, - 0, -+#endif - limit, - &replace_count - ); -@@ -1424,7 +1433,11 @@ static inline int solr_pcre_replace_into_buffer(solr_string_t *buffer, char * se - solr_string_set_ex(buffer, (solr_char_t *)result->val, (size_t)result->len); - /* fprintf(stdout, "%s", buffer->str); */ - efree(result); -+#if PHP_VERSION_ID >= 70200 -+ zend_string_release(replace_str); -+#else - zval_ptr_dtor(&replace_val); -+#endif - zend_string_release(regex_str); - zend_string_release(subject_str); - --- -2.1.4 -