src/site/php/curl fix.php

Functions

cfw_curl_installed()

cfw_curl_installed() : bool

Returns

bool —

cfw_curl_shim()

cfw_curl_shim() : \Drupal\drupflare\Shim\CurlShim|null

The one shim instance, resolved on FIRST USE rather than at declaration time.

This fragment runs from ensurePhp(), which is before Drupal's autoloader exists, so a class_exists() guard around the declarations would never pass and the functions would never be declared at all. Resolving here instead means the class is looked up when a caller actually makes a request, by which time the module is loaded.

Returns

\Drupal\drupflare\Shim\CurlShim|null —

NULL when the module is not loaded, which every caller below treats as a refusal.

cfw_curl_absent()

cfw_curl_absent() : false

Declares the gap once, then answers the way curl answers a connection it cannot make.

Never silently absent. Without the module there is no queue to defer into, so the honest answer is the same FALSE a caller already handles -- but an operator gets a status-report row saying why instead of an unexplained failure.

Returns

false —

curl_init()

curl_init(string|null  $url = null) : array<string,mixed>|false

Parameters

string|null $url

The URL to request, or NULL to set it later.

Returns

array|false —

The opaque handle, or FALSE when the shim is unavailable.

curl_setopt()

curl_setopt(array|false  $handle, int  $option, mixed  $value) : bool

Parameters

array|false $handle

The handle curl_init() returned.

int $option

A CURLOPT_* constant.

mixed $value

The option value.

Returns

bool —

curl_setopt_array()

curl_setopt_array(array|false  $handle, array  $options) : bool

Parameters

array|false $handle

The handle curl_init() returned.

array $options

CURLOPT_* constants mapped to their values.

Returns

bool —

curl_exec()

curl_exec(array|false  $handle) : string|bool

Parameters

array|false $handle

The handle curl_init() returned.

Returns

string|bool —

curl_getinfo()

curl_getinfo(array|false  $handle, int|null  $key = null) : mixed

Parameters

array|false $handle

The handle curl_init() returned.

int|null $key

A CURLINFO_* constant, or NULL for every field.

Returns

mixed —

curl_reset()

curl_reset(array|false  $handle) : mixed

Parameters

array|false $handle

The handle curl_init() returned.

Returns

mixed —

curl_errno()

curl_errno(array|false  $handle) : int

Parameters

array|false $handle

The handle curl_init() returned.

Returns

int —

curl_error()

curl_error(array|false  $handle) : string

Parameters

array|false $handle

The handle curl_init() returned.

Returns

string —

curl_close()

curl_close(array|false  $handle) : mixed

Parameters

array|false $handle

The handle curl_init() returned.

Returns

mixed —

curl_version()

curl_version() : array<string,mixed>

Reports a version the way ext-curl does, so a caller's feature test has something to read.

The version string names this shim rather than a curl release: a caller comparing against a real curl version must not conclude a feature is present because the number looked new enough.

Returns

array —