WpOrg\Requests\Transport

Curl::test()public staticWP 1.0

Self-test whether the transport can be used.

The available capabilities to test for can be found in Capability{}.

Метод класса: Curl{}

Хуков нет.

Возвращает

true|false. Whether the transport can be used.

Использование

$result = Curl::test( $capabilities );
$capabilities **
-
По умолчанию: []

Код Curl::test() WP 6.7.1

public static function test($capabilities = []) {
	if (!function_exists('curl_init') || !function_exists('curl_exec')) {
		return false;
	}

	// If needed, check that our installed curl version supports SSL
	if (isset($capabilities[Capability::SSL]) && $capabilities[Capability::SSL]) {
		$curl_version = curl_version();
		if (!(CURL_VERSION_SSL & $curl_version['features'])) {
			return false;
		}
	}

	return true;
}