From d5d8e90cbc7f302fa4b364f118fcfb25aec12027 Mon Sep 17 00:00:00 2001 From: Shish Date: Mon, 2 Dec 2024 17:44:27 +0000 Subject: [PATCH] Regenerate files based on latest code changes --- composer.json | 4 +- generated/apache.php | 61 +- generated/apcu.php | 1 + generated/array.php | 50 +- generated/bzip2.php | 3 +- generated/calendar.php | 3 +- generated/classobj.php | 4 +- generated/com.php | 3 +- generated/cubrid.php | 17 +- generated/curl.php | 2948 +---------------------------------- generated/datetime.php | 330 +--- generated/dir.php | 1 + generated/eio.php | 221 +-- generated/errorfunc.php | 3 +- generated/exec.php | 1 + generated/fileinfo.php | 3 +- generated/filesystem.php | 77 +- generated/filter.php | 46 +- generated/fpm.php | 24 + generated/ftp.php | 39 +- generated/funchand.php | 3 +- generated/functionsList.php | 104 +- generated/gettext.php | 9 +- generated/gnupg.php | 3 +- generated/hash.php | 39 +- generated/ibase.php | 9 +- generated/ibmDb2.php | 78 +- generated/iconv.php | 1 + generated/image.php | 102 +- generated/imap.php | 204 +-- generated/info.php | 315 +--- generated/inotify.php | 29 + generated/json.php | 1 + generated/ldap.php | 54 +- generated/libxml.php | 3 +- generated/lzf.php | 1 + generated/mailparse.php | 3 +- generated/mbstring.php | 50 +- generated/misc.php | 224 +-- generated/mysql.php | 41 +- generated/network.php | 278 +--- generated/oci8.php | 25 +- generated/opcache.php | 1 + generated/openssl.php | 178 ++- generated/outcontrol.php | 269 ++-- generated/pcntl.php | 5 +- generated/pcre.php | 21 +- generated/pgsql.php | 83 +- generated/posix.php | 43 +- generated/ps.php | 5 +- generated/pspell.php | 45 +- generated/readline.php | 65 +- generated/rpminfo.php | 1 + generated/rrd.php | 3 +- generated/sem.php | 7 +- generated/session.php | 26 +- generated/shmop.php | 8 +- generated/sockets.php | 31 +- generated/sodium.php | 61 +- generated/solr.php | 1 + generated/spl.php | 22 +- generated/sqlsrv.php | 7 +- generated/ssdeep.php | 1 + generated/ssh2.php | 31 +- generated/stream.php | 40 +- generated/strings.php | 1 + generated/swoole.php | 5 +- generated/uodbc.php | 648 +------- generated/uopz.php | 1 + generated/url.php | 1 + generated/var.php | 1 + generated/xdiff.php | 3 +- generated/xml.php | 685 +------- generated/xmlrpc.php | 1 + generated/yaml.php | 13 +- generated/yaz.php | 3 +- generated/zip.php | 1 + generated/zlib.php | 48 +- rector-migrate.php | 103 +- 79 files changed, 1317 insertions(+), 6566 deletions(-) diff --git a/composer.json b/composer.json index cb78de5b..84d3ee2a 100644 --- a/composer.json +++ b/composer.json @@ -43,7 +43,6 @@ "generated/ftp.php", "generated/funchand.php", "generated/gettext.php", - "generated/gmp.php", "generated/gnupg.php", "generated/hash.php", "generated/ibase.php", @@ -73,6 +72,7 @@ "generated/ps.php", "generated/pspell.php", "generated/readline.php", + "generated/rnp.php", "generated/rpminfo.php", "generated/rrd.php", "generated/sem.php", @@ -116,4 +116,4 @@ "cs-fix": "phpcbf", "cs-check": "phpcs" } -} +} \ No newline at end of file diff --git a/generated/apache.php b/generated/apache.php index e6fd372c..2e1ce7c9 100644 --- a/generated/apache.php +++ b/generated/apache.php @@ -91,44 +91,6 @@ function apache_lookup_uri(string $filename): object } -/** - * Fetches all HTTP request headers from the current request. Works in the - * Apache, FastCGI, CLI, and FPM webservers. - * - * @return array An associative array of all the HTTP headers in the current request. - * @throws ApacheException - * - */ -function apache_request_headers(): array -{ - error_clear_last(); - $safeResult = \apache_request_headers(); - if ($safeResult === false) { - throw ApacheException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Fetch all HTTP response headers. Works in the - * Apache, FastCGI, CLI, and FPM webservers. - * - * @return array An array of all Apache response headers on success. - * @throws ApacheException - * - */ -function apache_response_headers(): array -{ - error_clear_last(); - $safeResult = \apache_response_headers(); - if ($safeResult === false) { - throw ApacheException::createFromPhpError(); - } - return $safeResult; -} - - /** * apache_setenv sets the value of the Apache * environment variable specified by @@ -150,28 +112,6 @@ function apache_setenv(string $variable, string $value, bool $walk_to_top = fals } -/** - * Fetches all HTTP headers from the current request. - * - * This function is an alias for apache_request_headers. - * Please read the apache_request_headers - * documentation for more information on how this function works. - * - * @return array An associative array of all the HTTP headers in the current request. - * @throws ApacheException - * - */ -function getallheaders(): array -{ - error_clear_last(); - $safeResult = \getallheaders(); - if ($safeResult === false) { - throw ApacheException::createFromPhpError(); - } - return $safeResult; -} - - /** * virtual is an Apache-specific function which * is similar to <!--#include virtual...--> in @@ -197,3 +137,4 @@ function virtual(string $uri): void throw ApacheException::createFromPhpError(); } } + diff --git a/generated/apcu.php b/generated/apcu.php index a8ec70b4..ff774136 100644 --- a/generated/apcu.php +++ b/generated/apcu.php @@ -110,3 +110,4 @@ function apcu_sma_info(bool $limited = false): array } return $safeResult; } + diff --git a/generated/array.php b/generated/array.php index 6ef24195..6d41249b 100644 --- a/generated/array.php +++ b/generated/array.php @@ -5,55 +5,27 @@ use Safe\Exceptions\ArrayException; /** - * Applies the user-defined callback function to each - * element of the array. This function will recurse - * into deeper arrays. * - * @param array|object $array The input array. - * @param callable $callback Typically, callback takes on two parameters. - * The array parameter's value being the first, and - * the key/index second. * - * If callback needs to be working with the - * actual values of the array, specify the first parameter of - * callback as a - * reference. Then, - * any changes made to those elements will be made in the - * original array itself. - * @param mixed $arg If the optional arg parameter is supplied, - * it will be passed as the third parameter to the - * callback. - * @throws ArrayException + * @param array $array + * @param callable $callback The callback function to call to check each element, which must be * - */ -function array_walk_recursive(&$array, callable $callback, $arg = null): void -{ - error_clear_last(); - if ($arg !== null) { - $safeResult = \array_walk_recursive($array, $callback, $arg); - } else { - $safeResult = \array_walk_recursive($array, $callback); - } - if ($safeResult === false) { - throw ArrayException::createFromPhpError(); - } -} - - -/** - * This function shuffles (randomizes the order of the elements in) an array. - * It uses a pseudo random number generator that is not suitable for - * cryptographic purposes. + * boolcallback + * mixedvalue + * mixedkey * - * @param array $array The array. + * If this function returns FALSE, FALSE is returned from + * array_all and the callback will not be called for + * further elements. * @throws ArrayException * */ -function shuffle(array &$array): void +function array_all(array $array, callable $callback): void { error_clear_last(); - $safeResult = \shuffle($array); + $safeResult = \array_all($array, $callback); if ($safeResult === false) { throw ArrayException::createFromPhpError(); } } + diff --git a/generated/bzip2.php b/generated/bzip2.php index df550e09..eaf36dc0 100644 --- a/generated/bzip2.php +++ b/generated/bzip2.php @@ -82,7 +82,7 @@ function bzread($bz, int $length = 1024): string * @throws Bzip2Exception * */ -function bzwrite($bz, string $data, int $length = null): int +function bzwrite($bz, string $data, ?int $length = null): int { error_clear_last(); if ($length !== null) { @@ -95,3 +95,4 @@ function bzwrite($bz, string $data, int $length = null): int } return $safeResult; } + diff --git a/generated/calendar.php b/generated/calendar.php index c063ab06..097e7d4a 100644 --- a/generated/calendar.php +++ b/generated/calendar.php @@ -15,7 +15,7 @@ * @throws CalendarException * */ -function unixtojd(int $timestamp = null): int +function unixtojd(?int $timestamp = null): int { error_clear_last(); if ($timestamp !== null) { @@ -28,3 +28,4 @@ function unixtojd(int $timestamp = null): int } return $safeResult; } + diff --git a/generated/classobj.php b/generated/classobj.php index 06141e26..09de2d37 100644 --- a/generated/classobj.php +++ b/generated/classobj.php @@ -11,7 +11,8 @@ * * @param string $class The original class. * @param string $alias The alias name for the class. - * @param bool $autoload Whether to autoload if the original class is not found. + * @param bool $autoload Whether to autoload + * if the original class is not found. * @throws ClassobjException * */ @@ -23,3 +24,4 @@ function class_alias(string $class, string $alias, bool $autoload = true): void throw ClassobjException::createFromPhpError(); } } + diff --git a/generated/com.php b/generated/com.php index fcbcc551..45946123 100644 --- a/generated/com.php +++ b/generated/com.php @@ -138,7 +138,7 @@ function com_load_typelib(string $typelib, bool $case_insensitive = true): void * @throws ComException * */ -function com_print_typeinfo(object $variant, string $dispatch_interface = null, bool $display_sink = false): void +function com_print_typeinfo(object $variant, ?string $dispatch_interface = null, bool $display_sink = false): void { error_clear_last(); if ($display_sink !== false) { @@ -194,3 +194,4 @@ function variant_round($value, int $decimals) } return $safeResult; } + diff --git a/generated/cubrid.php b/generated/cubrid.php index 4835f87b..155fe5a7 100644 --- a/generated/cubrid.php +++ b/generated/cubrid.php @@ -124,7 +124,7 @@ * @throws CubridException * */ -function cubrid_bind($req_identifier, int $bind_index, $bind_value, string $bind_value_type = null): void +function cubrid_bind($req_identifier, int $bind_index, $bind_value, ?string $bind_value_type = null): void { error_clear_last(); if ($bind_value_type !== null) { @@ -303,7 +303,7 @@ function cubrid_commit($conn_identifier): void * @throws CubridException * */ -function cubrid_connect_with_url(string $conn_url, string $userid = null, string $passwd = null, bool $new_link = false) +function cubrid_connect_with_url(string $conn_url, ?string $userid = null, ?string $passwd = null, bool $new_link = false) { error_clear_last(); if ($new_link !== false) { @@ -347,7 +347,7 @@ function cubrid_connect_with_url(string $conn_url, string $userid = null, string * @throws CubridException * */ -function cubrid_connect(string $host, int $port, string $dbname, string $userid = null, string $passwd = null, bool $new_link = false) +function cubrid_connect(string $host, int $port, string $dbname, ?string $userid = null, ?string $passwd = null, bool $new_link = false) { error_clear_last(); if ($new_link !== false) { @@ -822,7 +822,7 @@ function cubrid_lob_size($lob_identifier): string * @throws CubridException * */ -function cubrid_lob2_bind($req_identifier, int $bind_index, $bind_value, string $bind_value_type = null): void +function cubrid_lob2_bind($req_identifier, int $bind_index, $bind_value, ?string $bind_value_type = null): void { error_clear_last(); if ($bind_value_type !== null) { @@ -1300,7 +1300,7 @@ function cubrid_next_result($result): void * @throws CubridException * */ -function cubrid_pconnect_with_url(string $conn_url, string $userid = null, string $passwd = null) +function cubrid_pconnect_with_url(string $conn_url, ?string $userid = null, ?string $passwd = null) { error_clear_last(); if ($passwd !== null) { @@ -1345,7 +1345,7 @@ function cubrid_pconnect_with_url(string $conn_url, string $userid = null, strin * @throws CubridException * */ -function cubrid_pconnect(string $host, int $port, string $dbname, string $userid = null, string $passwd = null) +function cubrid_pconnect(string $host, int $port, string $dbname, ?string $userid = null, ?string $passwd = null) { error_clear_last(); if ($passwd !== null) { @@ -1409,7 +1409,7 @@ function cubrid_prepare($conn_identifier, string $prepare_stmt, int $option = 0) * @throws CubridException * */ -function cubrid_put($conn_identifier, string $oid, string $attr = null, $value = null): void +function cubrid_put($conn_identifier, string $oid, ?string $attr = null, $value = null): void { error_clear_last(); if ($value !== null) { @@ -1837,7 +1837,7 @@ function cubrid_rollback($conn_identifier): void * @throws CubridException * */ -function cubrid_schema($conn_identifier, int $schema_type, string $class_name = null, string $attr_name = null): array +function cubrid_schema($conn_identifier, int $schema_type, ?string $class_name = null, ?string $attr_name = null): array { error_clear_last(); if ($attr_name !== null) { @@ -2036,3 +2036,4 @@ function cubrid_set_query_timeout($req_identifier, int $timeout): void throw CubridException::createFromPhpError(); } } + diff --git a/generated/curl.php b/generated/curl.php index 3c135f0b..a49d2f97 100644 --- a/generated/curl.php +++ b/generated/curl.php @@ -53,7 +53,9 @@ function curl_escape(\CurlHandle $handle, string $string): string * * @param \CurlHandle $handle A cURL handle returned by * curl_init. - * @return bool|string Returns TRUE on success. However, if the CURLOPT_RETURNTRANSFER + * @return bool|string On success, this function flushes the result directly to the + * stdout and returns TRUE. + * However, if the CURLOPT_RETURNTRANSFER * option is set, it will return * the result on success, FALSE on failure. * @throws CurlException @@ -75,318 +77,7 @@ function curl_exec(\CurlHandle $handle) * * @param \CurlHandle $handle A cURL handle returned by * curl_init. - * @param int $option This may be one of the following constants: - * - * - * - * CURLINFO_EFFECTIVE_URL - Last effective URL - * - * - * - * - * CURLINFO_HTTP_CODE - The last response code. - * As of cURL 7.10.8, this is a legacy alias of - * CURLINFO_RESPONSE_CODE - * - * - * - * - * CURLINFO_FILETIME - Remote time of the retrieved document, with the CURLOPT_FILETIME enabled; if -1 is returned the time of the document is unknown - * - * - * - * - * CURLINFO_TOTAL_TIME - Total transaction time in seconds for last transfer - * - * - * - * - * CURLINFO_NAMELOOKUP_TIME - Time in seconds until name resolving was complete - * - * - * - * - * CURLINFO_CONNECT_TIME - Time in seconds it took to establish the connection - * - * - * - * - * CURLINFO_PRETRANSFER_TIME - Time in seconds from start until just before file transfer begins - * - * - * - * - * CURLINFO_STARTTRANSFER_TIME - Time in seconds until the first byte is about to be transferred - * - * - * - * - * CURLINFO_REDIRECT_COUNT - Number of redirects, with the CURLOPT_FOLLOWLOCATION option enabled - * - * - * - * - * CURLINFO_REDIRECT_TIME - Time in seconds of all redirection steps before final transaction was started, with the CURLOPT_FOLLOWLOCATION option enabled - * - * - * - * - * CURLINFO_REDIRECT_URL - With the CURLOPT_FOLLOWLOCATION option disabled: redirect URL found in the last transaction, that should be requested manually next. With the CURLOPT_FOLLOWLOCATION option enabled: this is empty. The redirect URL in this case is available in CURLINFO_EFFECTIVE_URL - * - * - * - * - * CURLINFO_PRIMARY_IP - IP address of the most recent connection - * - * - * - * - * CURLINFO_PRIMARY_PORT - Destination port of the most recent connection - * - * - * - * - * CURLINFO_LOCAL_IP - Local (source) IP address of the most recent connection - * - * - * - * - * CURLINFO_LOCAL_PORT - Local (source) port of the most recent connection - * - * - * - * - * CURLINFO_SIZE_UPLOAD - Total number of bytes uploaded - * - * - * - * - * CURLINFO_SIZE_DOWNLOAD - Total number of bytes downloaded - * - * - * - * - * CURLINFO_SPEED_DOWNLOAD - Average download speed - * - * - * - * - * CURLINFO_SPEED_UPLOAD - Average upload speed - * - * - * - * - * CURLINFO_HEADER_SIZE - Total size of all headers received - * - * - * - * - * CURLINFO_HEADER_OUT - The request string sent. For this to - * work, add the CURLINFO_HEADER_OUT option to the handle by calling - * curl_setopt - * - * - * - * - * CURLINFO_REQUEST_SIZE - Total size of issued requests, currently only for HTTP requests - * - * - * - * - * CURLINFO_SSL_VERIFYRESULT - Result of SSL certification verification requested by setting CURLOPT_SSL_VERIFYPEER - * - * - * - * - * CURLINFO_CONTENT_LENGTH_DOWNLOAD - Content length of download, read from Content-Length: field - * - * - * - * - * CURLINFO_CONTENT_LENGTH_UPLOAD - Specified size of upload - * - * - * - * - * CURLINFO_CONTENT_TYPE - Content-Type: of the requested document. NULL indicates server did not send valid Content-Type: header - * - * - * - * - * CURLINFO_PRIVATE - Private data associated with this cURL handle, previously set with the CURLOPT_PRIVATE option of curl_setopt - * - * - * - * - * CURLINFO_RESPONSE_CODE - The last response code - * - * - * - * - * CURLINFO_HTTP_CONNECTCODE - The CONNECT response code - * - * - * - * - * CURLINFO_HTTPAUTH_AVAIL - Bitmask indicating the authentication method(s) available according to the previous response - * - * - * - * - * CURLINFO_PROXYAUTH_AVAIL - Bitmask indicating the proxy authentication method(s) available according to the previous response - * - * - * - * - * CURLINFO_OS_ERRNO - Errno from a connect failure. The number is OS and system specific. - * - * - * - * - * CURLINFO_NUM_CONNECTS - Number of connections curl had to create to achieve the previous transfer - * - * - * - * - * CURLINFO_SSL_ENGINES - OpenSSL crypto-engines supported - * - * - * - * - * CURLINFO_COOKIELIST - All known cookies - * - * - * - * - * CURLINFO_FTP_ENTRY_PATH - Entry path in FTP server - * - * - * - * - * CURLINFO_APPCONNECT_TIME - Time in seconds it took from the start until the SSL/SSH connect/handshake to the remote host was completed - * - * - * - * - * CURLINFO_CERTINFO - TLS certificate chain - * - * - * - * - * CURLINFO_CONDITION_UNMET - Info on unmet time conditional - * - * - * - * - * CURLINFO_RTSP_CLIENT_CSEQ - Next RTSP client CSeq - * - * - * - * - * CURLINFO_RTSP_CSEQ_RECV - Recently received CSeq - * - * - * - * - * CURLINFO_RTSP_SERVER_CSEQ - Next RTSP server CSeq - * - * - * - * - * CURLINFO_RTSP_SESSION_ID - RTSP session ID - * - * - * - * - * CURLINFO_CONTENT_LENGTH_DOWNLOAD_T - The content-length of the download. This is the value read from the Content-Type: field. -1 if the size isn't known - * - * - * - * - * CURLINFO_CONTENT_LENGTH_UPLOAD_T - The specified size of the upload. -1 if the size isn't known - * - * - * - * - * CURLINFO_HTTP_VERSION - The version used in the last HTTP connection. The return value will be one of the defined CURL_HTTP_VERSION_* constants or 0 if the version can't be determined - * - * - * - * - * CURLINFO_PROTOCOL - The protocol used in the last HTTP connection. The returned value will be exactly one of the CURLPROTO_* values - * - * - * - * - * CURLINFO_PROXY_SSL_VERIFYRESULT - The result of the certificate verification that was requested (using the CURLOPT_PROXY_SSL_VERIFYPEER option). Only used for HTTPS proxies - * - * - * - * - * CURLINFO_SCHEME - The URL scheme used for the most recent connection - * - * - * - * - * CURLINFO_SIZE_DOWNLOAD_T - Total number of bytes that were downloaded. The number is only for the latest transfer and will be reset again for each new transfer - * - * - * - * - * CURLINFO_SIZE_UPLOAD_T - Total number of bytes that were uploaded - * - * - * - * - * CURLINFO_SPEED_DOWNLOAD_T - The average download speed in bytes/second that curl measured for the complete download - * - * - * - * - * CURLINFO_SPEED_UPLOAD_T - The average upload speed in bytes/second that curl measured for the complete upload - * - * - * - * - * CURLINFO_APPCONNECT_TIME_T - Time, in microseconds, it took from the start until the SSL/SSH connect/handshake to the remote host was completed - * - * - * - * - * CURLINFO_CONNECT_TIME_T - Total time taken, in microseconds, from the start until the connection to the remote host (or proxy) was completed - * - * - * - * - * CURLINFO_FILETIME_T - Remote time of the retrieved document (as Unix timestamp), an alternative to CURLINFO_FILETIME to allow systems with 32 bit long variables to extract dates outside of the 32bit timestamp range - * - * - * - * - * CURLINFO_NAMELOOKUP_TIME_T - Time in microseconds from the start until the name resolving was completed - * - * - * - * - * CURLINFO_PRETRANSFER_TIME_T - Time taken from the start until the file transfer is just about to begin, in microseconds - * - * - * - * - * CURLINFO_REDIRECT_TIME_T - Total time, in microseconds, it took for all redirection steps include name lookup, connect, pretransfer and transfer before final transaction was started - * - * - * - * - * CURLINFO_STARTTRANSFER_TIME_T - Time, in microseconds, it took from the start until the first byte is received - * - * - * - * - * CURLINFO_TOTAL_TIME_T - Total time in microseconds for the previous transfer, including name resolving, TCP connect etc. - * - * - * + * @param int $option One of the CURLINFO_* constants. * @return mixed If option is given, returns its value. * Otherwise, returns an associative array with the following elements * (which correspond to option): @@ -528,11 +219,16 @@ function curl_exec(\CurlHandle $handle) * * * + * + * "posttransfer_time_us" (Available as of PHP 8.4.0 and cURL 8.10.0) + * + * + * * Note that private data is not included in the associative array and must be retrieved individually with the CURLINFO_PRIVATE option. * @throws CurlException * */ -function curl_getinfo(\CurlHandle $handle, int $option = null) +function curl_getinfo(\CurlHandle $handle, ?int $option = null) { error_clear_last(); if ($option !== null) { @@ -548,12 +244,10 @@ function curl_getinfo(\CurlHandle $handle, int $option = null) /** - * Initializes a new session and return a cURL handle for use with the - * curl_setopt, curl_exec, - * and curl_close functions. + * Initializes a new session and returns a cURL handle. * * @param string $url If provided, the CURLOPT_URL option will be set - * to its value. You can manually set this using the + * to its value. This can be set manually using the * curl_setopt function. * * The file protocol is disabled by cURL if @@ -562,7 +256,7 @@ function curl_getinfo(\CurlHandle $handle, int $option = null) * @throws CurlException * */ -function curl_init(string $url = null): \CurlHandle +function curl_init(?string $url = null): \CurlHandle { error_clear_last(); if ($url !== null) { @@ -634,2559 +328,48 @@ function curl_multi_info_read(\CurlMultiHandle $multi_handle, ?int &$queued_mess /** - * Allows the processing of multiple cURL handles asynchronously. + * Sets an option on the given cURL multi handle. * - * @return \CurlMultiHandle Returns a cURL multi handle on success, FALSE on failure. + * @param \CurlMultiHandle $multi_handle A cURL multi handle returned by + * curl_multi_init. + * @param int $option One of the CURLMOPT_* constants. + * @param mixed $value The value to be set on option. + * See the description of the + * CURLMOPT_* constants + * for details on the type of values each constant expects. * @throws CurlException * */ -function curl_multi_init(): \CurlMultiHandle +function curl_multi_setopt(\CurlMultiHandle $multi_handle, int $option, $value): void { error_clear_last(); - $safeResult = \curl_multi_init(); + $safeResult = \curl_multi_setopt($multi_handle, $option, $value); if ($safeResult === false) { - throw CurlException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * - * - * @param \CurlMultiHandle $multi_handle - * @param int $option One of the CURLMOPT_* constants. - * @param mixed $value The value to be set on option. - * - * value should be an int for the - * following values of the option parameter: - * - * - * - * - * Option - * Set value to - * - * - * - * - * CURLMOPT_PIPELINING - * - * Pass 1 to enable or 0 to disable. Enabling pipelining on a multi - * handle will make it attempt to perform HTTP Pipelining as far as - * possible for transfers using this handle. This means that if you add - * a second request that can use an already existing connection, the - * second request will be "piped" on the same connection. - * As of cURL 7.43.0, the value is a bitmask, and you can also pass 2 to try to multiplex the new - * transfer over an existing HTTP/2 connection if possible. - * Passing 3 instructs cURL to ask for pipelining and multiplexing - * independently of each other. - * As of cURL 7.62.0, setting the pipelining bit has no effect. - * Instead of integer literals, you can also use the CURLPIPE_* - * constants if available. - * - * - * - * CURLMOPT_MAXCONNECTS - * - * Pass a number that will be used as the maximum amount of - * simultaneously open connections that libcurl may cache. - * By default the size will be enlarged to fit four times the number - * of handles added via curl_multi_add_handle. - * When the cache is full, curl closes the oldest one in the cache - * to prevent the number of open connections from increasing. - * - * - * - * CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE - * - * Pass a number that specifies the chunk length threshold for pipelining - * in bytes. - * - * - * - * CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE - * - * Pass a number that specifies the size threshold for pipelining - * penalty in bytes. - * - * - * - * CURLMOPT_MAX_HOST_CONNECTIONS - * - * Pass a number that specifies the maximum number of connections to a - * single host. - * - * - * - * CURLMOPT_MAX_PIPELINE_LENGTH - * - * Pass a number that specifies the maximum number of requests in a - * pipeline. - * - * - * - * CURLMOPT_MAX_TOTAL_CONNECTIONS - * - * Pass a number that specifies the maximum number of simultaneously - * open connections. - * - * - * - * CURLMOPT_PUSHFUNCTION - * - * Pass a callable that will be registered to handle server - * pushes and should have the following signature: - * - * intpushfunction - * resourceparent_ch - * resourcepushed_ch - * arrayheaders - * - * - * - * parent_ch - * - * - * The parent cURL handle (the request the client made). - * - * - * - * - * pushed_ch - * - * - * A new cURL handle for the pushed request. - * - * - * - * - * headers - * - * - * The push promise headers. - * - * - * - * - * The push function is supposed to return either - * CURL_PUSH_OK if it can handle the push, or - * CURL_PUSH_DENY to reject it. - * - * - * - * - * - * - * The parent cURL handle (the request the client made). - * - * A new cURL handle for the pushed request. - * - * The push promise headers. - * @throws CurlException - * - */ -function curl_multi_setopt(\CurlMultiHandle $multi_handle, int $option, $value): void -{ - error_clear_last(); - $safeResult = \curl_multi_setopt($multi_handle, $option, $value); - if ($safeResult === false) { - throw CurlException::createFromPhpError($multi_handle); - } -} - - -/** - * Sets an option on the given cURL session handle. - * - * @param \CurlHandle $handle A cURL handle returned by - * curl_init. - * @param int $option The CURLOPT_XXX option to set. - * @param mixed $value The value to be set on option. - * - * value should be a bool for the - * following values of the option parameter: - * - * - * - * - * Option - * Set value to - * Notes - * - * - * - * - * CURLOPT_AUTOREFERER - * - * TRUE to automatically set the Referer: field in - * requests where it follows a Location: redirect. - * - * - * - * - * - * CURLOPT_COOKIESESSION - * - * TRUE to mark this as a new cookie "session". It will force libcurl - * to ignore all cookies it is about to load that are "session cookies" - * from the previous session. By default, libcurl always stores and - * loads all cookies, independent if they are session cookies or not. - * Session cookies are cookies without expiry date and they are meant - * to be alive and existing for this "session" only. - * - * - * - * - * - * CURLOPT_CERTINFO - * - * TRUE to output SSL certification information to STDERR - * on secure transfers. - * - * - * Added in cURL 7.19.1. - * Requires CURLOPT_VERBOSE to be on to have an effect. - * - * - * - * CURLOPT_CONNECT_ONLY - * - * TRUE tells the library to perform all the required proxy authentication - * and connection setup, but no data transfer. This option is implemented for - * HTTP, SMTP and POP3. - * - * - * Added in 7.15.2. - * - * - * - * CURLOPT_CRLF - * - * TRUE to convert Unix newlines to CRLF newlines - * on transfers. - * - * - * - * - * - * CURLOPT_DISALLOW_USERNAME_IN_URL - * - * TRUE to not allow URLs that include a username. Usernames are allowed by default (0). - * - * - * Added in cURL 7.61.0. Available since PHP 7.3.0. - * - * - * - * CURLOPT_DNS_SHUFFLE_ADDRESSES - * - * TRUE to shuffle the order of all returned addresses so that they will be used - * in a random order, when a name is resolved and more than one IP address is returned. - * This may cause IPv4 to be used before IPv6 or vice versa. - * - * - * Added in cURL 7.60.0. Available since PHP 7.3.0. - * - * - * - * CURLOPT_HAPROXYPROTOCOL - * - * TRUE to send an HAProxy PROXY protocol v1 header at the start of the connection. - * The default action is not to send this header. - * - * - * Added in cURL 7.60.0. Available since PHP 7.3.0. - * - * - * - * CURLOPT_SSH_COMPRESSION - * - * TRUE to enable built-in SSH compression. This is a request, not an order; - * the server may or may not do it. - * - * - * Added in cURL 7.56.0. Available since PHP 7.3.0. - * - * - * - * CURLOPT_DNS_USE_GLOBAL_CACHE - * - * TRUE to use a global DNS cache. This option is not thread-safe. - * It is conditionally enabled by default if PHP is built for non-threaded use - * (CLI, FCGI, Apache2-Prefork, etc.). - * - * - * - * - * - * CURLOPT_FAILONERROR - * - * TRUE to fail verbosely if the HTTP code returned - * is greater than or equal to 400. The default behavior is to return - * the page normally, ignoring the code. - * - * - * - * - * - * CURLOPT_SSL_FALSESTART - * - * TRUE to enable TLS false start. - * - * - * Added in cURL 7.42.0. Available since PHP 7.0.7. - * - * - * - * CURLOPT_FILETIME - * - * TRUE to attempt to retrieve the modification - * date of the remote document. This value can be retrieved using - * the CURLINFO_FILETIME option with - * curl_getinfo. - * - * - * - * - * - * CURLOPT_FOLLOWLOCATION - * - * TRUE to follow any - * "Location: " header that the server sends as - * part of the HTTP header. - * See also CURLOPT_MAXREDIRS. - * - * - * - * - * - * CURLOPT_FORBID_REUSE - * - * TRUE to force the connection to explicitly - * close when it has finished processing, and not be pooled for reuse. - * - * - * - * - * - * CURLOPT_FRESH_CONNECT - * - * TRUE to force the use of a new connection - * instead of a cached one. - * - * - * - * - * - * CURLOPT_FTP_USE_EPRT - * - * TRUE to use EPRT (and LPRT) when doing active - * FTP downloads. Use FALSE to disable EPRT and LPRT and use PORT - * only. - * - * - * - * - * - * CURLOPT_FTP_USE_EPSV - * - * TRUE to first try an EPSV command for FTP - * transfers before reverting back to PASV. Set to FALSE - * to disable EPSV. - * - * - * - * - * - * CURLOPT_FTP_CREATE_MISSING_DIRS - * - * TRUE to create missing directories when an FTP operation - * encounters a path that currently doesn't exist. - * - * - * - * - * - * CURLOPT_FTPAPPEND - * - * TRUE to append to the remote file instead of - * overwriting it. - * - * - * - * - * - * CURLOPT_TCP_NODELAY - * - * TRUE to disable TCP's Nagle algorithm, which tries to minimize - * the number of small packets on the network. - * - * - * Available for versions compiled with libcurl 7.11.2 or - * greater. - * - * - * - * CURLOPT_FTPASCII - * - * An alias of - * CURLOPT_TRANSFERTEXT. Use that instead. - * - * - * - * - * - * CURLOPT_FTPLISTONLY - * - * TRUE to only list the names of an FTP - * directory. - * - * - * - * - * - * CURLOPT_HEADER - * - * TRUE to include the header in the output. - * - * - * - * - * - * CURLINFO_HEADER_OUT - * - * TRUE to track the handle's request string. - * - * - * The CURLINFO_ - * prefix is intentional. - * - * - * - * CURLOPT_HTTP09_ALLOWED - * - * Whether to allow HTTP/0.9 responses. Defaults to FALSE as of libcurl 7.66.0; - * formerly it defaulted to TRUE. - * - * - * Available since PHP 7.3.15 and 7.4.3, respectively, if built against libcurl >= 7.64.0 - * - * - * - * CURLOPT_HTTPGET - * - * TRUE to reset the HTTP request method to GET. - * Since GET is the default, this is only necessary if the request - * method has been changed. - * - * - * - * - * - * CURLOPT_HTTPPROXYTUNNEL - * - * TRUE to tunnel through a given HTTP proxy. - * - * - * - * - * - * CURLOPT_HTTP_CONTENT_DECODING - * - * FALSE to get the raw HTTP response body. - * - * - * Available if built against libcurl >= 7.16.2. - * - * - * - * CURLOPT_KEEP_SENDING_ON_ERROR - * - * TRUE to keep sending the request body if the HTTP code returned is - * equal to or larger than 300. The default action would be to stop sending - * and close the stream or connection. Suitable for manual NTLM authentication. - * Most applications do not need this option. - * - * - * Available as of PHP 7.3.0 if built against libcurl >= 7.51.0. - * - * - * - * CURLOPT_MUTE - * - * TRUE to be completely silent with regards to - * the cURL functions. - * - * - * Removed in cURL 7.15.5 (You can use CURLOPT_RETURNTRANSFER instead) - * - * - * - * CURLOPT_NETRC - * - * TRUE to scan the ~/.netrc - * file to find a username and password for the remote site that - * a connection is being established with. - * - * - * - * - * - * CURLOPT_NOBODY - * - * TRUE to exclude the body from the output. - * Request method is then set to HEAD. Changing this to FALSE does - * not change it to GET. - * - * - * - * - * - * CURLOPT_NOPROGRESS - * - * TRUE to disable the progress meter for cURL transfers. - * - * - * PHP automatically sets this option to TRUE, this should only be - * changed for debugging purposes. - * - * - * - * - * - * - * - * CURLOPT_NOSIGNAL - * - * TRUE to ignore any cURL function that causes a - * signal to be sent to the PHP process. This is turned on by default - * in multi-threaded SAPIs so timeout options can still be used. - * - * - * Added in cURL 7.10. - * - * - * - * CURLOPT_PATH_AS_IS - * - * TRUE to not handle dot dot sequences. - * - * - * Added in cURL 7.42.0. Available since PHP 7.0.7. - * - * - * - * CURLOPT_PIPEWAIT - * - * TRUE to wait for pipelining/multiplexing. - * - * - * Added in cURL 7.43.0. Available since PHP 7.0.7. - * - * - * - * CURLOPT_POST - * - * TRUE to do a regular HTTP POST. This POST is the - * normal application/x-www-form-urlencoded kind, - * most commonly used by HTML forms. - * - * - * - * - * - * CURLOPT_PUT - * - * TRUE to HTTP PUT a file. The file to PUT must - * be set with CURLOPT_INFILE and - * CURLOPT_INFILESIZE. - * - * - * - * - * - * CURLOPT_RETURNTRANSFER - * - * TRUE to return the transfer as a string of the - * return value of curl_exec instead of outputting - * it directly. - * - * - * - * - * - * CURLOPT_SASL_IR - * - * TRUE to enable sending the initial response in the first packet. - * - * - * Added in cURL 7.31.10. Available since PHP 7.0.7. - * - * - * - * CURLOPT_SSL_ENABLE_ALPN - * - * FALSE to disable ALPN in the SSL handshake (if the SSL backend - * libcurl is built to use supports it), which can be used to - * negotiate http2. - * - * - * Added in cURL 7.36.0. Available since PHP 7.0.7. - * - * - * - * CURLOPT_SSL_ENABLE_NPN - * - * FALSE to disable NPN in the SSL handshake (if the SSL backend - * libcurl is built to use supports it), which can be used to - * negotiate http2. - * - * - * Added in cURL 7.36.0. Available since PHP 7.0.7. - * - * - * - * CURLOPT_SSL_VERIFYPEER - * - * FALSE to stop cURL from verifying the peer's - * certificate. Alternate certificates to verify against can be - * specified with the CURLOPT_CAINFO option - * or a certificate directory can be specified with the - * CURLOPT_CAPATH option. - * - * - * TRUE by default as of cURL 7.10. Default bundle installed as of - * cURL 7.10. - * - * - * - * CURLOPT_SSL_VERIFYSTATUS - * - * TRUE to verify the certificate's status. - * - * - * Added in cURL 7.41.0. Available since PHP 7.0.7. - * - * - * - * CURLOPT_PROXY_SSL_VERIFYPEER - * - * FALSE to stop cURL from verifying the peer's certificate. - * Alternate certificates to verify against can be - * specified with the CURLOPT_CAINFO option - * or a certificate directory can be specified with the - * CURLOPT_CAPATH option. - * When set to false, the peer certificate verification succeeds regardless. - * - * - * TRUE by default. Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. - * - * - * - * CURLOPT_SAFE_UPLOAD - * - * Always TRUE, what disables support for the @ prefix for - * uploading files in CURLOPT_POSTFIELDS, which - * means that values starting with @ can be safely - * passed as fields. CURLFile may be used for - * uploads instead. - * - * - * - * - * - * CURLOPT_SUPPRESS_CONNECT_HEADERS - * - * TRUE to suppress proxy CONNECT response headers from the user callback functions - * CURLOPT_HEADERFUNCTION and CURLOPT_WRITEFUNCTION, - * when CURLOPT_HTTPPROXYTUNNEL is used and a CONNECT request is made. - * - * - * Added in cURL 7.54.0. Available since PHP 7.3.0. - * - * - * - * CURLOPT_TCP_FASTOPEN - * - * TRUE to enable TCP Fast Open. - * - * - * Added in cURL 7.49.0. Available since PHP 7.0.7. - * - * - * - * CURLOPT_TFTP_NO_OPTIONS - * - * TRUE to not send TFTP options requests. - * - * - * Added in cURL 7.48.0. Available since PHP 7.0.7. - * - * - * - * CURLOPT_TRANSFERTEXT - * - * TRUE to use ASCII mode for FTP transfers. - * For LDAP, it retrieves data in plain text instead of HTML. On - * Windows systems, it will not set STDOUT to binary - * mode. - * - * - * - * - * - * CURLOPT_UNRESTRICTED_AUTH - * - * TRUE to keep sending the username and password - * when following locations (using - * CURLOPT_FOLLOWLOCATION), even when the - * hostname has changed. - * - * - * - * - * - * CURLOPT_UPLOAD - * - * TRUE to prepare for an upload. - * - * - * - * - * - * CURLOPT_VERBOSE - * - * TRUE to output verbose information. Writes - * output to STDERR, or the file specified using - * CURLOPT_STDERR. - * - * - * - * - * - * - * - * - * TRUE to disable the progress meter for cURL transfers. - * - * - * PHP automatically sets this option to TRUE, this should only be - * changed for debugging purposes. - * - * - * - * PHP automatically sets this option to TRUE, this should only be - * changed for debugging purposes. - * - * value should be an int for the - * following values of the option parameter: - * - * - * - * - * Option - * Set value to - * Notes - * - * - * - * - * CURLOPT_BUFFERSIZE - * - * The size of the buffer to use for each read. There is no guarantee - * this request will be fulfilled, however. - * - * - * Added in cURL 7.10. - * - * - * - * CURLOPT_CONNECTTIMEOUT - * - * The number of seconds to wait while trying to connect. Use 0 to - * wait indefinitely. - * - * - * - * - * - * CURLOPT_CONNECTTIMEOUT_MS - * - * The number of milliseconds to wait while trying to connect. Use 0 to - * wait indefinitely. - * - * If libcurl is built to use the standard system name resolver, that - * portion of the connect will still use full-second resolution for - * timeouts with a minimum timeout allowed of one second. - * - * - * Added in cURL 7.16.2. - * - * - * - * CURLOPT_DNS_CACHE_TIMEOUT - * - * The number of seconds to keep DNS entries in memory. This - * option is set to 120 (2 minutes) by default. - * - * - * - * - * - * CURLOPT_EXPECT_100_TIMEOUT_MS - * - * The timeout for Expect: 100-continue responses in milliseconds. - * Defaults to 1000 milliseconds. - * - * - * Added in cURL 7.36.0. Available since PHP 7.0.7. - * - * - * - * CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS - * - * Head start for ipv6 for the happy eyeballs algorithm. Happy eyeballs attempts - * to connect to both IPv4 and IPv6 addresses for dual-stack hosts, - * preferring IPv6 first for timeout milliseconds. - * Defaults to CURL_HET_DEFAULT, which is currently 200 milliseconds. - * - * - * Added in cURL 7.59.0. Available since PHP 7.3.0. - * - * - * - * CURLOPT_FTPSSLAUTH - * - * The FTP authentication method (when is activated): - * CURLFTPAUTH_SSL (try SSL first), - * CURLFTPAUTH_TLS (try TLS first), or - * CURLFTPAUTH_DEFAULT (let cURL decide). - * - * - * Added in cURL 7.12.2. - * - * - * - * CURLOPT_HEADEROPT - * - * How to deal with headers. One of the following constants: - * - * CURLHEADER_UNIFIED: the headers specified in - * CURLOPT_HTTPHEADER will be used in requests - * both to servers and proxies. With this option enabled, - * CURLOPT_PROXYHEADER will not have any effect. - * - * - * CURLHEADER_SEPARATE: makes - * CURLOPT_HTTPHEADER headers only get sent to - * a server and not to a proxy. Proxy headers must be set with - * CURLOPT_PROXYHEADER to get used. Note that if - * a non-CONNECT request is sent to a proxy, libcurl will send both - * server headers and proxy headers. When doing CONNECT, libcurl will - * send CURLOPT_PROXYHEADER headers only to the - * proxy and then CURLOPT_HTTPHEADER headers - * only to the server. - * - * - * Defaults to CURLHEADER_SEPARATE as of cURL - * 7.42.1, and CURLHEADER_UNIFIED before. - * - * - * - * Added in cURL 7.37.0. Available since PHP 7.0.7. - * - * - * - * CURLOPT_HTTP_VERSION - * - * CURL_HTTP_VERSION_NONE (default, lets CURL - * decide which version to use), - * CURL_HTTP_VERSION_1_0 (forces HTTP/1.0), - * CURL_HTTP_VERSION_1_1 (forces HTTP/1.1), - * CURL_HTTP_VERSION_2_0 (attempts HTTP 2), - * CURL_HTTP_VERSION_2 (alias of CURL_HTTP_VERSION_2_0), - * CURL_HTTP_VERSION_2TLS (attempts HTTP 2 over TLS (HTTPS) only) or - * CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE (issues non-TLS HTTP requests using HTTP/2 without HTTP/1.1 Upgrade). - * - * - * - * - * - * CURLOPT_HTTPAUTH - * - * - * The HTTP authentication method(s) to use. The options are: - * CURLAUTH_BASIC, - * CURLAUTH_DIGEST, - * CURLAUTH_GSSNEGOTIATE, - * CURLAUTH_NTLM, - * CURLAUTH_ANY, and - * CURLAUTH_ANYSAFE. - * - * - * The bitwise | (or) operator can be used to combine - * more than one method. If this is done, cURL will poll the server to see - * what methods it supports and pick the best one. - * - * - * CURLAUTH_ANY is an alias for - * CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM. - * - * - * CURLAUTH_ANYSAFE is an alias for - * CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM. - * - * - * - * - * - * - * CURLOPT_INFILESIZE - * - * The expected size, in bytes, of the file when uploading a file to - * a remote site. Note that using this option will not stop libcurl - * from sending more data, as exactly what is sent depends on - * CURLOPT_READFUNCTION. - * - * - * - * - * - * CURLOPT_LOW_SPEED_LIMIT - * - * The transfer speed, in bytes per second, that the transfer should be - * below during the count of CURLOPT_LOW_SPEED_TIME - * seconds before PHP considers the transfer too slow and aborts. - * - * - * - * - * - * CURLOPT_LOW_SPEED_TIME - * - * The number of seconds the transfer speed should be below - * CURLOPT_LOW_SPEED_LIMIT before PHP considers - * the transfer too slow and aborts. - * - * - * - * - * - * CURLOPT_MAXCONNECTS - * - * The maximum amount of persistent connections that are allowed. - * When the limit is reached, the oldest one in the cache is closed - * to prevent increasing the number of open connections. - * - * - * - * - * - * CURLOPT_MAXREDIRS - * - * The maximum amount of HTTP redirections to follow. Use this option - * alongside CURLOPT_FOLLOWLOCATION. - * Default value of 20 is set to prevent infinite redirects. - * Setting to -1 allows inifinite redirects, and 0 - * refuses all redirects. - * - * - * - * - * - * CURLOPT_PORT - * - * An alternative port number to connect to. - * - * - * - * - * - * CURLOPT_POSTREDIR - * - * A bitmask of 1 (301 Moved Permanently), 2 (302 Found) - * and 4 (303 See Other) if the HTTP POST method should be maintained - * when CURLOPT_FOLLOWLOCATION is set and a - * specific type of redirect occurs. - * - * - * Added in cURL 7.19.1. - * - * - * - * CURLOPT_PROTOCOLS - * - * - * Bitmask of CURLPROTO_* values. If used, this bitmask - * limits what protocols libcurl may use in the transfer. This allows you to have - * a libcurl built to support a wide range of protocols but still limit specific - * transfers to only be allowed to use a subset of them. By default libcurl will - * accept all protocols it supports. - * See also CURLOPT_REDIR_PROTOCOLS. - * - * - * Valid protocol options are: - * CURLPROTO_HTTP, - * CURLPROTO_HTTPS, - * CURLPROTO_FTP, - * CURLPROTO_FTPS, - * CURLPROTO_SCP, - * CURLPROTO_SFTP, - * CURLPROTO_TELNET, - * CURLPROTO_LDAP, - * CURLPROTO_LDAPS, - * CURLPROTO_DICT, - * CURLPROTO_FILE, - * CURLPROTO_TFTP, - * CURLPROTO_ALL - * - * - * - * Added in cURL 7.19.4. - * - * - * - * CURLOPT_PROXYAUTH - * - * The HTTP authentication method(s) to use for the proxy connection. - * Use the same bitmasks as described in - * CURLOPT_HTTPAUTH. For proxy authentication, - * only CURLAUTH_BASIC and - * CURLAUTH_NTLM are currently supported. - * - * - * Added in cURL 7.10.7. - * - * - * - * CURLOPT_PROXYPORT - * - * The port number of the proxy to connect to. This port number can - * also be set in CURLOPT_PROXY. - * - * - * - * - * - * CURLOPT_PROXYTYPE - * - * Either CURLPROXY_HTTP (default), - * CURLPROXY_SOCKS4, - * CURLPROXY_SOCKS5, - * CURLPROXY_SOCKS4A or - * CURLPROXY_SOCKS5_HOSTNAME. - * - * - * Added in cURL 7.10. - * - * - * - * CURLOPT_REDIR_PROTOCOLS - * - * Bitmask of CURLPROTO_* values. If used, this bitmask - * limits what protocols libcurl may use in a transfer that it follows to in - * a redirect when CURLOPT_FOLLOWLOCATION is enabled. - * This allows you to limit specific transfers to only be allowed to use a subset - * of protocols in redirections. By default libcurl will allow all protocols - * except for FILE and SCP. This is a difference compared to pre-7.19.4 versions - * which unconditionally would follow to all protocols supported. - * See also CURLOPT_PROTOCOLS for protocol constant values. - * - * - * Added in cURL 7.19.4. - * - * - * - * CURLOPT_RESUME_FROM - * - * The offset, in bytes, to resume a transfer from. - * - * - * - * - * - * CURLOPT_SOCKS5_AUTH - * - * - * The SOCKS5 authentication method(s) to use. The options are: - * CURLAUTH_BASIC, - * CURLAUTH_GSSAPI, - * CURLAUTH_NONE. - * - * - * The bitwise | (or) operator can be used to combine - * more than one method. If this is done, cURL will poll the server to see - * what methods it supports and pick the best one. - * - * - * CURLAUTH_BASIC allows username/password authentication. - * - * - * CURLAUTH_GSSAPI allows GSS-API authentication. - * - * - * CURLAUTH_NONE allows no authentication. - * - * - * Defaults to CURLAUTH_BASIC|CURLAUTH_GSSAPI. - * Set the actual username and password with the CURLOPT_PROXYUSERPWD option. - * - * - * - * Available as of 7.3.0 and curl >= 7.55.0. - * - * - * - * CURLOPT_SSL_OPTIONS - * - * Set SSL behavior options, which is a bitmask of any of the following constants: - * - * CURLSSLOPT_ALLOW_BEAST: do not attempt to use - * any workarounds for a security flaw in the SSL3 and TLS1.0 protocols. - * - * - * CURLSSLOPT_NO_REVOKE: disable certificate - * revocation checks for those SSL backends where such behavior is - * present. - * - * - * - * Added in cURL 7.25.0. Available since PHP 7.0.7. - * - * - * - * CURLOPT_SSL_VERIFYHOST - * - * 2 to verify that a Common Name field or a Subject Alternate Name - * field in the SSL peer certificate matches the provided hostname. - * 0 to not check the names. - * 1 should not be used. - * In production environments the value of this option - * should be kept at 2 (default value). - * - * - * Support for value 1 removed in cURL 7.28.1. - * - * - * - * CURLOPT_SSLVERSION - * - * One of CURL_SSLVERSION_DEFAULT (0), - * CURL_SSLVERSION_TLSv1 (1), - * CURL_SSLVERSION_SSLv2 (2), - * CURL_SSLVERSION_SSLv3 (3), - * CURL_SSLVERSION_TLSv1_0 (4), - * CURL_SSLVERSION_TLSv1_1 (5) or - * CURL_SSLVERSION_TLSv1_2 (6). - * The maximum TLS version can be set by using one of the CURL_SSLVERSION_MAX_* - * constants. It is also possible to OR one of the CURL_SSLVERSION_* - * constants with one of the CURL_SSLVERSION_MAX_* constants. - * CURL_SSLVERSION_MAX_DEFAULT (the maximum version supported by the library), - * CURL_SSLVERSION_MAX_TLSv1_0, - * CURL_SSLVERSION_MAX_TLSv1_1, - * CURL_SSLVERSION_MAX_TLSv1_2, or - * CURL_SSLVERSION_MAX_TLSv1_3. - * - * - * Your best bet is to not set this and let it use the default. - * Setting it to 2 or 3 is very dangerous given the known - * vulnerabilities in SSLv2 and SSLv3. - * - * - * - * - * - * - * - * CURLOPT_PROXY_SSL_OPTIONS - * - * Set proxy SSL behavior options, which is a bitmask of any of the following constants: - * - * CURLSSLOPT_ALLOW_BEAST: do not attempt to use - * any workarounds for a security flaw in the SSL3 and TLS1.0 protocols. - * - * - * CURLSSLOPT_NO_REVOKE: disable certificate - * revocation checks for those SSL backends where such behavior is - * present. (curl >= 7.44.0) - * - * - * CURLSSLOPT_NO_PARTIALCHAIN: do not accept "partial" - * certificate chains, which it otherwise does by default. (curl >= 7.68.0) - * - * - * - * Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. - * - * - * - * CURLOPT_PROXY_SSL_VERIFYHOST - * - * Set to 2 to verify in the HTTPS proxy's certificate name fields against the proxy name. - * When set to 0 the connection succeeds regardless of the names used in the certificate. - * Use that ability with caution! - * 1 treated as a debug option in curl 7.28.0 and earlier. - * From curl 7.28.1 to 7.65.3 CURLE_BAD_FUNCTION_ARGUMENT is returned. - * From curl 7.66.0 onwards 1 and 2 is treated as the same value. - * In production environments the value of this option should be kept at 2 (default value). - * - * - * Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. - * - * - * - * CURLOPT_PROXY_SSLVERSION - * - * One of CURL_SSLVERSION_DEFAULT, - * CURL_SSLVERSION_TLSv1, - * CURL_SSLVERSION_TLSv1_0, - * CURL_SSLVERSION_TLSv1_1, - * CURL_SSLVERSION_TLSv1_2, - * CURL_SSLVERSION_TLSv1_3, - * CURL_SSLVERSION_MAX_DEFAULT, - * CURL_SSLVERSION_MAX_TLSv1_0, - * CURL_SSLVERSION_MAX_TLSv1_1, - * CURL_SSLVERSION_MAX_TLSv1_2, - * CURL_SSLVERSION_MAX_TLSv1_3 or - * CURL_SSLVERSION_SSLv3. - * - * - * Your best bet is to not set this and let it use the default CURL_SSLVERSION_DEFAULT - * which will attempt to figure out the remote SSL protocol version. - * - * - * - * - * Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. - * - * - * - * CURLOPT_STREAM_WEIGHT - * - * Set the numerical stream weight (a number between 1 and 256). - * - * - * Added in cURL 7.46.0. Available since PHP 7.0.7. - * - * - * - * CURLOPT_TCP_KEEPALIVE - * - * If set to 1, TCP keepalive probes will be sent. The delay and - * frequency of these probes can be controlled by the CURLOPT_TCP_KEEPIDLE - * and CURLOPT_TCP_KEEPINTVL options, provided the operating system - * supports them. If set to 0 (default) keepalive probes are disabled. - * - * - * Added in cURL 7.25.0. - * - * - * - * CURLOPT_TCP_KEEPIDLE - * - * Sets the delay, in seconds, that the operating system will wait while the connection is - * idle before sending keepalive probes, if CURLOPT_TCP_KEEPALIVE is - * enabled. Not all operating systems support this option. - * The default is 60. - * - * - * Added in cURL 7.25.0. - * - * - * - * CURLOPT_TCP_KEEPINTVL - * - * Sets the interval, in seconds, that the operating system will wait between sending - * keepalive probes, if CURLOPT_TCP_KEEPALIVE is enabled. - * Not all operating systems support this option. - * The default is 60. - * - * - * Added in cURL 7.25.0. - * - * - * - * CURLOPT_TIMECONDITION - * - * How CURLOPT_TIMEVALUE is treated. - * Use CURL_TIMECOND_IFMODSINCE to return the - * page only if it has been modified since the time specified in - * CURLOPT_TIMEVALUE. If it hasn't been modified, - * a "304 Not Modified" header will be returned - * assuming CURLOPT_HEADER is TRUE. - * Use CURL_TIMECOND_IFUNMODSINCE for the reverse - * effect. Use CURL_TIMECOND_NONE to ignore - * CURLOPT_TIMEVALUE and always return the page. - * CURL_TIMECOND_NONE is the default. - * - * - * Before cURL 7.46.0 the default was - * CURL_TIMECOND_IFMODSINCE. - * - * - * - * CURLOPT_TIMEOUT - * - * The maximum number of seconds to allow cURL functions to execute. - * - * - * - * - * - * CURLOPT_TIMEOUT_MS - * - * The maximum number of milliseconds to allow cURL functions to - * execute. - * - * If libcurl is built to use the standard system name resolver, that - * portion of the connect will still use full-second resolution for - * timeouts with a minimum timeout allowed of one second. - * - * - * Added in cURL 7.16.2. - * - * - * - * CURLOPT_TIMEVALUE - * - * The time in seconds since January 1st, 1970. The time will be used - * by CURLOPT_TIMECONDITION. - * - * - * - * - * - * CURLOPT_TIMEVALUE_LARGE - * - * The time in seconds since January 1st, 1970. The time will be used - * by CURLOPT_TIMECONDITION. Defaults to zero. - * The difference between this option and CURLOPT_TIMEVALUE - * is the type of the argument. On systems where 'long' is only 32 bit wide, - * this option has to be used to set dates beyond the year 2038. - * - * - * Added in cURL 7.59.0. Available since PHP 7.3.0. - * - * - * - * CURLOPT_MAX_RECV_SPEED_LARGE - * - * If a download exceeds this speed (counted in bytes per second) on - * cumulative average during the transfer, the transfer will pause to - * keep the average rate less than or equal to the parameter value. - * Defaults to unlimited speed. - * - * - * Added in cURL 7.15.5. - * - * - * - * CURLOPT_MAX_SEND_SPEED_LARGE - * - * If an upload exceeds this speed (counted in bytes per second) on - * cumulative average during the transfer, the transfer will pause to - * keep the average rate less than or equal to the parameter value. - * Defaults to unlimited speed. - * - * - * Added in cURL 7.15.5. - * - * - * - * CURLOPT_SSH_AUTH_TYPES - * - * A bitmask consisting of one or more of - * CURLSSH_AUTH_PUBLICKEY, - * CURLSSH_AUTH_PASSWORD, - * CURLSSH_AUTH_HOST, - * CURLSSH_AUTH_KEYBOARD. Set to - * CURLSSH_AUTH_ANY to let libcurl pick one. - * - * - * Added in cURL 7.16.1. - * - * - * - * CURLOPT_IPRESOLVE - * - * Allows an application to select what kind of IP addresses to use when - * resolving host names. This is only interesting when using host names that - * resolve addresses using more than one version of IP, possible values are - * CURL_IPRESOLVE_WHATEVER, - * CURL_IPRESOLVE_V4, - * CURL_IPRESOLVE_V6, by default - * CURL_IPRESOLVE_WHATEVER. - * - * - * Added in cURL 7.10.8. - * - * - * - * CURLOPT_FTP_FILEMETHOD - * - * Tell curl which method to use to reach a file on a FTP(S) server. Possible values are - * CURLFTPMETHOD_MULTICWD, - * CURLFTPMETHOD_NOCWD and - * CURLFTPMETHOD_SINGLECWD. - * - * - * Added in cURL 7.15.1. - * - * - * - * - * - * - * The HTTP authentication method(s) to use. The options are: - * CURLAUTH_BASIC, - * CURLAUTH_DIGEST, - * CURLAUTH_GSSNEGOTIATE, - * CURLAUTH_NTLM, - * CURLAUTH_ANY, and - * CURLAUTH_ANYSAFE. - * - * The bitwise | (or) operator can be used to combine - * more than one method. If this is done, cURL will poll the server to see - * what methods it supports and pick the best one. - * - * CURLAUTH_ANY is an alias for - * CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM. - * - * CURLAUTH_ANYSAFE is an alias for - * CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM. - * - * Bitmask of CURLPROTO_* values. If used, this bitmask - * limits what protocols libcurl may use in the transfer. This allows you to have - * a libcurl built to support a wide range of protocols but still limit specific - * transfers to only be allowed to use a subset of them. By default libcurl will - * accept all protocols it supports. - * See also CURLOPT_REDIR_PROTOCOLS. - * - * Valid protocol options are: - * CURLPROTO_HTTP, - * CURLPROTO_HTTPS, - * CURLPROTO_FTP, - * CURLPROTO_FTPS, - * CURLPROTO_SCP, - * CURLPROTO_SFTP, - * CURLPROTO_TELNET, - * CURLPROTO_LDAP, - * CURLPROTO_LDAPS, - * CURLPROTO_DICT, - * CURLPROTO_FILE, - * CURLPROTO_TFTP, - * CURLPROTO_ALL - * - * The SOCKS5 authentication method(s) to use. The options are: - * CURLAUTH_BASIC, - * CURLAUTH_GSSAPI, - * CURLAUTH_NONE. - * - * The bitwise | (or) operator can be used to combine - * more than one method. If this is done, cURL will poll the server to see - * what methods it supports and pick the best one. - * - * CURLAUTH_BASIC allows username/password authentication. - * - * CURLAUTH_GSSAPI allows GSS-API authentication. - * - * CURLAUTH_NONE allows no authentication. - * - * Defaults to CURLAUTH_BASIC|CURLAUTH_GSSAPI. - * Set the actual username and password with the CURLOPT_PROXYUSERPWD option. - * - * Your best bet is to not set this and let it use the default. - * Setting it to 2 or 3 is very dangerous given the known - * vulnerabilities in SSLv2 and SSLv3. - * - * Your best bet is to not set this and let it use the default CURL_SSLVERSION_DEFAULT - * which will attempt to figure out the remote SSL protocol version. - * - * value should be a string for the - * following values of the option parameter: - * - * - * - * - * Option - * Set value to - * Notes - * - * - * - * - * CURLOPT_ABSTRACT_UNIX_SOCKET - * - * Enables the use of an abstract Unix domain socket instead of - * establishing a TCP connection to a host and sets the path to - * the given string. This option shares the same semantics - * as CURLOPT_UNIX_SOCKET_PATH. These two options - * share the same storage and therefore only one of them can be set - * per handle. - * - * - * Available since PHP 7.3.0 and cURL 7.53.0 - * - * - * - * CURLOPT_CAINFO - * - * The name of a file holding one or more certificates to verify the - * peer with. This only makes sense when used in combination with - * CURLOPT_SSL_VERIFYPEER. - * - * - * Might require an absolute path. - * - * - * - * CURLOPT_CAPATH - * - * A directory that holds multiple CA certificates. Use this option - * alongside CURLOPT_SSL_VERIFYPEER. - * - * - * - * - * - * CURLOPT_COOKIE - * - * The contents of the "Cookie: " header to be - * used in the HTTP request. - * Note that multiple cookies are separated with a semicolon followed - * by a space (e.g., "fruit=apple; colour=red") - * - * - * - * - * - * CURLOPT_COOKIEFILE - * - * The name of the file containing the cookie data. The cookie file can - * be in Netscape format, or just plain HTTP-style headers dumped into - * a file. - * If the name is an empty string, no cookies are loaded, but cookie - * handling is still enabled. - * - * - * - * - * - * CURLOPT_COOKIEJAR - * - * The name of a file to save all internal cookies to when the handle is closed, - * e.g. after a call to curl_close. - * - * - * - * - * - * CURLOPT_COOKIELIST - * - * A cookie string (i.e. a single line in Netscape/Mozilla format, or a regular - * HTTP-style Set-Cookie header) adds that single cookie to the internal cookie store. - * "ALL" erases all cookies held in memory. - * "SESS" erases all session cookies held in memory. - * "FLUSH" writes all known cookies to the file specified by CURLOPT_COOKIEJAR. - * "RELOAD" loads all cookies from the files specified by CURLOPT_COOKIEFILE. - * - * - * Available since cURL 7.14.1. - * - * - * - * CURLOPT_CUSTOMREQUEST - * - * A custom request method to use instead of - * "GET" or "HEAD" when doing - * a HTTP request. This is useful for doing - * "DELETE" or other, more obscure HTTP requests. - * Valid values are things like "GET", - * "POST", "CONNECT" and so on; - * i.e. Do not enter a whole HTTP request line here. For instance, - * entering "GET /index.html HTTP/1.0\r\n\r\n" - * would be incorrect. - * - * - * Don't do this without making sure the server supports the custom - * request method first. - * - * - * - * - * - * - * - * CURLOPT_DEFAULT_PROTOCOL - * - * The default protocol to use if the URL is missing a scheme name. - * - * - * Added in cURL 7.45.0. Available since PHP 7.0.7. - * - * - * - * CURLOPT_DNS_INTERFACE - * - * Set the name of the network interface that the DNS resolver should bind to. - * This must be an interface name (not an address). - * - * - * Added in cURL 7.33.0. Available since PHP 7.0.7. - * - * - * - * CURLOPT_DNS_LOCAL_IP4 - * - * Set the local IPv4 address that the resolver should bind to. The argument - * should contain a single numerical IPv4 address as a string. - * - * - * Added in cURL 7.33.0. Available since PHP 7.0.7. - * - * - * - * CURLOPT_DNS_LOCAL_IP6 - * - * Set the local IPv6 address that the resolver should bind to. The argument - * should contain a single numerical IPv6 address as a string. - * - * - * Added in cURL 7.33.0. Available since PHP 7.0.7. - * - * - * - * CURLOPT_EGDSOCKET - * - * Like CURLOPT_RANDOM_FILE, except a filename - * to an Entropy Gathering Daemon socket. - * - * - * - * - * - * CURLOPT_ENCODING - * - * The contents of the "Accept-Encoding: " header. - * This enables decoding of the response. Supported encodings are - * "identity", "deflate", and - * "gzip". If an empty string, "", - * is set, a header containing all supported encoding types is sent. - * - * - * Added in cURL 7.10. - * - * - * - * CURLOPT_FTPPORT - * - * The value which will be used to get the IP address to use - * for the FTP "PORT" instruction. The "PORT" instruction tells - * the remote server to connect to our specified IP address. The - * string may be a plain IP address, a hostname, a network - * interface name (under Unix), or just a plain '-' to use the - * systems default IP address. - * - * - * - * - * - * CURLOPT_INTERFACE - * - * The name of the outgoing network interface to use. This can be an - * interface name, an IP address or a host name. - * - * - * - * - * - * CURLOPT_KEYPASSWD - * - * The password required to use the CURLOPT_SSLKEY - * or CURLOPT_SSH_PRIVATE_KEYFILE private key. - * - * - * Added in cURL 7.16.1. - * - * - * - * CURLOPT_KRB4LEVEL - * - * The KRB4 (Kerberos 4) security level. Any of the following values - * (in order from least to most powerful) are valid: - * "clear", - * "safe", - * "confidential", - * "private".. - * If the string does not match one of these, - * "private" is used. Setting this option to NULL - * will disable KRB4 security. Currently KRB4 security only works - * with FTP transactions. - * - * - * - * - * - * CURLOPT_LOGIN_OPTIONS - * - * Can be used to set protocol specific login options, such as the - * preferred authentication mechanism via "AUTH=NTLM" or "AUTH=*", - * and should be used in conjunction with the - * CURLOPT_USERNAME option. - * - * - * Added in cURL 7.34.0. Available since PHP 7.0.7. - * - * - * - * CURLOPT_PINNEDPUBLICKEY - * - * Set the pinned public key. - * The string can be the file name of your pinned public key. The file - * format expected is "PEM" or "DER". The string can also be any - * number of base64 encoded sha256 hashes preceded by "sha256//" and - * separated by ";". - * - * - * Added in cURL 7.39.0. Available since PHP 7.0.7. - * - * - * - * CURLOPT_POSTFIELDS - * - * - * The full data to post in a HTTP "POST" operation. - * This parameter can either be - * passed as a urlencoded string like 'para1=val1&para2=val2&...' - * or as an array with the field name as key and field data as value. - * If value is an array, the - * Content-Type header will be set to - * multipart/form-data. - * - * - * Files can be sent using CURLFile or CURLStringFile, - * in which case value must be an array. - * - * - * - * - * - * - * CURLOPT_PRIVATE - * - * Any data that should be associated with this cURL handle. This data - * can subsequently be retrieved with the - * CURLINFO_PRIVATE option of - * curl_getinfo. cURL does nothing with this data. - * When using a cURL multi handle, this private data is typically a - * unique key to identify a standard cURL handle. - * - * - * Added in cURL 7.10.3. - * - * - * - * CURLOPT_PRE_PROXY - * - * Set a string holding the host name or dotted numerical - * IP address to be used as the preproxy that curl connects to before - * it connects to the HTTP(S) proxy specified in the - * CURLOPT_PROXY option for the upcoming request. - * The preproxy can only be a SOCKS proxy and it should be prefixed with - * [scheme]:// to specify which kind of socks is used. - * A numerical IPv6 address must be written within [brackets]. - * Setting the preproxy to an empty string explicitly disables the use of a preproxy. - * To specify port number in this string, append :[port] - * to the end of the host name. The proxy's port number may optionally be - * specified with the separate option CURLOPT_PROXYPORT. - * Defaults to using port 1080 for proxies if a port is not specified. - * - * - * Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. - * - * - * - * CURLOPT_PROXY - * - * The HTTP proxy to tunnel requests through. - * - * - * - * - * - * CURLOPT_PROXY_SERVICE_NAME - * - * The proxy authentication service name. - * - * - * Added in cURL 7.43.0 for HTTP proxies, and in cURL 7.49.0 for SOCKS5 proxies. - * Available since PHP 7.0.7. - * - * - * - * CURLOPT_PROXY_CAINFO - * - * The path to proxy Certificate Authority (CA) bundle. Set the path as a - * string naming a file holding one or more certificates to - * verify the HTTPS proxy with. - * This option is for connecting to an HTTPS proxy, not an HTTPS server. - * Defaults set to the system path where libcurl's cacert bundle is assumed - * to be stored. - * - * - * Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. - * - * - * - * CURLOPT_PROXY_CAPATH - * - * The directory holding multiple CA certificates to verify the HTTPS proxy with. - * - * - * Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. - * - * - * - * CURLOPT_PROXY_CRLFILE - * - * Set the file name with the concatenation of CRL (Certificate Revocation List) - * in PEM format to use in the certificate validation that occurs during - * the SSL exchange. - * - * - * Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. - * - * - * - * CURLOPT_PROXY_KEYPASSWD - * - * Set the string be used as the password required to use the - * CURLOPT_PROXY_SSLKEY private key. You never needed a - * passphrase to load a certificate but you need one to load your private key. - * This option is for connecting to an HTTPS proxy, not an HTTPS server. - * - * - * Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. - * - * - * - * CURLOPT_PROXY_PINNEDPUBLICKEY - * - * Set the pinned public key for HTTPS proxy. The string can be the file name - * of your pinned public key. The file format expected is "PEM" or "DER". - * The string can also be any number of base64 encoded sha256 hashes preceded by - * "sha256//" and separated by ";" - * - * - * Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. - * - * - * - * CURLOPT_PROXY_SSLCERT - * - * The file name of your client certificate used to connect to the HTTPS proxy. - * The default format is "P12" on Secure Transport and "PEM" on other engines, - * and can be changed with CURLOPT_PROXY_SSLCERTTYPE. - * With NSS or Secure Transport, this can also be the nickname of the certificate - * you wish to authenticate with as it is named in the security database. - * If you want to use a file from the current directory, please precede it with - * "./" prefix, in order to avoid confusion with a nickname. - * - * - * Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. - * - * - * - * CURLOPT_PROXY_SSLCERTTYPE - * - * The format of your client certificate used when connecting to an HTTPS proxy. - * Supported formats are "PEM" and "DER", except with Secure Transport. - * OpenSSL (versions 0.9.3 and later) and Secure Transport - * (on iOS 5 or later, or OS X 10.7 or later) also support "P12" for - * PKCS#12-encoded files. Defaults to "PEM". - * - * - * Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. - * - * - * - * CURLOPT_PROXY_SSL_CIPHER_LIST - * - * The list of ciphers to use for the connection to the HTTPS proxy. - * The list must be syntactically correct, it consists of one or more cipher - * strings separated by colons. Commas or spaces are also acceptable separators - * but colons are normally used, !, - and + can be used as operators. - * - * - * Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. - * - * - * - * CURLOPT_PROXY_TLS13_CIPHERS - * - * The list of cipher suites to use for the TLS 1.3 connection to a proxy. - * The list must be syntactically correct, it consists of one or more - * cipher suite strings separated by colons. This option is currently used - * only when curl is built to use OpenSSL 1.1.1 or later. - * If you are using a different SSL backend you can try setting - * TLS 1.3 cipher suites by using the CURLOPT_PROXY_SSL_CIPHER_LIST option. - * - * - * Available since PHP 7.3.0 and libcurl >= cURL 7.61.0. Available when built with OpenSSL >= 1.1.1. - * - * - * - * CURLOPT_PROXY_SSLKEY - * - * The file name of your private key used for connecting to the HTTPS proxy. - * The default format is "PEM" and can be changed with - * CURLOPT_PROXY_SSLKEYTYPE. - * (iOS and Mac OS X only) This option is ignored if curl was built against Secure Transport. - * - * - * Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. Available if built TLS enabled. - * - * - * - * CURLOPT_PROXY_SSLKEYTYPE - * - * The format of your private key. Supported formats are "PEM", "DER" and "ENG". - * - * - * Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. - * - * - * - * CURLOPT_PROXY_TLSAUTH_PASSWORD - * - * The password to use for the TLS authentication method specified with the - * CURLOPT_PROXY_TLSAUTH_TYPE option. Requires that the - * CURLOPT_PROXY_TLSAUTH_USERNAME option to also be set. - * - * - * Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. - * - * - * - * CURLOPT_PROXY_TLSAUTH_TYPE - * - * The method of the TLS authentication used for the HTTPS connection. Supported method is "SRP". - * - * - * Secure Remote Password (SRP) authentication for TLS provides mutual authentication - * if both sides have a shared secret. To use TLS-SRP, you must also set the - * CURLOPT_PROXY_TLSAUTH_USERNAME and - * CURLOPT_PROXY_TLSAUTH_PASSWORD options. - * - * - * - * - * Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. - * - * - * - * CURLOPT_PROXY_TLSAUTH_USERNAME - * - * The username to use for the HTTPS proxy TLS authentication method specified with the - * CURLOPT_PROXY_TLSAUTH_TYPE option. Requires that the - * CURLOPT_PROXY_TLSAUTH_PASSWORD option to also be set. - * - * - * Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. - * - * - * - * CURLOPT_PROXYUSERPWD - * - * A username and password formatted as - * "[username]:[password]" to use for the - * connection to the proxy. - * - * - * - * - * - * CURLOPT_RANDOM_FILE - * - * A filename to be used to seed the random number generator for SSL. - * - * - * - * - * - * CURLOPT_RANGE - * - * Range(s) of data to retrieve in the format - * "X-Y" where X or Y are optional. HTTP transfers - * also support several intervals, separated with commas in the format - * "X-Y,N-M". - * - * - * - * - * - * CURLOPT_REFERER - * - * The contents of the "Referer: " header to be used - * in a HTTP request. - * - * - * - * - * - * CURLOPT_SERVICE_NAME - * - * The authentication service name. - * - * - * Added in cURL 7.43.0. Available since PHP 7.0.7. - * - * - * - * CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 - * - * A string containing 32 hexadecimal digits. The string should be the - * MD5 checksum of the remote host's public key, and libcurl will reject - * the connection to the host unless the md5sums match. - * This option is only for SCP and SFTP transfers. - * - * - * Added in cURL 7.17.1. - * - * - * - * CURLOPT_SSH_PUBLIC_KEYFILE - * - * The file name for your public key. If not used, libcurl defaults to - * $HOME/.ssh/id_dsa.pub if the HOME environment variable is set, - * and just "id_dsa.pub" in the current directory if HOME is not set. - * - * - * Added in cURL 7.16.1. - * - * - * - * CURLOPT_SSH_PRIVATE_KEYFILE - * - * The file name for your private key. If not used, libcurl defaults to - * $HOME/.ssh/id_dsa if the HOME environment variable is set, - * and just "id_dsa" in the current directory if HOME is not set. - * If the file is password-protected, set the password with - * CURLOPT_KEYPASSWD. - * - * - * Added in cURL 7.16.1. - * - * - * - * CURLOPT_SSL_CIPHER_LIST - * - * A list of ciphers to use for SSL. For example, - * RC4-SHA and TLSv1 are valid - * cipher lists. - * - * - * - * - * - * CURLOPT_SSLCERT - * - * The name of a file containing a PEM formatted certificate. - * - * - * - * - * - * CURLOPT_SSLCERTPASSWD - * - * The password required to use the - * CURLOPT_SSLCERT certificate. - * - * - * - * - * - * CURLOPT_SSLCERTTYPE - * - * The format of the certificate. Supported formats are - * "PEM" (default), "DER", - * and "ENG". - * As of OpenSSL 0.9.3, "P12" (for PKCS#12-encoded files) - * is also supported. - * - * - * Added in cURL 7.9.3. - * - * - * - * CURLOPT_SSLENGINE - * - * The identifier for the crypto engine of the private SSL key - * specified in CURLOPT_SSLKEY. - * - * - * - * - * - * CURLOPT_SSLENGINE_DEFAULT - * - * The identifier for the crypto engine used for asymmetric crypto - * operations. - * - * - * - * - * - * CURLOPT_SSLKEY - * - * The name of a file containing a private SSL key. - * - * - * - * - * - * CURLOPT_SSLKEYPASSWD - * - * The secret password needed to use the private SSL key specified in - * CURLOPT_SSLKEY. - * - * - * Since this option contains a sensitive password, remember to keep - * the PHP script it is contained within safe. - * - * - * - * - * - * - * - * CURLOPT_SSLKEYTYPE - * - * The key type of the private SSL key specified in - * CURLOPT_SSLKEY. Supported key types are - * "PEM" (default), "DER", - * and "ENG". - * - * - * - * - * - * CURLOPT_TLS13_CIPHERS - * - * The list of cipher suites to use for the TLS 1.3 connection. The list must be - * syntactically correct, it consists of one or more cipher suite strings separated by colons. - * This option is currently used only when curl is built to use OpenSSL 1.1.1 or later. - * If you are using a different SSL backend you can try setting - * TLS 1.3 cipher suites by using the CURLOPT_SSL_CIPHER_LIST option. - * - * - * Available since PHP 7.3.0 and libcurl >= cURL 7.61.0. Available when built with OpenSSL >= 1.1.1. - * - * - * - * CURLOPT_UNIX_SOCKET_PATH - * - * Enables the use of Unix domain sockets as connection endpoint and - * sets the path to the given string. - * - * - * Added in cURL 7.40.0. Available since PHP 7.0.7. - * - * - * - * CURLOPT_URL - * - * The URL to fetch. This can also be set when initializing a - * session with curl_init. - * - * - * - * - * - * CURLOPT_USERAGENT - * - * The contents of the "User-Agent: " header to be - * used in a HTTP request. - * - * - * - * - * - * CURLOPT_USERNAME - * - * The user name to use in authentication. - * - * - * Added in cURL 7.19.1. - * - * - * - * CURLOPT_PASSWORD - * - * The password to use in authentication. - * - * - * Added in cURL 7.19.1. - * - * - * - * CURLOPT_USERPWD - * - * A username and password formatted as - * "[username]:[password]" to use for the - * connection. - * - * - * - * - * - * CURLOPT_XOAUTH2_BEARER - * - * Specifies the OAuth 2.0 access token. - * - * - * Added in cURL 7.33.0. Available since PHP 7.0.7. - * - * - * - * - * - * - * A custom request method to use instead of - * "GET" or "HEAD" when doing - * a HTTP request. This is useful for doing - * "DELETE" or other, more obscure HTTP requests. - * Valid values are things like "GET", - * "POST", "CONNECT" and so on; - * i.e. Do not enter a whole HTTP request line here. For instance, - * entering "GET /index.html HTTP/1.0\r\n\r\n" - * would be incorrect. - * - * - * Don't do this without making sure the server supports the custom - * request method first. - * - * - * - * Don't do this without making sure the server supports the custom - * request method first. - * - * The default protocol to use if the URL is missing a scheme name. - * - * Set the name of the network interface that the DNS resolver should bind to. - * This must be an interface name (not an address). - * - * Set the local IPv4 address that the resolver should bind to. The argument - * should contain a single numerical IPv4 address as a string. - * - * Set the local IPv6 address that the resolver should bind to. The argument - * should contain a single numerical IPv6 address as a string. - * - * Secure Remote Password (SRP) authentication for TLS provides mutual authentication - * if both sides have a shared secret. To use TLS-SRP, you must also set the - * CURLOPT_PROXY_TLSAUTH_USERNAME and - * CURLOPT_PROXY_TLSAUTH_PASSWORD options. - * - * The secret password needed to use the private SSL key specified in - * CURLOPT_SSLKEY. - * - * - * Since this option contains a sensitive password, remember to keep - * the PHP script it is contained within safe. - * - * - * - * Since this option contains a sensitive password, remember to keep - * the PHP script it is contained within safe. - * - * value should be an array for the - * following values of the option parameter: - * - * - * - * - * Option - * Set value to - * Notes - * - * - * - * - * CURLOPT_CONNECT_TO - * - * Connect to a specific host and port instead of the URL's host and port. - * Accepts an array of strings with the format - * HOST:PORT:CONNECT-TO-HOST:CONNECT-TO-PORT. - * - * - * Added in cURL 7.49.0. Available since PHP 7.0.7. - * - * - * - * CURLOPT_HTTP200ALIASES - * - * An array of HTTP 200 responses that will be treated as valid - * responses and not as errors. - * - * - * Added in cURL 7.10.3. - * - * - * - * CURLOPT_HTTPHEADER - * - * An array of HTTP header fields to set, in the format - * - * array('Content-type: text/plain', 'Content-length: 100') - * - * - * - * - * - * - * CURLOPT_POSTQUOTE - * - * An array of FTP commands to execute on the server after the FTP - * request has been performed. - * - * - * - * - * - * CURLOPT_PROXYHEADER - * - * An array of custom HTTP headers to pass to proxies. - * - * - * Added in cURL 7.37.0. Available since PHP 7.0.7. - * - * - * - * CURLOPT_QUOTE - * - * An array of FTP commands to execute on the server prior to the FTP - * request. - * - * - * - * - * - * CURLOPT_RESOLVE - * - * Provide a custom address for a specific host and port pair. An array - * of hostname, port, and IP address strings, each element separated by - * a colon. In the format: - * - * array("example.com:80:127.0.0.1") - * - * - * - * Added in cURL 7.21.3. - * - * - * - * - * - * - * value should be a stream resource (using - * fopen, for example) for the following values of the - * option parameter: - * - * - * - * - * Option - * Set value to - * - * - * - * - * CURLOPT_FILE - * - * The file that the transfer should be written to. The default - * is STDOUT (the browser window). - * - * - * - * CURLOPT_INFILE - * - * The file that the transfer should be read from when uploading. - * - * - * - * CURLOPT_STDERR - * - * An alternative location to output errors to instead of - * STDERR. - * - * - * - * CURLOPT_WRITEHEADER - * - * The file that the header part of the transfer is written to. - * - * - * - * - * - * - * value should be the name of a valid function or a Closure - * for the following values of the option parameter: - * - * - * - * - * Option - * Set value to - * - * - * - * - * CURLOPT_HEADERFUNCTION - * - * A callback accepting two parameters. - * The first is the cURL resource, the second is a - * string with the header data to be written. The header data must - * be written by this callback. Return the number of - * bytes written. - * - * - * - * CURLOPT_PASSWDFUNCTION - * - * A callback accepting three parameters. - * The first is the cURL resource, the second is a - * string containing a password prompt, and the third is the maximum - * password length. Return the string containing the password. - * - * - * - * CURLOPT_PROGRESSFUNCTION - * - * - * A callback accepting five parameters. - * The first is the cURL resource, the second is the total number of - * bytes expected to be downloaded in this transfer, the third is - * the number of bytes downloaded so far, the fourth is the total - * number of bytes expected to be uploaded in this transfer, and the - * fifth is the number of bytes uploaded so far. - * - * - * - * The callback is only called when the CURLOPT_NOPROGRESS - * option is set to FALSE. - * - * - * - * Return a non-zero value to abort the transfer. In which case, the - * transfer will set a CURLE_ABORTED_BY_CALLBACK - * error. - * - * - * - * - * CURLOPT_READFUNCTION - * - * A callback accepting three parameters. - * The first is the cURL resource, the second is a - * stream resource provided to cURL through the option - * CURLOPT_INFILE, and the third is the maximum - * amount of data to be read. The callback must return a string - * with a length equal or smaller than the amount of data requested, - * typically by reading it from the passed stream resource. It should - * return an empty string to signal EOF. - * - * - * - * CURLOPT_WRITEFUNCTION - * - * A callback accepting two parameters. - * The first is the cURL resource, and the second is a - * string with the data to be written. The data must be saved by - * this callback. It must return the exact number of bytes written - * or the transfer will be aborted with an error. - * - * - * - * CURLOPT_XFERINFOFUNCTION - * - * A callback accepting two parameters. - * Has a similar purpose as CURLOPT_PROGRESSFUNCTION but is more modern - * and the preferred option from cURL. - * - * - * Added in 7.32.0. Available as of PHP 8.2.0. - * - * - * - * - * - * - * A callback accepting five parameters. - * The first is the cURL resource, the second is the total number of - * bytes expected to be downloaded in this transfer, the third is - * the number of bytes downloaded so far, the fourth is the total - * number of bytes expected to be uploaded in this transfer, and the - * fifth is the number of bytes uploaded so far. - * - * The callback is only called when the CURLOPT_NOPROGRESS - * option is set to FALSE. - * - * Return a non-zero value to abort the transfer. In which case, the - * transfer will set a CURLE_ABORTED_BY_CALLBACK - * error. - * - * Other values: - * - * - * - * - * Option - * Set value to - * - * - * - * - * CURLOPT_SHARE - * - * A result of curl_share_init. Makes the cURL - * handle to use the data from the shared handle. - * - * - * - * - * - * @throws CurlException - * - */ -function curl_setopt(\CurlHandle $handle, int $option, $value): void -{ - error_clear_last(); - $safeResult = \curl_setopt($handle, $option, $value); - if ($safeResult === false) { - throw CurlException::createFromPhpError($handle); + throw CurlException::createFromPhpError($multi_handle); } } /** - * Return an integer containing the last share curl error number. + * Sets an option on the given cURL session handle. * - * @param \CurlShareHandle $share_handle A cURL share handle returned by - * curl_share_init. - * @return int Returns an integer containing the last share curl error number. + * @param \CurlHandle $handle A cURL handle returned by + * curl_init. + * @param int $option The CURLOPT_* option to set. + * @param mixed $value The value to be set on option. + * See the description of the + * CURLOPT_* constants + * for details on the type of values each constant expects. * @throws CurlException * */ -function curl_share_errno(\CurlShareHandle $share_handle): int +function curl_setopt(\CurlHandle $handle, int $option, $value): void { error_clear_last(); - $safeResult = \curl_share_errno($share_handle); + $safeResult = \curl_setopt($handle, $option, $value); if ($safeResult === false) { - throw CurlException::createFromPhpError($share_handle); + throw CurlException::createFromPhpError($handle); } - return $safeResult; } @@ -3195,64 +378,8 @@ function curl_share_errno(\CurlShareHandle $share_handle): int * * @param \CurlShareHandle $share_handle A cURL share handle returned by * curl_share_init. - * @param int $option - * - * - * - * Option - * Description - * - * - * - * - * CURLSHOPT_SHARE - * - * Specifies a type of data that should be shared. - * - * - * - * CURLSHOPT_UNSHARE - * - * Specifies a type of data that will be no longer shared. - * - * - * - * - * - * @param mixed $value - * - * - * - * Value - * Description - * - * - * - * - * CURL_LOCK_DATA_COOKIE - * - * Shares cookie data. - * - * - * - * CURL_LOCK_DATA_DNS - * - * Shares DNS cache. Note that when you use cURL multi handles, - * all handles added to the same multi handle will share DNS cache - * by default. - * - * - * - * CURL_LOCK_DATA_SSL_SESSION - * - * Shares SSL session IDs, reducing the time spent on the SSL - * handshake when reconnecting to the same server. Note that SSL - * session IDs are reused within the same handle by default. - * - * - * - * - * + * @param int $option One of the CURLSHOPT_* constants. + * @param mixed $value One of the CURL_LOCK_DATA_* constants. * @throws CurlException * */ @@ -3311,3 +438,4 @@ function curl_upkeep(\CurlHandle $handle): void throw CurlException::createFromPhpError($handle); } } + diff --git a/generated/datetime.php b/generated/datetime.php index 31d39ec2..0099f6a7 100644 --- a/generated/datetime.php +++ b/generated/datetime.php @@ -5,51 +5,56 @@ use Safe\Exceptions\DatetimeException; /** - * Returns associative array with detailed info about given date/time. + * This is the procedural version of + * DateTimeImmutable::__construct. * - * @param string $format Documentation on how the format is used, please - * refer to the documentation of - * DateTimeImmutable::createFromFormat. The same - * rules apply. - * @param string $datetime String representing the date/time. - * @return array{year: int|false, month: int|false, day: int|false, hour: int|false, minute: int|false, second: int|false, fraction: float|false, warning_count: int, warnings: string[], error_count: int, errors: string[], is_localtime: bool, zone_type: int|bool, zone: int|bool, is_dst: bool, tz_abbr: string, tz_id: string, relative: array{year: int, month: int, day: int, hour: int, minute: int, second: int, weekday: int, weekdays: int, first_day_of_month: bool, last_day_of_month: bool}}|null Returns associative array with detailed info about given date/time. + * Unlike the DateTimeImmutable constructor, it will return + * FALSE instead of an exception if the passed in + * datetime string is invalid. * - * The returned array has keys for year, - * month, day, hour, - * minute, second, - * fraction, and is_localtime. + * @param string $datetime + * @param \DateTimeZone|null $timezone + * @return \DateTimeImmutable Returns a new DateTimeImmutable instance + * @throws DatetimeException * - * If is_localtime is present then - * zone_type indicates the type of timezone. For type - * 1 (UTC offset) the zone, - * is_dst fields are added; for type 2 - * (abbreviation) the fields tz_abbr, - * is_dst are added; and for type 3 - * (timezone identifier) the tz_abbr, - * tz_id are added. + */ +function date_create_immutable(string $datetime = "now", ?\DateTimeZone $timezone = null): \DateTimeImmutable +{ + error_clear_last(); + if ($timezone !== null) { + $safeResult = \date_create_immutable($datetime, $timezone); + } else { + $safeResult = \date_create_immutable($datetime); + } + if ($safeResult === false) { + throw DatetimeException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * This is the procedural version of + * DateTime::__construct. * - * The array includes warning_count and - * warnings fields. The first one indicate how many - * warnings there were. - * The keys of elements warnings array indicate the - * position in the given datetime where the warning - * occurred, with the string value describing the warning itself. An example - * below shows such a warning. + * Unlike the DateTime constructor, it will return + * FALSE instead of an exception if the passed in + * datetime string is invalid. * - * The array also contains error_count and - * errors fields. The first one indicate how many errors - * were found. - * The keys of elements errors array indicate the - * position in the given datetime where the error - * occurred, with the string value describing the error itself. An example - * below shows such an error. + * @param string|null $datetime + * @param \DateTimeZone|null $timezone + * @return \DateTime Returns a new DateTime instance * @throws DatetimeException * */ -function date_parse_from_format(string $format, string $datetime): ?array +function date_create(?string $datetime = "now", ?\DateTimeZone $timezone = null): \DateTime { error_clear_last(); - $safeResult = \date_parse_from_format($format, $datetime); + if ($timezone !== null) { + $safeResult = \date_create($datetime, $timezone); + } else { + $safeResult = \date_create($datetime); + } if ($safeResult === false) { throw DatetimeException::createFromPhpError(); } @@ -58,26 +63,14 @@ function date_parse_from_format(string $format, string $datetime): ?array /** - * date_parse parses the given - * datetime string according to the same rules as - * strtotime and - * DateTimeImmutable::__construct. Instead of returning a - * Unix timestamp (with strtotime) or a - * DateTimeImmutable object (with - * DateTimeImmutable::__construct), it returns an - * associative array with the information that it could detect in the given - * datetime string. - * - * If no information about a certain group of elements can be found, these - * array elements will be set to FALSE or are missing. If needed for - * constructing a timestamp or DateTimeImmutable object from - * the same datetime string, more fields can be set to - * a non-FALSE value. See the examples for cases where that happens. - * - * @param string $datetime Date/time in format accepted by - * DateTimeImmutable::__construct. - * @return array{year: int|false, month: int|false, day: int|false, hour: int|false, minute: int|false, second: int|false, fraction: float|false, warning_count: int, warnings: string[], error_count: int, errors: string[], is_localtime: bool, zone_type: int|bool, zone: int|bool, is_dst: bool, tz_abbr: string, tz_id: string, relative: array{year: int, month: int, day: int, hour: int, minute: int, second: int, weekday: int, weekdays: int, first_day_of_month: bool, last_day_of_month: bool}}|null Returns array with information about the parsed date/time - * on success. + * Returns associative array with detailed info about given date/time. + * + * @param string $format Documentation on how the format is used, please + * refer to the documentation of + * DateTimeImmutable::createFromFormat. The same + * rules apply. + * @param string $datetime String representing the date/time. + * @return array{year: int|false, month: int|false, day: int|false, hour: int|false, minute: int|false, second: int|false, fraction: float|false, warning_count: int, warnings: string[], error_count: int, errors: string[], is_localtime: bool, zone_type: int|bool, zone: int|bool, is_dst: bool, tz_abbr: string, tz_id: string, relative: array{year: int, month: int, day: int, hour: int, minute: int, second: int, weekday: int, weekdays: int, first_day_of_month: bool, last_day_of_month: bool}}|null Returns associative array with detailed info about given date/time. * * The returned array has keys for year, * month, day, hour, @@ -93,143 +86,28 @@ function date_parse_from_format(string $format, string $datetime): ?array * (timezone identifier) the tz_abbr, * tz_id are added. * - * If relative time elements are present in the - * datetime string such as +3 days, - * the then returned array includes a nested array with the key - * relative. This array then contains the keys - * year, month, day, - * hour, minute, - * second, and if necessary weekday, and - * weekdays, depending on the string that was passed in. - * * The array includes warning_count and * warnings fields. The first one indicate how many * warnings there were. * The keys of elements warnings array indicate the * position in the given datetime where the warning - * occurred, with the string value describing the warning itself. + * occurred, with the string value describing the warning itself. An example + * below shows such a warning. * * The array also contains error_count and * errors fields. The first one indicate how many errors * were found. * The keys of elements errors array indicate the * position in the given datetime where the error - * occurred, with the string value describing the error itself. - * @throws DatetimeException - * - */ -function date_parse(string $datetime): ?array -{ - error_clear_last(); - $safeResult = \date_parse($datetime); - if ($safeResult === false) { - throw DatetimeException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * - * - * @param int $timestamp Unix timestamp. - * @param float $latitude Latitude in degrees. - * @param float $longitude Longitude in degrees. - * @return array Returns array on success. - * The structure of the array is detailed in the following list: - * - * - * - * sunrise - * - * - * The timestamp of the sunrise (zenith angle = 90°35'). - * - * - * - * - * sunset - * - * - * The timestamp of the sunset (zenith angle = 90°35'). - * - * - * - * - * transit - * - * - * The timestamp when the sun is at its zenith, i.e. has reached its topmost - * point. - * - * - * - * - * civil_twilight_begin - * - * - * The start of the civil dawn (zenith angle = 96°). It ends at - * sunrise. - * - * - * - * - * civil_twilight_end - * - * - * The end of the civil dusk (zenith angle = 96°). It starts at - * sunset. - * - * - * - * - * nautical_twilight_begin - * - * - * The start of the nautical dawn (zenith angle = 102°). It ends at - * civil_twilight_begin. - * - * - * - * - * nautical_twilight_end - * - * - * The end of the nautical dusk (zenith angle = 102°). It starts at - * civil_twilight_end. - * - * - * - * - * astronomical_twilight_begin - * - * - * The start of the astronomical dawn (zenith angle = 108°). It ends at - * nautical_twilight_begin. - * - * - * - * - * astronomical_twilight_end - * - * - * The end of the astronomical dusk (zenith angle = 108°). It starts at - * nautical_twilight_end. - * - * - * - * - * - * The values of the array elements are either UNIX timestamps, FALSE if the - * sun is below the respective zenith for the whole day, or TRUE if the sun is - * above the respective zenith for the whole day. + * occurred, with the string value describing the error itself. An example + * below shows such an error. * @throws DatetimeException * */ -function date_sun_info(int $timestamp, float $latitude, float $longitude): array +function date_parse_from_format(string $format, string $datetime): ?array { error_clear_last(); - $safeResult = \date_sun_info($timestamp, $latitude, $longitude); + $safeResult = \date_parse_from_format($format, $datetime); if ($safeResult === false) { throw DatetimeException::createFromPhpError(); } @@ -319,7 +197,7 @@ function date_sun_info(int $timestamp, float $latitude, float $longitude): array * @throws DatetimeException * */ -function date_sunrise(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, float $latitude = null, float $longitude = null, float $zenith = null, float $utcOffset = null) +function date_sunrise(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, ?float $latitude = null, ?float $longitude = null, ?float $zenith = null, ?float $utcOffset = null) { error_clear_last(); if ($utcOffset !== null) { @@ -422,7 +300,7 @@ function date_sunrise(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, f * @throws DatetimeException * */ -function date_sunset(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, float $latitude = null, float $longitude = null, float $zenith = null, float $utcOffset = null) +function date_sunset(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, ?float $latitude = null, ?float $longitude = null, ?float $zenith = null, ?float $utcOffset = null) { error_clear_last(); if ($utcOffset !== null) { @@ -443,93 +321,6 @@ function date_sunset(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, fl } -/** - * Returns a string formatted according to the given format string using the - * given integer timestamp (Unix timestamp) or the current time - * if no timestamp is given. In other words, timestamp - * is optional and defaults to the value of time. - * - * @param string $format Format accepted by DateTimeInterface::format. - * @param int $timestamp The optional timestamp parameter is an - * int Unix timestamp that defaults to the current - * local time if timestamp is omitted or NULL. In other - * words, it defaults to the value of time. - * @return string Returns a formatted date string. If a non-numeric value is used for - * timestamp, FALSE is returned and an - * E_WARNING level error is emitted. - * @throws DatetimeException - * - */ -function date(string $format, int $timestamp = null): string -{ - error_clear_last(); - if ($timestamp !== null) { - $safeResult = \date($format, $timestamp); - } else { - $safeResult = \date($format); - } - if ($safeResult === false) { - throw DatetimeException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Identical to mktime except the passed parameters represents a - * GMT date. gmmktime internally uses mktime - * so only times valid in derived local time can be used. - * - * Like mktime, arguments may be left out in order - * from right to left, with any omitted arguments being set to the - * current corresponding GMT value. - * - * @param int $hour The number of the hour relative to the start of the day determined by - * month, day and year. - * Negative values reference the hour before midnight of the day in question. - * Values greater than 23 reference the appropriate hour in the following day(s). - * @param int $minute The number of the minute relative to the start of the hour. - * Negative values reference the minute in the previous hour. - * Values greater than 59 reference the appropriate minute in the following hour(s). - * @param int $second The number of seconds relative to the start of the minute. - * Negative values reference the second in the previous minute. - * Values greater than 59 reference the appropriate second in the following minute(s). - * @param int $month The number of the month relative to the end of the previous year. - * Values 1 to 12 reference the normal calendar months of the year in question. - * Values less than 1 (including negative values) reference the months in the previous year in reverse order, so 0 is December, -1 is November, etc. - * Values greater than 12 reference the appropriate month in the following year(s). - * @param int $day The number of the day relative to the end of the previous month. - * Values 1 to 28, 29, 30 or 31 (depending upon the month) reference the normal days in the relevant month. - * Values less than 1 (including negative values) reference the days in the previous month, so 0 is the last day of the previous month, -1 is the day before that, etc. - * Values greater than the number of days in the relevant month reference the appropriate day in the following month(s). - * @param int $year The year - * @return int Returns a int Unix timestamp on success. - * @throws DatetimeException - * - */ -function gmmktime(int $hour, int $minute = null, int $second = null, int $month = null, int $day = null, int $year = null): int -{ - error_clear_last(); - if ($year !== null) { - $safeResult = \gmmktime($hour, $minute, $second, $month, $day, $year); - } elseif ($day !== null) { - $safeResult = \gmmktime($hour, $minute, $second, $month, $day); - } elseif ($month !== null) { - $safeResult = \gmmktime($hour, $minute, $second, $month); - } elseif ($second !== null) { - $safeResult = \gmmktime($hour, $minute, $second); - } elseif ($minute !== null) { - $safeResult = \gmmktime($hour, $minute); - } else { - $safeResult = \gmmktime($hour); - } - if ($safeResult === false) { - throw DatetimeException::createFromPhpError(); - } - return $safeResult; -} - - /** * Behaves the same as strftime except that the * time returned is Greenwich Mean Time (GMT). For example, when run @@ -551,7 +342,7 @@ function gmmktime(int $hour, int $minute = null, int $second = null, int $month * @throws DatetimeException * */ -function gmstrftime(string $format, int $timestamp = null): string +function gmstrftime(string $format, ?int $timestamp = null): string { error_clear_last(); if ($timestamp !== null) { @@ -682,7 +473,7 @@ function gmstrftime(string $format, int $timestamp = null): string * @throws DatetimeException * */ -function idate(string $format, int $timestamp = null): int +function idate(string $format, ?int $timestamp = null): int { error_clear_last(); if ($timestamp !== null) { @@ -1000,7 +791,7 @@ function idate(string $format, int $timestamp = null): int * @throws DatetimeException * */ -function strftime(string $format, int $timestamp = null): string +function strftime(string $format, ?int $timestamp = null): string { error_clear_last(); if ($timestamp !== null) { @@ -1112,7 +903,7 @@ function strptime(string $timestamp, string $format): array * @throws DatetimeException * */ -function strtotime(string $datetime, int $baseTimestamp = null): int +function strtotime(string $datetime, ?int $baseTimestamp = null): int { error_clear_last(); if ($baseTimestamp !== null) { @@ -1157,3 +948,4 @@ function timezone_name_from_abbr(string $abbr, int $utcOffset = -1, int $isDST = } return $safeResult; } + diff --git a/generated/dir.php b/generated/dir.php index 9c2c40a8..a1fb53da 100644 --- a/generated/dir.php +++ b/generated/dir.php @@ -132,3 +132,4 @@ function scandir(string $directory, int $sorting_order = SCANDIR_SORT_ASCENDING, } return $safeResult; } + diff --git a/generated/eio.php b/generated/eio.php index c4dd39c6..04e1db32 100644 --- a/generated/eio.php +++ b/generated/eio.php @@ -19,7 +19,7 @@ * @throws EioException * */ -function eio_busy(int $delay, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null) +function eio_busy(int $delay, int $pri = EIO_PRI_DEFAULT, ?callable $callback = NULL, $data = NULL) { error_clear_last(); $safeResult = \eio_busy($delay, $pri, $callback, $data); @@ -56,7 +56,7 @@ function eio_busy(int $delay, int $pri = EIO_PRI_DEFAULT, callable $callback = n * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -65,13 +65,13 @@ function eio_busy(int $delay, int $pri = EIO_PRI_DEFAULT, callable $callback = n * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_chmod returns request resource on success. * @throws EioException * */ -function eio_chmod(string $path, int $mode, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null) +function eio_chmod(string $path, int $mode, int $pri = EIO_PRI_DEFAULT, ?callable $callback = NULL, $data = NULL) { error_clear_last(); $safeResult = \eio_chmod($path, $mode, $pri, $callback, $data); @@ -108,7 +108,7 @@ function eio_chmod(string $path, int $mode, int $pri = EIO_PRI_DEFAULT, callable * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -117,13 +117,13 @@ function eio_chmod(string $path, int $mode, int $pri = EIO_PRI_DEFAULT, callable * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_chown returns request resource on success. * @throws EioException * */ -function eio_chown(string $path, int $uid, int $gid = -1, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null) +function eio_chown(string $path, int $uid, int $gid = -1, int $pri = EIO_PRI_DEFAULT, ?callable $callback = NULL, $data = NULL) { error_clear_last(); $safeResult = \eio_chown($path, $uid, $gid, $pri, $callback, $data); @@ -157,7 +157,7 @@ function eio_chown(string $path, int $uid, int $gid = -1, int $pri = EIO_PRI_DEF * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -166,13 +166,13 @@ function eio_chown(string $path, int $uid, int $gid = -1, int $pri = EIO_PRI_DEF * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_close returns request resource on success. * @throws EioException * */ -function eio_close($fd, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null) +function eio_close($fd, int $pri = EIO_PRI_DEFAULT, ?callable $callback = NULL, $data = NULL) { error_clear_last(); $safeResult = \eio_close($fd, $pri, $callback, $data); @@ -216,7 +216,7 @@ function eio_close($fd, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $ * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -225,13 +225,13 @@ function eio_close($fd, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $ * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_custom returns request resource on success. * @throws EioException * */ -function eio_custom(callable $execute, int $pri, callable $callback, $data = null) +function eio_custom(callable $execute, int $pri, callable $callback, $data = NULL) { error_clear_last(); $safeResult = \eio_custom($execute, $pri, $callback, $data); @@ -265,7 +265,7 @@ function eio_custom(callable $execute, int $pri, callable $callback, $data = nul * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -274,13 +274,13 @@ function eio_custom(callable $execute, int $pri, callable $callback, $data = nul * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_dup2 returns request resource on success. * @throws EioException * */ -function eio_dup2($fd, $fd2, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null) +function eio_dup2($fd, $fd2, int $pri = EIO_PRI_DEFAULT, ?callable $callback = NULL, $data = NULL) { error_clear_last(); $safeResult = \eio_dup2($fd, $fd2, $pri, $callback, $data); @@ -337,7 +337,7 @@ function eio_event_loop(): void * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -346,13 +346,13 @@ function eio_event_loop(): void * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_fallocate returns request resource on success. * @throws EioException * */ -function eio_fallocate($fd, int $mode, int $offset, int $length, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null) +function eio_fallocate($fd, int $mode, int $offset, int $length, int $pri = EIO_PRI_DEFAULT, ?callable $callback = NULL, $data = NULL) { error_clear_last(); $safeResult = \eio_fallocate($fd, $mode, $offset, $length, $pri, $callback, $data); @@ -387,7 +387,7 @@ function eio_fallocate($fd, int $mode, int $offset, int $length, int $pri = EIO_ * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -396,13 +396,13 @@ function eio_fallocate($fd, int $mode, int $offset, int $length, int $pri = EIO_ * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_fchmod returns request resource on success. * @throws EioException * */ -function eio_fchmod($fd, int $mode, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null) +function eio_fchmod($fd, int $mode, int $pri = EIO_PRI_DEFAULT, ?callable $callback = NULL, $data = NULL) { error_clear_last(); $safeResult = \eio_fchmod($fd, $mode, $pri, $callback, $data); @@ -438,7 +438,7 @@ function eio_fchmod($fd, int $mode, int $pri = EIO_PRI_DEFAULT, callable $callba * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -447,13 +447,13 @@ function eio_fchmod($fd, int $mode, int $pri = EIO_PRI_DEFAULT, callable $callba * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_chmod returns request resource on success. * @throws EioException * */ -function eio_fchown($fd, int $uid, int $gid = -1, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null) +function eio_fchown($fd, int $uid, int $gid = -1, int $pri = EIO_PRI_DEFAULT, ?callable $callback = NULL, $data = NULL) { error_clear_last(); $safeResult = \eio_fchown($fd, $uid, $gid, $pri, $callback, $data); @@ -486,7 +486,7 @@ function eio_fchown($fd, int $uid, int $gid = -1, int $pri = EIO_PRI_DEFAULT, ca * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -495,13 +495,13 @@ function eio_fchown($fd, int $uid, int $gid = -1, int $pri = EIO_PRI_DEFAULT, ca * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_fdatasync returns request resource on success. * @throws EioException * */ -function eio_fdatasync($fd, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null) +function eio_fdatasync($fd, int $pri = EIO_PRI_DEFAULT, ?callable $callback = NULL, $data = NULL) { error_clear_last(); $safeResult = \eio_fdatasync($fd, $pri, $callback, $data); @@ -535,7 +535,7 @@ function eio_fdatasync($fd, int $pri = EIO_PRI_DEFAULT, callable $callback = nul * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -544,7 +544,7 @@ function eio_fdatasync($fd, int $pri = EIO_PRI_DEFAULT, callable $callback = nul * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_busy returns request resource on success. * @throws EioException @@ -588,7 +588,7 @@ function eio_fstat($fd, int $pri, callable $callback, $data = null) * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -597,7 +597,7 @@ function eio_fstat($fd, int $pri, callable $callback, $data = null) * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_fstatvfs returns request resource on success. * @throws EioException @@ -640,7 +640,7 @@ function eio_fstatvfs($fd, int $pri, callable $callback, $data = null) * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -649,13 +649,13 @@ function eio_fstatvfs($fd, int $pri, callable $callback, $data = null) * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_fsync returns request resource on success. * @throws EioException * */ -function eio_fsync($fd, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null) +function eio_fsync($fd, int $pri = EIO_PRI_DEFAULT, ?callable $callback = NULL, $data = NULL) { error_clear_last(); $safeResult = \eio_fsync($fd, $pri, $callback, $data); @@ -691,7 +691,7 @@ function eio_fsync($fd, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $ * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -700,13 +700,13 @@ function eio_fsync($fd, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $ * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_ftruncate returns request resource on success. * @throws EioException * */ -function eio_ftruncate($fd, int $offset = 0, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null) +function eio_ftruncate($fd, int $offset = 0, int $pri = EIO_PRI_DEFAULT, ?callable $callback = NULL, $data = NULL) { error_clear_last(); $safeResult = \eio_ftruncate($fd, $offset, $pri, $callback, $data); @@ -742,7 +742,7 @@ function eio_ftruncate($fd, int $offset = 0, int $pri = EIO_PRI_DEFAULT, callabl * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -751,13 +751,13 @@ function eio_ftruncate($fd, int $offset = 0, int $pri = EIO_PRI_DEFAULT, callabl * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_futime returns request resource on success. * @throws EioException * */ -function eio_futime($fd, float $atime, float $mtime, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null) +function eio_futime($fd, float $atime, float $mtime, int $pri = EIO_PRI_DEFAULT, ?callable $callback = NULL, $data = NULL) { error_clear_last(); $safeResult = \eio_futime($fd, $atime, $mtime, $pri, $callback, $data); @@ -786,7 +786,7 @@ function eio_futime($fd, float $atime, float $mtime, int $pri = EIO_PRI_DEFAULT, * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -795,13 +795,13 @@ function eio_futime($fd, float $atime, float $mtime, int $pri = EIO_PRI_DEFAULT, * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param string $data is custom data passed to the request. * @return resource eio_grp returns request group resource on success. * @throws EioException * */ -function eio_grp(callable $callback, string $data = null) +function eio_grp(callable $callback, ?string $data = NULL) { error_clear_last(); $safeResult = \eio_grp($callback, $data); @@ -835,7 +835,7 @@ function eio_grp(callable $callback, string $data = null) * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -844,13 +844,13 @@ function eio_grp(callable $callback, string $data = null) * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_lstat returns request resource on success. * @throws EioException * */ -function eio_lstat(string $path, int $pri, callable $callback, $data = null) +function eio_lstat(string $path, int $pri, callable $callback, $data = NULL) { error_clear_last(); $safeResult = \eio_lstat($path, $pri, $callback, $data); @@ -885,7 +885,7 @@ function eio_lstat(string $path, int $pri, callable $callback, $data = null) * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -894,13 +894,13 @@ function eio_lstat(string $path, int $pri, callable $callback, $data = null) * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_mkdir returns request resource on success. * @throws EioException * */ -function eio_mkdir(string $path, int $mode, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null) +function eio_mkdir(string $path, int $mode, int $pri = EIO_PRI_DEFAULT, ?callable $callback = NULL, $data = NULL) { error_clear_last(); $safeResult = \eio_mkdir($path, $mode, $pri, $callback, $data); @@ -950,7 +950,7 @@ function eio_mkdir(string $path, int $mode, int $pri = EIO_PRI_DEFAULT, callable * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -959,13 +959,13 @@ function eio_mkdir(string $path, int $mode, int $pri = EIO_PRI_DEFAULT, callable * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_mknod returns request resource on success. * @throws EioException * */ -function eio_mknod(string $path, int $mode, int $dev, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null) +function eio_mknod(string $path, int $mode, int $dev, int $pri = EIO_PRI_DEFAULT, ?callable $callback = NULL, $data = NULL) { error_clear_last(); $safeResult = \eio_mknod($path, $mode, $dev, $pri, $callback, $data); @@ -998,7 +998,7 @@ function eio_mknod(string $path, int $mode, int $dev, int $pri = EIO_PRI_DEFAULT * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -1007,13 +1007,13 @@ function eio_mknod(string $path, int $mode, int $dev, int $pri = EIO_PRI_DEFAULT * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_nop returns request resource on success. * @throws EioException * */ -function eio_nop(int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null) +function eio_nop(int $pri = EIO_PRI_DEFAULT, ?callable $callback = NULL, $data = NULL) { error_clear_last(); $safeResult = \eio_nop($pri, $callback, $data); @@ -1049,7 +1049,7 @@ function eio_nop(int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -1058,13 +1058,13 @@ function eio_nop(int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_readahead returns request resource on success. * @throws EioException * */ -function eio_readahead($fd, int $offset, int $length, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null) +function eio_readahead($fd, int $offset, int $length, int $pri = EIO_PRI_DEFAULT, ?callable $callback = NULL, $data = NULL) { error_clear_last(); $safeResult = \eio_readahead($fd, $offset, $length, $pri, $callback, $data); @@ -1101,7 +1101,7 @@ function eio_readahead($fd, int $offset, int $length, int $pri = EIO_PRI_DEFAULT * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -1110,7 +1110,7 @@ function eio_readahead($fd, int $offset, int $length, int $pri = EIO_PRI_DEFAULT * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param string $data is custom data passed to the request. * @return resource eio_readdir returns request resource on success. * Sets result argument of @@ -1368,7 +1368,7 @@ function eio_readahead($fd, int $offset, int $length, int $pri = EIO_PRI_DEFAULT * @throws EioException * */ -function eio_readdir(string $path, int $flags, int $pri, callable $callback, string $data = null) +function eio_readdir(string $path, int $flags, int $pri, callable $callback, ?string $data = NULL) { error_clear_last(); $safeResult = \eio_readdir($path, $flags, $pri, $callback, $data); @@ -1401,7 +1401,7 @@ function eio_readdir(string $path, int $flags, int $pri, callable $callback, str * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -1410,13 +1410,13 @@ function eio_readdir(string $path, int $flags, int $pri, callable $callback, str * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param string $data is custom data passed to the request. * @return resource eio_readlink returns request resource on success. * @throws EioException * */ -function eio_readlink(string $path, int $pri, callable $callback, string $data = null) +function eio_readlink(string $path, int $pri, callable $callback, ?string $data = NULL) { error_clear_last(); $safeResult = \eio_readlink($path, $pri, $callback, $data); @@ -1450,7 +1450,7 @@ function eio_readlink(string $path, int $pri, callable $callback, string $data = * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -1459,13 +1459,13 @@ function eio_readlink(string $path, int $pri, callable $callback, string $data = * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_rename returns request resource on success. * @throws EioException * */ -function eio_rename(string $path, string $new_path, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null) +function eio_rename(string $path, string $new_path, int $pri = EIO_PRI_DEFAULT, ?callable $callback = NULL, $data = NULL) { error_clear_last(); $safeResult = \eio_rename($path, $new_path, $pri, $callback, $data); @@ -1498,7 +1498,7 @@ function eio_rename(string $path, string $new_path, int $pri = EIO_PRI_DEFAULT, * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -1507,13 +1507,13 @@ function eio_rename(string $path, string $new_path, int $pri = EIO_PRI_DEFAULT, * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_rmdir returns request resource on success. * @throws EioException * */ -function eio_rmdir(string $path, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null) +function eio_rmdir(string $path, int $pri = EIO_PRI_DEFAULT, ?callable $callback = NULL, $data = NULL) { error_clear_last(); $safeResult = \eio_rmdir($path, $pri, $callback, $data); @@ -1526,16 +1526,18 @@ function eio_rmdir(string $path, int $pri = EIO_PRI_DEFAULT, callable $callback /** * eio_seek repositions the offset of the open file associated with - * stream, Socket resource, or file descriptor specified by fd to the argument offset according to the directive whence as follows: + * stream, Socket instance, or file descriptor specified by fd to + * the argument offset according to + * the directive whence. + * + * @param mixed $fd Stream, Socket instance, or numeric file descriptor. + * @param int $offset Starting point from which data is to be read. + * @param int $whence whence values are: * * EIO_SEEK_SET - Set position equal to offset bytes. * EIO_SEEK_CUR - Set position to current location plus offset. * EIO_SEEK_END - Set position to end-of-file plus offset. * - * - * @param mixed $fd Stream, Socket resource, or numeric file descriptor - * @param int $offset Starting point from which data is to be read. - * @param int $whence Number of bytes to be read. * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL. * If NULL passed, pri internally is set to * EIO_PRI_DEFAULT. @@ -1554,7 +1556,7 @@ function eio_rmdir(string $path, int $pri = EIO_PRI_DEFAULT, callable $callback * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -1563,13 +1565,13 @@ function eio_rmdir(string $path, int $pri = EIO_PRI_DEFAULT, callable $callback * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_seek returns request resource on success. * @throws EioException * */ -function eio_seek($fd, int $offset, int $whence, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null) +function eio_seek($fd, int $offset, int $whence, int $pri = EIO_PRI_DEFAULT, ?callable $callback = NULL, $data = NULL) { error_clear_last(); $safeResult = \eio_seek($fd, $offset, $whence, $pri, $callback, $data); @@ -1606,7 +1608,7 @@ function eio_seek($fd, int $offset, int $whence, int $pri = EIO_PRI_DEFAULT, cal * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -1615,13 +1617,13 @@ function eio_seek($fd, int $offset, int $whence, int $pri = EIO_PRI_DEFAULT, cal * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param string $data is custom data passed to the request. * @return resource eio_sendfile returns request resource on success. * @throws EioException * */ -function eio_sendfile($out_fd, $in_fd, int $offset, int $length, int $pri = null, callable $callback = null, string $data = null) +function eio_sendfile($out_fd, $in_fd, int $offset, int $length, ?int $pri = null, ?callable $callback = null, ?string $data = null) { error_clear_last(); if ($data !== null) { @@ -1663,7 +1665,7 @@ function eio_sendfile($out_fd, $in_fd, int $offset, int $length, int $pri = null * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -1672,14 +1674,14 @@ function eio_sendfile($out_fd, $in_fd, int $offset, int $length, int $pri = null * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_stat returns request resource on success. On success assigns result argument of * callback to an array. * @throws EioException * */ -function eio_stat(string $path, int $pri, callable $callback, $data = null) +function eio_stat(string $path, int $pri, callable $callback, $data = NULL) { error_clear_last(); $safeResult = \eio_stat($path, $pri, $callback, $data); @@ -1713,7 +1715,7 @@ function eio_stat(string $path, int $pri, callable $callback, $data = null) * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -1722,7 +1724,7 @@ function eio_stat(string $path, int $pri, callable $callback, $data = null) * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_statvfs returns request resource on success. * On success assigns result argument of @@ -1769,7 +1771,7 @@ function eio_statvfs(string $path, int $pri, callable $callback, $data = null) * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -1778,13 +1780,13 @@ function eio_statvfs(string $path, int $pri, callable $callback, $data = null) * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_symlink returns request resource on success. * @throws EioException * */ -function eio_symlink(string $path, string $new_path, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null) +function eio_symlink(string $path, string $new_path, int $pri = EIO_PRI_DEFAULT, ?callable $callback = NULL, $data = NULL) { error_clear_last(); $safeResult = \eio_symlink($path, $new_path, $pri, $callback, $data); @@ -1828,7 +1830,7 @@ function eio_symlink(string $path, string $new_path, int $pri = EIO_PRI_DEFAULT, * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -1837,13 +1839,13 @@ function eio_symlink(string $path, string $new_path, int $pri = EIO_PRI_DEFAULT, * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_sync_file_range returns request resource on success. * @throws EioException * */ -function eio_sync_file_range($fd, int $offset, int $nbytes, int $flags, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null) +function eio_sync_file_range($fd, int $offset, int $nbytes, int $flags, int $pri = EIO_PRI_DEFAULT, ?callable $callback = NULL, $data = NULL) { error_clear_last(); $safeResult = \eio_sync_file_range($fd, $offset, $nbytes, $flags, $pri, $callback, $data); @@ -1864,7 +1866,7 @@ function eio_sync_file_range($fd, int $offset, int $nbytes, int $flags, int $pri * @throws EioException * */ -function eio_sync(int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null) +function eio_sync(int $pri = EIO_PRI_DEFAULT, ?callable $callback = NULL, $data = NULL) { error_clear_last(); $safeResult = \eio_sync($pri, $callback, $data); @@ -1897,7 +1899,7 @@ function eio_sync(int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -1906,13 +1908,13 @@ function eio_sync(int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_syncfs returns request resource on success. * @throws EioException * */ -function eio_syncfs($fd, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null) +function eio_syncfs($fd, int $pri = EIO_PRI_DEFAULT, ?callable $callback = NULL, $data = NULL) { error_clear_last(); $safeResult = \eio_syncfs($fd, $pri, $callback, $data); @@ -1947,7 +1949,7 @@ function eio_syncfs($fd, int $pri = EIO_PRI_DEFAULT, callable $callback = null, * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -1956,13 +1958,13 @@ function eio_syncfs($fd, int $pri = EIO_PRI_DEFAULT, callable $callback = null, * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_busy returns request resource on success. * @throws EioException * */ -function eio_truncate(string $path, int $offset = 0, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null) +function eio_truncate(string $path, int $offset = 0, int $pri = EIO_PRI_DEFAULT, ?callable $callback = NULL, $data = NULL) { error_clear_last(); $safeResult = \eio_truncate($path, $offset, $pri, $callback, $data); @@ -1995,7 +1997,7 @@ function eio_truncate(string $path, int $offset = 0, int $pri = EIO_PRI_DEFAULT, * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -2004,13 +2006,13 @@ function eio_truncate(string $path, int $offset = 0, int $pri = EIO_PRI_DEFAULT, * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_unlink returns request resource on success. * @throws EioException * */ -function eio_unlink(string $path, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null) +function eio_unlink(string $path, int $pri = EIO_PRI_DEFAULT, ?callable $callback = NULL, $data = NULL) { error_clear_last(); $safeResult = \eio_unlink($path, $pri, $callback, $data); @@ -2045,7 +2047,7 @@ function eio_unlink(string $path, int $pri = EIO_PRI_DEFAULT, callable $callback * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -2054,13 +2056,13 @@ function eio_unlink(string $path, int $pri = EIO_PRI_DEFAULT, callable $callback * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_utime returns request resource on success. * @throws EioException * */ -function eio_utime(string $path, float $atime, float $mtime, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null) +function eio_utime(string $path, float $atime, float $mtime, int $pri = EIO_PRI_DEFAULT, ?callable $callback = NULL, $data = NULL) { error_clear_last(); $safeResult = \eio_utime($path, $atime, $mtime, $pri, $callback, $data); @@ -2098,7 +2100,7 @@ function eio_utime(string $path, float $atime, float $mtime, int $pri = EIO_PRI_ * * * req - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * * * @@ -2107,13 +2109,13 @@ function eio_utime(string $path, float $atime, float $mtime, int $pri = EIO_PRI_ * request-specific result value; basically, the value returned by corresponding * system call. * - * is optional request resource which can be used with functions like eio_get_last_error + * is optional request resource which can be used with functions like eio_get_last_error. * @param mixed $data is custom data passed to the request. * @return resource eio_write returns request resource on success. * @throws EioException * */ -function eio_write($fd, string $str, int $length = 0, int $offset = 0, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null) +function eio_write($fd, string $str, int $length = 0, int $offset = 0, int $pri = EIO_PRI_DEFAULT, ?callable $callback = NULL, $data = NULL) { error_clear_last(); $safeResult = \eio_write($fd, $str, $length, $offset, $pri, $callback, $data); @@ -2122,3 +2124,4 @@ function eio_write($fd, string $str, int $length = 0, int $offset = 0, int $pri } return $safeResult; } + diff --git a/generated/errorfunc.php b/generated/errorfunc.php index b693deca..20cacf10 100644 --- a/generated/errorfunc.php +++ b/generated/errorfunc.php @@ -66,7 +66,7 @@ * @throws ErrorfuncException * */ -function error_log(string $message, int $message_type = 0, string $destination = null, string $additional_headers = null): void +function error_log(string $message, int $message_type = 0, ?string $destination = null, ?string $additional_headers = null): void { error_clear_last(); if ($additional_headers !== null) { @@ -80,3 +80,4 @@ function error_log(string $message, int $message_type = 0, string $destination = throw ErrorfuncException::createFromPhpError(); } } + diff --git a/generated/exec.php b/generated/exec.php index c6984a2d..bc3a5af6 100644 --- a/generated/exec.php +++ b/generated/exec.php @@ -152,3 +152,4 @@ function system(string $command, ?int &$result_code = null): string } return $safeResult; } + diff --git a/generated/fileinfo.php b/generated/fileinfo.php index dda07206..d171a9ec 100644 --- a/generated/fileinfo.php +++ b/generated/fileinfo.php @@ -43,7 +43,7 @@ function finfo_close($finfo): void * @throws FileinfoException * */ -function finfo_open(int $flags = FILEINFO_NONE, string $magic_database = null) +function finfo_open(int $flags = FILEINFO_NONE, ?string $magic_database = null) { error_clear_last(); if ($magic_database !== null) { @@ -77,3 +77,4 @@ function mime_content_type($filename): string } return $safeResult; } + diff --git a/generated/filesystem.php b/generated/filesystem.php index df545f84..52e953fc 100644 --- a/generated/filesystem.php +++ b/generated/filesystem.php @@ -260,7 +260,7 @@ function fflush($stream): void * @throws FilesystemException * */ -function file_get_contents(string $filename, bool $use_include_path = false, $context = null, int $offset = 0, int $length = null): string +function file_get_contents(string $filename, bool $use_include_path = false, $context = null, int $offset = 0, ?int $length = null): string { error_clear_last(); if ($length !== null) { @@ -406,6 +406,16 @@ function file_put_contents(string $filename, $data, int $flags = 0, $context = n * * * + * + * FILE_NO_DEFAULT_CONTEXT + * + * + * + * Don't use the default context + * + * + * + * * @param resource $context * @return array Returns the file in an array. Each element of the array corresponds to a * line in the file, with the newline still attached. Upon failure, @@ -826,7 +836,7 @@ function flock($stream, int $operation, ?int &$would_block = null): void * mode so that it uses the correct line endings and * 'b' mode instead. * @param bool $use_include_path The optional third use_include_path parameter - * can be set to '1' or TRUE if you want to search for the file in the + * can be set to TRUE if you want to search for the file in the * include_path, too. * @param resource|null $context A context stream * resource. @@ -985,7 +995,7 @@ function ftruncate($stream, int $size): void * @throws FilesystemException * */ -function fwrite($stream, string $data, int $length = null): int +function fwrite($stream, string $data, ?int $length = null): int { error_clear_last(); if ($length !== null) { @@ -1034,59 +1044,11 @@ function fwrite($stream, string $data, int $length = null): int * * * - * @param int $flags Valid flags: - * - * - * - * GLOB_MARK - Adds a slash (a backslash on Windows) to each directory returned - * - * - * - * - * GLOB_NOSORT - Return files as they appear in the - * directory (no sorting). When this flag is not used, the pathnames are - * sorted alphabetically - * - * - * - * - * GLOB_NOCHECK - Return the search pattern if no - * files matching it were found - * - * - * - * - * GLOB_NOESCAPE - Backslashes do not quote - * metacharacters - * - * - * - * - * GLOB_BRACE - Expands {a,b,c} to match 'a', 'b', - * or 'c' - * - * - * - * - * GLOB_ONLYDIR - Return only directory entries - * which match the pattern - * - * - * - * - * GLOB_ERR - Stop on read errors (like unreadable - * directories), by default errors are ignored. - * - * - * - * - * - * The GLOB_BRACE flag is not available on some non GNU - * systems, like Solaris or Alpine Linux. - * - * + * @param int $flags Any of the GLOB_* constants. * @return array Returns an array containing the matched files/directories, an empty array * if no file matched. + * Unless GLOB_NOSORT was used, the names will + * be sorted alphanumerically. * @throws FilesystemException * */ @@ -1518,7 +1480,7 @@ function tempnam(string $directory, string $prefix): string /** - * Creates a temporary file with a unique name in read-write (w+) mode and + * Creates a temporary file with a unique name in read-write-binary (w+b) mode and * returns a file handle. * * The file is automatically removed when closed (for example, by calling @@ -1526,7 +1488,7 @@ function tempnam(string $directory, string $prefix): string * the file handle returned by tmpfile), or when the * script ends. * - * @return resource Returns a file handle, similar to the one returned by + * @return resource|false Returns a file handle, similar to the one returned by * fopen, for the new file. * @throws FilesystemException * @@ -1561,7 +1523,7 @@ function tmpfile() * @throws FilesystemException * */ -function touch(string $filename, int $mtime = null, int $atime = null): void +function touch(string $filename, ?int $mtime = null, ?int $atime = null): void { error_clear_last(); if ($atime !== null) { @@ -1603,3 +1565,4 @@ function unlink(string $filename, $context = null): void throw FilesystemException::createFromPhpError(); } } + diff --git a/generated/filter.php b/generated/filter.php index 0508f8e7..32a19106 100644 --- a/generated/filter.php +++ b/generated/filter.php @@ -8,31 +8,10 @@ * This function is useful for retrieving many values without * repetitively calling filter_input. * - * @param int $type One of INPUT_GET, INPUT_POST, - * INPUT_COOKIE, INPUT_SERVER, or - * INPUT_ENV. - * @param int|array $options An array defining the arguments. A valid key is a string - * containing a variable name and a valid value is either a filter type, or an array - * optionally specifying the filter, flags and options. If the value is an - * array, valid keys are filter which specifies the - * filter type, - * flags which specifies any flags that apply to the - * filter, and options which specifies any options that - * apply to the filter. See the example below for a better understanding. - * - * This parameter can be also an integer holding a filter constant. Then all values in the - * input array are filtered by this filter. - * @param bool $add_empty Add missing keys as NULL to the return value. - * @return array|null An array containing the values of the requested variables on success. - * If the input array designated by type is not populated, - * the function returns NULL if the FILTER_NULL_ON_FAILURE - * flag is not given, or FALSE otherwise. For other failures, FALSE is returned. - * - * An array value will be FALSE if the filter fails, or NULL if - * the variable is not set. Or if the flag FILTER_NULL_ON_FAILURE - * is used, it returns FALSE if the variable is not set and NULL if the filter - * fails. If the add_empty parameter is FALSE, no array - * element will be added for unset variables. + * @param int $type + * @param int|array $options + * @param bool $add_empty + * @return array|null * @throws FilterException * */ @@ -48,22 +27,10 @@ function filter_input_array(int $type, $options = FILTER_DEFAULT, bool $add_empt /** - * This function is useful for retrieving many values without - * repetitively calling filter_var. * - * @param array $array An array with string keys containing the data to filter. - * @param mixed $options An array defining the arguments. A valid key is a string - * containing a variable name and a valid value is either a - * filter type, or an - * array optionally specifying the filter, flags and options. - * If the value is an array, valid keys are filter - * which specifies the filter type, - * flags which specifies any flags that apply to the - * filter, and options which specifies any options that - * apply to the filter. See the example below for a better understanding. * - * This parameter can be also an integer holding a filter constant. Then all values in the - * input array are filtered by this filter. + * @param array $array + * @param mixed $options * @param bool $add_empty Add missing keys as NULL to the return value. * @return array|null An array containing the values of the requested variables on success. An array value will be FALSE if the filter fails, or NULL if * the variable is not set. @@ -79,3 +46,4 @@ function filter_var_array(array $array, $options = FILTER_DEFAULT, bool $add_emp } return $safeResult; } + diff --git a/generated/fpm.php b/generated/fpm.php index 7a9a98de..dd5be0d3 100644 --- a/generated/fpm.php +++ b/generated/fpm.php @@ -20,3 +20,27 @@ function fastcgi_finish_request(): void throw FpmException::createFromPhpError(); } } + + +/** + * This function returns the full current FPM pool status as an associative array. It always + * returns the full status, including per-process status information. See the + * FPM status page guide for further + * details. + * + * Note that this function will only be defined if FPM is being used to serve the script. + * + * @return int Associative array containing the full FPM pool status. + * @throws FpmException + * + */ +function fpm_get_status(): int +{ + error_clear_last(); + $safeResult = \fpm_get_status(); + if ($safeResult === false) { + throw FpmException::createFromPhpError(); + } + return $safeResult; +} + diff --git a/generated/ftp.php b/generated/ftp.php index 0de5fcc4..fa4aa4c3 100644 --- a/generated/ftp.php +++ b/generated/ftp.php @@ -294,6 +294,36 @@ function ftp_mlsd($ftp, string $directory): array } +/** + * ftp_nb_get retrieves a remote file from the FTP server, + * and saves it into a local file. + * + * The difference between this function and ftp_get is that + * this function retrieves the file asynchronously, so your program can perform + * other operations while the file is being downloaded. + * + * @param resource $ftp An FTP\Connection instance. + * @param string $local_filename The local file path (will be overwritten if the file already exists). + * @param string $remote_filename The remote file path. + * @param int $mode The transfer mode. Must be either FTP_ASCII or + * FTP_BINARY. + * @param int $offset The position in the remote file to start downloading from. + * @return int Returns FTP_FAILED or FTP_FINISHED + * or FTP_MOREDATA to open the local file. + * @throws FtpException + * + */ +function ftp_nb_get($ftp, string $local_filename, string $remote_filename, int $mode = FTP_BINARY, int $offset = 0): int +{ + error_clear_last(); + $safeResult = \ftp_nb_get($ftp, $local_filename, $remote_filename, $mode, $offset); + if ($safeResult === false) { + throw FtpException::createFromPhpError(); + } + return $safeResult; +} + + /** * ftp_nb_put stores a local file on the FTP server. * @@ -500,10 +530,10 @@ function ftp_site($ftp, string $command): void * ftp_ssl_connect opens an explicit SSL-FTP connection to the * specified hostname. That implies that * ftp_ssl_connect will succeed even if the server is not - * configured for SSL-FTP, or its certificate is invalid. Only when - * ftp_login is called, the client will send the - * appropriate AUTH FTP command, so ftp_login will fail in - * the mentioned cases. + * configured for SSL-FTP. Only when ftp_login is called, the client will send the + * appropriate AUTH FTP command, so ftp_login will fail. + * The connection established by ftp_ssl_connect will not do + * peer-certificate verification. * * @param string $hostname The FTP server address. This parameter shouldn't have any trailing * slashes and shouldn't be prefixed with ftp://. @@ -545,3 +575,4 @@ function ftp_systype($ftp): string } return $safeResult; } + diff --git a/generated/funchand.php b/generated/funchand.php index 18750f1c..83744fdf 100644 --- a/generated/funchand.php +++ b/generated/funchand.php @@ -35,7 +35,7 @@ function create_function(string $args, string $code): string * @throws FunchandException * */ -function register_tick_function(callable $callback, ...$args): void +function register_tick_function(callable $callback, ...$args): void { error_clear_last(); if ($args !== []) { @@ -47,3 +47,4 @@ function register_tick_function(callable $callback, ...$args): void throw FunchandException::createFromPhpError(); } } + diff --git a/generated/functionsList.php b/generated/functionsList.php index 7ead69b0..5a60cafc 100644 --- a/generated/functionsList.php +++ b/generated/functionsList.php @@ -4,8 +4,6 @@ 'apache_getenv', 'apache_get_version', 'apache_lookup_uri', - 'apache_request_headers', - 'apache_response_headers', 'apache_setenv', 'apcu_cache_info', 'apcu_cas', @@ -14,8 +12,7 @@ 'apcu_inc', 'apcu_sma_info', 'apc_fetch', - 'array_walk_recursive', - 'assert_options', + 'array_all', 'base64_decode', 'bindtextdomain', 'bzclose', @@ -32,7 +29,6 @@ 'class_parents', 'class_uses', 'cli_set_process_title', - 'closelog', 'com_create_guid', 'com_event_sink', 'com_load_typelib', @@ -100,19 +96,16 @@ 'curl_getinfo', 'curl_init', 'curl_multi_info_read', - 'curl_multi_init', 'curl_multi_setopt', 'curl_setopt', - 'curl_share_errno', 'curl_share_setopt', 'curl_unescape', 'curl_upkeep', - 'date', - 'date_parse', + 'date_create', + 'date_create_immutable', 'date_parse_from_format', 'date_sunrise', 'date_sunset', - 'date_sun_info', 'db2_autocommit', 'db2_bind_param', 'db2_client_info', @@ -122,6 +115,7 @@ 'db2_free_result', 'db2_free_stmt', 'db2_get_option', + 'db2_num_rows', 'db2_pclose', 'db2_rollback', 'db2_server_info', @@ -195,6 +189,7 @@ 'finfo_open', 'flock', 'fopen', + 'fpm_get_status', 'fputcsv', 'fread', 'fsockopen', @@ -214,6 +209,7 @@ 'ftp_login', 'ftp_mkdir', 'ftp_mlsd', + 'ftp_nb_get', 'ftp_nb_put', 'ftp_nlist', 'ftp_pasv', @@ -227,7 +223,6 @@ 'ftp_systype', 'ftruncate', 'fwrite', - 'getallheaders', 'getcwd', 'gethostname', 'getimagesize', @@ -245,8 +240,6 @@ 'get_include_path', 'get_meta_tags', 'glob', - 'gmmktime', - 'gmp_random_seed', 'gmstrftime', 'gnupg_adddecryptkey', 'gnupg_addencryptkey', @@ -267,17 +260,14 @@ 'gzgetss', 'gzinflate', 'gzopen', - 'gzpassthru', 'gzread', 'gzrewind', 'gzuncompress', 'gzwrite', - 'hash_hkdf', 'hash_update_file', 'header_register_callback', 'hex2bin', 'highlight_file', - 'highlight_string', 'hrtime', 'ibase_add_user', 'ibase_backup', @@ -382,8 +372,6 @@ 'imagesettile', 'imagestring', 'imagestringup', - 'imagesx', - 'imagesy', 'imagetruecolortopalette', 'imagettfbbox', 'imagettftext', @@ -398,8 +386,6 @@ 'imap_body', 'imap_bodystruct', 'imap_check', - 'imap_clearflag_full', - 'imap_close', 'imap_createmailbox', 'imap_deletemailbox', 'imap_fetchbody', @@ -407,7 +393,6 @@ 'imap_fetchmime', 'imap_fetchstructure', 'imap_fetch_overview', - 'imap_gc', 'imap_getacl', 'imap_getmailboxes', 'imap_getsubscribed', @@ -416,7 +401,6 @@ 'imap_listscan', 'imap_lsub', 'imap_mail', - 'imap_mailboxmsginfo', 'imap_mail_compose', 'imap_mail_copy', 'imap_mail_move', @@ -429,23 +413,21 @@ 'imap_rfc822_write_address', 'imap_savebody', 'imap_setacl', - 'imap_setflag_full', 'imap_set_quota', 'imap_sort', 'imap_status', 'imap_subscribe', 'imap_thread', 'imap_timeout', - 'imap_undelete', 'imap_unsubscribe', 'imap_utf8_to_mutf7', 'inet_ntop', 'inflate_add', 'inflate_get_read_len', - 'inflate_get_status', 'inflate_init', 'ini_get', 'ini_set', + 'inotify_add_watch', 'inotify_init', 'inotify_rm_watch', 'iptcembed', @@ -470,7 +452,6 @@ 'ldap_first_attribute', 'ldap_first_entry', 'ldap_free_result', - 'ldap_get_attributes', 'ldap_get_dn', 'ldap_get_entries', 'ldap_get_option', @@ -490,7 +471,6 @@ 'libxml_get_last_error', 'libxml_set_external_entity_loader', 'link', - 'long2ip', 'lstat', 'lzf_compress', 'lzf_decompress', @@ -502,7 +482,6 @@ 'mb_chr', 'mb_convert_encoding', 'mb_detect_order', - 'mb_encoding_aliases', 'mb_eregi_replace', 'mb_ereg_replace', 'mb_ereg_replace_callback', @@ -564,6 +543,8 @@ 'ob_end_clean', 'ob_end_flush', 'ob_flush', + 'ob_get_clean', + 'ob_get_flush', 'ob_start', 'oci_bind_array_by_name', 'oci_bind_by_name', @@ -603,9 +584,6 @@ 'oci_statement_type', 'oci_unregister_taf_callback', 'odbc_autocommit', - 'odbc_binmode', - 'odbc_columnprivileges', - 'odbc_columns', 'odbc_commit', 'odbc_connect', 'odbc_cursor', @@ -618,26 +596,17 @@ 'odbc_field_num', 'odbc_field_scale', 'odbc_field_type', - 'odbc_foreignkeys', - 'odbc_gettypeinfo', - 'odbc_longreadlen', 'odbc_pconnect', 'odbc_prepare', - 'odbc_primarykeys', - 'odbc_procedurecolumns', 'odbc_procedures', 'odbc_result', 'odbc_result_all', 'odbc_rollback', 'odbc_setoption', - 'odbc_specialcolumns', - 'odbc_statistics', - 'odbc_tableprivileges', 'odbc_tables', 'opcache_compile_file', 'opcache_get_status', 'opendir', - 'openlog', 'openssl_cipher_iv_length', 'openssl_cipher_key_length', 'openssl_cms_decrypt', @@ -668,6 +637,7 @@ 'openssl_pkey_derive', 'openssl_pkey_export', 'openssl_pkey_export_to_file', + 'openssl_pkey_get_details', 'openssl_pkey_get_private', 'openssl_pkey_get_public', 'openssl_pkey_new', @@ -688,7 +658,6 @@ 'openssl_x509_read', 'output_add_rewrite_var', 'output_reset_rewrite_vars', - 'pack', 'parse_ini_file', 'parse_ini_string', 'parse_url', @@ -736,14 +705,14 @@ 'pg_result_error_field', 'pg_result_seek', 'pg_select', + 'pg_set_chunked_rows_size', 'pg_socket', 'pg_trace', 'pg_update', - 'phpcredits', - 'phpinfo', 'php_sapi_name', 'png2wbmp', 'posix_access', + 'posix_eaccess', 'posix_getgrgid', 'posix_getgrnam', 'posix_getgroups', @@ -772,7 +741,6 @@ 'pspell_add_to_personal', 'pspell_add_to_session', 'pspell_clear_session', - 'pspell_config_create', 'pspell_config_data_dir', 'pspell_config_dict_dir', 'pspell_config_ignore', @@ -854,9 +822,6 @@ 'putenv', 'readfile', 'readgzfile', - 'readline_add_history', - 'readline_callback_handler_install', - 'readline_clear_history', 'readline_completion_function', 'readline_read_history', 'readline_write_history', @@ -866,6 +831,33 @@ 'rename', 'rewind', 'rmdir', + 'rnp_decrypt', + 'rnp_dump_packets', + 'rnp_dump_packets_to_json', + 'rnp_ffi_create', + 'rnp_ffi_set_pass_provider', + 'rnp_import_keys', + 'rnp_import_signatures', + 'rnp_key_export', + 'rnp_key_export_autocrypt', + 'rnp_key_export_revocation', + 'rnp_key_get_info', + 'rnp_key_remove', + 'rnp_key_revoke', + 'rnp_list_keys', + 'rnp_load_keys', + 'rnp_load_keys_from_path', + 'rnp_locate_key', + 'rnp_op_encrypt', + 'rnp_op_generate_key', + 'rnp_op_sign', + 'rnp_op_sign_cleartext', + 'rnp_op_sign_detached', + 'rnp_op_verify', + 'rnp_op_verify_detached', + 'rnp_save_keys', + 'rnp_save_keys_to_path', + 'rnp_supported_features', 'rpmaddtag', 'rrd_create', 'rrd_first', @@ -911,7 +903,6 @@ 'shm_put_var', 'shm_remove', 'shm_remove_var', - 'shuffle', 'simplexml_import_dom', 'simplexml_load_file', 'simplexml_load_string', @@ -919,6 +910,7 @@ 'socket_addrinfo_bind', 'socket_addrinfo_connect', 'socket_addrinfo_lookup', + 'socket_atmark', 'socket_bind', 'socket_connect', 'socket_create', @@ -942,6 +934,8 @@ 'socket_wsaprotocol_info_export', 'socket_wsaprotocol_info_import', 'socket_wsaprotocol_info_release', + 'sodium_crypto_aead_aegis128l_decrypt', + 'sodium_crypto_aead_aegis256_decrypt', 'sodium_crypto_aead_aes256gcm_decrypt', 'sodium_crypto_aead_chacha20poly1305_decrypt', 'sodium_crypto_aead_chacha20poly1305_encrypt', @@ -952,7 +946,6 @@ 'sodium_crypto_auth_verify', 'sodium_crypto_box_open', 'sodium_crypto_box_seal_open', - 'sodium_crypto_generichash_update', 'sodium_crypto_secretbox_open', 'sodium_crypto_sign_open', 'sodium_crypto_sign_verify_detached', @@ -1001,6 +994,7 @@ 'ssh2_sftp_symlink', 'ssh2_sftp_unlink', 'ssh2_shell', + 'stream_context_set_options', 'stream_context_set_params', 'stream_copy_to_stream', 'stream_filter_append', @@ -1036,7 +1030,6 @@ 'swoole_event_del', 'swoole_event_write', 'symlink', - 'syslog', 'system', 'tempnam', 'timezone_name_from_abbr', @@ -1063,16 +1056,7 @@ 'xdiff_string_patch_binary', 'xmlrpc_set_type', 'xml_parser_free', - 'xml_set_character_data_handler', - 'xml_set_default_handler', - 'xml_set_element_handler', - 'xml_set_end_namespace_decl_handler', - 'xml_set_external_entity_ref_handler', - 'xml_set_notation_decl_handler', - 'xml_set_object', - 'xml_set_processing_instruction_handler', - 'xml_set_start_namespace_decl_handler', - 'xml_set_unparsed_entity_decl_handler', + 'xml_parser_set_option', 'yaml_parse', 'yaml_parse_file', 'yaml_parse_url', diff --git a/generated/gettext.php b/generated/gettext.php index 5abd6cb6..cebbf8a9 100644 --- a/generated/gettext.php +++ b/generated/gettext.php @@ -16,12 +16,17 @@ * @throws GettextException * */ -function bindtextdomain(string $domain, string $directory): string +function bindtextdomain(string $domain, ?string $directory = null): string { error_clear_last(); - $safeResult = \bindtextdomain($domain, $directory); + if ($directory !== null) { + $safeResult = \bindtextdomain($domain, $directory); + } else { + $safeResult = \bindtextdomain($domain); + } if ($safeResult === false) { throw GettextException::createFromPhpError(); } return $safeResult; } + diff --git a/generated/gnupg.php b/generated/gnupg.php index 51055b8d..0e549374 100644 --- a/generated/gnupg.php +++ b/generated/gnupg.php @@ -53,7 +53,7 @@ function gnupg_addencryptkey($identifier, string $fingerprint): void * @throws GnupgException * */ -function gnupg_addsignkey($identifier, string $fingerprint, string $passphrase = null): void +function gnupg_addsignkey($identifier, string $fingerprint, ?string $passphrase = null): void { error_clear_last(); if ($passphrase !== null) { @@ -186,3 +186,4 @@ function gnupg_setsignmode($identifier, int $signmode): void throw GnupgException::createFromPhpError(); } } + diff --git a/generated/hash.php b/generated/hash.php index 239cde00..596161f9 100644 --- a/generated/hash.php +++ b/generated/hash.php @@ -4,44 +4,6 @@ use Safe\Exceptions\HashException; -/** - * - * - * @param string $algo Name of selected hashing algorithm (i.e. "sha256", "sha512", "haval160,4", etc..) - * See hash_algos for a list of supported algorithms. - * - * - * Non-cryptographic hash functions are not allowed. - * - * - * - * Non-cryptographic hash functions are not allowed. - * @param string $key Input keying material (raw binary). Cannot be empty. - * @param int $length Desired output length in bytes. - * Cannot be greater than 255 times the chosen hash function size. - * - * If length is 0, the output length - * will default to the chosen hash function size. - * @param string $info Application/context-specific info string. - * @param string $salt Salt to use during derivation. - * - * While optional, adding random salt significantly improves the strength of HKDF. - * @return string Returns a string containing a raw binary representation of the derived key - * (also known as output keying material - OKM);. - * @throws HashException - * - */ -function hash_hkdf(string $algo, string $key, int $length = 0, string $info = "", string $salt = ""): string -{ - error_clear_last(); - $safeResult = \hash_hkdf($algo, $key, $length, $info, $salt); - if ($safeResult === false) { - throw HashException::createFromPhpError(); - } - return $safeResult; -} - - /** * * @@ -63,3 +25,4 @@ function hash_update_file(\HashContext $context, string $filename, ?\HashContext throw HashException::createFromPhpError(); } } + diff --git a/generated/ibase.php b/generated/ibase.php index 18c7206c..e8cb8869 100644 --- a/generated/ibase.php +++ b/generated/ibase.php @@ -34,7 +34,7 @@ function fbird_blob_cancel($blob_handle): void * @throws IbaseException * */ -function ibase_add_user($service_handle, string $user_name, string $password, string $first_name = null, string $middle_name = null, string $last_name = null): void +function ibase_add_user($service_handle, string $user_name, string $password, ?string $first_name = null, ?string $middle_name = null, ?string $last_name = null): void { error_clear_last(); if ($last_name !== null) { @@ -266,7 +266,7 @@ function ibase_commit($link_or_trans_identifier = null): void * @throws IbaseException * */ -function ibase_connect(string $database = null, string $username = null, string $password = null, string $charset = null, int $buffers = null, int $dialect = null, string $role = null, int $sync = null) +function ibase_connect(?string $database = null, ?string $username = null, ?string $password = null, ?string $charset = null, ?int $buffers = null, ?int $dialect = null, ?string $role = null, ?int $sync = null) { error_clear_last(); if ($sync !== null) { @@ -423,7 +423,7 @@ function ibase_maintain_db($service_handle, string $db, int $action, int $argume * @throws IbaseException * */ -function ibase_modify_user($service_handle, string $user_name, string $password, string $first_name = null, string $middle_name = null, string $last_name = null): void +function ibase_modify_user($service_handle, string $user_name, string $password, ?string $first_name = null, ?string $middle_name = null, ?string $last_name = null): void { error_clear_last(); if ($last_name !== null) { @@ -500,7 +500,7 @@ function ibase_name_result($result, string $name): void * @throws IbaseException * */ -function ibase_pconnect(string $database = null, string $username = null, string $password = null, string $charset = null, int $buffers = null, int $dialect = null, string $role = null, int $sync = null) +function ibase_pconnect(?string $database = null, ?string $username = null, ?string $password = null, ?string $charset = null, ?int $buffers = null, ?int $dialect = null, ?string $role = null, ?int $sync = null) { error_clear_last(); if ($sync !== null) { @@ -659,3 +659,4 @@ function ibase_service_detach($service_handle): void throw IbaseException::createFromPhpError(); } } + diff --git a/generated/ibmDb2.php b/generated/ibmDb2.php index e84347b0..25f4d660 100644 --- a/generated/ibmDb2.php +++ b/generated/ibmDb2.php @@ -9,7 +9,7 @@ * * @param resource $connection A valid database connection resource variable as returned from * db2_connect or db2_pconnect. - * @param int $value One of the following constants: + * @param \DB2_AUTOCOMMIT_OFF|\DB2_AUTOCOMMIT_ON $value One of the following constants: * * * DB2_AUTOCOMMIT_OFF @@ -32,10 +32,11 @@ * Turns AUTOCOMMIT off. * * Turns AUTOCOMMIT on. - * @return mixed When db2_autocommit receives only the + * @return \DB2_AUTOCOMMIT_OFF|\DB2_AUTOCOMMIT_ON|bool When db2_autocommit receives only the * connection parameter, it returns the current state * of AUTOCOMMIT for the requested connection as an integer value. A value of - * DB2_AUTOCOMMIT_OFF indicates that AUTOCOMMIT is off, while a value of DB2_AUTOCOMMIT_ON indicates that + * DB2_AUTOCOMMIT_OFF indicates that AUTOCOMMIT is off, + * while a value of DB2_AUTOCOMMIT_ON indicates that * AUTOCOMMIT is on. * * When db2_autocommit receives both the @@ -46,7 +47,7 @@ * @throws IbmDb2Exception * */ -function db2_autocommit($connection, int $value = null) +function db2_autocommit($connection, $value = null) { error_clear_last(); if ($value !== null) { @@ -96,20 +97,10 @@ function db2_autocommit($connection, int $value = null) * @throws IbmDb2Exception * */ -function db2_bind_param($stmt, int $parameter_number, string $variable_name, int $parameter_type = null, int $data_type = 0, int $precision = -1, int $scale = 0): void +function db2_bind_param($stmt, int $parameter_number, string $variable_name, int $parameter_type = DB2_PARAM_IN, int $data_type = 0, int $precision = -1, int $scale = 0): void { error_clear_last(); - if ($scale !== 0) { - $safeResult = \db2_bind_param($stmt, $parameter_number, $variable_name, $parameter_type, $data_type, $precision, $scale); - } elseif ($precision !== -1) { - $safeResult = \db2_bind_param($stmt, $parameter_number, $variable_name, $parameter_type, $data_type, $precision); - } elseif ($data_type !== 0) { - $safeResult = \db2_bind_param($stmt, $parameter_number, $variable_name, $parameter_type, $data_type); - } elseif ($parameter_type !== null) { - $safeResult = \db2_bind_param($stmt, $parameter_number, $variable_name, $parameter_type); - } else { - $safeResult = \db2_bind_param($stmt, $parameter_number, $variable_name); - } + $safeResult = \db2_bind_param($stmt, $parameter_number, $variable_name, $parameter_type, $data_type, $precision, $scale); if ($safeResult === false) { throw IbmDb2Exception::createFromPhpError(); } @@ -221,11 +212,11 @@ function db2_bind_param($stmt, int $parameter_number, string $variable_name, int * * * @param resource $connection Specifies an active DB2 client connection. - * @return object Returns an object on a successful call. Returns FALSE on failure. + * @return \stdClass Returns an object on a successful call * @throws IbmDb2Exception * */ -function db2_client_info($connection): object +function db2_client_info($connection): \stdClass { error_clear_last(); $safeResult = \db2_client_info($connection); @@ -304,14 +295,10 @@ function db2_commit($connection): void * @throws IbmDb2Exception * */ -function db2_execute($stmt, array $parameters = null): void +function db2_execute($stmt, array $parameters = []): void { error_clear_last(); - if ($parameters !== null) { - $safeResult = \db2_execute($stmt, $parameters); - } else { - $safeResult = \db2_execute($stmt); - } + $safeResult = \db2_execute($stmt, $parameters); if ($safeResult === false) { throw IbmDb2Exception::createFromPhpError(); } @@ -519,6 +506,38 @@ function db2_get_option($resource, string $option): string } +/** + * Returns the number of rows deleted, inserted, or updated by an SQL + * statement. + * + * To determine the number of rows that will be returned by a SELECT + * statement, issue SELECT COUNT(*) with the same predicates as your + * intended SELECT statement and retrieve the value. + * + * If your application logic checks the number of rows returned by a SELECT + * statement and branches if the number of rows is 0, consider modifying your + * application to attempt to return the first row with one of + * db2_fetch_assoc, db2_fetch_both, + * db2_fetch_array, or db2_fetch_row, + * and branch if the fetch function returns FALSE. + * + * @param resource $stmt A valid stmt resource containing a result set. + * @return int Returns the number of rows affected by the last SQL statement issued by + * the specified statement handle + * @throws IbmDb2Exception + * + */ +function db2_num_rows($stmt): int +{ + error_clear_last(); + $safeResult = \db2_num_rows($stmt); + if ($safeResult === false) { + throw IbmDb2Exception::createFromPhpError(); + } + return $safeResult; +} + + /** * This function closes a DB2 client connection created with * db2_pconnect and returns the corresponding resources @@ -537,14 +556,14 @@ function db2_get_option($resource, string $option): string * has become unresponsive or the persistent connection will not be needed for * a long period of time. * - * @param resource $resource Specifies an active DB2 client connection. + * @param resource $connection Specifies an active DB2 client connection. * @throws IbmDb2Exception * */ -function db2_pclose($resource): void +function db2_pclose($connection): void { error_clear_last(); - $safeResult = \db2_pclose($resource); + $safeResult = \db2_pclose($connection); if ($safeResult === false) { throw IbmDb2Exception::createFromPhpError(); } @@ -819,11 +838,11 @@ function db2_rollback($connection): void * * * @param resource $connection Specifies an active DB2 client connection. - * @return object Returns an object on a successful call. Returns FALSE on failure. + * @return \stdClass Returns an object on a successful call * @throws IbmDb2Exception * */ -function db2_server_info($connection): object +function db2_server_info($connection): \stdClass { error_clear_last(); $safeResult = \db2_server_info($connection); @@ -1219,3 +1238,4 @@ function db2_set_option($resource, array $options, int $type): void throw IbmDb2Exception::createFromPhpError(); } } + diff --git a/generated/iconv.php b/generated/iconv.php index 99da4c0e..f89c67c3 100644 --- a/generated/iconv.php +++ b/generated/iconv.php @@ -93,3 +93,4 @@ function iconv(string $from_encoding, string $to_encoding, string $string): stri } return $safeResult; } + diff --git a/generated/image.php b/generated/image.php index c9d4cb92..66c88bd7 100644 --- a/generated/image.php +++ b/generated/image.php @@ -28,12 +28,12 @@ * * The image_info only supports * JFIF files. - * @return array Returns an array with up to 7 elements. Not all image types will include + * @return array{0: 0|positive-int, 1: 0|positive-int, 2: int, 3: string, mime: string, channels: int, bits: int}|null Returns an array with up to 7 elements. Not all image types will include * the channels and bits elements. * * Index 0 and 1 contains respectively the width and the height of the image. * - * Index 2 is one of the IMAGETYPE_XXX constants indicating + * Index 2 is one of the IMAGETYPE_* constants indicating * the type of the image. * * Index 3 is a text string with the correct @@ -66,7 +66,7 @@ * @throws ImageException * */ -function getimagesize(string $filename, ?array &$image_info = null): array +function getimagesize(string $filename, ?array &$image_info = null): ?array { error_clear_last(); $safeResult = \getimagesize($filename, $image_info); @@ -78,10 +78,10 @@ function getimagesize(string $filename, ?array &$image_info = null): array /** - * Returns the extension for the given IMAGETYPE_XXX + * Returns the extension for the given IMAGETYPE_* * constant. * - * @param int $image_type One of the IMAGETYPE_XXX constant. + * @param int $image_type One of the IMAGETYPE_* constant. * @param bool $include_dot Whether to prepend a dot to the extension or not. Default to TRUE. * @return string A string with the extension corresponding to the given image type. * @throws ImageException @@ -112,7 +112,7 @@ function image_type_to_extension(int $image_type, bool $include_dot = true): str * @throws ImageException * */ -function image2wbmp($image, ?string $filename = null, int $foreground = null): void +function image2wbmp($image, ?string $filename = null, ?int $foreground = null): void { error_clear_last(); if ($foreground !== null) { @@ -139,7 +139,7 @@ function image2wbmp($image, ?string $filename = null, int $foreground = null): v * @throws ImageException * */ -function imageaffine($image, array $affine, array $clip = null) +function imageaffine($image, array $affine, ?array $clip = null) { error_clear_last(); if ($clip !== null) { @@ -528,7 +528,7 @@ function imageconvolution($image, array $matrix, float $divisor, float $offset): /** * Copy a part of src_image onto * dst_image starting at the x,y coordinates - * src_x, src_y with + * src_x, src_y with * a width of src_width and a height of * src_height. The portion defined will be copied * onto the x,y coordinates, dst_x and @@ -558,7 +558,7 @@ function imagecopy($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, i /** * Copy a part of src_image onto * dst_image starting at the x,y coordinates - * src_x, src_y with + * src_x, src_y with * a width of src_width and a height of * src_height. The portion defined will be copied * onto the x,y coordinates, dst_x and @@ -594,7 +594,7 @@ function imagecopymerge($dst_image, $src_image, int $dst_x, int $dst_y, int $src /** * imagecopymergegray copy a part of src_image onto * dst_image starting at the x,y coordinates - * src_x, src_y with + * src_x, src_y with * a width of src_width and a height of * src_height. The portion defined will be copied * onto the x,y coordinates, dst_x and @@ -735,7 +735,7 @@ function imagecopyresized($dst_image, $src_image, int $dst_x, int $dst_y, int $s * * @param int $width The image width. * @param int $height The image height. - * @return resource Returns an image object on success, FALSE on errors. + * @return resource|false Returns an image object on success, FALSE on errors. * @throws ImageException * */ @@ -759,14 +759,13 @@ function imagecreate(int $width, int $height) * @throws ImageException * */ -function imagecreatefromavif(string $filename) +function imagecreatefromavif(string $filename): void { error_clear_last(); $safeResult = \imagecreatefromavif($filename); if ($safeResult === false) { throw ImageException::createFromPhpError(); } - return $safeResult; } @@ -915,7 +914,7 @@ function imagecreatefrompng(string $filename) * imagecreatefromstring returns an image identifier * representing the image obtained from the given data. * These types will be automatically detected if your build of PHP supports - * them: JPEG, PNG, GIF, BMP, WBMP, GD2, and WEBP. + * them: JPEG, PNG, GIF, BMP, WBMP, GD2, WEBP and AVIF. * * @param string $data A string containing the image data. * @return resource An image object will be returned on success. FALSE is returned if @@ -944,14 +943,13 @@ function imagecreatefromstring(string $data) * @throws ImageException * */ -function imagecreatefromtga(string $filename) +function imagecreatefromtga(string $filename): void { error_clear_last(); $safeResult = \imagecreatefromtga($filename); if ($safeResult === false) { throw ImageException::createFromPhpError(); } - return $safeResult; } @@ -1042,7 +1040,7 @@ function imagecreatefromxpm(string $filename) * * @param int $width Image width. * @param int $height Image height. - * @return resource Returns an image object on success, FALSE on errors. + * @return resource|false Returns an image object on success, FALSE on errors. * @throws ImageException * */ @@ -1091,7 +1089,7 @@ function imagecrop($image, array $rectangle) * @param float $threshold * @param int $color * @return resource Returns a cropped image object on success. - * If the complete image was cropped, imagecrop returns FALSE. + * FALSE is also returned if the whole image was cropped. * @throws ImageException * */ @@ -2060,7 +2058,7 @@ function imageloadfont(string $filename): int * The default (-1) uses the zlib compression default. * For more information see the zlib manual. * @param int $filters Allows reducing the PNG file size. It is a bitmask field which may be - * set to any combination of the PNG_FILTER_XXX + * set to any combination of the PNG_FILTER_* * constants. PNG_NO_FILTER or * PNG_ALL_FILTERS may also be used to respectively * disable or activate all filters. @@ -2136,7 +2134,7 @@ function imagerectangle($image, int $x1, int $y1, int $x2, int $y2, int $color): * @throws ImageException * */ -function imageresolution($image, int $resolution_x = null, int $resolution_y = null) +function imageresolution($image, ?int $resolution_x = null, ?int $resolution_y = null) { error_clear_last(); if ($resolution_y !== null) { @@ -2165,15 +2163,14 @@ function imageresolution($image, int $resolution_x = null, int $resolution_y = n * @param float $angle Rotation angle, in degrees. The rotation angle is interpreted as the * number of degrees to rotate the image anticlockwise. * @param int $background_color Specifies the color of the uncovered zone after the rotation - * @param bool $ignore_transparent This parameter is unused. * @return resource Returns an image object for the rotated image. * @throws ImageException * */ -function imagerotate($image, float $angle, int $background_color, bool $ignore_transparent = false) +function imagerotate($image, float $angle, int $background_color) { error_clear_last(); - $safeResult = \imagerotate($image, $angle, $background_color, $ignore_transparent); + $safeResult = \imagerotate($image, $angle, $background_color); if ($safeResult === false) { throw ImageException::createFromPhpError(); } @@ -2184,7 +2181,19 @@ function imagerotate($image, float $angle, int $background_color, bool $ignore_t /** * imagesavealpha sets the flag which determines whether to retain * full alpha channel information (as opposed to single-color transparency) - * when saving PNG images. + * when saving images. + * This is only supported for image formats which support full alpha channel information, + * i.e. PNG, WebP and AVIF. + * + * + * imagesavealpha is only meaningful for PNG + * images, since the full alpha channel is always saved for WebP + * and AVIF. It is not recommended to rely on this behavior, + * as it may change in the future. Thus, imagesavealpha + * should be called deliberately also for WebP and + * AVIF images. + * + * * * Alphablending has to be disabled (imagealphablending($im, false)) * to retain the alpha-channel in the first place. @@ -2559,46 +2568,6 @@ function imagestringup($image, int $font, int $x, int $y, string $string, int $c } -/** - * Returns the width of the given image object. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @return int Return the width of the images. - * @throws ImageException - * - */ -function imagesx($image): int -{ - error_clear_last(); - $safeResult = \imagesx($image); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Returns the height of the given image object. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @return int Return the height of the images. - * @throws ImageException - * - */ -function imagesy($image): int -{ - error_clear_last(); - $safeResult = \imagesy($image); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - /** * imagetruecolortopalette converts a truecolor image * to a palette image. The code for this function was originally drawn from @@ -2814,7 +2783,7 @@ function imagettftext($image, float $size, float $angle, int $x, int $y, int $co * @throws ImageException * */ -function imagewbmp($image, $file = null, int $foreground_color = null): void +function imagewbmp($image, $file = null, ?int $foreground_color = null): void { error_clear_last(); if ($foreground_color !== null) { @@ -2877,7 +2846,7 @@ function imagewebp($image, $file = null, int $quality = -1): void * @throws ImageException * */ -function imagexbm($image, $filename, int $foreground_color = null): void +function imagexbm($image, $filename, ?int $foreground_color = null): void { error_clear_last(); if ($foreground_color !== null) { @@ -2973,3 +2942,4 @@ function png2wbmp(string $pngname, string $wbmpname, int $dest_height, int $dest throw ImageException::createFromPhpError(); } } + diff --git a/generated/imap.php b/generated/imap.php index a654470d..54c29137 100644 --- a/generated/imap.php +++ b/generated/imap.php @@ -41,7 +41,7 @@ function imap_8bit(string $string): string * @throws ImapException * */ -function imap_append($imap, string $folder, string $message, string $options = null, string $internal_date = null): void +function imap_append($imap, string $folder, string $message, ?string $options = null, ?string $internal_date = null): void { error_clear_last(); if ($internal_date !== null) { @@ -216,61 +216,6 @@ function imap_check($imap): \stdClass } -/** - * This function causes a store to delete the specified - * flag to the flags set for the - * messages in the specified sequence. - * - * @param resource $imap An IMAP\Connection instance. - * @param string $sequence A sequence of message numbers. You can enumerate desired messages - * with the X,Y syntax, or retrieve all messages - * within an interval with the X:Y syntax - * @param string $flag The flags which you can unset are "\\Seen", "\\Answered", "\\Flagged", - * "\\Deleted", and "\\Draft" (as defined by RFC2060) - * @param int $options options are a bit mask and may contain - * the single option: - * - * - * - * ST_UID - The sequence argument contains UIDs - * instead of sequence numbers - * - * - * - * @throws ImapException - * - */ -function imap_clearflag_full($imap, string $sequence, string $flag, int $options = 0): void -{ - error_clear_last(); - $safeResult = \imap_clearflag_full($imap, $sequence, $flag, $options); - if ($safeResult === false) { - throw ImapException::createFromPhpError(); - } -} - - -/** - * Closes the imap stream. - * - * @param resource $imap An IMAP\Connection instance. - * @param int $flags If set to CL_EXPUNGE, the function will silently - * expunge the mailbox before closing, removing all messages marked for - * deletion. You can achieve the same thing by using - * imap_expunge - * @throws ImapException - * - */ -function imap_close($imap, int $flags = 0): void -{ - error_clear_last(); - $safeResult = \imap_close($imap, $flags); - if ($safeResult === false) { - throw ImapException::createFromPhpError(); - } -} - - /** * Creates a new mailbox specified by mailbox. * @@ -706,28 +651,6 @@ function imap_fetchstructure($imap, int $message_num, int $flags = 0): \stdClass } -/** - * Purges the cache of entries of a specific type. - * - * @param resource $imap An IMAP\Connection instance. - * @param int $flags Specifies the cache to purge. It may one or a combination - * of the following constants: - * IMAP_GC_ELT (message cache elements), - * IMAP_GC_ENV (envelope and bodies), - * IMAP_GC_TEXTS (texts). - * @throws ImapException - * - */ -function imap_gc($imap, int $flags): void -{ - error_clear_last(); - $safeResult = \imap_gc($imap, $flags); - if ($safeResult === false) { - throw ImapException::createFromPhpError(); - } -} - - /** * Gets the ACL for a given mailbox. * @@ -1452,7 +1375,7 @@ function imap_mail_move($imap, string $message_nums, string $mailbox, int $flags * @throws ImapException * */ -function imap_mail(string $to, string $subject, string $message, string $additional_headers = null, string $cc = null, string $bcc = null, string $return_path = null): void +function imap_mail(string $to, string $subject, string $message, ?string $additional_headers = null, ?string $cc = null, ?string $bcc = null, ?string $return_path = null): void { error_clear_last(); if ($return_path !== null) { @@ -1472,69 +1395,6 @@ function imap_mail(string $to, string $subject, string $message, string $additio } -/** - * Checks the current mailbox status on the server. It is similar to - * imap_status, but will additionally sum up the size of - * all messages in the mailbox, which will take some additional time to - * execute. - * - * @param resource $imap An IMAP\Connection instance. - * @return \stdClass Returns the information in an object with following properties: - * - * Mailbox properties - * - * - * - * Date - * date of last change (current datetime) - * - * - * Driver - * driver - * - * - * Mailbox - * name of the mailbox - * - * - * Nmsgs - * number of messages - * - * - * Recent - * number of recent messages - * - * - * Unread - * number of unread messages - * - * - * Deleted - * number of deleted messages - * - * - * Size - * mailbox size - * - * - * - * - * - * Returns FALSE on failure. - * @throws ImapException - * - */ -function imap_mailboxmsginfo($imap): \stdClass -{ - error_clear_last(); - $safeResult = \imap_mailboxmsginfo($imap); - if ($safeResult === false) { - throw ImapException::createFromPhpError(); - } - return $safeResult; -} - - /** * Decodes MIME message header extensions that are non ASCII text (see RFC2047). * @@ -1963,41 +1823,6 @@ function imap_setacl($imap, string $mailbox, string $user_id, string $rights): v } -/** - * Causes a store to add the specified flag to the - * flags set for the messages in the specified - * sequence. - * - * @param resource $imap An IMAP\Connection instance. - * @param string $sequence A sequence of message numbers. You can enumerate desired messages - * with the X,Y syntax, or retrieve all messages - * within an interval with the X:Y syntax - * @param string $flag The flags which you can set are \Seen, - * \Answered, \Flagged, - * \Deleted, and \Draft as - * defined by RFC2060. - * @param int $options A bit mask that may contain the single option: - * - * - * - * ST_UID - The sequence argument contains UIDs - * instead of sequence numbers - * - * - * - * @throws ImapException - * - */ -function imap_setflag_full($imap, string $sequence, string $flag, int $options = 0): void -{ - error_clear_last(); - $safeResult = \imap_setflag_full($imap, $sequence, $flag, $options); - if ($safeResult === false) { - throw ImapException::createFromPhpError(); - } -} - - /** * Gets and sorts message numbers by the given parameters. * @@ -2063,7 +1888,7 @@ function imap_setflag_full($imap, string $sequence, string $flag, int $options = * @throws ImapException * */ -function imap_sort($imap, int $criteria, int $reverse, int $flags = 0, string $search_criteria = null, string $charset = null): array +function imap_sort($imap, int $criteria, int $reverse, int $flags = 0, ?string $search_criteria = null, ?string $charset = null): array { error_clear_last(); if ($charset !== null) { @@ -2229,28 +2054,6 @@ function imap_timeout(int $timeout_type, int $timeout = -1) } -/** - * Removes the deletion flag for a specified message, which is set by - * imap_delete or imap_mail_move. - * - * @param resource $imap An IMAP\Connection instance. - * @param string $message_nums A string representing one or more messages in IMAP4-style sequence format - * ("n", "n:m", or combination of these - * delimited by commas). - * @param int $flags - * @throws ImapException - * - */ -function imap_undelete($imap, string $message_nums, int $flags = 0): void -{ - error_clear_last(); - $safeResult = \imap_undelete($imap, $message_nums, $flags); - if ($safeResult === false) { - throw ImapException::createFromPhpError(); - } -} - - /** * Unsubscribe from the specified mailbox. * @@ -2287,3 +2090,4 @@ function imap_utf8_to_mutf7(string $string): string } return $safeResult; } + diff --git a/generated/info.php b/generated/info.php index 2d39b920..6d394d6d 100644 --- a/generated/info.php +++ b/generated/info.php @@ -4,123 +4,6 @@ use Safe\Exceptions\InfoException; -/** - * Set the various assert control options or just query - * their current settings. - * - * @param int $what - * Assert Options - * - * - * - * Option - * INI Setting - * Default value - * Description - * - * - * - * - * ASSERT_ACTIVE - * assert.active - * 1 - * enable assert evaluation - * - * - * ASSERT_WARNING - * assert.warning - * 1 - * issue a PHP warning for each failed assertion - * - * - * ASSERT_BAIL - * assert.bail - * 0 - * terminate execution on failed assertions - * - * - * ASSERT_QUIET_EVAL - * assert.quiet_eval - * 0 - * - * disable error_reporting during assertion expression - * evaluation - * - * - * - * ASSERT_CALLBACK - * assert.callback - * (NULL) - * Callback to call on failed assertions - * - * - * - * - * @param mixed $value An optional new value for the option. - * - * The callback function set via ASSERT_CALLBACK or assert.callback should - * have the following signature: - * - * voidassert_callback - * stringfile - * intline - * stringassertion - * stringdescription - * - * - * - * file - * - * - * The file where assert has been called. - * - * - * - * - * line - * - * - * The line where assert has been called. - * - * - * - * - * assertion - * - * - * The assertion that has been passed to assert, - * converted to a string. - * - * - * - * - * description - * - * - * The description that has been passed to assert. - * - * - * - * - * @return mixed Returns the original setting of any options. - * @throws InfoException - * - */ -function assert_options(int $what, $value = null) -{ - error_clear_last(); - if ($value !== null) { - $safeResult = \assert_options($what, $value); - } else { - $safeResult = \assert_options($what); - } - if ($safeResult === false) { - throw InfoException::createFromPhpError(); - } - return $safeResult; -} - - /** * Sets the process title visible in tools such as top and * ps. This function is available only in @@ -173,7 +56,7 @@ function cli_set_process_title(string $title): void * * * - * whether PHP has been built with (experimental) ZTS (Zend Thread Safety) + * whether PHP has been built with ZTS (Zend Thread Safety) * support or not * * @@ -207,11 +90,11 @@ function dl(string $extension_filename): void /** * * - * @return string Returns the path, as a string. + * @return string|false Returns the path, as a string. * @throws InfoException * */ -function get_include_path(): string +function get_include_path(): string|false { error_clear_last(); $safeResult = \get_include_path(); @@ -323,7 +206,7 @@ function getmyuid(): int * @param string $short_options * @param array $long_options * @param int|null $rest_index - * @return \__benevolent This function will return an array of option / argument pairs. + * @return array|array|array|false This function will return an array of option / argument pairs. * @throws InfoException * */ @@ -433,195 +316,6 @@ function php_sapi_name(): string } -/** - * This function prints out the credits listing the PHP developers, - * modules, etc. It generates the appropriate HTML codes to insert - * the information in a page. - * - * @param int $flags To generate a custom credits page, you may want to use the - * flags parameter. - * - * - * Pre-defined phpcredits flags - * - * - * - * name - * description - * - * - * - * - * CREDITS_ALL - * - * All the credits, equivalent to using: CREDITS_DOCS + - * CREDITS_GENERAL + CREDITS_GROUP + - * CREDITS_MODULES + CREDITS_FULLPAGE. - * It generates a complete stand-alone HTML page with the appropriate tags. - * - * - * - * CREDITS_DOCS - * The credits for the documentation team - * - * - * CREDITS_FULLPAGE - * - * Usually used in combination with the other flags. Indicates - * that a complete stand-alone HTML page needs to be - * printed including the information indicated by the other - * flags. - * - * - * - * CREDITS_GENERAL - * - * General credits: Language design and concept, PHP authors - * and SAPI module. - * - * - * - * CREDITS_GROUP - * A list of the core developers - * - * - * CREDITS_MODULES - * - * A list of the extension modules for PHP, and their authors - * - * - * - * CREDITS_SAPI - * - * A list of the server API modules for PHP, and their authors - * - * - * - * - * - * @throws InfoException - * - */ -function phpcredits(int $flags = CREDITS_ALL): void -{ - error_clear_last(); - $safeResult = \phpcredits($flags); - if ($safeResult === false) { - throw InfoException::createFromPhpError(); - } -} - - -/** - * Outputs a large amount of information about the current state of PHP. - * This includes information about PHP compilation options and extensions, - * the PHP version, server information and environment (if compiled as a - * module), the PHP environment, OS version information, paths, master and - * local values of configuration options, HTTP headers, and the PHP License. - * - * Because every system is setup differently, phpinfo is - * commonly used to check configuration settings and for available - * predefined variables - * on a given system. - * - * phpinfo is also a valuable debugging tool as it - * contains all EGPCS (Environment, GET, POST, Cookie, Server) data. - * - * @param int $flags The output may be customized by passing one or more of the - * following constants bitwise values summed - * together in the optional flags parameter. - * One can also combine the respective constants or bitwise values - * together with the bitwise or operator. - * - * - * phpinfo options - * - * - * - * Name (constant) - * Value - * Description - * - * - * - * - * INFO_GENERAL - * 1 - * - * The configuration line, php.ini location, build date, Web - * Server, System and more. - * - * - * - * INFO_CREDITS - * 2 - * - * PHP Credits. See also phpcredits. - * - * - * - * INFO_CONFIGURATION - * 4 - * - * Current Local and Master values for PHP directives. See - * also ini_get. - * - * - * - * INFO_MODULES - * 8 - * - * Loaded modules and their respective settings. See also - * get_loaded_extensions. - * - * - * - * INFO_ENVIRONMENT - * 16 - * - * Environment Variable information that's also available in - * $_ENV. - * - * - * - * INFO_VARIABLES - * 32 - * - * Shows all - * predefined variables from EGPCS (Environment, GET, - * POST, Cookie, Server). - * - * - * - * INFO_LICENSE - * 64 - * - * PHP License information. See also the license FAQ. - * - * - * - * INFO_ALL - * -1 - * - * Shows all of the above. - * - * - * - * - * - * @throws InfoException - * - */ -function phpinfo(int $flags = INFO_ALL): void -{ - error_clear_last(); - $safeResult = \phpinfo($flags); - if ($safeResult === false) { - throw InfoException::createFromPhpError(); - } -} - - /** * Adds assignment to the server environment. The * environment variable will only exist for the duration of the current @@ -688,3 +382,4 @@ function set_time_limit(int $seconds): void throw InfoException::createFromPhpError(); } } + diff --git a/generated/inotify.php b/generated/inotify.php index e5e632b1..cc5d28d7 100644 --- a/generated/inotify.php +++ b/generated/inotify.php @@ -4,6 +4,34 @@ use Safe\Exceptions\InotifyException; +/** + * inotify_add_watch adds a new watch or modify an + * existing watch for the file or directory specified in + * pathname. + * + * Using inotify_add_watch on a watched object replaces + * the existing watch. Using the IN_MASK_ADD constant + * adds (OR) events to the existing watch. + * + * @param resource $inotify_instance Resource returned by + * inotify_init + * @param string $pathname File or directory to watch + * @param int $mask Events to watch for. See Predefined Constants. + * @return int The return value is a unique (inotify instance wide) watch descriptor. + * @throws InotifyException + * + */ +function inotify_add_watch($inotify_instance, string $pathname, int $mask): int +{ + error_clear_last(); + $safeResult = \inotify_add_watch($inotify_instance, $pathname, $mask); + if ($safeResult === false) { + throw InotifyException::createFromPhpError(); + } + return $safeResult; +} + + /** * Initialize an inotify instance for use with * inotify_add_watch @@ -42,3 +70,4 @@ function inotify_rm_watch($inotify_instance, int $watch_descriptor): void throw InotifyException::createFromPhpError(); } } + diff --git a/generated/json.php b/generated/json.php index 875d8524..ae58e2b7 100644 --- a/generated/json.php +++ b/generated/json.php @@ -56,3 +56,4 @@ function json_encode($value, int $flags = 0, int $depth = 512): string } return $safeResult; } + diff --git a/generated/ldap.php b/generated/ldap.php index 867a074f..5731440f 100644 --- a/generated/ldap.php +++ b/generated/ldap.php @@ -47,7 +47,7 @@ function ldap_8859_to_t61(string $value): string * @throws LdapException * */ -function ldap_add($ldap, string $dn, array $entry, array $controls = null): void +function ldap_add($ldap, string $dn, array $entry, ?array $controls = null): void { error_clear_last(); if ($controls !== null) { @@ -159,7 +159,7 @@ function ldap_count_entries($ldap, $result): int * @throws LdapException * */ -function ldap_delete($ldap, string $dn, array $controls = null): void +function ldap_delete($ldap, string $dn, ?array $controls = null): void { error_clear_last(); if ($controls !== null) { @@ -208,7 +208,7 @@ function ldap_dn2ufn(string $dn): string * @throws LdapException * */ -function ldap_exop_passwd($ldap, string $user = "", string $old_password = "", string $new_password = "", array &$controls = null) +function ldap_exop_passwd($ldap, string $user = "", string $old_password = "", string $new_password = "", ?array &$controls = null) { error_clear_last(); $safeResult = \ldap_exop_passwd($ldap, $user, $old_password, $new_password, $controls); @@ -256,7 +256,7 @@ function ldap_exop_whoami($ldap) * @throws LdapException * */ -function ldap_exop($ldap, string $request_oid, string $request_data = null, ?array $controls = null, ?string &$response_data = null, ?string &$response_oid = null) +function ldap_exop($ldap, string $request_oid, ?string $request_data = null, ?array $controls = null, ?string &$response_data = null, ?string &$response_oid = null) { error_clear_last(); if ($response_oid !== null) { @@ -379,39 +379,6 @@ function ldap_free_result($result): void } -/** - * Reads attributes and values from an entry in the search result. - * - * Having located a specific entry in the directory, you can find out what - * information is held for that entry by using this call. You would use this - * call for an application which "browses" directory entries and/or where you - * do not know the structure of the directory entries. In many applications - * you will be searching for a specific attribute such as an email address or - * a surname, and won't care what other data is held. - * - * - * - * - * - * - * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. - * @param resource $entry An LDAP\ResultEntry instance. - * @return array Returns a complete entry information in a multi-dimensional array - * on success and FALSE on error. - * @throws LdapException - * - */ -function ldap_get_attributes($ldap, $entry): array -{ - error_clear_last(); - $safeResult = \ldap_get_attributes($ldap, $entry); - if ($safeResult === false) { - throw LdapException::createFromPhpError(); - } - return $safeResult; -} - - /** * Finds out the DN of an entry in the result. * @@ -738,7 +705,7 @@ function ldap_get_values($ldap, $entry, string $attribute): array * @throws LdapException * */ -function ldap_mod_add($ldap, string $dn, array $entry, array $controls = null): void +function ldap_mod_add($ldap, string $dn, array $entry, ?array $controls = null): void { error_clear_last(); if ($controls !== null) { @@ -764,7 +731,7 @@ function ldap_mod_add($ldap, string $dn, array $entry, array $controls = null): * @throws LdapException * */ -function ldap_mod_del($ldap, string $dn, array $entry, array $controls = null): void +function ldap_mod_del($ldap, string $dn, array $entry, ?array $controls = null): void { error_clear_last(); if ($controls !== null) { @@ -789,7 +756,7 @@ function ldap_mod_del($ldap, string $dn, array $entry, array $controls = null): * @throws LdapException * */ -function ldap_mod_replace($ldap, string $dn, array $entry, array $controls = null): void +function ldap_mod_replace($ldap, string $dn, array $entry, ?array $controls = null): void { error_clear_last(); if ($controls !== null) { @@ -888,7 +855,7 @@ function ldap_mod_replace($ldap, string $dn, array $entry, array $controls = nul * @throws LdapException * */ -function ldap_modify_batch($ldap, string $dn, array $modifications_info, array $controls = null): void +function ldap_modify_batch($ldap, string $dn, array $modifications_info, ?array $controls = null): void { error_clear_last(); if ($controls !== null) { @@ -987,7 +954,7 @@ function ldap_parse_result($ldap, $result, ?int &$error_code, ?string &$matched_ * @throws LdapException * */ -function ldap_rename($ldap, string $dn, string $new_rdn, string $new_parent, bool $delete_old_rdn, array $controls = null): void +function ldap_rename($ldap, string $dn, string $new_rdn, string $new_parent, bool $delete_old_rdn, ?array $controls = null): void { error_clear_last(); if ($controls !== null) { @@ -1015,7 +982,7 @@ function ldap_rename($ldap, string $dn, string $new_rdn, string $new_parent, boo * @throws LdapException * */ -function ldap_sasl_bind($ldap, string $dn = null, string $password = null, string $mech = null, string $realm = null, string $authc_id = null, string $authz_id = null, string $props = null): void +function ldap_sasl_bind($ldap, ?string $dn = null, ?string $password = null, ?string $mech = null, ?string $realm = null, ?string $authc_id = null, ?string $authz_id = null, ?string $props = null): void { error_clear_last(); if ($props !== null) { @@ -1244,3 +1211,4 @@ function ldap_unbind($ldap): void throw LdapException::createFromPhpError(); } } + diff --git a/generated/libxml.php b/generated/libxml.php index 20d32408..9db24738 100644 --- a/generated/libxml.php +++ b/generated/libxml.php @@ -32,7 +32,7 @@ function libxml_get_last_error(): \LibXMLError * @param callable $resolver_function A callable with the following signature: * * resourcestringnullresolver - * stringpublic_id + * stringnullpublic_id * stringsystem_id * arraycontext * @@ -76,3 +76,4 @@ function libxml_set_external_entity_loader(callable $resolver_function): void throw LibxmlException::createFromPhpError(); } } + diff --git a/generated/lzf.php b/generated/lzf.php index 7ea98c4d..77972779 100644 --- a/generated/lzf.php +++ b/generated/lzf.php @@ -42,3 +42,4 @@ function lzf_decompress(string $data): string } return $safeResult; } + diff --git a/generated/mailparse.php b/generated/mailparse.php index b6fc0070..14f38462 100644 --- a/generated/mailparse.php +++ b/generated/mailparse.php @@ -26,7 +26,7 @@ * @throws MailparseException * */ -function mailparse_msg_extract_part_file($mimemail, $filename, callable $callbackfunc = null): string +function mailparse_msg_extract_part_file($mimemail, $filename, ?callable $callbackfunc = null): string { error_clear_last(); if ($callbackfunc !== null) { @@ -125,3 +125,4 @@ function mailparse_stream_encode($sourcefp, $destfp, string $encoding): void throw MailparseException::createFromPhpError(); } } + diff --git a/generated/mbstring.php b/generated/mbstring.php index 21203436..47a59f62 100644 --- a/generated/mbstring.php +++ b/generated/mbstring.php @@ -19,7 +19,7 @@ * @throws MbstringException * */ -function mb_chr(int $codepoint, string $encoding = null): string +function mb_chr(int $codepoint, ?string $encoding = null): string { error_clear_last(); if ($encoding !== null) { @@ -47,7 +47,7 @@ function mb_chr(int $codepoint, string $encoding = null): string * list, in which case the correct encoding will be guessed using the * same algorithm as mb_detect_encoding. * - * If from_encoding is NULL or not specified, the + * If from_encoding is omitted or NULL, the * mbstring.internal_encoding setting * will be used if set, otherwise the default_charset setting. * @@ -96,7 +96,7 @@ function mb_convert_encoding($string, string $to_encoding, $from_encoding = null * For UTF-16, UTF-32, * UCS2 and UCS4, encoding * detection will fail always. - * @return bool|array When setting the encoding detection order, TRUE is returned on success. + * @return bool|string When setting the encoding detection order, TRUE is returned on success. * * When getting the encoding detection order, an ordered array of the encodings is returned. * @throws MbstringException @@ -117,25 +117,6 @@ function mb_detect_order($encoding = null) } -/** - * Returns an array of aliases for a known encoding type. - * - * @param string $encoding The encoding type being checked, for aliases. - * @return array Returns a numerically indexed array of encoding aliases on success - * @throws MbstringException - * - */ -function mb_encoding_aliases(string $encoding): array -{ - error_clear_last(); - $safeResult = \mb_encoding_aliases($encoding); - if ($safeResult === false) { - throw MbstringException::createFromPhpError(); - } - return $safeResult; -} - - /** * Scans string for matches to * pattern, then replaces the matched text @@ -149,8 +130,8 @@ function mb_encoding_aliases(string $encoding): array * @param string $pattern The regular expression pattern. * * Multibyte characters may be used in pattern. - * @param callable $callback A callback that will be called and passed an array of matched elements - * in the subject string. The callback should + * @param callable(array):string $callback A callback that will be called and passed an array of matched elements + * in the string string. The callback should * return the replacement string. * * You'll often need the callback function @@ -170,7 +151,7 @@ function mb_encoding_aliases(string $encoding): array * @throws MbstringException * */ -function mb_ereg_replace_callback(string $pattern, callable $callback, string $string, string $options = null): ?string +function mb_ereg_replace_callback(string $pattern, callable $callback, string $string, ?string $options = null): ?string { error_clear_last(); if ($options !== null) { @@ -200,7 +181,7 @@ function mb_ereg_replace_callback(string $pattern, callable $callback, string $s * @throws MbstringException * */ -function mb_ereg_replace(string $pattern, string $replacement, string $string, string $options = null): ?string +function mb_ereg_replace(string $pattern, string $replacement, string $string, ?string $options = null): ?string { error_clear_last(); if ($options !== null) { @@ -247,7 +228,7 @@ function mb_ereg_search_getregs(): array * @throws MbstringException * */ -function mb_ereg_search_init(string $string, string $pattern = null, string $options = null): void +function mb_ereg_search_init(string $string, ?string $pattern = null, ?string $options = null): void { error_clear_last(); if ($options !== null) { @@ -272,7 +253,7 @@ function mb_ereg_search_init(string $string, string $pattern = null, string $opt * @throws MbstringException * */ -function mb_ereg_search_regs(string $pattern = null, string $options = null): array +function mb_ereg_search_regs(?string $pattern = null, ?string $options = null): array { error_clear_last(); if ($options !== null) { @@ -319,7 +300,7 @@ function mb_ereg_search_setpos(int $offset): void * @throws MbstringException * */ -function mb_eregi_replace(string $pattern, string $replacement, string $string, string $options = null): string +function mb_eregi_replace(string $pattern, string $replacement, string $string, ?string $options = null): string { error_clear_last(); if ($options !== null) { @@ -390,7 +371,7 @@ function mb_get_info(string $type = "all") * @throws MbstringException * */ -function mb_http_output(string $encoding = null) +function mb_http_output(?string $encoding = null) { error_clear_last(); if ($encoding !== null) { @@ -421,7 +402,7 @@ function mb_http_output(string $encoding = null) * @throws MbstringException * */ -function mb_internal_encoding(string $encoding = null) +function mb_internal_encoding(?string $encoding = null) { error_clear_last(); if ($encoding !== null) { @@ -449,7 +430,7 @@ function mb_internal_encoding(string $encoding = null) * @throws MbstringException * */ -function mb_ord(string $string, string $encoding = null): int +function mb_ord(string $string, ?string $encoding = null): int { error_clear_last(); if ($encoding !== null) { @@ -497,7 +478,7 @@ function mb_parse_str(string $string, ?array &$result): void * @throws MbstringException * */ -function mb_regex_encoding(string $encoding = null) +function mb_regex_encoding(?string $encoding = null) { error_clear_last(); if ($encoding !== null) { @@ -569,7 +550,7 @@ function mb_regex_encoding(string $encoding = null) * @throws MbstringException * */ -function mb_send_mail(string $to, string $subject, string $message, $additional_headers = [], string $additional_params = null): void +function mb_send_mail(string $to, string $subject, string $message, $additional_headers = [], ?string $additional_params = null): void { error_clear_last(); if ($additional_params !== null) { @@ -602,3 +583,4 @@ function mb_split(string $pattern, string $string, int $limit = -1): array } return $safeResult; } + diff --git a/generated/misc.php b/generated/misc.php index ab4ac59b..0aa26b27 100644 --- a/generated/misc.php +++ b/generated/misc.php @@ -69,29 +69,6 @@ function highlight_file(string $filename, bool $return = false) } -/** - * - * - * @param string $string The PHP code to be highlighted. This should include the opening tag. - * @param bool $return Set this parameter to TRUE to make this function return the - * highlighted code. - * @return string|bool If return is set to TRUE, returns the highlighted - * code as a string instead of printing it out. Otherwise, it will return - * TRUE on success, FALSE on failure. - * @throws MiscException - * - */ -function highlight_string(string $string, bool $return = false) -{ - error_clear_last(); - $safeResult = \highlight_string($string, $return); - if ($safeResult === false) { - throw MiscException::createFromPhpError(); - } - return $safeResult; -} - - /** * * @@ -116,175 +93,6 @@ function hrtime(bool $as_number = false) } -/** - * Pack given arguments into a binary string according to - * format. - * - * The idea for this function was taken from Perl and all formatting codes - * work the same as in Perl. However, there are some formatting codes that are - * missing such as Perl's "u" format code. - * - * Note that the distinction between signed and unsigned values only - * affects the function unpack, where as - * function pack gives the same result for - * signed and unsigned format codes. - * - * @param string $format The format string consists of format codes - * followed by an optional repeater argument. The repeater argument can - * be either an integer value or * for repeating to - * the end of the input data. For a, A, h, H the repeat count specifies - * how many characters of one data argument are taken, for @ it is the - * absolute position where to put the next data, for everything else the - * repeat count specifies how many data arguments are consumed and packed - * into the resulting binary string. - * - * Currently implemented formats are: - * - * pack format characters - * - * - * - * Code - * Description - * - * - * - * - * a - * NUL-padded string - * - * - * A - * SPACE-padded string - * - * h - * Hex string, low nibble first - * - * H - * Hex string, high nibble first - * csigned char - * - * C - * unsigned char - * - * s - * signed short (always 16 bit, machine byte order) - * - * - * S - * unsigned short (always 16 bit, machine byte order) - * - * - * n - * unsigned short (always 16 bit, big endian byte order) - * - * - * v - * unsigned short (always 16 bit, little endian byte order) - * - * - * i - * signed integer (machine dependent size and byte order) - * - * - * I - * unsigned integer (machine dependent size and byte order) - * - * - * l - * signed long (always 32 bit, machine byte order) - * - * - * L - * unsigned long (always 32 bit, machine byte order) - * - * - * N - * unsigned long (always 32 bit, big endian byte order) - * - * - * V - * unsigned long (always 32 bit, little endian byte order) - * - * - * q - * signed long long (always 64 bit, machine byte order) - * - * - * Q - * unsigned long long (always 64 bit, machine byte order) - * - * - * J - * unsigned long long (always 64 bit, big endian byte order) - * - * - * P - * unsigned long long (always 64 bit, little endian byte order) - * - * - * f - * float (machine dependent size and representation) - * - * - * g - * float (machine dependent size, little endian byte order) - * - * - * G - * float (machine dependent size, big endian byte order) - * - * - * d - * double (machine dependent size and representation) - * - * - * e - * double (machine dependent size, little endian byte order) - * - * - * E - * double (machine dependent size, big endian byte order) - * - * - * x - * NUL byte - * - * - * X - * Back up one byte - * - * - * Z - * NUL-padded string - * - * - * @ - * NUL-fill to absolute position - * - * - * - * - * @param mixed $values - * @return string Returns a binary string containing data. - * @throws MiscException - * - */ -function pack(string $format, ...$values): string -{ - error_clear_last(); - if ($values !== []) { - $safeResult = \pack($format, ...$values); - } else { - $safeResult = \pack($format); - } - if ($safeResult === false) { - throw MiscException::createFromPhpError(); - } - return $safeResult; -} - - /** * Convert string from one codepage to another. * @@ -329,7 +137,7 @@ function sapi_windows_cp_set(int $codepage): void /** * Sends a CTRL event to another process in the same process group. * - * @param int $event The CTRL even to send; + * @param int $event The CTRL event to send; * either PHP_WINDOWS_EVENT_CTRL_C * or PHP_WINDOWS_EVENT_CTRL_BREAK. * @param int $pid The ID of the process to which to send the event to. If 0 @@ -354,8 +162,18 @@ function sapi_windows_generate_ctrl_event(int $event, int $pid = 0): void * this is only possible when called from the main thread. * * @param $handler A callback function to set or remove. If set, this function will be called - * whenever a CTRL+C or CTRL+BREAK event - * occurs. The function is supposed to have the following signature: + * whenever a + * + * CTRL + * C + * + * or + * + * CTRL + * BREAK + * + * event occurs. + * The function is supposed to have the following signature: * * voidhandler * intevent @@ -373,7 +191,16 @@ function sapi_windows_generate_ctrl_event(int $event, int $pid = 0): void * * * Setting a NULL handler causes the process to ignore - * CTRL+C events, but not CTRL+BREAK events. + * + * CTRL + * C + * + * events, but not + * + * CTRL + * BREAK + * + * events. * @param bool $add * @throws MiscException * @@ -404,7 +231,7 @@ function sapi_windows_set_ctrl_handler($handler, bool $add = true): void * @throws MiscException * */ -function sapi_windows_vt100_support($stream, bool $enable = null): void +function sapi_windows_vt100_support($stream, ?bool $enable = null): void { error_clear_last(); if ($enable !== null) { @@ -424,7 +251,7 @@ function sapi_windows_vt100_support($stream, bool $enable = null): void * * @param int $seconds Must be a non-negative integer. * @param int $nanoseconds Must be a non-negative integer less than 1 billion. - * @return array{0:0|positive-int,1:0|positive-int}|bool Returns TRUE on success. + * @return array{seconds:0|positive-int,nanoseconds:0|positive-int}|bool Returns TRUE on success. * * If the delay was interrupted by a signal, an associative array will be * returned with the components: @@ -516,3 +343,4 @@ function unpack(string $format, string $string, int $offset = 0): array } return $safeResult; } + diff --git a/generated/mysql.php b/generated/mysql.php index 2f882444..12cf2e0e 100644 --- a/generated/mysql.php +++ b/generated/mysql.php @@ -26,7 +26,7 @@ * @throws MysqlException * */ -function mysql_close($link_identifier = null): void +function mysql_close($link_identifier = NULL): void { error_clear_last(); $safeResult = \mysql_close($link_identifier); @@ -73,7 +73,7 @@ function mysql_close($link_identifier = null): void * @throws MysqlException * */ -function mysql_connect(string $server = null, string $username = null, string $password = null, bool $new_link = false, int $client_flags = 0) +function mysql_connect(?string $server = null, ?string $username = null, ?string $password = null, bool $new_link = false, int $client_flags = 0) { error_clear_last(); if ($client_flags !== 0) { @@ -111,7 +111,7 @@ function mysql_connect(string $server = null, string $username = null, string $p * @throws MysqlException * */ -function mysql_create_db(string $database_name, $link_identifier = null): void +function mysql_create_db(string $database_name, $link_identifier = NULL): void { error_clear_last(); $safeResult = \mysql_create_db($database_name, $link_identifier); @@ -165,7 +165,7 @@ function mysql_data_seek($result, int $row_number): void * @throws MysqlException * */ -function mysql_db_name($result, int $row, $field = null): string +function mysql_db_name($result, int $row, $field = NULL): string { error_clear_last(); $safeResult = \mysql_db_name($result, $row, $field); @@ -196,7 +196,7 @@ function mysql_db_name($result, int $row, $field = null): string * @throws MysqlException * */ -function mysql_db_query(string $database, string $query, $link_identifier = null) +function mysql_db_query(string $database, string $query, $link_identifier = NULL) { error_clear_last(); $safeResult = \mysql_db_query($database, $query, $link_identifier); @@ -224,7 +224,7 @@ function mysql_db_query(string $database, string $query, $link_identifier = null * @throws MysqlException * */ -function mysql_drop_db(string $database_name, $link_identifier = null): void +function mysql_drop_db(string $database_name, $link_identifier = NULL): void { error_clear_last(); $safeResult = \mysql_drop_db($database_name, $link_identifier); @@ -418,7 +418,7 @@ function mysql_free_result($result): void * @throws MysqlException * */ -function mysql_get_host_info($link_identifier = null): string +function mysql_get_host_info($link_identifier = NULL): string { error_clear_last(); $safeResult = \mysql_get_host_info($link_identifier); @@ -442,7 +442,7 @@ function mysql_get_host_info($link_identifier = null): string * @throws MysqlException * */ -function mysql_get_proto_info($link_identifier = null): int +function mysql_get_proto_info($link_identifier = NULL): int { error_clear_last(); $safeResult = \mysql_get_proto_info($link_identifier); @@ -466,7 +466,7 @@ function mysql_get_proto_info($link_identifier = null): int * @throws MysqlException * */ -function mysql_get_server_info($link_identifier = null): string +function mysql_get_server_info($link_identifier = NULL): string { error_clear_last(); $safeResult = \mysql_get_server_info($link_identifier); @@ -492,7 +492,7 @@ function mysql_get_server_info($link_identifier = null): string * @throws MysqlException * */ -function mysql_info($link_identifier = null): string +function mysql_info($link_identifier = NULL): string { error_clear_last(); $safeResult = \mysql_info($link_identifier); @@ -519,7 +519,7 @@ function mysql_info($link_identifier = null): string * @throws MysqlException * */ -function mysql_list_dbs($link_identifier = null) +function mysql_list_dbs($link_identifier = NULL) { error_clear_last(); $safeResult = \mysql_list_dbs($link_identifier); @@ -554,7 +554,7 @@ function mysql_list_dbs($link_identifier = null) * @throws MysqlException * */ -function mysql_list_fields(string $database_name, string $table_name, $link_identifier = null) +function mysql_list_fields(string $database_name, string $table_name, $link_identifier = NULL) { error_clear_last(); $safeResult = \mysql_list_fields($database_name, $table_name, $link_identifier); @@ -578,7 +578,7 @@ function mysql_list_fields(string $database_name, string $table_name, $link_iden * @throws MysqlException * */ -function mysql_list_processes($link_identifier = null) +function mysql_list_processes($link_identifier = NULL) { error_clear_last(); $safeResult = \mysql_list_processes($link_identifier); @@ -611,7 +611,7 @@ function mysql_list_processes($link_identifier = null) * @throws MysqlException * */ -function mysql_list_tables(string $database, $link_identifier = null) +function mysql_list_tables(string $database, $link_identifier = NULL) { error_clear_last(); $safeResult = \mysql_list_tables($database, $link_identifier); @@ -707,7 +707,7 @@ function mysql_num_rows($result): int * @throws MysqlException * */ -function mysql_query(string $query, $link_identifier = null) +function mysql_query(string $query, $link_identifier = NULL) { error_clear_last(); $safeResult = \mysql_query($query, $link_identifier); @@ -744,7 +744,7 @@ function mysql_query(string $query, $link_identifier = null) * @throws MysqlException * */ -function mysql_real_escape_string(string $unescaped_string, $link_identifier = null): string +function mysql_real_escape_string(string $unescaped_string, $link_identifier = NULL): string { error_clear_last(); $safeResult = \mysql_real_escape_string($unescaped_string, $link_identifier); @@ -807,7 +807,7 @@ function mysql_result($result, int $row, $field = 0): string * @throws MysqlException * */ -function mysql_select_db(string $database_name, $link_identifier = null): void +function mysql_select_db(string $database_name, $link_identifier = NULL): void { error_clear_last(); $safeResult = \mysql_select_db($database_name, $link_identifier); @@ -830,7 +830,7 @@ function mysql_select_db(string $database_name, $link_identifier = null): void * @throws MysqlException * */ -function mysql_set_charset(string $charset, $link_identifier = null): void +function mysql_set_charset(string $charset, $link_identifier = NULL): void { error_clear_last(); $safeResult = \mysql_set_charset($charset, $link_identifier); @@ -884,7 +884,7 @@ function mysql_tablename($result, int $i): string * @throws MysqlException * */ -function mysql_thread_id($link_identifier = null): int +function mysql_thread_id($link_identifier = NULL): int { error_clear_last(); $safeResult = \mysql_thread_id($link_identifier); @@ -927,7 +927,7 @@ function mysql_thread_id($link_identifier = null): int * @throws MysqlException * */ -function mysql_unbuffered_query(string $query, $link_identifier = null) +function mysql_unbuffered_query(string $query, $link_identifier = NULL) { error_clear_last(); $safeResult = \mysql_unbuffered_query($query, $link_identifier); @@ -936,3 +936,4 @@ function mysql_unbuffered_query(string $query, $link_identifier = null) } return $safeResult; } + diff --git a/generated/network.php b/generated/network.php index 9b4e5965..540663e9 100644 --- a/generated/network.php +++ b/generated/network.php @@ -4,23 +4,6 @@ use Safe\Exceptions\NetworkException; -/** - * closelog closes the descriptor being used to write to - * the system logger. The use of closelog is optional. - * - * @throws NetworkException - * - */ -function closelog(): void -{ - error_clear_last(); - $safeResult = \closelog(); - if ($safeResult === false) { - throw NetworkException::createFromPhpError(); - } -} - - /** * Fetch DNS Resource Records associated with the given * hostname. @@ -37,24 +20,9 @@ function closelog(): void * with a functions such as mail. * @param int $type By default, dns_get_record will search for any * resource records associated with hostname. - * To limit the query, specify the optional type - * parameter. May be any one of the following: - * DNS_A, DNS_CNAME, - * DNS_HINFO, DNS_CAA, - * DNS_MX, DNS_NS, - * DNS_PTR, DNS_SOA, - * DNS_TXT, DNS_AAAA, - * DNS_SRV, DNS_NAPTR, - * DNS_A6, DNS_ALL - * or DNS_ANY. - * - * Because of eccentricities in the performance of libresolv - * between platforms, DNS_ANY will not - * always return every record, the slower DNS_ALL - * will collect all records more reliably. - * - * Windows: DNS_CAA is not supported. - * Support for DNS_A6 is not implemented. + * To limit the query, use one of the + * DNS_* + * constants. * @param array|null $authoritative_name_servers Passed by reference and, if given, will be populated with Resource * Records for the Authoritative Name Servers. * @param array|null $additional_records Passed by reference and, if given, will be populated with any @@ -108,7 +76,7 @@ function closelog(): void * * * - * Other keys in associative arrays dependant on 'type' + * Other keys in associative arrays dependent on type * * * @@ -306,7 +274,7 @@ function dns_get_record(string $hostname, int $type = DNS_ANY, ?array &$authorit * @throws NetworkException * */ -function fsockopen(string $hostname, int $port = -1, ?int &$error_code = null, ?string &$error_message = null, float $timeout = null) +function fsockopen(string $hostname, int $port = -1, ?int &$error_code = null, ?string &$error_message = null, ?float $timeout = null) { error_clear_last(); if ($timeout !== null) { @@ -447,27 +415,6 @@ function inet_ntop(string $ip): string } -/** - * The function long2ip generates an Internet address - * in dotted format (i.e.: aaa.bbb.ccc.ddd) from the long integer - * representation. - * - * @param int $ip A proper address representation in long integer. - * @return string Returns the Internet IP address as a string. - * @throws NetworkException - * - */ -function long2ip(int $ip): string -{ - error_clear_last(); - $safeResult = \long2ip($ip); - if ($safeResult === false) { - throw NetworkException::createFromPhpError(); - } - return $safeResult; -} - - /** * Returns an enumeration of network interfaces (adapters) on the local machine. * @@ -573,148 +520,6 @@ function net_get_interfaces(): array } -/** - * openlog opens a connection to the system - * logger for a program. - * - * The use of openlog is optional. It - * will automatically be called by syslog if - * necessary, in which case prefix will default - * to FALSE. - * - * @param string $prefix The string prefix is added to each message. - * @param int $flags The flags argument is used to indicate - * what logging options will be used when generating a log message. - * - * openlog Options - * - * - * - * Constant - * Description - * - * - * - * - * LOG_CONS - * - * if there is an error while sending data to the system logger, - * write directly to the system console - * - * - * - * LOG_NDELAY - * - * open the connection to the logger immediately - * - * - * - * LOG_ODELAY - * - * (default) delay opening the connection until the first - * message is logged - * - * - * - * LOG_PERROR - * print log message also to standard error - * - * - * LOG_PID - * include PID with each message - * - * - * - * - * You can use one or more of these options. When using multiple options - * you need to OR them, i.e. to open the connection - * immediately, write to the console and include the PID in each message, - * you will use: LOG_CONS | LOG_NDELAY | LOG_PID - * @param int $facility The facility argument is used to specify what - * type of program is logging the message. This allows you to specify - * (in your machine's syslog configuration) how messages coming from - * different facilities will be handled. - * - * openlog Facilities - * - * - * - * Constant - * Description - * - * - * - * - * LOG_AUTH - * - * security/authorization messages (use - * LOG_AUTHPRIV instead - * in systems where that constant is defined) - * - * - * - * LOG_AUTHPRIV - * security/authorization messages (private) - * - * - * LOG_CRON - * clock daemon (cron and at) - * - * - * LOG_DAEMON - * other system daemons - * - * - * LOG_KERN - * kernel messages - * - * - * LOG_LOCAL0 ... LOG_LOCAL7 - * reserved for local use, these are not available in Windows - * - * - * LOG_LPR - * line printer subsystem - * - * - * LOG_MAIL - * mail subsystem - * - * - * LOG_NEWS - * USENET news subsystem - * - * - * LOG_SYSLOG - * messages generated internally by syslogd - * - * - * LOG_USER - * generic user-level messages - * - * - * LOG_UUCP - * UUCP subsystem - * - * - * - * - * - * LOG_USER is the only valid log type under Windows - * operating systems - * @throws NetworkException - * - */ -function openlog(string $prefix, int $flags, int $facility): void -{ - error_clear_last(); - $safeResult = \openlog($prefix, $flags, $facility); - if ($safeResult === false) { - throw NetworkException::createFromPhpError(); - } -} - - /** * This function behaves exactly as fsockopen with the * difference that the connection is not closed after the script finishes. @@ -733,7 +538,7 @@ function openlog(string $prefix, int $flags, int $facility): void * @throws NetworkException * */ -function pfsockopen(string $hostname, int $port = -1, ?int &$error_code = null, ?string &$error_message = null, float $timeout = null) +function pfsockopen(string $hostname, int $port = -1, ?int &$error_code = null, ?string &$error_message = null, ?float $timeout = null) { error_clear_last(); if ($timeout !== null) { @@ -747,74 +552,3 @@ function pfsockopen(string $hostname, int $port = -1, ?int &$error_code = null, return $safeResult; } - -/** - * syslog generates a log message that will be - * distributed by the system logger. - * - * For information on setting up a user defined log handler, see the - * syslog.conf - * 5 Unix manual page. More - * information on the syslog facilities and option can be found in the man - * pages for syslog - * 3 on Unix machines. - * - * @param int $priority priority is a combination of the facility and - * the level. Possible values are: - * - * syslog Priorities (in descending order) - * - * - * - * Constant - * Description - * - * - * - * - * LOG_EMERG - * system is unusable - * - * - * LOG_ALERT - * action must be taken immediately - * - * - * LOG_CRIT - * critical conditions - * - * - * LOG_ERR - * error conditions - * - * - * LOG_WARNING - * warning conditions - * - * - * LOG_NOTICE - * normal, but significant, condition - * - * - * LOG_INFO - * informational message - * - * - * LOG_DEBUG - * debug-level message - * - * - * - * - * @param string $message The message to send. - * @throws NetworkException - * - */ -function syslog(int $priority, string $message): void -{ - error_clear_last(); - $safeResult = \syslog($priority, $message); - if ($safeResult === false) { - throw NetworkException::createFromPhpError(); - } -} diff --git a/generated/oci8.php b/generated/oci8.php index 4dd35015..6f9a5538 100644 --- a/generated/oci8.php +++ b/generated/oci8.php @@ -265,7 +265,7 @@ function oci_bind_array_by_name($statement, string $param, array &$var, int $max * * * SQLT_BOL or OCI_B_BOL - * - for PL/SQL BOOLEANs (Requires OCI8 2.0.7 and Oracle Database 12c) + * - for PL/SQL BOOLEANs (Requires Oracle Database 12c) * * * @@ -303,7 +303,7 @@ function oci_bind_array_by_name($statement, string $param, array &$var, int $max * with oci_new_cursor; * * SQLT_BOL or OCI_B_BOL - * - for PL/SQL BOOLEANs (Requires OCI8 2.0.7 and Oracle Database 12c) + * - for PL/SQL BOOLEANs (Requires Oracle Database 12c) * @throws Oci8Exception * */ @@ -376,9 +376,6 @@ function oci_commit($connection): void * See Connection Handling for general * information on connection management and connection pooling. * - * From PHP 5.1.2 (PECL OCI8 1.1) oci_close can - * be used to close the connection. - * * The second and subsequent calls to oci_connect * with the same parameters will return the connection handle returned * from the first call. This means that transactions in one handle are @@ -466,7 +463,7 @@ function oci_commit($connection): void * @throws Oci8Exception * */ -function oci_connect(string $username, string $password, string $connection_string = null, string $encoding = "", int $session_mode = OCI_DEFAULT) +function oci_connect(string $username, string $password, ?string $connection_string = null, string $encoding = "", int $session_mode = OCI_DEFAULT) { error_clear_last(); if ($session_mode !== OCI_DEFAULT) { @@ -564,10 +561,7 @@ function oci_define_by_name($statement, string $column, &$var, int $type = 0): v * * * OCI_NO_AUTO_COMMIT - * Do not automatically commit changes. Prior to PHP - * 5.3.2 (PECL OCI8 1.4) - * use OCI_DEFAULT which is equivalent - * to OCI_NO_AUTO_COMMIT. + * Do not automatically commit changes. * * * @@ -786,7 +780,7 @@ function oci_free_statement($statement): void * @throws Oci8Exception * */ -function oci_new_collection($connection, string $type_name, string $schema = null) +function oci_new_collection($connection, string $type_name, ?string $schema = null) { error_clear_last(); if ($schema !== null) { @@ -889,7 +883,7 @@ function oci_new_collection($connection, string $type_name, string $schema = nul * @throws Oci8Exception * */ -function oci_new_connect(string $username, string $password, string $connection_string = null, string $encoding = "", int $session_mode = OCI_DEFAULT) +function oci_new_connect(string $username, string $password, ?string $connection_string = null, string $encoding = "", int $session_mode = OCI_DEFAULT) { error_clear_last(); if ($session_mode !== OCI_DEFAULT) { @@ -1092,7 +1086,7 @@ function oci_parse($connection, string $sql) * @throws Oci8Exception * */ -function oci_pconnect(string $username, string $password, string $connection_string = null, string $encoding = "", int $session_mode = OCI_DEFAULT) +function oci_pconnect(string $username, string $password, ?string $connection_string = null, string $encoding = "", int $session_mode = OCI_DEFAULT) { error_clear_last(); if ($session_mode !== OCI_DEFAULT) { @@ -1262,7 +1256,7 @@ function oci_set_action($connection, string $action): void /** - * Sets a timeout limiting the maxium time a database round-trip using this connection may take. + * Sets a timeout limiting the maximum time a database round-trip using this connection may take. * * Each OCI8 operation may make zero or more calls to Oracle's client * library. These internal calls may then may make zero or more @@ -1589,7 +1583,7 @@ function oci_set_prefetch($statement, int $rows): void * * * CALL - * Introduced in PHP 5.2.1 (PECL OCI8 1.2.3) + * * * * CREATE @@ -1653,3 +1647,4 @@ function oci_unregister_taf_callback($connection): void throw Oci8Exception::createFromPhpError(); } } + diff --git a/generated/opcache.php b/generated/opcache.php index 88d1c435..ed8ccdd8 100644 --- a/generated/opcache.php +++ b/generated/opcache.php @@ -41,3 +41,4 @@ function opcache_get_status(bool $include_scripts = true): array } return $safeResult; } + diff --git a/generated/openssl.php b/generated/openssl.php index ce7b7265..f1f929fd 100644 --- a/generated/openssl.php +++ b/generated/openssl.php @@ -31,14 +31,13 @@ function openssl_cipher_iv_length(string $cipher_algo): int * @throws OpensslException * */ -function openssl_cipher_key_length(string $cipher_algo) +function openssl_cipher_key_length(string $cipher_algo): void { error_clear_last(); $safeResult = \openssl_cipher_key_length($cipher_algo); if ($safeResult === false) { throw OpensslException::createFromPhpError(); } - return $safeResult; } @@ -189,7 +188,8 @@ function openssl_cms_verify(string $input_filename, int $flags = 0, $certificate /** * openssl_csr_export_to_file takes the Certificate * Signing Request represented by csr and saves it - * in PEM format into the file named by output_filename. + * in PEM format into the file named by + * output_filename. * * @param string|resource $csr See CSR parameters for a list of valid values. * @param string $output_filename Path to the output file. @@ -218,7 +218,8 @@ function openssl_csr_export_to_file($csr, string $output_filename, bool $no_text * reference. * * @param string|resource $csr See CSR parameters for a list of valid values. - * @param string|null $output on success, this string will contain the PEM encoded CSR + * @param string|null $output on success, this string will contain the PEM + * encoded CSR * @param bool $no_text * The optional parameter notext affects * the verbosity of the output; if it is FALSE, then additional human-readable @@ -264,8 +265,8 @@ function openssl_csr_get_public_key($csr, bool $short_names = true) * including fields commonName (CN), organizationName (O), countryName (C) etc. * * @param string|resource $csr See CSR parameters for a list of valid values. - * @param bool $short_names shortnames controls how the data is indexed in the - * array - if shortnames is TRUE (the default) then + * @param bool $short_names short_names controls how the data is indexed in the + * array - if short_names is TRUE (the default) then * fields will be indexed with the short name form, otherwise, the long name * form will be used - e.g.: CN is the shortname form of commonName. * @return array Returns an associative array with subject description. @@ -284,20 +285,22 @@ function openssl_csr_get_subject($csr, bool $short_names = true): array /** - * openssl_csr_new generates a new CSR (Certificate Signing Request) + * openssl_csr_new generates a new CSR * based on the information provided by distinguished_names. * * @param array $distinguished_names The Distinguished Name or subject fields to be used in the certificate. - * @param resource $private_key private_key should be set to a private key that was - * previously generated by openssl_pkey_new (or - * otherwise obtained from the other openssl_pkey family of functions). - * The corresponding public portion of the key will be used to sign the - * CSR. + * @param resource $private_key private_key should be set to a private key that + * was previously generated by openssl_pkey_new (or + * otherwise obtained from the other openssl_pkey family of functions), or + * NULL variable. If its value is NULL variable, a new private key is + * generated based on the supplied options and + * assigned to supplied variable. The corresponding public portion of the + * key will be used to sign the CSR. * @param array $options By default, the information in your system openssl.conf * is used to initialize the request; you can specify a configuration file - * section by setting the config_section_section key of + * section by setting the config_section_section key in * options. You can also specify an alternative - * openssl configuration file by setting the value of the + * OpenSSL configuration file by setting the value of the * config key to the path of the file you want to use. * The following keys, if present in options * behave as their equivalents in the openssl.conf, as @@ -337,8 +340,7 @@ function openssl_csr_get_subject($csr, bool $short_names = true): array * private_key_bits * int * default_bits - * Specifies how many bits should be used to generate a private - * key + * Specifies how many bits should be used to generate a private key * * * private_key_type @@ -386,14 +388,16 @@ function openssl_csr_get_subject($csr, bool $short_names = true): array * * * @param array $extra_attributes extra_attributes is used to specify additional - * configuration options for the CSR. Both distinguished_names and - * extra_attributes are associative arrays whose keys are - * converted to OIDs and applied to the relevant part of the request. - * @return resource Returns the CSR. + * configuration options for the CSR. Both + * distinguished_names and + * extra_attributes are associative arrays, whose keys + * are converted to OIDs and applied to the relevant part of the request. + * @return resource Returns the CSR on success, TRUE if CSR creation is + * successful but signing fails. * @throws OpensslException * */ -function openssl_csr_new(array $distinguished_names, &$private_key, array $options = null, array $extra_attributes = null) +function openssl_csr_new(array $distinguished_names, &$private_key, ?array $options = null, ?array $extra_attributes = null) { error_clear_last(); if ($extra_attributes !== null) { @@ -429,14 +433,17 @@ function openssl_csr_new(array $distinguished_names, &$private_key, array $optio * options. * @param int $serial An optional the serial number of issued certificate. If not specified * it will default to 0. + * @param $serial_hex * @return resource Returns an OpenSSLCertificate on success, FALSE on failure. * @throws OpensslException * */ -function openssl_csr_sign($csr, $ca_certificate, $private_key, int $days, array $options = null, int $serial = 0) +function openssl_csr_sign($csr, $ca_certificate, $private_key, int $days, ?array $options = null, int $serial = 0, $serial_hex = null) { error_clear_last(); - if ($serial !== 0) { + if ($serial_hex !== null) { + $safeResult = \openssl_csr_sign($csr, $ca_certificate, $private_key, $days, $options, $serial, $serial_hex); + } elseif ($serial !== 0) { $safeResult = \openssl_csr_sign($csr, $ca_certificate, $private_key, $days, $options, $serial); } elseif ($options !== null) { $safeResult = \openssl_csr_sign($csr, $ca_certificate, $private_key, $days, $options); @@ -451,23 +458,28 @@ function openssl_csr_sign($csr, $ca_certificate, $private_key, int $days, array /** - * Takes a raw or base64 encoded string and decrypts it using a given method and key. + * Takes a raw or base64 encoded string and decrypts it using a given method and passphrase. * * @param string $data The encrypted message to be decrypted. * @param string $cipher_algo The cipher method. For a list of available cipher methods, use * openssl_get_cipher_methods. - * @param string $passphrase The key. + * @param string $passphrase The passphrase. If the passphrase is shorter than expected, it is silently padded with + * NUL characters; if the passphrase is longer than expected, it is + * silently truncated. * @param int $options options can be one of * OPENSSL_RAW_DATA, - * OPENSSL_ZERO_PADDING. - * @param string $iv A non-NULL Initialization Vector. + * OPENSSL_ZERO_PADDING + * or OPENSSL_DONT_ZERO_PAD_KEY. + * @param string $iv A non-NULL Initialization Vector. If the IV is shorter than expected, it is padded with + * NUL characters and warning is emitted; if the passphrase is longer + * than expected, it is truncated and warning is emitted. * @param string $tag The authentication tag in AEAD cipher mode. If it is incorrect, the authentication fails and the function returns FALSE. * @param string $aad Additional authenticated data. * @return string The decrypted string on success. * @throws OpensslException * */ -function openssl_decrypt(string $data, string $cipher_algo, string $passphrase, int $options = 0, string $iv = "", string $tag = null, string $aad = ""): string +function openssl_decrypt(string $data, string $cipher_algo, string $passphrase, int $options = 0, string $iv = "", ?string $tag = null, string $aad = ""): string { error_clear_last(); if ($aad !== "") { @@ -592,32 +604,33 @@ function openssl_get_curve_names(): array /** - * openssl_open opens (decrypts) - * data using the private key associated with - * the key identifier private_key and the envelope key - * encrypted_key, and fills - * output with the decrypted data. - * The envelope key is generated when the - * data are sealed and can only be used by one specific private key. See - * openssl_seal for more information. + * openssl_open opens (decrypts) data using an envelope + * key that is decrypted from encrypted_key using + * private_key. The decryption is done using + * cipher_algo and iv. The IV is required only if the + * cipher method requires it. The function fills output with the decrypted + * data. The envelope key is usually generated when the data are sealed using a public key that is + * associated with the private key. See openssl_seal for more information. * - * @param string $data - * @param string|null $output If the call is successful the opened data is returned in this - * parameter. - * @param string $encrypted_key - * @param string|array|resource $private_key - * @param string $cipher_algo The cipher method. + * @param string $data The sealed data. + * @param string|null $output If the call is successful the opened data is returned in this parameter. + * @param string $encrypted_key The encrypted symmetric key that can be decrypted using private_key. + * @param string|array|resource $private_key The private key used for decrypting encrypted_key. + * @param string $cipher_algo The cipher method used for decryption of data. * * - * The default value ('RC4') is considered insecure. - * It is strongly recommended to explicitly specify a secure cipher method. + * The default value for PHP versions prior to 8.0 is ('RC4') which is + * considered insecure. It is strongly recommended to explicitly specify a secure cipher + * method. * * - * @param string $iv The initialization vector. + * @param string $iv The initialization vector used for decryption of data. It is required + * if the cipher method requires IV. This can be found out by calling + * openssl_cipher_iv_length with cipher_algo. * @throws OpensslException * */ -function openssl_open(string $data, ?string &$output, string $encrypted_key, $private_key, string $cipher_algo, string $iv = null): void +function openssl_open(string $data, ?string &$output, string $encrypted_key, $private_key, string $cipher_algo, ?string $iv = null): void { error_clear_last(); if ($iv !== null) { @@ -636,11 +649,14 @@ function openssl_open(string $data, ?string &$output, string $encrypted_key, $pr * a key derivation function defined in PKCS5 v2. * * @param string $password Password from which the derived key is generated. - * @param string $salt PBKDF2 recommends a crytographic salt of at least 64 bits (8 bytes). + * @param string $salt PBKDF2 recommends a crytographic salt of at least 128 bits (16 bytes). * @param int $key_length Length of desired output key. - * @param int $iterations The number of iterations desired. NIST - * recommends at least 10,000. - * @param string $digest_algo Optional hash or digest algorithm from openssl_get_md_methods. Defaults to SHA-1. + * @param int $iterations The number of iterations desired. + * NIST + * recommends at least 1,000. As of 2023, OWASP recommends 600,000 iterations for + * PBKDF2-HMAC-SHA256 and 210,000 for PBKDF2-HMAC-SHA512. + * @param string $digest_algo Optional hash or digest algorithm from openssl_get_md_methods. Defaults + * to SHA-1. It is recommended to set it to SHA-256 or SHA-512. * @return string Returns raw binary string. * @throws OpensslException * @@ -681,7 +697,7 @@ function openssl_pbkdf2(string $password, string $salt, int $key_length, int $it * array of extra certificates or a single certificate to be included in the PKCS#12 file. * * - * "friendlyname" + * "friendly_name" * string to be used for the supplied certificate and key * * @@ -725,7 +741,7 @@ function openssl_pkcs12_export_to_file($certificate, string $output_filename, $p * array of extra certificates or a single certificate to be included in the PKCS#12 file. * * - * "friendlyname" + * "friendly_name" * string to be used for the supplied certificate and key * * @@ -867,7 +883,7 @@ function openssl_pkcs7_read(string $data, ?array &$certificates): void * @throws OpensslException * */ -function openssl_pkcs7_sign(string $input_filename, string $output_filename, $certificate, $private_key, array $headers, int $flags = PKCS7_DETACHED, string $untrusted_certificates_filename = null): void +function openssl_pkcs7_sign(string $input_filename, string $output_filename, $certificate, $private_key, array $headers, int $flags = PKCS7_DETACHED, ?string $untrusted_certificates_filename = null): void { error_clear_last(); if ($untrusted_certificates_filename !== null) { @@ -889,7 +905,7 @@ function openssl_pkcs7_sign(string $input_filename, string $output_filename, $ce * See Public/Private Key parameters for a list of valid values. * @param resource $private_key private_key is the private key for the derivation. * See Public/Private Key parameters for a list of valid values. - * @param int $key_length If not zero, will set the desired length of the derived secret. + * @param int $key_length If not zero, will attempt to set the desired length of the derived secret. * @return string The derived secret on success. * @throws OpensslException * @@ -921,7 +937,7 @@ function openssl_pkey_derive($public_key, $private_key, int $key_length = 0): st * @throws OpensslException * */ -function openssl_pkey_export_to_file($key, string $output_filename, ?string $passphrase = null, array $options = null): void +function openssl_pkey_export_to_file($key, string $output_filename, ?string $passphrase = null, ?array $options = null): void { error_clear_last(); if ($options !== null) { @@ -952,7 +968,7 @@ function openssl_pkey_export_to_file($key, string $output_filename, ?string $pas * @throws OpensslException * */ -function openssl_pkey_export($key, ?string &$output, ?string $passphrase = null, array $options = null): void +function openssl_pkey_export($key, ?string &$output, ?string $passphrase = null, ?array $options = null): void { error_clear_last(); if ($options !== null) { @@ -1070,11 +1086,12 @@ function openssl_pkey_get_public($public_key): \OpenSSLAsymmetricKey * bits) using options. See * openssl_csr_new for more information about * options. - * @return resource Returns an OpenSSLAsymmetricKey instance for the pkey on success. + * @return resource Returns an OpenSSLAsymmetricKey instance for + * the pkey on success. * @throws OpensslException * */ -function openssl_pkey_new(array $options = null) +function openssl_pkey_new(?array $options = null) { error_clear_last(); if ($options !== null) { @@ -1099,8 +1116,8 @@ function openssl_pkey_new(array $options = null) * * @param string $data * @param string|null $decrypted_data - * @param string|resource|array $private_key private_key must be the private key corresponding that - * was used to encrypt the data. + * @param string|resource|array $private_key private_key must be the private key that corresponds + * to the public key that was used to encrypt the data. * @param int $padding padding can be one of * OPENSSL_PKCS1_PADDING, * OPENSSL_SSLV23_PADDING, @@ -1130,7 +1147,8 @@ function openssl_private_decrypt(string $data, ?string &$decrypted_data, $privat * * @param string $data * @param string|null $encrypted_data - * @param string|resource|array $private_key + * @param string|resource|array $private_key private_key must be the private key that corresponds + * to the public key that will be used to decrypt the data. * @param int $padding padding can be one of * OPENSSL_PKCS1_PADDING, * OPENSSL_NO_PADDING. @@ -1158,8 +1176,8 @@ function openssl_private_encrypt(string $data, ?string &$encrypted_data, $privat * * @param string $data * @param string|null $decrypted_data - * @param string|resource $public_key public_key must be the public key corresponding that - * was used to encrypt the data. + * @param string|resource $public_key public_key must be the public key that corresponds + * to the private key that was used to encrypt the data. * @param int $padding padding can be one of * OPENSSL_PKCS1_PADDING, * OPENSSL_NO_PADDING. @@ -1188,7 +1206,8 @@ function openssl_public_decrypt(string $data, ?string &$decrypted_data, $public_ * * @param string $data * @param string|null $encrypted_data This will hold the result of the encryption. - * @param string|resource $public_key The public key. + * @param string|resource $public_key public_key must be the public key that corresponds + * to the private key that will be used to decrypt the data. * @param int $padding padding can be one of * OPENSSL_PKCS1_PADDING, * OPENSSL_SSLV23_PADDING, @@ -1208,15 +1227,14 @@ function openssl_public_encrypt(string $data, ?string &$encrypted_data, $public_ /** - * openssl_seal seals (encrypts) - * data by using the given cipher_algo with a randomly generated - * secret key. The key is encrypted with each of the public keys - * associated with the identifiers in public_key - * and each encrypted key is returned - * in encrypted_keys. This means that one can send - * sealed data to multiple recipients (provided one has obtained their - * public keys). Each recipient must receive both the sealed data and - * the envelope key that was encrypted with the recipient's public key. + * openssl_seal seals (encrypts) data using the + * specified cipher_algo with a randomly generated secret key. The key is + * then encrypted with each of the public keys in public_key array, + * and each encrypted envelope key is returned in encrypted_keys. This allows + * sealed data to be sent to multiple recipients (provided their public keys are available). Each + * recipient must receive both the sealed data and the envelope key that was encrypted with the + * recipient's public key. The IV (Initialization Vector) is generated, and its value is returned in + * iv. * * @param string $data The data to seal. * @param string|null $sealed_data The sealed data. @@ -1225,11 +1243,14 @@ function openssl_public_encrypt(string $data, ?string &$encrypted_data, $public_ * @param string $cipher_algo The cipher method. * * - * The default value ('RC4') is considered insecure. - * It is strongly recommended to explicitly specify a secure cipher method. + * The default value for PHP versions prior to 8.0 is ('RC4') which is + * considered insecure. It is strongly recommended to explicitly specify a secure cipher + * method. * * - * @param string|null $iv The initialization vector. + * @param string|null $iv The initialization vector for decryption of data. It is required if + * the cipher method requires IV. This can be found out by calling + * openssl_cipher_iv_length with cipher_algo. * @return int Returns the length of the sealed data on success. * If successful the sealed data is returned in * sealed_data, and the envelope keys in @@ -1368,8 +1389,8 @@ function openssl_spki_verify(string $spki): void * @param string $signature A raw binary string, generated by openssl_sign or similar means * @param \ OpenSSLAsymmetricKey|\OpenSSLCertificate|string $public_key OpenSSLAsymmetricKey - a key, returned by openssl_get_publickey * - * string - a PEM formatted key, example, "-----BEGIN PUBLIC KEY----- - * MIIBCgK..." + * string - a PEM formatted key (e.g. -----BEGIN PUBLIC KEY----- + * MIIBCgK...) * @param int|string $algorithm int - one of these Signature Algorithms. * * string - a valid string returned by openssl_get_md_methods example, "sha1WithRSAEncryption" or "sha512". @@ -1482,3 +1503,4 @@ function openssl_x509_read($certificate): \OpenSSLCertificate } return $safeResult; } + diff --git a/generated/outcontrol.php b/generated/outcontrol.php index afea0f9c..f481a63a 100644 --- a/generated/outcontrol.php +++ b/generated/outcontrol.php @@ -5,14 +5,17 @@ use Safe\Exceptions\OutcontrolException; /** - * This function discards the contents of the output buffer. + * This function calls the output handler + * (with the PHP_OUTPUT_HANDLER_CLEAN flag), + * discards it's return value + * and cleans (erases) the contents of the active output buffer. * - * This function does not destroy the output buffer like - * ob_end_clean does. + * This function does not turn off the active output buffer like + * ob_end_clean or ob_get_clean does. * - * The output buffer must be started by - * ob_start with PHP_OUTPUT_HANDLER_CLEANABLE - * flag. Otherwise ob_clean will not work. + * ob_clean will fail + * without an active output buffer started with the + * PHP_OUTPUT_HANDLER_CLEANABLE flag. * * @throws OutcontrolException * @@ -28,16 +31,21 @@ function ob_clean(): void /** - * This function discards the contents of the topmost output buffer and turns - * off this output buffering. If you want to further process the buffer's - * contents you have to call ob_get_contents before - * ob_end_clean as the buffer contents are discarded - * when ob_end_clean is called. - * - * The output buffer must be started by - * ob_start with PHP_OUTPUT_HANDLER_CLEANABLE - * and PHP_OUTPUT_HANDLER_REMOVABLE - * flags. Otherwise ob_end_clean will not work. + * This function calls the output handler + * (with the PHP_OUTPUT_HANDLER_CLEAN and + * PHP_OUTPUT_HANDLER_FINAL flags), + * discards it's return value, + * discards the contents of the active output buffer + * and turns off the active output buffer. + * + * ob_end_clean will fail + * without an active output buffer started with the + * PHP_OUTPUT_HANDLER_REMOVABLE flag. + * + * ob_end_clean + * will discard the contents of the active output buffer + * even if it was started without the + * PHP_OUTPUT_HANDLER_CLEANABLE flag. * * @throws OutcontrolException * @@ -53,17 +61,20 @@ function ob_end_clean(): void /** - * This function will send the contents of the topmost output buffer (if - * any) and turn this output buffer off. If you want to further - * process the buffer's contents you have to call - * ob_get_contents before - * ob_end_flush as the buffer contents are - * discarded after ob_end_flush is called. - * - * The output buffer must be started by - * ob_start with PHP_OUTPUT_HANDLER_FLUSHABLE - * and PHP_OUTPUT_HANDLER_REMOVABLE - * flags. Otherwise ob_end_flush will not work. + * This function calls the output handler + * (with the PHP_OUTPUT_HANDLER_FINAL flag), + * flushes (sends) it's return value, + * discards the contents of the active output buffer + * and turns off the active output buffer. + * + * ob_end_flush will fail + * without an active output buffer started with the + * PHP_OUTPUT_HANDLER_REMOVABLE flag. + * + * ob_end_flush will flush (send) + * the return value of the output handler + * even if the active output buffer was started without the + * PHP_OUTPUT_HANDLER_FLUSHABLE flag. * * @throws OutcontrolException * @@ -79,14 +90,17 @@ function ob_end_flush(): void /** - * This function will send the contents of the output buffer (if any). If you - * want to further process the buffer's contents you have to call - * ob_get_contents before ob_flush - * as the buffer contents are discarded after ob_flush - * is called. + * This function calls the output handler + * (with the PHP_OUTPUT_HANDLER_FLUSH flag), + * flushes (sends) its return value + * and discards the contents of the active output buffer. * - * This function does not destroy the output buffer like - * ob_end_flush does. + * This function does not turn off the active output buffer like + * ob_end_flush or ob_get_flush does. + * + * ob_flush will fail + * without an active output buffer started with the + * PHP_OUTPUT_HANDLER_FLUSHABLE flag. * * @throws OutcontrolException * @@ -102,40 +116,93 @@ function ob_flush(): void /** - * This function will turn output buffering on. While output buffering is - * active no output is sent from the script (other than headers), instead the - * output is stored in an internal buffer. - * - * The contents of this internal buffer may be copied into a string variable - * using ob_get_contents. To output what is stored in - * the internal buffer, use ob_end_flush. Alternatively, - * ob_end_clean will silently discard the buffer - * contents. - * - * Output buffers are stackable, that is, you may call - * ob_start while another - * ob_start is active. Just make - * sure that you call ob_end_flush - * the appropriate number of times. If multiple output callback - * functions are active, output is being filtered sequentially + * This function calls the output handler + * (with the PHP_OUTPUT_HANDLER_CLEAN and + * PHP_OUTPUT_HANDLER_FINAL flags), + * discards it's return value, + * returns the contents of the active output buffer + * and turns off the active output buffer. + * + * ob_get_clean will fail + * without an active output buffer started with the + * PHP_OUTPUT_HANDLER_REMOVABLE flag. + * + * ob_get_clean + * will discard the contents of the active output buffer + * even if it was started without the + * PHP_OUTPUT_HANDLER_CLEANABLE flag. + * + * @return string Returns the contents of the active output buffer on success. + * @throws OutcontrolException + * + */ +function ob_get_clean(): string +{ + error_clear_last(); + $safeResult = \ob_get_clean(); + if ($safeResult === false) { + throw OutcontrolException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * This function calls the output handler + * (with the PHP_OUTPUT_HANDLER_FINAL flag), + * flushes (sends) it's return value, + * returns the contents of the active output buffer + * and turns off the active output buffer. + * + * ob_get_flush will fail + * without an active output buffer started with the + * PHP_OUTPUT_HANDLER_REMOVABLE flag. + * + * ob_get_flush will flush (send) + * the return value of the output handler + * even if the active output buffer was started without the + * PHP_OUTPUT_HANDLER_FLUSHABLE flag. + * + * @return string Returns the contents of the active output buffer on success. + * @throws OutcontrolException + * + */ +function ob_get_flush(): string +{ + error_clear_last(); + $safeResult = \ob_get_flush(); + if ($safeResult === false) { + throw OutcontrolException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * This function will turn output buffering on. + * While output buffering is active no output is sent from the script, + * instead the output is stored in an internal buffer. + * See + * on exactly what output is affected. + * + * Output buffers are stackable, that is, + * ob_start may be called while another buffer is active. + * If multiple output buffers are active, + * output is being filtered sequentially * through each of them in nesting order. + * See for more details. + * + * See + * for a detailed description of output buffers. + * + * @param string|array|callable|null $callback An optional callback callable may be + * specified. It can also be bypassed by passing NULL. * - * If output buffering is still active when the script ends, PHP outputs the - * contents automatically. + * callback is invoked when the output buffer is + * flushed (sent), cleaned, or when the output buffer is flushed + * at the end of the script. * - * @param string|array|callable|null $callback An optional callback function may be - * specified. This function takes a string as a parameter and should - * return a string. The function will be called when - * the output buffer is flushed (sent) or cleaned (with - * ob_flush, ob_clean or similar - * function) or when the output buffer - * is flushed to the browser at the end of the request. When - * callback is called, it will receive the - * contents of the output buffer as its parameter and is expected to - * return a new output buffer as a result, which will be sent to the - * browser. If the callback is not a - * callable function, this function will return FALSE. - * This is the callback signature: + * The signature of the callback is as follows: * * * stringhandler @@ -155,34 +222,26 @@ function ob_flush(): void * phase * * - * Bitmask of PHP_OUTPUT_HANDLER_* constants. + * Bitmask of * + * PHP_OUTPUT_HANDLER_* + * constants + * . + * See + * for more details. * * * * - * If callback returns FALSE original - * input is sent to the browser. * - * The callback parameter may be bypassed - * by passing a NULL value. + * If callback returns FALSE + * the contents of the buffer are returned. + * See + * for more details. * - * ob_end_clean, ob_end_flush, - * ob_clean, ob_flush and - * ob_start may not be called from a callback - * function. If you call them from callback function, the behavior is - * undefined. If you would like to delete the contents of a buffer, - * return "" (a null string) from callback function. - * You can't even call functions using the output buffering functions like - * print_r($expression, true) or - * highlight_file($filename, true) from a callback - * function. - * - * ob_gzhandler function exists to - * facilitate sending gz-encoded data to web browsers that support - * compressed web pages. ob_gzhandler determines - * what type of content encoding the browser will accept and will return - * its output accordingly. + * See + * and + * for more details on callbacks (output handlers). * @param int $chunk_size * @param int $flags * @throws OutcontrolException @@ -207,16 +266,28 @@ function ob_start($callback = null, int $chunk_size = 0, int $flags = PHP_OUTPUT /** - * This function adds another name/value pair to the URL rewrite mechanism. - * The name and value will be added to URLs (as GET parameter) and forms - * (as hidden input fields) the same way as the session ID when transparent - * URL rewriting is enabled with session.use_trans_sid. - * - * This function's behaviour is controlled by the url_rewriter.tags and - * url_rewriter.hosts php.ini - * parameters. - * - * Note that this function can be successfully called at most once per request. + * This function starts the 'URL-Rewriter' output buffer handler + * if it is not active, + * stores the name and value parameters, + * and when the buffer is flushed rewrites the URLs + * and forms based on the applicable ini settings. + * Subsequent calls to this function will store all additional name/value pairs + * until the handler is turned off. + * + * When the output buffer is flushed + * (by calling ob_flush, ob_end_flush, + * ob_get_flush or at the end of the script) + * the 'URL-Rewriter' handler adds the name/value pairs + * as query parameters to URLs in attributes of HTML tags + * and adds hidden fields to forms based on the values of the + * url_rewriter.tags and + * url_rewriter.hosts + * configuration directives. + * + * Each name/value pair added to the 'URL-Rewriter' handler + * is added to the URLs and/or forms + * even if this results in duplicate URL query parameters + * or elements with the same name attributes. * * @param string $name The variable name. * @param string $value The variable value. @@ -234,9 +305,8 @@ function output_add_rewrite_var(string $name, string $value): void /** - * This function resets the URL rewriter and removes all rewrite - * variables previously set by the output_add_rewrite_var - * function. + * This function removes all rewrite variables previously set by + * the output_add_rewrite_var function. * * @throws OutcontrolException * @@ -249,3 +319,4 @@ function output_reset_rewrite_vars(): void throw OutcontrolException::createFromPhpError(); } } + diff --git a/generated/pcntl.php b/generated/pcntl.php index ee593f80..8be458a8 100644 --- a/generated/pcntl.php +++ b/generated/pcntl.php @@ -19,7 +19,7 @@ * @throws PcntlException * */ -function pcntl_getpriority(int $process_id = null, int $mode = PRIO_PROCESS): int +function pcntl_getpriority(?int $process_id = null, int $mode = PRIO_PROCESS): int { error_clear_last(); if ($mode !== PRIO_PROCESS) { @@ -53,7 +53,7 @@ function pcntl_getpriority(int $process_id = null, int $mode = PRIO_PROCESS): in * @throws PcntlException * */ -function pcntl_setpriority(int $priority, int $process_id = null, int $mode = PRIO_PROCESS): void +function pcntl_setpriority(int $priority, ?int $process_id = null, int $mode = PRIO_PROCESS): void { error_clear_last(); if ($mode !== PRIO_PROCESS) { @@ -253,3 +253,4 @@ function pcntl_sigwaitinfo(array $signals, ?array &$info = []): int } return $safeResult; } + diff --git a/generated/pcre.php b/generated/pcre.php index b62f0777..3a9790a5 100644 --- a/generated/pcre.php +++ b/generated/pcre.php @@ -68,8 +68,8 @@ function preg_grep(string $pattern, array $array, int $flags = 0): array * ]]> * * - * So, $out[0] contains array of strings that matched full pattern, - * and $out[1] contains array of strings enclosed by tags. + * So, $out[0] contains an array of strings that matched the full pattern, + * and $out[1] contains an array of strings enclosed by tags. * * * @@ -209,15 +209,15 @@ function preg_grep(string $pattern, array $array, int $flags = 0): array * ]]> * * - * So, $out[0] contains array of strings that matched full pattern, - * and $out[1] contains array of strings enclosed by tags. + * So, $out[0] contains an array of strings that matched the full pattern, + * and $out[1] contains an array of strings enclosed by tags. * * * * The above example will output: * - * So, $out[0] contains array of strings that matched full pattern, - * and $out[1] contains array of strings enclosed by tags. + * So, $out[0] contains an array of strings that matched the full pattern, + * and $out[1] contains an array of strings enclosed by tags. * * If the pattern contains named subpatterns, $matches * additionally contains entries for keys with the subpattern name. @@ -339,15 +339,15 @@ function preg_grep(string $pattern, array $array, int $flags = 0): array * ]]> * * - * So, $out[0] contains array of strings that matched full pattern, - * and $out[1] contains array of strings enclosed by tags. + * So, $out[0] contains an array of strings that matched the full pattern, + * and $out[1] contains an array of strings enclosed by tags. * * * * The above example will output: * - * So, $out[0] contains array of strings that matched full pattern, - * and $out[1] contains array of strings enclosed by tags. + * So, $out[0] contains an array of strings that matched the full pattern, + * and $out[1] contains an array of strings enclosed by tags. * * If the pattern contains named subpatterns, $matches * additionally contains entries for keys with the subpattern name. @@ -683,3 +683,4 @@ function preg_split(string $pattern, string $subject, ?int $limit = -1, int $fla } return $safeResult; } + diff --git a/generated/pgsql.php b/generated/pgsql.php index 9968a5ae..1aa26b94 100644 --- a/generated/pgsql.php +++ b/generated/pgsql.php @@ -150,7 +150,7 @@ function pg_convert($connection, string $table_name, array $values, int $flags = * @throws PgsqlException * */ -function pg_copy_from($connection, string $table_name, array $rows, string $separator = "\t", string $null_as = "\\\\N"): void +function pg_copy_from($connection, string $table_name, array $rows, string $separator = "\t", string $null_as = "\\N"): void { error_clear_last(); $safeResult = \pg_copy_from($connection, $table_name, $rows, $separator, $null_as); @@ -175,7 +175,7 @@ function pg_copy_from($connection, string $table_name, array $rows, string $sepa * @throws PgsqlException * */ -function pg_copy_to($connection, string $table_name, string $separator = "\t", string $null_as = "\\\\N"): array +function pg_copy_to($connection, string $table_name, string $separator = "\t", string $null_as = "\\N"): array { error_clear_last(); $safeResult = \pg_copy_to($connection, $table_name, $separator, $null_as); @@ -297,7 +297,7 @@ function pg_end_copy($connection = null): void * @throws PgsqlException * */ -function pg_execute($connection = null, string $stmtname = null, array $params = null) +function pg_execute($connection = null, ?string $stmtname = null, ?array $params = null) { error_clear_last(); if ($params !== null) { @@ -542,7 +542,7 @@ function pg_lo_close($lob): void * @throws PgsqlException * */ -function pg_lo_export($connection = null, int $oid = null, string $pathname = null): void +function pg_lo_export($connection = null, ?int $oid = null, ?string $pathname = null): void { error_clear_last(); if ($pathname !== null) { @@ -584,7 +584,7 @@ function pg_lo_export($connection = null, int $oid = null, string $pathname = nu * @throws PgsqlException * */ -function pg_lo_import($connection = null, string $pathname = null, $object_id = null): int +function pg_lo_import($connection = null, ?string $pathname = null, $object_id = null): int { error_clear_last(); if ($object_id !== null) { @@ -748,7 +748,7 @@ function pg_lo_unlink($connection, int $oid): void * @throws PgsqlException * */ -function pg_lo_write($lob, string $data, int $length = null): int +function pg_lo_write($lob, string $data, ?int $length = null): int { error_clear_last(); if ($length !== null) { @@ -824,7 +824,7 @@ function pg_meta_data($connection, string $table_name, bool $extended = false): * @throws PgsqlException * */ -function pg_parameter_status($connection = null, string $param_name = null): string +function pg_parameter_status($connection = null, ?string $param_name = null): string { error_clear_last(); if ($param_name !== null) { @@ -935,13 +935,14 @@ function pg_ping($connection = null): void * create an unnamed statement, in which case any pre-existing unnamed * statement is automatically replaced; otherwise it is an error if the * statement name is already defined in the current session. If any parameters - * are used, they are referred to in the query as $1, $2, etc. + * are used, they are referred to in the query as $1, + * $2, etc. * * Prepared statements for use with pg_prepare can also be created by - * executing SQL PREPARE statements. (But pg_prepare is more flexible since it - * does not require parameter types to be pre-specified.) Also, although there - * is no PHP function for deleting a prepared statement, the SQL DEALLOCATE - * statement can be used for that purpose. + * executing SQL PREPARE statements. (But pg_prepare is + * more flexible since it does not require parameter types to be pre-specified.) Also, + * although there is no PHP function for deleting a prepared statement, the + * SQL DEALLOCATE statement can be used for that purpose. * * @param resource $connection An PgSql\Connection instance. * When connection is unspecified, the default connection is used. @@ -951,14 +952,14 @@ function pg_ping($connection = null): void * @param string $stmtname The name to give the prepared statement. Must be unique per-connection. If * "" is specified, then an unnamed statement is created, overwriting any * previously defined unnamed statement. - * @param string $query The parameterized SQL statement. Must contain only a single statement. - * (multiple statements separated by semi-colons are not allowed.) If any parameters + * @param string $query The parameterized SQL statement. Must contain only a single statement + * (multiple statements separated by semi-colons are not allowed). If any parameters * are used, they are referred to as $1, $2, etc. * @return resource An PgSql\Result instance on success. * @throws PgsqlException * */ -function pg_prepare($connection = null, string $stmtname = null, string $query = null) +function pg_prepare($connection = null, ?string $stmtname = null, ?string $query = null) { error_clear_last(); if ($query !== null) { @@ -1000,7 +1001,7 @@ function pg_prepare($connection = null, string $stmtname = null, string $query = * @throws PgsqlException * */ -function pg_put_line($connection = null, string $data = null): void +function pg_put_line($connection = null, ?string $data = null): void { error_clear_last(); if ($data !== null) { @@ -1067,7 +1068,7 @@ function pg_put_line($connection = null, string $data = null): void * @throws PgsqlException * */ -function pg_query_params($connection = null, string $query = null, array $params = null) +function pg_query_params($connection = null, ?string $query = null, ?array $params = null) { error_clear_last(); if ($params !== null) { @@ -1126,7 +1127,7 @@ function pg_query_params($connection = null, string $query = null, array $params * @throws PgsqlException * */ -function pg_query($connection = null, string $query = null) +function pg_query($connection = null, ?string $query = null) { error_clear_last(); if ($query !== null) { @@ -1211,10 +1212,16 @@ function pg_result_seek($result, int $row): void * array containing all records and fields that match the condition * specified by conditions. * - * If flags is specified, + * If flags is set, * pg_convert is applied to * conditions with the specified flags. * + * If mode is set, + * the return value will be in the form of an array + * with PGSQL_NUM, an associative array + * with PGSQL_ASSOC (default) or both + * with PGSQL_BOTH. + * * By default pg_select passes raw values. Values * must be escaped or PGSQL_DML_ESCAPE option must be * specified. PGSQL_DML_ESCAPE quotes and escapes @@ -1235,9 +1242,15 @@ function pg_result_seek($result, int $row): void * PGSQL_DML_EXEC, * PGSQL_DML_ASYNC or * PGSQL_DML_STRING combined. If PGSQL_DML_STRING is part of the - * flags then query string is returned. When PGSQL_DML_NO_CONV + * flags then the query string is returned. When PGSQL_DML_NO_CONV * or PGSQL_DML_ESCAPE is set, it does not call pg_convert internally. - * @param int $mode + * @param int $mode Any number of PGSQL_ASSOC, + * PGSQL_NUM or + * PGSQL_BOTH + * If PGSQL_ASSOC is set the return value will be an associative array, + * with PGSQL_NUM the return value will be an array, and + * with PGSQL_BOTH the return value will be both an associative and + * numerically indexed array. * @return mixed Returns string if PGSQL_DML_STRING is passed * via flags, otherwise it returns an array on success. * @throws PgsqlException @@ -1254,6 +1267,24 @@ function pg_select($connection, string $table_name, array $conditions, int $flag } +/** + * + * + * @param \PgSql\Connection $connection An PgSql\Connection instance. + * @param int $size + * @throws PgsqlException + * + */ +function pg_set_chunked_rows_size(\PgSql\Connection $connection, int $size): void +{ + error_clear_last(); + $safeResult = \pg_set_chunked_rows_size($connection, $size); + if ($safeResult === false) { + throw PgsqlException::createFromPhpError(); + } +} + + /** * pg_socket returns a read only resource * corresponding to the socket underlying the given PostgreSQL connection. @@ -1295,13 +1326,18 @@ function pg_socket($connection) * The default connection is the last connection made by pg_connect * or pg_pconnect. * As of PHP 8.1.0, using the default connection is deprecated. + * @param int $trace_mode An optional trace mode with the following constants + * PGSQL_TRACE_SUPPRESS_TIMESTAMPS and + * PGSQL_TRACE_REGRESS_MODE * @throws PgsqlException * */ -function pg_trace(string $filename, string $mode = "w", $connection = null): void +function pg_trace(string $filename, string $mode = "w", $connection = null, int $trace_mode = 0): void { error_clear_last(); - if ($connection !== null) { + if ($trace_mode !== 0) { + $safeResult = \pg_trace($filename, $mode, $connection, $trace_mode); + } elseif ($connection !== null) { $safeResult = \pg_trace($filename, $mode, $connection); } else { $safeResult = \pg_trace($filename, $mode); @@ -1358,3 +1394,4 @@ function pg_update($connection, string $table_name, array $values, array $condit } return $safeResult; } + diff --git a/generated/posix.php b/generated/posix.php index ea50d848..7992f578 100644 --- a/generated/posix.php +++ b/generated/posix.php @@ -30,11 +30,37 @@ function posix_access(string $filename, int $flags = 0): void } +/** + * posix_eaccess checks the effective user's permission of a file + * + * @param string $filename The name of a file to be tested. + * @param int $flags A mask consisting of one or more of POSIX_F_OK, + * POSIX_R_OK, POSIX_W_OK and + * POSIX_X_OK. + * + * POSIX_R_OK, POSIX_W_OK and + * POSIX_X_OK request checking whether the file + * exists and has read, write and execute permissions, respectively. + * POSIX_F_OK just requests checking for the + * existence of the file. + * @throws PosixException + * + */ +function posix_eaccess(string $filename, int $flags = 0): void +{ + error_clear_last(); + $safeResult = \posix_eaccess($filename, $flags); + if ($safeResult === false) { + throw PosixException::createFromPhpError(); + } +} + + /** * Gets information about a group provided its id. * * @param int $group_id The group id. - * @return array The array elements returned are: + * @return array{name: string, passwd: string, gid: int, members: array} The array elements returned are: * * The group information array * @@ -98,7 +124,7 @@ function posix_getgrgid(int $group_id): array * Gets information about a group provided its name. * * @param string $name The name of the group - * @return array Returns an array on success. + * @return array{name: string, passwd: string, gid: int, members: array} Returns an array on success. * The array elements returned are: * * The group information array @@ -200,7 +226,7 @@ function posix_getlogin(): string * referenced by the given user ID. * * @param int $user_id The user identifier. - * @return array Returns an associative array with the following elements: + * @return array{name: string, passwd: string, uid: int, gid: int, gecos: string, dir: string, shell: string} Returns an associative array with the following elements: * * The user information array * @@ -298,6 +324,8 @@ function posix_getpwuid(int $user_id): array * An unprivileged process may only set its soft limit to a value * from 0 to the hard limit, and irreversibly lower its hard limit. * + * @param $resource If NULL all resource limits will be fetched. + * Otherwise, the only limits of the resource type provided will be returned. * @return array Returns an associative array of elements for each * limit that is defined. Each limit has a soft and a hard limit. * @@ -386,10 +414,14 @@ function posix_getpwuid(int $user_id): array * @throws PosixException * */ -function posix_getrlimit(): array +function posix_getrlimit($resource = null): array { error_clear_last(); - $safeResult = \posix_getrlimit(); + if ($resource !== null) { + $safeResult = \posix_getrlimit($resource); + } else { + $safeResult = \posix_getrlimit(); + } if ($safeResult === false) { throw PosixException::createFromPhpError(); } @@ -731,3 +763,4 @@ function posix_uname(): array } return $safeResult; } + diff --git a/generated/ps.php b/generated/ps.php index 6ead054b..2a754355 100644 --- a/generated/ps.php +++ b/generated/ps.php @@ -778,7 +778,7 @@ function ps_fill($psdoc): void * @throws PsException * */ -function ps_get_parameter($psdoc, string $name, float $modifier = null): string +function ps_get_parameter($psdoc, string $name, ?float $modifier = null): string { error_clear_last(); if ($modifier !== null) { @@ -925,7 +925,7 @@ function ps_new() * @throws PsException * */ -function ps_open_file($psdoc, string $filename = null): void +function ps_open_file($psdoc, ?string $filename = null): void { error_clear_last(); if ($filename !== null) { @@ -1810,3 +1810,4 @@ function ps_translate($psdoc, float $x, float $y): void throw PsException::createFromPhpError(); } } + diff --git a/generated/pspell.php b/generated/pspell.php index 7ef3d259..1234737f 100644 --- a/generated/pspell.php +++ b/generated/pspell.php @@ -57,50 +57,6 @@ function pspell_clear_session(int $dictionary): void } -/** - * Create a config used to open a dictionary. - * - * pspell_config_create has a very similar syntax to - * pspell_new. In fact, using - * pspell_config_create immediately followed by - * pspell_new_config will produce the exact same result. - * However, after creating a new config, you can also use - * pspell_config_* functions before calling - * pspell_new_config to take advantage of some - * advanced functionality. - * - * For more information and examples, check out inline manual pspell - * website:http://aspell.net/. - * - * @param string $language The language parameter is the language code which consists of the - * two letter ISO 639 language code and an optional two letter ISO - * 3166 country code after a dash or underscore. - * @param string $spelling The spelling parameter is the requested spelling for languages - * with more than one spelling such as English. Known values are - * 'american', 'british', and 'canadian'. - * @param string $jargon The jargon parameter contains extra information to distinguish - * two different words lists that have the same language and - * spelling parameters. - * @param string $encoding The encoding parameter is the encoding that words are expected to - * be in. Valid values are 'utf-8', 'iso8859-*', 'koi8-r', - * 'viscii', 'cp1252', 'machine unsigned 16', 'machine unsigned - * 32'. This parameter is largely untested, so be careful when - * using. - * @return int Returns an PSpell\Config instance on success. - * @throws PspellException - * - */ -function pspell_config_create(string $language, string $spelling = "", string $jargon = "", string $encoding = ""): int -{ - error_clear_last(); - $safeResult = \pspell_config_create($language, $spelling, $jargon, $encoding); - if ($safeResult === false) { - throw PspellException::createFromPhpError(); - } - return $safeResult; -} - - /** * This function is * currently not documented; only its argument list is available. @@ -499,3 +455,4 @@ function pspell_store_replacement(int $dictionary, string $misspelled, string $c throw PspellException::createFromPhpError(); } } + diff --git a/generated/readline.php b/generated/readline.php index d8b82181..d735dde2 100644 --- a/generated/readline.php +++ b/generated/readline.php @@ -4,66 +4,6 @@ use Safe\Exceptions\ReadlineException; -/** - * This function adds a line to the command line history. - * - * @param string $prompt The line to be added in the history. - * @throws ReadlineException - * - */ -function readline_add_history(string $prompt): void -{ - error_clear_last(); - $safeResult = \readline_add_history($prompt); - if ($safeResult === false) { - throw ReadlineException::createFromPhpError(); - } -} - - -/** - * Sets up a readline callback interface then prints - * prompt and immediately returns. - * Calling this function twice without removing the previous - * callback interface will automatically and conveniently overwrite the old - * interface. - * - * The callback feature is useful when combined with - * stream_select as it allows interleaving of IO and - * user input, unlike readline. - * - * @param string $prompt The prompt message. - * @param callable $callback The callback function takes one parameter; the - * user input returned. - * @throws ReadlineException - * - */ -function readline_callback_handler_install(string $prompt, callable $callback): void -{ - error_clear_last(); - $safeResult = \readline_callback_handler_install($prompt, $callback); - if ($safeResult === false) { - throw ReadlineException::createFromPhpError(); - } -} - - -/** - * This function clears the entire command line history. - * - * @throws ReadlineException - * - */ -function readline_clear_history(): void -{ - error_clear_last(); - $safeResult = \readline_clear_history(); - if ($safeResult === false) { - throw ReadlineException::createFromPhpError(); - } -} - - /** * This function registers a completion function. This is the same kind of * functionality you'd get if you hit your tab key while using Bash. @@ -90,7 +30,7 @@ function readline_completion_function(callable $callback): void * @throws ReadlineException * */ -function readline_read_history(string $filename = null): void +function readline_read_history(?string $filename = null): void { error_clear_last(); if ($filename !== null) { @@ -111,7 +51,7 @@ function readline_read_history(string $filename = null): void * @throws ReadlineException * */ -function readline_write_history(string $filename = null): void +function readline_write_history(?string $filename = null): void { error_clear_last(); if ($filename !== null) { @@ -123,3 +63,4 @@ function readline_write_history(string $filename = null): void throw ReadlineException::createFromPhpError(); } } + diff --git a/generated/rpminfo.php b/generated/rpminfo.php index 2cd42fa6..1a6ba986 100644 --- a/generated/rpminfo.php +++ b/generated/rpminfo.php @@ -19,3 +19,4 @@ function rpmaddtag(int $tag): void throw RpminfoException::createFromPhpError(); } } + diff --git a/generated/rrd.php b/generated/rrd.php index c119df9b..1c342fa6 100644 --- a/generated/rrd.php +++ b/generated/rrd.php @@ -115,7 +115,7 @@ function rrd_lastupdate(string $filename): array * @throws RrdException * */ -function rrd_restore(string $xml_file, string $rrd_file, array $options = null): void +function rrd_restore(string $xml_file, string $rrd_file, ?array $options = null): void { error_clear_last(); if ($options !== null) { @@ -188,3 +188,4 @@ function rrd_xport(array $options): array } return $safeResult; } + diff --git a/generated/sem.php b/generated/sem.php index 86d0ae81..22b61caa 100644 --- a/generated/sem.php +++ b/generated/sem.php @@ -327,8 +327,8 @@ function msg_stat_queue($queue): array * @param resource $semaphore semaphore is a semaphore * obtained from sem_get. * @param bool $non_blocking Specifies if the process shouldn't wait for the semaphore to be acquired. - * If set to true, the call will return - * false immediately if a semaphore cannot be immediately + * If set to TRUE, the call will return + * FALSE immediately if a semaphore cannot be immediately * acquired. * @throws SemException * @@ -442,7 +442,7 @@ function sem_remove($semaphore): void * @throws SemException * */ -function shm_attach(int $key, int $size = null, int $permissions = 0666) +function shm_attach(int $key, ?int $size = null, int $permissions = 0666) { error_clear_last(); if ($permissions !== 0666) { @@ -543,3 +543,4 @@ function shm_remove($shm): void throw SemException::createFromPhpError(); } } + diff --git a/generated/session.php b/generated/session.php index 35e7f843..d837e9eb 100644 --- a/generated/session.php +++ b/generated/session.php @@ -37,8 +37,7 @@ function session_abort(): void * @param string $prefix If prefix is specified, new session id * is prefixed by prefix. Not all * characters are allowed within the session id. Characters in - * the range a-z A-Z 0-9 , (comma) and - - * (minus) are allowed. + * the range [a-zA-Z0-9,-] are allowed. Maximum length is 256 characters. * @return string session_create_id returns new collision free * session id for the current session. If it is used without active * session, it omits collision check. @@ -141,7 +140,7 @@ function session_encode(): string * session_start for that purpose. Depending on the * session handler, not all characters are allowed within the session id. * For example, the file session handler only allows characters in the - * range a-z A-Z 0-9 , (comma) and - (minus)! + * range [a-zA-Z0-9,-]! * @return string session_id returns the session id for the current * session or the empty string ("") if there is no current * session (no current session id exists). @@ -149,7 +148,7 @@ function session_encode(): string * @throws SessionException * */ -function session_id(string $id = null): string +function session_id(?string $id = null): string { error_clear_last(); if ($id !== null) { @@ -178,7 +177,7 @@ function session_id(string $id = null): string * @throws SessionException * */ -function session_module_name(string $module = null): string +function session_module_name(?string $module = null): string { error_clear_last(); if ($module !== null) { @@ -201,9 +200,9 @@ function session_module_name(string $module = null): string * * If a new session name is * supplied, session_name modifies the HTTP cookie - * (and output content when session.transid is - * enabled). Once the HTTP cookie is - * sent, session_name raises error. + * (and outputs the content when session.use_trans_sid is + * enabled). Once the HTTP cookie has been + * sent, calling session_name raises an E_WARNING. * session_name must be called * before session_start for the session to work * properly. @@ -235,7 +234,7 @@ function session_module_name(string $module = null): string * @throws SessionException * */ -function session_name(string $name = null): string +function session_name(?string $name = null): string { error_clear_last(); if ($name !== null) { @@ -304,19 +303,17 @@ function session_reset(): void * * * On some operating systems, you may want to specify a path on a - * filesystem that handles lots of small files efficiently. For example, - * on Linux, reiserfs may provide better performance than ext2fs. + * filesystem that handles lots of small files efficiently. * * * * On some operating systems, you may want to specify a path on a - * filesystem that handles lots of small files efficiently. For example, - * on Linux, reiserfs may provide better performance than ext2fs. + * filesystem that handles lots of small files efficiently. * @return string Returns the path of the current directory used for data storage. * @throws SessionException * */ -function session_save_path(string $path = null): string +function session_save_path(?string $path = null): string { error_clear_last(); if ($path !== null) { @@ -370,3 +367,4 @@ function session_write_close(): void throw SessionException::createFromPhpError(); } } + diff --git a/generated/shmop.php b/generated/shmop.php index 21bcd175..25d8d1f9 100644 --- a/generated/shmop.php +++ b/generated/shmop.php @@ -27,8 +27,11 @@ function shmop_delete($shmop): void * * @param resource $shmop The shared memory block identifier created by * shmop_open - * @param int $offset Offset from which to start reading - * @param int $size The number of bytes to read. + * @param int $offset Offset from which to start reading; must be greater than or equal to zero + * and less than or equal to the actual size of the shared memory segment. + * @param int $size The number of bytes to read; must be greater than or equal to zero, + * and the sum of offset and size + * must be less than or equal to the actual size of the shared memory segment. * 0 reads shmop_size($shmid) - $start bytes. * @return string Returns the data. * @throws ShmopException @@ -43,3 +46,4 @@ function shmop_read($shmop, int $offset, int $size): string } return $safeResult; } + diff --git a/generated/sockets.php b/generated/sockets.php index 0a0d36ad..d08fd8d5 100644 --- a/generated/sockets.php +++ b/generated/sockets.php @@ -69,7 +69,7 @@ function socket_addrinfo_bind($address) * Create a Socket instance, and connect it to the provided AddressInfo instance. The return * value of this function may be used with the rest of the socket functions. * - * @param resource $address AddressInfo instance created from socket_addrinfo_lookup + * @param resource $address AddressInfo instance created from socket_addrinfo_lookup. * @return resource|null Returns a Socket instance on success. * @throws SocketsException * @@ -94,7 +94,8 @@ function socket_addrinfo_connect($address) * Otherwise it designates a network service name, which is mapped to a port by the operating system. * @param array $hints Hints provide criteria for selecting addresses returned. You may specify the * hints as defined by getaddrinfo. - * @return resource[] Returns an array of AddressInfo instances that can be used with the other socket_addrinfo functions. + * @return resource[] Returns an array of AddressInfo instances that can be used with + * the socket_addrinfo_* family of functions. * On failure, FALSE is returned. * @throws SocketsException * @@ -116,10 +117,27 @@ function socket_addrinfo_lookup(string $host, $service = null, array $hints = [] } +/** + * Determines whether socket is at out-of-band mark. + * + * @param \Socket $socket A Socket instance created with socket_create. + * @throws SocketsException + * + */ +function socket_atmark(\Socket $socket): void +{ + error_clear_last(); + $safeResult = \socket_atmark($socket); + if ($safeResult === false) { + throw SocketsException::createFromPhpError(); + } +} + + /** * Binds the name given in address to the socket * described by socket. This has to be done before - * a connection is be established using socket_connect + * a connection is established using socket_connect * or socket_listen. * * @param resource $socket A Socket instance created with socket_create. @@ -167,7 +185,7 @@ function socket_bind($socket, string $address, int $port = 0): void * @throws SocketsException * */ -function socket_connect($socket, string $address, int $port = null): void +function socket_connect($socket, string $address, ?int $port = null): void { error_clear_last(); if ($port !== null) { @@ -203,7 +221,7 @@ function socket_connect($socket, string $address, int $port = null): void * @throws SocketsException * */ -function socket_create_listen(int $port, int $backlog = 128) +function socket_create_listen(int $port, int $backlog = SOMAXCONN) { error_clear_last(); $safeResult = \socket_create_listen($port, $backlog); @@ -652,7 +670,7 @@ function socket_sendmsg($socket, array $message, int $flags = 0): int * @throws SocketsException * */ -function socket_sendto($socket, string $data, int $length, int $flags, string $address, int $port = null): int +function socket_sendto($socket, string $data, int $length, int $flags, string $address, ?int $port = null): int { error_clear_last(); if ($port !== null) { @@ -851,3 +869,4 @@ function socket_wsaprotocol_info_release(string $info_id): void throw SocketsException::createFromPhpError(); } } + diff --git a/generated/sodium.php b/generated/sodium.php index b2ad105b..d111e0e5 100644 --- a/generated/sodium.php +++ b/generated/sodium.php @@ -4,6 +4,48 @@ use Safe\Exceptions\SodiumException; +/** + * + * + * @param string $ciphertext + * @param string $additional_data + * @param string $nonce + * @param string $key + * @return + * @throws SodiumException + * + */ +function sodium_crypto_aead_aegis128l_decrypt(string $ciphertext, string $additional_data, string $nonce, string $key): void +{ + error_clear_last(); + $safeResult = \sodium_crypto_aead_aegis128l_decrypt($ciphertext, $additional_data, $nonce, $key); + if ($safeResult === false) { + throw SodiumException::createFromPhpError(); + } +} + + +/** + * + * + * @param string $ciphertext + * @param string $additional_data + * @param string $nonce + * @param string $key + * @return + * @throws SodiumException + * + */ +function sodium_crypto_aead_aegis256_decrypt(string $ciphertext, string $additional_data, string $nonce, string $key): void +{ + error_clear_last(); + $safeResult = \sodium_crypto_aead_aegis256_decrypt($ciphertext, $additional_data, $nonce, $key); + if ($safeResult === false) { + throw SodiumException::createFromPhpError(); + } +} + + /** * Verify then decrypt with AES-256-GCM. * Only available if sodium_crypto_aead_aes256gcm_is_available returns TRUE. @@ -246,24 +288,6 @@ function sodium_crypto_box_seal_open(string $ciphertext, string $key_pair): stri } -/** - * Appends a message to the internal hash state. - * - * @param string $state The return value of sodium_crypto_generichash_init. - * @param string $message Data to append to the hashing state. - * @throws SodiumException - * - */ -function sodium_crypto_generichash_update(string &$state, string $message): void -{ - error_clear_last(); - $safeResult = \sodium_crypto_generichash_update($state, $message); - if ($safeResult === false) { - throw SodiumException::createFromPhpError(); - } -} - - /** * Decrypt an encrypted message with a symmetric (shared) key. * @@ -348,3 +372,4 @@ function sodium_crypto_stream_xchacha20_xor_ic(string $message, string $nonce, i } return $safeResult; } + diff --git a/generated/solr.php b/generated/solr.php index 0c4260a0..6b036ee8 100644 --- a/generated/solr.php +++ b/generated/solr.php @@ -20,3 +20,4 @@ function solr_get_version(): string } return $safeResult; } + diff --git a/generated/spl.php b/generated/spl.php index 2d692220..fa999f4a 100644 --- a/generated/spl.php +++ b/generated/spl.php @@ -9,7 +9,8 @@ * given object_or_class and its parents implement. * * @param object|string $object_or_class An object (class instance) or a string (class or interface name). - * @param bool $autoload Whether to call __autoload by default. + * @param bool $autoload Whether to autoload + * if not already loaded. * @return array An array on success, or FALSE when the given class doesn't exist. * @throws SplException * @@ -30,7 +31,8 @@ function class_implements($object_or_class, bool $autoload = true): array * the given object_or_class. * * @param object|string $object_or_class An object (class instance) or a string (class name). - * @param bool $autoload Whether to call __autoload by default. + * @param bool $autoload Whether to autoload + * if not already loaded. * @return array An array on success, or FALSE when the given class doesn't exist. * @throws SplException * @@ -52,7 +54,8 @@ function class_parents($object_or_class, bool $autoload = true): array * any traits used by a parent class. * * @param object|string $object_or_class An object (class instance) or a string (class name). - * @param bool $autoload Whether to call __autoload by default. + * @param bool $autoload Whether to autoload + * if not already loaded. * @return array An array on success, or FALSE when the given class doesn't exist. * @throws SplException * @@ -87,16 +90,24 @@ function class_uses($object_or_class, bool $autoload = true): array * @param callable(string):void $callback The autoload function being registered. * If NULL, then the default implementation of * spl_autoload will be registered. + * + * The class will not contain the leading + * backslash of a fully-qualified identifier. * @param bool $throw This parameter specifies whether * spl_autoload_register should throw * exceptions when the callback * cannot be registered. - * @param bool $prepend If true, spl_autoload_register will prepend + * + * This parameter is ignored as of PHP 8.0.0, and a notice will be + * emitted if set to FALSE. spl_autoload_register + * will now always throw a TypeError on invalid + * arguments. + * @param bool $prepend If TRUE, spl_autoload_register will prepend * the autoloader on the autoload queue instead of appending it. * @throws SplException * */ -function spl_autoload_register(callable $callback = null, bool $throw = true, bool $prepend = false): void +function spl_autoload_register(?callable $callback = null, bool $throw = true, bool $prepend = false): void { error_clear_last(); if ($prepend !== false) { @@ -134,3 +145,4 @@ function spl_autoload_unregister($callback): void throw SplException::createFromPhpError(); } } + diff --git a/generated/sqlsrv.php b/generated/sqlsrv.php index 33dd9124..f5a70e3f 100644 --- a/generated/sqlsrv.php +++ b/generated/sqlsrv.php @@ -251,7 +251,7 @@ function sqlsrv_free_stmt($stmt): void * @throws SqlsrvException * */ -function sqlsrv_get_field($stmt, int $fieldIndex, int $getAsType = null) +function sqlsrv_get_field($stmt, int $fieldIndex, ?int $getAsType = null) { error_clear_last(); if ($getAsType !== null) { @@ -357,7 +357,7 @@ function sqlsrv_num_rows($stmt): int * @throws SqlsrvException * */ -function sqlsrv_prepare($conn, string $sql, array $params = null, array $options = null) +function sqlsrv_prepare($conn, string $sql, ?array $params = null, ?array $options = null) { error_clear_last(); if ($options !== null) { @@ -394,7 +394,7 @@ function sqlsrv_prepare($conn, string $sql, array $params = null, array $options * @throws SqlsrvException * */ -function sqlsrv_query($conn, string $sql, array $params = null, array $options = null) +function sqlsrv_query($conn, string $sql, ?array $params = null, ?array $options = null) { error_clear_last(); if ($options !== null) { @@ -427,3 +427,4 @@ function sqlsrv_rollback($conn): void throw SqlsrvException::createFromPhpError(); } } + diff --git a/generated/ssdeep.php b/generated/ssdeep.php index 240b83b3..59e17c13 100644 --- a/generated/ssdeep.php +++ b/generated/ssdeep.php @@ -68,3 +68,4 @@ function ssdeep_fuzzy_hash(string $to_hash): string } return $safeResult; } + diff --git a/generated/ssh2.php b/generated/ssh2.php index edee699c..8c3ba31b 100644 --- a/generated/ssh2.php +++ b/generated/ssh2.php @@ -39,7 +39,7 @@ function ssh2_auth_agent($session, string $username): void * @throws Ssh2Exception * */ -function ssh2_auth_hostbased_file($session, string $username, string $hostname, string $pubkeyfile, string $privkeyfile, string $passphrase = null, string $local_username = null): void +function ssh2_auth_hostbased_file($session, string $username, string $hostname, string $pubkeyfile, string $privkeyfile, ?string $passphrase = null, ?string $local_username = null): void { error_clear_last(); if ($local_username !== null) { @@ -91,7 +91,7 @@ function ssh2_auth_password($session, string $username, string $password): void * @throws Ssh2Exception * */ -function ssh2_auth_pubkey_file($session, string $username, string $pubkeyfile, string $privkeyfile, string $passphrase = null): void +function ssh2_auth_pubkey_file($session, string $username, string $pubkeyfile, string $privkeyfile, ?string $passphrase = null): void { error_clear_last(); if ($passphrase !== null) { @@ -304,7 +304,7 @@ function ssh2_auth_pubkey_file($session, string $username, string $pubkeyfile, s * @throws Ssh2Exception * */ -function ssh2_connect(string $host, int $port = 22, array $methods = null, array $callbacks = null) +function ssh2_connect(string $host, int $port = 22, ?array $methods = null, ?array $callbacks = null) { error_clear_last(); if ($callbacks !== null) { @@ -357,7 +357,7 @@ function ssh2_disconnect($session): void * @throws Ssh2Exception * */ -function ssh2_exec($session, string $command, string $pty = null, array $env = null, int $width = 80, int $height = 25, int $width_height_type = SSH2_TERM_UNIT_CHARS) +function ssh2_exec($session, string $command, ?string $pty = null, ?array $env = null, int $width = 80, int $height = 25, int $width_height_type = SSH2_TERM_UNIT_CHARS) { error_clear_last(); if ($width_height_type !== SSH2_TERM_UNIT_CHARS) { @@ -388,14 +388,13 @@ function ssh2_exec($session, string $command, string $pty = null, array $env = n * @throws Ssh2Exception * */ -function ssh2_forward_accept($listener) +function ssh2_forward_accept($listener): void { error_clear_last(); $safeResult = \ssh2_forward_accept($listener); if ($safeResult === false) { throw Ssh2Exception::createFromPhpError(); } - return $safeResult; } @@ -410,7 +409,7 @@ function ssh2_forward_accept($listener) * @throws Ssh2Exception * */ -function ssh2_forward_listen($session, int $port, string $host = null, int $max_connections = 16) +function ssh2_forward_listen($session, int $port, ?string $host = null, int $max_connections = 16): void { error_clear_last(); if ($max_connections !== 16) { @@ -423,7 +422,6 @@ function ssh2_forward_listen($session, int $port, string $host = null, int $max_ if ($safeResult === false) { throw Ssh2Exception::createFromPhpError(); } - return $safeResult; } @@ -442,7 +440,7 @@ function ssh2_forward_listen($session, int $port, string $host = null, int $max_ * @throws Ssh2Exception * */ -function ssh2_publickey_add($pkey, string $algoname, string $blob, bool $overwrite = false, array $attributes = null): void +function ssh2_publickey_add($pkey, string $algoname, string $blob, bool $overwrite = false, ?array $attributes = null): void { error_clear_last(); if ($attributes !== null) { @@ -715,7 +713,7 @@ function ssh2_sftp($session) * * @param resource $session An SSH connection link identifier, obtained from a call to * ssh2_connect. - * @param string $term_type term_type should correspond to one of the + * @param string $termtype termtype should correspond to one of the * entries in the target system's /etc/termcap file. * @param array $env env may be passed as an associative array of * name/value pairs to set in the target environment. @@ -728,22 +726,23 @@ function ssh2_sftp($session) * @throws Ssh2Exception * */ -function ssh2_shell($session, string $term_type = "vanilla", array $env = null, int $width = 80, int $height = 25, int $width_height_type = SSH2_TERM_UNIT_CHARS) +function ssh2_shell($session, string $termtype = "vanilla", ?array $env = null, int $width = 80, int $height = 25, int $width_height_type = SSH2_TERM_UNIT_CHARS) { error_clear_last(); if ($width_height_type !== SSH2_TERM_UNIT_CHARS) { - $safeResult = \ssh2_shell($session, $term_type, $env, $width, $height, $width_height_type); + $safeResult = \ssh2_shell($session, $termtype, $env, $width, $height, $width_height_type); } elseif ($height !== 25) { - $safeResult = \ssh2_shell($session, $term_type, $env, $width, $height); + $safeResult = \ssh2_shell($session, $termtype, $env, $width, $height); } elseif ($width !== 80) { - $safeResult = \ssh2_shell($session, $term_type, $env, $width); + $safeResult = \ssh2_shell($session, $termtype, $env, $width); } elseif ($env !== null) { - $safeResult = \ssh2_shell($session, $term_type, $env); + $safeResult = \ssh2_shell($session, $termtype, $env); } else { - $safeResult = \ssh2_shell($session, $term_type); + $safeResult = \ssh2_shell($session, $termtype); } if ($safeResult === false) { throw Ssh2Exception::createFromPhpError(); } return $safeResult; } + diff --git a/generated/stream.php b/generated/stream.php index e025221c..41670433 100644 --- a/generated/stream.php +++ b/generated/stream.php @@ -4,6 +4,33 @@ use Safe\Exceptions\StreamException; +/** + * Sets options on the specified context. + * + * @param resource $context The stream or context resource to apply the options to. + * @param array $options The options to set for context. + * + * options must be an associative + * array of associative arrays in the format + * $array['wrapper']['option'] = $value. + * + * Refer to context options and parameters + * for a listing of stream options. + * @return true Returns TRUE on success. + * @throws StreamException + * + */ +function stream_context_set_options($context, array $options): true +{ + error_clear_last(); + $safeResult = \stream_context_set_options($context, $options); + if ($safeResult === false) { + throw StreamException::createFromPhpError(); + } + return $safeResult; +} + + /** * Sets parameters on the specified context. * @@ -39,7 +66,7 @@ function stream_context_set_params($context, array $params): void * @throws StreamException * */ -function stream_copy_to_stream($from, $to, int $length = null, int $offset = 0): int +function stream_copy_to_stream($from, $to, ?int $length = null, int $offset = 0): int { error_clear_last(); if ($offset !== 0) { @@ -87,7 +114,7 @@ function stream_copy_to_stream($from, $to, int $length = null, int $offset = 0): * @throws StreamException * */ -function stream_filter_append($stream, string $filtername, int $read_write = null, $params = null) +function stream_filter_append($stream, string $filtername, ?int $read_write = null, $params = null) { error_clear_last(); if ($params !== null) { @@ -136,7 +163,7 @@ function stream_filter_append($stream, string $filtername, int $read_write = nul * @throws StreamException * */ -function stream_filter_prepend($stream, string $filtername, int $read_write = null, $params = null) +function stream_filter_prepend($stream, string $filtername, ?int $read_write = null, $params = null) { error_clear_last(); if ($params !== null) { @@ -218,7 +245,7 @@ function stream_filter_remove($stream_filter): void * @throws StreamException * */ -function stream_get_contents($stream, int $length = null, int $offset = -1): string +function stream_get_contents($stream, ?int $length = null, int $offset = -1): string { error_clear_last(); if ($offset !== -1) { @@ -376,7 +403,7 @@ function stream_set_timeout($stream, int $seconds, int $microseconds = 0): void * @throws StreamException * */ -function stream_socket_accept($socket, float $timeout = null, ?string &$peer_name = null) +function stream_socket_accept($socket, ?float $timeout = null, ?string &$peer_name = null) { error_clear_last(); if ($peer_name !== null) { @@ -443,7 +470,7 @@ function stream_socket_accept($socket, float $timeout = null, ?string &$peer_nam * @throws StreamException * */ -function stream_socket_client(string $address, ?int &$error_code = null, ?string &$error_message = null, float $timeout = null, int $flags = STREAM_CLIENT_CONNECT, $context = null) +function stream_socket_client(string $address, ?int &$error_code = null, ?string &$error_message = null, ?float $timeout = null, int $flags = STREAM_CLIENT_CONNECT, $context = null) { error_clear_last(); if ($context !== null) { @@ -762,3 +789,4 @@ function stream_wrapper_unregister(string $protocol): void throw StreamException::createFromPhpError(); } } + diff --git a/generated/strings.php b/generated/strings.php index 9d2db754..69d79ec9 100644 --- a/generated/strings.php +++ b/generated/strings.php @@ -86,3 +86,4 @@ function sha1_file(string $filename, bool $binary = false): string } return $safeResult; } + diff --git a/generated/swoole.php b/generated/swoole.php index 510e6377..1baff324 100644 --- a/generated/swoole.php +++ b/generated/swoole.php @@ -54,7 +54,7 @@ function swoole_async_readfile(string $filename, string $callback): void * @throws SwooleException * */ -function swoole_async_write(string $filename, string $content, int $offset = null, callable $callback = null): void +function swoole_async_write(string $filename, string $content, ?int $offset = null, ?callable $callback = null): void { error_clear_last(); if ($callback !== null) { @@ -80,7 +80,7 @@ function swoole_async_write(string $filename, string $content, int $offset = nul * @throws SwooleException * */ -function swoole_async_writefile(string $filename, string $content, callable $callback = null, int $flags = 0): void +function swoole_async_writefile(string $filename, string $content, ?callable $callback = null, int $flags = 0): void { error_clear_last(); if ($flags !== 0) { @@ -146,3 +146,4 @@ function swoole_event_write(int $fd, string $data): void throw SwooleException::createFromPhpError(); } } + diff --git a/generated/uodbc.php b/generated/uodbc.php index df6a9afa..d396f679 100644 --- a/generated/uodbc.php +++ b/generated/uodbc.php @@ -10,246 +10,29 @@ * By default, auto-commit is on for a connection. Disabling * auto-commit is equivalent with starting a transaction. * - * @param resource $odbc The ODBC connection identifier, + * @param resource $odbc The ODBC connection object, * see odbc_connect for details. * @param bool $enable If enable is TRUE, auto-commit is enabled, if * it is FALSE auto-commit is disabled. - * @return mixed Without the enable parameter, this function returns + * If NULL is passed, this function returns the auto-commit status for + * odbc. + * @return mixed With a NULL enable parameter, this function returns * auto-commit status for odbc. Non-zero is * returned if auto-commit is on, 0 if it is off, or FALSE if an error * occurs. * - * If enable is set, this function returns TRUE on + * If enable is non-null, this function returns TRUE on * success. * @throws UodbcException * */ -function odbc_autocommit($odbc, bool $enable = false) +function odbc_autocommit($odbc, ?bool $enable = null) { error_clear_last(); - $safeResult = \odbc_autocommit($odbc, $enable); - if ($safeResult === false) { - throw UodbcException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Controls handling of binary column data. ODBC SQL types affected are - * BINARY, VARBINARY, and - * LONGVARBINARY. - * The default mode can be set using the - * uodbc.defaultbinmode php.ini directive. - * - * When binary SQL data is converted to character C data (ODBC_BINMODE_CONVERT), each byte - * (8 bits) of source data is represented as two ASCII characters. - * These characters are the ASCII character representation of the - * number in its hexadecimal form. For example, a binary - * 00000001 is converted to - * "01" and a binary 11111111 - * is converted to "FF". - * - * While the handling of BINARY and VARBINARY - * columns only depend on the binmode, the handling of LONGVARBINARY - * columns also depends on the longreadlen as well: - * - * LONGVARBINARY handling - * - * - * - * binmode - * longreadlen - * result - * - * - * - * - * ODBC_BINMODE_PASSTHRU - * 0 - * passthru - * - * - * ODBC_BINMODE_RETURN - * 0 - * passthru - * - * - * ODBC_BINMODE_CONVERT - * 0 - * passthru - * - * - * ODBC_BINMODE_PASSTHRU - * >0 - * passthru - * - * - * ODBC_BINMODE_RETURN - * >0 - * return as is - * - * - * ODBC_BINMODE_CONVERT - * >0 - * return as char - * - * - * - * - * - * If odbc_fetch_into is used, passthru means that an - * empty string is returned for these columns. - * If odbc_result is used, passthru means that the data are - * sent directly to the client (i.e. printed). - * - * @param int $statement The result identifier. - * - * If statement is 0, the - * settings apply as default for new results. - * @param int $mode Possible values for mode are: - * - * - * - * ODBC_BINMODE_PASSTHRU: Passthru BINARY data - * - * - * - * - * ODBC_BINMODE_RETURN: Return as is - * - * - * - * - * ODBC_BINMODE_CONVERT: Convert to char and return - * - * - * - * - * - * Handling of binary long - * columns is also affected by odbc_longreadlen. - * - * - * @throws UodbcException - * - */ -function odbc_binmode(int $statement, int $mode): void -{ - error_clear_last(); - $safeResult = \odbc_binmode($statement, $mode); - if ($safeResult === false) { - throw UodbcException::createFromPhpError(); - } -} - - -/** - * Lists columns and associated privileges for the given table. - * - * @param resource $odbc The ODBC connection identifier, - * see odbc_connect for details. - * @param string $catalog The catalog ('qualifier' in ODBC 2 parlance). - * @param string $schema The schema ('owner' in ODBC 2 parlance). - * This parameter accepts the following search patterns: - * % to match zero or more characters, - * and _ to match a single character. - * @param string $table The table name. - * This parameter accepts the following search patterns: - * % to match zero or more characters, - * and _ to match a single character. - * @param string $column The column name. - * This parameter accepts the following search patterns: - * % to match zero or more characters, - * and _ to match a single character. - * @return resource Returns an ODBC result identifier. - * This result identifier can be used to fetch a list of columns and - * associated privileges. - * - * The result set has the following columns: - * - * TABLE_CAT - * TABLE_SCHEM - * TABLE_NAME - * COLUMN_NAME - * GRANTOR - * GRANTEE - * PRIVILEGE - * IS_GRANTABLE - * - * Drivers can report additional columns. - * @throws UodbcException - * - */ -function odbc_columnprivileges($odbc, string $catalog, string $schema, string $table, string $column) -{ - error_clear_last(); - $safeResult = \odbc_columnprivileges($odbc, $catalog, $schema, $table, $column); - if ($safeResult === false) { - throw UodbcException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Lists all columns in the requested range. - * - * @param resource $odbc The ODBC connection identifier, - * see odbc_connect for details. - * @param string $catalog The catalog ('qualifier' in ODBC 2 parlance). - * @param string $schema The schema ('owner' in ODBC 2 parlance). - * This parameter accepts the following search patterns: - * % to match zero or more characters, - * and _ to match a single character. - * @param string $table The table name. - * This parameter accepts the following search patterns: - * % to match zero or more characters, - * and _ to match a single character. - * @param string $column The column name. - * This parameter accepts the following search patterns: - * % to match zero or more characters, - * and _ to match a single character. - * @return resource Returns an ODBC result identifier. - * - * The result set has the following columns: - * - * TABLE_CAT - * TABLE_SCHEM - * TABLE_NAME - * COLUMN_NAME - * DATA_TYPE - * TYPE_NAME - * COLUMN_SIZE - * BUFFER_LENGTH - * DECIMAL_DIGITS - * NUM_PREC_RADIX - * NULLABLE - * REMARKS - * COLUMN_DEF - * SQL_DATA_TYPE - * SQL_DATETIME_SUB - * CHAR_OCTET_LENGTH - * ORDINAL_POSITION - * IS_NULLABLE - * - * Drivers can report additional columns. - * @throws UodbcException - * - */ -function odbc_columns($odbc, string $catalog = null, string $schema = null, string $table = null, string $column = null) -{ - error_clear_last(); - if ($column !== null) { - $safeResult = \odbc_columns($odbc, $catalog, $schema, $table, $column); - } elseif ($table !== null) { - $safeResult = \odbc_columns($odbc, $catalog, $schema, $table); - } elseif ($schema !== null) { - $safeResult = \odbc_columns($odbc, $catalog, $schema); - } elseif ($catalog !== null) { - $safeResult = \odbc_columns($odbc, $catalog); + if ($enable !== null) { + $safeResult = \odbc_autocommit($odbc, $enable); } else { - $safeResult = \odbc_columns($odbc); + $safeResult = \odbc_autocommit($odbc); } if ($safeResult === false) { throw UodbcException::createFromPhpError(); @@ -261,7 +44,7 @@ function odbc_columns($odbc, string $catalog = null, string $schema = null, stri /** * Commits all pending transactions on the connection. * - * @param resource $odbc The ODBC connection identifier, + * @param resource $odbc The ODBC connection object, * see odbc_connect for details. * @throws UodbcException * @@ -322,7 +105,7 @@ function odbc_connect(string $dsn, string $user, string $password, int $cursor_o /** * Gets the cursorname for the given result_id. * - * @param resource $statement The result identifier. + * @param resource $statement The ODBC result object. * @return string Returns the cursor name, as a string. * @throws UodbcException * @@ -342,7 +125,7 @@ function odbc_cursor($statement): string * This function will return the list of available DSN (after calling it * several times). * - * @param resource $odbc The ODBC connection identifier, + * @param resource $odbc The ODBC connection object, * see odbc_connect for details. * @param int $fetch_type The fetch_type can be one of two constant types: * SQL_FETCH_FIRST, SQL_FETCH_NEXT. @@ -367,10 +150,10 @@ function odbc_data_source($odbc, int $fetch_type): array /** * Sends an SQL statement to the database server. * - * @param resource $odbc The ODBC connection identifier, + * @param resource $odbc The ODBC connection object, * see odbc_connect for details. * @param string $query The SQL statement. - * @return resource Returns an ODBC result identifier if the SQL command was executed + * @return resource Returns an ODBC result object if the SQL command was executed * successfully. * @throws UodbcException * @@ -389,7 +172,7 @@ function odbc_exec($odbc, string $query) /** * Executes a statement prepared with odbc_prepare. * - * @param resource $statement The result id resource, from odbc_prepare. + * @param resource $statement The ODBC result object from odbc_prepare. * @param array $params Parameters in params will be * substituted for placeholders in the prepared statement in order. * Elements of this array will be converted to strings by calling this @@ -415,7 +198,7 @@ function odbc_execute($statement, array $params = []): void /** * Fetch one result row into array. * - * @param resource $statement The result resource. + * @param resource $statement The ODBC result object. * @param array|null $array The result array * that can be of any type since it will be converted to type * array. The array will contain the column values starting at array @@ -426,10 +209,14 @@ function odbc_execute($statement, array $params = []): void * @throws UodbcException * */ -function odbc_fetch_into($statement, ?array &$array, int $row = 0): int +function odbc_fetch_into($statement, ?array &$array, ?int $row = null): int { error_clear_last(); - $safeResult = \odbc_fetch_into($statement, $array, $row); + if ($row !== null) { + $safeResult = \odbc_fetch_into($statement, $array, $row); + } else { + $safeResult = \odbc_fetch_into($statement, $array); + } if ($safeResult === false) { throw UodbcException::createFromPhpError(); } @@ -441,7 +228,7 @@ function odbc_fetch_into($statement, ?array &$array, int $row = 0): int * Gets the length of the field referenced by number in the given result * identifier. * - * @param resource $statement The result identifier. + * @param resource $statement The ODBC result object. * @param int $field The field number. Field numbering starts at 1. * @return int Returns the field length. * @throws UodbcException @@ -460,9 +247,9 @@ function odbc_field_len($statement, int $field): int /** * Gets the name of the field occupying the given column number in the given - * result identifier. + * result object. * - * @param resource $statement The result identifier. + * @param resource $statement The ODBC result object. * @param int $field The field number. Field numbering starts at 1. * @return string Returns the field name as a string. * @throws UodbcException @@ -481,9 +268,9 @@ function odbc_field_name($statement, int $field): string /** * Gets the number of the column slot that corresponds to the named field in - * the given result identifier. + * the given result object. * - * @param resource $statement The result identifier. + * @param resource $statement The ODBC result object. * @param string $field The field name. * @return int Returns the field number as a integer. * Field numbering starts at 1. @@ -505,7 +292,7 @@ function odbc_field_num($statement, string $field): int * Gets the scale of the field referenced by number in the given result * identifier. * - * @param resource $statement The result identifier. + * @param resource $statement The ODBC result object. * @param int $field The field number. Field numbering starts at 1. * @return int Returns the field scale as a integer. * @throws UodbcException @@ -526,7 +313,7 @@ function odbc_field_scale($statement, int $field): int * Gets the SQL type of the field referenced by number in the given result * identifier. * - * @param resource $statement The result identifier. + * @param resource $statement The ODBC result object. * @param int $field The field number. Field numbering starts at 1. * @return string Returns the field type as a string. * @throws UodbcException @@ -543,118 +330,6 @@ function odbc_field_type($statement, int $field): string } -/** - * Retrieves a list of foreign keys in the specified table or a list of - * foreign keys in other tables that refer to the primary key in the - * specified table - * - * @param resource $odbc The ODBC connection identifier, - * see odbc_connect for details. - * @param string $pk_catalog The catalog ('qualifier' in ODBC 2 parlance) of the primary key table. - * @param string $pk_schema The schema ('owner' in ODBC 2 parlance) of the primary key table. - * @param string $pk_table The primary key table. - * @param string $fk_catalog The catalog ('qualifier' in ODBC 2 parlance) of the foreign key table. - * @param string $fk_schema The schema ('owner' in ODBC 2 parlance) of the foreign key table. - * @param string $fk_table The foreign key table. - * @return resource Returns an ODBC result identifier. - * - * The result set has the following columns: - * - * PKTABLE_CAT - * PKTABLE_SCHEM - * PKTABLE_NAME - * PKCOLUMN_NAME - * FKTABLE_CAT - * FKTABLE_SCHEM - * FKTABLE_NAME - * FKCOLUMN_NAME - * KEY_SEQ - * UPDATE_RULE - * DELETE_RULE - * FK_NAME - * PK_NAME - * DEFERRABILITY - * - * Drivers can report additional columns. - * @throws UodbcException - * - */ -function odbc_foreignkeys($odbc, string $pk_catalog, string $pk_schema, string $pk_table, string $fk_catalog, string $fk_schema, string $fk_table) -{ - error_clear_last(); - $safeResult = \odbc_foreignkeys($odbc, $pk_catalog, $pk_schema, $pk_table, $fk_catalog, $fk_schema, $fk_table); - if ($safeResult === false) { - throw UodbcException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Retrieves information about data types supported by the data source. - * - * @param resource $odbc The ODBC connection identifier, - * see odbc_connect for details. - * @param int $data_type The data type, which can be used to restrict the information to a - * single data type. - * @return resource Returns an ODBC result identifier. - * - * The result set has the following columns: - * - * TYPE_NAME - * DATA_TYPE - * PRECISION - * LITERAL_PREFIX - * LITERAL_SUFFIX - * CREATE_PARAMS - * NULLABLE - * CASE_SENSITIVE - * SEARCHABLE - * UNSIGNED_ATTRIBUTE - * MONEY - * AUTO_INCREMENT - * LOCAL_TYPE_NAME - * MINIMUM_SCALE - * MAXIMUM_SCALE - * - * - * The result set is ordered by DATA_TYPE and TYPE_NAME. - * @throws UodbcException - * - */ -function odbc_gettypeinfo($odbc, int $data_type = 0) -{ - error_clear_last(); - $safeResult = \odbc_gettypeinfo($odbc, $data_type); - if ($safeResult === false) { - throw UodbcException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Controls handling of LONG, LONGVARCHAR and LONGVARBINARY columns. - * The default length can be set using the - * uodbc.defaultlrl php.ini directive. - * - * @param resource $statement The result identifier. - * @param int $length The number of bytes returned to PHP is controlled by the parameter - * length. If it is set to 0, long column data is passed through to the - * client (i.e. printed) when retrieved with odbc_result. - * @throws UodbcException - * - */ -function odbc_longreadlen($statement, int $length): void -{ - error_clear_last(); - $safeResult = \odbc_longreadlen($statement, $length); - if ($safeResult === false) { - throw UodbcException::createFromPhpError(); - } -} - - /** * Opens a persistent database connection. * @@ -672,7 +347,6 @@ function odbc_longreadlen($statement, int $length): void * @param string $password * @param int $cursor_option * @return resource Returns an ODBC connection. - * error. * @throws UodbcException * */ @@ -688,7 +362,7 @@ function odbc_pconnect(string $dsn, string $user, string $password, int $cursor_ /** - * Prepares a statement for execution. The result identifier can be used + * Prepares a statement for execution. The ODBC result object can be used * later to execute the statement with odbc_execute. * * Some databases (such as IBM DB2, MS SQL Server, and Oracle) support @@ -696,10 +370,10 @@ function odbc_pconnect(string $dsn, string $user, string $password, int $cursor_ * defined by the ODBC specification. However, the Unified ODBC driver * currently only supports parameters of type IN to stored procedures. * - * @param resource $odbc The ODBC connection identifier, + * @param resource $odbc The ODBC connection object, * see odbc_connect for details. * @param string $query The query string statement being prepared. - * @return resource Returns an ODBC result identifier if the SQL command was prepared + * @return resource Returns an ODBC result object if the SQL command was prepared * successfully. * @throws UodbcException * @@ -715,114 +389,10 @@ function odbc_prepare($odbc, string $query) } -/** - * Returns a result identifier that can be used to fetch the column names - * that comprise the primary key for a table. - * - * @param resource $odbc The ODBC connection identifier, - * see odbc_connect for details. - * @param string $catalog The catalog ('qualifier' in ODBC 2 parlance). - * @param string $schema The schema ('owner' in ODBC 2 parlance). - * @param string $table - * @return resource Returns an ODBC result identifier. - * - * The result set has the following columns: - * - * TABLE_CAT - * TABLE_SCHEM - * TABLE_NAME - * COLUMN_NAME - * KEY_SEQ - * PK_NAME - * - * Drivers can report additional columns. - * @throws UodbcException - * - */ -function odbc_primarykeys($odbc, string $catalog, string $schema, string $table) -{ - error_clear_last(); - $safeResult = \odbc_primarykeys($odbc, $catalog, $schema, $table); - if ($safeResult === false) { - throw UodbcException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Retrieve information about parameters to procedures. - * - * @param $odbc The ODBC connection identifier, - * see odbc_connect for details. - * @param string $catalog The catalog ('qualifier' in ODBC 2 parlance). - * @param string $schema The schema ('owner' in ODBC 2 parlance). - * This parameter accepts the following search patterns: - * % to match zero or more characters, - * and _ to match a single character. - * @param string $procedure The proc. - * This parameter accepts the following search patterns: - * % to match zero or more characters, - * and _ to match a single character. - * @param string $column The column. - * This parameter accepts the following search patterns: - * % to match zero or more characters, - * and _ to match a single character. - * @return resource Returns the list of input and output parameters, as well as the - * columns that make up the result set for the specified procedures. - * Returns an ODBC result identifier. - * - * The result set has the following columns: - * - * PROCEDURE_CAT - * PROCEDURE_SCHEM - * PROCEDURE_NAME - * COLUMN_NAME - * COLUMN_TYPE - * DATA_TYPE - * TYPE_NAME - * COLUMN_SIZE - * BUFFER_LENGTH - * DECIMAL_DIGITS - * NUM_PREC_RADIX - * NULLABLE - * REMARKS - * COLUMN_DEF - * SQL_DATA_TYPE - * SQL_DATETIME_SUB - * CHAR_OCTET_LENGTH - * ORDINAL_POSITION - * IS_NULLABLE - * - * Drivers can report additional columns. - * @throws UodbcException - * - */ -function odbc_procedurecolumns($odbc, string $catalog = null, string $schema = null, string $procedure = null, string $column = null) -{ - error_clear_last(); - if ($column !== null) { - $safeResult = \odbc_procedurecolumns($odbc, $catalog, $schema, $procedure, $column); - } elseif ($procedure !== null) { - $safeResult = \odbc_procedurecolumns($odbc, $catalog, $schema, $procedure); - } elseif ($schema !== null) { - $safeResult = \odbc_procedurecolumns($odbc, $catalog, $schema); - } elseif ($catalog !== null) { - $safeResult = \odbc_procedurecolumns($odbc, $catalog); - } else { - $safeResult = \odbc_procedurecolumns($odbc); - } - if ($safeResult === false) { - throw UodbcException::createFromPhpError(); - } - return $safeResult; -} - - /** * Lists all procedures in the requested range. * - * @param $odbc The ODBC connection identifier, + * @param $odbc The ODBC connection object, * see odbc_connect for details. * @param string $catalog The catalog ('qualifier' in ODBC 2 parlance). * @param string $schema The schema ('owner' in ODBC 2 parlance). @@ -833,8 +403,7 @@ function odbc_procedurecolumns($odbc, string $catalog = null, string $schema = n * This parameter accepts the following search patterns: * % to match zero or more characters, * and _ to match a single character. - * @return resource Returns an ODBC - * result identifier containing the information. + * @return resource Returns an ODBC result object containing the information. * * The result set has the following columns: * @@ -851,7 +420,7 @@ function odbc_procedurecolumns($odbc, string $catalog = null, string $schema = n * @throws UodbcException * */ -function odbc_procedures($odbc, string $catalog = null, string $schema = null, string $procedure = null) +function odbc_procedures($odbc, ?string $catalog = null, ?string $schema = null, ?string $procedure = null) { error_clear_last(); if ($procedure !== null) { @@ -871,14 +440,14 @@ function odbc_procedures($odbc, string $catalog = null, string $schema = null, s /** - * Prints all rows from a result identifier produced by + * Prints all rows from a result object produced by * odbc_exec. The result is printed in HTML table format. * The data is not escaped. * * This function is not supposed to be used in production environments; it is * merely meant for development purposes, to get a result set quickly rendered. * - * @param resource $statement The result identifier. + * @param resource $statement The ODBC result object. * @param string $format Additional overall table formatting. * @return int Returns the number of rows in the result. * @throws UodbcException @@ -898,7 +467,7 @@ function odbc_result_all($statement, string $format = ""): int /** * Get result data * - * @param resource $statement The ODBC resource. + * @param resource $statement The ODBC result object. * @param mixed $field The field name being retrieved. It can either be an integer containing * the column number of the field you want; or it can be a string * containing the name of the field. @@ -921,7 +490,7 @@ function odbc_result($statement, $field) /** * Rolls back all pending statements on the connection. * - * @param resource $odbc The ODBC connection identifier, + * @param resource $odbc The ODBC connection object, * see odbc_connect for details. * @throws UodbcException * @@ -976,138 +545,6 @@ function odbc_setoption($odbc, int $which, int $option, int $value): void } -/** - * Retrieves either the optimal set of columns that uniquely identifies a - * row in the table, or columns that are automatically updated when any - * value in the row is updated by a transaction. - * - * @param resource $odbc The ODBC connection identifier, - * see odbc_connect for details. - * @param int $type - * @param string $catalog The catalog ('qualifier' in ODBC 2 parlance). - * @param string $schema The schema ('owner' in ODBC 2 parlance). - * @param string $table The table. - * @param int $scope The scope, which orders the result set. - * One of SQL_SCOPE_CURROW, SQL_SCOPE_TRANSACTION - * or SQL_SCOPE_SESSION. - * @param int $nullable Determines whether to return special columns that can have a NULL value. - * One of SQL_NO_NULLS or SQL_NULLABLE . - * @return resource Returns an ODBC result identifier. - * - * The result set has the following columns: - * - * SCOPE - * COLUMN_NAME - * DATA_TYPE - * TYPE_NAME - * COLUMN_SIZE - * BUFFER_LENGTH - * DECIMAL_DIGITS - * PSEUDO_COLUMN - * - * Drivers can report additional columns. - * @throws UodbcException - * - */ -function odbc_specialcolumns($odbc, int $type, string $catalog, string $schema, string $table, int $scope, int $nullable) -{ - error_clear_last(); - $safeResult = \odbc_specialcolumns($odbc, $type, $catalog, $schema, $table, $scope, $nullable); - if ($safeResult === false) { - throw UodbcException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Get statistics about a table and its indexes. - * - * @param resource $odbc The ODBC connection identifier, - * see odbc_connect for details. - * @param string $catalog The catalog ('qualifier' in ODBC 2 parlance). - * @param string $schema The schema ('owner' in ODBC 2 parlance). - * @param string $table The table name. - * @param int $unique The type of the index. - * One of SQL_INDEX_UNIQUE or SQL_INDEX_ALL. - * @param int $accuracy One of SQL_ENSURE or SQL_QUICK. - * The latter requests that the driver retrieve the CARDINALITY and - * PAGES only if they are readily available from the server. - * @return resource Returns an ODBC result identifier. - * - * The result set has the following columns: - * - * TABLE_CAT - * TABLE_SCHEM - * TABLE_NAME - * NON_UNIQUE - * INDEX_QUALIFIER - * INDEX_NAME - * TYPE - * ORDINAL_POSITION - * COLUMN_NAME - * ASC_OR_DESC - * CARDINALITY - * PAGES - * FILTER_CONDITION - * - * Drivers can report additional columns. - * @throws UodbcException - * - */ -function odbc_statistics($odbc, string $catalog, string $schema, string $table, int $unique, int $accuracy) -{ - error_clear_last(); - $safeResult = \odbc_statistics($odbc, $catalog, $schema, $table, $unique, $accuracy); - if ($safeResult === false) { - throw UodbcException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Lists tables in the requested range and the privileges associated - * with each table. - * - * @param resource $odbc The ODBC connection identifier, - * see odbc_connect for details. - * @param string $catalog The catalog ('qualifier' in ODBC 2 parlance). - * @param string $schema The schema ('owner' in ODBC 2 parlance). - * This parameter accepts the following search patterns: - * % to match zero or more characters, - * and _ to match a single character. - * @param string $table The name. - * This parameter accepts the following search patterns: - * % to match zero or more characters, - * and _ to match a single character. - * @return resource An ODBC result identifier. - * - * The result set has the following columns: - * - * TABLE_CAT - * TABLE_SCHEM - * TABLE_NAME - * GRANTOR - * GRANTEE - * PRIVILEGE - * IS_GRANTABLE - * - * Drivers can report additional columns. - * @throws UodbcException - * - */ -function odbc_tableprivileges($odbc, string $catalog, string $schema, string $table) -{ - error_clear_last(); - $safeResult = \odbc_tableprivileges($odbc, $catalog, $schema, $table); - if ($safeResult === false) { - throw UodbcException::createFromPhpError(); - } - return $safeResult; -} - - /** * Lists all tables in the requested range. * @@ -1149,7 +586,7 @@ function odbc_tableprivileges($odbc, string $catalog, string $schema, string $ta * * * - * @param resource $odbc The ODBC connection identifier, + * @param resource $odbc The ODBC connection object, * see odbc_connect for details. * @param string $catalog The catalog ('qualifier' in ODBC 2 parlance). * @param string $schema The schema ('owner' in ODBC 2 parlance). @@ -1167,7 +604,7 @@ function odbc_tableprivileges($odbc, string $catalog, string $schema, string $ta * data source does not support a specified table type, * odbc_tables does not return any results for * that type. - * @return resource Returns an ODBC result identifier containing the information. + * @return resource Returns an ODBC result object containing the information. * * The result set has the following columns: * @@ -1181,7 +618,7 @@ function odbc_tableprivileges($odbc, string $catalog, string $schema, string $ta * @throws UodbcException * */ -function odbc_tables($odbc, string $catalog = null, string $schema = null, string $table = null, string $types = null) +function odbc_tables($odbc, ?string $catalog = null, ?string $schema = null, ?string $table = null, ?string $types = null) { error_clear_last(); if ($types !== null) { @@ -1200,3 +637,4 @@ function odbc_tables($odbc, string $catalog = null, string $schema = null, strin } return $safeResult; } + diff --git a/generated/uopz.php b/generated/uopz.php index 17d2e760..55747d74 100644 --- a/generated/uopz.php +++ b/generated/uopz.php @@ -38,3 +38,4 @@ function uopz_implement(string $class, string $interface): void throw UopzException::createFromPhpError(); } } + diff --git a/generated/url.php b/generated/url.php index 96c37b95..18589aec 100644 --- a/generated/url.php +++ b/generated/url.php @@ -202,3 +202,4 @@ function parse_url(string $url, int $component = -1) } return $safeResult; } + diff --git a/generated/var.php b/generated/var.php index 70f048df..3488603e 100644 --- a/generated/var.php +++ b/generated/var.php @@ -58,3 +58,4 @@ function settype(&$var, string $type): void throw VarException::createFromPhpError(); } } + diff --git a/generated/xdiff.php b/generated/xdiff.php index 785b2278..931644e2 100644 --- a/generated/xdiff.php +++ b/generated/xdiff.php @@ -219,7 +219,7 @@ function xdiff_string_patch_binary(string $str, string $patch): string * @throws XdiffException * */ -function xdiff_string_patch(string $str, string $patch, int $flags = null, ?string &$error = null): string +function xdiff_string_patch(string $str, string $patch, ?int $flags = null, ?string &$error = null): string { error_clear_last(); if ($error !== null) { @@ -234,3 +234,4 @@ function xdiff_string_patch(string $str, string $patch, int $flags = null, ?stri } return $safeResult; } + diff --git a/generated/xml.php b/generated/xml.php index 26f3f01d..6afe29d4 100644 --- a/generated/xml.php +++ b/generated/xml.php @@ -22,695 +22,80 @@ function xml_parser_free($parser): void /** - * Sets the character data handler function for the XML parser - * parser. + * Sets an option in an XML parser. * - * @param resource $parser A reference to the XML parser to set up character data handler function. - * @param callable $handler handler is a string containing the name of a - * function that must exist when xml_parse is called - * for parser. + * @param resource $parser A reference to the XML parser to set an option in. + * @param int $option Which option to set. See below. * - * The function named by handler must accept - * two parameters: + * The following options are available: * - * handler - * XMLParserparser - * stringdata + * XML parser options * * * - * parser + * Option constant + * Data type + * Description * * - * The first parameter, parser, is a - * reference to the XML parser calling the handler. * * + * XML_OPTION_CASE_FOLDING + * bool * + * Controls whether case-folding is enabled for this + * XML parser. Enabled by default. * - * data * * - * The second parameter, data, contains - * the character data as a string. + * XML_OPTION_PARSE_HUGE + * bool * + * Allows parsing documents larger than 10 MB. + * This option should only be enabled when the document size is + * bounded because this could otherwise lead to a DoS. + * This option is only available when using libxml2. * * * + * XML_OPTION_SKIP_TAGSTART + * integer * - * Character data handler is called for every piece of a text in the XML - * document. It can be called multiple times inside each fragment (e.g. - * for non-ASCII strings). + * Specify how many characters should be skipped in the beginning of a + * tag name. * - * If a handler function is set to an empty string, or FALSE, the handler - * in question is disabled. - * @throws XmlException - * - */ -function xml_set_character_data_handler($parser, callable $handler): void -{ - error_clear_last(); - $safeResult = \xml_set_character_data_handler($parser, $handler); - if ($safeResult === false) { - throw XmlException::createFromPhpError(); - } -} - - -/** - * Sets the default handler function for the XML parser - * parser. - * - * @param resource $parser A reference to the XML parser to set up default handler function. - * @param callable $handler handler is a string containing the name of a - * function that must exist when xml_parse is called - * for parser. - * - * The function named by handler must accept - * two parameters: - * - * handler - * XMLParserparser - * stringdata - * - * - * - * - * parser - * - * - * - * The first parameter, parser, is a - * reference to the XML parser calling the handler. - * - * - * - * - * - * data - * - * - * - * The second parameter, data, contains - * the character data.This may be the XML declaration, - * document type declaration, entities or other data for which - * no other handler exists. - * - * - * - * - * - * If a handler function is set to an empty string, or FALSE, the handler - * in question is disabled. - * @throws XmlException - * - */ -function xml_set_default_handler($parser, callable $handler): void -{ - error_clear_last(); - $safeResult = \xml_set_default_handler($parser, $handler); - if ($safeResult === false) { - throw XmlException::createFromPhpError(); - } -} - - -/** - * Sets the element handler functions for the XML parser. - * start_handler and - * end_handler are strings containing - * the names of functions that must exist when xml_parse - * is called for parser. - * - * @param resource $parser A reference to the XML parser to set up start and end element handler functions. - * @param callable $start_handler The function named by start_handler - * must accept three parameters: - * - * start_element_handler - * XMLParserparser - * stringname - * arrayattribs - * - * - * - * parser - * - * - * The first parameter, parser, is a - * reference to the XML parser calling the handler. - * - * - * - * - * name - * - * - * The second parameter, name, contains the name - * of the element for which this handler is called.If case-folding is in effect for this - * parser, the element name will be in uppercase letters. - * - * - * - * - * attribs - * - * - * The third parameter, attribs, contains an - * associative array with the element's attributes (if any).The keys - * of this array are the attribute names, the values are the attribute - * values.Attribute names are case-folded on the same criteria as - * element names.Attribute values are not - * case-folded. - * - * - * The original order of the attributes can be retrieved by walking - * through attribs the normal way, using - * each.The first key in the array was the first - * attribute, and so on. - * - * - * - * - * @param callable $end_handler - * @throws XmlException - * - */ -function xml_set_element_handler($parser, callable $start_handler, callable $end_handler): void -{ - error_clear_last(); - $safeResult = \xml_set_element_handler($parser, $start_handler, $end_handler); - if ($safeResult === false) { - throw XmlException::createFromPhpError(); - } -} - - -/** - * Set a handler to be called when leaving the scope of a namespace - * declaration. This will be called, for each namespace declaration, after - * the handler for the end tag of the element in which the namespace was - * declared. - * - * @param resource $parser A reference to the XML parser. - * @param callable $handler handler is a string containing the name of a - * function that must exist when xml_parse is called - * for parser. - * - * The function named by handler must accept - * two parameters, and should return an integer value. If the - * value returned from the handler is FALSE (which it will be if no - * value is returned), the XML parser will stop parsing and - * xml_get_error_code will return - * XML_ERROR_EXTERNAL_ENTITY_HANDLING. - * - * handler - * XMLParserparser - * stringprefix * * + * XML_OPTION_SKIP_WHITE + * bool * - * parser + * Whether to skip values consisting of whitespace characters. * * - * The first parameter, parser, is a - * reference to the XML parser calling the handler. * + * XML_OPTION_TARGET_ENCODING + * string * + * Sets which target encoding to + * use in this XML parser.By default, it is set to the same as the + * source encoding used by xml_parser_create. + * Supported target encodings are ISO-8859-1, + * US-ASCII and UTF-8. * * - * prefix * * - * The prefix is a string used to reference the namespace within an XML object. * - * - * - * - * - * If a handler function is set to an empty string, or FALSE, the handler - * in question is disabled. + * @param mixed $value The option's new value. * @throws XmlException * */ -function xml_set_end_namespace_decl_handler($parser, callable $handler): void +function xml_parser_set_option($parser, int $option, $value): void { error_clear_last(); - $safeResult = \xml_set_end_namespace_decl_handler($parser, $handler); + $safeResult = \xml_parser_set_option($parser, $option, $value); if ($safeResult === false) { throw XmlException::createFromPhpError(); } } - -/** - * Sets the external entity reference handler function for the XML parser - * parser. - * - * @param resource $parser A reference to the XML parser to set up external entity reference handler function. - * @param callable $handler handler is a string containing the name of a - * function that must exist when xml_parse is called - * for parser. - * - * The function named by handler must accept - * five parameters, and should return an integer value.If the - * value returned from the handler is FALSE (which it will be if no - * value is returned), the XML parser will stop parsing and - * xml_get_error_code will return - * XML_ERROR_EXTERNAL_ENTITY_HANDLING. - * - * handler - * XMLParserparser - * stringopen_entity_names - * stringbase - * stringsystem_id - * stringpublic_id - * - * - * - * parser - * - * - * The first parameter, parser, is a - * reference to the XML parser calling the handler. - * - * - * - * - * open_entity_names - * - * - * The second parameter, open_entity_names, is a - * space-separated list of the names of the entities that are open for - * the parse of this entity (including the name of the referenced - * entity). - * - * - * - * - * base - * - * - * This is the base for resolving the system identifier - * (system_id) of the external entity.Currently - * this parameter will always be set to an empty string. - * - * - * - * - * system_id - * - * - * The fourth parameter, system_id, is the - * system identifier as specified in the entity declaration. - * - * - * - * - * public_id - * - * - * The fifth parameter, public_id, is the - * public identifier as specified in the entity declaration, or - * an empty string if none was specified; the whitespace in the - * public identifier will have been normalized as required by - * the XML spec. - * - * - * - * - * - * If a handler function is set to an empty string, or FALSE, the handler - * in question is disabled. - * @throws XmlException - * - */ -function xml_set_external_entity_ref_handler($parser, callable $handler): void -{ - error_clear_last(); - $safeResult = \xml_set_external_entity_ref_handler($parser, $handler); - if ($safeResult === false) { - throw XmlException::createFromPhpError(); - } -} - - -/** - * Sets the notation declaration handler function for the XML parser - * parser. - * - * A notation declaration is part of the document's DTD and has the - * following format: - * - * name - * { systemId | publicId?> - * ]]> - * - * See section 4.7 of the XML 1.0 - * spec for the definition of notation declarations. - * - * @param resource $parser A reference to the XML parser to set up notation declaration handler function. - * @param callable $handler handler is a string containing the name of a - * function that must exist when xml_parse is called - * for parser. - * - * The function named by handler must accept - * five parameters: - * - * handler - * XMLParserparser - * stringnotation_name - * stringbase - * stringsystem_id - * stringpublic_id - * - * - * - * - * parser - * - * - * - * The first parameter, parser, is a - * reference to the XML parser calling the handler. - * - * - * - * - * notation_name - * - * - * This is the notation's name, as per - * the notation format described above. - * - * - * - * - * - * base - * - * - * - * This is the base for resolving the system identifier - * (system_id) of the notation declaration. - * Currently this parameter will always be set to an empty string. - * - * - * - * - * system_id - * - * - * System identifier of the external notation declaration. - * - * - * - * - * - * public_id - * - * - * - * Public identifier of the external notation declaration. - * - * - * - * - * - * If a handler function is set to an empty string, or FALSE, the handler - * in question is disabled. - * @throws XmlException - * - */ -function xml_set_notation_decl_handler($parser, callable $handler): void -{ - error_clear_last(); - $safeResult = \xml_set_notation_decl_handler($parser, $handler); - if ($safeResult === false) { - throw XmlException::createFromPhpError(); - } -} - - -/** - * This function allows to use parser inside - * object. All callback functions could be set with - * xml_set_element_handler etc and assumed to be - * methods of object. - * - * @param resource $parser A reference to the XML parser to use inside the object. - * @param object $object The object where to use the XML parser. - * @throws XmlException - * - */ -function xml_set_object($parser, object $object): void -{ - error_clear_last(); - $safeResult = \xml_set_object($parser, $object); - if ($safeResult === false) { - throw XmlException::createFromPhpError(); - } -} - - -/** - * Sets the processing instruction (PI) handler function for the XML parser - * parser. - * - * A processing instruction has the following format: - * - * <?target - * data?> - * - * - * You can put PHP code into such a tag, but be aware of one limitation: in - * an XML PI, the PI end tag (?>) can not be quoted, - * so this character sequence should not appear in the PHP code you embed - * with PIs in XML documents.If it does, the rest of the PHP code, as well - * as the "real" PI end tag, will be treated as character data. - * - * @param resource $parser A reference to the XML parser to set up processing instruction (PI) handler function. - * @param callable $handler handler is a string containing the name of a - * function that must exist when xml_parse is called - * for parser. - * - * The function named by handler must accept - * three parameters: - * - * handler - * XMLParserparser - * stringtarget - * stringdata - * - * - * - * parser - * - * - * The first parameter, parser, is a - * reference to the XML parser calling the handler. - * - * - * - * - * target - * - * - * The second parameter, target, contains the PI - * target. - * - * - * - * - * data - * - * - * The third parameter, data, contains the PI - * data. - * - * - * - * - * - * If a handler function is set to an empty string, or FALSE, the handler - * in question is disabled. - * @throws XmlException - * - */ -function xml_set_processing_instruction_handler($parser, callable $handler): void -{ - error_clear_last(); - $safeResult = \xml_set_processing_instruction_handler($parser, $handler); - if ($safeResult === false) { - throw XmlException::createFromPhpError(); - } -} - - -/** - * Set a handler to be called when a namespace is declared. Namespace - * declarations occur inside start tags. But the namespace declaration start - * handler is called before the start tag handler for each namespace declared - * in that start tag. - * - * @param resource $parser A reference to the XML parser. - * @param callable $handler handler is a string containing the name of a - * function that must exist when xml_parse is called - * for parser. - * - * The function named by handler must accept - * three parameters, and should return an integer value. If the - * value returned from the handler is FALSE (which it will be if no - * value is returned), the XML parser will stop parsing and - * xml_get_error_code will return - * XML_ERROR_EXTERNAL_ENTITY_HANDLING. - * - * handler - * XMLParserparser - * stringprefix - * stringuri - * - * - * - * parser - * - * - * The first parameter, parser, is a - * reference to the XML parser calling the handler. - * - * - * - * - * prefix - * - * - * The prefix is a string used to reference the namespace within an XML object. - * - * - * - * - * uri - * - * - * Uniform Resource Identifier (URI) of namespace. - * - * - * - * - * - * If a handler function is set to an empty string, or FALSE, the handler - * in question is disabled. - * @throws XmlException - * - */ -function xml_set_start_namespace_decl_handler($parser, callable $handler): void -{ - error_clear_last(); - $safeResult = \xml_set_start_namespace_decl_handler($parser, $handler); - if ($safeResult === false) { - throw XmlException::createFromPhpError(); - } -} - - -/** - * Sets the unparsed entity declaration handler function for the XML parser - * parser. - * - * The handler will be called if the XML parser - * encounters an external entity declaration with an NDATA declaration, like - * the following: - * - * name {publicId | systemId} - * NDATA notationName - * ]]> - * - * - * See section 4.2.2 of - * the XML 1.0 spec for the definition of notation declared - * external entities. - * - * @param resource $parser A reference to the XML parser to set up unparsed entity declaration handler function. - * @param callable $handler handler is a string containing the name of a - * function that must exist when xml_parse is called - * for parser. - * - * The function named by handler must accept six - * parameters: - * - * handler - * XMLParserparser - * stringentity_name - * stringbase - * stringsystem_id - * stringpublic_id - * stringnotation_name - * - * - * - * parser - * - * - * The first parameter, parser, is a - * reference to the XML parser calling the - * handler. - * - * - * - * - * entity_name - * - * - * The name of the entity that is about to be defined. - * - * - * - * - * base - * - * - * This is the base for resolving the system identifier - * (systemId) of the external entity.Currently - * this parameter will always be set to an empty string. - * - * - * - * - * system_id - * - * - * System identifier for the external entity. - * - * - * - * - * public_id - * - * - * Public identifier for the external entity. - * - * - * - * - * notation_name - * - * - * Name of the notation of this entity (see - * xml_set_notation_decl_handler). - * - * - * - * - * - * If a handler function is set to an empty string, or FALSE, the handler - * in question is disabled. - * @throws XmlException - * - */ -function xml_set_unparsed_entity_decl_handler($parser, callable $handler): void -{ - error_clear_last(); - $safeResult = \xml_set_unparsed_entity_decl_handler($parser, $handler); - if ($safeResult === false) { - throw XmlException::createFromPhpError(); - } -} diff --git a/generated/xmlrpc.php b/generated/xmlrpc.php index 3a1f5362..38ac3766 100644 --- a/generated/xmlrpc.php +++ b/generated/xmlrpc.php @@ -20,3 +20,4 @@ function xmlrpc_set_type(&$value, string $type): void throw XmlrpcException::createFromPhpError(); } } + diff --git a/generated/yaml.php b/generated/yaml.php index ba518e9e..2a3c537d 100644 --- a/generated/yaml.php +++ b/generated/yaml.php @@ -16,14 +16,14 @@ * tag => callable mappings. See * parse callbacks for more * details. - * @return mixed Returns the value encoded in input in appropriate + * @return mixed Returns the value encoded in filename in appropriate * PHP type. If pos is -1 an * array will be returned with one entry for each document found * in the stream. * @throws YamlException * */ -function yaml_parse_file(string $filename, int $pos = 0, ?int &$ndocs = null, array $callbacks = null) +function yaml_parse_file(string $filename, int $pos = 0, ?int &$ndocs = null, ?array $callbacks = null) { error_clear_last(); if ($callbacks !== null) { @@ -52,15 +52,15 @@ function yaml_parse_file(string $filename, int $pos = 0, ?int &$ndocs = null, ar * number of documents found in stream. * @param array $callbacks Content handlers for YAML nodes. Associative array of YAML * tag => callable mappings. See - * parse callbacks for more - * @return mixed Returns the value encoded in input in appropriate + * parse callbacks for more details. + * @return mixed Returns the value encoded in url in appropriate * PHP type. If pos is * -1 an array will be returned with one entry * for each document found in the stream. * @throws YamlException * */ -function yaml_parse_url(string $url, int $pos = 0, ?int &$ndocs = null, array $callbacks = null) +function yaml_parse_url(string $url, int $pos = 0, ?int &$ndocs = null, ?array $callbacks = null) { error_clear_last(); if ($callbacks !== null) { @@ -94,7 +94,7 @@ function yaml_parse_url(string $url, int $pos = 0, ?int &$ndocs = null, array $c * @throws YamlException * */ -function yaml_parse(string $input, int $pos = 0, ?int &$ndocs = null, array $callbacks = null) +function yaml_parse(string $input, int $pos = 0, ?int &$ndocs = null, ?array $callbacks = null) { error_clear_last(); if ($callbacks !== null) { @@ -107,3 +107,4 @@ function yaml_parse(string $input, int $pos = 0, ?int &$ndocs = null, array $cal } return $safeResult; } + diff --git a/generated/yaz.php b/generated/yaz.php index 4730dd0b..ef2136c7 100644 --- a/generated/yaz.php +++ b/generated/yaz.php @@ -427,7 +427,7 @@ function yaz_search($id, string $type, string $query): void * @throws YazException * */ -function yaz_wait(array &$options = null) +function yaz_wait(?array &$options = null) { error_clear_last(); $safeResult = \yaz_wait($options); @@ -436,3 +436,4 @@ function yaz_wait(array &$options = null) } return $safeResult; } + diff --git a/generated/zip.php b/generated/zip.php index d1a628eb..7ce2263b 100644 --- a/generated/zip.php +++ b/generated/zip.php @@ -142,3 +142,4 @@ function zip_entry_read($zip_entry, int $len = 1024): string } return $safeResult; } + diff --git a/generated/zlib.php b/generated/zlib.php index daa555ab..0c01cf1a 100644 --- a/generated/zlib.php +++ b/generated/zlib.php @@ -298,7 +298,7 @@ function gzfile(string $filename, int $use_include_path = 0): array * @throws ZlibException * */ -function gzgets($stream, int $length = null): string +function gzgets($stream, ?int $length = null): string { error_clear_last(); if ($length !== null) { @@ -327,7 +327,7 @@ function gzgets($stream, int $length = null): string * @throws ZlibException * */ -function gzgetss($zp, int $length, string $allowable_tags = null): string +function gzgetss($zp, int $length, ?string $allowable_tags = null): string { error_clear_last(); if ($allowable_tags !== null) { @@ -403,28 +403,6 @@ function gzopen(string $filename, string $mode, int $use_include_path = 0) } -/** - * Reads to EOF on the given gz-file pointer from the current position and - * writes the (uncompressed) results to standard output. - * - * @param resource $stream The gz-file pointer. It must be valid, and must point to a file - * successfully opened by gzopen. - * @return int The number of uncompressed characters read from gz - * and passed through to the input. - * @throws ZlibException - * - */ -function gzpassthru($stream): int -{ - error_clear_last(); - $safeResult = \gzpassthru($stream); - if ($safeResult === false) { - throw ZlibException::createFromPhpError(); - } - return $safeResult; -} - - /** * gzread reads up to length bytes * from the given gz-file pointer. Reading stops when @@ -508,7 +486,7 @@ function gzuncompress(string $data, int $max_length = 0): string * @throws ZlibException * */ -function gzwrite($stream, string $data, int $length = null): int +function gzwrite($stream, string $data, ?int $length = null): int { error_clear_last(); if ($length !== null) { @@ -542,25 +520,6 @@ function inflate_get_read_len($context): int } -/** - * Usually returns either ZLIB_OK or ZLIB_STREAM_END. - * - * @param resource $context - * @return int Returns decompression status. - * @throws ZlibException - * - */ -function inflate_get_status($context): int -{ - error_clear_last(); - $safeResult = \inflate_get_status($context); - if ($safeResult === false) { - throw ZlibException::createFromPhpError(); - } - return $safeResult; -} - - /** * Incrementally inflates encoded data in the specified context. * @@ -719,3 +678,4 @@ function zlib_decode(string $data, int $max_length = 0): string } return $safeResult; } + diff --git a/rector-migrate.php b/rector-migrate.php index 8bd9d7bd..8d3758b4 100644 --- a/rector-migrate.php +++ b/rector-migrate.php @@ -11,8 +11,6 @@ RenameFunctionRector::class,[ 'apache_getenv' => 'Safe\apache_getenv', 'apache_get_version' => 'Safe\apache_get_version', 'apache_lookup_uri' => 'Safe\apache_lookup_uri', - 'apache_request_headers' => 'Safe\apache_request_headers', - 'apache_response_headers' => 'Safe\apache_response_headers', 'apache_setenv' => 'Safe\apache_setenv', 'apcu_cache_info' => 'Safe\apcu_cache_info', 'apcu_cas' => 'Safe\apcu_cas', @@ -21,8 +19,7 @@ 'apcu_inc' => 'Safe\apcu_inc', 'apcu_sma_info' => 'Safe\apcu_sma_info', 'apc_fetch' => 'Safe\apc_fetch', - 'array_walk_recursive' => 'Safe\array_walk_recursive', - 'assert_options' => 'Safe\assert_options', + 'array_all' => 'Safe\array_all', 'base64_decode' => 'Safe\base64_decode', 'bindtextdomain' => 'Safe\bindtextdomain', 'bzclose' => 'Safe\bzclose', @@ -39,7 +36,6 @@ 'class_parents' => 'Safe\class_parents', 'class_uses' => 'Safe\class_uses', 'cli_set_process_title' => 'Safe\cli_set_process_title', - 'closelog' => 'Safe\closelog', 'com_create_guid' => 'Safe\com_create_guid', 'com_event_sink' => 'Safe\com_event_sink', 'com_load_typelib' => 'Safe\com_load_typelib', @@ -107,19 +103,16 @@ 'curl_getinfo' => 'Safe\curl_getinfo', 'curl_init' => 'Safe\curl_init', 'curl_multi_info_read' => 'Safe\curl_multi_info_read', - 'curl_multi_init' => 'Safe\curl_multi_init', 'curl_multi_setopt' => 'Safe\curl_multi_setopt', 'curl_setopt' => 'Safe\curl_setopt', - 'curl_share_errno' => 'Safe\curl_share_errno', 'curl_share_setopt' => 'Safe\curl_share_setopt', 'curl_unescape' => 'Safe\curl_unescape', 'curl_upkeep' => 'Safe\curl_upkeep', - 'date' => 'Safe\date', - 'date_parse' => 'Safe\date_parse', + 'date_create' => 'Safe\date_create', + 'date_create_immutable' => 'Safe\date_create_immutable', 'date_parse_from_format' => 'Safe\date_parse_from_format', 'date_sunrise' => 'Safe\date_sunrise', 'date_sunset' => 'Safe\date_sunset', - 'date_sun_info' => 'Safe\date_sun_info', 'db2_autocommit' => 'Safe\db2_autocommit', 'db2_bind_param' => 'Safe\db2_bind_param', 'db2_client_info' => 'Safe\db2_client_info', @@ -129,6 +122,7 @@ 'db2_free_result' => 'Safe\db2_free_result', 'db2_free_stmt' => 'Safe\db2_free_stmt', 'db2_get_option' => 'Safe\db2_get_option', + 'db2_num_rows' => 'Safe\db2_num_rows', 'db2_pclose' => 'Safe\db2_pclose', 'db2_rollback' => 'Safe\db2_rollback', 'db2_server_info' => 'Safe\db2_server_info', @@ -202,6 +196,7 @@ 'finfo_open' => 'Safe\finfo_open', 'flock' => 'Safe\flock', 'fopen' => 'Safe\fopen', + 'fpm_get_status' => 'Safe\fpm_get_status', 'fputcsv' => 'Safe\fputcsv', 'fread' => 'Safe\fread', 'fsockopen' => 'Safe\fsockopen', @@ -221,6 +216,7 @@ 'ftp_login' => 'Safe\ftp_login', 'ftp_mkdir' => 'Safe\ftp_mkdir', 'ftp_mlsd' => 'Safe\ftp_mlsd', + 'ftp_nb_get' => 'Safe\ftp_nb_get', 'ftp_nb_put' => 'Safe\ftp_nb_put', 'ftp_nlist' => 'Safe\ftp_nlist', 'ftp_pasv' => 'Safe\ftp_pasv', @@ -234,7 +230,6 @@ 'ftp_systype' => 'Safe\ftp_systype', 'ftruncate' => 'Safe\ftruncate', 'fwrite' => 'Safe\fwrite', - 'getallheaders' => 'Safe\getallheaders', 'getcwd' => 'Safe\getcwd', 'gethostname' => 'Safe\gethostname', 'getimagesize' => 'Safe\getimagesize', @@ -252,8 +247,6 @@ 'get_include_path' => 'Safe\get_include_path', 'get_meta_tags' => 'Safe\get_meta_tags', 'glob' => 'Safe\glob', - 'gmmktime' => 'Safe\gmmktime', - 'gmp_random_seed' => 'Safe\gmp_random_seed', 'gmstrftime' => 'Safe\gmstrftime', 'gnupg_adddecryptkey' => 'Safe\gnupg_adddecryptkey', 'gnupg_addencryptkey' => 'Safe\gnupg_addencryptkey', @@ -274,17 +267,14 @@ 'gzgetss' => 'Safe\gzgetss', 'gzinflate' => 'Safe\gzinflate', 'gzopen' => 'Safe\gzopen', - 'gzpassthru' => 'Safe\gzpassthru', 'gzread' => 'Safe\gzread', 'gzrewind' => 'Safe\gzrewind', 'gzuncompress' => 'Safe\gzuncompress', 'gzwrite' => 'Safe\gzwrite', - 'hash_hkdf' => 'Safe\hash_hkdf', 'hash_update_file' => 'Safe\hash_update_file', 'header_register_callback' => 'Safe\header_register_callback', 'hex2bin' => 'Safe\hex2bin', 'highlight_file' => 'Safe\highlight_file', - 'highlight_string' => 'Safe\highlight_string', 'hrtime' => 'Safe\hrtime', 'ibase_add_user' => 'Safe\ibase_add_user', 'ibase_backup' => 'Safe\ibase_backup', @@ -389,8 +379,6 @@ 'imagesettile' => 'Safe\imagesettile', 'imagestring' => 'Safe\imagestring', 'imagestringup' => 'Safe\imagestringup', - 'imagesx' => 'Safe\imagesx', - 'imagesy' => 'Safe\imagesy', 'imagetruecolortopalette' => 'Safe\imagetruecolortopalette', 'imagettfbbox' => 'Safe\imagettfbbox', 'imagettftext' => 'Safe\imagettftext', @@ -405,8 +393,6 @@ 'imap_body' => 'Safe\imap_body', 'imap_bodystruct' => 'Safe\imap_bodystruct', 'imap_check' => 'Safe\imap_check', - 'imap_clearflag_full' => 'Safe\imap_clearflag_full', - 'imap_close' => 'Safe\imap_close', 'imap_createmailbox' => 'Safe\imap_createmailbox', 'imap_deletemailbox' => 'Safe\imap_deletemailbox', 'imap_fetchbody' => 'Safe\imap_fetchbody', @@ -414,7 +400,6 @@ 'imap_fetchmime' => 'Safe\imap_fetchmime', 'imap_fetchstructure' => 'Safe\imap_fetchstructure', 'imap_fetch_overview' => 'Safe\imap_fetch_overview', - 'imap_gc' => 'Safe\imap_gc', 'imap_getacl' => 'Safe\imap_getacl', 'imap_getmailboxes' => 'Safe\imap_getmailboxes', 'imap_getsubscribed' => 'Safe\imap_getsubscribed', @@ -423,7 +408,6 @@ 'imap_listscan' => 'Safe\imap_listscan', 'imap_lsub' => 'Safe\imap_lsub', 'imap_mail' => 'Safe\imap_mail', - 'imap_mailboxmsginfo' => 'Safe\imap_mailboxmsginfo', 'imap_mail_compose' => 'Safe\imap_mail_compose', 'imap_mail_copy' => 'Safe\imap_mail_copy', 'imap_mail_move' => 'Safe\imap_mail_move', @@ -436,23 +420,21 @@ 'imap_rfc822_write_address' => 'Safe\imap_rfc822_write_address', 'imap_savebody' => 'Safe\imap_savebody', 'imap_setacl' => 'Safe\imap_setacl', - 'imap_setflag_full' => 'Safe\imap_setflag_full', 'imap_set_quota' => 'Safe\imap_set_quota', 'imap_sort' => 'Safe\imap_sort', 'imap_status' => 'Safe\imap_status', 'imap_subscribe' => 'Safe\imap_subscribe', 'imap_thread' => 'Safe\imap_thread', 'imap_timeout' => 'Safe\imap_timeout', - 'imap_undelete' => 'Safe\imap_undelete', 'imap_unsubscribe' => 'Safe\imap_unsubscribe', 'imap_utf8_to_mutf7' => 'Safe\imap_utf8_to_mutf7', 'inet_ntop' => 'Safe\inet_ntop', 'inflate_add' => 'Safe\inflate_add', 'inflate_get_read_len' => 'Safe\inflate_get_read_len', - 'inflate_get_status' => 'Safe\inflate_get_status', 'inflate_init' => 'Safe\inflate_init', 'ini_get' => 'Safe\ini_get', 'ini_set' => 'Safe\ini_set', + 'inotify_add_watch' => 'Safe\inotify_add_watch', 'inotify_init' => 'Safe\inotify_init', 'inotify_rm_watch' => 'Safe\inotify_rm_watch', 'iptcembed' => 'Safe\iptcembed', @@ -477,7 +459,6 @@ 'ldap_first_attribute' => 'Safe\ldap_first_attribute', 'ldap_first_entry' => 'Safe\ldap_first_entry', 'ldap_free_result' => 'Safe\ldap_free_result', - 'ldap_get_attributes' => 'Safe\ldap_get_attributes', 'ldap_get_dn' => 'Safe\ldap_get_dn', 'ldap_get_entries' => 'Safe\ldap_get_entries', 'ldap_get_option' => 'Safe\ldap_get_option', @@ -497,7 +478,6 @@ 'libxml_get_last_error' => 'Safe\libxml_get_last_error', 'libxml_set_external_entity_loader' => 'Safe\libxml_set_external_entity_loader', 'link' => 'Safe\link', - 'long2ip' => 'Safe\long2ip', 'lstat' => 'Safe\lstat', 'lzf_compress' => 'Safe\lzf_compress', 'lzf_decompress' => 'Safe\lzf_decompress', @@ -509,7 +489,6 @@ 'mb_chr' => 'Safe\mb_chr', 'mb_convert_encoding' => 'Safe\mb_convert_encoding', 'mb_detect_order' => 'Safe\mb_detect_order', - 'mb_encoding_aliases' => 'Safe\mb_encoding_aliases', 'mb_eregi_replace' => 'Safe\mb_eregi_replace', 'mb_ereg_replace' => 'Safe\mb_ereg_replace', 'mb_ereg_replace_callback' => 'Safe\mb_ereg_replace_callback', @@ -571,6 +550,8 @@ 'ob_end_clean' => 'Safe\ob_end_clean', 'ob_end_flush' => 'Safe\ob_end_flush', 'ob_flush' => 'Safe\ob_flush', + 'ob_get_clean' => 'Safe\ob_get_clean', + 'ob_get_flush' => 'Safe\ob_get_flush', 'ob_start' => 'Safe\ob_start', 'oci_bind_array_by_name' => 'Safe\oci_bind_array_by_name', 'oci_bind_by_name' => 'Safe\oci_bind_by_name', @@ -610,9 +591,6 @@ 'oci_statement_type' => 'Safe\oci_statement_type', 'oci_unregister_taf_callback' => 'Safe\oci_unregister_taf_callback', 'odbc_autocommit' => 'Safe\odbc_autocommit', - 'odbc_binmode' => 'Safe\odbc_binmode', - 'odbc_columnprivileges' => 'Safe\odbc_columnprivileges', - 'odbc_columns' => 'Safe\odbc_columns', 'odbc_commit' => 'Safe\odbc_commit', 'odbc_connect' => 'Safe\odbc_connect', 'odbc_cursor' => 'Safe\odbc_cursor', @@ -625,26 +603,17 @@ 'odbc_field_num' => 'Safe\odbc_field_num', 'odbc_field_scale' => 'Safe\odbc_field_scale', 'odbc_field_type' => 'Safe\odbc_field_type', - 'odbc_foreignkeys' => 'Safe\odbc_foreignkeys', - 'odbc_gettypeinfo' => 'Safe\odbc_gettypeinfo', - 'odbc_longreadlen' => 'Safe\odbc_longreadlen', 'odbc_pconnect' => 'Safe\odbc_pconnect', 'odbc_prepare' => 'Safe\odbc_prepare', - 'odbc_primarykeys' => 'Safe\odbc_primarykeys', - 'odbc_procedurecolumns' => 'Safe\odbc_procedurecolumns', 'odbc_procedures' => 'Safe\odbc_procedures', 'odbc_result' => 'Safe\odbc_result', 'odbc_result_all' => 'Safe\odbc_result_all', 'odbc_rollback' => 'Safe\odbc_rollback', 'odbc_setoption' => 'Safe\odbc_setoption', - 'odbc_specialcolumns' => 'Safe\odbc_specialcolumns', - 'odbc_statistics' => 'Safe\odbc_statistics', - 'odbc_tableprivileges' => 'Safe\odbc_tableprivileges', 'odbc_tables' => 'Safe\odbc_tables', 'opcache_compile_file' => 'Safe\opcache_compile_file', 'opcache_get_status' => 'Safe\opcache_get_status', 'opendir' => 'Safe\opendir', - 'openlog' => 'Safe\openlog', 'openssl_cipher_iv_length' => 'Safe\openssl_cipher_iv_length', 'openssl_cipher_key_length' => 'Safe\openssl_cipher_key_length', 'openssl_cms_decrypt' => 'Safe\openssl_cms_decrypt', @@ -696,7 +665,6 @@ 'openssl_x509_read' => 'Safe\openssl_x509_read', 'output_add_rewrite_var' => 'Safe\output_add_rewrite_var', 'output_reset_rewrite_vars' => 'Safe\output_reset_rewrite_vars', - 'pack' => 'Safe\pack', 'parse_ini_file' => 'Safe\parse_ini_file', 'parse_ini_string' => 'Safe\parse_ini_string', 'parse_url' => 'Safe\parse_url', @@ -744,14 +712,14 @@ 'pg_result_error_field' => 'Safe\pg_result_error_field', 'pg_result_seek' => 'Safe\pg_result_seek', 'pg_select' => 'Safe\pg_select', + 'pg_set_chunked_rows_size' => 'Safe\pg_set_chunked_rows_size', 'pg_socket' => 'Safe\pg_socket', 'pg_trace' => 'Safe\pg_trace', 'pg_update' => 'Safe\pg_update', - 'phpcredits' => 'Safe\phpcredits', - 'phpinfo' => 'Safe\phpinfo', 'php_sapi_name' => 'Safe\php_sapi_name', 'png2wbmp' => 'Safe\png2wbmp', 'posix_access' => 'Safe\posix_access', + 'posix_eaccess' => 'Safe\posix_eaccess', 'posix_getgrgid' => 'Safe\posix_getgrgid', 'posix_getgrnam' => 'Safe\posix_getgrnam', 'posix_getgroups' => 'Safe\posix_getgroups', @@ -780,7 +748,6 @@ 'pspell_add_to_personal' => 'Safe\pspell_add_to_personal', 'pspell_add_to_session' => 'Safe\pspell_add_to_session', 'pspell_clear_session' => 'Safe\pspell_clear_session', - 'pspell_config_create' => 'Safe\pspell_config_create', 'pspell_config_data_dir' => 'Safe\pspell_config_data_dir', 'pspell_config_dict_dir' => 'Safe\pspell_config_dict_dir', 'pspell_config_ignore' => 'Safe\pspell_config_ignore', @@ -862,9 +829,6 @@ 'putenv' => 'Safe\putenv', 'readfile' => 'Safe\readfile', 'readgzfile' => 'Safe\readgzfile', - 'readline_add_history' => 'Safe\readline_add_history', - 'readline_callback_handler_install' => 'Safe\readline_callback_handler_install', - 'readline_clear_history' => 'Safe\readline_clear_history', 'readline_completion_function' => 'Safe\readline_completion_function', 'readline_read_history' => 'Safe\readline_read_history', 'readline_write_history' => 'Safe\readline_write_history', @@ -874,6 +838,33 @@ 'rename' => 'Safe\rename', 'rewind' => 'Safe\rewind', 'rmdir' => 'Safe\rmdir', + 'rnp_decrypt' => 'Safe\rnp_decrypt', + 'rnp_dump_packets' => 'Safe\rnp_dump_packets', + 'rnp_dump_packets_to_json' => 'Safe\rnp_dump_packets_to_json', + 'rnp_ffi_create' => 'Safe\rnp_ffi_create', + 'rnp_ffi_set_pass_provider' => 'Safe\rnp_ffi_set_pass_provider', + 'rnp_import_keys' => 'Safe\rnp_import_keys', + 'rnp_import_signatures' => 'Safe\rnp_import_signatures', + 'rnp_key_export' => 'Safe\rnp_key_export', + 'rnp_key_export_autocrypt' => 'Safe\rnp_key_export_autocrypt', + 'rnp_key_export_revocation' => 'Safe\rnp_key_export_revocation', + 'rnp_key_get_info' => 'Safe\rnp_key_get_info', + 'rnp_key_remove' => 'Safe\rnp_key_remove', + 'rnp_key_revoke' => 'Safe\rnp_key_revoke', + 'rnp_list_keys' => 'Safe\rnp_list_keys', + 'rnp_load_keys' => 'Safe\rnp_load_keys', + 'rnp_load_keys_from_path' => 'Safe\rnp_load_keys_from_path', + 'rnp_locate_key' => 'Safe\rnp_locate_key', + 'rnp_op_encrypt' => 'Safe\rnp_op_encrypt', + 'rnp_op_generate_key' => 'Safe\rnp_op_generate_key', + 'rnp_op_sign' => 'Safe\rnp_op_sign', + 'rnp_op_sign_cleartext' => 'Safe\rnp_op_sign_cleartext', + 'rnp_op_sign_detached' => 'Safe\rnp_op_sign_detached', + 'rnp_op_verify' => 'Safe\rnp_op_verify', + 'rnp_op_verify_detached' => 'Safe\rnp_op_verify_detached', + 'rnp_save_keys' => 'Safe\rnp_save_keys', + 'rnp_save_keys_to_path' => 'Safe\rnp_save_keys_to_path', + 'rnp_supported_features' => 'Safe\rnp_supported_features', 'rpmaddtag' => 'Safe\rpmaddtag', 'rrd_create' => 'Safe\rrd_create', 'rrd_first' => 'Safe\rrd_first', @@ -919,7 +910,6 @@ 'shm_put_var' => 'Safe\shm_put_var', 'shm_remove' => 'Safe\shm_remove', 'shm_remove_var' => 'Safe\shm_remove_var', - 'shuffle' => 'Safe\shuffle', 'simplexml_import_dom' => 'Safe\simplexml_import_dom', 'simplexml_load_file' => 'Safe\simplexml_load_file', 'simplexml_load_string' => 'Safe\simplexml_load_string', @@ -927,6 +917,7 @@ 'socket_addrinfo_bind' => 'Safe\socket_addrinfo_bind', 'socket_addrinfo_connect' => 'Safe\socket_addrinfo_connect', 'socket_addrinfo_lookup' => 'Safe\socket_addrinfo_lookup', + 'socket_atmark' => 'Safe\socket_atmark', 'socket_bind' => 'Safe\socket_bind', 'socket_connect' => 'Safe\socket_connect', 'socket_create' => 'Safe\socket_create', @@ -950,6 +941,8 @@ 'socket_wsaprotocol_info_export' => 'Safe\socket_wsaprotocol_info_export', 'socket_wsaprotocol_info_import' => 'Safe\socket_wsaprotocol_info_import', 'socket_wsaprotocol_info_release' => 'Safe\socket_wsaprotocol_info_release', + 'sodium_crypto_aead_aegis128l_decrypt' => 'Safe\sodium_crypto_aead_aegis128l_decrypt', + 'sodium_crypto_aead_aegis256_decrypt' => 'Safe\sodium_crypto_aead_aegis256_decrypt', 'sodium_crypto_aead_aes256gcm_decrypt' => 'Safe\sodium_crypto_aead_aes256gcm_decrypt', 'sodium_crypto_aead_chacha20poly1305_decrypt' => 'Safe\sodium_crypto_aead_chacha20poly1305_decrypt', 'sodium_crypto_aead_chacha20poly1305_encrypt' => 'Safe\sodium_crypto_aead_chacha20poly1305_encrypt', @@ -960,7 +953,6 @@ 'sodium_crypto_auth_verify' => 'Safe\sodium_crypto_auth_verify', 'sodium_crypto_box_open' => 'Safe\sodium_crypto_box_open', 'sodium_crypto_box_seal_open' => 'Safe\sodium_crypto_box_seal_open', - 'sodium_crypto_generichash_update' => 'Safe\sodium_crypto_generichash_update', 'sodium_crypto_secretbox_open' => 'Safe\sodium_crypto_secretbox_open', 'sodium_crypto_sign_open' => 'Safe\sodium_crypto_sign_open', 'sodium_crypto_sign_verify_detached' => 'Safe\sodium_crypto_sign_verify_detached', @@ -1009,6 +1001,7 @@ 'ssh2_sftp_symlink' => 'Safe\ssh2_sftp_symlink', 'ssh2_sftp_unlink' => 'Safe\ssh2_sftp_unlink', 'ssh2_shell' => 'Safe\ssh2_shell', + 'stream_context_set_options' => 'Safe\stream_context_set_options', 'stream_context_set_params' => 'Safe\stream_context_set_params', 'stream_copy_to_stream' => 'Safe\stream_copy_to_stream', 'stream_filter_append' => 'Safe\stream_filter_append', @@ -1044,7 +1037,6 @@ 'swoole_event_del' => 'Safe\swoole_event_del', 'swoole_event_write' => 'Safe\swoole_event_write', 'symlink' => 'Safe\symlink', - 'syslog' => 'Safe\syslog', 'system' => 'Safe\system', 'tempnam' => 'Safe\tempnam', 'timezone_name_from_abbr' => 'Safe\timezone_name_from_abbr', @@ -1071,16 +1063,7 @@ 'xdiff_string_patch_binary' => 'Safe\xdiff_string_patch_binary', 'xmlrpc_set_type' => 'Safe\xmlrpc_set_type', 'xml_parser_free' => 'Safe\xml_parser_free', - 'xml_set_character_data_handler' => 'Safe\xml_set_character_data_handler', - 'xml_set_default_handler' => 'Safe\xml_set_default_handler', - 'xml_set_element_handler' => 'Safe\xml_set_element_handler', - 'xml_set_end_namespace_decl_handler' => 'Safe\xml_set_end_namespace_decl_handler', - 'xml_set_external_entity_ref_handler' => 'Safe\xml_set_external_entity_ref_handler', - 'xml_set_notation_decl_handler' => 'Safe\xml_set_notation_decl_handler', - 'xml_set_object' => 'Safe\xml_set_object', - 'xml_set_processing_instruction_handler' => 'Safe\xml_set_processing_instruction_handler', - 'xml_set_start_namespace_decl_handler' => 'Safe\xml_set_start_namespace_decl_handler', - 'xml_set_unparsed_entity_decl_handler' => 'Safe\xml_set_unparsed_entity_decl_handler', + 'xml_parser_set_option' => 'Safe\xml_parser_set_option', 'yaml_parse' => 'Safe\yaml_parse', 'yaml_parse_file' => 'Safe\yaml_parse_file', 'yaml_parse_url' => 'Safe\yaml_parse_url',