BROTLI_COMPRESS_LEVEL_DEFAULT
BROTLI_COMPRESS_LEVEL_DEFAULT = 11
| OpenSSLAsymmetricKey | A key, holding PEM text rather than a native handle. |
| OpenSSLCertificate | A certificate, holding its PEM text. |
| PhpWasmSyncFiber | |
| SodiumException | |
| XMLWriter | Enough of libxml's writer to generate a sitemap, and no more. |
brotli_compress(string $data, int $level = 11, int $mode = 0, string|null $dict = null) : string|false
Compresses a string with brotli.
| string | $data | The bytes to compress. |
| int | $level | A brotli quality, 0 to 11. |
| int | $mode | BROTLI_GENERIC, BROTLI_TEXT or BROTLI_FONT. |
| string|null | $dict | Not supported on this host; a non-empty value is refused. |
The compressed bytes, or FALSE on failure.
brotli_uncompress(string $data, string|null $dict = null) : string|false
Decompresses a brotli stream.
| string | $data | The brotli stream. |
| string|null | $dict | Not supported on this host; a non-empty value is refused. |
The decompressed bytes, or FALSE on failure.
cfw_argon2_hash(string $password, int $m = 19456, int $t = 2, int $p = 1) : string|null
Hashes into PHP's own encoded form.
| string | $password | The password to hash. |
| int | $m | Memory cost in KiB. |
| int | $t | Time cost. |
| int | $p | Lanes. |
The encoded hash, or NULL when the host refused.
cfw_argon2_needs_rehash(string $encoded, int $m = 19456, int $t = 2, int $p = 1) : bool
whether an existing encoded hash was written with weaker parameters than today's
| string | $encoded | The stored hash. |
| int | $m | Memory cost in KiB. |
| int | $t | Time cost. |
| int | $p | Lanes. |
cfw_argon2_raw(string $password, string $salt, int $m, int $t, int $p, int $tagLen = 32) : string|false|null
| string | $password | The password bytes. |
| string | $salt | The salt bytes. |
| int | $m | Memory cost in KiB. |
| int | $t | Time cost. |
| int | $p | Lanes. |
| int | $tagLen | Output length in bytes. |
The raw tag, FALSE when the reply was not base64, or NULL when the host refused.
cfw_argon2_verify(string $password, string $encoded) : bool
Verifies against an encoded hash, in constant time.
hash_equals() rather than ===, because a byte-at-a-time comparison of a password digest is a timing oracle even when the digest itself is memory-hard.
| string | $password | The password to check. |
| string | $encoded | A hash cfw_argon2_hash() or PHP's own password_hash() wrote. |
cfw_batch_yield(int $ops) : bool
Whether _batch_process() should end this request, read after every operation.
Yields on the operation count or when the host reports the isolate near its ceiling, whichever comes first; memory_get_usage() reads 0 in this build, so the host is asked.
| int | $ops | Operations run so far in this request. |
cfw_brotli(string $op, string $data, int $level = 11, int $mode = 0, string $dict = '') : array{ok: bool, data?: string, error?: string}
Runs one op over the bridge.
| string | $op | The operation, compress or uncompress. |
| string | $data | The bytes to transform. |
| int | $level | A brotli quality, 0 to 11. |
| int | $mode | BROTLI_GENERIC, BROTLI_TEXT or BROTLI_FONT. |
| string | $dict | A preset dictionary, or an empty string for none. The host refuses one. |
The decoded reply, or the reason it failed.
cfw_call(callable $fn, array$payload) : array<string,mixed>
Sends one request across the bridge and decodes the reply.
| callable | $fn | The host function from cfw_host(). |
| array |
$payload | The request, run through the pw codec. |
The decoded reply, or an ok => false refusal naming what went wrong.
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.
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.
NULL when the module is not loaded, which every caller below treats as a refusal.
cfw_iconv_strrpos(string $haystack, string $needle, string|null $encoding = null) : int|false
| string | $haystack | The text to search. |
| string | $needle | What to look for. |
| string|null | $encoding | The charset of both, or NULL for the polyfill's internal one. |
The character offset of the last match.
cfw_mb_decode_subst(string $s, string $from) : ?string
The same substitution in the DECODE direction: a source byte the charmap does not know becomes "?" instead of vanishing.
Walks the source the way the polyfill's own mapToUtf8 does -- a two-byte key first, then a one-byte key -- so it is right for SJIS and Big5 as well as for the single-byte charsets. The pair was used exactly when its answer is not the two singles concatenated; where those agree, either choice produces the same bytes.
Returns null when it does not apply, which leaves the polyfill's answer alone: an unknown charset (no charmap ships for EUC-JP) and a source with nothing unmappable both take that path, and the second is the common one.
| string | $s | Source bytes in the named charset. |
| string | $from | The charset the bytes are in. |
cfw_mb_encode_subst(string $s, string $to) : string
Replaces every character the TARGET encoding cannot represent with "?", which is what native mb_convert_encoding does and what the polyfill does not.
The polyfill converts with //IGNORE, so an unmappable character is DROPPED: a Cyrillic sentence converted to ISO-8859-1 comes back as its spaces. One whole-string probe decides -- iconv without //IGNORE answers false only when something is unmappable -- so the per-character loop is paid by the strings that actually need it.
| string | $s | Well-formed UTF-8. |
| string | $to | The target charset. |
cfw_mb_final_sigma(string $lo) : string|null
Applies Unicode SpecialCasing final-sigma to an ALREADY-lowercased string.
Not applied to mb_strtoupper: there is no uppercase counterpart and running it there would corrupt correct output. The strpos() guard is the common case -- a string with no sigma in it cannot need this.
| string | $lo | The lowercased text. |
The text with final sigmas applied, or NULL when the pattern failed.
cfw_mb_fold_safe(string $s) : string
A length-PRESERVING fold, which is what the case-insensitive searches need.
The polyfill lowercases first, and one codepoint lowercases to two (U+0130 gives i plus a combining dot), so every index past it shifts and mb_stripos answers an offset into a string the caller never passed.
| string | $s | Well-formed UTF-8. |
cfw_mb_iconv_label(mixed $enc) : mixed
Spells a charset the way symfony/polyfill-iconv's alias table spells it.
THE CHARMAPS ARE PRESENT AND THE NAMES ARE NOT. Measured against the polyfill rather than against the real extension: SJIS, GBK, BIG5 and EUC-KR are all REFUSED outright, while Shift_JIS, CP936, CP950 and CP949 decode -- out of the same 55 from.*.php files. So the gap that looked like missing capability is six alias entries.
CP950 and CP949 are SUPERSETS of Big5 and EUC-KR, so those two decode every assigned byte correctly and additionally decode bytes the narrower charset leaves unassigned, where mbstring substitutes. That is a real difference and it is why they are named here rather than presented as exact. EUC-JP and ISO-2022-JP ship no charmap at all and stay refused.
| mixed | $enc | The charset the caller named. |
The polyfill's spelling, or the input when it is not a string or needs no alias.
cfw_mb_isubpart(string $haystack, int|false $pos, bool $before, string|null $encoding) : string|false
Case-insensitive search on the ORIGINAL haystack.
The polyfill returns a slice of its own lowercased copy, so a haystack containing a character that lowercases to two comes back with different bytes than went in.
| string | $haystack | The original text. |
| int|false | $pos | Where the needle was found, or FALSE. |
| bool | $before | Return the part before the match rather than from it. |
| string|null | $encoding | The encoding the caller named. |
cfw_mb_patch(string $s, string $which) : string
Pre-maps the codepoints the polyfill would answer wrongly, so its own pass then sees a character it already agrees with.
Pre and not post: the polyfill's wrong answer is ambiguous -- three characters share one stale uppercase -- so a table keyed on its OUTPUT cannot recover the input it came from. strpbrk first, because a string carrying none of the keys' lead bytes cannot need the strtr.
| string | $s | Well-formed UTF-8. |
| string | $which | lower or upper. |
cfw_mb_sanitize(mixed $s, string $sub = '?') : mixed
Replaces every ill-formed UTF-8 sequence with "?".
Matches native mbstring byte for byte, and the rule is NOT one "?" per bad byte -- that was measured, not assumed. Native emits ONE "?" per maximal valid PREFIX it consumed, then resumes at the byte that broke the sequence:
$sub exists for one caller: mb_convert_case TITLE, which needs the substituted run to be a case-IGNORABLE character rather than "?" while the word boundaries are found.
"abc\xe4\xbddef" -> abc?def one "?", two bytes consumed "abc\xe4\xbd" -> abc? same at end of string "abc\xed\xa0\x80def" -> abc???def ED is a valid lead but A0 is out of its range, so ED alone is one "?" and A0 and 80 are then lone continuations "abc\xc0\xafdef" -> abc??def C0 is never a valid lead "abc\xf5\x80\x80\x80def" -> abc????def
A first version advanced one byte at a time on failure and got the truncated cases wrong (abc?? for abc?). The oracle is native mb_substr(); the gate test pins every case above against it.
| mixed | $s | The string to clean; anything else is returned as it came. |
| string | $sub | What replaces each ill-formed run. |
The cleaned string, or the input when it was not a string.
cfw_mb_title_regexp() : string|null
The word-boundary pattern for titlecasing, built from the polyfill's Case_Ignorable data.
The 6,201-byte character class is READ from the package rather than copied, so upstream keeps owning the Unicode half; the two-line grammar around it is replaced, because upstream's lookbehind-then-two-letter-groups is wrong in both directions. It blocks a match on the letter after an ignorable and then RE-ENTERS on the letter after that, so "abc<SHY>def" comes out "Abc<SHY>dEf" where mbstring gives "Abc<SHY>def". Consuming ignorables in the word TAIL fixes it: a character inside a match is never offered a second start.
null means the package moved and every caller falls back to the polyfill's own title path.
The pattern, or NULL when the polyfill's data file is not where it was.
cfw_mb_title_word(array$m) : string
One word: its first character titlecased, the rest lowercased.
The polyfill UPPERCASES the first character, which is a different operation for the 31 Lt digraphs and for every ligature that expands (native titlecases U+FB01 to "Fi", the polyfill uppercases it to "FI").
| array |
$m | The match: the whole word, its first character, and its tail. |
cfw_mb_unicode_data() : array<string,mixed>
The table, or an empty one.
An empty table is not a failure mode, it is the polyfill unchanged: every lookup misses, cfw_mb_patch returns its input and both generated patterns come back null, so a site with no driver pack answers exactly what it answered before the table existed.
The case, width and lead-byte tables keyed by name.
cfw_openssl_crypt(string $dir, string $data, string $cipher_algo, string $passphrase, int $options, string $iv, string|false|null $tag, string $aad, int $tag_length) : array<string,mixed>|false
The shared half of encrypt and decrypt: key and IV sized the way ext-openssl sizes them.
A short key is padded with NUL and a long one truncated, silently, as ext-openssl does. A short IV is padded with a warning; a GCM IV keeps whatever length the caller gave.
| string | $dir | 'enc' or 'dec'. |
| string | $data | The plaintext, or the ciphertext. |
| string | $cipher_algo | A cipher name. |
| string | $passphrase | The key material. |
| int | $options | OPENSSL_RAW_DATA and OPENSSL_ZERO_PADDING flags. |
| string | $iv | The initialisation vector. |
| string|false|null | $tag | The GCM tag, on decrypt. |
| string | $aad | Additional authenticated data, for GCM. |
| int | $tag_length | The GCM tag length in bytes. |
The bridge reply, or FALSE for an unknown cipher or a malformed ciphertext.
cfw_openssl_degraded(string $capability, string $why) : void
Declares a failure to the operator, the way curl-fix.ts does.
A per-call trigger_error reaches the log and never the status report, and a failed verify had neither -- so a caller misreading -1 as "forged" was invisible from outside.
| string | $capability | The capability that degraded. |
| string | $why | Why it did. |
cfw_openssl_pem(\OpenSSLAsymmetricKey|\OpenSSLCertificate|array|string $key, string $want) : string
The PEM text for whatever ext-openssl would accept as a key or certificate.
| \OpenSSLAsymmetricKey|\OpenSSLCertificate|array |
$key | A key object, a certificate object, a two-key array, a PEM or a file:// path. |
| string | $want | 'private' for the private half, 'public' for the public half or a certificate. |
cfw_serve(string $path, bool|string $destruct = true, string $method = 'GET', string $body = '', string $contentType = '', string $cookieHeader = '', string $origin = '', string $clientIp = '', string $accept = '', array $headers = []) : \Symfony\Component\HttpFoundation\Response
Runs one request through the booted kernel and returns the response.
| string | $path | The request path, with its query string. |
| bool|string | $destruct | True, false, or a comma-separated allowlist of service ids to destruct. |
| string | $method | The HTTP method. |
| string | $body | The raw request body. |
| string | $contentType | The request content type. |
| string | $cookieHeader | The raw Cookie header. |
| string | $origin | A scheme://host[:port], or an empty string. |
| string | $clientIp | The visitor's address, or an empty string. |
| string | $accept | The raw Accept header, or an empty string. |
| array | $headers | Every other inbound header, lowercase name to value, such as authorization. |
The kernel's response.
cfw_sleep_ms(float|int $ms, string $fn) : bool
Waits through the host, or returns at once and records how short it fell.
| float|int | $ms | How long to wait, in milliseconds. |
| string | $fn | The PHP function the caller used, for the degradation row. |
Whether the whole wait happened.
cfw_sodium_go(string $fn, array$args) : mixed
Runs one wrapper's call: coerces each argument by its declared kind, crosses the bridge, and writes back any by-reference state.
| string | $fn | The sodium function, from FUNCTION. |
| array |
$args | The wrapper's arguments, by reference where the function takes a state. |
cfw_sodium_int(string $fn, int $at, string $name, mixed $v) : string
An int argument as the decimal string the host reads.
| string | $fn | The function name, for the message. |
| int | $at | The argument's zero-based position. |
| string | $name | The parameter name. |
| mixed | $v | What the caller passed. |
cfw_sodium_ref(string $fn, int $at, string $name, mixed $v) : string
A by-reference state argument; anything but a string is not a state.
| string | $fn | The function name, for the message. |
| int | $at | The argument's zero-based position. |
| string | $name | The parameter name. |
| mixed | $v | What the caller passed. |
cfw_sodium_str(string $fn, int $at, string $name, mixed $v) : string
A string argument as the base64 the host reads, coerced the way an internal function coerces it.
| string | $fn | The function name, for the message. |
| int | $at | The argument's zero-based position. |
| string | $name | The parameter name. |
| mixed | $v | What the caller passed. |
cfw_symfony_http_client(array$defaultOptions = []) : object|null
What a delivered symfony/http-client's HttpClient::create() answers with, once rewritten.
| array |
$defaultOptions | The options the caller passed to create(). |
A client, or NULL when the drupflare module is not loaded.
cfw_txn(array}> $statements, bool $commit = true, array{sql: string, params: array }|null $read = null) : array<string,mixed>
Runs statements in one transaction, optionally reading inside it.
| array |
$statements | The statements to run in one transaction. |
| bool | $commit | Whether to commit rather than roll back. |
| array{sql: string, params: array |
$read | A statement to run inside the transaction and report. |
The host reply: ok, and readResult when a read was asked for.
cfw_zlib(string $op, string $data, int $level = -1, string $dict = '') : array{ok: bool, data?: string, error?: string}
Runs one op over the bridge.
| string | $op | gzip, gunzip, zlib, unzlib, deflate or inflate. |
| string | $data | The bytes to transform. |
| int | $level | A zlib level, or -1 for the default. |
| string | $dict | A preset dictionary, or an empty string for none. |
['ok' => true, 'data' => string] or ['ok' => false, 'error' => string].
cfw_zlib_cap(string $name, string $data, int $max_length) : string|false
Applies $max_length the way zlib does, which is NOT a truncation.
Measured: gzuncompress(gzcompress('hello world'), 5) is FALSE, not 'hello'. zlib fails the inflate when its output buffer is too small, so a cap below the payload is a data error rather than a short read. 0 means no cap.
| string | $name | The PHP function being called. |
| string | $data | The inflated bytes. |
| int | $max_length | The cap, or 0 for none. |
The bytes, or FALSE with an E_USER_WARNING when the cap was exceeded.
cfw_zlib_dict(string $op, string $data, string $dict, int $level = -1) : string|false
Compresses or decompresses against a preset dictionary.
NOT shaped like a gz* function: PHP has never had a dictionary parameter on gzcompress(), so widening one of those signatures would make a host-only argument look like part of the language. function_exists('cfw_zlib_dict') is the feature test a caller uses.
$op is 'zlib' to compress and 'unzlib' to decompress; the output is an ordinary zlib stream with FDICT set. gzip and the raw pair are refused, because neither has anywhere to record the dictionary's checksum -- so a wrong dictionary would decode to plausible garbage instead of failing.
| string | $op | zlib or unzlib. |
| string | $data | The bytes to transform. |
| string | $dict | The preset dictionary. |
| int | $level | A zlib level, or -1 for the default. |
The bytes, or FALSE with an E_USER_WARNING, matching the gz* functions.
cfw_zlib_encoding(string $name, int $encoding) : string
The container an encoding names.
All three encoders accept all three encodings and emit that container -- measured on 8.5.7, gzcompress(x, 9, ZLIB_ENCODING_GZIP) is byte-identical to gzencode(x, 9, FORCE_GZIP) -- so the three share one mapping.
| string | $name | The PHP function being called. |
| int | $encoding | A ZLIB_ENCODING_* value. |
cfw_zstd(string $op, string $data, int $level = 3, string $dict = '') : array{ok: bool, data?: string, error?: string}
Runs one op over the bridge.
| string | $op | The operation, compress or uncompress. |
| string | $data | The bytes to transform. |
| int | $level | A zstd level, 1 to 22 (or zero and below). |
| string | $dict | A preset dictionary, or an empty string for none. |
The decoded reply, or the reason it failed.
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.
exif_read_data(string|resource $file, string|null $required_sections = null, bool $as_arrays = false, bool $read_thumbnail = false) : array<string,mixed>|false
| string|resource | $file | A path or an open stream. |
| string|null | $required_sections | Comma-separated sections the result must carry. |
| bool | $as_arrays | Return sections as arrays. |
| bool | $read_thumbnail | Also read the embedded thumbnail. |
get_extension_funcs(string $extension) : array<int,string>|false
Lists the functions an extension provides, counting the gated shims.
| string | $extension | An extension name, in any case. |
The function names, or FALSE when the extension is unknown or has none.
openssl_decrypt(string $data, string $cipher_algo, string $passphrase, int $options = 0, string $iv = '', string|false|null $tag = null, string $aad = '') : string|false
| string | $data | The ciphertext. |
| string | $cipher_algo | A cipher name. |
| string | $passphrase | The key material. |
| int | $options | OPENSSL_RAW_DATA and OPENSSL_ZERO_PADDING flags. |
| string | $iv | The initialisation vector. |
| string|false|null | $tag | The GCM tag. |
| string | $aad | Additional authenticated data, for GCM. |
openssl_encrypt(string $data, string $cipher_algo, string $passphrase, int $options = 0, string $iv = '', string|false|null $tag = null, string $aad = '', int $tag_length = 16) : string|false
| string | $data | The plaintext. |
| string | $cipher_algo | A cipher name. |
| string | $passphrase | The key material. |
| int | $options | OPENSSL_RAW_DATA and OPENSSL_ZERO_PADDING flags. |
| string | $iv | The initialisation vector. |
| string|false|null | $tag | Set to the GCM tag. |
| string | $aad | Additional authenticated data, for GCM. |
| int | $tag_length | The GCM tag length in bytes. |
openssl_get_privatekey(\OpenSSLAsymmetricKey|array|string $private_key, string|null $passphrase = null) : \OpenSSLAsymmetricKey|false
| \OpenSSLAsymmetricKey|array |
$private_key | A PEM, a key object or a file:// path. |
| string|null | $passphrase | The passphrase the PEM was written with. |
openssl_get_publickey(\OpenSSLAsymmetricKey|\OpenSSLCertificate|array|string $public_key) : \OpenSSLAsymmetricKey|false
| \OpenSSLAsymmetricKey|\OpenSSLCertificate|array |
$public_key | A PEM, a certificate, a file:// path or a JWK array. |
openssl_pkey_derive(\OpenSSLAsymmetricKey|\OpenSSLCertificate|array|string $public_key, \OpenSSLAsymmetricKey|array |string $private_key, int $key_length = 0) : string|false
ECDH: the shared secret between a private key and a peer public key.
| \OpenSSLAsymmetricKey|\OpenSSLCertificate|array |
$public_key | The peer's public key. |
| \OpenSSLAsymmetricKey|array |
$private_key | This side's private key. |
| int | $key_length | Truncate the secret to this many bytes, or 0 for all of it. |
The secret, or FALSE.
openssl_pkey_export(\OpenSSLAsymmetricKey|array|string $key, string|null $out, string|null $passphrase = null) : bool
Writes a private key out as PEM.
PASSPHRASES ARE REFUSED rather than ignored. ext-openssl encrypts the output when one is given, and answering with an UNENCRYPTED key to a caller who asked for an encrypted one would hand them a secret they believe is protected.
| \OpenSSLAsymmetricKey|array |
$key | The key to export. |
| string|null | $out | Set to the PEM. |
| string|null | $passphrase | Refused when not empty. |
TRUE on success.
openssl_pkey_get_details(\OpenSSLAsymmetricKey|array|string $key) : array<string,mixed>|false
What ext-openssl reports about a key: bits, the public PEM, the type and its parameters.
| \OpenSSLAsymmetricKey|array |
$key | The key to describe. |
The details, or FALSE.
openssl_pkey_get_private(\OpenSSLAsymmetricKey|array|string $private_key, string|null $passphrase = null) : \OpenSSLAsymmetricKey|false
Reads a private key, decrypting it with the passphrase when one was used to write it.
| \OpenSSLAsymmetricKey|array |
$private_key | A PEM, a key object or a file:// path. |
| string|null | $passphrase | The passphrase the PEM was written with. |
The key, or FALSE.
openssl_pkey_get_public(\OpenSSLAsymmetricKey|\OpenSSLCertificate|array|string $public_key) : \OpenSSLAsymmetricKey|false
Turns a PEM, a certificate or a JWKS entry into a public key openssl_verify() accepts.
THE MISSING STEP IN EVERY OIDC LIBRARY. A provider publishes a key SET, the library reads the entry it needs and hands it here.
| \OpenSSLAsymmetricKey|\OpenSSLCertificate|array |
$public_key | A PEM, a certificate, a file:// path or a JWK array. |
The public key, or FALSE.
openssl_private_decrypt(string $data, string|false|null $decrypted_data, \OpenSSLAsymmetricKey|array|string $private_key, int $padding = 1) : bool
| string | $data | The bytes to decrypt. |
| string|false|null | $decrypted_data | Set to the result. |
| \OpenSSLAsymmetricKey|array |
$private_key | The key. |
| int | $padding | OPENSSL_PKCS1_PADDING or OPENSSL_PKCS1_OAEP_PADDING. |
openssl_private_encrypt(string $data, string|false|null $encrypted_data, \OpenSSLAsymmetricKey|array|string $private_key, int $padding = 1) : bool
RSA sign-with-private, which is what a legacy licence check or an older SSO handshake uses.
| string | $data | The bytes to encrypt. |
| string|false|null | $encrypted_data | Set to the result. |
| \OpenSSLAsymmetricKey|array |
$private_key | The key. |
| int | $padding | An OPENSSL_*_PADDING value; ignored here. |
TRUE on success.
openssl_public_decrypt(string $data, string|false|null $decrypted_data, \OpenSSLAsymmetricKey|\OpenSSLCertificate|array|string $public_key, int $padding = 1) : bool
The other half of the pair above.
| string | $data | The bytes to decrypt. |
| string|false|null | $decrypted_data | Set to the result. |
| \OpenSSLAsymmetricKey|\OpenSSLCertificate|array |
$public_key | The key. |
| int | $padding | An OPENSSL_*_PADDING value; ignored here. |
TRUE on success.
openssl_public_encrypt(string $data, string|false|null $encrypted_data, \OpenSSLAsymmetricKey|\OpenSSLCertificate|array|string $public_key, int $padding = 1) : bool
Encrypt to a public key, PKCS#1 v1.5 or OAEP, which is how XML encryption wraps its key.
| string | $data | The bytes to encrypt. |
| string|false|null | $encrypted_data | Set to the result. |
| \OpenSSLAsymmetricKey|\OpenSSLCertificate|array |
$public_key | The key. |
| int | $padding | OPENSSL_PKCS1_PADDING or OPENSSL_PKCS1_OAEP_PADDING. |
TRUE on success.
openssl_sign(string $data, string|false|null $signature, \OpenSSLAsymmetricKey|array|string $private_key, int|string $algorithm = 1) : bool
| string | $data | The bytes to sign. |
| string|false|null | $signature | Set to the raw signature. |
| \OpenSSLAsymmetricKey|array |
$private_key | The signing key. |
| int|string | $algorithm | An OPENSSL_ALGO_* value or a digest name. |
openssl_verify(string $data, string $signature, \OpenSSLAsymmetricKey|\OpenSSLCertificate|array|string $public_key, int|string $algorithm = 1) : int
Answers 1, 0 or -1, matching ext-openssl.
-1 means the call itself failed -- an unreadable key, an unsupported digest -- and is NOT the same as 0, which means the signature was read and did not match. A caller treating -1 as "invalid" would report a broken key as a forged token.
| string | $data | The signed bytes. |
| string | $signature | The raw signature. |
| \OpenSSLAsymmetricKey|\OpenSSLCertificate|array |
$public_key | The verification key. |
| int|string | $algorithm | An OPENSSL_ALGO_* value or a digest name. |
openssl_x509_checkpurpose(\OpenSSLCertificate|string $certificate, int $purpose, array$ca_info = [], string|null $untrusted_certificates_file = null) : int
Purpose checking needs a trust store and purpose table this runtime does not carry.
| \OpenSSLCertificate|string | $certificate | The certificate to check. |
| int | $purpose | An X509_PURPOSE_* value. |
| array |
$ca_info | Trusted CA locations. |
| string|null | $untrusted_certificates_file | Intermediate certificates. |
-1, which ext-openssl uses for "could not be determined".
openssl_x509_export(\OpenSSLCertificate|string $certificate, string|null $output, bool $no_text = true) : bool
| \OpenSSLCertificate|string | $certificate | A PEM, a file:// path or a certificate object. |
| string|null | $output | Set to the PEM. |
| bool | $no_text | Ignored. |
openssl_x509_fingerprint(\OpenSSLCertificate|string $certificate, string $digest_algo = 'sha1', bool $binary = false) : string|false
| \OpenSSLCertificate|string | $certificate | A PEM, a file:// path or a certificate object. |
| string | $digest_algo | A digest name. |
| bool | $binary | Return raw bytes instead of hex. |
openssl_x509_parse(\OpenSSLCertificate|string $certificate, bool $short_names = true) : array<string,mixed>|false
The fields of a certificate that node:crypto exposes, under ext-openssl's key names.
| \OpenSSLCertificate|string | $certificate | A PEM, a file:// path or a certificate object. |
| bool | $short_names | Ignored. |
The parsed certificate, or FALSE.
openssl_x509_read(\OpenSSLCertificate|string $certificate) : \OpenSSLCertificate|false
Reads a certificate from PEM, a file:// path or another certificate.
| \OpenSSLCertificate|string | $certificate | A PEM, a file:// path or a certificate object. |
The certificate, or FALSE.
proc_open(array|string $command, array $descriptor_spec, array $pipes, string|null $cwd = null, array |null $env_vars = null, array |null $options = null) : resource|false
| array |
$command | The command line. |
| array |
$descriptor_spec | The pipes to open. |
| array |
$pipes | Set to the opened pipes. |
| string|null | $cwd | Working directory. |
| array |
$env_vars | Environment. |
| array |
$options | Platform options. |
transliterator_transliterate(object|string $transliterator, string $string, int $start = 0, int $end = -1) : string|false
| object|string | $transliterator | A transliterator or a rule id. |
| string | $string | The text to transliterate. |
| int | $start | First byte to transliterate. |
| int | $end | One past the last byte, or -1 for the rest. |
zstd_compress(string $data, int $level = 3, string|null $dict = null) : string|false
Compresses a string with zstd.
| string | $data | The bytes to compress. |
| int | $level | A zstd level, 1 to 22 (or zero and below). |
| string|null | $dict | A preset dictionary, or NULL for none. |
The compressed bytes, or FALSE on failure.
zstd_compress_dict(string $data, string $dict, int $level = 3) : string|false
Compresses a string with zstd and a required dictionary.
| string | $data | The bytes to compress. |
| string | $dict | The dictionary; required. |
| int | $level | A zstd level, 1 to 22 (or zero and below). |
The compressed bytes, or FALSE on failure.
zstd_decompress(string $data, string|null $dict = null) : string|false
The alias ext-zstd documents beside zstd_uncompress().
| string | $data | The zstd frame. |
| string|null | $dict | The dictionary the frame was compressed with, or NULL for none. |
The decompressed bytes, or FALSE on failure.
zstd_uncompress(string $data, string|null $dict = null) : string|false
Decompresses a zstd frame.
| string | $data | The zstd frame. |
| string|null | $dict | The dictionary the frame was compressed with, or NULL for none. |
The decompressed bytes, or FALSE on failure.
zstd_uncompress_dict(string $data, string $dict) : string|false
Decompresses a zstd frame with a required dictionary.
| string | $data | The zstd frame. |
| string | $dict | The dictionary the frame was compressed with; required. |
The decompressed bytes, or FALSE on failure.