-
Notifications
You must be signed in to change notification settings - Fork 26
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
Fixes #42 SoapClient->_stream_context is private in php 8 #46
base: develop
Are you sure you want to change the base?
Fixes #42 SoapClient->_stream_context is private in php 8 #46
Conversation
Hi, thanks for the PR. |
Yes, that change is live on a project running php 7.4 with a generated client and custom http headers. |
As you mentionned |
The removal of AbstractSoapClientBase->setSoapClient may break stuff downstream, so a new major version makes sense. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
worked for me on both php7.4 and 8.2.4, macos
There is an issue here. If the options array passed in during construction contain a stream context, this will replace that context. |
…d not be overwritten with a new one.
Indeed, I just committed a fix. |
SoapClient->_stream_context is private in php8.
To work around that a stream context is systematically created during init and provided to SoapClient.
Another aproach I tried before was to get access to SoapClient->_stream_context through reflection or a closure.
That trick does not work for php internal classes, and felt a bit hacky.
I had to remove AbstractSoapClientBase->setSoapClient, since we lose access to the stream context if SoapClient is created externally.
That's a potential breaking change.