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

Consider not depending on PHP Sockets extension #117

Open
sylbru opened this issue May 3, 2018 · 2 comments
Open

Consider not depending on PHP Sockets extension #117

sylbru opened this issue May 3, 2018 · 2 comments

Comments

@sylbru
Copy link

sylbru commented May 3, 2018

Hi,

I'm currently using Wrench 2 and wanted to upgrade to Wrench 3, only to realize that my webhost PHP install doesn't have the PHP Sockets extension enabled.
It looks like even though ext-sockets is and was listed as a platform requirement, it wasn't actually required in branch 2.0 because Wrench did not use socket_* functions at the time, only stream_socket_* functions, which are "an integral part of PHP as of version 4.3.0."
[See this article about the difference between the two]

Looking for the use of socket_* functions in master branch, it looks like there is only a few of them:

So the functions concerned would be: socket_strerror, socket_last_error, socket_set_option and socket_import_stream.
I’m not sure if there is a way to get rid of this dependency on the Sockets extension, but it would make the library easier to adopt by more people.

@sylbru
Copy link
Author

sylbru commented May 3, 2018

It looks like some of these lines (the socket_strerror and socket_last_error ones) were present as well in branch 2.0, but never caused an issue for me, even if the functions do not exist.
The fact that it didn't work anymore in my app is simply due to the fact that I've reinstalled the library with Composer, without applying my dirty patch I mentioned in #107.

This issue is not as relevant for me now, but I'm not sure if it still might be considered. If it will not, feel free to close the issue.

@sylbru
Copy link
Author

sylbru commented Nov 30, 2018

The issue may actually still be relevant now, because from time to time a connexion causes an error and the websocket server crashes because of socket_strerror being undefined. Not sure what happens if I just remove this call (it is called when throwing an exception anyway), but I can't reproduce this because it happens only in production.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant