Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.2 compatibility #39

Merged
merged 2 commits into from
Nov 9, 2022
Merged

PHP 8.2 compatibility #39

merged 2 commits into from
Nov 9, 2022

Conversation

remicollet
Copy link
Member

No description provided.

@remicollet
Copy link
Member Author

@bix0r this one is still needed for 8.2

@remicollet
Copy link
Member Author

Rebased and Second commit to allow dynamic properties (trivial / minimal fix), so test suite passes:

=====================================================================
PHP         : /opt/remi/php82/root/usr/bin/php 
PHP_SAPI    : cli
PHP_VERSION : 8.2.0RC6
ZEND_VERSION: 4.2.0RC6
PHP_OS      : Linux - Linux builder.remirepo.net 6.0.5-100.fc35.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 26 16:27:59 UTC 2022 x86_64
INI actual  : /work/GIT/pecl-and-ext/solr
More .INIs  :  
---------------------------------------------------------------------
PHP         : /opt/remi/php82/root/usr/bin/php-cgi 
PHP_SAPI    : cgi-fcgi
PHP_VERSION : 8.2.0RC6
ZEND_VERSION: 4.2.0RC6
PHP_OS      : Linux - Linux builder.remirepo.net 6.0.5-100.fc35.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 26 16:27:59 UTC 2022 x86_64
INI actual  : /work/GIT/pecl-and-ext/solr
More .INIs  : 
--------------------------------------------------------------------- 
CWD         : /work/GIT/pecl-and-ext/solr
Extra dirs  : 
VALGRIND    : Not used
=====================================================================
TIME START 2022-11-09 12:32:20
=====================================================================
PASS Solr Server 4+ Compatibility Test [tests/000.solr_server_compat.phpt] 
PASS SolrClient::ping() - Ping Solr Server [tests/000.solrclient_ping.phpt] 
PASS SolrClient::addDocument() - sending document to the Solr server [tests/001.solrclient_addDocument.phpt] 
PASS SolrClient::addDocumnt() - Partial Update (integration) [tests/001.solrclient_addDocument_partial.phpt] 
PASS SolrClient::addDocuments() - sending multiple documents to the Solr server [tests/002.solrclient_addDocuments.phpt] 
PASS SolrClient::addDocument() - Overwrite an existing document [tests/003.solrclient_addDocument_no_overwrite.phpt] 
PASS SolrClient::addDocuments() - sending multiple documents to the Solr server [tests/003.solrclient_addDocuments_commitwithin.phpt] 
PASS SolrClient::__construct() - Test options [tests/003.solrclient_options.phpt] 
PASS SolrClient::query() - Sending a chained query request [tests/004.solrclient_query_response.phpt] 
PASS SolrClient::query() - Terms component [tests/004.solrclient_query_terms.phpt] 
PASS SolrClient::query() - throw SolrClientException on Solr Server exception [tests/005.solrclient_query_error.phpt] 
PASS SolrClient::system() - Retrieve Solr Server/System Info [tests/006.solrclient_system.phpt] 
PASS SolrClient::deleteById() - Testing deleting a document by ID [tests/007.solrclient_deleteById.phpt] 
PASS SolrClient::deleteByIds() - Test deleting documents by an array of IDS [tests/007.solrclient_deleteByIds.phpt] 
PASS SolrClient::commit() - Testing commit [tests/008.solrclient_commit.phpt] 
PASS SolrClient::rollback() - Testing rollback [tests/008.solrclient_rollback.phpt] 
PASS SolrClient::optimize() - Testing optimize [tests/009.solrclient_optimize.phpt] 
PASS SolrClient::getOptions - Returning all the default options [tests/010.solrclient_getOptions.phpt] 
PASS SolrClient - PHPS response writer support [tests/011.solrclient_phps_response.phpt] 
PASS SolrClient::getById() - Testing Real Time Get by id [tests/012.solrclient_getById.phpt] 
PASS SolrClient::getByIds() - Testing Real Time Get by ids [tests/013.solrclient_getByIds.phpt] 
PASS SolrClient::addDocument() - Sending a document with child documents [tests/014.solrclient_addDocument_nested_document.phpt] 
PASS SolrClient::addDocuments() - Sending multiple documents with child documents [tests/015.solrclient_addDocuments_nested_document.phpt] 
PASS SolrClient::Request() - Sending custom update request [tests/016.solrclient_request.phpt] 
PASS SolrClient::sendUpdateStream - send SolrExtractRequest (bin) [tests/016.solrclient_sendUpdateStream_bin.phpt] 
PASS SolrClient::sendUpdateStream - send SolrExtractRequest (file) [tests/016.solrclient_sendUpdateStream_file.phpt] 
PASS SolrClient::deleteByQueries() - delete by multiple queries [tests/017.solrclient_deletebyqueries.phpt] 
PASS SolrClient::deleteByQuery() - delete by query [tests/017.solrclient_deletebyquery.phpt] 
PASS SolrClient::threads() - Solr Threads Info [tests/017.solrclient_threads.phpt] 
PASS SolrClient::setServlet() - set different servlet for a certain request type [tests/018.solrclient_setservlet.phpt] 
PASS SolrClient::__clone() - expect exception on clone [tests/019.solrclient_clone.phpt] 
PASS SolrClient::getDebug() - Get request debug logs for the last request [tests/019.solrclient_getdebug.phpt] 
PASS SolrClient - serialization [tests/019.solrclient_serialize.phpt] 
PASS SolrDocument - checking dimension and magic property sets. [tests/020.solrdocument_adding_fields.phpt] 
PASS SolrInputDocument::updateField [tests/020.solrdocument_update_field.phpt] 
PASS SolrDocument - checking Iterator interface implementation [tests/021.solrdocument_iterator.phpt] 
PASS SolrDocument::getInputDocument() - creating SolrInputDocument from SolrDocument [tests/022.solrdocument_getInputDocument.phpt] 
PASS SolrDocument::merge() - merging source document into current document [tests/023.solrdocument_merge.phpt] 
PASS SolrDocument::merge() - merging source document into current document without overwrite [tests/023.solrdocument_merge_no_overwrite.phpt] 
PASS SolrClient::query() - Query child documents SolrObject (Integ) [tests/024.solrdocument_child_fetch.phpt] 
PASS SolrDocument::hasChildDocuments() - Method test [tests/025.solrdocument_haschilddocuments.phpt] 
PASS SolrDocument::getChildDocumentsCount() - Method test [tests/026.solrdocument_getchilddocscount.phpt] 
PASS SolrDocument::getInputDocument() - Where document has child docs [tests/027.solrdocument_getinputdocument_children.phpt] 
PASS SolrDocument - clone [tests/028.solrdocument_clone.phpt] 
SKIP SolrDocument - clone [tests/029.solrdocument_serialize.phpt] reason: PHP < 8.1 only
PASS SolrDocument - clone [tests/029.solrdocument_serialize_php81.phpt] 
PASS SolrDocument - magic __isset/__unset/__get/__set [tests/030.solrdocument_magic.phpt] 
PASS SolrDocument::clear - Remove all fields from the document [tests/031.solrdocument_clear.phpt] 
PASS SolrDocument::fieldExists [tests/032.solrdocument_fieldexists.phpt] 
PASS SolrDocument::sort - Sort Document fields [tests/033.solrdocument_sort.phpt] 
PASS SolrDocument::deleteField [tests/034.solrdocument_deletefield.phpt] 
PASS SolrDocument::getFieldNames [tests/035.solrdocument_getfieldnames.phpt] 
PASS SolrDocument - Array Access [tests/036.solrdocument_array_access.phpt] 
PASS SolrDocument::getField [tests/037.solrdocument_getfield.phpt] 
PASS SolrObject - checking xml response digest [tests/040.solrobject_xmlresponse.phpt] 
PASS SolrObject - checking illegal operation of modifying object [tests/041.solrobject_illegal_operation.phpt] 
PASS SolrObject - testing the magic property access [tests/042.solrobject_magic_property.phpt] 
PASS SolrObject - test property access [tests/043.solrobject_magic_properties.phpt] 
PASS SolrObject - checking dimension access on properties. [tests/044.solrobject_dimension_access_properties.phpt] 
PASS SolrObject - checking dimension access on properties. [tests/045.solrobject_array_access.phpt] 
PASS SolrObject - SolrObject::getPropertyNames() [tests/046.solrobject_getpropertynames.phpt] 
PASS SolrObject::offsetExists [tests/047.solrobject_offsetExists.phpt] 
PASS SolrInputDocument::addChildDocument() - add child document [tests/050.solrinputdocument_addchilddocument_01.phpt] 
PASS SolrInputDocument::addChildDocument()/SolrInputDocument::addChildDocuments() - Expected SolrIllegalArgumentException [tests/050.solrinputdocument_addchilddocument_02_error.phpt] 
PASS SolrInputDocument::getChildDocuments() - test [tests/051.solrinputdocument_getchilddocuments.phpt] 
PASS SolrInputDocument::hasChildDocuments() - test [tests/052.solrinputdocument_haschilddocuments.phpt] 
PASS SolrInputDocument::getChildDocumentsCount() - test [tests/053.solrinputdocument_getchilddocumentscount.phpt] 
PASS SolrInputDocument::addChildDocuments() - add child documents [tests/054.solrinputdocument_addchilddocuments.phpt] 
PASS SolrInputDocument - serialize/unserialize Exception [tests/055.solrinputdocument_serialization.phpt] 
PASS SolrInputDocument::toArray - Array conversion [tests/056.solrinputdocument_toArray.phpt] 
PASS SolrInputDocument - clone [tests/057.solrinputdocument_clone.phpt] 
PASS SolrInputDocument::deleteField - Delete a field from SolrInputDocument [tests/058.solrinputdocument_deletefield.phpt] 
PASS SolrInputDocument::clear - Clear document fields [tests/059.solrinputdocument_clear.phpt] 
PASS SolrInputDocument::fieldExists [tests/059.solrinputdocument_fieldexists.phpt] 
PASS SolrInputDocument::getBoost - Test document fieldnames [tests/059.solrinputdocument_getboost.phpt] 
PASS SolrInputDocument::getField [tests/059.solrinputdocument_getfield.phpt] 
PASS SolrInputDocument::getFieldCount [tests/059.solrinputdocument_getfieldcount.phpt] 
PASS SolrInputDocument::getFieldNames - Test document fieldnames [tests/059.solrinputdocument_getfieldnames.phpt] 
PASS SolrInputDocument::merge - Merge 2 docs [tests/059.solrinputdocument_merge.phpt] 
PASS SolrInputDocument::getFieldBoost [tests/059.solrinputdocument_set_getfieldboost.phpt] 
PASS SolrInputDocument::setVersion - Set document version [tests/059.solrinputdocument_setversion.phpt] 
PASS SolrInputDocument::sort - Sort Document fields [tests/059.solrinputdocument_sort.phpt] 
PASS SolrQuery - testing CommonQueryParameters [tests/060.solrquery_comon_query_params.phpt] 
PASS SolrQuery - testing SimpleFacetParameters [tests/061.solrquery_simpleFacetParameters.phpt] 
PASS SolrQuery - Testing Date facet parameters [tests/062.solrquery_date_facet_parameters.phpt] 
PASS SolrQuery - testing HighlightingParameters [tests/063.solrquery_HighlightingParameters.phpt] 
PASS SolrQuery - testing StatsComponent [tests/064.solrquery_StatsComponent.phpt] 
PASS SolrQuery - testing MoreLikeThis component [tests/065.solrquery_MoreLikeThis.phpt] 
PASS SolrQuery - testing TermsComponent [tests/066.solrquery_TermsComponent.phpt] 
PASS SolrQuery::_construct - Throws exception on illegal Argument [tests/067.solrquery__construct.phpt] 
PASS SolrQuery - Invalid Parameters thorws exception Throws exception on illegal Argument [tests/068.solrquery_parameters_error.phpt] 
PASS SolrQuery - Result Grouping (Group Parameters) [tests/069.solrquery_GroupParameters.phpt] 
PASS SolrQuery::collapse - Collapse Using a SolrCollapseFunction [tests/070.solrquery_collapse.phpt] 
PASS SolrQuery::collapse - throws SolrMissingMandatoryParameterException [tests/071.solrquery_collapse_exception.phpt] 
PASS SolrQuery - Expand Component [tests/072.solrquery_expand.phpt] 
PASS SolrUtils::escapeQueryChars() - Testing Lucene Reserved Characters [tests/080.solrutils_escapequerychars.phpt] 
PASS SolrUtils::digestJsonResponse() - Digest JSON Response [tests/081.solrutils_digest_json_response.phpt] 
PASS SolrUtils::getSolrVersion() - Returns solr dotted version [tests/082.solrutils_getsolrversion.phpt] 
PASS SolrUtils::getSolrStats() - Get Statistics about number of documents/clients..etc [tests/083.solrutils_getsolrstats.phpt] 
PASS SolrUtils::queryPhrase() - Escapes a query phrase [tests/084.solrutils_queryphrase.phpt] 
PASS SolrServerException (xml) - Throw Exception on solr server exception using xml response writer [tests/090.solrserverexception_xml.phpt] 
PASS SolrServerException (json) - Throw Exception on solr server exception using json response writer [tests/091.solrserverexception_json.phpt] 
PASS SolrServerException (phps) - Throw Exception on solr server exception using phps response writer [tests/092.solrserverexception_php.phpt] 
PASS SolrResponse::getResponse - JSON response writer [tests/100.solrresponse_json.phpt] 
PASS SolrResponse - ParseMode [tests/101.solrresponse_parseMode.phpt] 
PASS SolrResponse::getResponse - PHPS response writer [tests/102.solrresponse_phps.phpt] 
PASS SolrResponse::getArrayResponse - For All response writers [tests/103.solrresponse_get_array_response.phpt] 
PASS SolrResponse::getResponse() - maxScore [tests/104.solrresponse_get_response_maxscore.phpt] 
PASS Response - Response with child documents [tests/105.solrresponse_child_doc_response.phpt] 
PASS SolrDocument - Response parsed as SolrDocument with child documents [tests/106.solrresponse_child_doc_response_solrdoc.phpt] 
PASS SolrResponse::getRawResponseHeaders() - Get Raw Response Headers [tests/107.solrresponse_getrawresponseheaders.phpt] 
PASS SolrResponse::getDigestedResponse() - Get Raw Response Headers [tests/108.solrresponse_getdigestedresponse.phpt] 
PASS SolrResponse::getHttpStatus() - getHttpStatusMessage() [tests/109.solrresponse_gethttpstatus.phpt] 
PASS SolrResponse::getRequestUrl() - Get Raw Response Headers [tests/109.solrresponse_getrequesturl.phpt] 
PASS SolrResponse::success() - Was the request successful [tests/109.solrresponse_success.phpt] 
PASS SolrDisMaxQuery - Methods [tests/110.solrdismaxquery.phpt] 
PASS SolrDisMaxQuery - Boost Query [tests/111.solrdismaxquery_boostquery.phpt] 
PASS SolrDisMaxQuery - QueryParser Switch [tests/112.solrdismaxquery_query_parser.phpt] 
PASS SolrDisMaxQuery - BigramFields and slop (addBigramPhraseField, removeBigramPhraseField, setBigramPhraseFields) [tests/113.solrdismaxquery_bigramfields.phpt] 
PASS SolrDisMaxQuery - TrigramFields and slop (addTrigramPhraseField, removeTrigramPhraseField, setTrigramPhraseFields) [tests/114.solrdismaxquery_trigramfields.phpt] 
PASS SolrDisMaxQuery - UserFields (uf parameter) (addUserField) [tests/115.solrdismaxquery_userfields.phpt] 
PASS SolrDisMaxQuery - setBoostFunction [tests/116.solrdismaxquery_boostfunction.phpt] 
PASS simple_list_parameter type - Use of default, non-default separator [tests/130.parameters_simple_list_separator.phpt] 
PASS SolrCollapseFunction - string conversion [tests/150.solrcollapsefunction.phpt] 
PASS SolrCollapseFunction - Illegal Operations [tests/151.solrcollapsefunction_illegal_operations.phpt] 
PASS Solr - Fetch and Update nested documents [tests/160.solr_update_document_block.phpt] 
PASS SolrDocumentField::__construct [tests/180.solrdocumentfield_construct.phpt] 
PASS SolrDocumentField - exception - on write property [tests/181.solrdocumentfield_write_property.phpt] 
PASS SolrDocumentField - exception - on unset property [tests/182.solrdocumentfield_unset_property.phpt] 
PASS SolrParams::setParam() [tests/190.solrparams_setparam.phpt] 
PASS SolrParams::addParam() [tests/191.solrparams_addparam.phpt] 
PASS SolrParams::getParam() [tests/192.solrparams_getparam.phpt] 
PASS SolrParams::getParams() [tests/193.solrparams_getparams.phpt] 
PASS SolrParams::getPreparedParams() [tests/194.solrparams_getpreparedparams.phpt] 
PASS SolrParams::toString() [tests/195.solrparams_tostring.phpt] 
SKIP SolrParams::serialize() - serialize params [tests/196.solrparams_serialize.phpt] reason: PHP < 8.1 only
PASS SolrParams::serialize() - serialize params [tests/196.solrparams_serialize_php81.phpt] 
PASS SolrParams::unserialize() [tests/197.solrparams_unserialize.phpt] 
PASS SolrParams - clone [exception] [tests/198.solrparams_clone.phpt] 
PASS SolrExtractRequest - clone [exception] [tests/200.solrextractrequest_clone.phpt] 
PASS SolrExtractRequest - serialize [exception] [tests/201.solrextractrequest_serialize.phpt] 
PASS SolrDocument - new serialize api [tests/202.solrdocument_new_serialize.phpt] 
PASS Solr bug #59511 - SolrClient::query() Timeout shall throw a SolrClientException [tests/bug_59511_error.phpt] 
PASS Solr bug #61836 - Extending SolrDocument [tests/bug_61836_error.phpt] 
PASS Solr Bug #67394 - Unable to parse response with NaN [tests/bug_67394.phpt] 
PASS Solr Bug #68179 - Solr Params (Argument list) separator disappears [tests/bug_68179.phpt] 
PASS Solr Bug #68181 - Conflict occurs when using SolrDisMax::addBoostQuery and setBoostQuery [tests/bug_68181.phpt] 
PASS Solr Bug #69156 - segfault on 500 response from Solr [tests/bug_69156.phpt] 
PASS Solr Bug #70482 - Segmentation fault on server 500 response with no msg field XML RW [tests/bug_70482.phpt] 
PASS Solr Bug #70495 - Failed to parse 500 error response when Solr it lacks msg JSON RW [tests/bug_70495.phpt] 
PASS Solr Bug #70496 - Failed to parse 500 error response when Solr it lacks msg PHPS RW [tests/bug_70496.phpt] 
PASS Solr Bug #72033 - Real Time Get requests fails if it wasn't the first request [tests/bug_72033.phpt] 
PASS Solr Bug #72740 - addPhraseField return wrong query [tests/bug_72740.phpt] 
PASS Solr Bug #70496 - Failed to parse 500 error response when Solr it lacks msg PHPS RW [tests/bug_unknown.phpt] 
=====================================================================
TIME END 2022-11-09 12:32:26

=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped    :    0
Exts tested     :   73
---------------------------------------------------------------------

Number of tests :  154               152
Tests skipped   :    2 (  1.3%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :    0 (  0.0%) (  0.0%)
Tests passed    :  152 ( 98.7%) (100.0%)
---------------------------------------------------------------------
Time taken      :    6 seconds
=====================================================================

remicollet referenced this pull request Nov 9, 2022
@remicollet remicollet changed the title fix __toString method for 8.2 PHP 8.2 compatibility Nov 9, 2022
@bix0r
Copy link
Collaborator

bix0r commented Nov 9, 2022

@remicollet That is awesome. I was going to make a separate release with both the __toString fix and had just started thinking about the dynamic properties.

Thank you for this fix. I will do some final testing and then include this in the new release!

Copy link
Collaborator

@bix0r bix0r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thank you

@bix0r bix0r merged commit ab5c601 into php:master Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants