WpOrg\Requests\Transport
Fsockopen::test()
Self-test whether the transport can be used.
The available capabilities to test for can be found in Capability{}.
Метод класса: Fsockopen{}
Хуков нет.
Возвращает
true|false
. Whether the transport can be used.
Использование
$result = Fsockopen::test( $capabilities );
- $capabilities **
- -
По умолчанию: []
Код Fsockopen::test() Fsockopen::test WP 6.6.2
public static function test($capabilities = []) { if (!function_exists('fsockopen')) { return false; } // If needed, check that streams support SSL if (isset($capabilities[Capability::SSL]) && $capabilities[Capability::SSL]) { if (!extension_loaded('openssl') || !function_exists('openssl_x509_parse')) { return false; } } return true; }