Requests_Transport_fsockopen::test

Advertisement

Summery Summery

Whether this transport is valid

Syntax Syntax

Requests_Transport_fsockopen::test( $capabilities = array() )

Return Return

(boolean) True if the transport is valid, false otherwise.

Source Source

File: wp-includes/Requests/Transport/fsockopen.php

	public static function test($capabilities = array()) {
		if (!function_exists('fsockopen')) {
			return false;
		}

		// If needed, check that streams support SSL
		if (isset($capabilities['ssl']) && $capabilities['ssl']) {
			if (!extension_loaded('openssl') || !function_exists('openssl_x509_parse')) {
				return false;
			}

			// Currently broken, thanks to https://github.com/facebook/hhvm/issues/2156
			if (defined('HHVM_VERSION')) {
				return false;
			}
		}

		return true;
	}

Advertisement

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.