diff --git a/generated/bzip2.php b/generated/bzip2.php index d1f04df0..38094213 100644 --- a/generated/bzip2.php +++ b/generated/bzip2.php @@ -13,14 +13,13 @@ * @throws Bzip2Exception * */ -function bzclose($bz): int +function bzclose($bz): void { error_clear_last(); $result = \bzclose($bz); if ($result === false) { throw Bzip2Exception::createFromPhpError(); } - return $result; } diff --git a/generated/dir.php b/generated/dir.php index 1c4990da..9fd1e630 100644 --- a/generated/dir.php +++ b/generated/dir.php @@ -78,16 +78,7 @@ function getcwd(): string * @param resource $context For a description of the context parameter, * refer to the streams section of * the manual. - * @return resource Returns a directory handle resource on success. - * - * If path is not a valid directory or the - * directory can not be opened due to permission restrictions or - * filesystem errors, opendir returns FALSE and - * generates a PHP error of level - * E_WARNING. You can suppress the error output of - * opendir by prepending - * '@' to the - * front of the function name. + * @return resource Returns a directory handle resource on success * @throws DirException * */ diff --git a/generated/filesystem.php b/generated/filesystem.php index e5af49a3..8d387538 100644 --- a/generated/filesystem.php +++ b/generated/filesystem.php @@ -215,7 +215,7 @@ function fflush($handle): void * supported by your OS to enhance performance. * * @param string $filename Name of the file to read. - * @param bool $use_include_path As of PHP 5 the FILE_USE_INCLUDE_PATH constant can be used + * @param bool $use_include_path The FILE_USE_INCLUDE_PATH constant can be used * to trigger include path * search. * This is not possible if strict typing @@ -779,7 +779,7 @@ function flock($handle, int $operation, ?int &$wouldblock = null): void * can be set to '1' or TRUE if you want to search for the file in the * include_path, too. * @param resource $context - * @return resource Returns a file pointer resource on success. + * @return resource Returns a file pointer resource on success * @throws FilesystemException * */ @@ -1180,6 +1180,32 @@ function parse_ini_string(string $ini, bool $process_sections = false, int $scan } +/** + * Reads a file and writes it to the output buffer. + * + * @param string $filename The filename being read. + * @param bool $use_include_path You can use the optional second parameter and set it to TRUE, if + * you want to search for the file in the include_path, too. + * @param resource $context A context stream resource. + * @return int Returns the number of bytes read from the file on success + * @throws FilesystemException + * + */ +function readfile(string $filename, bool $use_include_path = false, $context = null): int +{ + error_clear_last(); + if ($context !== null) { + $result = \readfile($filename, $use_include_path, $context); + } else { + $result = \readfile($filename, $use_include_path); + } + if ($result === false) { + throw FilesystemException::createFromPhpError(); + } + return $result; +} + + /** * readlink does the same as the readlink C function. * diff --git a/generated/functionsList.php b/generated/functionsList.php index dbca346f..10ccc565 100644 --- a/generated/functionsList.php +++ b/generated/functionsList.php @@ -161,6 +161,7 @@ 'mkdir', 'parse_ini_file', 'parse_ini_string', + 'readfile', 'readlink', 'realpath', 'rename', @@ -216,7 +217,9 @@ 'gnupg_setsignmode', 'hash_hkdf', 'hash_update_file', + 'fbird_blob_cancel', 'ibase_add_user', + 'ibase_backup', 'ibase_blob_cancel', 'ibase_blob_create', 'ibase_blob_get', @@ -233,8 +236,10 @@ 'ibase_modify_user', 'ibase_name_result', 'ibase_pconnect', + 'ibase_restore', 'ibase_rollback_ret', 'ibase_rollback', + 'ibase_service_attach', 'ibase_service_detach', 'db2_autocommit', 'db2_bind_param', @@ -914,6 +919,9 @@ 'socket_set_option', 'socket_shutdown', 'socket_write', + 'socket_wsaprotocol_info_export', + 'socket_wsaprotocol_info_import', + 'socket_wsaprotocol_info_release', 'sodium_crypto_pwhash_str', 'sodium_crypto_pwhash', 'solr_get_version', @@ -1075,6 +1083,7 @@ 'inflate_get_status', 'inflate_add', 'inflate_init', + 'readgzfile', 'zlib_decode', 'json_decode', 'apc_fetch', diff --git a/generated/ibase.php b/generated/ibase.php index ef5285a4..49697400 100644 --- a/generated/ibase.php +++ b/generated/ibase.php @@ -4,6 +4,24 @@ use Safe\Exceptions\IbaseException; +/** + * This function will discard a BLOB if it has not yet been closed by + * fbird_blob_close. + * + * @param resource $blob_handle A BLOB handle opened with fbird_blob_create. + * @throws IbaseException + * + */ +function fbird_blob_cancel($blob_handle): void +{ + error_clear_last(); + $result = \fbird_blob_cancel($blob_handle); + if ($result === false) { + throw IbaseException::createFromPhpError(); + } +} + + /** * * @@ -34,6 +52,44 @@ function ibase_add_user($service_handle, string $user_name, string $password, st } +/** + * This function passes the arguments to the (remote) database server. There it starts a new backup process. Therefore you + * won't get any responses. + * + * @param resource $service_handle A previously opened connection to the database server. + * @param string $source_db The absolute file path to the database on the database server. You can also use a database alias. + * @param string $dest_file The path to the backup file on the database server. + * @param int $options Additional options to pass to the database server for backup. + * The options parameter can be a combination + * of the following constants: + * IBASE_BKP_IGNORE_CHECKSUMS, + * IBASE_BKP_IGNORE_LIMBO, + * IBASE_BKP_METADATA_ONLY, + * IBASE_BKP_NO_GARBAGE_COLLECT, + * IBASE_BKP_OLD_DESCRIPTIONS, + * IBASE_BKP_NON_TRANSPORTABLE or + * IBASE_BKP_CONVERT. + * Read the section about for further information. + * @param bool $verbose Since the backup process is done on the database server, you don't have any chance + * to get its output. This argument is useless. + * @return mixed Returns TRUE on success. + * + * Since the backup process is done on the (remote) server, this function just passes the arguments to it. + * While the arguments are legal, you won't get FALSE. + * @throws IbaseException + * + */ +function ibase_backup($service_handle, string $source_db, string $dest_file, int $options = 0, bool $verbose = false) +{ + error_clear_last(); + $result = \ibase_backup($service_handle, $source_db, $dest_file, $options, $verbose); + if ($result === false) { + throw IbaseException::createFromPhpError(); + } + return $result; +} + + /** * This function will discard a BLOB if it has not yet been closed by * ibase_blob_close. @@ -453,6 +509,47 @@ function ibase_pconnect(string $database = null, string $username = null, string } +/** + * This function passes the arguments to the (remote) database server. There it starts a new restore process. Therefore you + * won't get any responses. + * + * @param resource $service_handle A previously opened connection to the database server. + * @param string $source_file The absolute path on the server where the backup file is located. + * @param string $dest_db The path to create the new database on the server. You can also use database alias. + * @param int $options Additional options to pass to the database server for restore. + * The options parameter can be a combination + * of the following constants: + * IBASE_RES_DEACTIVATE_IDX, + * IBASE_RES_NO_SHADOW, + * IBASE_RES_NO_VALIDITY, + * IBASE_RES_ONE_AT_A_TIME, + * IBASE_RES_REPLACE, + * IBASE_RES_CREATE, + * IBASE_RES_USE_ALL_SPACE, + * IBASE_PRP_PAGE_BUFFERS, + * IBASE_PRP_SWEEP_INTERVAL, + * IBASE_RES_CREATE. + * Read the section about for further information. + * @param bool $verbose Since the restore process is done on the database server, you don't have any chance + * to get its output. This argument is useless. + * @return mixed Returns TRUE on success. + * + * Since the restore process is done on the (remote) server, this function just passes the arguments to it. + * While the arguments are legal, you won't get FALSE. + * @throws IbaseException + * + */ +function ibase_restore($service_handle, string $source_file, string $dest_db, int $options = 0, bool $verbose = false) +{ + error_clear_last(); + $result = \ibase_restore($service_handle, $source_file, $dest_db, $options, $verbose); + if ($result === false) { + throw IbaseException::createFromPhpError(); + } + return $result; +} + + /** * Rolls back a transaction without closing it. * @@ -500,7 +597,29 @@ function ibase_rollback($link_or_trans_identifier = null): void /** * * - * @param resource $service_handle + * @param string $host The name or ip address of the database host. You can define the port by adding + * '/' and port number. If no port is specified, port 3050 will be used. + * @param string $dba_username The name of any valid user. + * @param string $dba_password The user's password. + * @return resource Returns a Interbase / Firebird link identifier on success. + * @throws IbaseException + * + */ +function ibase_service_attach(string $host, string $dba_username, string $dba_password) +{ + error_clear_last(); + $result = \ibase_service_attach($host, $dba_username, $dba_password); + if ($result === false) { + throw IbaseException::createFromPhpError(); + } + return $result; +} + + +/** + * + * + * @param resource $service_handle A previously created connection to the database server. * @throws IbaseException * */ diff --git a/generated/image.php b/generated/image.php index 4557ce06..d389f6f5 100644 --- a/generated/image.php +++ b/generated/image.php @@ -938,6 +938,15 @@ function imagefilltoborder($image, int $x, int $y, int $border, int $color): voi * * * + * + * IMG_FILTER_SCATTER: Applies scatter effect + * to the image, use arg1 and + * arg2 to define the effect strength and + * additionally arg3 to only apply the + * on select pixel colors. + * + * + * * @param int $arg1 * * @@ -965,6 +974,13 @@ function imagefilltoborder($image, int $x, int $y, int $border, int $color): voi * * * + * + * IMG_FILTER_SCATTER: Effect substraction level. + * This must not be higher or equal to the addition level set with + * arg2. + * + * + * * @param int $arg2 * * @@ -978,6 +994,11 @@ function imagefilltoborder($image, int $x, int $y, int $border, int $color): voi * * * + * + * IMG_FILTER_SCATTER: Effect addition level. + * + * + * * @param int $arg3 * * @@ -985,6 +1006,12 @@ function imagefilltoborder($image, int $x, int $y, int $border, int $color): voi * * * + * + * IMG_FILTER_SCATTER: Optional array indexed color values + * to apply effect at. + * + * + * * @param int $arg4 * * diff --git a/generated/json.php b/generated/json.php index efaf7797..dad455cc 100644 --- a/generated/json.php +++ b/generated/json.php @@ -54,7 +54,8 @@ function json_encode($value, int $options = 0, int $depth = 512): string /** - * + * Returns the error string of the last json_encode or json_decode + * call, which did not specify JSON_THROW_ON_ERROR. * * @return string Returns the error message on success, "No error" if no * error has occurred. diff --git a/generated/sem.php b/generated/sem.php index 040b64ac..02fa693e 100644 --- a/generated/sem.php +++ b/generated/sem.php @@ -26,7 +26,7 @@ function msg_queue_exists(int $key): void * specified queue of the type specified by * desiredmsgtype. * - * @param resource $queue + * @param resource $queue Message queue resource handle * @param int $desiredmsgtype If desiredmsgtype is 0, the message from the front * of the queue is returned. If desiredmsgtype is * greater than 0, then the first message of that type is returned. @@ -127,9 +127,13 @@ function msg_remove_queue($queue): void * msgtype (which MUST be greater than 0) to * the message queue specified by queue. * - * @param resource $queue - * @param int $msgtype - * @param mixed $message + * @param resource $queue Message queue resource handle + * @param int $msgtype The type of the message (MUST be greater than 0) + * @param mixed $message The body of the message. + * + * If serialize set to FALSE is supplied, + * MUST be of type: string, integer, float + * or bool. In other case a warning will be issued. * @param bool $serialize The optional serialize controls how the * message is sent. serialize * defaults to TRUE which means that the message is @@ -147,7 +151,7 @@ function msg_remove_queue($queue): void * errorcode to MSG_EAGAIN, * indicating that you should try to send your message again a little * later on. - * @param int $errorcode + * @param int $errorcode If the function fails, the optional errorcode will be set to the value of the system errno variable. * @throws SemException * */ diff --git a/generated/sockets.php b/generated/sockets.php index 5fa99711..d9e0b524 100644 --- a/generated/sockets.php +++ b/generated/sockets.php @@ -722,3 +722,63 @@ function socket_write($socket, string $buffer, int $length = 0): int } return $result; } + + +/** + * Exports the WSAPROTOCOL_INFO structure into shared memory and returns + * an identifier to be used with socket_wsaprotocol_info_import. The + * exported ID is only valid for the given target_pid. + * + * @param resource $socket A valid socket resource. + * @param int $target_pid The ID of the process which will import the the socket. + * @return string Returns an identifier to be used for the import + * @throws SocketsException + * + */ +function socket_wsaprotocol_info_export(resource $socket, int $target_pid): string +{ + error_clear_last(); + $result = \socket_wsaprotocol_info_export($socket, $target_pid); + if ($result === false) { + throw SocketsException::createFromPhpError(); + } + return $result; +} + + +/** + * Imports a socket which has formerly been exported from another process. + * + * @param string $info_id The ID which has been returned by a former call to + * socket_wsaprotocol_info_export. + * @return resource Returns the socket resource + * @throws SocketsException + * + */ +function socket_wsaprotocol_info_import(string $info_id) +{ + error_clear_last(); + $result = \socket_wsaprotocol_info_import($info_id); + if ($result === false) { + throw SocketsException::createFromPhpError(); + } + return $result; +} + + +/** + * Releases the shared memory corresponding to the given info_id. + * + * @param string $info_id The ID which has been returned by a former call to + * socket_wsaprotocol_info_export. + * @throws SocketsException + * + */ +function socket_wsaprotocol_info_release(string $info_id): void +{ + error_clear_last(); + $result = \socket_wsaprotocol_info_release($info_id); + if ($result === false) { + throw SocketsException::createFromPhpError(); + } +} diff --git a/generated/zlib.php b/generated/zlib.php index 324bd08e..59374dd4 100644 --- a/generated/zlib.php +++ b/generated/zlib.php @@ -561,6 +561,32 @@ function inflate_init(int $encoding, array $options = null) } +/** + * Reads a file, decompresses it and writes it to standard output. + * + * readgzfile can be used to read a file which is not in + * gzip format; in this case readgzfile will directly + * read from the file without decompression. + * + * @param string $filename The file name. This file will be opened from the filesystem and its + * contents written to standard output. + * @param int $use_include_path You can set this optional parameter to 1, if you + * want to search for the file in the include_path too. + * @return int Returns the number of (uncompressed) bytes read from the file on success + * @throws ZlibException + * + */ +function readgzfile(string $filename, int $use_include_path = 0): int +{ + error_clear_last(); + $result = \readgzfile($filename, $use_include_path); + if ($result === false) { + throw ZlibException::createFromPhpError(); + } + return $result; +} + + /** * Uncompress any raw/gzip/zlib encoded data. * diff --git a/rector-migrate.yml b/rector-migrate.yml index 01578c12..b883ec01 100644 --- a/rector-migrate.yml +++ b/rector-migrate.yml @@ -164,6 +164,7 @@ services: mkdir: 'Safe\mkdir' parse_ini_file: 'Safe\parse_ini_file' parse_ini_string: 'Safe\parse_ini_string' + readfile: 'Safe\readfile' readlink: 'Safe\readlink' realpath: 'Safe\realpath' rename: 'Safe\rename' @@ -219,7 +220,9 @@ services: gnupg_setsignmode: 'Safe\gnupg_setsignmode' hash_hkdf: 'Safe\hash_hkdf' hash_update_file: 'Safe\hash_update_file' + fbird_blob_cancel: 'Safe\fbird_blob_cancel' ibase_add_user: 'Safe\ibase_add_user' + ibase_backup: 'Safe\ibase_backup' ibase_blob_cancel: 'Safe\ibase_blob_cancel' ibase_blob_create: 'Safe\ibase_blob_create' ibase_blob_get: 'Safe\ibase_blob_get' @@ -236,8 +239,10 @@ services: ibase_modify_user: 'Safe\ibase_modify_user' ibase_name_result: 'Safe\ibase_name_result' ibase_pconnect: 'Safe\ibase_pconnect' + ibase_restore: 'Safe\ibase_restore' ibase_rollback_ret: 'Safe\ibase_rollback_ret' ibase_rollback: 'Safe\ibase_rollback' + ibase_service_attach: 'Safe\ibase_service_attach' ibase_service_detach: 'Safe\ibase_service_detach' db2_autocommit: 'Safe\db2_autocommit' db2_bind_param: 'Safe\db2_bind_param' @@ -917,6 +922,9 @@ services: socket_set_option: 'Safe\socket_set_option' socket_shutdown: 'Safe\socket_shutdown' socket_write: 'Safe\socket_write' + 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_pwhash_str: 'Safe\sodium_crypto_pwhash_str' sodium_crypto_pwhash: 'Safe\sodium_crypto_pwhash' solr_get_version: 'Safe\solr_get_version' @@ -1078,6 +1086,7 @@ services: inflate_get_status: 'Safe\inflate_get_status' inflate_add: 'Safe\inflate_add' inflate_init: 'Safe\inflate_init' + readgzfile: 'Safe\readgzfile' zlib_decode: 'Safe\zlib_decode' json_decode: 'Safe\json_decode' apc_fetch: 'Safe\apc_fetch'