class-http.php

Http boundary — resource teardown + last-response headers (REF-015).

Source includes/Support/class-http.php3 min readPart of Performance Optimisation

includes/Support/class-http.php

Http boundary — resource teardown + last-response headers (REF-015).

Namespace: PerformanceOptimise\\Inc · Lines: 351

Class Http

Class Http

Source: includes/Support/class-http.php, line 42

final class Http

Tags: @since 2.4.0

publicstatic is_php85_or_greater()

public static function is_php85_or_greater(?string=null $php_version): bool

Whether the current runtime deprecates explicit handle-close calls (PHP 8.5+).

ParameterTypeDefaultDescription
$php_version?string=null—Optional version string for testing; defaults to PHP_VERSION.

Return: bool — True on PHP 8.5+, false below.

Tags: @since 2.0.0 · @since 2.4.0 Moved from Util (REF-015); behavior unchanged.

Source: includes/Support/class-http.php, line 63

publicstatic close_curl_handle()

public static function close_curl_handle(& $ch, ?string=null $php_version): void

Release a cURL handle without triggering the PHP 8.5 deprecation.

ParameterTypeDefaultDescription
$ch&—cURL handle to release (nulled in the caller scope).
$php_version?string=null—Optional version override for testing; defaults to PHP_VERSION.

Return: void.

Tags: @since 2.0.0 · @since 2.4.0 Moved from Util (REF-015); behavior unchanged.

Source: includes/Support/class-http.php, line 95

publicstatic close_curl_multi_handle()

public static function close_curl_multi_handle(& $mh, ?string=null $php_version): void

Release a cURL multi handle without triggering the PHP 8.5 deprecation.

ParameterTypeDefaultDescription
$mh&—cURL multi handle to release (nulled in the caller scope).
$php_version?string=null—Optional version override for testing; defaults to PHP_VERSION.

Return: void.

Tags: @since 2.0.0 · @since 2.4.0 Moved from Util (REF-015); behavior unchanged.

Source: includes/Support/class-http.php, line 125

publicstatic destroy_gd_image()

public static function destroy_gd_image(& $image, ?string=null $php_version): void

Release a GD image without triggering the PHP 8.5 deprecation.

ParameterTypeDefaultDescription
$image&—GD image to release (nulled in the caller scope).
$php_version?string=null—Optional version override for testing; defaults to PHP_VERSION.

Return: void.

Tags: @since 2.0.0 · @since 2.4.0 Moved from Util (REF-015); behavior unchanged.

Source: includes/Support/class-http.php, line 155

publicstatic close_curl_share_handle()

public static function close_curl_share_handle(& $sh, ?string=null $php_version): void

Release a cURL share handle without triggering the PHP 8.5 deprecation.

ParameterTypeDefaultDescription
$sh&—cURL share handle to release (nulled in the caller scope).
$php_version?string=null—Optional version override for testing; defaults to PHP_VERSION.

Return: void.

Tags: @since 2.2.0 · @since 2.4.0 Moved from Util (REF-015); behavior unchanged.

Source: includes/Support/class-http.php, line 189

publicstatic close_finfo_handle()

public static function close_finfo_handle(& $finfo, ?string=null $php_version): void

Release a finfo handle without triggering the PHP 8.5 deprecation.

ParameterTypeDefaultDescription
$finfo&—Finfo handle to release (nulled in the caller scope).
$php_version?string=null—Optional version override for testing; defaults to PHP_VERSION.

Return: void.

Tags: @since 2.2.0 · @since 2.4.0 Moved from Util (REF-015); behavior unchanged.

Source: includes/Support/class-http.php, line 223

publicstatic free_xml_parser()

public static function free_xml_parser(& $parser, ?string=null $php_version): void

Release an XML parser without triggering the PHP 8.5 deprecation.

ParameterTypeDefaultDescription
$parser&—XML parser to release (nulled in the caller scope).
$php_version?string=null—Optional version override for testing; defaults to PHP_VERSION.

Return: void.

Tags: @since 2.2.0 · @since 2.4.0 Moved from Util (REF-015); behavior unchanged.

Source: includes/Support/class-http.php, line 257

publicstatic get_last_response_headers()

public static function get_last_response_headers(?array=null $legacy_source): array

Return the last HTTP response headers without touching the deprecated global.

ParameterTypeDefaultDescription
$legacy_source?array=null—Optional explicit header lines for the legacy path (string-filtered).

Return: string[] — List of response header lines, or empty array when unavailable.

Tags: @since 2.2.0 · @since 2.2.0 `$legacy_source` parameter for the scope-blind legacy path. · @since 2.4.0 Moved from Util (REF-015); behavior unchanged.

Source: includes/Support/class-http.php, line 308