Requests_Transport_cURL::test() WordPress Method

The Requests_Transport_cURL::test() Wordpress method is used to test whether the cURL transport is available on the current system.

Requests_Transport_cURL::test( $capabilities = array() ) #

Whether this transport is valid

Contents


Return

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


Top ↑

Source

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

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

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

		return true;
	}

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.