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:
|
throw new ConnectionException(socket_strerror(socket_last_error($new))); |
|
socket_set_option(socket_import_stream($new), SOL_TCP, TCP_NODELAY, 1); |
|
$err = @socket_last_error($this->socket); |
|
$err = socket_strerror($err); |
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.
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-socketsis and was listed as a platform requirement, it wasn't actually required in branch 2.0 because Wrench did not usesocket_*functions at the time, onlystream_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:Wrench/lib/Socket/ServerSocket.php
Line 64 in 3b82fe1
Wrench/lib/Socket/ServerSocket.php
Line 67 in 3b82fe1
Wrench/lib/Socket/Socket.php
Line 156 in 3b82fe1
Wrench/lib/Socket/Socket.php
Line 158 in 3b82fe1
So the functions concerned would be:
socket_strerror,socket_last_error,socket_set_optionandsocket_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.