[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/Requests/Transport/ -> Fsockopen.php (summary)

fsockopen HTTP transport

File Size: 506 lines (15 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 7 functions

  request()
  request_multiple()
  accept_encoding()
  format_get()
  connect_error_handler()
  verify_certificate_from_context()
  test()

Functions
Functions that are not part of a class:

request($url, $headers = [], $data = [], $options = [])   X-Ref
Perform a request

return: string Raw HTTP result
param: string|Stringable $url URL to request
param: array $headers Associative array of request headers
param: string|array $data Data to send either as the POST body, or as parameters in the URL for a GET/HEAD
param: array $options Request options, see {@see \WpOrg\Requests\Requests::response()} for documentation

request_multiple($requests, $options)   X-Ref
Send multiple requests simultaneously

return: array Array of \WpOrg\Requests\Response objects (may contain \WpOrg\Requests\Exception or string responses as well)
param: array $requests Request data (array of 'url', 'headers', 'data', 'options') as per {@see \WpOrg\Requests\Transport::request()}
param: array $options Global options, see {@see \WpOrg\Requests\Requests::response()} for documentation

accept_encoding()   X-Ref
Retrieve the encodings we can accept

return: string Accept-Encoding header value

format_get($url_parts, $data)   X-Ref
Format a URL given GET data

return: string URL with data
param: array $url_parts
param: array|object $data Data to build query using, see {@link https://www.php.net/http_build_query}

connect_error_handler($errno, $errstr)   X-Ref
Error handler for stream_socket_client()

param: int $errno Error number (e.g. E_WARNING)
param: string $errstr Error message

verify_certificate_from_context($host, $context)   X-Ref
Verify the certificate against common name and subject alternative names

Unfortunately, PHP doesn't check the certificate against the alternative
names, leading things like 'https://www.github.com/' to be invalid.
Instead

return: bool
param: string $host Host name to verify against
param: resource $context Stream context

test($capabilities = [])   X-Ref
Self-test whether the transport can be used.

The available capabilities to test for can be found in {@see \WpOrg\Requests\Capability}.

return: bool Whether the transport can be used.
param: array<string, bool> $capabilities Optional. Associative array of capabilities to test against, i.e. `['<capability>' => true]`.



Generated : Mon Dec 6 08:20:01 2021 Cross-referenced by PHPXref