![]() |
Bearsampp 2026.5.5
|
Static Public Member Functions | |
| static | checkInternetState () |
| static | get ($url, $headers=array()) |
| static | getApiJson ($url, $headers=array()) |
| static | getCurlHeaders ($url, $headers=array()) |
| static | getCurlHttpHeaders ($url) |
| static | getFopenHttpHeaders ($url) |
| static | getHttpHeaders ($pingUrl) |
| static | getVerbose () |
| static | setVerbose ($verbose) |
Static Private Member Functions | |
| static | categorizeCurlError ($errorCode, $errorMessage, $isLocalhost) |
| static | getApiHeaders () |
| static | getCABundlePath () |
| static | getDefaultHeaders () |
Static Private Attributes | |
| static | $verbose = false |
HttpClient class for handling HTTP requests using cURL.
Definition at line 11 of file class.httpclient.php.
|
staticprivate |
Categorizes cURL errors for better logging and debugging.
| int | $errorCode | The cURL error code. |
| string | $errorMessage | The cURL error message. |
| bool | $isLocalhost | Whether the request was made to a localhost URL. |
Definition at line 271 of file class.httpclient.php.
Referenced by get(), and getCurlHeaders().
|
static |
Checks the current state of the internet connection.
This method attempts to reach a well-known website (e.g., www.google.com) to determine the state of the internet connection. It returns true if the connection is successful, otherwise it returns false.
Definition at line 400 of file class.httpclient.php.
Referenced by QuickPick\getQuickpickMenu(), and QuickPick\installModule().
|
static |
Makes a GET request to the specified URL and returns the response data.
| string | $url | The URL to request. |
| array | $headers | Optional additional headers to include in the request. |
Definition at line 47 of file class.httpclient.php.
References categorizeCurlError(), Log\error(), getCABundlePath(), and getDefaultHeaders().
Referenced by getApiJson().
|
staticprivate |
Gets the headers required for GitHub API requests.
Definition at line 255 of file class.httpclient.php.
References APP_GITHUB_USERAGENT.
Referenced by getApiJson().
|
static |
Makes a request to a JSON API and returns the response data.
| string | $url | The API URL to request. |
| array | $headers | Optional additional headers to include in the request. |
Definition at line 120 of file class.httpclient.php.
References get(), and getApiHeaders().
Referenced by Util\getApiJson().
|
staticprivate |
Gets the path to the CA bundle file.
Definition at line 217 of file class.httpclient.php.
Referenced by get(), and getCurlHeaders().
|
static |
Retrieves HTTP headers from a given URL.
| string | $url | The URL from which to fetch the headers. |
| array | $headers | Optional additional headers to include in the request. |
Definition at line 134 of file class.httpclient.php.
References $response, categorizeCurlError(), Log\error(), getCABundlePath(), and getDefaultHeaders().
Referenced by getCurlHttpHeaders().
|
static |
Retrieves HTTP headers from a given URL using cURL.
This method uses HttpClient for secure TLS verification.
| string | $url | The URL from which to fetch the headers. |
Definition at line 377 of file class.httpclient.php.
References $result, Log\error(), and getCurlHeaders().
Referenced by getHttpHeaders().
|
staticprivate |
Gets the default headers for HTTP requests.
Definition at line 245 of file class.httpclient.php.
Referenced by get(), and getCurlHeaders().
|
static |
Retrieves HTTP headers from a given URL using the fopen function.
This method creates a stream context with SSL verification enabled for security. It attempts to open the URL and read the HTTP response headers.
| string | $url | The URL from which to fetch the headers. |
Definition at line 346 of file class.httpclient.php.
References $result.
Referenced by getHttpHeaders().
|
static |
Retrieves HTTP headers from a given URL using either cURL or fopen, depending on availability.
| string | $pingUrl | The URL to ping for headers. |
Definition at line 309 of file class.httpclient.php.
References $result, Log\debug(), getCurlHttpHeaders(), and getFopenHttpHeaders().
Referenced by BinApache\checkPort().
|
static |
Gets the current verbosity setting.
Definition at line 35 of file class.httpclient.php.
|
static |
Sets the verbosity level for cURL operations.
| bool | $verbose | Whether to enable verbose output. |
Definition at line 25 of file class.httpclient.php.
References $verbose.
|
staticprivate |
Definition at line 17 of file class.httpclient.php.
Referenced by setVerbose().