Set custom webdriver port with ENV var and checking port availability by usernameComputer01 · Pull Request #1124 · php-webdriver/php-webdriver
Does such env exist in another project ? could we use more standard ones ?
I didn't find any information on the ENV standard for webdriver.
usernameComputer01
changed the title
Set custom webdriver port with ENV var
Set custom webdriver port with ENV var and checking port availability
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Could you please update the sockets dependency? 🙏
| /** | ||
| * @throws RuntimeException | ||
| */ | ||
| protected static function checkPortIsAvail(int $port) |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| protected static function checkPortIsAvail(int $port) | |
| protected static function checkPortIsAvailable(int $port) |
No need for shortcuts :)
| */ | ||
| protected static function checkPortIsAvail(int $port) | ||
| { | ||
| $errTest = static function ($sock) use ($port) { |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method should check if the Sockets extension is enabled, and if not, it should just return true (ie. the same behavior as before - without free port detection).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters