Closed bkidwell closed 2 years ago
Aside from the comment from @WyriHaximus, this looks good to me. 👍
Phake is no longer able to mock Resolver
because it's been made final
in the newer version of react/dns
. The newer version does provide a ResolverInterface
interface to typehint against, but that only exists in the newer version. It may take further consideration to come up with a solution that supports both versions of react/dns
.
Phake is no longer able to mock
Resolver
because it's been madefinal
in the newer version ofreact/dns
. The newer version does provide aResolverInterface
interface to typehint against, but that only exists in the newer version. It may take further consideration to come up with a solution that supports both versions ofreact/dns
.
Ow yeah hehe, mock an executor instead and wrap an actual resolver around that.
In release 0.4.13 of
reactphp/dns
(Feb 2018) they added support for asking the host OS for a DNS server address instead of requiring that the calling module provide one.We should use this instead of hard-coding Google 8.8.8.8 as the only DNS server Phergie will ever use.
This patch will cause blocking IO the first time you do a DNS query, as the
reactphp/dns
uses the appropriate method to get the DNS server address from the host OS. This blocking should only ever happen once per Phergie launch, and should take less than a second, I think.Note: without a patch like this one, Phergie will fail hard when trying to find and connect to a private IRC server on the local network if the server isn't available on the public Internet.