diff --git a/.gitignore b/.gitignore index 10170914..dc84bf9f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ /generator/build/ /generator/doc/doc-en/ /generator/doc/entities/generated.ent -/composer.lock \ No newline at end of file +/composer.lock +/vendor/ \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 3d497742..3a351281 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,6 +33,17 @@ script: - cd generator && composer phpstan && cd .. - composer cs-check - composer phpstan +# Now, let's regenerate all files and see if we obtain the same set of files as the ones commited: +- cd generator && ./safe.php generate && cd .. +- | + if output=$(git status --porcelain) && [ -z "$output" ]; then + # all is good + echo "Generated files are the same as committed file: OK" + else + # Uncommitted changes + echo "Generated files are different from commited files. Please run './safe.php generate' command and commit the results." + exit 1; + fi after_script: - travis_retry php vendor/bin/php-coveralls diff --git a/composer.json b/composer.json index daaabb97..f165fe45 100644 --- a/composer.json +++ b/composer.json @@ -1,25 +1,157 @@ { - "name": "thecodingmachine/safe", - "description": "PHP core functions that throw exceptions instead of returning FALSE on error", - "autoload": { - "psr-4": { - "Safe\\": ["lib/", "generated/"] + "name": "thecodingmachine/safe", + "description": "PHP core functions that throw exceptions instead of returning FALSE on error", + "autoload": { + "psr-4": { + "Safe\\": [ + "lib/", + "generated/" + ] + }, + "files": [ + "generated/apache.php", + "generated/apc.php", + "generated/apcu.php", + "generated/apd.php", + "generated/array.php", + "generated/bbcode.php", + "generated/bcompiler.php", + "generated/bzip2.php", + "generated/cairo.php", + "generated/chdb.php", + "generated/classkit.php", + "generated/classobj.php", + "generated/com.php", + "generated/crack.php", + "generated/curl.php", + "generated/cyrus.php", + "generated/datetime.php", + "generated/dba.php", + "generated/dbase.php", + "generated/dbplus.php", + "generated/dbx.php", + "generated/dio.php", + "generated/dir.php", + "generated/eio.php", + "generated/enchant.php", + "generated/errorfunc.php", + "generated/exec.php", + "generated/fam.php", + "generated/fann.php", + "generated/fbsql.php", + "generated/fdf.php", + "generated/fileinfo.php", + "generated/filepro.php", + "generated/filesystem.php", + "generated/filter.php", + "generated/fpm.php", + "generated/fribidi.php", + "generated/ftp.php", + "generated/funchand.php", + "generated/gmp.php", + "generated/gnupg.php", + "generated/gupnp.php", + "generated/hash.php", + "generated/ibase.php", + "generated/ibmDb2.php", + "generated/iconv.php", + "generated/id3.php", + "generated/ifx.php", + "generated/image.php", + "generated/imap.php", + "generated/info.php", + "generated/ingres-ii.php", + "generated/inotify.php", + "generated/json.php", + "generated/kadm5.php", + "generated/ldap.php", + "generated/libevent.php", + "generated/libxml.php", + "generated/lzf.php", + "generated/mailparse.php", + "generated/maxdb.php", + "generated/mbstring.php", + "generated/mcrypt.php", + "generated/mhash.php", + "generated/misc.php", + "generated/mnogosearch.php", + "generated/msql.php", + "generated/mssql.php", + "generated/mysql.php", + "generated/mysqlndMs.php", + "generated/mysqlndQc.php", + "generated/ncurses.php", + "generated/network.php", + "generated/newt.php", + "generated/nis.php", + "generated/nsapi.php", + "generated/oci8.php", + "generated/opcache.php", + "generated/openal.php", + "generated/openssl.php", + "generated/outcontrol.php", + "generated/paradox.php", + "generated/password.php", + "generated/pcntl.php", + "generated/pcre.php", + "generated/pdf.php", + "generated/pgsql.php", + "generated/posix.php", + "generated/proctitle.php", + "generated/ps.php", + "generated/pspell.php", + "generated/radius.php", + "generated/readline.php", + "generated/rpmreader.php", + "generated/rrd.php", + "generated/runkit.php", + "generated/sem.php", + "generated/session.php", + "generated/sessionPgsql.php", + "generated/shmop.php", + "generated/simplexml.php", + "generated/sockets.php", + "generated/sodium.php", + "generated/spl.php", + "generated/sqlite.php", + "generated/sqlsrv.php", + "generated/ssh2.php", + "generated/stream.php", + "generated/strings.php", + "generated/suhosin.php", + "generated/svn.php", + "generated/swoole.php", + "generated/sybase.php", + "generated/tidy.php", + "generated/uodbc.php", + "generated/url.php", + "generated/var.php", + "generated/wddx.php", + "generated/wincache.php", + "generated/xattr.php", + "generated/xdiff.php", + "generated/xml.php", + "generated/xmlrpc.php", + "generated/yaml.php", + "generated/yaz.php", + "generated/zip.php", + "generated/zlib.php" + ] + }, + "require-dev": { + "php": ">=7.1", + "phpstan/phpstan": "^0.10.3", + "thecodingmachine/phpstan-strict-rules": "^0.10.3", + "squizlabs/php_codesniffer": "^3.2" + }, + "scripts": { + "phpstan": "phpstan analyse lib -c phpstan.neon --level=7 --no-progress -vvv", + "cs-fix": "phpcbf", + "cs-check": "phpcs" + }, + "extra": { + "branch-alias": { + "dev-master": "0.1-dev" + } } - }, - "require-dev": { - "php": ">=7.1", - "phpstan/phpstan": "^0.10.3", - "thecodingmachine/phpstan-strict-rules": "^0.10.3", - "squizlabs/php_codesniffer": "^3.2" - }, - "scripts": { - "phpstan": "phpstan analyse lib -c phpstan.neon --level=7 --no-progress -vvv", - "cs-fix": "phpcbf", - "cs-check": "phpcs" - }, - "extra": { - "branch-alias": { - "dev-master": "0.1-dev" - } - } -} +} \ No newline at end of file diff --git a/generated/Exceptions/ApacheException.php b/generated/Exceptions/ApacheException.php new file mode 100644 index 00000000..aedca197 --- /dev/null +++ b/generated/Exceptions/ApacheException.php @@ -0,0 +1,6 @@ + + * ]]> + * + * + * + * + * + * + * + * module + * + * + * + * It is used internally by dbx only, and is actually the module number + * mentioned above. + * + * + * + * + * @throws Exceptions\DbxException + * + */ +function dbx_connect($module, string $host, string $database, string $username, string $password, int $persistent): object +{ + error_clear_last(); + if ($persistent !== null) { + $result = \dbx_connect($module, $host, $database, $username, $password, $persistent); + }else { + $result = \dbx_connect($module, $host, $database, $username, $password); + } + if ($result === FALSE) { + throw Exceptions\DbxException::createFromPhpError(); + } + return $result; +} + + +/** + * Sort a result from a dbx_query call with a custom sort + * function. + * + * @param object $result A result set returned by dbx_query. + * @param string $user_compare_function The user-defined comparison function. It must accept two arguments and + * return an integer less than, equal to, or greater than zero if the + * first argument is considered to be respectively less than, equal to, + * or greater than the second. + * @throws Exceptions\DbxException + * + */ +function dbx_sort(object $result, string $user_compare_function): void +{ + error_clear_last(); + $result = \dbx_sort($result, $user_compare_function); + if ($result === FALSE) { + throw Exceptions\DbxException::createFromPhpError(); + } +} + + diff --git a/generated/dio.php b/generated/dio.php new file mode 100644 index 00000000..6ff28fc1 --- /dev/null +++ b/generated/dio.php @@ -0,0 +1,146 @@ + + * + * + * + * The mode parameter consists of three octal + * number components specifying access restrictions for the owner, + * the user group in which the owner is in, and to everybody else in + * this order. One component can be computed by adding up the needed + * permissions for that target user base. Number 1 means that you + * grant execute rights, number 2 means that you make the file + * writeable, number 4 means that you make the file readable. Add + * up these numbers to specify needed rights. You can also read more + * about modes on Unix systems with 'man 1 chmod' + * and 'man 2 chmod'. + * + * + * + * + */ +function chmod(string $filename, int $mode): void +{ + error_clear_last(); + $result = \chmod($filename, $mode); + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } +} + + +/** + * Attempts to change the owner of the file filename + * to user user. Only the superuser may change the + * owner of a file. + * + * @param string $filename Path to the file. + * @param string|int $user A user name or number. + * @throws Exceptions\FilesystemException + * + */ +function chown(string $filename, $user): void +{ + error_clear_last(); + $result = \chown($filename, $user); + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } +} + + +/** + * Makes a copy of the file source to + * dest. + * + * If you wish to move a file, use the rename function. + * + * @param string $source Path to the source file. + * @param string $dest The destination path. If dest is a URL, the + * copy operation may fail if the wrapper does not support overwriting of + * existing files. + * + * If the destination file already exists, it will be overwritten. + * @param resource $context A valid context resource created with + * stream_context_create. + * @throws Exceptions\FilesystemException + * + */ +function copy(string $source, string $dest, $context): void +{ + error_clear_last(); + if ($context !== null) { + $result = \copy($source, $dest, $context); + }else { + $result = \copy($source, $dest); + } + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } +} + + +/** + * Given a string containing a directory, this function will return the + * number of bytes available on the corresponding filesystem or disk + * partition. + * + * @param string $directory A directory of the filesystem or disk partition. + * + * Given a file name instead of a directory, the behaviour of the + * function is unspecified and may differ between operating systems and + * PHP versions. + * @return float Returns the number of available bytes as a float + * . + * @throws Exceptions\FilesystemException + * + */ +function disk_free_space(string $directory): float +{ + error_clear_last(); + $result = \disk_free_space($directory); + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } + return $result; +} + + +/** + * Given a string containing a directory, this function will return the total + * number of bytes on the corresponding filesystem or disk partition. + * + * @param string $directory A directory of the filesystem or disk partition. + * @return float Returns the total number of bytes as a float + * . + * @throws Exceptions\FilesystemException + * + */ +function disk_total_space(string $directory): float +{ + error_clear_last(); + $result = \disk_total_space($directory); + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } + return $result; +} + + +/** + * The file pointed to by handle is closed. + * + * @param resource $handle The file pointer must be valid, and must point to a file successfully + * opened by fopen or fsockopen. + * @throws Exceptions\FilesystemException + * + */ +function fclose($handle): void +{ + error_clear_last(); + $result = \fclose($handle); + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } +} + + +/** + * This function forces a write of all buffered output to the resource + * pointed to by the file handle. + * + * @param resource $handle The file pointer must be valid, and must point to + * a file successfully opened by fopen or + * fsockopen (and not yet closed by + * fclose). + * @throws Exceptions\FilesystemException + * + */ +function fflush($handle): void +{ + error_clear_last(); + $result = \fflush($handle); + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } +} + + +/** + * This function is similar to file, except that + * file_get_contents returns the file in a + * string, starting at the specified offset + * up to maxlen bytes. On failure, + * file_get_contents will return FALSE. + * + * file_get_contents is the preferred way to read the + * contents of a file into a string. It will use memory mapping techniques if + * 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 + * to trigger include path + * search. + * This is not possible if strict typing + * is enabled, since FILE_USE_INCLUDE_PATH is an + * int. Use TRUE instead. + * @param resource|null $context A valid context resource created with + * stream_context_create. If you don't need to use a + * custom context, you can skip this parameter by NULL. + * @param int $offset The offset where the reading starts on the original stream. + * Negative offsets count from the end of the stream. + * + * Seeking (offset) is not supported with remote files. + * Attempting to seek on non-local files may work with small offsets, but this + * is unpredictable because it works on the buffered stream. + * @param int $maxlen Maximum length of data read. The default is to read until end + * of file is reached. Note that this parameter is applied to the + * stream processed by the filters. + * @return string The function returns the read data . + * @throws Exceptions\FilesystemException + * + */ +function file_get_contents(string $filename, bool $use_include_path = false, $context = null, int $offset = 0, int $maxlen = null): string +{ + error_clear_last(); + if ($maxlen !== null) { + $result = \file_get_contents($filename, $use_include_path, $context, $offset, $maxlen); + } elseif ($offset !== 0) { + $result = \file_get_contents($filename, $use_include_path, $context, $offset); + } elseif ($context !== null) { + $result = \file_get_contents($filename, $use_include_path, $context); + }else { + $result = \file_get_contents($filename, $use_include_path); + } + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } + return $result; +} + + +/** + * + * + * @param string $filename Path to the file. + * @return int Returns the time the file was last accessed, . + * The time is returned as a Unix timestamp. + * @throws Exceptions\FilesystemException + * + */ +function fileatime(string $filename): int +{ + error_clear_last(); + $result = \fileatime($filename); + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } + return $result; +} + + +/** + * Gets the inode change time of a file. + * + * @param string $filename Path to the file. + * @return int Returns the time the file was last changed, . + * The time is returned as a Unix timestamp. + * @throws Exceptions\FilesystemException + * + */ +function filectime(string $filename): int +{ + error_clear_last(); + $result = \filectime($filename); + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } + return $result; +} + + +/** + * Gets the file inode. + * + * @param string $filename Path to the file. + * @return int Returns the inode number of the file, . + * @throws Exceptions\FilesystemException + * + */ +function fileinode(string $filename): int +{ + error_clear_last(); + $result = \fileinode($filename); + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } + return $result; +} + + +/** + * This function returns the time when the data blocks of a file were being + * written to, that is, the time when the content of the file was changed. + * + * @param string $filename Path to the file. + * @return int Returns the time the file was last modified, . + * The time is returned as a Unix timestamp, which is + * suitable for the date function. + * @throws Exceptions\FilesystemException + * + */ +function filemtime(string $filename): int +{ + error_clear_last(); + $result = \filemtime($filename); + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } + return $result; +} + + +/** + * Gets the file owner. + * + * @param string $filename Path to the file. + * @return int Returns the user ID of the owner of the file, . + * The user ID is returned in numerical format, use + * posix_getpwuid to resolve it to a username. + * @throws Exceptions\FilesystemException + * + */ +function fileowner(string $filename): int +{ + error_clear_last(); + $result = \fileowner($filename); + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } + return $result; +} + + +/** + * fopen binds a named resource, specified by + * filename, to a stream. + * + * @param string $filename If filename is of the form "scheme://...", it + * is assumed to be a URL and PHP will search for a protocol handler + * (also known as a wrapper) for that scheme. If no wrappers for that + * protocol are registered, PHP will emit a notice to help you track + * potential problems in your script and then continue as though + * filename specifies a regular file. + * + * If PHP has decided that filename specifies + * a local file, then it will try to open a stream on that file. + * The file must be accessible to PHP, so you need to ensure that + * the file access permissions allow this access. + * If you have enabled safe mode + * or open_basedir further + * restrictions may apply. + * + * If PHP has decided that filename specifies + * a registered protocol, and that protocol is registered as a + * network URL, PHP will check to make sure that + * allow_url_fopen is + * enabled. If it is switched off, PHP will emit a warning and + * the fopen call will fail. + * + * The list of supported protocols can be found in . Some protocols (also referred to as + * wrappers) support context + * and/or php.ini options. Refer to the specific page for the + * protocol in use for a list of options which can be set. (e.g. + * php.ini value user_agent used by the + * http wrapper). + * + * On the Windows platform, be careful to escape any backslashes + * used in the path to the file, or use forward slashes. + * + * + * + * ]]> + * + * + * @param string $mode The mode parameter specifies the type of access + * you require to the stream. It may be any of the following: + * + * + * A list of possible modes for fopen + * using mode + * + * + * + * + * mode + * Description + * + * + * + * + * 'r' + * + * Open for reading only; place the file pointer at the + * beginning of the file. + * + * + * + * 'r+' + * + * Open for reading and writing; place the file pointer at + * the beginning of the file. + * + * + * + * 'w' + * + * Open for writing only; place the file pointer at the + * beginning of the file and truncate the file to zero length. + * If the file does not exist, attempt to create it. + * + * + * + * 'w+' + * + * Open for reading and writing; place the file pointer at + * the beginning of the file and truncate the file to zero + * length. If the file does not exist, attempt to create it. + * + * + * + * 'a' + * + * Open for writing only; place the file pointer at the end of + * the file. If the file does not exist, attempt to create it. + * In this mode, fseek has no effect, writes are always appended. + * + * + * + * 'a+' + * + * Open for reading and writing; place the file pointer at + * the end of the file. If the file does not exist, attempt to + * create it. In this mode, fseek only affects + * the reading position, writes are always appended. + * + * + * + * 'x' + * + * Create and open for writing only; place the file pointer at the + * beginning of the file. If the file already exists, the + * fopen call will fail by returning FALSE and + * generating an error of level E_WARNING. If + * the file does not exist, attempt to create it. This is equivalent + * to specifying O_EXCL|O_CREAT flags for the + * underlying open(2) system call. + * + * + * + * 'x+' + * + * Create and open for reading and writing; otherwise it has the + * same behavior as 'x'. + * + * + * + * 'c' + * + * Open the file for writing only. If the file does not exist, it is + * created. If it exists, it is neither truncated (as opposed to + * 'w'), nor the call to this function fails (as is + * the case with 'x'). The file pointer is + * positioned on the beginning of the file. This may be useful if it's + * desired to get an advisory lock (see flock) + * before attempting to modify the file, as using + * 'w' could truncate the file before the lock + * was obtained (if truncation is desired, + * ftruncate can be used after the lock is + * requested). + * + * + * + * 'c+' + * + * Open the file for reading and writing; otherwise it has the same + * behavior as 'c'. + * + * + * + * 'e' + * + * Set close-on-exec flag on the opened file descriptor. Only + * available in PHP compiled on POSIX.1-2008 conform systems. + * + * + * + * + * + * + * Different operating system families have different line-ending + * conventions. When you write a text file and want to insert a line + * break, you need to use the correct line-ending character(s) for your + * operating system. Unix based systems use \n as the + * line ending character, Windows based systems use \r\n + * as the line ending characters and Macintosh based systems use + * \r as the line ending character. + * + * If you use the wrong line ending characters when writing your files, you + * might find that other applications that open those files will "look + * funny". + * + * Windows offers a text-mode translation flag ('t') + * which will transparently translate \n to + * \r\n when working with the file. In contrast, you + * can also use 'b' to force binary mode, which will not + * translate your data. To use these flags, specify either + * 'b' or 't' as the last character + * of the mode parameter. + * + * The default translation mode depends on the SAPI and version of PHP that + * you are using, so you are encouraged to always specify the appropriate + * flag for portability reasons. You should use the 't' + * mode if you are working with plain-text files and you use + * \n to delimit your line endings in your script, but + * expect your files to be readable with applications such as notepad. You + * should use the 'b' in all other cases. + * + * If you do not specify the 'b' flag when working with binary files, you + * may experience strange problems with your data, including broken image + * files and strange problems with \r\n characters. + * + * For portability, it is strongly recommended that you always + * use the 'b' flag when opening files with fopen. + * + * Again, for portability, it is also strongly recommended that + * you re-write code that uses or relies upon the 't' + * 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 + * include_path, too. + * @param resource $context + * @return resource Returns a file pointer resource on success, . + * @throws Exceptions\FilesystemException + * + */ +function fopen(string $filename, string $mode, bool $use_include_path = false, $context = null) +{ + error_clear_last(); + if ($context !== null) { + $result = \fopen($filename, $mode, $use_include_path, $context); + }else { + $result = \fopen($filename, $mode, $use_include_path); + } + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } + return $result; +} + + +/** + * fputcsv formats a line (passed as a + * fields array) as CSV and write it (terminated by a + * newline) to the specified file handle. + * + * @param resource $handle The file pointer must be valid, and must point to + * a file successfully opened by fopen or + * fsockopen (and not yet closed by + * fclose). + * @param array $fields An array of strings. + * @param string $delimiter The optional delimiter parameter sets the field + * delimiter (one character only). + * @param string $enclosure The optional enclosure parameter sets the field + * enclosure (one character only). + * @param string $escape_char The optional escape_char parameter sets the + * escape character (one character only). + * @return int Returns the length of the written string . + * @throws Exceptions\FilesystemException + * + */ +function fputcsv($handle, array $fields, string $delimiter = ",", string $enclosure = '"', string $escape_char = "\\"): int +{ + error_clear_last(); + $result = \fputcsv($handle, $fields, $delimiter, $enclosure, $escape_char); + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } + return $result; +} + + +/** + * fread reads up to + * length bytes from the file pointer + * referenced by handle. Reading stops as soon as one + * of the following conditions is met: + * + * + * + * length bytes have been read + * + * + * + * + * EOF (end of file) is reached + * + * + * + * + * a packet becomes available or the + * socket timeout occurs (for network streams) + * + * + * + * + * if the stream is read buffered and it does not represent a plain file, at + * most one read of up to a number of bytes equal to the chunk size (usually + * 8192) is made; depending on the previously buffered data, the size of the + * returned data may be larger than the chunk size. + * + * + * + * + * @param resource $handle A file system pointer resource + * that is typically created using fopen. + * @param int $length Up to length number of bytes read. + * @return string Returns the read string . + * @throws Exceptions\FilesystemException + * + */ +function fread($handle, int $length): string +{ + error_clear_last(); + $result = \fread($handle, $length); + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } + return $result; +} + + +/** + * Takes the filepointer, handle, and truncates the file to + * length, size. + * + * @param resource $handle The file pointer. + * + * The handle must be open for writing. + * @param int $size The size to truncate to. + * + * If size is larger than the file then the file + * is extended with null bytes. + * + * If size is smaller than the file then the file + * is truncated to that size. + * @throws Exceptions\FilesystemException + * + */ +function ftruncate($handle, int $size): void +{ + error_clear_last(); + $result = \ftruncate($handle, $size); + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } +} + + +/** + * + * + * @param resource $handle A file system pointer resource + * that is typically created using fopen. + * @param string $string The string that is to be written. + * @param int $length If the length argument is given, writing will + * stop after length bytes have been written or + * the end of string is reached, whichever comes + * first. + * + * Note that if the length argument is given, + * then the magic_quotes_runtime + * configuration option will be ignored and no slashes will be + * stripped from string. + * @return int + * @throws Exceptions\FilesystemException + * + */ +function fwrite($handle, string $string, int $length): int +{ + error_clear_last(); + if ($length !== null) { + $result = \fwrite($handle, $string, $length); + }else { + $result = \fwrite($handle, $string); + } + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } + return $result; +} + + +/** + * The glob function searches for all the pathnames + * matching pattern according to the rules used by + * the libc glob() function, which is similar to the rules used by common + * shells. + * + * @param string $pattern The pattern. No tilde expansion or parameter substitution is done. + * @param int $flags Valid flags: + * + * + * + * GLOB_MARK - Adds a slash 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. + * + * + * + * @return array Returns an array containing the matched files/directories, an empty array + * if no file matched . + * @throws Exceptions\FilesystemException + * + */ +function glob(string $pattern, int $flags = 0): array +{ + error_clear_last(); + $result = \glob($pattern, $flags); + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } + return $result; +} + + +/** + * Tells whether the filename is executable. + * + * @param string $filename Path to the file. + * @throws Exceptions\FilesystemException + * + */ +function is_executable(string $filename): void +{ + error_clear_last(); + $result = \is_executable($filename); + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } +} + + +/** + * Returns TRUE if the file named by filename was + * uploaded via HTTP POST. This is useful to help ensure that a + * malicious user hasn't tried to trick the script into working on + * files upon which it should not be working--for instance, + * /etc/passwd. + * + * This sort of check is especially important if there is any chance + * that anything done with uploaded files could reveal their + * contents to the user, or even to other users on the same + * system. + * + * For proper working, the function is_uploaded_file needs + * an argument like $_FILES['userfile']['tmp_name'], - the name of the uploaded + * file on the client's machine $_FILES['userfile']['name'] does not work. + * + * @param string $filename The filename being checked. + * @throws Exceptions\FilesystemException + * + */ +function is_uploaded_file(string $filename): void +{ + error_clear_last(); + $result = \is_uploaded_file($filename); + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } +} + + +/** + * Attempts to change the group of the symlink filename + * to group. + * + * Only the superuser may change the group of a symlink arbitrarily; other + * users may change the group of a symlink to any group of which that user is + * a member. + * + * @param string $filename Path to the symlink. + * @param string|int $group The group specified by name or number. + * @throws Exceptions\FilesystemException + * + */ +function lchgrp(string $filename, $group): void +{ + error_clear_last(); + $result = \lchgrp($filename, $group); + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } +} + + +/** + * Attempts to change the owner of the symlink filename + * to user user. + * + * Only the superuser may change the owner of a symlink. + * + * @param string $filename Path to the file. + * @param string|int $user User name or number. + * @throws Exceptions\FilesystemException + * + */ +function lchown(string $filename, $user): void +{ + error_clear_last(); + $result = \lchown($filename, $user); + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } +} + + +/** + * link creates a hard link. + * + * @param string $target Target of the link. + * @param string $link The link name. + * @throws Exceptions\FilesystemException + * + */ +function link(string $target, string $link): void +{ + error_clear_last(); + $result = \link($target, $link); + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } +} + + +/** + * Attempts to create the directory specified by pathname. + * + * @param string $pathname The directory path. + * @param int $mode The mode is 0777 by default, which means the widest possible + * access. For more information on modes, read the details + * on the chmod page. + * + * mode is ignored on Windows. + * + * Note that you probably want to specify the mode as an octal number, + * which means it should have a leading zero. The mode is also modified + * by the current umask, which you can change using + * umask. + * @param bool $recursive Allows the creation of nested directories specified in the + * pathname. + * @param resource $context + * @throws Exceptions\FilesystemException + * + */ +function mkdir(string $pathname, int $mode = 0777, bool $recursive = false, $context = null): void +{ + error_clear_last(); + if ($context !== null) { + $result = \mkdir($pathname, $mode, $recursive, $context); + }else { + $result = \mkdir($pathname, $mode, $recursive); + } + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } +} + + +/** + * readlink does the same as the readlink C function. + * + * @param string $path The symbolic link path. + * @return string Returns the contents of the symbolic link path . + * @throws Exceptions\FilesystemException + * + */ +function readlink(string $path): string +{ + error_clear_last(); + $result = \readlink($path); + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } + return $result; +} + + +/** + * Attempts to rename oldname to + * newname, moving it between directories if necessary. + * If renaming a file and newname exists, + * it will be overwritten. If renaming a directory and + * newname exists, + * this function will emit a warning. + * + * @param string $oldname The old name. + * + * The wrapper used in oldname + * must match the wrapper used in + * newname. + * @param string $newname The new name. + * @param resource $context + * @throws Exceptions\FilesystemException + * + */ +function rename(string $oldname, string $newname, $context): void +{ + error_clear_last(); + if ($context !== null) { + $result = \rename($oldname, $newname, $context); + }else { + $result = \rename($oldname, $newname); + } + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } +} + + +/** + * Sets the file position indicator for handle + * to the beginning of the file stream. + * + * @param resource $handle The file pointer must be valid, and must point to a file + * successfully opened by fopen. + * @throws Exceptions\FilesystemException + * + */ +function rewind($handle): void +{ + error_clear_last(); + $result = \rewind($handle); + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } +} + + +/** + * Attempts to remove the directory named by dirname. + * The directory must be empty, and the relevant permissions must permit this. + * A E_WARNING level error will be generated on failure. + * + * @param string $dirname Path to the directory. + * @param resource $context + * @throws Exceptions\FilesystemException + * + */ +function rmdir(string $dirname, $context): void +{ + error_clear_last(); + if ($context !== null) { + $result = \rmdir($dirname, $context); + }else { + $result = \rmdir($dirname); + } + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } +} + + +/** + * symlink creates a symbolic link to the existing + * target with the specified name + * link. + * + * @param string $target Target of the link. + * @param string $link The link name. + * @throws Exceptions\FilesystemException + * + */ +function symlink(string $target, string $link): void +{ + error_clear_last(); + $result = \symlink($target, $link); + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } +} + + +/** + * Creates a temporary file with a unique name in read-write (w+) mode and + * returns a file handle . + * + * The file is automatically removed when closed (for example, by calling + * fclose, or when there are no remaining references to + * the file handle returned by tmpfile), or when the + * script ends. + * + * For details, consult your system documentation on the + * tmpfile(3) function, as well as the + * stdio.h header file. + * + * @return resource Returns a file handle, similar to the one returned by + * fopen, for the new file . + * @throws Exceptions\FilesystemException + * + */ +function tmpfile() +{ + error_clear_last(); + $result = \tmpfile(); + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } + return $result; +} + + +/** + * Attempts to set the access and modification times of the file named in the + * filename parameter to the value given in + * time. + * Note that the access time is always modified, regardless of the number + * of parameters. + * + * If the file does not exist, it will be created. + * + * @param string $filename The name of the file being touched. + * @param int $time The touch time. If time is not supplied, + * the current system time is used. + * @param int $atime If present, the access time of the given filename is set to + * the value of atime. Otherwise, it is set to + * the value passed to the time parameter. + * If neither are present, the current system time is used. + * @throws Exceptions\FilesystemException + * + */ +function touch(string $filename, int $time = null, int $atime = null): void +{ + error_clear_last(); + if ($atime !== null) { + $result = \touch($filename, $time, $atime); + }else { + $result = \touch($filename, $time); + } + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } +} + + +/** + * Deletes filename. Similar to the Unix C unlink() + * function. An E_WARNING level error will be generated on + * failure. + * + * @param string $filename Path to the file. + * @param resource $context + * @throws Exceptions\FilesystemException + * + */ +function unlink(string $filename, $context): void +{ + error_clear_last(); + if ($context !== null) { + $result = \unlink($filename, $context); + }else { + $result = \unlink($filename); + } + if ($result === FALSE) { + throw Exceptions\FilesystemException::createFromPhpError(); + } +} + + diff --git a/generated/filter.php b/generated/filter.php new file mode 100644 index 00000000..7a8d0967 --- /dev/null +++ b/generated/filter.php @@ -0,0 +1,24 @@ + 'apache_get_version', + 1 => 'apache_reset_timeout', + 2 => 'apache_response_headers', + 3 => 'apache_setenv', + 4 => 'apc_cas', + 5 => 'apc_compile_file', + 6 => 'apc_dec', + 7 => 'apc_define_constants', + 8 => 'apc_delete_file', + 9 => 'apc_delete', + 10 => 'apc_inc', + 11 => 'apc_load_constants', + 12 => 'apcu_cas', + 13 => 'apcu_dec', + 14 => 'apcu_delete', + 15 => 'apcu_inc', + 16 => 'apd_breakpoint', + 17 => 'apd_continue', + 18 => 'apd_echo', + 19 => 'apd_set_session_trace_socket', + 20 => 'override_function', + 21 => 'rename_function', + 22 => 'array_key_exists', + 23 => 'array_multisort', + 24 => 'array_walk_recursive', + 25 => 'arsort', + 26 => 'asort', + 27 => 'krsort', + 28 => 'ksort', + 29 => 'natcasesort', + 30 => 'natsort', + 31 => 'rsort', + 32 => 'shuffle', + 33 => 'sort', + 34 => 'uasort', + 35 => 'uksort', + 36 => 'usort', + 37 => 'bbcode_add_element', + 38 => 'bbcode_add_smiley', + 39 => 'bbcode_destroy', + 40 => 'bbcode_parse', + 41 => 'bbcode_set_arg_parser', + 42 => 'bbcode_set_flags', + 43 => 'bcompiler_load_exe', + 44 => 'bcompiler_load', + 45 => 'bcompiler_parse_class', + 46 => 'bcompiler_read', + 47 => 'bcompiler_write_class', + 48 => 'bcompiler_write_constant', + 49 => 'bcompiler_write_file', + 50 => 'bcompiler_write_footer', + 51 => 'bcompiler_write_function', + 52 => 'bcompiler_write_functions_from_file', + 53 => 'bcompiler_write_header', + 54 => 'bcompiler_write_included_filename', + 55 => 'bzclose', + 56 => 'bzflush', + 57 => 'bzread', + 58 => 'bzwrite', + 59 => 'cairo_create', + 60 => 'cairo_font_options_create', + 61 => 'cairo_font_options_equal', + 62 => 'cairo_font_options_get_antialias', + 63 => 'cairo_font_options_get_hint_metrics', + 64 => 'cairo_font_options_get_hint_style', + 65 => 'cairo_font_options_get_subpixel_order', + 66 => 'cairo_font_options_hash', + 67 => 'cairo_font_options_merge', + 68 => 'cairo_font_options_set_antialias', + 69 => 'cairo_font_options_set_hint_metrics', + 70 => 'cairo_font_options_set_hint_style', + 71 => 'cairo_font_options_set_subpixel_order', + 72 => 'cairo_font_options_status', + 73 => 'cairo_format_stride_for_width', + 74 => 'cairo_image_surface_create_for_data', + 75 => 'cairo_image_surface_create_from_png', + 76 => 'cairo_image_surface_create', + 77 => 'cairo_image_surface_get_data', + 78 => 'cairo_image_surface_get_format', + 79 => 'cairo_image_surface_get_height', + 80 => 'cairo_image_surface_get_stride', + 81 => 'cairo_image_surface_get_width', + 82 => 'cairo_matrix_invert', + 83 => 'cairo_matrix_multiply', + 84 => 'cairo_matrix_transform_distance', + 85 => 'cairo_matrix_transform_point', + 86 => 'cairo_matrix_translate', + 87 => 'cairo_pattern_add_color_stop_rgb', + 88 => 'cairo_pattern_add_color_stop_rgba', + 89 => 'cairo_pattern_create_for_surface', + 90 => 'cairo_pattern_create_linear', + 91 => 'cairo_pattern_create_radial', + 92 => 'cairo_pattern_create_rgb', + 93 => 'cairo_pattern_create_rgba', + 94 => 'cairo_pattern_get_color_stop_count', + 95 => 'cairo_pattern_get_color_stop_rgba', + 96 => 'cairo_pattern_get_extend', + 97 => 'cairo_pattern_get_filter', + 98 => 'cairo_pattern_get_linear_points', + 99 => 'cairo_pattern_get_matrix', + 100 => 'cairo_pattern_get_radial_circles', + 101 => 'cairo_pattern_get_rgba', + 102 => 'cairo_pattern_get_surface', + 103 => 'cairo_pattern_get_type', + 104 => 'cairo_pattern_set_extend', + 105 => 'cairo_pattern_set_filter', + 106 => 'cairo_pattern_set_matrix', + 107 => 'cairo_pattern_status', + 108 => 'cairo_pdf_surface_create', + 109 => 'cairo_pdf_surface_set_size', + 110 => 'cairo_ps_get_levels', + 111 => 'cairo_ps_level_to_string', + 112 => 'cairo_ps_surface_create', + 113 => 'cairo_ps_surface_dsc_begin_page_setup', + 114 => 'cairo_ps_surface_dsc_begin_setup', + 115 => 'cairo_ps_surface_dsc_comment', + 116 => 'cairo_ps_surface_get_eps', + 117 => 'cairo_ps_surface_restrict_to_level', + 118 => 'cairo_ps_surface_set_eps', + 119 => 'cairo_ps_surface_set_size', + 120 => 'cairo_scaled_font_create', + 121 => 'cairo_scaled_font_extents', + 122 => 'cairo_scaled_font_get_ctm', + 123 => 'cairo_scaled_font_get_font_face', + 124 => 'cairo_scaled_font_get_font_matrix', + 125 => 'cairo_scaled_font_get_font_options', + 126 => 'cairo_scaled_font_get_scale_matrix', + 127 => 'cairo_scaled_font_get_type', + 128 => 'cairo_scaled_font_glyph_extents', + 129 => 'cairo_scaled_font_status', + 130 => 'cairo_scaled_font_text_extents', + 131 => 'cairo_surface_copy_page', + 132 => 'cairo_surface_create_similar', + 133 => 'cairo_surface_finish', + 134 => 'cairo_surface_flush', + 135 => 'cairo_surface_get_content', + 136 => 'cairo_surface_get_device_offset', + 137 => 'cairo_surface_get_font_options', + 138 => 'cairo_surface_get_type', + 139 => 'cairo_surface_mark_dirty_rectangle', + 140 => 'cairo_surface_mark_dirty', + 141 => 'cairo_surface_set_device_offset', + 142 => 'cairo_surface_set_fallback_resolution', + 143 => 'cairo_surface_show_page', + 144 => 'cairo_surface_status', + 145 => 'cairo_surface_write_to_png', + 146 => 'cairo_svg_surface_create', + 147 => 'cairo_svg_surface_restrict_to_version', + 148 => 'cairo_svg_version_to_string', + 149 => 'chdb_create', + 150 => 'classkit_method_add', + 151 => 'classkit_method_remove', + 152 => 'class_alias', + 153 => 'com_event_sink', + 154 => 'com_load_typelib', + 155 => 'com_print_typeinfo', + 156 => 'crack_closedict', + 157 => 'crack_opendict', + 158 => 'curl_escape', + 159 => 'curl_exec', + 160 => 'curl_init', + 161 => 'curl_multi_errno', + 162 => 'curl_setopt', + 163 => 'curl_share_errno', + 164 => 'curl_share_setopt', + 165 => 'curl_unescape', + 166 => 'cyrus_bind', + 167 => 'cyrus_close', + 168 => 'cyrus_connect', + 169 => 'cyrus_unbind', + 170 => 'date_parse', + 171 => 'date_sun_info', + 172 => 'date_sunrise', + 173 => 'date_sunset', + 174 => 'mktime', + 175 => 'timezone_name_from_abbr', + 176 => 'dba_delete', + 177 => 'dba_firstkey', + 178 => 'dba_insert', + 179 => 'dba_nextkey', + 180 => 'dba_open', + 181 => 'dba_optimize', + 182 => 'dba_popen', + 183 => 'dba_replace', + 184 => 'dba_sync', + 185 => 'dbase_add_record', + 186 => 'dbase_close', + 187 => 'dbase_create', + 188 => 'dbase_delete_record', + 189 => 'dbase_open', + 190 => 'dbase_pack', + 191 => 'dbase_replace_record', + 192 => 'dbplus_resolve', + 193 => 'dbx_connect', + 194 => 'dbx_sort', + 195 => 'dio_open', + 196 => 'dio_truncate', + 197 => 'chdir', + 198 => 'chroot', + 199 => 'readdir', + 200 => 'rewinddir', + 201 => 'eio_busy', + 202 => 'eio_chmod', + 203 => 'eio_chown', + 204 => 'eio_close', + 205 => 'eio_custom', + 206 => 'eio_dup2', + 207 => 'eio_event_loop', + 208 => 'eio_fallocate', + 209 => 'eio_fchmod', + 210 => 'eio_fdatasync', + 211 => 'eio_fstat', + 212 => 'eio_fstatvfs', + 213 => 'eio_fsync', + 214 => 'eio_ftruncate', + 215 => 'eio_futime', + 216 => 'eio_grp', + 217 => 'eio_lstat', + 218 => 'eio_mkdir', + 219 => 'eio_mknod', + 220 => 'eio_nop', + 221 => 'eio_readahead', + 222 => 'eio_readdir', + 223 => 'eio_readlink', + 224 => 'eio_rename', + 225 => 'eio_rmdir', + 226 => 'eio_seek', + 227 => 'eio_sendfile', + 228 => 'eio_stat', + 229 => 'eio_statvfs', + 230 => 'eio_symlink', + 231 => 'eio_sync_file_range', + 232 => 'eio_sync', + 233 => 'eio_syncfs', + 234 => 'eio_truncate', + 235 => 'eio_unlink', + 236 => 'eio_utime', + 237 => 'eio_write', + 238 => 'enchant_broker_describe', + 239 => 'enchant_broker_free_dict', + 240 => 'enchant_broker_free', + 241 => 'enchant_broker_get_dict_path', + 242 => 'enchant_broker_list_dicts', + 243 => 'enchant_broker_request_dict', + 244 => 'enchant_broker_request_pwl_dict', + 245 => 'enchant_broker_set_dict_path', + 246 => 'enchant_broker_set_ordering', + 247 => 'enchant_dict_add_to_personal', + 248 => 'enchant_dict_describe', + 249 => 'enchant_dict_store_replacement', + 250 => 'error_log', + 251 => 'proc_nice', + 252 => 'fam_cancel_monitor', + 253 => 'fam_monitor_collection', + 254 => 'fam_monitor_directory', + 255 => 'fam_monitor_file', + 256 => 'fam_open', + 257 => 'fam_resume_monitor', + 258 => 'fam_suspend_monitor', + 259 => 'fann_copy', + 260 => 'fann_create_shortcut_array', + 261 => 'fann_create_shortcut', + 262 => 'fann_create_sparse_array', + 263 => 'fann_create_sparse', + 264 => 'fann_create_standard_array', + 265 => 'fann_create_standard', + 266 => 'fann_get_activation_function', + 267 => 'fann_get_activation_steepness', + 268 => 'fann_get_bit_fail_limit', + 269 => 'fann_get_bit_fail', + 270 => 'fann_get_cascade_activation_functions_count', + 271 => 'fann_get_cascade_activation_functions', + 272 => 'fann_get_cascade_activation_steepnesses_count', + 273 => 'fann_get_cascade_activation_steepnesses', + 274 => 'fann_get_cascade_candidate_change_fraction', + 275 => 'fann_get_cascade_candidate_limit', + 276 => 'fann_get_cascade_candidate_stagnation_epochs', + 277 => 'fann_get_cascade_max_cand_epochs', + 278 => 'fann_get_cascade_max_out_epochs', + 279 => 'fann_get_cascade_min_cand_epochs', + 280 => 'fann_get_cascade_min_out_epochs', + 281 => 'fann_get_cascade_num_candidate_groups', + 282 => 'fann_get_cascade_num_candidates', + 283 => 'fann_get_cascade_output_change_fraction', + 284 => 'fann_get_cascade_output_stagnation_epochs', + 285 => 'fann_get_cascade_weight_multiplier', + 286 => 'fann_get_connection_rate', + 287 => 'fann_get_errno', + 288 => 'fann_get_errstr', + 289 => 'fann_get_learning_momentum', + 290 => 'fann_get_learning_rate', + 291 => 'fann_get_MSE', + 292 => 'fann_get_network_type', + 293 => 'fann_get_num_input', + 294 => 'fann_get_num_layers', + 295 => 'fann_get_num_output', + 296 => 'fann_get_quickprop_decay', + 297 => 'fann_get_quickprop_mu', + 298 => 'fann_get_rprop_decrease_factor', + 299 => 'fann_get_rprop_delta_max', + 300 => 'fann_get_rprop_delta_min', + 301 => 'fann_get_rprop_delta_zero', + 302 => 'fann_get_rprop_increase_factor', + 303 => 'fann_get_sarprop_step_error_shift', + 304 => 'fann_get_sarprop_step_error_threshold_factor', + 305 => 'fann_get_sarprop_temperature', + 306 => 'fann_get_sarprop_weight_decay_shift', + 307 => 'fann_get_total_connections', + 308 => 'fann_get_total_neurons', + 309 => 'fann_get_train_error_function', + 310 => 'fann_get_train_stop_function', + 311 => 'fann_get_training_algorithm', + 312 => 'fann_length_train_data', + 313 => 'fann_merge_train_data', + 314 => 'fann_num_input_train_data', + 315 => 'fann_num_output_train_data', + 316 => 'fann_run', + 317 => 'fann_test_data', + 318 => 'fann_test', + 319 => 'fann_train_epoch', + 320 => 'fbsql_blob_size', + 321 => 'fbsql_change_user', + 322 => 'fbsql_clob_size', + 323 => 'fbsql_close', + 324 => 'fbsql_commit', + 325 => 'fbsql_connect', + 326 => 'fbsql_create_db', + 327 => 'fbsql_data_seek', + 328 => 'fbsql_db_query', + 329 => 'fbsql_drop_db', + 330 => 'fbsql_fetch_field', + 331 => 'fbsql_fetch_lengths', + 332 => 'fbsql_field_seek', + 333 => 'fbsql_free_result', + 334 => 'fbsql_list_dbs', + 335 => 'fbsql_list_fields', + 336 => 'fbsql_list_tables', + 337 => 'fbsql_pconnect', + 338 => 'fbsql_rollback', + 339 => 'fbsql_select_db', + 340 => 'fbsql_set_lob_mode', + 341 => 'fbsql_set_password', + 342 => 'fbsql_start_db', + 343 => 'fbsql_stop_db', + 344 => 'fdf_add_doc_javascript', + 345 => 'fdf_create', + 346 => 'fdf_get_ap', + 347 => 'fdf_open_string', + 348 => 'fdf_open', + 349 => 'fdf_save_string', + 350 => 'fdf_save', + 351 => 'fdf_set_ap', + 352 => 'fdf_set_encoding', + 353 => 'fdf_set_file', + 354 => 'fdf_set_flags', + 355 => 'fdf_set_javascript_action', + 356 => 'fdf_set_opt', + 357 => 'fdf_set_status', + 358 => 'fdf_set_submit_form_action', + 359 => 'fdf_set_target_frame', + 360 => 'fdf_set_value', + 361 => 'fdf_set_version', + 362 => 'finfo_close', + 363 => 'mime_content_type', + 364 => 'filepro_fieldcount', + 365 => 'filepro_fieldname', + 366 => 'filepro_fieldtype', + 367 => 'filepro_fieldwidth', + 368 => 'filepro_retrieve', + 369 => 'filepro_rowcount', + 370 => 'filepro', + 371 => 'chgrp', + 372 => 'chmod', + 373 => 'chown', + 374 => 'copy', + 375 => 'disk_free_space', + 376 => 'disk_total_space', + 377 => 'fclose', + 378 => 'fflush', + 379 => 'file_get_contents', + 380 => 'fileatime', + 381 => 'filectime', + 382 => 'fileinode', + 383 => 'filemtime', + 384 => 'fileowner', + 385 => 'fopen', + 386 => 'fputcsv', + 387 => 'fread', + 388 => 'ftruncate', + 389 => 'fwrite', + 390 => 'glob', + 391 => 'is_executable', + 392 => 'is_uploaded_file', + 393 => 'lchgrp', + 394 => 'lchown', + 395 => 'link', + 396 => 'mkdir', + 397 => 'readlink', + 398 => 'rename', + 399 => 'rewind', + 400 => 'rmdir', + 401 => 'symlink', + 402 => 'tmpfile', + 403 => 'touch', + 404 => 'unlink', + 405 => 'filter_has_var', + 406 => 'fastcgi_finish_request', + 407 => 'fribidi_log2vis', + 408 => 'ftp_alloc', + 409 => 'ftp_append', + 410 => 'ftp_cdup', + 411 => 'ftp_chdir', + 412 => 'ftp_chmod', + 413 => 'ftp_close', + 414 => 'ftp_connect', + 415 => 'ftp_delete', + 416 => 'ftp_fget', + 417 => 'ftp_fput', + 418 => 'ftp_get', + 419 => 'ftp_login', + 420 => 'ftp_mkdir', + 421 => 'ftp_mlsd', + 422 => 'ftp_nlist', + 423 => 'ftp_pasv', + 424 => 'ftp_put', + 425 => 'ftp_pwd', + 426 => 'ftp_rename', + 427 => 'ftp_rmdir', + 428 => 'ftp_site', + 429 => 'ftp_ssl_connect', + 430 => 'ftp_systype', + 431 => 'create_function', + 432 => 'func_get_arg', + 433 => 'register_tick_function', + 434 => 'gmp_export', + 435 => 'gmp_import', + 436 => 'gmp_random_seed', + 437 => 'gnupg_adddecryptkey', + 438 => 'gnupg_addencryptkey', + 439 => 'gnupg_addsignkey', + 440 => 'gnupg_cleardecryptkeys', + 441 => 'gnupg_clearencryptkeys', + 442 => 'gnupg_clearsignkeys', + 443 => 'gnupg_setarmor', + 444 => 'gupnp_context_get_host_ip', + 445 => 'gupnp_context_get_port', + 446 => 'gupnp_context_host_path', + 447 => 'gupnp_context_timeout_add', + 448 => 'gupnp_context_unhost_path', + 449 => 'gupnp_control_point_browse_start', + 450 => 'gupnp_control_point_browse_stop', + 451 => 'gupnp_control_point_callback_set', + 452 => 'gupnp_device_action_callback_set', + 453 => 'gupnp_root_device_get_available', + 454 => 'gupnp_root_device_set_available', + 455 => 'gupnp_root_device_start', + 456 => 'gupnp_root_device_stop', + 457 => 'gupnp_service_action_return_error', + 458 => 'gupnp_service_action_return', + 459 => 'gupnp_service_action_set', + 460 => 'gupnp_service_freeze_notify', + 461 => 'gupnp_service_notify', + 462 => 'gupnp_service_proxy_action_set', + 463 => 'gupnp_service_proxy_add_notify', + 464 => 'gupnp_service_proxy_callback_set', + 465 => 'gupnp_service_proxy_get_subscribed', + 466 => 'gupnp_service_proxy_remove_notify', + 467 => 'gupnp_service_proxy_send_action', + 468 => 'gupnp_service_proxy_set_subscribed', + 469 => 'gupnp_service_thaw_notify', + 470 => 'hash_update_file', + 471 => 'ibase_add_user', + 472 => 'ibase_blob_cancel', + 473 => 'ibase_blob_create', + 474 => 'ibase_close', + 475 => 'ibase_commit_ret', + 476 => 'ibase_commit', + 477 => 'ibase_connect', + 478 => 'ibase_delete_user', + 479 => 'ibase_drop_db', + 480 => 'ibase_free_event_handler', + 481 => 'ibase_free_query', + 482 => 'ibase_free_result', + 483 => 'ibase_maintain_db', + 484 => 'ibase_modify_user', + 485 => 'ibase_name_result', + 486 => 'ibase_pconnect', + 487 => 'ibase_rollback_ret', + 488 => 'ibase_rollback', + 489 => 'ibase_service_detach', + 490 => 'db2_autocommit', + 491 => 'db2_bind_param', + 492 => 'db2_close', + 493 => 'db2_commit', + 494 => 'db2_execute', + 495 => 'db2_free_result', + 496 => 'db2_free_stmt', + 497 => 'db2_get_option', + 498 => 'db2_pclose', + 499 => 'db2_rollback', + 500 => 'db2_set_option', + 501 => 'iconv_get_encoding', + 502 => 'iconv_set_encoding', + 503 => 'iconv', + 504 => 'id3_get_frame_long_name', + 505 => 'id3_get_frame_short_name', + 506 => 'id3_get_genre_id', + 507 => 'id3_remove_tag', + 508 => 'id3_set_tag', + 509 => 'ifx_blobinfile_mode', + 510 => 'ifx_byteasvarchar', + 511 => 'ifx_close', + 512 => 'ifx_connect', + 513 => 'ifx_copy_blob', + 514 => 'ifx_create_blob', + 515 => 'ifx_create_char', + 516 => 'ifx_do', + 517 => 'ifx_fieldproperties', + 518 => 'ifx_fieldtypes', + 519 => 'ifx_free_blob', + 520 => 'ifx_free_char', + 521 => 'ifx_free_result', + 522 => 'ifx_get_blob', + 523 => 'ifx_get_char', + 524 => 'ifx_htmltbl_result', + 525 => 'ifx_nullformat', + 526 => 'ifx_num_fields', + 527 => 'ifx_num_rows', + 528 => 'ifx_pconnect', + 529 => 'ifx_prepare', + 530 => 'ifx_query', + 531 => 'ifx_textasvarchar', + 532 => 'ifx_update_blob', + 533 => 'ifx_update_char', + 534 => 'ifxus_close_slob', + 535 => 'ifxus_create_slob', + 536 => 'ifxus_free_slob', + 537 => 'ifxus_open_slob', + 538 => 'ifxus_read_slob', + 539 => 'ifxus_seek_slob', + 540 => 'ifxus_tell_slob', + 541 => 'ifxus_write_slob', + 542 => 'image2wbmp', + 543 => 'imageaffine', + 544 => 'imageaffinematrixconcat', + 545 => 'imageaffinematrixget', + 546 => 'imagealphablending', + 547 => 'imageantialias', + 548 => 'imagearc', + 549 => 'imagebmp', + 550 => 'imagechar', + 551 => 'imagecharup', + 552 => 'imagecolorat', + 553 => 'imagecolordeallocate', + 554 => 'imagecolormatch', + 555 => 'imageconvolution', + 556 => 'imagecopy', + 557 => 'imagecopymerge', + 558 => 'imagecopymergegray', + 559 => 'imagecopyresampled', + 560 => 'imagecopyresized', + 561 => 'imagecrop', + 562 => 'imagecropauto', + 563 => 'imagedashedline', + 564 => 'imagedestroy', + 565 => 'imageellipse', + 566 => 'imagefill', + 567 => 'imagefilledarc', + 568 => 'imagefilledellipse', + 569 => 'imagefilledpolygon', + 570 => 'imagefilledrectangle', + 571 => 'imagefilltoborder', + 572 => 'imagefilter', + 573 => 'imageflip', + 574 => 'imagegammacorrect', + 575 => 'imagegd', + 576 => 'imagegd2', + 577 => 'imagegif', + 578 => 'imagejpeg', + 579 => 'imagelayereffect', + 580 => 'imageline', + 581 => 'imageloadfont', + 582 => 'imageopenpolygon', + 583 => 'imagepng', + 584 => 'imagepolygon', + 585 => 'imagepsencodefont', + 586 => 'imagepsextendfont', + 587 => 'imagepsfreefont', + 588 => 'imagepsslantfont', + 589 => 'imagerectangle', + 590 => 'imageresolution', + 591 => 'imagerotate', + 592 => 'imagesavealpha', + 593 => 'imagescale', + 594 => 'imagesetbrush', + 595 => 'imagesetclip', + 596 => 'imagesetinterpolation', + 597 => 'imagesetpixel', + 598 => 'imagesetstyle', + 599 => 'imagesetthickness', + 600 => 'imagesettile', + 601 => 'imagestring', + 602 => 'imagestringup', + 603 => 'imagesx', + 604 => 'imagesy', + 605 => 'imagetruecolortopalette', + 606 => 'imagettfbbox', + 607 => 'imagettftext', + 608 => 'imagewbmp', + 609 => 'imagewebp', + 610 => 'imagexbm', + 611 => 'iptcembed', + 612 => 'iptcparse', + 613 => 'jpeg2wbmp', + 614 => 'png2wbmp', + 615 => 'imap_append', + 616 => 'imap_clearflag_full', + 617 => 'imap_close', + 618 => 'imap_createmailbox', + 619 => 'imap_deletemailbox', + 620 => 'imap_gc', + 621 => 'imap_headerinfo', + 622 => 'imap_mail_copy', + 623 => 'imap_mail_move', + 624 => 'imap_mail', + 625 => 'imap_mutf7_to_utf8', + 626 => 'imap_num_msg', + 627 => 'imap_open', + 628 => 'imap_renamemailbox', + 629 => 'imap_savebody', + 630 => 'imap_set_quota', + 631 => 'imap_setacl', + 632 => 'imap_setflag_full', + 633 => 'imap_subscribe', + 634 => 'imap_thread', + 635 => 'imap_undelete', + 636 => 'imap_unsubscribe', + 637 => 'imap_utf8_to_mutf7', + 638 => 'assert_options', + 639 => 'cli_set_process_title', + 640 => 'dl', + 641 => 'getlastmod', + 642 => 'getmygid', + 643 => 'getmyinode', + 644 => 'getmypid', + 645 => 'getmyuid', + 646 => 'phpcredits', + 647 => 'phpinfo', + 648 => 'putenv', + 649 => 'set_include_path', + 650 => 'set_magic_quotes_runtime', + 651 => 'ingres_autocommit', + 652 => 'ingres_close', + 653 => 'ingres_commit', + 654 => 'ingres_execute', + 655 => 'ingres_field_name', + 656 => 'ingres_field_type', + 657 => 'ingres_free_result', + 658 => 'ingres_result_seek', + 659 => 'ingres_rollback', + 660 => 'ingres_set_environment', + 661 => 'inotify_init', + 662 => 'inotify_rm_watch', + 663 => 'json_encode', + 664 => 'json_last_error_msg', + 665 => 'kadm5_chpass_principal', + 666 => 'kadm5_create_principal', + 667 => 'kadm5_delete_principal', + 668 => 'kadm5_destroy', + 669 => 'kadm5_flush', + 670 => 'kadm5_get_policies', + 671 => 'kadm5_get_principal', + 672 => 'kadm5_get_principals', + 673 => 'kadm5_init_with_password', + 674 => 'kadm5_modify_principal', + 675 => 'ldap_add', + 676 => 'ldap_bind', + 677 => 'ldap_control_paged_result_response', + 678 => 'ldap_control_paged_result', + 679 => 'ldap_count_entries', + 680 => 'ldap_delete', + 681 => 'ldap_exop_whoami', + 682 => 'ldap_exop', + 683 => 'ldap_explode_dn', + 684 => 'ldap_first_attribute', + 685 => 'ldap_first_entry', + 686 => 'ldap_free_result', + 687 => 'ldap_get_attributes', + 688 => 'ldap_get_dn', + 689 => 'ldap_get_entries', + 690 => 'ldap_get_option', + 691 => 'ldap_get_values_len', + 692 => 'ldap_get_values', + 693 => 'ldap_list', + 694 => 'ldap_mod_add', + 695 => 'ldap_mod_del', + 696 => 'ldap_mod_replace', + 697 => 'ldap_modify_batch', + 698 => 'ldap_next_attribute', + 699 => 'ldap_parse_exop', + 700 => 'ldap_parse_result', + 701 => 'ldap_read', + 702 => 'ldap_rename', + 703 => 'ldap_sasl_bind', + 704 => 'ldap_search', + 705 => 'ldap_set_option', + 706 => 'ldap_unbind', + 707 => 'event_add', + 708 => 'event_base_loopbreak', + 709 => 'event_base_loopexit', + 710 => 'event_base_new', + 711 => 'event_base_priority_init', + 712 => 'event_base_reinit', + 713 => 'event_base_set', + 714 => 'event_buffer_base_set', + 715 => 'event_buffer_disable', + 716 => 'event_buffer_enable', + 717 => 'event_buffer_new', + 718 => 'event_buffer_priority_set', + 719 => 'event_buffer_set_callback', + 720 => 'event_buffer_write', + 721 => 'event_del', + 722 => 'event_new', + 723 => 'event_priority_set', + 724 => 'event_set', + 725 => 'event_timer_set', + 726 => 'libxml_set_external_entity_loader', + 727 => 'lzf_compress', + 728 => 'lzf_decompress', + 729 => 'mailparse_msg_extract_part_file', + 730 => 'mailparse_msg_free', + 731 => 'mailparse_msg_parse_file', + 732 => 'mailparse_msg_parse', + 733 => 'mailparse_stream_encode', + 734 => 'maxdb_report', + 735 => 'mb_check_encoding', + 736 => 'mb_chr', + 737 => 'mb_encoding_aliases', + 738 => 'mb_ereg_replace_callback', + 739 => 'mb_ereg_replace', + 740 => 'mb_ereg_search_getregs', + 741 => 'mb_ereg_search_init', + 742 => 'mb_ereg_search_regs', + 743 => 'mb_ereg_search_setpos', + 744 => 'mb_eregi_replace', + 745 => 'mb_http_output', + 746 => 'mb_internal_encoding', + 747 => 'mb_ord', + 748 => 'mb_parse_str', + 749 => 'mb_regex_encoding', + 750 => 'mb_send_mail', + 751 => 'mcrypt_create_iv', + 752 => 'mcrypt_decrypt', + 753 => 'mcrypt_encrypt', + 754 => 'mcrypt_generic_deinit', + 755 => 'mcrypt_generic_end', + 756 => 'mcrypt_module_close', + 757 => 'mcrypt_module_open', + 758 => 'mhash_keygen_s2k', + 759 => 'mhash', + 760 => 'define', + 761 => 'sapi_windows_cp_set', + 762 => 'sapi_windows_vt100_support', + 763 => 'sleep', + 764 => 'time_nanosleep', + 765 => 'time_sleep_until', + 766 => 'udm_add_search_limit', + 767 => 'udm_alloc_agent_array', + 768 => 'udm_find', + 769 => 'udm_free_agent', + 770 => 'udm_free_res', + 771 => 'udm_get_res_field', + 772 => 'udm_get_res_param', + 773 => 'udm_load_ispell_data', + 774 => 'udm_set_agent_param', + 775 => 'msql_affected_rows', + 776 => 'msql_close', + 777 => 'msql_connect', + 778 => 'msql_create_db', + 779 => 'msql_data_seek', + 780 => 'msql_db_query', + 781 => 'msql_drop_db', + 782 => 'msql_field_len', + 783 => 'msql_field_name', + 784 => 'msql_field_seek', + 785 => 'msql_field_table', + 786 => 'msql_free_result', + 787 => 'msql_pconnect', + 788 => 'msql_query', + 789 => 'msql_select_db', + 790 => 'mssql_close', + 791 => 'mssql_data_seek', + 792 => 'mssql_field_seek', + 793 => 'mssql_free_result', + 794 => 'mssql_free_statement', + 795 => 'mssql_init', + 796 => 'mssql_select_db', + 797 => 'mysql_close', + 798 => 'mysql_drop_db', + 799 => 'mysql_get_proto_info', + 800 => 'mysql_list_processes', + 801 => 'mysql_list_tables', + 802 => 'mysql_set_charset', + 803 => 'mysql_tablename', + 804 => 'mysql_thread_id', + 805 => 'mysql_unbuffered_query', + 806 => 'mysqlnd_ms_dump_servers', + 807 => 'mysqlnd_ms_fabric_select_global', + 808 => 'mysqlnd_ms_fabric_select_shard', + 809 => 'mysqlnd_ms_get_last_used_connection', + 810 => 'mysqlnd_qc_clear_cache', + 811 => 'mysqlnd_qc_set_is_select', + 812 => 'mysqlnd_qc_set_storage_handler', + 813 => 'ncurses_clear', + 814 => 'ncurses_clrtobot', + 815 => 'ncurses_clrtoeol', + 816 => 'ncurses_doupdate', + 817 => 'ncurses_erase', + 818 => 'ncurses_slk_init', + 819 => 'closelog', + 820 => 'dns_get_record', + 821 => 'getprotobyname', + 822 => 'getprotobynumber', + 823 => 'header_register_callback', + 824 => 'openlog', + 825 => 'setrawcookie', + 826 => 'syslog', + 827 => 'newt_button', + 828 => 'newt_form', + 829 => 'yp_first', + 830 => 'yp_match', + 831 => 'yp_next', + 832 => 'yp_order', + 833 => 'nsapi_virtual', + 834 => 'oci_bind_array_by_name', + 835 => 'oci_bind_by_name', + 836 => 'oci_cancel', + 837 => 'oci_close', + 838 => 'oci_commit', + 839 => 'oci_connect', + 840 => 'oci_define_by_name', + 841 => 'oci_execute', + 842 => 'oci_fetch_all', + 843 => 'oci_field_name', + 844 => 'oci_field_precision', + 845 => 'oci_field_scale', + 846 => 'oci_field_size', + 847 => 'oci_field_type_raw', + 848 => 'oci_field_type', + 849 => 'oci_free_statement', + 850 => 'oci_new_collection', + 851 => 'oci_new_connect', + 852 => 'oci_new_cursor', + 853 => 'oci_new_descriptor', + 854 => 'oci_num_fields', + 855 => 'oci_num_rows', + 856 => 'oci_parse', + 857 => 'oci_pconnect', + 858 => 'oci_result', + 859 => 'oci_rollback', + 860 => 'oci_server_version', + 861 => 'oci_set_action', + 862 => 'oci_set_client_identifier', + 863 => 'oci_set_client_info', + 864 => 'oci_set_edition', + 865 => 'oci_set_module_name', + 866 => 'oci_set_prefetch', + 867 => 'oci_statement_type', + 868 => 'oci_unregister_taf_callback', + 869 => 'opcache_compile_file', + 870 => 'openal_buffer_data', + 871 => 'openal_buffer_destroy', + 872 => 'openal_buffer_get', + 873 => 'openal_buffer_loadwav', + 874 => 'openal_context_current', + 875 => 'openal_context_destroy', + 876 => 'openal_context_process', + 877 => 'openal_context_suspend', + 878 => 'openal_device_close', + 879 => 'openal_listener_get', + 880 => 'openal_listener_set', + 881 => 'openal_source_destroy', + 882 => 'openal_source_get', + 883 => 'openal_source_pause', + 884 => 'openal_source_play', + 885 => 'openal_source_rewind', + 886 => 'openal_source_set', + 887 => 'openal_source_stop', + 888 => 'openal_stream', + 889 => 'openssl_csr_export_to_file', + 890 => 'openssl_csr_export', + 891 => 'openssl_csr_get_subject', + 892 => 'openssl_csr_new', + 893 => 'openssl_decrypt', + 894 => 'openssl_dh_compute_key', + 895 => 'openssl_digest', + 896 => 'openssl_encrypt', + 897 => 'openssl_open', + 898 => 'openssl_pbkdf2', + 899 => 'openssl_pkcs12_export_to_file', + 900 => 'openssl_pkcs12_export', + 901 => 'openssl_pkcs12_read', + 902 => 'openssl_pkcs7_decrypt', + 903 => 'openssl_pkcs7_encrypt', + 904 => 'openssl_pkcs7_read', + 905 => 'openssl_pkcs7_sign', + 906 => 'openssl_pkey_export_to_file', + 907 => 'openssl_pkey_export', + 908 => 'openssl_pkey_get_private', + 909 => 'openssl_pkey_get_public', + 910 => 'openssl_pkey_new', + 911 => 'openssl_private_decrypt', + 912 => 'openssl_private_encrypt', + 913 => 'openssl_public_decrypt', + 914 => 'openssl_public_encrypt', + 915 => 'openssl_random_pseudo_bytes', + 916 => 'openssl_seal', + 917 => 'openssl_sign', + 918 => 'openssl_x509_export_to_file', + 919 => 'openssl_x509_export', + 920 => 'openssl_x509_read', + 921 => 'ob_end_clean', + 922 => 'ob_end_flush', + 923 => 'output_add_rewrite_var', + 924 => 'output_reset_rewrite_vars', + 925 => 'px_close', + 926 => 'px_create_fp', + 927 => 'px_date2string', + 928 => 'px_delete_record', + 929 => 'px_delete', + 930 => 'px_get_parameter', + 931 => 'px_get_value', + 932 => 'px_open_fp', + 933 => 'px_put_record', + 934 => 'px_set_blob_file', + 935 => 'px_set_parameter', + 936 => 'px_set_tablename', + 937 => 'px_set_value', + 938 => 'px_timestamp2string', + 939 => 'px_update_record', + 940 => 'password_hash', + 941 => 'pcntl_exec', + 942 => 'pcntl_getpriority', + 943 => 'pcntl_setpriority', + 944 => 'pcntl_signal_dispatch', + 945 => 'pcntl_sigprocmask', + 946 => 'pcntl_strerror', + 947 => 'preg_match_all', + 948 => 'preg_match', + 949 => 'preg_split', + 950 => 'PDF_activate_item', + 951 => 'PDF_add_locallink', + 952 => 'PDF_add_nameddest', + 953 => 'PDF_add_note', + 954 => 'PDF_add_pdflink', + 955 => 'PDF_add_thumbnail', + 956 => 'PDF_add_weblink', + 957 => 'PDF_attach_file', + 958 => 'PDF_begin_layer', + 959 => 'PDF_begin_page_ext', + 960 => 'PDF_begin_page', + 961 => 'PDF_circle', + 962 => 'PDF_clip', + 963 => 'PDF_close_pdi_page', + 964 => 'PDF_close_pdi', + 965 => 'PDF_close', + 966 => 'PDF_closepath_fill_stroke', + 967 => 'PDF_closepath_stroke', + 968 => 'PDF_closepath', + 969 => 'PDF_concat', + 970 => 'PDF_continue_text', + 971 => 'PDF_curveto', + 972 => 'PDF_delete', + 973 => 'PDF_end_layer', + 974 => 'PDF_end_page_ext', + 975 => 'PDF_end_page', + 976 => 'PDF_end_pattern', + 977 => 'PDF_end_template', + 978 => 'PDF_fill_stroke', + 979 => 'PDF_fill', + 980 => 'PDF_fit_image', + 981 => 'PDF_fit_pdi_page', + 982 => 'PDF_fit_textline', + 983 => 'PDF_initgraphics', + 984 => 'PDF_lineto', + 985 => 'PDF_makespotcolor', + 986 => 'PDF_moveto', + 987 => 'PDF_open_file', + 988 => 'PDF_place_image', + 989 => 'PDF_place_pdi_page', + 990 => 'PDF_rect', + 991 => 'PDF_restore', + 992 => 'PDF_rotate', + 993 => 'PDF_save', + 994 => 'PDF_scale', + 995 => 'PDF_set_border_color', + 996 => 'PDF_set_border_dash', + 997 => 'PDF_set_border_style', + 998 => 'PDF_set_info', + 999 => 'PDF_set_layer_dependency', + 1000 => 'PDF_set_parameter', + 1001 => 'PDF_set_text_pos', + 1002 => 'PDF_set_value', + 1003 => 'PDF_setcolor', + 1004 => 'PDF_setdash', + 1005 => 'PDF_setdashpattern', + 1006 => 'PDF_setflat', + 1007 => 'PDF_setfont', + 1008 => 'PDF_setgray_fill', + 1009 => 'PDF_setgray_stroke', + 1010 => 'PDF_setgray', + 1011 => 'PDF_setlinejoin', + 1012 => 'PDF_setlinewidth', + 1013 => 'PDF_setmatrix', + 1014 => 'PDF_setmiterlimit', + 1015 => 'PDF_setrgbcolor_fill', + 1016 => 'PDF_setrgbcolor_stroke', + 1017 => 'PDF_setrgbcolor', + 1018 => 'PDF_show_xy', + 1019 => 'PDF_show', + 1020 => 'PDF_skew', + 1021 => 'PDF_stroke', + 1022 => 'pg_cancel_query', + 1023 => 'pg_client_encoding', + 1024 => 'pg_close', + 1025 => 'pg_connection_reset', + 1026 => 'pg_convert', + 1027 => 'pg_copy_from', + 1028 => 'pg_dbname', + 1029 => 'pg_delete', + 1030 => 'pg_end_copy', + 1031 => 'pg_execute', + 1032 => 'pg_field_name', + 1033 => 'pg_field_type', + 1034 => 'pg_flush', + 1035 => 'pg_free_result', + 1036 => 'pg_host', + 1037 => 'pg_insert', + 1038 => 'pg_last_error', + 1039 => 'pg_last_notice', + 1040 => 'pg_last_oid', + 1041 => 'pg_lo_close', + 1042 => 'pg_lo_export', + 1043 => 'pg_lo_open', + 1044 => 'pg_lo_read_all', + 1045 => 'pg_lo_read', + 1046 => 'pg_lo_seek', + 1047 => 'pg_lo_truncate', + 1048 => 'pg_lo_unlink', + 1049 => 'pg_lo_write', + 1050 => 'pg_meta_data', + 1051 => 'pg_options', + 1052 => 'pg_ping', + 1053 => 'pg_port', + 1054 => 'pg_prepare', + 1055 => 'pg_put_line', + 1056 => 'pg_query_params', + 1057 => 'pg_query', + 1058 => 'pg_result_seek', + 1059 => 'pg_select', + 1060 => 'pg_send_query_params', + 1061 => 'pg_send_query', + 1062 => 'pg_socket', + 1063 => 'pg_trace', + 1064 => 'pg_tty', + 1065 => 'pg_update', + 1066 => 'pg_version', + 1067 => 'posix_access', + 1068 => 'posix_getgrnam', + 1069 => 'posix_getpgid', + 1070 => 'posix_initgroups', + 1071 => 'posix_kill', + 1072 => 'posix_mkfifo', + 1073 => 'posix_mknod', + 1074 => 'posix_setegid', + 1075 => 'posix_seteuid', + 1076 => 'posix_setgid', + 1077 => 'posix_setpgid', + 1078 => 'posix_setrlimit', + 1079 => 'posix_setuid', + 1080 => 'setthreadtitle', + 1081 => 'ps_add_launchlink', + 1082 => 'ps_add_locallink', + 1083 => 'ps_add_note', + 1084 => 'ps_add_pdflink', + 1085 => 'ps_add_weblink', + 1086 => 'ps_arc', + 1087 => 'ps_arcn', + 1088 => 'ps_begin_page', + 1089 => 'ps_begin_pattern', + 1090 => 'ps_begin_template', + 1091 => 'ps_circle', + 1092 => 'ps_clip', + 1093 => 'ps_close_image', + 1094 => 'ps_close', + 1095 => 'ps_closepath_stroke', + 1096 => 'ps_closepath', + 1097 => 'ps_continue_text', + 1098 => 'ps_curveto', + 1099 => 'ps_delete', + 1100 => 'ps_end_page', + 1101 => 'ps_end_pattern', + 1102 => 'ps_end_template', + 1103 => 'ps_fill_stroke', + 1104 => 'ps_fill', + 1105 => 'ps_get_parameter', + 1106 => 'ps_hyphenate', + 1107 => 'ps_include_file', + 1108 => 'ps_lineto', + 1109 => 'ps_moveto', + 1110 => 'ps_new', + 1111 => 'ps_open_file', + 1112 => 'ps_place_image', + 1113 => 'ps_rect', + 1114 => 'ps_restore', + 1115 => 'ps_rotate', + 1116 => 'ps_save', + 1117 => 'ps_scale', + 1118 => 'ps_set_border_color', + 1119 => 'ps_set_border_dash', + 1120 => 'ps_set_border_style', + 1121 => 'ps_set_info', + 1122 => 'ps_set_parameter', + 1123 => 'ps_set_text_pos', + 1124 => 'ps_set_value', + 1125 => 'ps_setcolor', + 1126 => 'ps_setdash', + 1127 => 'ps_setflat', + 1128 => 'ps_setfont', + 1129 => 'ps_setgray', + 1130 => 'ps_setlinecap', + 1131 => 'ps_setlinejoin', + 1132 => 'ps_setlinewidth', + 1133 => 'ps_setmiterlimit', + 1134 => 'ps_setoverprintmode', + 1135 => 'ps_setpolydash', + 1136 => 'ps_shading_pattern', + 1137 => 'ps_shading', + 1138 => 'ps_shfill', + 1139 => 'ps_show_xy', + 1140 => 'ps_show_xy2', + 1141 => 'ps_show', + 1142 => 'ps_show2', + 1143 => 'ps_stroke', + 1144 => 'ps_symbol', + 1145 => 'ps_translate', + 1146 => 'pspell_add_to_personal', + 1147 => 'pspell_add_to_session', + 1148 => 'pspell_clear_session', + 1149 => 'pspell_config_create', + 1150 => 'pspell_config_data_dir', + 1151 => 'pspell_config_dict_dir', + 1152 => 'pspell_config_ignore', + 1153 => 'pspell_config_mode', + 1154 => 'pspell_config_personal', + 1155 => 'pspell_config_repl', + 1156 => 'pspell_config_runtogether', + 1157 => 'pspell_config_save_repl', + 1158 => 'pspell_new', + 1159 => 'pspell_save_wordlist', + 1160 => 'pspell_store_replacement', + 1161 => 'radius_acct_open', + 1162 => 'radius_add_server', + 1163 => 'radius_auth_open', + 1164 => 'radius_close', + 1165 => 'radius_config', + 1166 => 'radius_create_request', + 1167 => 'radius_demangle_mppe_key', + 1168 => 'radius_demangle', + 1169 => 'radius_get_tagged_attr_data', + 1170 => 'radius_get_tagged_attr_tag', + 1171 => 'radius_get_vendor_attr', + 1172 => 'radius_put_addr', + 1173 => 'radius_put_attr', + 1174 => 'radius_put_int', + 1175 => 'radius_put_string', + 1176 => 'radius_put_vendor_addr', + 1177 => 'radius_put_vendor_attr', + 1178 => 'radius_put_vendor_int', + 1179 => 'radius_put_vendor_string', + 1180 => 'radius_request_authenticator', + 1181 => 'radius_salt_encrypt_attr', + 1182 => 'radius_server_secret', + 1183 => 'readline_add_history', + 1184 => 'readline_callback_handler_install', + 1185 => 'readline_clear_history', + 1186 => 'readline_completion_function', + 1187 => 'readline_read_history', + 1188 => 'readline_write_history', + 1189 => 'rpm_close', + 1190 => 'rpm_is_valid', + 1191 => 'rrd_create', + 1192 => 'runkit_function_copy', + 1193 => 'runkit_function_remove', + 1194 => 'runkit_function_rename', + 1195 => 'runkit_import', + 1196 => 'runkit_lint_file', + 1197 => 'runkit_lint', + 1198 => 'runkit_method_remove', + 1199 => 'msg_queue_exists', + 1200 => 'msg_receive', + 1201 => 'msg_remove_queue', + 1202 => 'msg_send', + 1203 => 'msg_set_queue', + 1204 => 'sem_acquire', + 1205 => 'sem_get', + 1206 => 'sem_release', + 1207 => 'sem_remove', + 1208 => 'shm_put_var', + 1209 => 'shm_remove_var', + 1210 => 'shm_remove', + 1211 => 'session_abort', + 1212 => 'session_decode', + 1213 => 'session_destroy', + 1214 => 'session_regenerate_id', + 1215 => 'session_register', + 1216 => 'session_reset', + 1217 => 'session_set_cookie_params', + 1218 => 'session_unregister', + 1219 => 'session_unset', + 1220 => 'session_write_close', + 1221 => 'session_pgsql_add_error', + 1222 => 'session_pgsql_reset', + 1223 => 'session_pgsql_set_field', + 1224 => 'shmop_delete', + 1225 => 'shmop_read', + 1226 => 'simplexml_import_dom', + 1227 => 'socket_accept', + 1228 => 'socket_bind', + 1229 => 'socket_create_listen', + 1230 => 'socket_create_pair', + 1231 => 'socket_create', + 1232 => 'socket_export_stream', + 1233 => 'socket_get_option', + 1234 => 'socket_listen', + 1235 => 'socket_read', + 1236 => 'socket_send', + 1237 => 'socket_sendmsg', + 1238 => 'socket_sendto', + 1239 => 'socket_set_block', + 1240 => 'socket_set_nonblock', + 1241 => 'socket_set_option', + 1242 => 'socket_shutdown', + 1243 => 'socket_write', + 1244 => 'sodium_crypto_pwhash', + 1245 => 'class_implements', + 1246 => 'class_parents', + 1247 => 'class_uses', + 1248 => 'spl_autoload_unregister', + 1249 => 'sqlite_popen', + 1250 => 'sqlsrv_begin_transaction', + 1251 => 'sqlsrv_cancel', + 1252 => 'sqlsrv_close', + 1253 => 'sqlsrv_commit', + 1254 => 'sqlsrv_configure', + 1255 => 'sqlsrv_execute', + 1256 => 'sqlsrv_free_stmt', + 1257 => 'sqlsrv_next_result', + 1258 => 'sqlsrv_num_rows', + 1259 => 'sqlsrv_prepare', + 1260 => 'sqlsrv_query', + 1261 => 'sqlsrv_rollback', + 1262 => 'ssh2_auth_agent', + 1263 => 'ssh2_auth_hostbased_file', + 1264 => 'ssh2_auth_password', + 1265 => 'ssh2_auth_pubkey_file', + 1266 => 'ssh2_connect', + 1267 => 'ssh2_disconnect', + 1268 => 'ssh2_exec', + 1269 => 'ssh2_publickey_add', + 1270 => 'ssh2_publickey_init', + 1271 => 'ssh2_publickey_remove', + 1272 => 'ssh2_scp_recv', + 1273 => 'ssh2_scp_send', + 1274 => 'ssh2_sftp_chmod', + 1275 => 'ssh2_sftp_mkdir', + 1276 => 'ssh2_sftp_rename', + 1277 => 'ssh2_sftp_rmdir', + 1278 => 'ssh2_sftp_symlink', + 1279 => 'ssh2_sftp_unlink', + 1280 => 'stream_context_set_params', + 1281 => 'stream_copy_to_stream', + 1282 => 'stream_filter_append', + 1283 => 'stream_filter_prepend', + 1284 => 'stream_filter_register', + 1285 => 'stream_filter_remove', + 1286 => 'stream_get_contents', + 1287 => 'stream_is_local', + 1288 => 'stream_isatty', + 1289 => 'stream_resolve_include_path', + 1290 => 'stream_set_blocking', + 1291 => 'stream_set_timeout', + 1292 => 'stream_socket_accept', + 1293 => 'stream_socket_server', + 1294 => 'stream_socket_shutdown', + 1295 => 'stream_supports_lock', + 1296 => 'stream_wrapper_register', + 1297 => 'stream_wrapper_restore', + 1298 => 'stream_wrapper_unregister', + 1299 => 'convert_uudecode', + 1300 => 'convert_uuencode', + 1301 => 'hex2bin', + 1302 => 'metaphone', + 1303 => 'sprintf', + 1304 => 'substr', + 1305 => 'sha256_file', + 1306 => 'sha256', + 1307 => 'suhosin_encrypt_cookie', + 1308 => 'svn_add', + 1309 => 'svn_checkout', + 1310 => 'svn_cleanup', + 1311 => 'svn_delete', + 1312 => 'svn_export', + 1313 => 'svn_import', + 1314 => 'svn_mkdir', + 1315 => 'svn_revert', + 1316 => 'swoole_async_write', + 1317 => 'swoole_async_writefile', + 1318 => 'swoole_event_defer', + 1319 => 'swoole_event_del', + 1320 => 'swoole_event_write', + 1321 => 'sybase_close', + 1322 => 'sybase_data_seek', + 1323 => 'sybase_field_seek', + 1324 => 'sybase_free_result', + 1325 => 'sybase_pconnect', + 1326 => 'sybase_query', + 1327 => 'sybase_select_db', + 1328 => 'sybase_set_message_handler', + 1329 => 'sybase_unbuffered_query', + 1330 => 'tidy_reset_config', + 1331 => 'tidy_save_config', + 1332 => 'tidy_set_encoding', + 1333 => 'tidy_setopt', + 1334 => 'odbc_binmode', + 1335 => 'odbc_columnprivileges', + 1336 => 'odbc_columns', + 1337 => 'odbc_commit', + 1338 => 'odbc_data_source', + 1339 => 'odbc_exec', + 1340 => 'odbc_execute', + 1341 => 'odbc_fetch_into', + 1342 => 'odbc_field_len', + 1343 => 'odbc_field_name', + 1344 => 'odbc_field_num', + 1345 => 'odbc_field_scale', + 1346 => 'odbc_field_type', + 1347 => 'odbc_foreignkeys', + 1348 => 'odbc_longreadlen', + 1349 => 'odbc_prepare', + 1350 => 'odbc_primarykeys', + 1351 => 'odbc_result_all', + 1352 => 'odbc_result', + 1353 => 'odbc_rollback', + 1354 => 'odbc_setoption', + 1355 => 'odbc_statistics', + 1356 => 'odbc_tableprivileges', + 1357 => 'odbc_tables', + 1358 => 'base64_decode', + 1359 => 'base64_encode', + 1360 => 'import_request_variables', + 1361 => 'settype', + 1362 => 'wddx_add_vars', + 1363 => 'wddx_packet_start', + 1364 => 'wddx_serialize_value', + 1365 => 'wddx_serialize_vars', + 1366 => 'wincache_fcache_fileinfo', + 1367 => 'wincache_fcache_meminfo', + 1368 => 'wincache_lock', + 1369 => 'wincache_ocache_fileinfo', + 1370 => 'wincache_ocache_meminfo', + 1371 => 'wincache_refresh_if_changed', + 1372 => 'wincache_rplist_fileinfo', + 1373 => 'wincache_rplist_meminfo', + 1374 => 'wincache_scache_info', + 1375 => 'wincache_scache_meminfo', + 1376 => 'wincache_ucache_cas', + 1377 => 'wincache_ucache_clear', + 1378 => 'wincache_ucache_delete', + 1379 => 'wincache_ucache_info', + 1380 => 'wincache_ucache_meminfo', + 1381 => 'wincache_unlock', + 1382 => 'xattr_remove', + 1383 => 'xattr_set', + 1384 => 'xdiff_file_bdiff', + 1385 => 'xdiff_file_bpatch', + 1386 => 'xdiff_file_diff_binary', + 1387 => 'xdiff_file_diff', + 1388 => 'xdiff_file_patch_binary', + 1389 => 'xdiff_file_rabdiff', + 1390 => 'xdiff_string_bpatch', + 1391 => 'xdiff_string_patch_binary', + 1392 => 'xdiff_string_patch', + 1393 => 'xml_set_object', + 1394 => 'xmlrpc_set_type', + 1395 => 'yaml_parse_file', + 1396 => 'yaml_parse_url', + 1397 => 'yaml_parse', + 1398 => 'yaz_ccl_parse', + 1399 => 'yaz_close', + 1400 => 'yaz_connect', + 1401 => 'yaz_database', + 1402 => 'yaz_element', + 1403 => 'yaz_present', + 1404 => 'yaz_search', + 1405 => 'yaz_wait', + 1406 => 'zip_entry_close', + 1407 => 'zip_entry_open', + 1408 => 'zip_entry_read', + 1409 => 'deflate_add', + 1410 => 'deflate_init', + 1411 => 'gzclose', + 1412 => 'gzcompress', + 1413 => 'gzdecode', + 1414 => 'gzdeflate', + 1415 => 'gzencode', + 1416 => 'gzgets', + 1417 => 'gzgetss', + 1418 => 'gzinflate', + 1419 => 'gzpassthru', + 1420 => 'gzrewind', + 1421 => 'gzuncompress', + 1422 => 'inflate_get_read_len', + 1423 => 'inflate_get_status', + 1424 => 'inflate_add', + 1425 => 'inflate_init', + 1426 => 'zlib_decode', +); + diff --git a/generated/gmp.php b/generated/gmp.php new file mode 100644 index 00000000..6eb163ad --- /dev/null +++ b/generated/gmp.php @@ -0,0 +1,68 @@ + + * + * + * Note that open_basedir does + * not apply to fontfile. + * @param string $text The string to be measured. + * @return array imagettfbbox returns an array with 8 + * elements representing four points making the bounding box of the + * text on success and FALSE on error. + * + * + * + * + * key + * contents + * + * + * + * + * 0 + * lower left corner, X position + * + * + * 1 + * lower left corner, Y position + * + * + * 2 + * lower right corner, X position + * + * + * 3 + * lower right corner, Y position + * + * + * 4 + * upper right corner, X position + * + * + * 5 + * upper right corner, Y position + * + * + * 6 + * upper left corner, X position + * + * + * 7 + * upper left corner, Y position + * + * + * + * + * + * The points are relative to the text regardless of the + * angle, so "upper left" means in the top left-hand + * corner seeing the text horizontally. + * @throws Exceptions\ImageException + * + */ +function imagettfbbox(float $size, float $angle, string $fontfile, string $text): array +{ + error_clear_last(); + $result = \imagettfbbox($size, $angle, $fontfile, $text); + if ($result === FALSE) { + throw Exceptions\ImageException::createFromPhpError(); + } + return $result; +} + + +/** + * Writes the given text into the image using TrueType + * fonts. + * + * @param resource $image An image resource, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param float $size The font size in points. + * @param float $angle The angle in degrees, with 0 degrees being left-to-right reading text. + * Higher values represent a counter-clockwise rotation. For example, a + * value of 90 would result in bottom-to-top reading text. + * @param int $x The coordinates given by x and + * y will define the basepoint of the first + * character (roughly the lower-left corner of the character). This + * is different from the imagestring, where + * x and y define the + * upper-left corner of the first character. For example, "top left" + * is 0, 0. + * @param int $y The y-ordinate. This sets the position of the fonts baseline, not the + * very bottom of the character. + * @param int $color The color index. Using the negative of a color index has the effect of + * turning off antialiasing. See imagecolorallocate. + * @param string $fontfile The path to the TrueType font you wish to use. + * + * Depending on which version of the GD library PHP is using, when + * fontfile does not begin with a leading + * / then .ttf will be appended + * to the filename and the library will attempt to search for that + * filename along a library-defined font path. + * + * When using versions of the GD library lower than 2.0.18, a space character, + * rather than a semicolon, was used as the 'path separator' for different font files. + * Unintentional use of this feature will result in the warning message: + * Warning: Could not find/open font. For these affected versions, the + * only solution is moving the font to a path which does not contain spaces. + * + * In many cases where a font resides in the same directory as the script using it + * the following trick will alleviate any include problems. + * + * + * ]]> + * + * + * Note that open_basedir does + * not apply to fontfile. + * @param string $text The text string in UTF-8 encoding. + * + * May include decimal numeric character references (of the form: + * &#8364;) to access characters in a font beyond position 127. + * The hexadecimal format (like &#xA9;) is supported. + * Strings in UTF-8 encoding can be passed directly. + * + * Named entities, such as &copy;, are not supported. Consider using + * html_entity_decode + * to decode these named entities into UTF-8 strings. + * + * If a character is used in the string which is not supported by the + * font, a hollow rectangle will replace the character. + * @return array Returns an array with 8 elements representing four points making the + * bounding box of the text. The order of the points is lower left, lower + * right, upper right, upper left. The points are relative to the text + * regardless of the angle, so "upper left" means in the top left-hand + * corner when you see the text horizontally. + * Returns FALSE on error. + * @throws Exceptions\ImageException + * + */ +function imagettftext($image, float $size, float $angle, int $x, int $y, int $color, string $fontfile, string $text): array +{ + error_clear_last(); + $result = \imagettftext($image, $size, $angle, $x, $y, $color, $fontfile, $text); + if ($result === FALSE) { + throw Exceptions\ImageException::createFromPhpError(); + } + return $result; +} + + +/** + * imagewbmp outputs or save a WBMP + * version of the given image. + * + * @param resource $image An image resource, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param mixed $to The path or an open stream resource (which is automatically being closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be outputted directly. + * @param int $foreground You can set the foreground color with this parameter by setting an + * identifier obtained from imagecolorallocate. + * The default foreground color is black. + * @throws Exceptions\ImageException + * + */ +function imagewbmp($image, $to, int $foreground): void +{ + error_clear_last(); + if ($foreground !== null) { + $result = \imagewbmp($image, $to, $foreground); + } elseif ($to !== null) { + $result = \imagewbmp($image, $to); + }else { + $result = \imagewbmp($image); + } + if ($result === FALSE) { + throw Exceptions\ImageException::createFromPhpError(); + } +} + + +/** + * Outputs or saves a WebP version of the given image. + * + * @param resource $image An image resource, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param mixed $to The path or an open stream resource (which is automatically being closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be outputted directly. + * @param int $quality quality ranges from 0 (worst + * quality, smaller file) to 100 (best quality, biggest file). + * @throws Exceptions\ImageException + * + */ +function imagewebp($image, $to = null, int $quality = 80): void +{ + error_clear_last(); + $result = \imagewebp($image, $to, $quality); + if ($result === FALSE) { + throw Exceptions\ImageException::createFromPhpError(); + } +} + + +/** + * Outputs or save an XBM version of the given + * image. + * + * @param resource $image An image resource, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|null $filename The path to save the file to. If not set or NULL, the raw image stream will be outputted directly. + * + * The filename (without the .xbm extension) is also + * used for the C identifiers of the XBM, whereby non + * alphanumeric characters of the current locale are substituted by + * underscores. If filename is set to NULL, + * image is used to build the C identifiers. + * @param int $foreground You can set the foreground color with this parameter by setting an + * identifier obtained from imagecolorallocate. + * The default foreground color is black. All other colors are treated as + * background. + * @throws Exceptions\ImageException + * + */ +function imagexbm($image, string $filename, int $foreground): void +{ + error_clear_last(); + if ($foreground !== null) { + $result = \imagexbm($image, $filename, $foreground); + }else { + $result = \imagexbm($image, $filename); + } + if ($result === FALSE) { + throw Exceptions\ImageException::createFromPhpError(); + } +} + + +/** + * Embeds binary IPTC data into a JPEG image. + * + * @param string $iptcdata The data to be written. + * @param string $jpeg_file_name Path to the JPEG image. + * @param int $spool Spool flag. If the spool flag is less than 2 then the JPEG will be + * returned as a string. Otherwise the JPEG will be printed to STDOUT. + * @return array If spool is less than 2, the JPEG will be returned, + * . Otherwise returns TRUE on success + * . + * @throws Exceptions\ImageException + * + */ +function iptcembed(string $iptcdata, string $jpeg_file_name, int $spool = 0) +{ + error_clear_last(); + $result = \iptcembed($iptcdata, $jpeg_file_name, $spool); + if ($result === FALSE) { + throw Exceptions\ImageException::createFromPhpError(); + } + return $result; +} + + +/** + * Parses an IPTC block into its single tags. + * + * @param string $iptcblock A binary IPTC block. + * @return array Returns an array using the tagmarker as an index and the value as the + * value. It returns FALSE on error or if no IPTC data was found. + * @throws Exceptions\ImageException + * + */ +function iptcparse(string $iptcblock): array +{ + error_clear_last(); + $result = \iptcparse($iptcblock); + if ($result === FALSE) { + throw Exceptions\ImageException::createFromPhpError(); + } + return $result; +} + + +/** + * Converts a JPEG file into a WBMP file. + * + * @param string $jpegname Path to JPEG file. + * @param string $wbmpname Path to destination WBMP file. + * @param int $dest_height Destination image height. + * @param int $dest_width Destination image width. + * @param int $threshold Threshold value, between 0 and 8 (inclusive). + * @throws Exceptions\ImageException + * + */ +function jpeg2wbmp(string $jpegname, string $wbmpname, int $dest_height, int $dest_width, int $threshold): void +{ + error_clear_last(); + $result = \jpeg2wbmp($jpegname, $wbmpname, $dest_height, $dest_width, $threshold); + if ($result === FALSE) { + throw Exceptions\ImageException::createFromPhpError(); + } +} + + +/** + * Converts a PNG file into a WBMP file. + * + * @param string $pngname Path to PNG file. + * @param string $wbmpname Path to destination WBMP file. + * @param int $dest_height Destination image height. + * @param int $dest_width Destination image width. + * @param int $threshold Threshold value, between 0 and 8 (inclusive). + * @throws Exceptions\ImageException + * + */ +function png2wbmp(string $pngname, string $wbmpname, int $dest_height, int $dest_width, int $threshold): void +{ + error_clear_last(); + $result = \png2wbmp($pngname, $wbmpname, $dest_height, $dest_width, $threshold); + if ($result === FALSE) { + throw Exceptions\ImageException::createFromPhpError(); + } +} + + diff --git a/generated/imap.php b/generated/imap.php new file mode 100644 index 00000000..abfa83da --- /dev/null +++ b/generated/imap.php @@ -0,0 +1,997 @@ + + * + * + * @param array $serverctrls + * @throws Exceptions\LdapException + * + */ +function ldap_add($link_identifier, string $dn, array $entry, array $serverctrls): void +{ + error_clear_last(); + if ($serverctrls !== null) { + $result = \ldap_add($link_identifier, $dn, $entry, $serverctrls); + }else { + $result = \ldap_add($link_identifier, $dn, $entry); + } + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } +} + + +/** + * Binds to the LDAP directory with specified RDN and password. + * + * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. + * @param string $bind_rdn + * @param string $bind_password + * @throws Exceptions\LdapException + * + */ +function ldap_bind($link_identifier, string $bind_rdn = null, string $bind_password = null): void +{ + error_clear_last(); + $result = \ldap_bind($link_identifier, $bind_rdn, $bind_password); + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } +} + + +/** + * Retrieve the pagination information send by the server. + * + * @param resource $link An LDAP link identifier, returned by ldap_connect. + * @param resource $result + * @param string $cookie An opaque structure sent by the server. + * @param int $estimated The estimated number of entries to retrieve. + * @throws Exceptions\LdapException + * + */ +function ldap_control_paged_result_response($link, $result, string &$cookie, int &$estimated): void +{ + error_clear_last(); + if ($estimated !== null) { + $result = \ldap_control_paged_result_response($link, $result, $cookie, $estimated); + } elseif ($cookie !== null) { + $result = \ldap_control_paged_result_response($link, $result, $cookie); + }else { + $result = \ldap_control_paged_result_response($link, $result); + } + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } +} + + +/** + * Enable LDAP pagination by sending the pagination control (page size, cookie...). + * + * @param resource $link An LDAP link identifier, returned by ldap_connect. + * @param int $pagesize The number of entries by page. + * @param bool $iscritical Indicates whether the pagination is critical or not. + * If true and if the server doesn't support pagination, the search + * will return no result. + * @param string $cookie An opaque structure sent by the server + * (ldap_control_paged_result_response). + * @throws Exceptions\LdapException + * + */ +function ldap_control_paged_result($link, int $pagesize, bool $iscritical = false, string $cookie = ""): void +{ + error_clear_last(); + $result = \ldap_control_paged_result($link, $pagesize, $iscritical, $cookie); + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } +} + + +/** + * Returns the number of entries stored in the result of previous search + * operations. + * + * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. + * @param resource $result_identifier The internal LDAP result. + * @return int Returns number of entries in the result . + * @throws Exceptions\LdapException + * + */ +function ldap_count_entries($link_identifier, $result_identifier): int +{ + error_clear_last(); + $result = \ldap_count_entries($link_identifier, $result_identifier); + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } + return $result; +} + + +/** + * Deletes a particular entry in LDAP directory. + * + * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. + * @param string $dn The distinguished name of an LDAP entity. + * @param array $serverctrls + * @throws Exceptions\LdapException + * + */ +function ldap_delete($link_identifier, string $dn, array $serverctrls): void +{ + error_clear_last(); + if ($serverctrls !== null) { + $result = \ldap_delete($link_identifier, $dn, $serverctrls); + }else { + $result = \ldap_delete($link_identifier, $dn); + } + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } +} + + +/** + * Performs a WHOAMI extended operation and returns the data. + * + * @param resource $link An LDAP link identifier, returned by ldap_connect. + * @return string The data returned by the server, . + * @throws Exceptions\LdapException + * + */ +function ldap_exop_whoami($link): string +{ + error_clear_last(); + $result = \ldap_exop_whoami($link); + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } + return $result; +} + + +/** + * Performs an extended operation on the specified link with + * reqoid the OID of the operation and + * reqdata the data. + * + * @param resource $link An LDAP link identifier, returned by ldap_connect. + * @param string $reqoid The extended operation request OID. You may use one of LDAP_EXOP_START_TLS, LDAP_EXOP_MODIFY_PASSWD, LDAP_EXOP_REFRESH, LDAP_EXOP_WHO_AM_I, LDAP_EXOP_TURN, or a string with the OID of the operation you want to send. + * @param string $reqdata The extended operation request data. May be NULL for some operations like LDAP_EXOP_WHO_AM_I, may also need to be BER encoded. + * @param array $servercontrols Unused as of PHP 7.2. + * @param string $retdata Will be filled with the extended operation response data if provided. + * If not provided you may use ldap_parse_exop on the result object + * later to get this data. + * @param string $retoid Will be filled with the response OID if provided, usually equal to the request OID. + * @return mixed When used with retdata, returns TRUE on success . + * When used without retdata, returns a result identifier . + * @throws Exceptions\LdapException + * + */ +function ldap_exop($link, string $reqoid, string $reqdata, array $servercontrols, string &$retdata, string &$retoid) +{ + error_clear_last(); + if ($retoid !== null) { + $result = \ldap_exop($link, $reqoid, $reqdata, $servercontrols, $retdata, $retoid); + } elseif ($retdata !== null) { + $result = \ldap_exop($link, $reqoid, $reqdata, $servercontrols, $retdata); + } elseif ($servercontrols !== null) { + $result = \ldap_exop($link, $reqoid, $reqdata, $servercontrols); + } elseif ($reqdata !== null) { + $result = \ldap_exop($link, $reqoid, $reqdata); + }else { + $result = \ldap_exop($link, $reqoid); + } + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } + return $result; +} + + +/** + * Splits the DN returned by ldap_get_dn and breaks it + * up into its component parts. Each part is known as Relative Distinguished + * Name, or RDN. + * + * @param string $dn The distinguished name of an LDAP entity. + * @param int $with_attrib Used to request if the RDNs are returned with only values or their + * attributes as well. To get RDNs with the attributes (i.e. in + * attribute=value format) set with_attrib to 0 + * and to get only values set it to 1. + * @return array Returns an array of all DN components, . + * The first element in the array has count key and + * represents the number of returned values, next elements are numerically + * indexed DN components. + * @throws Exceptions\LdapException + * + */ +function ldap_explode_dn(string $dn, int $with_attrib): array +{ + error_clear_last(); + $result = \ldap_explode_dn($dn, $with_attrib); + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } + return $result; +} + + +/** + * Gets the first attribute in the given entry. Remaining attributes are + * retrieved by calling ldap_next_attribute successively. + * + * Similar to reading entries, attributes are also read one by one from a + * particular entry. + * + * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. + * @param resource $result_entry_identifier + * @return string Returns the first attribute in the entry on success and FALSE on + * error. + * @throws Exceptions\LdapException + * + */ +function ldap_first_attribute($link_identifier, $result_entry_identifier): string +{ + error_clear_last(); + $result = \ldap_first_attribute($link_identifier, $result_entry_identifier); + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } + return $result; +} + + +/** + * Returns the entry identifier for first entry in the result. This entry + * identifier is then supplied to ldap_next_entry + * routine to get successive entries from the result. + * + * Entries in the LDAP result are read sequentially using the + * ldap_first_entry and + * ldap_next_entry functions. + * + * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. + * @param resource $result_identifier + * @return resource Returns the result entry identifier for the first entry on success and + * FALSE on error. + * @throws Exceptions\LdapException + * + */ +function ldap_first_entry($link_identifier, $result_identifier) +{ + error_clear_last(); + $result = \ldap_first_entry($link_identifier, $result_identifier); + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } + return $result; +} + + +/** + * Frees up the memory allocated internally to store the result. All result + * memory will be automatically freed when the script terminates. + * + * Typically all the memory allocated for the LDAP result gets freed at the + * end of the script. In case the script is making successive searches which + * return large result sets, ldap_free_result could be + * called to keep the runtime memory usage by the script low. + * + * @param resource $result_identifier + * @throws Exceptions\LdapException + * + */ +function ldap_free_result($result_identifier): void +{ + error_clear_last(); + $result = \ldap_free_result($result_identifier); + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } +} + + +/** + * 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 $link_identifier An LDAP link identifier, returned by ldap_connect. + * @param resource $result_entry_identifier + * @return array Returns a complete entry information in a multi-dimensional array + * on success and FALSE on error. + * @throws Exceptions\LdapException + * + */ +function ldap_get_attributes($link_identifier, $result_entry_identifier): array +{ + error_clear_last(); + $result = \ldap_get_attributes($link_identifier, $result_entry_identifier); + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } + return $result; +} + + +/** + * Finds out the DN of an entry in the result. + * + * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. + * @param resource $result_entry_identifier + * @return string Returns the DN of the result entry and FALSE on error. + * @throws Exceptions\LdapException + * + */ +function ldap_get_dn($link_identifier, $result_entry_identifier): string +{ + error_clear_last(); + $result = \ldap_get_dn($link_identifier, $result_entry_identifier); + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } + return $result; +} + + +/** + * Reads multiple entries from the given result, and then reading the + * attributes and multiple values. + * + * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. + * @param resource $result_identifier + * @return array Returns a complete result information in a multi-dimensional array on + * success and FALSE on error. + * + * The structure of the array is as follows. + * The attribute index is converted to lowercase. (Attributes are + * case-insensitive for directory servers, but not when used as + * array indices.) + * + * + * + * + * + * @throws Exceptions\LdapException + * + */ +function ldap_get_entries($link_identifier, $result_identifier): array +{ + error_clear_last(); + $result = \ldap_get_entries($link_identifier, $result_identifier); + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } + return $result; +} + + +/** + * Sets retval to the value of the specified option. + * + * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. + * @param int $option The parameter option can be one of: + * + * + * + * + * Option + * Type + * since + * + * + * + * + * LDAP_OPT_DEREF + * integer + * + * + * + * LDAP_OPT_SIZELIMIT + * integer + * + * + * + * LDAP_OPT_TIMELIMIT + * integer + * + * + * + * LDAP_OPT_NETWORK_TIMEOUT + * integer + * + * + * + * LDAP_OPT_PROTOCOL_VERSION + * integer + * + * + * + * LDAP_OPT_ERROR_NUMBER + * integer + * + * + * + * LDAP_OPT_DIAGNOSTIC_MESSAGE + * integer + * + * + * + * LDAP_OPT_REFERRALS + * bool + * + * + * + * LDAP_OPT_RESTART + * bool + * + * + * + * LDAP_OPT_HOST_NAME + * string + * + * + * + * LDAP_OPT_ERROR_STRING + * string + * + * + * + * LDAP_OPT_MATCHED_DN + * string + * + * + * + * LDAP_OPT_SERVER_CONTROLS + * array + * + * + * + * LDAP_OPT_CLIENT_CONTROLS + * array + * + * + * + * LDAP_OPT_X_KEEPALIVE_IDLE + * int + * 7.1 + * + * + * LDAP_OPT_X_KEEPALIVE_PROBES + * int + * 7.1 + * + * + * LDAP_OPT_X_KEEPALIVE_INTERVAL + * int + * 7.1 + * + * + * LDAP_OPT_X_TLS_CACERTDIR + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_CACERTFILE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_CERTFILE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_CIPHER_SUITE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_CRLCHECK + * integer + * 7.1 + * + * + * LDAP_OPT_X_TLS_CRL_NONE + * integer + * 7.1 + * + * + * LDAP_OPT_X_TLS_CRL_PEER + * integer + * 7.1 + * + * + * LDAP_OPT_X_TLS_CRL_ALL + * integer + * 7.1 + * + * + * LDAP_OPT_X_TLS_CRLFILE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_DHFILE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_KEYILE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_PACKAGE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_PROTOCOL_MIN + * integer + * 7.1 + * + * + * LDAP_OPT_X_TLS_RANDOM_FILE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_REQUIRE_CERT + * integer + * + * + * + * + * + * @param mixed $retval This will be set to the option value. + * @throws Exceptions\LdapException + * + */ +function ldap_get_option($link_identifier, int $option, &$retval): void +{ + error_clear_last(); + $result = \ldap_get_option($link_identifier, $option, $retval); + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } +} + + +/** + * Reads all the values of the attribute in the entry in the result. + * + * This function is used exactly like ldap_get_values + * except that it handles binary data and not string data. + * + * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. + * @param resource $result_entry_identifier + * @param string $attribute + * @return array Returns an array of values for the attribute on success and FALSE on + * error. Individual values are accessed by integer index in the array. The + * first index is 0. The number of values can be found by indexing "count" + * in the resultant array. + * @throws Exceptions\LdapException + * + */ +function ldap_get_values_len($link_identifier, $result_entry_identifier, string $attribute): array +{ + error_clear_last(); + $result = \ldap_get_values_len($link_identifier, $result_entry_identifier, $attribute); + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } + return $result; +} + + +/** + * Reads all the values of the attribute in the entry in the result. + * + * This call needs a result_entry_identifier, + * so needs to be preceded by one of the ldap search calls and one + * of the calls to get an individual entry. + * + * You application will either be hard coded to look for certain + * attributes (such as "surname" or "mail") or you will have to use + * the ldap_get_attributes call to work out + * what attributes exist for a given entry. + * + * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. + * @param resource $result_entry_identifier + * @param string $attribute + * @return array Returns an array of values for the attribute on success and FALSE on + * error. The number of values can be found by indexing "count" in the + * resultant array. Individual values are accessed by integer index in the + * array. The first index is 0. + * + * LDAP allows more than one entry for an attribute, so it can, for example, + * store a number of email addresses for one person's directory entry all + * labeled with the attribute "mail" + * + * + * return_value["count"] = number of values for attribute + * return_value[0] = first value of attribute + * return_value[i] = ith value of attribute + * + * + * @throws Exceptions\LdapException + * + */ +function ldap_get_values($link_identifier, $result_entry_identifier, string $attribute): array +{ + error_clear_last(); + $result = \ldap_get_values($link_identifier, $result_entry_identifier, $attribute); + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } + return $result; +} + + +/** + * Performs the search for a specified filter on the + * directory with the scope LDAP_SCOPE_ONELEVEL. + * + * LDAP_SCOPE_ONELEVEL means that the search should only + * return information that is at the level immediately below the + * base_dn given in the call. + * (Equivalent to typing "ls" and getting a list of files and folders in the + * current working directory.) + * + * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. + * @param string $base_dn The base DN for the directory. + * @param string $filter + * @param array $attributes An array of the required attributes, e.g. array("mail", "sn", "cn"). + * Note that the "dn" is always returned irrespective of which attributes + * types are requested. + * + * Using this parameter is much more efficient than the default action + * (which is to return all attributes and their associated values). + * The use of this parameter should therefore be considered good + * practice. + * @param int $attrsonly Should be set to 1 if only attribute types are wanted. If set to 0 + * both attributes types and attribute values are fetched which is the + * default behaviour. + * @param int $sizelimit Enables you to limit the count of entries fetched. Setting this to 0 + * means no limit. + * + * This parameter can NOT override server-side preset sizelimit. You can + * set it lower though. + * + * Some directory server hosts will be configured to return no more than + * a preset number of entries. If this occurs, the server will indicate + * that it has only returned a partial results set. This also occurs if + * you use this parameter to limit the count of fetched entries. + * @param int $timelimit Sets the number of seconds how long is spend on the search. Setting + * this to 0 means no limit. + * + * This parameter can NOT override server-side preset timelimit. You can + * set it lower though. + * @param int $deref Specifies how aliases should be handled during the search. It can be + * one of the following: + * + * + * + * LDAP_DEREF_NEVER - (default) aliases are never + * dereferenced. + * + * + * + * + * LDAP_DEREF_SEARCHING - aliases should be + * dereferenced during the search but not when locating the base object + * of the search. + * + * + * + * + * LDAP_DEREF_FINDING - aliases should be + * dereferenced when locating the base object but not during the search. + * + * + * + * + * LDAP_DEREF_ALWAYS - aliases should be dereferenced + * always. + * + * + * + * @param array $serverctrls + * @return resource Returns a search result identifier . + * @throws Exceptions\LdapException + * + */ +function ldap_list($link_identifier, string $base_dn, string $filter, array $attributes, int $attrsonly, int $sizelimit, int $timelimit, int $deref, array $serverctrls) +{ + error_clear_last(); + if ($serverctrls !== null) { + $result = \ldap_list($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref, $serverctrls); + } elseif ($deref !== null) { + $result = \ldap_list($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref); + } elseif ($timelimit !== null) { + $result = \ldap_list($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit); + } elseif ($sizelimit !== null) { + $result = \ldap_list($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit); + } elseif ($attrsonly !== null) { + $result = \ldap_list($link_identifier, $base_dn, $filter, $attributes, $attrsonly); + } elseif ($attributes !== null) { + $result = \ldap_list($link_identifier, $base_dn, $filter, $attributes); + }else { + $result = \ldap_list($link_identifier, $base_dn, $filter); + } + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } + return $result; +} + + +/** + * Adds one or more attribute values to the specified dn. + * To add a whole new object see ldap_add function. + * + * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. + * @param string $dn The distinguished name of an LDAP entity. + * @param array $entry An associative array listing the attirbute values to add. If an attribute was not existing yet it will be added. If an attribute is existing you can only add values to it if it supports multiple values. + * @param array $serverctrls + * @throws Exceptions\LdapException + * + */ +function ldap_mod_add($link_identifier, string $dn, array $entry, array $serverctrls): void +{ + error_clear_last(); + if ($serverctrls !== null) { + $result = \ldap_mod_add($link_identifier, $dn, $entry, $serverctrls); + }else { + $result = \ldap_mod_add($link_identifier, $dn, $entry); + } + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } +} + + +/** + * Removes one or more attribute values from the specified dn. + * Object deletions are done by the + * ldap_delete function. + * + * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. + * @param string $dn The distinguished name of an LDAP entity. + * @param array $entry + * @param array $serverctrls + * @throws Exceptions\LdapException + * + */ +function ldap_mod_del($link_identifier, string $dn, array $entry, array $serverctrls): void +{ + error_clear_last(); + if ($serverctrls !== null) { + $result = \ldap_mod_del($link_identifier, $dn, $entry, $serverctrls); + }else { + $result = \ldap_mod_del($link_identifier, $dn, $entry); + } + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } +} + + +/** + * Replaces one or more attributes from the specified dn. + * It may also add or remove attributes. + * + * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. + * @param string $dn The distinguished name of an LDAP entity. + * @param array $entry An associative array listing the attributes to replace. Sending an empty array as value will remove the attribute, while sending an attribute not existing yet on this entry will add it. + * @param array $serverctrls + * @throws Exceptions\LdapException + * + */ +function ldap_mod_replace($link_identifier, string $dn, array $entry, array $serverctrls): void +{ + error_clear_last(); + if ($serverctrls !== null) { + $result = \ldap_mod_replace($link_identifier, $dn, $entry, $serverctrls); + }else { + $result = \ldap_mod_replace($link_identifier, $dn, $entry); + } + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } +} + + +/** + * Modifies an existing entry in the LDAP directory. Allows detailed + * specification of the modifications to perform. + * + * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. + * @param string $dn The distinguished name of an LDAP entity. + * @param array $entry An array that specifies the modifications to make. Each entry in this + * array is an associative array with two or three keys: + * attrib maps to the name of the attribute to modify, + * modtype maps to the type of modification to perform, + * and (depending on the type of modification) values + * maps to an array of attribute values relevant to the modification. + * + * Possible values for modtype include: + * + * + * LDAP_MODIFY_BATCH_ADD + * + * + * Each value specified through values is added (as + * an additional value) to the attribute named by + * attrib. + * + * + * + * + * LDAP_MODIFY_BATCH_REMOVE + * + * + * Each value specified through values is removed + * from the attribute named by attrib. Any value of + * the attribute not contained in the values array + * will remain untouched. + * + * + * + * + * LDAP_MODIFY_BATCH_REMOVE_ALL + * + * + * All values are removed from the attribute named by + * attrib. A values entry must + * not be provided. + * + * + * + * + * LDAP_MODIFY_BATCH_REPLACE + * + * + * All current values of the attribute named by + * attrib are replaced with the values specified + * through values. + * + * + * + * + * + * Each value specified through values is added (as + * an additional value) to the attribute named by + * attrib. + * + * Each value specified through values is removed + * from the attribute named by attrib. Any value of + * the attribute not contained in the values array + * will remain untouched. + * + * All values are removed from the attribute named by + * attrib. A values entry must + * not be provided. + * + * All current values of the attribute named by + * attrib are replaced with the values specified + * through values. + * + * Note that any value for attrib must be a string, any + * value for values must be an array of strings, and + * any value for modtype must be one of the + * LDAP_MODIFY_BATCH_* constants listed above. + * @param array $serverctrls Each value specified through values is added (as + * an additional value) to the attribute named by + * attrib. + * @throws Exceptions\LdapException + * + */ +function ldap_modify_batch($link_identifier, string $dn, array $entry, array $serverctrls): void +{ + error_clear_last(); + if ($serverctrls !== null) { + $result = \ldap_modify_batch($link_identifier, $dn, $entry, $serverctrls); + }else { + $result = \ldap_modify_batch($link_identifier, $dn, $entry); + } + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } +} + + +/** + * Retrieves the attributes in an entry. The first call to + * ldap_next_attribute is made with the + * result_entry_identifier returned from + * ldap_first_attribute. + * + * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. + * @param resource $result_entry_identifier + * @return string Returns the next attribute in an entry on success and FALSE on + * error. + * @throws Exceptions\LdapException + * + */ +function ldap_next_attribute($link_identifier, $result_entry_identifier): string +{ + error_clear_last(); + $result = \ldap_next_attribute($link_identifier, $result_entry_identifier); + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } + return $result; +} + + +/** + * Parse LDAP extended operation data from result object result + * + * @param resource $link An LDAP link identifier, returned by ldap_connect. + * @param resource $result An LDAP result resource, returned by ldap_exop. + * @param string $retdata Will be filled by the response data. + * @param string $retoid Will be filled by the response OID. + * @throws Exceptions\LdapException + * + */ +function ldap_parse_exop($link, $result, string &$retdata, string &$retoid): void +{ + error_clear_last(); + if ($retoid !== null) { + $result = \ldap_parse_exop($link, $result, $retdata, $retoid); + } elseif ($retdata !== null) { + $result = \ldap_parse_exop($link, $result, $retdata); + }else { + $result = \ldap_parse_exop($link, $result); + } + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } +} + + +/** + * Parses an LDAP search result. + * + * @param resource $link An LDAP link identifier, returned by ldap_connect. + * @param resource $result An LDAP result resource, returned by ldap_list or + * ldap_search. + * @param int $errcode A reference to a variable that will be set to the LDAP error code in + * the result, or 0 if no error occurred. + * @param string $matcheddn A reference to a variable that will be set to a matched DN if one was + * recognised within the request, otherwise it will be set to NULL. + * @param string $errmsg A reference to a variable that will be set to the LDAP error message in + * the result, or an empty string if no error occurred. + * @param array $referrals A reference to a variable that will be set to an array set + * to all of the referral strings in the result, or an empty array if no + * referrals were returned. + * @param array $serverctrls + * @throws Exceptions\LdapException + * + */ +function ldap_parse_result($link, $result, int &$errcode, string &$matcheddn, string &$errmsg, array &$referrals, array &$serverctrls): void +{ + error_clear_last(); + if ($serverctrls !== null) { + $result = \ldap_parse_result($link, $result, $errcode, $matcheddn, $errmsg, $referrals, $serverctrls); + } elseif ($referrals !== null) { + $result = \ldap_parse_result($link, $result, $errcode, $matcheddn, $errmsg, $referrals); + } elseif ($errmsg !== null) { + $result = \ldap_parse_result($link, $result, $errcode, $matcheddn, $errmsg); + } elseif ($matcheddn !== null) { + $result = \ldap_parse_result($link, $result, $errcode, $matcheddn); + }else { + $result = \ldap_parse_result($link, $result, $errcode); + } + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } +} + + +/** + * Performs the search for a specified filter on the + * directory with the scope LDAP_SCOPE_BASE. So it is + * equivalent to reading an entry from the directory. + * + * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. + * @param string $base_dn The base DN for the directory. + * @param string $filter An empty filter is not allowed. If you want to retrieve absolutely all + * information for this entry, use a filter of + * objectClass=*. If you know which entry types are + * used on the directory server, you might use an appropriate filter such + * as objectClass=inetOrgPerson. + * @param array $attributes An array of the required attributes, e.g. array("mail", "sn", "cn"). + * Note that the "dn" is always returned irrespective of which attributes + * types are requested. + * + * Using this parameter is much more efficient than the default action + * (which is to return all attributes and their associated values). + * The use of this parameter should therefore be considered good + * practice. + * @param int $attrsonly Should be set to 1 if only attribute types are wanted. If set to 0 + * both attributes types and attribute values are fetched which is the + * default behaviour. + * @param int $sizelimit Enables you to limit the count of entries fetched. Setting this to 0 + * means no limit. + * + * This parameter can NOT override server-side preset sizelimit. You can + * set it lower though. + * + * Some directory server hosts will be configured to return no more than + * a preset number of entries. If this occurs, the server will indicate + * that it has only returned a partial results set. This also occurs if + * you use this parameter to limit the count of fetched entries. + * @param int $timelimit Sets the number of seconds how long is spend on the search. Setting + * this to 0 means no limit. + * + * This parameter can NOT override server-side preset timelimit. You can + * set it lower though. + * @param int $deref Specifies how aliases should be handled during the search. It can be + * one of the following: + * + * + * + * LDAP_DEREF_NEVER - (default) aliases are never + * dereferenced. + * + * + * + * + * LDAP_DEREF_SEARCHING - aliases should be + * dereferenced during the search but not when locating the base object + * of the search. + * + * + * + * + * LDAP_DEREF_FINDING - aliases should be + * dereferenced when locating the base object but not during the search. + * + * + * + * + * LDAP_DEREF_ALWAYS - aliases should be dereferenced + * always. + * + * + * + * @param array $serverctrls + * @return resource Returns a search result identifier . + * @throws Exceptions\LdapException + * + */ +function ldap_read($link_identifier, string $base_dn, string $filter, array $attributes, int $attrsonly, int $sizelimit, int $timelimit, int $deref, array $serverctrls) +{ + error_clear_last(); + if ($serverctrls !== null) { + $result = \ldap_read($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref, $serverctrls); + } elseif ($deref !== null) { + $result = \ldap_read($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref); + } elseif ($timelimit !== null) { + $result = \ldap_read($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit); + } elseif ($sizelimit !== null) { + $result = \ldap_read($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit); + } elseif ($attrsonly !== null) { + $result = \ldap_read($link_identifier, $base_dn, $filter, $attributes, $attrsonly); + } elseif ($attributes !== null) { + $result = \ldap_read($link_identifier, $base_dn, $filter, $attributes); + }else { + $result = \ldap_read($link_identifier, $base_dn, $filter); + } + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } + return $result; +} + + +/** + * The entry specified by dn is renamed/moved. + * + * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. + * @param string $dn The distinguished name of an LDAP entity. + * @param string $newrdn The new RDN. + * @param string $newparent The new parent/superior entry. + * @param bool $deleteoldrdn If TRUE the old RDN value(s) is removed, else the old RDN value(s) + * is retained as non-distinguished values of the entry. + * @param array $serverctrls + * @throws Exceptions\LdapException + * + */ +function ldap_rename($link_identifier, string $dn, string $newrdn, string $newparent, bool $deleteoldrdn, array $serverctrls): void +{ + error_clear_last(); + if ($serverctrls !== null) { + $result = \ldap_rename($link_identifier, $dn, $newrdn, $newparent, $deleteoldrdn, $serverctrls); + }else { + $result = \ldap_rename($link_identifier, $dn, $newrdn, $newparent, $deleteoldrdn); + } + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } +} + + +/** + * + * + * @param resource $link + * @param string $binddn + * @param string $password + * @param string $sasl_mech + * @param string $sasl_realm + * @param string $sasl_authc_id + * @param string $sasl_authz_id + * @param string $props + * @throws Exceptions\LdapException + * + */ +function ldap_sasl_bind($link, string $binddn = null, string $password = null, string $sasl_mech = null, string $sasl_realm = null, string $sasl_authc_id = null, string $sasl_authz_id = null, string $props = null): void +{ + error_clear_last(); + $result = \ldap_sasl_bind($link, $binddn, $password, $sasl_mech, $sasl_realm, $sasl_authc_id, $sasl_authz_id, $props); + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } +} + + +/** + * Performs the search for a specified filter on the directory with the scope + * of LDAP_SCOPE_SUBTREE. This is equivalent to searching + * the entire directory. + * + * From 4.0.5 on it's also possible to do parallel searches. To do this + * you use an array of link identifiers, rather than a single identifier, + * as the first argument. If you don't want the same base DN and the + * same filter for all the searches, you can also use an array of base DNs + * and/or an array of filters. Those arrays must be of the same size as + * the link identifier array since the first entries of the arrays are + * used for one search, the second entries are used for another, and so + * on. When doing parallel searches an array of search result + * identifiers is returned, except in case of error, then the entry + * corresponding to the search will be FALSE. This is very much like + * the value normally returned, except that a result identifier is always + * returned when a search was made. There are some rare cases where the + * normal search returns FALSE while the parallel search returns an + * identifier. + * + * @param resource|array $link_identifier An LDAP link identifier, returned by ldap_connect. + * @param string $base_dn The base DN for the directory. + * @param string $filter The search filter can be simple or advanced, using boolean operators in + * the format described in the LDAP documentation (see the Netscape Directory SDK or + * RFC4515 for full + * information on filters). + * @param array $attributes An array of the required attributes, e.g. array("mail", "sn", "cn"). + * Note that the "dn" is always returned irrespective of which attributes + * types are requested. + * + * Using this parameter is much more efficient than the default action + * (which is to return all attributes and their associated values). + * The use of this parameter should therefore be considered good + * practice. + * @param int $attrsonly Should be set to 1 if only attribute types are wanted. If set to 0 + * both attributes types and attribute values are fetched which is the + * default behaviour. + * @param int $sizelimit Enables you to limit the count of entries fetched. Setting this to 0 + * means no limit. + * + * This parameter can NOT override server-side preset sizelimit. You can + * set it lower though. + * + * Some directory server hosts will be configured to return no more than + * a preset number of entries. If this occurs, the server will indicate + * that it has only returned a partial results set. This also occurs if + * you use this parameter to limit the count of fetched entries. + * @param int $timelimit Sets the number of seconds how long is spend on the search. Setting + * this to 0 means no limit. + * + * This parameter can NOT override server-side preset timelimit. You can + * set it lower though. + * @param int $deref Specifies how aliases should be handled during the search. It can be + * one of the following: + * + * + * + * LDAP_DEREF_NEVER - (default) aliases are never + * dereferenced. + * + * + * + * + * LDAP_DEREF_SEARCHING - aliases should be + * dereferenced during the search but not when locating the base object + * of the search. + * + * + * + * + * LDAP_DEREF_FINDING - aliases should be + * dereferenced when locating the base object but not during the search. + * + * + * + * + * LDAP_DEREF_ALWAYS - aliases should be dereferenced + * always. + * + * + * + * @param array $serverctrls + * @return resource Returns a search result identifier . + * @throws Exceptions\LdapException + * + */ +function ldap_search($link_identifier, string $base_dn, string $filter, array $attributes, int $attrsonly, int $sizelimit, int $timelimit, int $deref, array $serverctrls) +{ + error_clear_last(); + if ($serverctrls !== null) { + $result = \ldap_search($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref, $serverctrls); + } elseif ($deref !== null) { + $result = \ldap_search($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref); + } elseif ($timelimit !== null) { + $result = \ldap_search($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit); + } elseif ($sizelimit !== null) { + $result = \ldap_search($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit); + } elseif ($attrsonly !== null) { + $result = \ldap_search($link_identifier, $base_dn, $filter, $attributes, $attrsonly); + } elseif ($attributes !== null) { + $result = \ldap_search($link_identifier, $base_dn, $filter, $attributes); + }else { + $result = \ldap_search($link_identifier, $base_dn, $filter); + } + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } + return $result; +} + + +/** + * Sets the value of the specified option to be newval. + * + * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. + * @param int $option The parameter option can be one of: + * + * + * + * + * Option + * Type + * Available since + * + * + * + * + * LDAP_OPT_DEREF + * integer + * + * + * + * LDAP_OPT_SIZELIMIT + * integer + * + * + * + * LDAP_OPT_TIMELIMIT + * integer + * + * + * + * LDAP_OPT_NETWORK_TIMEOUT + * integer + * PHP 5.3.0 + * + * + * LDAP_OPT_PROTOCOL_VERSION + * integer + * + * + * + * LDAP_OPT_ERROR_NUMBER + * integer + * + * + * + * LDAP_OPT_REFERRALS + * bool + * + * + * + * LDAP_OPT_RESTART + * bool + * + * + * + * LDAP_OPT_HOST_NAME + * string + * + * + * + * LDAP_OPT_ERROR_STRING + * string + * + * + * + * LDAP_OPT_DIAGNOSTIC_MESSAGE + * string + * + * + * + * LDAP_OPT_MATCHED_DN + * string + * + * + * + * LDAP_OPT_SERVER_CONTROLS + * array + * + * + * + * LDAP_OPT_CLIENT_CONTROLS + * array + * + * + * + * LDAP_OPT_X_KEEPALIVE_IDLE + * int + * PHP 7.1.0 + * + * + * LDAP_OPT_X_KEEPALIVE_PROBES + * int + * PHP 7.1.0 + * + * + * LDAP_OPT_X_KEEPALIVE_INTERVAL + * int + * PHP 7.1.0 + * + * + * LDAP_OPT_X_TLS_CACERTDIR + * string + * PHP 7.1.0 + * + * + * LDAP_OPT_X_TLS_CACERTFILE + * string + * PHP 7.1.0 + * + * + * LDAP_OPT_X_TLS_CERTFILE + * string + * PHP 7.1.0 + * + * + * LDAP_OPT_X_TLS_CIPHER_SUITE + * string + * PHP 7.1.0 + * + * + * LDAP_OPT_X_TLS_CRLCHECK + * integer + * PHP 7.1.0 + * + * + * LDAP_OPT_X_TLS_CRLFILE + * string + * PHP 7.1.0 + * + * + * LDAP_OPT_X_TLS_DHFILE + * string + * PHP 7.1.0 + * + * + * LDAP_OPT_X_TLS_KEYFILE + * string + * PHP 7.1.0 + * + * + * LDAP_OPT_X_TLS_PROTOCOL_MIN + * integer + * PHP 7.1.0 + * + * + * LDAP_OPT_X_TLS_RANDOM_FILE + * string + * PHP 7.1.0 + * + * + * LDAP_OPT_X_TLS_REQUIRE_CERT + * integer + * PHP 7.0.5 + * + * + * + * + * + * LDAP_OPT_SERVER_CONTROLS and + * LDAP_OPT_CLIENT_CONTROLS require a list of + * controls, this means that the value must be an array of controls. A + * control consists of an oid identifying the control, + * an optional value, and an optional flag for + * criticality. In PHP a control is given by an + * array containing an element with the key oid + * and string value, and two optional elements. The optional + * elements are key value with string value + * and key iscritical with boolean value. + * iscritical defaults to FALSE + * if not supplied. See draft-ietf-ldapext-ldap-c-api-xx.txt + * for details. See also the second example below. + * @param mixed $newval The new value for the specified option. + * @throws Exceptions\LdapException + * + */ +function ldap_set_option($link_identifier, int $option, $newval): void +{ + error_clear_last(); + $result = \ldap_set_option($link_identifier, $option, $newval); + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } +} + + +/** + * Unbinds from the LDAP directory. + * + * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. + * @throws Exceptions\LdapException + * + */ +function ldap_unbind($link_identifier): void +{ + error_clear_last(); + $result = \ldap_unbind($link_identifier); + if ($result === FALSE) { + throw Exceptions\LdapException::createFromPhpError(); + } +} + + diff --git a/generated/libevent.php b/generated/libevent.php new file mode 100644 index 00000000..b96e8b8c --- /dev/null +++ b/generated/libevent.php @@ -0,0 +1,496 @@ + + * + * + * + * + * If > character is used, then the search will be restricted to those + * documents having a modification date greater than entered, if <, then smaller. + * + * + * + * + * UDM_LIMIT_DATE - defines limitation by date the document was modified. + * + * Format of parameter value: a string with first character < or >, + * then with no space - date in unixtime format, for example: + * + * + * + * + * + * ]]> + * + * + * + * If > character is used, then the search will be restricted to those + * documents having a modification date greater than entered, if <, then smaller. + * @param string $val Defines the value of the current parameter. + * @throws Exceptions\MnogosearchException + * + */ +function udm_add_search_limit($agent, int $var, string $val): void +{ + error_clear_last(); + $result = \udm_add_search_limit($agent, $var, $val); + if ($result === FALSE) { + throw Exceptions\MnogosearchException::createFromPhpError(); + } +} + + +/** + * udm_alloc_agent_array will create an agent + * with multiple database connections. + * + * @param array $databases The array databases must contain one database + * URL per element, analog to the first parameter of + * udm_alloc_agent. + * @return resource Returns a resource link identifier on success . + * @throws Exceptions\MnogosearchException + * + */ +function udm_alloc_agent_array(array $databases) +{ + error_clear_last(); + $result = \udm_alloc_agent_array($databases); + if ($result === FALSE) { + throw Exceptions\MnogosearchException::createFromPhpError(); + } + return $result; +} + + +/** + * Performs a search. + * + * The search itself. The first argument - session, the next one - + * query itself. To find something just type words you want to find + * and press SUBMIT button. For example, "mysql odbc". You should + * not use quotes " in query, they are written here only to divide a + * query from other text. mnoGoSearch will find all documents that + * contain word "mysql" and/or word "odbc". Best documents having + * bigger weights will be displayed first. If you use search mode + * ALL, search will return documents that contain both (or more) + * words you entered. In case you use mode ANY, the search will + * return list of documents that contain any of the words you + * entered. If you want more advanced results you may use query + * language. You should select "bool" match mode in the search + * from. + * + * @param resource $agent A link to Agent, received after call to + * udm_alloc_agent. + * @param string $query mnoGoSearch understands the following boolean operators: + * + * & - logical AND. For example, "mysql & + * odbc". mnoGoSearch will find any URLs that contain both + * "mysql" and "odbc". + * + * | - logical OR. For example "mysql|odbc". mnoGoSearch + * will find any URLs, that contain word "mysql" or word + * "odbc". + * + * ~ - logical NOT. For example "mysql & ~odbc". + * mnoGoSearch will find URLs that contain word "mysql" + * and do not contain word "odbc" at the same time. Note + * that ~ just excludes given word from results. Query + * "~odbc" will find nothing! + * + * () - group command to compose more complex queries. For example + * "(mysql | msql) & ~postgres". Query language is + * simple and powerful at the same time. Just consider query as + * usual boolean expression. + * @return resource Returns a result link identifier on success . + * @throws Exceptions\MnogosearchException + * + */ +function udm_find($agent, string $query) +{ + error_clear_last(); + $result = \udm_find($agent, $query); + if ($result === FALSE) { + throw Exceptions\MnogosearchException::createFromPhpError(); + } + return $result; +} + + +/** + * Freeing up memory allocated for agent session. + * + * @param resource $agent A link to Agent, received after call to + * udm_alloc_agent. + * @return int Returns TRUE on success . + * @throws Exceptions\MnogosearchException + * + */ +function udm_free_agent($agent): int +{ + error_clear_last(); + $result = \udm_free_agent($agent); + if ($result === FALSE) { + throw Exceptions\MnogosearchException::createFromPhpError(); + } + return $result; +} + + +/** + * Freeing up memory allocated for results. + * + * @param resource $res A link to a result identifier, received after call to + * udm_find. + * @throws Exceptions\MnogosearchException + * + */ +function udm_free_res($res): void +{ + error_clear_last(); + $result = \udm_free_res($res); + if ($result === FALSE) { + throw Exceptions\MnogosearchException::createFromPhpError(); + } +} + + +/** + * Fetch a mnoGoSearch result field. + * + * @param resource $res res - a link to result identifier, received + * after call to udm_find. + * @param int $row row - the number of the link on the current page. + * May have values from 0 to + * UDM_PARAM_NUM_ROWS-1. + * @param int $field field - field identifier, may have the following values: + * + * + * + * UDM_FIELD_URL - document URL field + * + * + * + * + * UDM_FIELD_CONTENT - document + * Content-type field (for example, text/html). + * + * + * + * + * UDM_FIELD_CATEGORY - document category field. Use + * udm_cat_path to get full path to current category + * from the categories tree root. (This parameter is available only in PHP + * 4.0.6 or later). + * + * + * + * + * UDM_FIELD_TITLE - document title field. + * + * + * + * + * UDM_FIELD_KEYWORDS - document keywords field (from META KEYWORDS tag). + * + * + * + * + * UDM_FIELD_DESC - document description field (from META DESCRIPTION tag). + * + * + * + * + * UDM_FIELD_TEXT - document body text (the first couple of lines to give an + * idea of what the document is about). + * + * + * + * + * UDM_FIELD_SIZE - document size. + * + * + * + * + * UDM_FIELD_URLID - unique URL ID of the link. + * + * + * + * + * UDM_FIELD_RATING - page rating (as calculated by mnoGoSearch). + * + * + * + * + * UDM_FIELD_MODIFIED - last-modified field in unixtime format. + * + * + * + * + * UDM_FIELD_ORDER - the number of the current document in set of found documents. + * + * + * + * + * UDM_FIELD_CRC - document CRC. + * + * + * + * @return string udm_get_res_field returns result field value on + * success, FALSE on error. + * @throws Exceptions\MnogosearchException + * + */ +function udm_get_res_field($res, int $row, int $field): string +{ + error_clear_last(); + $result = \udm_get_res_field($res, $row, $field); + if ($result === FALSE) { + throw Exceptions\MnogosearchException::createFromPhpError(); + } + return $result; +} + + +/** + * Gets the mnoGoSearch result parameters. + * + * @param resource $res res - a link to result identifier, received after + * call to udm_find. + * @param int $param param - parameter identifier, may have the following values: + * + * + * + * UDM_PARAM_NUM_ROWS - number of received found links on the current page. It is equal to + * UDM_PARAM_PAGE_SIZE for all search pages, on the last page - the rest of links. + * + * + * + * + * UDM_PARAM_FOUND - total number of results matching the query. + * + * + * + * + * UDM_PARAM_WORDINFO - information on the words found. E.g. search for + * "a good book" will return "a: stopword, good:5637, book: 120" + * + * + * + * + * UDM_PARAM_SEARCHTIME - search time in seconds. + * + * + * + * + * UDM_PARAM_FIRST_DOC - the number of the first document displayed on current page. + * + * + * + * + * UDM_PARAM_LAST_DOC - the number of the last document displayed on current page. + * + * + * + * @return string udm_get_res_param returns result parameter value on + * success, FALSE on error. + * @throws Exceptions\MnogosearchException + * + */ +function udm_get_res_param($res, int $param): string +{ + error_clear_last(); + $result = \udm_get_res_param($res, $param); + if ($result === FALSE) { + throw Exceptions\MnogosearchException::createFromPhpError(); + } + return $result; +} + + +/** + * udm_load_ispell_data loads ispell data. + * + * After using this function to free memory allocated for ispell data, please + * use udm_free_ispell_data, even if you use + * UDM_ISPELL_TYPE_SERVER mode. + * + * @param resource $agent A link to Agent, received after call to + * udm_alloc_agent. + * @param int $var Indicates the source for ispell data. May have the following values: + * + * + * + * UDM_ISPELL_TYPE_DB - indicates that ispell data should be loaded from SQL. + * In this case, parameters val1 and val2 + * are ignored and should be left blank. flag + * should be equal to 1. + * + * + * + * flag indicates that after loading ispell data + * from defined source it should be sorted (it is necessary for correct + * functioning of ispell). In case of loading ispell data from files + * there may be several calls to udm_load_ispell_data, + * and there is no sense to sort data after every call, but only after + * the last one. Since in db mode all the data is loaded by one call, + * this parameter should have the value 1. In this mode + * in case of error, e.g. if ispell tables are absent, the function will + * return FALSE and code and error message will be accessible through + * udm_error and udm_errno. + * + * + * + * + * + * UDM_ISPELL_TYPE_AFFIX - indicates that ispell data should be loaded from + * file and initiates loading affixes file. In this case val1 + * defines double letter language code for which affixes are loaded, + * and val2 - file path. Please note, that if + * a relative path entered, the module looks for the file not in UDM_CONF_DIR, + * but in relation to current path, i.e. to the path where the script is executed. + * In case of error in this mode, e.g. if file is absent, the function will return + * FALSE, and an error message will be displayed. Error message text cannot be + * accessed through udm_error and udm_errno, + * since those functions can only return messages associated with SQL. Please, + * see flag parameter description in UDM_ISPELL_TYPE_DB. + * + * + * + * udm_load_ispell_data example + * + * + * ]]> + * + * + * + * + * + * flag is equal to 1 only in the last call. + * + * + * + * + * + * UDM_ISPELL_TYPE_SPELL - indicates that ispell data should be loaded from + * file and initiates loading of ispell dictionary file. In this case + * val1 defines double letter language code for which + * affixes are loaded, + * and val2 - file path. Please note, that if a relative + * path entered, the module looks for the file not in UDM_CONF_DIR, but in + * relation to current path, i.e. to the path where the script is executed. + * In case of error in this mode, e.g. if file is absent, the function will + * return FALSE, and an error message will be displayed. Error message text + * cannot be accessed through udm_error and + * udm_errno, since those functions can only return messages + * associated with SQL. Please, see flag parameter + * description in UDM_ISPELL_TYPE_DB. + * + * + * + * + * ]]> + * + * + * + * + * flag is equal to 1 only in the last call. + * + * + * + * + * + * UDM_ISPELL_TYPE_SERVER - enables spell server support. + * val1 parameter indicates + * address of the host running spell server. val2 ` + * is not used yet, but in future releases it is going to indicate number + * of port used by spell server. flag parameter in + * this case is not needed since ispell data is stored + * on spellserver already sorted. + * + * + * Spelld server reads spell-data from a separate configuration file + * (/usr/local/mnogosearch/etc/spelld.conf by default), sorts it and stores in + * memory. With clients server communicates in two ways: to indexer all the + * data is transferred (so that indexer starts faster), from search.cgi server + * receives word to normalize and then passes over to client (search.cgi) list + * of normalized word forms. This allows fastest, compared to db and text modes + * processing of search queries (by omitting loading and sorting all the spell data). + * + * + * udm_load_ispell_data function in UDM_ISPELL_TYPE_SERVER + * mode does not actually load ispell data, but only defines server address. + * In fact, server is automatically used by udm_find + * function when performing search. In case of errors, e.g. if spellserver + * is not running or invalid host indicated, there are no messages returned + * and ispell conversion does not work. + * + * + * + * This function is available in mnoGoSearch 3.1.12 or later. + * + * + * Example: + * + * + * + * ]]> + * + * + * + * + * + * flag indicates that after loading ispell data + * from defined source it should be sorted (it is necessary for correct + * functioning of ispell). In case of loading ispell data from files + * there may be several calls to udm_load_ispell_data, + * and there is no sense to sort data after every call, but only after + * the last one. Since in db mode all the data is loaded by one call, + * this parameter should have the value 1. In this mode + * in case of error, e.g. if ispell tables are absent, the function will + * return FALSE and code and error message will be accessible through + * udm_error and udm_errno. + * + * UDM_ISPELL_TYPE_AFFIX - indicates that ispell data should be loaded from + * file and initiates loading affixes file. In this case val1 + * defines double letter language code for which affixes are loaded, + * and val2 - file path. Please note, that if + * a relative path entered, the module looks for the file not in UDM_CONF_DIR, + * but in relation to current path, i.e. to the path where the script is executed. + * In case of error in this mode, e.g. if file is absent, the function will return + * FALSE, and an error message will be displayed. Error message text cannot be + * accessed through udm_error and udm_errno, + * since those functions can only return messages associated with SQL. Please, + * see flag parameter description in UDM_ISPELL_TYPE_DB. + * + * + * udm_load_ispell_data example + * + * + * ]]> + * + * + * + * flag is equal to 1 only in the last call. + * + * UDM_ISPELL_TYPE_SPELL - indicates that ispell data should be loaded from + * file and initiates loading of ispell dictionary file. In this case + * val1 defines double letter language code for which + * affixes are loaded, + * and val2 - file path. Please note, that if a relative + * path entered, the module looks for the file not in UDM_CONF_DIR, but in + * relation to current path, i.e. to the path where the script is executed. + * In case of error in this mode, e.g. if file is absent, the function will + * return FALSE, and an error message will be displayed. Error message text + * cannot be accessed through udm_error and + * udm_errno, since those functions can only return messages + * associated with SQL. Please, see flag parameter + * description in UDM_ISPELL_TYPE_DB. + * + * flag is equal to 1 only in the last call. + * + * UDM_ISPELL_TYPE_SERVER - enables spell server support. + * val1 parameter indicates + * address of the host running spell server. val2 ` + * is not used yet, but in future releases it is going to indicate number + * of port used by spell server. flag parameter in + * this case is not needed since ispell data is stored + * on spellserver already sorted. + * + * Spelld server reads spell-data from a separate configuration file + * (/usr/local/mnogosearch/etc/spelld.conf by default), sorts it and stores in + * memory. With clients server communicates in two ways: to indexer all the + * data is transferred (so that indexer starts faster), from search.cgi server + * receives word to normalize and then passes over to client (search.cgi) list + * of normalized word forms. This allows fastest, compared to db and text modes + * processing of search queries (by omitting loading and sorting all the spell data). + * + * udm_load_ispell_data function in UDM_ISPELL_TYPE_SERVER + * mode does not actually load ispell data, but only defines server address. + * In fact, server is automatically used by udm_find + * function when performing search. In case of errors, e.g. if spellserver + * is not running or invalid host indicated, there are no messages returned + * and ispell conversion does not work. + * + * This function is available in mnoGoSearch 3.1.12 or later. + * + * The fastest mode is UDM_ISPELL_TYPE_SERVER. + * UDM_ISPELL_TYPE_TEXT is slower + * and UDM_ISPELL_TYPE_DB is the slowest. The above pattern is TRUE for + * mnoGoSearch 3.1.10 - 3.1.11. It is planned to speed up DB mode in future + * versions and it is going to be faster than TEXT mode. + * @param string $val1 + * @param string $val2 + * @param int $flag + * @throws Exceptions\MnogosearchException + * + */ +function udm_load_ispell_data($agent, int $var, string $val1, string $val2, int $flag): void +{ + error_clear_last(); + $result = \udm_load_ispell_data($agent, $var, $val1, $val2, $flag); + if ($result === FALSE) { + throw Exceptions\MnogosearchException::createFromPhpError(); + } +} + + +/** + * Defines mnoGoSearch session parameters. + * + * @param resource $agent A link to Agent, received after call to + * udm_alloc_agent. + * @param int $var The following parameters and their values are available: + * + * + * + * UDM_PARAM_PAGE_NUM - used to choose search results page number (results + * are returned by pages beginning from 0, with UDM_PARAM_PAGE_SIZE results per page). + * + * + * + * + * UDM_PARAM_PAGE_SIZE - number of search results displayed on one page. + * + * + * + * + * UDM_PARAM_SEARCH_MODE - search mode. The following values available: UDM_MODE_ALL - + * search for all words; UDM_MODE_ANY - search for any word; UDM_MODE_PHRASE - + * phrase search; UDM_MODE_BOOL - boolean search. See udm_find + * for details on boolean search. + * + * + * + * + * UDM_PARAM_CACHE_MODE - turns on or off search result cache mode. + * When enabled, the search engine will store + * search results to disk. In case a similar search is performed later, + * the engine will take results from the cache for faster performance. + * Available values: UDM_CACHE_ENABLED, + * UDM_CACHE_DISABLED. + * + * + * + * + * UDM_PARAM_TRACK_MODE - turns on or off trackquery mode. Since + * version 3.1.2 mnoGoSearch has a query tracking support. + * Note that tracking is implemented in SQL version only and not available + * in built-in database. + * To use tracking, you have to create tables for tracking support. + * For MySQL, use create/mysql/track.txt. + * When doing a search, front-end uses those tables to store query words, + * a number of found documents and current Unix timestamp in seconds. + * Available values: UDM_TRACK_ENABLED, + * UDM_TRACK_DISABLED. + * + * + * + * + * UDM_PARAM_PHRASE_MODE - defines whether index database using phrases + * ("phrase" parameter in indexer.conf). + * Possible values: UDM_PHRASE_ENABLED and UDM_PHRASE_DISABLED. + * Please note, that if phrase search is enabled (UDM_PHRASE_ENABLED), + * it is still possible to do search in any mode (ANY, ALL, + * BOOL or PHRASE). + * In 3.1.10 version of mnoGoSearch phrase search is supported only in sql + * and built-in database modes, + * while beginning with 3.1.11 phrases are supported in cachemode as well. + * + * + * Examples of phrase search: + * + * + * "Arizona desert" - This query returns all indexed documents that contain + * "Arizona desert" as a phrase. Notice that you need to put double quotes + * around the phrase + * + * + * + * + * UDM_PARAM_CHARSET - defines local charset. Available values: set of + * charsets supported by mnoGoSearch, e.g. koi8-r, cp1251, ... + * + * + * + * + * UDM_PARAM_STOPFILE - Defines name and path + * to stopwords file. (There is a small difference with mnoGoSearch + * - while in mnoGoSearch if relative path or no path entered, it + * looks for this file in relation to UDM_CONF_DIR, the module looks for + * the file in relation to current path, i.e. to the path where the + * PHP script is executed.) + * + * + * + * + * UDM_PARAM_STOPTABLE - Load stop words from the given SQL table. You may use + * several StopwordTable commands. + * This command has no effect when compiled without SQL database support. + * + * + * + * + * UDM_PARAM_WEIGHT_FACTOR - represents weight factors for specific document parts. + * Currently body, title, keywords, description, url are supported. + * To activate this feature please use degrees of 2 in *Weight commands of + * the indexer.conf. Let's imagine that we have these weights: + * + * + * URLWeight 1 + * BodyWeight 2 + * TitleWeight 4 + * KeywordWeight 8 + * DescWeight 16 + * + * + * + * As far as indexer uses bit OR operation for word weights when some + * word presents several time in the same document, it is possible at search + * time to detect word appearance in different document parts. Word which + * appears only in the body will have 00000010 aggregate weight (in binary notation). + * Word used in all document parts will have 00011111 aggregate weight. + * + * + * + * This parameter's value is a string of hex digits ABCDE. Each digit is a + * factor for corresponding bit in word weight. For the given above weights + * configuration: + * + * + * E is a factor for weight 1 (URL Weight bit) + * D is a factor for weight 2 (BodyWeight bit) + * C is a factor for weight 4 (TitleWeight bit) + * B is a factor for weight 8 (KeywordWeight bit) + * A is a factor for weight 16 (DescWeight bit) + * + * + * Examples: + * + * + * UDM_PARAM_WEIGHT_FACTOR=00001 will search through URLs only. + * + * + * UDM_PARAM_WEIGHT_FACTOR=00100 will search through Titles only. + * + * + * UDM_PARAM_WEIGHT_FACTOR=11100 will search through Title,Keywords,Description + * but not through URL and Body. + * + * + * UDM_PARAM_WEIGHT_FACTOR=F9421 will search through: + * + * + * Description with factor 15 (F hex) + * Keywords with factor 9 + * Title with factor 4 + * Body with factor 2 + * URL with factor 1 + * + * + * If UDM_PARAM_WEIGHT_FACTOR variable is omitted, original weight value is + * taken to sort results. For a given above weight configuration it means + * that document description has a most big weight 16. + * + * + * + * + * UDM_PARAM_WORD_MATCH - word match. You may use this parameter to choose + * word match type. This feature works only in "single" and "multi" modes + * using SQL based and built-in database. It does not work in cachemode and other modes + * since they use word CRC and do not support substring search. Available values: + * + * UDM_MATCH_BEGIN - word beginning match; + * UDM_MATCH_END - word ending match; + * UDM_MATCH_WORD - whole word match; + * UDM_MATCH_SUBSTR - word substring match. + * + * + * + * UDM_PARAM_MIN_WORD_LEN - defines minimal word length. + * Any word shorter this limit is considered to be a stopword. Please note + * that this parameter value is inclusive, i.e. if UDM_PARAM_MIN_WORD_LEN=3, + * a word 3 characters long will not be considered a stopword, while + * a word 2 characters long will be. Default value is 1. + * + * + * + * + * UDM_PARAM_ISPELL_PREFIXES - Possible values: UDM_PREFIXES_ENABLED and + * UDM_PREFIXES_DISABLED, that respectively enable or disable using prefixes. + * E.g. if a word "tested" is in search query, also words like "test", + * "testing", etc. Only suffixes are supported by default. Prefixes usually + * change word meanings, for example if somebody is searching for the word "tested" + * one hardly wants "untested" to be found. Prefixes support may also be + * found useful for site's spelling checking purposes. In order to enable + * ispell, you have to load ispell data with udm_load_ispell_data. + * + * + * + * + * UDM_PARAM_CROSS_WORDS - enables or disables crosswords support. + * Possible values: UDM_CROSS_WORDS_ENABLED and UDM_CROSS_WORDS_DISABLED. + * + * + * The crosswords feature allows to assign words between <a href="xxx"> and </a> + * also to a document this link leads to. It works in SQL database mode and + * is not supported in built-in database and Cachemode. + * + * + * + * + * UDM_PARAM_VARDIR - specifies a custom path to directory where indexer + * stores data when using built-in database and in cache mode. + * By default /var directory of + * mnoGoSearch installation is used. Can have + * only string values. + * + * + * + * @param string $val + * @throws Exceptions\MnogosearchException + * + */ +function udm_set_agent_param($agent, int $var, string $val): void +{ + error_clear_last(); + $result = \udm_set_agent_param($agent, $var, $val); + if ($result === FALSE) { + throw Exceptions\MnogosearchException::createFromPhpError(); + } +} + + diff --git a/generated/msql.php b/generated/msql.php new file mode 100644 index 00000000..2cc4e01c --- /dev/null +++ b/generated/msql.php @@ -0,0 +1,416 @@ + + * + * The above example will output: + * + * example: , this is a test + * example: , this is a test + * ]]> + * + * + * So, $out[0] contains array of strings that matched full pattern, + * and $out[1] contains array of strings enclosed by tags. + * + * + * + * + * If the pattern contains named subpatterns, $matches + * additionally contains entries for keys with the subpattern name. + * + * + * If the pattern contains duplicate named subpatterns, only the rightmost + * subpattern is stored in $matches[NAME]. + * + * + * + * ]]> + * + * The above example will output: + * + * + * [1] => bar + * ) + * ]]> + * + * + * + * + * + * + * PREG_SET_ORDER + * + * + * Orders results so that $matches[0] is an array of first set + * of matches, $matches[1] is an array of second set of matches, + * and so on. + * + * + * + * ]]> + * + * The above example will output: + * + * example: , example: + * this is a test, this is a test + * ]]> + * + * + * + * + * + * + * PREG_OFFSET_CAPTURE + * + * + * If this flag is passed, for every occurring match the appendant string + * offset will also be returned. Note that this changes the value of + * matches into an array of arrays where every element is an + * array consisting of the matched string at offset 0 + * and its string offset into subject at offset + * 1. + * + * + * + * ]]> + * + * The above example will output: + * + * Array + * ( + * [0] => Array + * ( + * [0] => foobarbaz + * [1] => 0 + * ) + * + * ) + * + * [1] => Array + * ( + * [0] => Array + * ( + * [0] => foo + * [1] => 0 + * ) + * + * ) + * + * [2] => Array + * ( + * [0] => Array + * ( + * [0] => bar + * [1] => 3 + * ) + * + * ) + * + * [3] => Array + * ( + * [0] => Array + * ( + * [0] => baz + * [1] => 6 + * ) + * + * ) + * + * ) + * ]]> + * + * + * + * + * + * + * PREG_UNMATCHED_AS_NULL + * + * + * If this flag is passed, unmatched subpatterns are reported as NULL; + * otherwise they are reported as an empty string. + * + * + * + * + * + * Orders results so that $matches[0] is an array of full + * pattern matches, $matches[1] is an array of strings matched by + * the first parenthesized subpattern, and so on. + * + * + * + * + * ]]> + * + * The above example will output: + * + * example: , this is a test + * example: , this is a test + * ]]> + * + * + * So, $out[0] contains array of strings that matched full pattern, + * and $out[1] contains 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. + * + * If the pattern contains named subpatterns, $matches + * additionally contains entries for keys with the subpattern name. + * + * If the pattern contains duplicate named subpatterns, only the rightmost + * subpattern is stored in $matches[NAME]. + * + * + * + * ]]> + * + * The above example will output: + * + * + * [1] => bar + * ) + * ]]> + * + * + * + * The above example will output: + * + * Orders results so that $matches[0] is an array of first set + * of matches, $matches[1] is an array of second set of matches, + * and so on. + * + * + * + * ]]> + * + * The above example will output: + * + * example: , example: + * this is a test, this is a test + * ]]> + * + * + * + * The above example will output: + * + * If this flag is passed, for every occurring match the appendant string + * offset will also be returned. Note that this changes the value of + * matches into an array of arrays where every element is an + * array consisting of the matched string at offset 0 + * and its string offset into subject at offset + * 1. + * + * + * + * ]]> + * + * The above example will output: + * + * Array + * ( + * [0] => Array + * ( + * [0] => foobarbaz + * [1] => 0 + * ) + * + * ) + * + * [1] => Array + * ( + * [0] => Array + * ( + * [0] => foo + * [1] => 0 + * ) + * + * ) + * + * [2] => Array + * ( + * [0] => Array + * ( + * [0] => bar + * [1] => 3 + * ) + * + * ) + * + * [3] => Array + * ( + * [0] => Array + * ( + * [0] => baz + * [1] => 6 + * ) + * + * ) + * + * ) + * ]]> + * + * + * + * The above example will output: + * + * If this flag is passed, unmatched subpatterns are reported as NULL; + * otherwise they are reported as an empty string. + * + * If no order flag is given, PREG_PATTERN_ORDER is + * assumed. + * @param int $offset Orders results so that $matches[0] is an array of full + * pattern matches, $matches[1] is an array of strings matched by + * the first parenthesized subpattern, and so on. + * + * + * + * + * ]]> + * + * The above example will output: + * + * example: , this is a test + * example: , this is a test + * ]]> + * + * + * So, $out[0] contains array of strings that matched full pattern, + * and $out[1] contains 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. + * + * If the pattern contains named subpatterns, $matches + * additionally contains entries for keys with the subpattern name. + * + * If the pattern contains duplicate named subpatterns, only the rightmost + * subpattern is stored in $matches[NAME]. + * + * + * + * ]]> + * + * The above example will output: + * + * + * [1] => bar + * ) + * ]]> + * + * + * + * The above example will output: + * @return int Returns the number of full pattern matches (which might be zero), + * . + * @throws Exceptions\PcreException + * + */ +function preg_match_all(string $pattern, string $subject, array &$matches, int $flags = PREG_PATTERN_ORDER, int $offset = 0): int +{ + error_clear_last(); + if ($offset !== 0) { + $result = \preg_match_all($pattern, $subject, $matches, $flags, $offset); + } elseif ($flags !== PREG_PATTERN_ORDER) { + $result = \preg_match_all($pattern, $subject, $matches, $flags); + } elseif ($matches !== null) { + $result = \preg_match_all($pattern, $subject, $matches); + }else { + $result = \preg_match_all($pattern, $subject); + } + if ($result === FALSE) { + throw Exceptions\PcreException::createFromPhpError(); + } + return $result; +} + + +/** + * Searches subject for a match to the regular + * expression given in pattern. + * + * @param string $pattern The pattern to search for, as a string. + * @param string $subject The input string. + * @param array $matches If matches is provided, then it is filled with + * the results of search. $matches[0] will contain the + * text that matched the full pattern, $matches[1] + * will have the text that matched the first captured parenthesized + * subpattern, and so on. + * @param int $flags flags can be a combination of the following flags: + * + * + * PREG_OFFSET_CAPTURE + * + * + * If this flag is passed, for every occurring match the appendant string + * offset will also be returned. Note that this changes the value of + * matches into an array where every element is an + * array consisting of the matched string at offset 0 + * and its string offset into subject at offset + * 1. + * + * + * + * ]]> + * + * The above example will output: + * + * Array + * ( + * [0] => foobarbaz + * [1] => 0 + * ) + * + * [1] => Array + * ( + * [0] => foo + * [1] => 0 + * ) + * + * [2] => Array + * ( + * [0] => bar + * [1] => 3 + * ) + * + * [3] => Array + * ( + * [0] => baz + * [1] => 6 + * ) + * + * ) + * ]]> + * + * + * + * + * + * + * PREG_UNMATCHED_AS_NULL + * + * + * If this flag is passed, unmatched subpatterns are reported as NULL; + * otherwise they are reported as an empty string. + * + * + * + * ]]> + * + * The above example will output: + * + * + * string(2) "ac" + * [1]=> + * string(1) "a" + * [2]=> + * string(0) "" + * [3]=> + * string(1) "c" + * } + * array(4) { + * [0]=> + * string(2) "ac" + * [1]=> + * string(1) "a" + * [2]=> + * NULL + * [3]=> + * string(1) "c" + * } + * ]]> + * + * + * + * + * + * + * + * If this flag is passed, for every occurring match the appendant string + * offset will also be returned. Note that this changes the value of + * matches into an array where every element is an + * array consisting of the matched string at offset 0 + * and its string offset into subject at offset + * 1. + * + * + * + * ]]> + * + * The above example will output: + * + * Array + * ( + * [0] => foobarbaz + * [1] => 0 + * ) + * + * [1] => Array + * ( + * [0] => foo + * [1] => 0 + * ) + * + * [2] => Array + * ( + * [0] => bar + * [1] => 3 + * ) + * + * [3] => Array + * ( + * [0] => baz + * [1] => 6 + * ) + * + * ) + * ]]> + * + * + * + * The above example will output: + * + * If this flag is passed, unmatched subpatterns are reported as NULL; + * otherwise they are reported as an empty string. + * + * + * + * ]]> + * + * The above example will output: + * + * + * string(2) "ac" + * [1]=> + * string(1) "a" + * [2]=> + * string(0) "" + * [3]=> + * string(1) "c" + * } + * array(4) { + * [0]=> + * string(2) "ac" + * [1]=> + * string(1) "a" + * [2]=> + * NULL + * [3]=> + * string(1) "c" + * } + * ]]> + * + * + * + * The above example will output: + * @param int $offset If this flag is passed, for every occurring match the appendant string + * offset will also be returned. Note that this changes the value of + * matches into an array where every element is an + * array consisting of the matched string at offset 0 + * and its string offset into subject at offset + * 1. + * + * + * + * ]]> + * + * The above example will output: + * + * Array + * ( + * [0] => foobarbaz + * [1] => 0 + * ) + * + * [1] => Array + * ( + * [0] => foo + * [1] => 0 + * ) + * + * [2] => Array + * ( + * [0] => bar + * [1] => 3 + * ) + * + * [3] => Array + * ( + * [0] => baz + * [1] => 6 + * ) + * + * ) + * ]]> + * + * + * + * The above example will output: + * @return int preg_match returns 1 if the pattern + * matches given subject, 0 if it does not, . + * @throws Exceptions\PcreException + * + */ +function preg_match(string $pattern, string $subject, array &$matches, int $flags = 0, int $offset = 0): int +{ + error_clear_last(); + if ($offset !== 0) { + $result = \preg_match($pattern, $subject, $matches, $flags, $offset); + } elseif ($flags !== 0) { + $result = \preg_match($pattern, $subject, $matches, $flags); + } elseif ($matches !== null) { + $result = \preg_match($pattern, $subject, $matches); + }else { + $result = \preg_match($pattern, $subject); + } + if ($result === FALSE) { + throw Exceptions\PcreException::createFromPhpError(); + } + return $result; +} + + +/** + * Split the given string by a regular expression. + * + * @param string $pattern The pattern to search for, as a string. + * @param string $subject The input string. + * @param int|null $limit If specified, then only substrings up to limit + * are returned with the rest of the string being placed in the last + * substring. A limit of -1 or 0 means "no limit" + * and, as is standard across PHP, you can use NULL to skip to the + * flags parameter. + * @param int $flags flags can be any combination of the following + * flags (combined with the | bitwise operator): + * + * + * PREG_SPLIT_NO_EMPTY + * + * + * If this flag is set, only non-empty pieces will be returned by + * preg_split. + * + * + * + * + * PREG_SPLIT_DELIM_CAPTURE + * + * + * If this flag is set, parenthesized expression in the delimiter pattern + * will be captured and returned as well. + * + * + * + * + * PREG_SPLIT_OFFSET_CAPTURE + * + * + * If this flag is set, for every occurring match the appendant string + * offset will also be returned. Note that this changes the return + * value in an array where every element is an array consisting of the + * matched string at offset 0 and its string offset + * into subject at offset 1. + * + * + * + * + * + * If this flag is set, for every occurring match the appendant string + * offset will also be returned. Note that this changes the return + * value in an array where every element is an array consisting of the + * matched string at offset 0 and its string offset + * into subject at offset 1. + * @return array Returns an array containing substrings of subject + * split along boundaries matched by pattern, . + * @throws Exceptions\PcreException + * + */ +function preg_split(string $pattern, string $subject, int $limit = -1, int $flags = 0): array +{ + error_clear_last(); + $result = \preg_split($pattern, $subject, $limit, $flags); + if ($result === FALSE) { + throw Exceptions\PcreException::createFromPhpError(); + } + return $result; +} + + diff --git a/generated/pdf.php b/generated/pdf.php new file mode 100644 index 00000000..1ac97b00 --- /dev/null +++ b/generated/pdf.php @@ -0,0 +1,1553 @@ + + * ]]> + * + * + * + * @param string $prompt The prompt message. + * @param callable $callback The callback function takes one parameter; the + * user input returned. + * @throws Exceptions\ReadlineException + * + */ +function readline_callback_handler_install(string $prompt, callable $callback): void +{ + error_clear_last(); + $result = \readline_callback_handler_install($prompt, $callback); + if ($result === FALSE) { + throw Exceptions\ReadlineException::createFromPhpError(); + } +} + + +/** + * This function clears the entire command line history. + * + * @throws Exceptions\ReadlineException + * + */ +function readline_clear_history(): void +{ + error_clear_last(); + $result = \readline_clear_history(); + if ($result === FALSE) { + throw Exceptions\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. + * + * @param callable $function You must supply the name of an existing function which accepts a + * partial command line and returns an array of possible matches. + * @throws Exceptions\ReadlineException + * + */ +function readline_completion_function(callable $function): void +{ + error_clear_last(); + $result = \readline_completion_function($function); + if ($result === FALSE) { + throw Exceptions\ReadlineException::createFromPhpError(); + } +} + + +/** + * This function reads a command history from a file. + * + * @param string $filename Path to the filename containing the command history. + * @throws Exceptions\ReadlineException + * + */ +function readline_read_history(string $filename): void +{ + error_clear_last(); + if ($filename !== null) { + $result = \readline_read_history($filename); + }else { + $result = \readline_read_history(); + } + if ($result === FALSE) { + throw Exceptions\ReadlineException::createFromPhpError(); + } +} + + +/** + * This function writes the command history to a file. + * + * @param string $filename Path to the saved file. + * @throws Exceptions\ReadlineException + * + */ +function readline_write_history(string $filename): void +{ + error_clear_last(); + if ($filename !== null) { + $result = \readline_write_history($filename); + }else { + $result = \readline_write_history(); + } + if ($result === FALSE) { + throw Exceptions\ReadlineException::createFromPhpError(); + } +} + + diff --git a/generated/rpmreader.php b/generated/rpmreader.php new file mode 100644 index 00000000..d8aa3628 --- /dev/null +++ b/generated/rpmreader.php @@ -0,0 +1,43 @@ + + * + * + * + * If session_start was not called before this function + * is called, an implicit call to session_start with no + * parameters will be made. $_SESSION does not mimic + * this behavior and requires session_start before use. + * + * @param mixed $name A string holding the name of a variable or an array consisting of + * variable names or other arrays. + * @param mixed $params + * @throws Exceptions\SessionException + * + */ +function session_register($name, ...$params): void +{ + error_clear_last(); + if ($params !== null) { + $result = \session_register($name, $params); + }else { + $result = \session_register($name); + } + if ($result === FALSE) { + throw Exceptions\SessionException::createFromPhpError(); + } +} + + +/** + * session_reset reinitializes a session with + * original values stored in session storage. This function requires an active session and + * discards changes in $_SESSION. + * + * @throws Exceptions\SessionException + * + */ +function session_reset(): void +{ + error_clear_last(); + $result = \session_reset(); + if ($result === FALSE) { + throw Exceptions\SessionException::createFromPhpError(); + } +} + + +/** + * Set cookie parameters defined in the php.ini file. The effect of this + * function only lasts for the duration of the script. Thus, you need to + * call session_set_cookie_params for every request and + * before session_start is called. + * + * This function updates the runtime ini values of the corresponding PHP ini configuration + * keys which can be retrieved with the ini_get. + * + * @param int $lifetime Lifetime of the + * session cookie, defined in seconds. + * @param string $path Path on the domain where + * the cookie will work. Use a single slash ('/') for all paths on the + * domain. + * @param string|null $domain Cookie domain, for + * example 'www.php.net'. To make cookies visible on all subdomains then + * the domain must be prefixed with a dot like '.php.net'. + * @param bool $secure If TRUE cookie will only be sent over + * secure connections. + * @param bool $httponly If set to TRUE then PHP will attempt to send the + * httponly + * flag when setting the session cookie. + * @throws Exceptions\SessionException + * + */ +function session_set_cookie_params(int $lifetime, string $path, string $domain, bool $secure = false, bool $httponly = false): void +{ + error_clear_last(); + if ($httponly !== false) { + $result = \session_set_cookie_params($lifetime, $path, $domain, $secure, $httponly); + } elseif ($secure !== false) { + $result = \session_set_cookie_params($lifetime, $path, $domain, $secure); + } elseif ($domain !== null) { + $result = \session_set_cookie_params($lifetime, $path, $domain); + } elseif ($path !== null) { + $result = \session_set_cookie_params($lifetime, $path); + }else { + $result = \session_set_cookie_params($lifetime); + } + if ($result === FALSE) { + throw Exceptions\SessionException::createFromPhpError(); + } +} + + +/** + * session_unregister unregisters the global variable + * named name from the current session. + * + * @param string $name The variable name. + * @throws Exceptions\SessionException + * + */ +function session_unregister(string $name): void +{ + error_clear_last(); + $result = \session_unregister($name); + if ($result === FALSE) { + throw Exceptions\SessionException::createFromPhpError(); + } +} + + +/** + * The session_unset function frees all session variables + * currently registered. + * + * @throws Exceptions\SessionException + * + */ +function session_unset(): void +{ + error_clear_last(); + $result = \session_unset(); + if ($result === FALSE) { + throw Exceptions\SessionException::createFromPhpError(); + } +} + + +/** + * End the current session and store session data. + * + * Session data is usually stored after your script terminated without the + * need to call session_write_close, but as session data + * is locked to prevent concurrent writes only one script may operate on a + * session at any time. When using framesets together with sessions you will + * experience the frames loading one by one due to this locking. You can + * reduce the time needed to load all the frames by ending the session as + * soon as all changes to session variables are done. + * + * @throws Exceptions\SessionException + * + */ +function session_write_close(): void +{ + error_clear_last(); + $result = \session_write_close(); + if ($result === FALSE) { + throw Exceptions\SessionException::createFromPhpError(); + } +} + + diff --git a/generated/sessionPgsql.php b/generated/sessionPgsql.php new file mode 100644 index 00000000..22afe1a9 --- /dev/null +++ b/generated/sessionPgsql.php @@ -0,0 +1,59 @@ + + * + * + * This will output "There are 5 monkeys in the tree". But + * imagine we are creating a format string in a separate file, + * commonly because we would like to internationalize it and we + * rewrite it as: + * + * Argument swapping + * + * + * ]]> + * + * + * We now have a problem. The order of the placeholders in the + * format string does not match the order of the arguments in the + * code. We would like to leave the code as is and simply indicate + * in the format string which arguments the placeholders refer to. + * We would write the format string like this instead: + * + * Argument swapping + * + * + * ]]> + * + * + * An added benefit here is that you can repeat the placeholders without + * adding more arguments in the code. For example: + * + * Argument swapping + * + * + * ]]> + * + * + * When using argument swapping, the n$ + * position specifier must come immediately + * after the percent sign (%), before any other + * specifiers, as shown in the example below. + * + * Specifying padding character + * + * + * ]]> + * + * The above example will output: + * + * + * + * + * + * Position specifier with other specifiers + * + * + * ]]> + * + * The above example will output: + * + * + * + * + * + * The above example will output: + * + * The above example will output: + * + * Attempting to use a position specifier greater than + * PHP_INT_MAX will result in + * sprintf generating warnings. + * + * The c type specifier ignores padding and width + * @param string|int|float $args + * @param mixed $params + * @return string Returns a string produced according to the formatting string + * format, . + * @throws Exceptions\StringsException + * + */ +function sprintf(string $format, $args, ...$params): string +{ + error_clear_last(); + if ($params !== null) { + $result = \sprintf($format, $args, $params); + } elseif ($args !== null) { + $result = \sprintf($format, $args); + }else { + $result = \sprintf($format); + } + if ($result === FALSE) { + throw Exceptions\StringsException::createFromPhpError(); + } + return $result; +} + + +/** + * Returns the portion of string specified by the + * start and length parameters. + * + * @param string $string The input string. Must be one character or longer. + * @param int $start If start is non-negative, the returned string + * will start at the start'th position in + * string, counting from zero. For instance, + * in the string 'abcdef', the character at + * position 0 is 'a', the + * character at position 2 is + * 'c', and so forth. + * + * If start is negative, the returned string + * will start at the start'th character + * from the end of string. + * + * If string is less than + * start characters long, FALSE will be returned. + * + * + * Using a negative start + * + * + * ]]> + * + * + * @param int $length If length is given and is positive, the string + * returned will contain at most length characters + * beginning from start (depending on the length of + * string). + * + * If length is given and is negative, then that many + * characters will be omitted from the end of string + * (after the start position has been calculated when a + * start is negative). If + * start denotes the position of this truncation or + * beyond, FALSE will be returned. + * + * If length is given and is 0, + * FALSE or NULL, an empty string will be returned. + * + * If length is omitted, the substring starting from + * start until the end of the string will be + * returned. + * @return string Returns the extracted part of string; , or + * an empty string. + * @throws Exceptions\StringsException + * + */ +function substr(string $string, int $start, int $length): string +{ + error_clear_last(); + if ($length !== null) { + $result = \substr($string, $start, $length); + }else { + $result = \substr($string, $start); + } + if ($result === FALSE) { + throw Exceptions\StringsException::createFromPhpError(); + } + return $result; +} + + diff --git a/generated/suhosin.php b/generated/suhosin.php new file mode 100644 index 00000000..23dbef47 --- /dev/null +++ b/generated/suhosin.php @@ -0,0 +1,72 @@ +