From 386e3655b3f561d78d6b016086e2f3b048fb1b8e Mon Sep 17 00:00:00 2001 From: Shish Date: Thu, 5 Dec 2024 13:31:11 +0000 Subject: [PATCH 1/2] Generate files for multiple versions --- composer.json | 6 +++-- generator/src/FileCreator.php | 24 +++++++++++++++++ generator/src/GenerateCommand.php | 45 ++++++++++++++++++++----------- 3 files changed, 57 insertions(+), 18 deletions(-) diff --git a/composer.json b/composer.json index 18a794bf..91733259 100644 --- a/composer.json +++ b/composer.json @@ -43,6 +43,7 @@ "generated/ftp.php", "generated/funchand.php", "generated/gettext.php", + "generated/gmp.php", "generated/gnupg.php", "generated/hash.php", "generated/ibase.php", @@ -60,6 +61,7 @@ "generated/mbstring.php", "generated/misc.php", "generated/mysql.php", + "generated/mysqli.php", "generated/network.php", "generated/oci8.php", "generated/opcache.php", @@ -72,7 +74,6 @@ "generated/ps.php", "generated/pspell.php", "generated/readline.php", - "generated/rnp.php", "generated/rpminfo.php", "generated/rrd.php", "generated/sem.php", @@ -98,7 +99,8 @@ "generated/yaml.php", "generated/yaz.php", "generated/zip.php", - "generated/zlib.php" + "generated/zlib.php", + "generated/rnp.php" ] }, "require": { diff --git a/generator/src/FileCreator.php b/generator/src/FileCreator.php index bc90f12e..9c8d6e5f 100644 --- a/generator/src/FileCreator.php +++ b/generator/src/FileCreator.php @@ -28,6 +28,9 @@ public function generatePhpFile(array $functions, string $path): void foreach ($phpFunctionsByModule as $module => $phpFunctions) { $lcModule = \lcfirst($module); + if (!is_dir($path)) { + \mkdir($path); + } $stream = \fopen($path.$lcModule.'.php', 'w'); if ($stream === false) { throw new \RuntimeException('Unable to write to '.$path); @@ -43,6 +46,27 @@ public function generatePhpFile(array $functions, string $path): void } } + /** + * @param string[] $versions + */ + public function generateVersionSplitters(string $module, string $path, array $versions): void + { + $lcModule = \lcfirst($module); + $stream = \fopen($path.$lcModule.'.php', 'w'); + if ($stream === false) { + throw new \RuntimeException('Unable to write to '.$path); + } + \fwrite($stream, "rmGenerated(); // Let's build the DTD necessary to load the XML files. DocPage::buildEntities(); - $scanner = new Scanner(__DIR__ . '/../doc/doc-en/en/reference/'); - $paths = $scanner->getFunctionsPaths(); + $versions = [ + "8.1" => "9097ea48f608dbbbf795235a31af82b85bd94430", + "8.2" => "8f4e8cf3de08208e71eb0117f1c970c27e9120c9", + "8.3" => "7453a50321f0834421cebea8edade14deef5466b", + "8.4" => "d553fa36940639b0889ec4358fa3bbb92f123b69", + "8.5" => "master", + ]; + $modules = []; - $res = $scanner->getMethods($paths); - $functions = $res->methods; - $overloadedFunctions = $res->overloadedFunctions; + foreach ($versions as $version => $commit) { + $process = new Process(['git', "checkout", $commit], __DIR__ . '/../doc/doc-en/en/reference/'); + $process->run(); + $scanner = new Scanner(__DIR__ . '/../doc/doc-en/en/reference/'); - $output->writeln('These functions have been ignored and must be dealt with manually: '.\implode(', ', $overloadedFunctions)); + $paths = $scanner->getFunctionsPaths(); - $fileCreator = new FileCreator(); - $fileCreator->generatePhpFile($functions, __DIR__ . '/../../generated/'); - $fileCreator->generateFunctionsList($functions, __DIR__ . '/../../generated/functionsList.php'); - $fileCreator->generateRectorFile($functions, __DIR__ . '/../../rector-migrate.php'); + $res = $scanner->getMethods($paths); + $functions = $res->methods; + $overloadedFunctions = $res->overloadedFunctions; + $output->writeln('These functions have been ignored and must be dealt with manually: '.\implode(', ', $overloadedFunctions)); - $modules = []; - foreach ($functions as $function) { - $moduleName = $function->getModuleName(); - $modules[$moduleName] = $moduleName; + $fileCreator = new FileCreator(); + $fileCreator->generatePhpFile($functions, __DIR__ . "/../../generated/$version/"); + $fileCreator->generateFunctionsList($functions, __DIR__ . "/../../generated/$version/functionsList.php"); + $fileCreator->generateRectorFile($functions, __DIR__ . "/../../generated/$version/rector-migrate.php"); + + foreach ($functions as $function) { + $moduleName = $function->getModuleName(); + $modules[$moduleName] = $moduleName; + } } foreach ($modules as $moduleName => $foo) { + $fileCreator->generateVersionSplitters($moduleName, __DIR__ . "/../../generated/", array_keys($versions)); $fileCreator->createExceptionFile((string) $moduleName); } $this->runCsFix($output); // Let's require the generated file to check there is no error. - $files = \glob(__DIR__.'/../../generated/*.php'); + $files = \glob(__DIR__."/../../generated/8.1/*.php"); if ($files === false) { throw new \RuntimeException('Failed to require the generated file'); } @@ -91,7 +104,7 @@ private function rmGenerated(): void \unlink($exception); } - $files = \glob(__DIR__.'/../../generated/*.php'); + $files = \glob(__DIR__.'/../../generated/*/*.php'); if ($files === false) { throw new \RuntimeException('Failed to require the generated files'); } From 7db3208a5a69342e9966b5aa6d25473207dd12f8 Mon Sep 17 00:00:00 2001 From: Shish Date: Thu, 5 Dec 2024 13:31:11 +0000 Subject: [PATCH 2/2] regenerate --- generated/8.1/apache.php | 199 ++ generated/8.1/apcu.php | 112 + generated/8.1/array.php | 188 ++ generated/8.1/bzip2.php | 97 + generated/8.1/calendar.php | 30 + generated/8.1/classobj.php | 25 + generated/8.1/com.php | 196 ++ generated/8.1/cubrid.php | 2038 +++++++++++++ generated/8.1/curl.php | 3264 +++++++++++++++++++++ generated/8.1/datetime.php | 1099 +++++++ generated/8.1/dir.php | 134 + generated/8.1/eio.php | 2124 ++++++++++++++ generated/8.1/errorfunc.php | 82 + generated/8.1/exec.php | 125 + generated/8.1/fileinfo.php | 79 + generated/8.1/filesystem.php | 1599 +++++++++++ generated/8.1/filter.php | 81 + generated/8.1/fpm.php | 22 + generated/8.1/ftp.php | 525 ++++ generated/8.1/funchand.php | 47 + generated/8.1/functionsList.php | 1092 +++++++ generated/8.1/gettext.php | 27 + generated/8.1/gmp.php | 29 + generated/8.1/gnupg.php | 168 ++ generated/8.1/hash.php | 65 + generated/8.1/ibase.php | 661 +++++ generated/8.1/ibmDb2.php | 1221 ++++++++ generated/8.1/iconv.php | 96 + generated/8.1/image.php | 3000 +++++++++++++++++++ generated/8.1/imap.php | 2283 +++++++++++++++ generated/8.1/info.php | 690 +++++ generated/8.1/inotify.php | 44 + generated/8.1/json.php | 53 + generated/8.1/ldap.php | 1244 ++++++++ generated/8.1/libxml.php | 78 + generated/8.1/lzf.php | 44 + generated/8.1/mailparse.php | 127 + generated/8.1/mbstring.php | 601 ++++ generated/8.1/misc.php | 544 ++++ generated/8.1/mysql.php | 938 ++++++ generated/8.1/mysqli.php | 22 + generated/8.1/network.php | 739 +++++ generated/8.1/oci8.php | 1619 +++++++++++ generated/8.1/opcache.php | 43 + generated/8.1/openssl.php | 1458 ++++++++++ generated/8.1/outcontrol.php | 251 ++ generated/8.1/pcntl.php | 253 ++ generated/8.1/pcre.php | 685 +++++ generated/8.1/pgsql.php | 1360 +++++++++ generated/8.1/posix.php | 733 +++++ generated/8.1/ps.php | 1812 ++++++++++++ generated/8.1/pspell.php | 501 ++++ generated/8.1/readline.php | 125 + generated/8.1/rector-migrate.php | 1102 +++++++ generated/8.1/rpminfo.php | 21 + generated/8.1/rrd.php | 190 ++ generated/8.1/sem.php | 545 ++++ generated/8.1/session.php | 372 +++ generated/8.1/shmop.php | 45 + generated/8.1/sockets.php | 853 ++++++ generated/8.1/sodium.php | 326 +++ generated/8.1/solr.php | 22 + generated/8.1/spl.php | 136 + generated/8.1/sqlsrv.php | 429 +++ generated/8.1/ssdeep.php | 70 + generated/8.1/ssh2.php | 747 +++++ generated/8.1/stream.php | 614 ++++ generated/8.1/strings.php | 88 + generated/8.1/swoole.php | 148 + generated/8.1/uodbc.php | 1202 ++++++++ generated/8.1/uopz.php | 40 + generated/8.1/url.php | 205 ++ generated/8.1/var.php | 60 + generated/8.1/xdiff.php | 236 ++ generated/8.1/xml.php | 716 +++++ generated/8.1/xmlrpc.php | 22 + generated/8.1/yaml.php | 109 + generated/8.1/yaz.php | 438 +++ generated/8.1/zip.php | 144 + generated/8.1/zlib.php | 721 +++++ generated/8.2/apache.php | 199 ++ generated/8.2/apcu.php | 112 + generated/8.2/array.php | 57 + generated/8.2/bzip2.php | 97 + generated/8.2/calendar.php | 30 + generated/8.2/classobj.php | 25 + generated/8.2/com.php | 196 ++ generated/8.2/cubrid.php | 2038 +++++++++++++ generated/8.2/curl.php | 3319 ++++++++++++++++++++++ generated/8.2/datetime.php | 1159 ++++++++ generated/8.2/dir.php | 134 + generated/8.2/eio.php | 2124 ++++++++++++++ generated/8.2/errorfunc.php | 82 + generated/8.2/exec.php | 154 + generated/8.2/fileinfo.php | 79 + generated/8.2/filesystem.php | 1605 +++++++++++ generated/8.2/filter.php | 81 + generated/8.2/fpm.php | 45 + generated/8.2/ftp.php | 547 ++++ generated/8.2/funchand.php | 49 + generated/8.2/functionsList.php | 1122 ++++++++ generated/8.2/gettext.php | 27 + generated/8.2/gnupg.php | 188 ++ generated/8.2/hash.php | 27 + generated/8.2/ibase.php | 661 +++++ generated/8.2/ibmDb2.php | 1221 ++++++++ generated/8.2/iconv.php | 95 + generated/8.2/image.php | 2985 +++++++++++++++++++ generated/8.2/imap.php | 2289 +++++++++++++++ generated/8.2/info.php | 690 +++++ generated/8.2/inotify.php | 44 + generated/8.2/json.php | 58 + generated/8.2/ldap.php | 1246 ++++++++ generated/8.2/libxml.php | 78 + generated/8.2/lzf.php | 44 + generated/8.2/mailparse.php | 127 + generated/8.2/mbstring.php | 604 ++++ generated/8.2/misc.php | 518 ++++ generated/8.2/mysql.php | 938 ++++++ generated/8.2/network.php | 844 ++++++ generated/8.2/oci8.php | 1655 +++++++++++ generated/8.2/opcache.php | 43 + generated/8.2/openssl.php | 1454 ++++++++++ generated/8.2/outcontrol.php | 251 ++ generated/8.2/pcntl.php | 255 ++ generated/8.2/pcre.php | 685 +++++ generated/8.2/pgsql.php | 1360 +++++++++ generated/8.2/posix.php | 733 +++++ generated/8.2/ps.php | 1812 ++++++++++++ generated/8.2/pspell.php | 501 ++++ generated/8.2/readline.php | 125 + generated/8.2/rector-migrate.php | 1132 ++++++++ generated/8.2/rnp.php | 609 ++++ generated/8.2/rpminfo.php | 21 + generated/8.2/rrd.php | 190 ++ generated/8.2/sem.php | 545 ++++ generated/8.2/session.php | 372 +++ generated/8.2/shmop.php | 45 + generated/8.2/sockets.php | 853 ++++++ generated/8.2/sodium.php | 350 +++ generated/8.2/solr.php | 22 + generated/8.2/spl.php | 136 + generated/8.2/sqlsrv.php | 429 +++ generated/8.2/ssdeep.php | 70 + generated/8.2/ssh2.php | 747 +++++ generated/8.2/stream.php | 764 +++++ generated/8.2/strings.php | 88 + generated/8.2/swoole.php | 148 + generated/8.2/uodbc.php | 1202 ++++++++ generated/8.2/uopz.php | 40 + generated/8.2/url.php | 204 ++ generated/8.2/var.php | 60 + generated/8.2/xdiff.php | 236 ++ generated/8.2/xml.php | 716 +++++ generated/8.2/xmlrpc.php | 22 + generated/8.2/yaml.php | 109 + generated/8.2/yaz.php | 438 +++ generated/8.2/zip.php | 144 + generated/8.2/zlib.php | 721 +++++ generated/8.3/apache.php | 199 ++ generated/8.3/apcu.php | 112 + generated/8.3/array.php | 57 + generated/8.3/bzip2.php | 97 + generated/8.3/calendar.php | 30 + generated/8.3/classobj.php | 25 + generated/8.3/com.php | 196 ++ generated/8.3/cubrid.php | 2038 +++++++++++++ generated/8.3/curl.php | 3319 ++++++++++++++++++++++ generated/8.3/datetime.php | 1159 ++++++++ generated/8.3/dir.php | 134 + generated/8.3/eio.php | 2124 ++++++++++++++ generated/8.3/errorfunc.php | 82 + generated/8.3/exec.php | 154 + generated/8.3/fileinfo.php | 79 + generated/8.3/filesystem.php | 1605 +++++++++++ generated/8.3/filter.php | 81 + generated/8.3/fpm.php | 45 + generated/8.3/ftp.php | 547 ++++ generated/8.3/funchand.php | 49 + generated/8.3/functionsList.php | 1122 ++++++++ generated/8.3/gettext.php | 27 + generated/8.3/gnupg.php | 188 ++ generated/8.3/hash.php | 27 + generated/8.3/ibase.php | 661 +++++ generated/8.3/ibmDb2.php | 1221 ++++++++ generated/8.3/iconv.php | 95 + generated/8.3/image.php | 2973 +++++++++++++++++++ generated/8.3/imap.php | 2289 +++++++++++++++ generated/8.3/info.php | 690 +++++ generated/8.3/inotify.php | 44 + generated/8.3/json.php | 58 + generated/8.3/ldap.php | 1246 ++++++++ generated/8.3/libxml.php | 78 + generated/8.3/lzf.php | 44 + generated/8.3/mailparse.php | 127 + generated/8.3/mbstring.php | 604 ++++ generated/8.3/misc.php | 518 ++++ generated/8.3/mysql.php | 938 ++++++ generated/8.3/network.php | 844 ++++++ generated/8.3/oci8.php | 1655 +++++++++++ generated/8.3/opcache.php | 43 + generated/8.3/openssl.php | 1454 ++++++++++ generated/8.3/outcontrol.php | 251 ++ generated/8.3/pcntl.php | 255 ++ generated/8.3/pcre.php | 685 +++++ generated/8.3/pgsql.php | 1360 +++++++++ generated/8.3/posix.php | 733 +++++ generated/8.3/ps.php | 1812 ++++++++++++ generated/8.3/pspell.php | 501 ++++ generated/8.3/readline.php | 125 + generated/8.3/rector-migrate.php | 1132 ++++++++ generated/8.3/rnp.php | 609 ++++ generated/8.3/rpminfo.php | 21 + generated/8.3/rrd.php | 190 ++ generated/8.3/sem.php | 545 ++++ generated/8.3/session.php | 372 +++ generated/8.3/shmop.php | 45 + generated/8.3/sockets.php | 853 ++++++ generated/8.3/sodium.php | 350 +++ generated/8.3/solr.php | 22 + generated/8.3/spl.php | 136 + generated/8.3/sqlsrv.php | 429 +++ generated/8.3/ssdeep.php | 70 + generated/8.3/ssh2.php | 747 +++++ generated/8.3/stream.php | 764 +++++ generated/8.3/strings.php | 88 + generated/8.3/swoole.php | 148 + generated/8.3/uodbc.php | 1202 ++++++++ generated/8.3/uopz.php | 40 + generated/8.3/url.php | 204 ++ generated/8.3/var.php | 60 + generated/8.3/xdiff.php | 236 ++ generated/8.3/xml.php | 716 +++++ generated/8.3/xmlrpc.php | 22 + generated/8.3/yaml.php | 109 + generated/8.3/yaz.php | 438 +++ generated/8.3/zip.php | 144 + generated/8.3/zlib.php | 721 +++++ generated/8.4/apache.php | 139 + generated/8.4/apcu.php | 112 + generated/8.4/array.php | 30 + generated/8.4/bzip2.php | 97 + generated/8.4/calendar.php | 30 + generated/8.4/classobj.php | 26 + generated/8.4/com.php | 196 ++ generated/8.4/cubrid.php | 2038 +++++++++++++ generated/8.4/curl.php | 440 +++ generated/8.4/datetime.php | 950 +++++++ generated/8.4/dir.php | 134 + generated/8.4/eio.php | 2126 ++++++++++++++ generated/8.4/errorfunc.php | 82 + generated/8.4/exec.php | 154 + generated/8.4/fileinfo.php | 79 + generated/8.4/filesystem.php | 1567 ++++++++++ generated/8.4/filter.php | 48 + generated/8.4/fpm.php | 45 + generated/8.4/ftp.php | 577 ++++ generated/8.4/funchand.php | 49 + generated/{ => 8.4}/functionsList.php | 0 generated/8.4/gettext.php | 31 + generated/8.4/gnupg.php | 188 ++ generated/8.4/hash.php | 27 + generated/8.4/ibase.php | 661 +++++ generated/8.4/ibmDb2.php | 1240 ++++++++ generated/8.4/iconv.php | 95 + generated/8.4/image.php | 2944 +++++++++++++++++++ generated/8.4/imap.php | 2092 ++++++++++++++ generated/8.4/info.php | 384 +++ generated/8.4/inotify.php | 72 + generated/8.4/json.php | 58 + generated/8.4/ldap.php | 1213 ++++++++ generated/8.4/libxml.php | 78 + generated/8.4/lzf.php | 44 + generated/8.4/mailparse.php | 127 + generated/8.4/mbstring.php | 585 ++++ generated/8.4/misc.php | 345 +++ generated/8.4/mysql.php | 938 ++++++ generated/8.4/network.php | 577 ++++ generated/8.4/oci8.php | 1649 +++++++++++ generated/8.4/opcache.php | 43 + generated/8.4/openssl.php | 1505 ++++++++++ generated/8.4/outcontrol.php | 321 +++ generated/8.4/pcntl.php | 255 ++ generated/8.4/pcre.php | 685 +++++ generated/8.4/pgsql.php | 1398 +++++++++ generated/8.4/posix.php | 765 +++++ generated/8.4/ps.php | 1812 ++++++++++++ generated/8.4/pspell.php | 457 +++ generated/8.4/readline.php | 65 + generated/8.4/rector-migrate.php | 1090 +++++++ generated/8.4/rnp.php | 609 ++++ generated/8.4/rpminfo.php | 21 + generated/8.4/rrd.php | 190 ++ generated/8.4/sem.php | 545 ++++ generated/8.4/session.php | 369 +++ generated/8.4/shmop.php | 48 + generated/8.4/sockets.php | 871 ++++++ generated/8.4/sodium.php | 374 +++ generated/8.4/solr.php | 22 + generated/8.4/spl.php | 147 + generated/8.4/sqlsrv.php | 429 +++ generated/8.4/ssdeep.php | 70 + generated/8.4/ssh2.php | 747 +++++ generated/8.4/stream.php | 790 +++++ generated/8.4/strings.php | 88 + generated/8.4/swoole.php | 148 + generated/8.4/uodbc.php | 639 +++++ generated/8.4/uopz.php | 40 + generated/8.4/url.php | 204 ++ generated/8.4/var.php | 60 + generated/8.4/xdiff.php | 236 ++ generated/8.4/xml.php | 100 + generated/8.4/xmlrpc.php | 22 + generated/8.4/yaml.php | 109 + generated/8.4/yaz.php | 438 +++ generated/8.4/zip.php | 144 + generated/8.4/zlib.php | 680 +++++ generated/8.5/apache.php | 139 + generated/8.5/apcu.php | 112 + generated/8.5/array.php | 30 + generated/8.5/bzip2.php | 97 + generated/8.5/calendar.php | 30 + generated/8.5/classobj.php | 26 + generated/8.5/com.php | 196 ++ generated/8.5/cubrid.php | 2038 +++++++++++++ generated/8.5/curl.php | 440 +++ generated/8.5/datetime.php | 950 +++++++ generated/8.5/dir.php | 134 + generated/8.5/eio.php | 2126 ++++++++++++++ generated/8.5/errorfunc.php | 82 + generated/8.5/exec.php | 154 + generated/8.5/fileinfo.php | 79 + generated/8.5/filesystem.php | 1567 ++++++++++ generated/8.5/filter.php | 48 + generated/8.5/fpm.php | 45 + generated/8.5/ftp.php | 577 ++++ generated/8.5/funchand.php | 49 + generated/8.5/functionsList.php | 1080 +++++++ generated/8.5/gettext.php | 31 + generated/8.5/gnupg.php | 188 ++ generated/8.5/hash.php | 27 + generated/8.5/ibase.php | 661 +++++ generated/8.5/ibmDb2.php | 1240 ++++++++ generated/8.5/iconv.php | 95 + generated/8.5/image.php | 2944 +++++++++++++++++++ generated/8.5/imap.php | 2092 ++++++++++++++ generated/8.5/info.php | 384 +++ generated/8.5/inotify.php | 72 + generated/8.5/json.php | 58 + generated/8.5/ldap.php | 1213 ++++++++ generated/8.5/libxml.php | 78 + generated/8.5/lzf.php | 44 + generated/8.5/mailparse.php | 127 + generated/8.5/mbstring.php | 585 ++++ generated/8.5/misc.php | 345 +++ generated/8.5/mysql.php | 938 ++++++ generated/8.5/network.php | 577 ++++ generated/8.5/oci8.php | 1649 +++++++++++ generated/8.5/opcache.php | 43 + generated/8.5/openssl.php | 1505 ++++++++++ generated/8.5/outcontrol.php | 321 +++ generated/8.5/pcntl.php | 255 ++ generated/8.5/pcre.php | 685 +++++ generated/8.5/pgsql.php | 1398 +++++++++ generated/8.5/posix.php | 765 +++++ generated/8.5/ps.php | 1812 ++++++++++++ generated/8.5/pspell.php | 457 +++ generated/8.5/readline.php | 65 + generated/8.5/rector-migrate.php | 1090 +++++++ generated/8.5/rnp.php | 609 ++++ generated/8.5/rpminfo.php | 21 + generated/8.5/rrd.php | 190 ++ generated/8.5/sem.php | 545 ++++ generated/8.5/session.php | 369 +++ generated/8.5/shmop.php | 48 + generated/8.5/sockets.php | 871 ++++++ generated/8.5/sodium.php | 374 +++ generated/8.5/solr.php | 22 + generated/8.5/spl.php | 147 + generated/8.5/sqlsrv.php | 429 +++ generated/8.5/ssdeep.php | 70 + generated/8.5/ssh2.php | 747 +++++ generated/8.5/stream.php | 790 +++++ generated/8.5/strings.php | 88 + generated/8.5/swoole.php | 148 + generated/8.5/uodbc.php | 639 +++++ generated/8.5/uopz.php | 40 + generated/8.5/url.php | 204 ++ generated/8.5/var.php | 60 + generated/8.5/xdiff.php | 236 ++ generated/8.5/xml.php | 100 + generated/8.5/xmlrpc.php | 22 + generated/8.5/yaml.php | 109 + generated/8.5/yaz.php | 438 +++ generated/8.5/zip.php | 144 + generated/8.5/zlib.php | 680 +++++ generated/Exceptions/.gitkeep | 0 generated/Exceptions/GmpException.php | 11 + generated/Exceptions/MysqliException.php | 11 + generated/apache.php | 142 +- generated/apcu.php | 115 +- generated/array.php | 41 +- generated/bzip2.php | 102 +- generated/calendar.php | 41 +- generated/classobj.php | 37 +- generated/com.php | 199 +- generated/cubrid.php | 2041 +------------ generated/curl.php | 443 +-- generated/datetime.php | 953 +------ generated/dir.php | 137 +- generated/eio.php | 2129 +------------- generated/errorfunc.php | 93 +- generated/exec.php | 157 +- generated/fileinfo.php | 86 +- generated/filesystem.php | 1570 +--------- generated/filter.php | 57 +- generated/fpm.php | 54 +- generated/ftp.php | 580 +--- generated/funchand.php | 58 +- generated/gettext.php | 42 +- generated/gmp.php | 5 + generated/gnupg.php | 191 +- generated/hash.php | 38 +- generated/ibase.php | 664 +---- generated/ibmDb2.php | 1243 +------- generated/iconv.php | 102 +- generated/image.php | 2947 +------------------ generated/imap.php | 2095 +------------- generated/info.php | 387 +-- generated/inotify.php | 79 +- generated/json.php | 69 +- generated/ldap.php | 1216 +------- generated/libxml.php | 87 +- generated/lzf.php | 53 +- generated/mailparse.php | 130 +- generated/mbstring.php | 588 +--- generated/misc.php | 348 +-- generated/mysql.php | 941 +----- generated/mysqli.php | 5 + generated/network.php | 580 +--- generated/oci8.php | 1652 +---------- generated/opcache.php | 52 +- generated/openssl.php | 1508 +--------- generated/outcontrol.php | 324 +-- generated/pcntl.php | 258 +- generated/pcre.php | 690 +---- generated/pgsql.php | 1401 +-------- generated/posix.php | 768 +---- generated/ps.php | 1815 +----------- generated/pspell.php | 460 +-- generated/readline.php | 72 +- generated/rnp.php | 611 +--- generated/rpminfo.php | 32 +- generated/rrd.php | 193 +- generated/sem.php | 548 +--- generated/session.php | 372 +-- generated/shmop.php | 57 +- generated/sockets.php | 874 +----- generated/sodium.php | 377 +-- generated/solr.php | 33 +- generated/spl.php | 150 +- generated/sqlsrv.php | 432 +-- generated/ssdeep.php | 77 +- generated/ssh2.php | 750 +---- generated/stream.php | 793 +----- generated/strings.php | 93 +- generated/swoole.php | 151 +- generated/uodbc.php | 642 +---- generated/uopz.php | 49 +- generated/url.php | 209 +- generated/var.php | 71 +- generated/xdiff.php | 239 +- generated/xml.php | 109 +- generated/xmlrpc.php | 33 +- generated/yaml.php | 116 +- generated/yaz.php | 441 +-- generated/zip.php | 147 +- generated/zlib.php | 683 +---- 478 files changed, 214284 insertions(+), 37262 deletions(-) create mode 100644 generated/8.1/apache.php create mode 100644 generated/8.1/apcu.php create mode 100644 generated/8.1/array.php create mode 100644 generated/8.1/bzip2.php create mode 100644 generated/8.1/calendar.php create mode 100644 generated/8.1/classobj.php create mode 100644 generated/8.1/com.php create mode 100644 generated/8.1/cubrid.php create mode 100644 generated/8.1/curl.php create mode 100644 generated/8.1/datetime.php create mode 100644 generated/8.1/dir.php create mode 100644 generated/8.1/eio.php create mode 100644 generated/8.1/errorfunc.php create mode 100644 generated/8.1/exec.php create mode 100644 generated/8.1/fileinfo.php create mode 100644 generated/8.1/filesystem.php create mode 100644 generated/8.1/filter.php create mode 100644 generated/8.1/fpm.php create mode 100644 generated/8.1/ftp.php create mode 100644 generated/8.1/funchand.php create mode 100644 generated/8.1/functionsList.php create mode 100644 generated/8.1/gettext.php create mode 100644 generated/8.1/gmp.php create mode 100644 generated/8.1/gnupg.php create mode 100644 generated/8.1/hash.php create mode 100644 generated/8.1/ibase.php create mode 100644 generated/8.1/ibmDb2.php create mode 100644 generated/8.1/iconv.php create mode 100644 generated/8.1/image.php create mode 100644 generated/8.1/imap.php create mode 100644 generated/8.1/info.php create mode 100644 generated/8.1/inotify.php create mode 100644 generated/8.1/json.php create mode 100644 generated/8.1/ldap.php create mode 100644 generated/8.1/libxml.php create mode 100644 generated/8.1/lzf.php create mode 100644 generated/8.1/mailparse.php create mode 100644 generated/8.1/mbstring.php create mode 100644 generated/8.1/misc.php create mode 100644 generated/8.1/mysql.php create mode 100644 generated/8.1/mysqli.php create mode 100644 generated/8.1/network.php create mode 100644 generated/8.1/oci8.php create mode 100644 generated/8.1/opcache.php create mode 100644 generated/8.1/openssl.php create mode 100644 generated/8.1/outcontrol.php create mode 100644 generated/8.1/pcntl.php create mode 100644 generated/8.1/pcre.php create mode 100644 generated/8.1/pgsql.php create mode 100644 generated/8.1/posix.php create mode 100644 generated/8.1/ps.php create mode 100644 generated/8.1/pspell.php create mode 100644 generated/8.1/readline.php create mode 100644 generated/8.1/rector-migrate.php create mode 100644 generated/8.1/rpminfo.php create mode 100644 generated/8.1/rrd.php create mode 100644 generated/8.1/sem.php create mode 100644 generated/8.1/session.php create mode 100644 generated/8.1/shmop.php create mode 100644 generated/8.1/sockets.php create mode 100644 generated/8.1/sodium.php create mode 100644 generated/8.1/solr.php create mode 100644 generated/8.1/spl.php create mode 100644 generated/8.1/sqlsrv.php create mode 100644 generated/8.1/ssdeep.php create mode 100644 generated/8.1/ssh2.php create mode 100644 generated/8.1/stream.php create mode 100644 generated/8.1/strings.php create mode 100644 generated/8.1/swoole.php create mode 100644 generated/8.1/uodbc.php create mode 100644 generated/8.1/uopz.php create mode 100644 generated/8.1/url.php create mode 100644 generated/8.1/var.php create mode 100644 generated/8.1/xdiff.php create mode 100644 generated/8.1/xml.php create mode 100644 generated/8.1/xmlrpc.php create mode 100644 generated/8.1/yaml.php create mode 100644 generated/8.1/yaz.php create mode 100644 generated/8.1/zip.php create mode 100644 generated/8.1/zlib.php create mode 100644 generated/8.2/apache.php create mode 100644 generated/8.2/apcu.php create mode 100644 generated/8.2/array.php create mode 100644 generated/8.2/bzip2.php create mode 100644 generated/8.2/calendar.php create mode 100644 generated/8.2/classobj.php create mode 100644 generated/8.2/com.php create mode 100644 generated/8.2/cubrid.php create mode 100644 generated/8.2/curl.php create mode 100644 generated/8.2/datetime.php create mode 100644 generated/8.2/dir.php create mode 100644 generated/8.2/eio.php create mode 100644 generated/8.2/errorfunc.php create mode 100644 generated/8.2/exec.php create mode 100644 generated/8.2/fileinfo.php create mode 100644 generated/8.2/filesystem.php create mode 100644 generated/8.2/filter.php create mode 100644 generated/8.2/fpm.php create mode 100644 generated/8.2/ftp.php create mode 100644 generated/8.2/funchand.php create mode 100644 generated/8.2/functionsList.php create mode 100644 generated/8.2/gettext.php create mode 100644 generated/8.2/gnupg.php create mode 100644 generated/8.2/hash.php create mode 100644 generated/8.2/ibase.php create mode 100644 generated/8.2/ibmDb2.php create mode 100644 generated/8.2/iconv.php create mode 100644 generated/8.2/image.php create mode 100644 generated/8.2/imap.php create mode 100644 generated/8.2/info.php create mode 100644 generated/8.2/inotify.php create mode 100644 generated/8.2/json.php create mode 100644 generated/8.2/ldap.php create mode 100644 generated/8.2/libxml.php create mode 100644 generated/8.2/lzf.php create mode 100644 generated/8.2/mailparse.php create mode 100644 generated/8.2/mbstring.php create mode 100644 generated/8.2/misc.php create mode 100644 generated/8.2/mysql.php create mode 100644 generated/8.2/network.php create mode 100644 generated/8.2/oci8.php create mode 100644 generated/8.2/opcache.php create mode 100644 generated/8.2/openssl.php create mode 100644 generated/8.2/outcontrol.php create mode 100644 generated/8.2/pcntl.php create mode 100644 generated/8.2/pcre.php create mode 100644 generated/8.2/pgsql.php create mode 100644 generated/8.2/posix.php create mode 100644 generated/8.2/ps.php create mode 100644 generated/8.2/pspell.php create mode 100644 generated/8.2/readline.php create mode 100644 generated/8.2/rector-migrate.php create mode 100644 generated/8.2/rnp.php create mode 100644 generated/8.2/rpminfo.php create mode 100644 generated/8.2/rrd.php create mode 100644 generated/8.2/sem.php create mode 100644 generated/8.2/session.php create mode 100644 generated/8.2/shmop.php create mode 100644 generated/8.2/sockets.php create mode 100644 generated/8.2/sodium.php create mode 100644 generated/8.2/solr.php create mode 100644 generated/8.2/spl.php create mode 100644 generated/8.2/sqlsrv.php create mode 100644 generated/8.2/ssdeep.php create mode 100644 generated/8.2/ssh2.php create mode 100644 generated/8.2/stream.php create mode 100644 generated/8.2/strings.php create mode 100644 generated/8.2/swoole.php create mode 100644 generated/8.2/uodbc.php create mode 100644 generated/8.2/uopz.php create mode 100644 generated/8.2/url.php create mode 100644 generated/8.2/var.php create mode 100644 generated/8.2/xdiff.php create mode 100644 generated/8.2/xml.php create mode 100644 generated/8.2/xmlrpc.php create mode 100644 generated/8.2/yaml.php create mode 100644 generated/8.2/yaz.php create mode 100644 generated/8.2/zip.php create mode 100644 generated/8.2/zlib.php create mode 100644 generated/8.3/apache.php create mode 100644 generated/8.3/apcu.php create mode 100644 generated/8.3/array.php create mode 100644 generated/8.3/bzip2.php create mode 100644 generated/8.3/calendar.php create mode 100644 generated/8.3/classobj.php create mode 100644 generated/8.3/com.php create mode 100644 generated/8.3/cubrid.php create mode 100644 generated/8.3/curl.php create mode 100644 generated/8.3/datetime.php create mode 100644 generated/8.3/dir.php create mode 100644 generated/8.3/eio.php create mode 100644 generated/8.3/errorfunc.php create mode 100644 generated/8.3/exec.php create mode 100644 generated/8.3/fileinfo.php create mode 100644 generated/8.3/filesystem.php create mode 100644 generated/8.3/filter.php create mode 100644 generated/8.3/fpm.php create mode 100644 generated/8.3/ftp.php create mode 100644 generated/8.3/funchand.php create mode 100644 generated/8.3/functionsList.php create mode 100644 generated/8.3/gettext.php create mode 100644 generated/8.3/gnupg.php create mode 100644 generated/8.3/hash.php create mode 100644 generated/8.3/ibase.php create mode 100644 generated/8.3/ibmDb2.php create mode 100644 generated/8.3/iconv.php create mode 100644 generated/8.3/image.php create mode 100644 generated/8.3/imap.php create mode 100644 generated/8.3/info.php create mode 100644 generated/8.3/inotify.php create mode 100644 generated/8.3/json.php create mode 100644 generated/8.3/ldap.php create mode 100644 generated/8.3/libxml.php create mode 100644 generated/8.3/lzf.php create mode 100644 generated/8.3/mailparse.php create mode 100644 generated/8.3/mbstring.php create mode 100644 generated/8.3/misc.php create mode 100644 generated/8.3/mysql.php create mode 100644 generated/8.3/network.php create mode 100644 generated/8.3/oci8.php create mode 100644 generated/8.3/opcache.php create mode 100644 generated/8.3/openssl.php create mode 100644 generated/8.3/outcontrol.php create mode 100644 generated/8.3/pcntl.php create mode 100644 generated/8.3/pcre.php create mode 100644 generated/8.3/pgsql.php create mode 100644 generated/8.3/posix.php create mode 100644 generated/8.3/ps.php create mode 100644 generated/8.3/pspell.php create mode 100644 generated/8.3/readline.php create mode 100644 generated/8.3/rector-migrate.php create mode 100644 generated/8.3/rnp.php create mode 100644 generated/8.3/rpminfo.php create mode 100644 generated/8.3/rrd.php create mode 100644 generated/8.3/sem.php create mode 100644 generated/8.3/session.php create mode 100644 generated/8.3/shmop.php create mode 100644 generated/8.3/sockets.php create mode 100644 generated/8.3/sodium.php create mode 100644 generated/8.3/solr.php create mode 100644 generated/8.3/spl.php create mode 100644 generated/8.3/sqlsrv.php create mode 100644 generated/8.3/ssdeep.php create mode 100644 generated/8.3/ssh2.php create mode 100644 generated/8.3/stream.php create mode 100644 generated/8.3/strings.php create mode 100644 generated/8.3/swoole.php create mode 100644 generated/8.3/uodbc.php create mode 100644 generated/8.3/uopz.php create mode 100644 generated/8.3/url.php create mode 100644 generated/8.3/var.php create mode 100644 generated/8.3/xdiff.php create mode 100644 generated/8.3/xml.php create mode 100644 generated/8.3/xmlrpc.php create mode 100644 generated/8.3/yaml.php create mode 100644 generated/8.3/yaz.php create mode 100644 generated/8.3/zip.php create mode 100644 generated/8.3/zlib.php create mode 100644 generated/8.4/apache.php create mode 100644 generated/8.4/apcu.php create mode 100644 generated/8.4/array.php create mode 100644 generated/8.4/bzip2.php create mode 100644 generated/8.4/calendar.php create mode 100644 generated/8.4/classobj.php create mode 100644 generated/8.4/com.php create mode 100644 generated/8.4/cubrid.php create mode 100644 generated/8.4/curl.php create mode 100644 generated/8.4/datetime.php create mode 100644 generated/8.4/dir.php create mode 100644 generated/8.4/eio.php create mode 100644 generated/8.4/errorfunc.php create mode 100644 generated/8.4/exec.php create mode 100644 generated/8.4/fileinfo.php create mode 100644 generated/8.4/filesystem.php create mode 100644 generated/8.4/filter.php create mode 100644 generated/8.4/fpm.php create mode 100644 generated/8.4/ftp.php create mode 100644 generated/8.4/funchand.php rename generated/{ => 8.4}/functionsList.php (100%) create mode 100644 generated/8.4/gettext.php create mode 100644 generated/8.4/gnupg.php create mode 100644 generated/8.4/hash.php create mode 100644 generated/8.4/ibase.php create mode 100644 generated/8.4/ibmDb2.php create mode 100644 generated/8.4/iconv.php create mode 100644 generated/8.4/image.php create mode 100644 generated/8.4/imap.php create mode 100644 generated/8.4/info.php create mode 100644 generated/8.4/inotify.php create mode 100644 generated/8.4/json.php create mode 100644 generated/8.4/ldap.php create mode 100644 generated/8.4/libxml.php create mode 100644 generated/8.4/lzf.php create mode 100644 generated/8.4/mailparse.php create mode 100644 generated/8.4/mbstring.php create mode 100644 generated/8.4/misc.php create mode 100644 generated/8.4/mysql.php create mode 100644 generated/8.4/network.php create mode 100644 generated/8.4/oci8.php create mode 100644 generated/8.4/opcache.php create mode 100644 generated/8.4/openssl.php create mode 100644 generated/8.4/outcontrol.php create mode 100644 generated/8.4/pcntl.php create mode 100644 generated/8.4/pcre.php create mode 100644 generated/8.4/pgsql.php create mode 100644 generated/8.4/posix.php create mode 100644 generated/8.4/ps.php create mode 100644 generated/8.4/pspell.php create mode 100644 generated/8.4/readline.php create mode 100644 generated/8.4/rector-migrate.php create mode 100644 generated/8.4/rnp.php create mode 100644 generated/8.4/rpminfo.php create mode 100644 generated/8.4/rrd.php create mode 100644 generated/8.4/sem.php create mode 100644 generated/8.4/session.php create mode 100644 generated/8.4/shmop.php create mode 100644 generated/8.4/sockets.php create mode 100644 generated/8.4/sodium.php create mode 100644 generated/8.4/solr.php create mode 100644 generated/8.4/spl.php create mode 100644 generated/8.4/sqlsrv.php create mode 100644 generated/8.4/ssdeep.php create mode 100644 generated/8.4/ssh2.php create mode 100644 generated/8.4/stream.php create mode 100644 generated/8.4/strings.php create mode 100644 generated/8.4/swoole.php create mode 100644 generated/8.4/uodbc.php create mode 100644 generated/8.4/uopz.php create mode 100644 generated/8.4/url.php create mode 100644 generated/8.4/var.php create mode 100644 generated/8.4/xdiff.php create mode 100644 generated/8.4/xml.php create mode 100644 generated/8.4/xmlrpc.php create mode 100644 generated/8.4/yaml.php create mode 100644 generated/8.4/yaz.php create mode 100644 generated/8.4/zip.php create mode 100644 generated/8.4/zlib.php create mode 100644 generated/8.5/apache.php create mode 100644 generated/8.5/apcu.php create mode 100644 generated/8.5/array.php create mode 100644 generated/8.5/bzip2.php create mode 100644 generated/8.5/calendar.php create mode 100644 generated/8.5/classobj.php create mode 100644 generated/8.5/com.php create mode 100644 generated/8.5/cubrid.php create mode 100644 generated/8.5/curl.php create mode 100644 generated/8.5/datetime.php create mode 100644 generated/8.5/dir.php create mode 100644 generated/8.5/eio.php create mode 100644 generated/8.5/errorfunc.php create mode 100644 generated/8.5/exec.php create mode 100644 generated/8.5/fileinfo.php create mode 100644 generated/8.5/filesystem.php create mode 100644 generated/8.5/filter.php create mode 100644 generated/8.5/fpm.php create mode 100644 generated/8.5/ftp.php create mode 100644 generated/8.5/funchand.php create mode 100644 generated/8.5/functionsList.php create mode 100644 generated/8.5/gettext.php create mode 100644 generated/8.5/gnupg.php create mode 100644 generated/8.5/hash.php create mode 100644 generated/8.5/ibase.php create mode 100644 generated/8.5/ibmDb2.php create mode 100644 generated/8.5/iconv.php create mode 100644 generated/8.5/image.php create mode 100644 generated/8.5/imap.php create mode 100644 generated/8.5/info.php create mode 100644 generated/8.5/inotify.php create mode 100644 generated/8.5/json.php create mode 100644 generated/8.5/ldap.php create mode 100644 generated/8.5/libxml.php create mode 100644 generated/8.5/lzf.php create mode 100644 generated/8.5/mailparse.php create mode 100644 generated/8.5/mbstring.php create mode 100644 generated/8.5/misc.php create mode 100644 generated/8.5/mysql.php create mode 100644 generated/8.5/network.php create mode 100644 generated/8.5/oci8.php create mode 100644 generated/8.5/opcache.php create mode 100644 generated/8.5/openssl.php create mode 100644 generated/8.5/outcontrol.php create mode 100644 generated/8.5/pcntl.php create mode 100644 generated/8.5/pcre.php create mode 100644 generated/8.5/pgsql.php create mode 100644 generated/8.5/posix.php create mode 100644 generated/8.5/ps.php create mode 100644 generated/8.5/pspell.php create mode 100644 generated/8.5/readline.php create mode 100644 generated/8.5/rector-migrate.php create mode 100644 generated/8.5/rnp.php create mode 100644 generated/8.5/rpminfo.php create mode 100644 generated/8.5/rrd.php create mode 100644 generated/8.5/sem.php create mode 100644 generated/8.5/session.php create mode 100644 generated/8.5/shmop.php create mode 100644 generated/8.5/sockets.php create mode 100644 generated/8.5/sodium.php create mode 100644 generated/8.5/solr.php create mode 100644 generated/8.5/spl.php create mode 100644 generated/8.5/sqlsrv.php create mode 100644 generated/8.5/ssdeep.php create mode 100644 generated/8.5/ssh2.php create mode 100644 generated/8.5/stream.php create mode 100644 generated/8.5/strings.php create mode 100644 generated/8.5/swoole.php create mode 100644 generated/8.5/uodbc.php create mode 100644 generated/8.5/uopz.php create mode 100644 generated/8.5/url.php create mode 100644 generated/8.5/var.php create mode 100644 generated/8.5/xdiff.php create mode 100644 generated/8.5/xml.php create mode 100644 generated/8.5/xmlrpc.php create mode 100644 generated/8.5/yaml.php create mode 100644 generated/8.5/yaz.php create mode 100644 generated/8.5/zip.php create mode 100644 generated/8.5/zlib.php delete mode 100644 generated/Exceptions/.gitkeep create mode 100644 generated/Exceptions/GmpException.php create mode 100644 generated/Exceptions/MysqliException.php create mode 100644 generated/gmp.php create mode 100644 generated/mysqli.php diff --git a/generated/8.1/apache.php b/generated/8.1/apache.php new file mode 100644 index 00000000..e6fd372c --- /dev/null +++ b/generated/8.1/apache.php @@ -0,0 +1,199 @@ + + * + * + * + * The permissions 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 $permissions): void +{ + error_clear_last(); + $safeResult = \chmod($filename, $permissions); + if ($safeResult === false) { + throw 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 FilesystemException + * + */ +function chown(string $filename, $user): void +{ + error_clear_last(); + $safeResult = \chown($filename, $user); + if ($safeResult === false) { + throw 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 FilesystemException + * + */ +function copy(string $source, string $dest, $context = null): void +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \copy($source, $dest, $context); + } else { + $safeResult = \copy($source, $dest); + } + if ($safeResult === false) { + throw 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 FilesystemException + * + */ +function disk_free_space(string $directory): float +{ + error_clear_last(); + $safeResult = \disk_free_space($directory); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function disk_total_space(string $directory): float +{ + error_clear_last(); + $safeResult = \disk_total_space($directory); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * The file pointed to by stream is closed. + * + * @param resource $stream The file pointer must be valid, and must point to a file successfully + * opened by fopen or fsockopen. + * @throws FilesystemException + * + */ +function fclose($stream): void +{ + error_clear_last(); + $safeResult = \fclose($stream); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * This function synchronizes stream contents to storage media, just like fsync does, + * but it does not synchronize file meta-data. + * Note that this function is only effectively different in POSIX systems. + * In Windows, this function is aliased to fsync. + * + * @param resource $stream 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 FilesystemException + * + */ +function fdatasync($stream): void +{ + error_clear_last(); + $safeResult = \fdatasync($stream); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * This function forces a write of all buffered output to the resource + * pointed to by the file stream. + * + * @param resource $stream 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 FilesystemException + * + */ +function fflush($stream): void +{ + error_clear_last(); + $safeResult = \fflush($stream); + if ($safeResult === false) { + throw 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 length 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 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 $length 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 FilesystemException + * + */ +function file_get_contents(string $filename, bool $use_include_path = false, $context = null, int $offset = 0, ?int $length = null): string +{ + error_clear_last(); + if ($length !== null) { + $safeResult = \file_get_contents($filename, $use_include_path, $context, $offset, $length); + } elseif ($offset !== 0) { + $safeResult = \file_get_contents($filename, $use_include_path, $context, $offset); + } elseif ($context !== null) { + $safeResult = \file_get_contents($filename, $use_include_path, $context); + } else { + $safeResult = \file_get_contents($filename, $use_include_path); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * This function is identical to calling fopen, + * fwrite and fclose successively + * to write data to a file. + * + * If filename does not exist, the file is created. + * Otherwise, the existing file is overwritten, unless the + * FILE_APPEND flag is set. + * + * @param string $filename Path to the file where to write the data. + * @param mixed $data The data to write. Can be either a string, an + * array or a stream resource. + * + * If data is a stream resource, the + * remaining buffer of that stream will be copied to the specified file. + * This is similar with using stream_copy_to_stream. + * + * You can also specify the data parameter as a single + * dimension array. This is equivalent to + * file_put_contents($filename, implode('', $array)). + * @param int $flags The value of flags can be any combination of + * the following flags, joined with the binary OR (|) + * operator. + * + * + * Available flags + * + * + * + * Flag + * Description + * + * + * + * + * + * FILE_USE_INCLUDE_PATH + * + * + * Search for filename in the include directory. + * See include_path for more + * information. + * + * + * + * + * FILE_APPEND + * + * + * If file filename already exists, append + * the data to the file instead of overwriting it. + * + * + * + * + * LOCK_EX + * + * + * Acquire an exclusive lock on the file while proceeding to the + * writing. In other words, a flock call happens + * between the fopen call and the + * fwrite call. This is not identical to an + * fopen call with mode "x". + * + * + * + * + * + * @param resource|null $context A valid context resource created with + * stream_context_create. + * @return int This function returns the number of bytes that were written to the file. + * @throws FilesystemException + * + */ +function file_put_contents(string $filename, $data, int $flags = 0, $context = null): int +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \file_put_contents($filename, $data, $flags, $context); + } else { + $safeResult = \file_put_contents($filename, $data, $flags); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Reads an entire file into an array. + * + * @param string $filename Path to the file. + * @param int $flags The optional parameter flags can be one, or + * more, of the following constants: + * + * + * + * FILE_USE_INCLUDE_PATH + * + * + * + * Search for the file in the include_path. + * + * + * + * + * + * FILE_IGNORE_NEW_LINES + * + * + * + * Omit newline at the end of each array element + * + * + * + * + * + * FILE_SKIP_EMPTY_LINES + * + * + * + * Skip empty lines + * + * + * + * + * @param resource $context + * @return array Returns the file in an array. Each element of the array corresponds to a + * line in the file, with the newline still attached. Upon failure, + * file returns FALSE. + * @throws FilesystemException + * + */ +function file(string $filename, int $flags = 0, $context = null): array +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \file($filename, $flags, $context); + } else { + $safeResult = \file($filename, $flags); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * + * + * @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 FilesystemException + * + */ +function fileatime(string $filename): int +{ + error_clear_last(); + $safeResult = \fileatime($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function filectime(string $filename): int +{ + error_clear_last(); + $safeResult = \filectime($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Gets the file inode. + * + * @param string $filename Path to the file. + * @return int Returns the inode number of the file. + * @throws FilesystemException + * + */ +function fileinode(string $filename): int +{ + error_clear_last(); + $safeResult = \fileinode($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function filemtime(string $filename): int +{ + error_clear_last(); + $safeResult = \filemtime($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function fileowner(string $filename): int +{ + error_clear_last(); + $safeResult = \fileowner($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Gets permissions for the given file. + * + * @param string $filename Path to the file. + * @return int Returns the file's permissions as a numeric mode. Lower bits of this mode + * are the same as the permissions expected by chmod, + * however on most platforms the return value will also include information on + * the type of file given as filename. The examples + * below demonstrate how to test the return value for specific permissions and + * file types on POSIX systems, including Linux and macOS. + * + * For local files, the specific return value is that of the + * st_mode member of the structure returned by the C + * library's stat function. Exactly which bits are set + * can vary from platform to platform, and looking up your specific platform's + * documentation is recommended if parsing the non-permission bits of the + * return value is required. + * + * Returns FALSE on failure. + * @throws FilesystemException + * + */ +function fileperms(string $filename): int +{ + error_clear_last(); + $safeResult = \fileperms($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Gets the size for the given file. + * + * @param string $filename Path to the file. + * @return int Returns the size of the file in bytes, or FALSE (and generates an error + * of level E_WARNING) in case of an error. + * @throws FilesystemException + * + */ +function filesize(string $filename): int +{ + error_clear_last(); + $safeResult = \filesize($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * flock allows you to perform a simple reader/writer + * model which can be used on virtually every platform (including most Unix + * derivatives and even Windows). + * + * The lock is released also by fclose, + * or when stream is garbage collected. + * + * PHP supports a portable way of locking complete files in an advisory way + * (which means all accessing programs have to use the same way of locking + * or it will not work). By default, this function will block until the + * requested lock is acquired; this may be controlled with the LOCK_NB option documented below. + * + * @param resource $stream A file system pointer resource + * that is typically created using fopen. + * @param int $operation operation is one of the following: + * + * + * + * LOCK_SH to acquire a shared lock (reader). + * + * + * + * + * LOCK_EX to acquire an exclusive lock (writer). + * + * + * + * + * LOCK_UN to release a lock (shared or exclusive). + * + * + * + * + * It is also possible to add LOCK_NB as a bitmask to one + * of the above operations, if flock should not + * block during the locking attempt. + * @param int|null $would_block The optional third argument is set to 1 if the lock would block + * (EWOULDBLOCK errno condition). + * @throws FilesystemException + * + */ +function flock($stream, int $operation, ?int &$would_block = null): void +{ + error_clear_last(); + $safeResult = \flock($stream, $operation, $would_block); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * 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 + * 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; otherwise it has the + * same behavior as 'w'. + * + * + * + * '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 (Mac OS Classic) used + * \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 is 'b'. + * You can 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 old versions of notepad. You + * should use the 'b' in all other cases. + * + * If you specify the 't' 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 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|null $context A context stream + * resource. + * @return resource Returns a file pointer resource on success + * @throws FilesystemException + * + */ +function fopen(string $filename, string $mode, bool $use_include_path = false, $context = null) +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \fopen($filename, $mode, $use_include_path, $context); + } else { + $safeResult = \fopen($filename, $mode, $use_include_path); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * fread reads up to + * length bytes from the file pointer + * referenced by stream. 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 $stream 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 FilesystemException + * + */ +function fread($stream, int $length): string +{ + error_clear_last(); + $safeResult = \fread($stream, $length); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Gathers the statistics of the file opened by the file + * pointer stream. This function is similar to the + * stat function except that it operates + * on an open file pointer instead of a filename. + * + * @param resource $stream A file system pointer resource + * that is typically created using fopen. + * @return array Returns an array with the statistics of the file; the format of the array + * is described in detail on the stat manual page. + * Returns FALSE on failure. + * @throws FilesystemException + * + */ +function fstat($stream): array +{ + error_clear_last(); + $safeResult = \fstat($stream); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * This function synchronizes changes to the file, including its meta-data. This is similar to fflush, + * but it also instructs the operating system to write to the storage media. + * + * @param resource $stream 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 FilesystemException + * + */ +function fsync($stream): void +{ + error_clear_last(); + $safeResult = \fsync($stream); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * Takes the filepointer, stream, and truncates the file to + * length, size. + * + * @param resource $stream The file pointer. + * + * The stream 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 FilesystemException + * + */ +function ftruncate($stream, int $size): void +{ + error_clear_last(); + $safeResult = \ftruncate($stream, $size); + if ($safeResult === false) { + throw 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. + * @return int + * @throws FilesystemException + * + */ +function fwrite($handle, string $string, ?int $length = null): int +{ + error_clear_last(); + if ($length !== null) { + $safeResult = \fwrite($handle, $string, $length); + } else { + $safeResult = \fwrite($handle, $string); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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. + * + * Special characters: + * + * + * + * * - Matches zero or more characters. + * + * + * + * + * ? - Matches exactly one character (any character). + * + * + * + * + * [...] - Matches one character from a group of + * characters. If the first character is !, + * matches any character not in the group. + * + * + * + * + * \ - Escapes the following character, + * except when the GLOB_NOESCAPE flag is used. + * + * + * + * @param int $flags Valid flags: + * + * + * + * GLOB_MARK - Adds a slash (a backslash on Windows) to each directory returned + * + * + * + * + * GLOB_NOSORT - Return files as they appear in the + * directory (no sorting). When this flag is not used, the pathnames are + * sorted alphabetically + * + * + * + * + * GLOB_NOCHECK - Return the search pattern if no + * files matching it were found + * + * + * + * + * GLOB_NOESCAPE - Backslashes do not quote + * metacharacters + * + * + * + * + * GLOB_BRACE - Expands {a,b,c} to match 'a', 'b', + * or 'c' + * + * + * + * + * GLOB_ONLYDIR - Return only directory entries + * which match the pattern + * + * + * + * + * GLOB_ERR - Stop on read errors (like unreadable + * directories), by default errors are ignored. + * + * + * + * + * + * The GLOB_BRACE flag is not available on some non GNU + * systems, like Solaris or Alpine Linux. + * + * + * @return array Returns an array containing the matched files/directories, an empty array + * if no file matched. + * @throws FilesystemException + * + */ +function glob(string $pattern, int $flags = 0): array +{ + error_clear_last(); + $safeResult = \glob($pattern, $flags); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function lchgrp(string $filename, $group): void +{ + error_clear_last(); + $safeResult = \lchgrp($filename, $group); + if ($safeResult === false) { + throw 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 FilesystemException + * + */ +function lchown(string $filename, $user): void +{ + error_clear_last(); + $safeResult = \lchown($filename, $user); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * link creates a hard link. + * + * @param string $target Target of the link. + * @param string $link The link name. + * @throws FilesystemException + * + */ +function link(string $target, string $link): void +{ + error_clear_last(); + $safeResult = \link($target, $link); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * Gathers the statistics of the file or symbolic link named by + * filename. + * + * @param string $filename Path to a file or a symbolic link. + * @return array See the manual page for stat for information on + * the structure of the array that lstat returns. + * This function is identical to the stat function + * except that if the filename parameter is a symbolic + * link, the status of the symbolic link is returned, not the status of the + * file pointed to by the symbolic link. + * + * On failure, FALSE is returned. + * @throws FilesystemException + * + */ +function lstat(string $filename): array +{ + error_clear_last(); + $safeResult = \lstat($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Attempts to create the directory specified by directory. + * + * @param string $directory The directory path. + * @param int $permissions The permissions are 0777 by default, which means the widest possible + * access. For more information on permissions, read the details + * on the chmod page. + * + * permissions is ignored on Windows. + * + * Note that you probably want to specify the permissions as an octal number, + * which means it should have a leading zero. The permissions 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 + * directory. + * @param resource $context A context stream + * resource. + * @throws FilesystemException + * + */ +function mkdir(string $directory, int $permissions = 0777, bool $recursive = false, $context = null): void +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \mkdir($directory, $permissions, $recursive, $context); + } else { + $safeResult = \mkdir($directory, $permissions, $recursive); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * parse_ini_file loads in the + * ini file specified in filename, + * and returns the settings in it in an associative array. + * + * The structure of the ini file is the same as the php.ini's. + * + * @param string $filename The filename of the ini file being parsed. If a relative path is used, + * it is evaluated relative to the current working directory, then the + * include_path. + * @param bool $process_sections By setting the process_sections + * parameter to TRUE, you get a multidimensional array, with + * the section names and settings included. The default + * for process_sections is FALSE + * @param int $scanner_mode Can either be INI_SCANNER_NORMAL (default) or + * INI_SCANNER_RAW. If INI_SCANNER_RAW + * is supplied, then option values will not be parsed. + * + * + * As of PHP 5.6.1 can also be specified as INI_SCANNER_TYPED. + * In this mode boolean, null and integer types are preserved when possible. + * String values "true", "on" and "yes" + * are converted to TRUE. "false", "off", "no" + * and "none" are considered FALSE. "null" is converted to NULL + * in typed mode. Also, all numeric strings are converted to integer type if it is possible. + * @return array The settings are returned as an associative array on success. + * @throws FilesystemException + * + */ +function parse_ini_file(string $filename, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array +{ + error_clear_last(); + $safeResult = \parse_ini_file($filename, $process_sections, $scanner_mode); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * parse_ini_string returns the settings in string + * ini_string in an associative array. + * + * The structure of the ini string is the same as the php.ini's. + * + * @param string $ini_string The contents of the ini file being parsed. + * @param bool $process_sections By setting the process_sections + * parameter to TRUE, you get a multidimensional array, with + * the section names and settings included. The default + * for process_sections is FALSE + * @param int $scanner_mode Can either be INI_SCANNER_NORMAL (default) or + * INI_SCANNER_RAW. If INI_SCANNER_RAW + * is supplied, then option values will not be parsed. + * + * + * As of PHP 5.6.1 can also be specified as INI_SCANNER_TYPED. + * In this mode boolean, null and integer types are preserved when possible. + * String values "true", "on" and "yes" + * are converted to TRUE. "false", "off", "no" + * and "none" are considered FALSE. "null" is converted to NULL + * in typed mode. Also, all numeric strings are converted to integer type if it is possible. + * @return array The settings are returned as an associative array on success. + * @throws FilesystemException + * + */ +function parse_ini_string(string $ini_string, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array +{ + error_clear_last(); + $safeResult = \parse_ini_string($ini_string, $process_sections, $scanner_mode); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Reads a file and writes it to the output buffer. + * + * @param string $filename The filename being read. + * @param bool $use_include_path You can use the optional second parameter and set it to TRUE, if + * you want to search for the file in the include_path, too. + * @param resource $context A context stream + * resource. + * @return int Returns the number of bytes read from the file on success + * @throws FilesystemException + * + */ +function readfile(string $filename, bool $use_include_path = false, $context = null): int +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \readfile($filename, $use_include_path, $context); + } else { + $safeResult = \readfile($filename, $use_include_path); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function readlink(string $path): string +{ + error_clear_last(); + $safeResult = \readlink($path); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * realpath expands all symbolic links and + * resolves references to /./, /../ and extra / characters in + * the input path and returns the canonicalized + * absolute pathname. + * + * @param string $path The path being checked. + * + * + * Whilst a path must be supplied, the value can be an empty string. + * In this case, the value is interpreted as the current directory. + * + * + * + * Whilst a path must be supplied, the value can be an empty string. + * In this case, the value is interpreted as the current directory. + * @return string Returns the canonicalized absolute pathname on success. The resulting path + * will have no symbolic link, /./ or /../ components. Trailing delimiters, + * such as \ and /, are also removed. + * + * realpath returns FALSE on failure, e.g. if + * the file does not exist. + * @throws FilesystemException + * + */ +function realpath(string $path): string +{ + error_clear_last(); + $safeResult = \realpath($path); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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. + * + * + * On Windows, if newname already exists, it must be writable. + * Otherwise rename fails and issues E_WARNING. + * + * + * @param resource $context A context stream + * resource. + * @throws FilesystemException + * + */ +function rename(string $oldname, string $newname, $context = null): void +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \rename($oldname, $newname, $context); + } else { + $safeResult = \rename($oldname, $newname); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * Sets the file position indicator for stream + * to the beginning of the file stream. + * + * @param resource $stream The file pointer must be valid, and must point to a file + * successfully opened by fopen. + * @throws FilesystemException + * + */ +function rewind($stream): void +{ + error_clear_last(); + $safeResult = \rewind($stream); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * Attempts to remove the directory named by directory. + * The directory must be empty, and the relevant permissions must permit this. + * A E_WARNING level error will be generated on failure. + * + * @param string $directory Path to the directory. + * @param resource $context A context stream + * resource. + * @throws FilesystemException + * + */ +function rmdir(string $directory, $context = null): void +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \rmdir($directory, $context); + } else { + $safeResult = \rmdir($directory); + } + if ($safeResult === false) { + throw 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 FilesystemException + * + */ +function symlink(string $target, string $link): void +{ + error_clear_last(); + $safeResult = \symlink($target, $link); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * Creates a file with a unique filename, with access permission set to 0600, in the specified directory. + * If the directory does not exist or is not writable, tempnam may + * generate a file in the system's temporary directory, and return + * the full path to that file, including its name. + * + * @param string $directory The directory where the temporary filename will be created. + * @param string $prefix The prefix of the generated temporary filename. + * @return string Returns the new temporary filename (with path). + * @throws FilesystemException + * + */ +function tempnam(string $directory, string $prefix): string +{ + error_clear_last(); + $safeResult = \tempnam($directory, $prefix); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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. + * + * @return resource|false Returns a file handle, similar to the one returned by + * fopen, for the new file. + * @throws FilesystemException + * + */ +function tmpfile() +{ + error_clear_last(); + $safeResult = \tmpfile(); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function touch(string $filename, ?int $time = null, ?int $atime = null): void +{ + error_clear_last(); + if ($atime !== null) { + $safeResult = \touch($filename, $time, $atime); + } elseif ($time !== null) { + $safeResult = \touch($filename, $time); + } else { + $safeResult = \touch($filename); + } + if ($safeResult === false) { + throw 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. + * + * If the file is a symlink, the symlink will be deleted. On Windows, to delete + * a symlink to a directory, rmdir has to be used instead. + * @param resource $context A context stream + * resource. + * @throws FilesystemException + * + */ +function unlink(string $filename, $context = null): void +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \unlink($filename, $context); + } else { + $safeResult = \unlink($filename); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} diff --git a/generated/8.1/filter.php b/generated/8.1/filter.php new file mode 100644 index 00000000..0508f8e7 --- /dev/null +++ b/generated/8.1/filter.php @@ -0,0 +1,81 @@ + + * + * + * + * channels will be 3 for RGB pictures and 4 for CMYK + * pictures. + * + * bits is the number of bits for each color. + * + * For some image types, the presence of channels and + * bits values can be a bit + * confusing. As an example, GIF always uses 3 channels + * per pixel, but the number of bits per pixel cannot be calculated for an + * animated GIF with a global color table. + * + * On failure, FALSE is returned. + * @throws ImageException + * + */ +function getimagesize(string $filename, ?array &$image_info = null): ?array +{ + error_clear_last(); + $safeResult = \getimagesize($filename, $image_info); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Returns the extension for the given IMAGETYPE_XXX + * constant. + * + * @param int $image_type One of the IMAGETYPE_XXX constant. + * @param bool $include_dot Whether to prepend a dot to the extension or not. Default to TRUE. + * @return string A string with the extension corresponding to the given image type. + * @throws ImageException + * + */ +function image_type_to_extension(int $image_type, bool $include_dot = true): string +{ + error_clear_last(); + $safeResult = \image_type_to_extension($image_type, $include_dot); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * image2wbmp 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 string|null $filename Path to the saved file. If not given, the raw image stream will be + * output 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 ImageException + * + */ +function image2wbmp($image, ?string $filename = null, ?int $foreground = null): void +{ + error_clear_last(); + if ($foreground !== null) { + $safeResult = \image2wbmp($image, $filename, $foreground); + } elseif ($filename !== null) { + $safeResult = \image2wbmp($image, $filename); + } else { + $safeResult = \image2wbmp($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param array $affine Array with keys 0 to 5. + * @param array $clip Array with keys "x", "y", "width" and "height"; or NULL. + * @return resource Return affined image object on success. + * @throws ImageException + * + */ +function imageaffine($image, array $affine, ?array $clip = null) +{ + error_clear_last(); + if ($clip !== null) { + $safeResult = \imageaffine($image, $affine, $clip); + } else { + $safeResult = \imageaffine($image, $affine); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Returns the concatenation of two affine transformation matrices, + * what is useful if multiple transformations should be applied to the same + * image in one go. + * + * @param array $matrix1 An affine transformation matrix (an array with keys + * 0 to 5 and float values). + * @param array $matrix2 An affine transformation matrix (an array with keys + * 0 to 5 and float values). + * @return array{0:float,1:float,2:float,3:float,4:float,5:float} An affine transformation matrix (an array with keys + * 0 to 5 and float values). + * @throws ImageException + * + */ +function imageaffinematrixconcat(array $matrix1, array $matrix2): array +{ + error_clear_last(); + $safeResult = \imageaffinematrixconcat($matrix1, $matrix2); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Returns an affine transformation matrix. + * + * @param int $type One of the IMG_AFFINE_* constants. + * @param array|float $options If type is IMG_AFFINE_TRANSLATE + * or IMG_AFFINE_SCALE, + * options has to be an array with keys x + * and y, both having float values. + * + * If type is IMG_AFFINE_ROTATE, + * IMG_AFFINE_SHEAR_HORIZONTAL or IMG_AFFINE_SHEAR_VERTICAL, + * options has to be a float specifying the angle. + * @return array{0:float,1:float,2:float,3:float,4:float,5:float} An affine transformation matrix (an array with keys + * 0 to 5 and float values). + * @throws ImageException + * + */ +function imageaffinematrixget(int $type, $options): array +{ + error_clear_last(); + $safeResult = \imageaffinematrixget($type, $options); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagealphablending allows for two different + * modes of drawing on truecolor images. In blending mode, the + * alpha channel component of the color supplied to all drawing function, + * such as imagesetpixel determines how much of the + * underlying color should be allowed to shine through. As a result, gd + * automatically blends the existing color at that point with the drawing color, + * and stores the result in the image. The resulting pixel is opaque. In + * non-blending mode, the drawing color is copied literally with its alpha channel + * information, replacing the destination pixel. Blending mode is not available + * when drawing on palette images. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param bool $enable Whether to enable the blending mode or not. On true color images + * the default value is TRUE otherwise the default value is FALSE + * @throws ImageException + * + */ +function imagealphablending($image, bool $enable): void +{ + error_clear_last(); + $safeResult = \imagealphablending($image, $enable); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Activate the fast drawing antialiased methods for lines and wired polygons. + * It does not support alpha components. It works using a direct blend + * operation. It works only with truecolor images. + * + * Thickness and styled are not supported. + * + * Using antialiased primitives with transparent background color can end with + * some unexpected results. The blend method uses the background color as any + * other colors. The lack of alpha component support does not allow an alpha + * based antialiasing method. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param bool $enable Whether to enable antialiasing or not. + * @throws ImageException + * + */ +function imageantialias($image, bool $enable): void +{ + error_clear_last(); + $safeResult = \imageantialias($image, $enable); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagearc draws an arc of circle centered at the given + * coordinates. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $center_x x-coordinate of the center. + * @param int $center_y y-coordinate of the center. + * @param int $width The arc width. + * @param int $height The arc height. + * @param int $start_angle The arc start angle, in degrees. + * @param int $end_angle The arc end angle, in degrees. + * 0° is located at the three-o'clock position, and the arc is drawn + * clockwise. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagearc($image, int $center_x, int $center_y, int $width, int $height, int $start_angle, int $end_angle, int $color): void +{ + error_clear_last(); + $safeResult = \imagearc($image, $center_x, $center_y, $width, $height, $start_angle, $end_angle, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Outputs or saves a AVIF Raster image from the given image. + * + * @param \GdImage $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @param int $quality quality is optional, and ranges from 0 (worst quality, smaller file) + * to 100 (best quality, larger file). + * If -1 is provided, the default value 30 is used. + * @param int $speed speed is optional, and ranges from 0 (slow, smaller file) + * to 10 (fast, larger file). + * If -1 is provided, the default value 6 is used. + * @throws ImageException + * + */ +function imageavif(\GdImage $image, $file = null, int $quality = -1, int $speed = -1): void +{ + error_clear_last(); + if ($speed !== -1) { + $safeResult = \imageavif($image, $file, $quality, $speed); + } elseif ($quality !== -1) { + $safeResult = \imageavif($image, $file, $quality); + } elseif ($file !== null) { + $safeResult = \imageavif($image, $file); + } else { + $safeResult = \imageavif($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Outputs or saves a BMP version of the given image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * + * NULL is invalid if the compressed arguments is + * not used. + * @param bool $compressed Whether the BMP should be compressed with run-length encoding (RLE), or not. + * @throws ImageException + * + */ +function imagebmp($image, $file = null, bool $compressed = true): void +{ + error_clear_last(); + if ($compressed !== true) { + $safeResult = \imagebmp($image, $file, $compressed); + } elseif ($file !== null) { + $safeResult = \imagebmp($image, $file); + } else { + $safeResult = \imagebmp($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagechar draws the first character of + * char in the image identified by + * image with its upper-left at + * x,y (top left is 0, + * 0) with the color color. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $font Can be 1, 2, 3, 4, 5 for built-in + * fonts in latin2 encoding (where higher numbers corresponding to larger fonts) or GdFont instance, + * returned by imageloadfont. + * @param int $x x-coordinate of the start. + * @param int $y y-coordinate of the start. + * @param string $char The character to draw. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagechar($image, int $font, int $x, int $y, string $char, int $color): void +{ + error_clear_last(); + $safeResult = \imagechar($image, $font, $x, $y, $char, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws the character char vertically at the specified + * coordinate on the given image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $font Can be 1, 2, 3, 4, 5 for built-in + * fonts in latin2 encoding (where higher numbers corresponding to larger fonts) or GdFont instance, + * returned by imageloadfont. + * @param int $x x-coordinate of the start. + * @param int $y y-coordinate of the start. + * @param string $char The character to draw. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagecharup($image, int $font, int $x, int $y, string $char, int $color): void +{ + error_clear_last(); + $safeResult = \imagecharup($image, $font, $x, $y, $char, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Returns the index of the color of the pixel at the + * specified location in the image specified by image. + * + * If the image is a + * truecolor image, this function returns the RGB value of that pixel as + * integer. Use bitshifting and masking to access the distinct red, green and blue + * component values: + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x x-coordinate of the point. + * @param int $y y-coordinate of the point. + * @return int Returns the index of the color. + * @throws ImageException + * + */ +function imagecolorat($image, int $x, int $y): int +{ + error_clear_last(); + $safeResult = \imagecolorat($image, $x, $y); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * De-allocates a color previously allocated with + * imagecolorallocate or + * imagecolorallocatealpha. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $color The color identifier. + * @throws ImageException + * + */ +function imagecolordeallocate($image, int $color): void +{ + error_clear_last(); + $safeResult = \imagecolordeallocate($image, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Makes the colors of the palette version of an image more closely match the true color version. + * + * @param resource $image1 A truecolor image object. + * @param resource $image2 A palette image object pointing to an image that has the same + * size as image1. + * @throws ImageException + * + */ +function imagecolormatch($image1, $image2): void +{ + error_clear_last(); + $safeResult = \imagecolormatch($image1, $image2); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * This sets the specified index in the palette to the specified + * color. This is useful for creating flood-fill-like effects in + * palleted images without the overhead of performing the actual + * flood-fill. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $color An index in the palette. + * @param int $red Value of red component. + * @param int $green Value of green component. + * @param int $blue Value of blue component. + * @param int $alpha Value of alpha component. + * @throws ImageException + * + */ +function imagecolorset($image, int $color, int $red, int $green, int $blue, int $alpha = 0): void +{ + error_clear_last(); + $safeResult = \imagecolorset($image, $color, $red, $green, $blue, $alpha); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Gets the color for a specified index. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $color The color index. + * @return int Returns an associative array with red, green, blue and alpha keys that + * contain the appropriate values for the specified color index. + * @throws ImageException + * + */ +function imagecolorsforindex($image, int $color): int +{ + error_clear_last(); + $safeResult = \imagecolorsforindex($image, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Applies a convolution matrix on the image, using the given coefficient and + * offset. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param array $matrix A 3x3 matrix: an array of three arrays of three floats. + * @param float $divisor The divisor of the result of the convolution, used for normalization. + * @param float $offset Color offset. + * @throws ImageException + * + */ +function imageconvolution($image, array $matrix, float $divisor, float $offset): void +{ + error_clear_last(); + $safeResult = \imageconvolution($image, $matrix, $divisor, $offset); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Copy a part of src_image onto + * dst_image starting at the x,y coordinates + * src_x, src_y with + * a width of src_width and a height of + * src_height. The portion defined will be copied + * onto the x,y coordinates, dst_x and + * dst_y. + * + * @param resource $dst_image Destination image resource. + * @param resource $src_image Source image resource. + * @param int $dst_x x-coordinate of destination point. + * @param int $dst_y y-coordinate of destination point. + * @param int $src_x x-coordinate of source point. + * @param int $src_y y-coordinate of source point. + * @param int $src_width Source width. + * @param int $src_height Source height. + * @throws ImageException + * + */ +function imagecopy($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height): void +{ + error_clear_last(); + $safeResult = \imagecopy($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $src_width, $src_height); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Copy a part of src_image onto + * dst_image starting at the x,y coordinates + * src_x, src_y with + * a width of src_width and a height of + * src_height. The portion defined will be copied + * onto the x,y coordinates, dst_x and + * dst_y. + * + * @param resource $dst_image Destination image resource. + * @param resource $src_image Source image resource. + * @param int $dst_x x-coordinate of destination point. + * @param int $dst_y y-coordinate of destination point. + * @param int $src_x x-coordinate of source point. + * @param int $src_y y-coordinate of source point. + * @param int $src_width Source width. + * @param int $src_height Source height. + * @param int $pct The two images will be merged according to pct + * which can range from 0 to 100. When pct = 0, + * no action is taken, when 100 this function behaves identically + * to imagecopy for pallete images, except for + * ignoring alpha components, while it implements alpha transparency + * for true colour images. + * @throws ImageException + * + */ +function imagecopymerge($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height, int $pct): void +{ + error_clear_last(); + $safeResult = \imagecopymerge($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $src_width, $src_height, $pct); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagecopymergegray copy a part of src_image onto + * dst_image starting at the x,y coordinates + * src_x, src_y with + * a width of src_width and a height of + * src_height. The portion defined will be copied + * onto the x,y coordinates, dst_x and + * dst_y. + * + * This function is identical to imagecopymerge except + * that when merging it preserves the hue of the source by converting + * the destination pixels to gray scale before the copy operation. + * + * @param resource $dst_image Destination image resource. + * @param resource $src_image Source image resource. + * @param int $dst_x x-coordinate of destination point. + * @param int $dst_y y-coordinate of destination point. + * @param int $src_x x-coordinate of source point. + * @param int $src_y y-coordinate of source point. + * @param int $src_width Source width. + * @param int $src_height Source height. + * @param int $pct The src_image will be changed to grayscale according + * to pct where 0 is fully grayscale and 100 is + * unchanged. When pct = 100 this function behaves + * identically to imagecopy for pallete images, except for + * ignoring alpha components, while + * it implements alpha transparency for true colour images. + * @throws ImageException + * + */ +function imagecopymergegray($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height, int $pct): void +{ + error_clear_last(); + $safeResult = \imagecopymergegray($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $src_width, $src_height, $pct); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagecopyresampled copies a rectangular + * portion of one image to another image, smoothly interpolating pixel + * values so that, in particular, reducing the size of an image still + * retains a great deal of clarity. + * + * In other words, imagecopyresampled will take a + * rectangular area from src_image of width + * src_width and height src_height at + * position (src_x,src_y) + * and place it in a rectangular area of dst_image + * of width dst_width and height dst_height + * at position (dst_x,dst_y). + * + * If the source and destination coordinates and width and heights + * differ, appropriate stretching or shrinking of the image fragment + * will be performed. The coordinates refer to the upper left + * corner. This function can be used to copy regions within the + * same image (if dst_image is the same as + * src_image) but if the regions overlap the + * results will be unpredictable. + * + * @param resource $dst_image Destination image resource. + * @param resource $src_image Source image resource. + * @param int $dst_x x-coordinate of destination point. + * @param int $dst_y y-coordinate of destination point. + * @param int $src_x x-coordinate of source point. + * @param int $src_y y-coordinate of source point. + * @param int $dst_width Destination width. + * @param int $dst_height Destination height. + * @param int $src_width Source width. + * @param int $src_height Source height. + * @throws ImageException + * + */ +function imagecopyresampled($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_width, int $dst_height, int $src_width, int $src_height): void +{ + error_clear_last(); + $safeResult = \imagecopyresampled($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_width, $dst_height, $src_width, $src_height); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagecopyresized copies a rectangular + * portion of one image to another image. + * dst_image is the destination image, + * src_image is the source image identifier. + * + * In other words, imagecopyresized will take a + * rectangular area from src_image of width + * src_width and height src_height at + * position (src_x,src_y) + * and place it in a rectangular area of dst_image + * of width dst_width and height dst_height + * at position (dst_x,dst_y). + * + * If the source and destination coordinates and width and heights + * differ, appropriate stretching or shrinking of the image fragment + * will be performed. The coordinates refer to the upper left + * corner. This function can be used to copy regions within the + * same image (if dst_image is the same as + * src_image) but if the regions overlap the + * results will be unpredictable. + * + * @param resource $dst_image Destination image resource. + * @param resource $src_image Source image resource. + * @param int $dst_x x-coordinate of destination point. + * @param int $dst_y y-coordinate of destination point. + * @param int $src_x x-coordinate of source point. + * @param int $src_y y-coordinate of source point. + * @param int $dst_width Destination width. + * @param int $dst_height Destination height. + * @param int $src_width Source width. + * @param int $src_height Source height. + * @throws ImageException + * + */ +function imagecopyresized($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_width, int $dst_height, int $src_width, int $src_height): void +{ + error_clear_last(); + $safeResult = \imagecopyresized($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_width, $dst_height, $src_width, $src_height); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagecreate returns an image identifier + * representing a blank image of specified size. + * + * In general, we recommend the use of + * imagecreatetruecolor instead of + * imagecreate so that image processing occurs on the + * highest quality image possible. If you want to output a palette image, then + * imagetruecolortopalette should be called immediately + * before saving the image with imagepng or + * imagegif. + * + * @param int $width The image width. + * @param int $height The image height. + * @return resource|false Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreate(int $width, int $height) +{ + error_clear_last(); + $safeResult = \imagecreate($width, $height); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromavif returns an image object + * representing the image obtained from the given filename. + * + * @param string $filename Path to the AVIF raster image. + * @return Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromavif(string $filename): void +{ + error_clear_last(); + $safeResult = \imagecreatefromavif($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagecreatefrombmp returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the BMP image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefrombmp(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefrombmp($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Create a new image from GD file or URL. + * + * @param string $filename Path to the GD file. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromgd(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromgd($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Create a new image from GD2 file or URL. + * + * @param string $filename Path to the GD2 image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromgd2(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromgd2($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Create a new image from a given part of GD2 file or URL. + * + * @param string $filename Path to the GD2 image. + * @param int $x x-coordinate of source point. + * @param int $y y-coordinate of source point. + * @param int $width Source width. + * @param int $height Source height. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromgd2part(string $filename, int $x, int $y, int $width, int $height) +{ + error_clear_last(); + $safeResult = \imagecreatefromgd2part($filename, $x, $y, $width, $height); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromgif returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the GIF image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromgif(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromgif($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromjpeg returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the JPEG image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromjpeg(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromjpeg($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefrompng returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the PNG image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefrompng(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefrompng($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromstring returns an image identifier + * representing the image obtained from the given data. + * These types will be automatically detected if your build of PHP supports + * them: JPEG, PNG, GIF, BMP, WBMP, GD2, and WEBP. + * + * @param string $data A string containing the image data. + * @return resource An image object will be returned on success. FALSE is returned if + * the image type is unsupported, the data is not in a recognised format, + * or the image is corrupt and cannot be loaded. + * @throws ImageException + * + */ +function imagecreatefromstring(string $data) +{ + error_clear_last(); + $safeResult = \imagecreatefromstring($data); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromtga returns an image object + * representing the image obtained from the given filename. + * + * @param string $filename Path to the Truevision TGA image. + * @return Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromtga(string $filename): void +{ + error_clear_last(); + $safeResult = \imagecreatefromtga($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagecreatefromwbmp returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the WBMP image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromwbmp(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromwbmp($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromwebp returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the WebP image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromwebp(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromwebp($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromxbm returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the XBM image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromxbm(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromxbm($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromxpm returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the XPM image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromxpm(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromxpm($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatetruecolor returns an image object + * representing a black image of the specified size. + * + * @param int $width Image width. + * @param int $height Image height. + * @return resource|false Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatetruecolor(int $width, int $height) +{ + error_clear_last(); + $safeResult = \imagecreatetruecolor($width, $height); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Crops an image to the given rectangular area and returns the resulting image. + * The given image is not modified. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param array $rectangle The cropping rectangle as array with keys + * x, y, width and + * height. + * @return resource Return cropped image object on success. + * @throws ImageException + * + */ +function imagecrop($image, array $rectangle) +{ + error_clear_last(); + $safeResult = \imagecrop($image, $rectangle); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Automatically crops an image according to the given + * mode. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $mode One of the following constants: + * @param float $threshold + * @param int $color + * @return resource Returns a cropped image object on success. + * If the complete image was cropped, imagecrop returns FALSE. + * @throws ImageException + * + */ +function imagecropauto($image, int $mode = IMG_CROP_DEFAULT, float $threshold = 0.5, int $color = -1) +{ + error_clear_last(); + $safeResult = \imagecropauto($image, $mode, $threshold, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * This function is deprecated. Use combination of + * imagesetstyle and imageline + * instead. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x1 Upper left x coordinate. + * @param int $y1 Upper left y coordinate 0, 0 is the top left corner of the image. + * @param int $x2 Bottom right x coordinate. + * @param int $y2 Bottom right y coordinate. + * @param int $color The fill color. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagedashedline($image, int $x1, int $y1, int $x2, int $y2, int $color): void +{ + error_clear_last(); + $safeResult = \imagedashedline($image, $x1, $y1, $x2, $y2, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Prior to PHP 8.0.0, imagedestroy freed any memory associated + * with image image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @throws ImageException + * + */ +function imagedestroy($image): void +{ + error_clear_last(); + $safeResult = \imagedestroy($image); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws an ellipse centered at the specified coordinates. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $center_x x-coordinate of the center. + * @param int $center_y y-coordinate of the center. + * @param int $width The ellipse width. + * @param int $height The ellipse height. + * @param int $color The color of the ellipse. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imageellipse($image, int $center_x, int $center_y, int $width, int $height, int $color): void +{ + error_clear_last(); + $safeResult = \imageellipse($image, $center_x, $center_y, $width, $height, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Performs a flood fill starting at the given coordinate (top left is 0, 0) + * with the given color in the + * image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x x-coordinate of start point. + * @param int $y y-coordinate of start point. + * @param int $color The fill color. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagefill($image, int $x, int $y, int $color): void +{ + error_clear_last(); + $safeResult = \imagefill($image, $x, $y, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws a partial arc centered at the specified coordinate in the + * given image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $center_x x-coordinate of the center. + * @param int $center_y y-coordinate of the center. + * @param int $width The arc width. + * @param int $height The arc height. + * @param int $start_angle The arc start angle, in degrees. + * @param int $end_angle The arc end angle, in degrees. + * 0° is located at the three-o'clock position, and the arc is drawn + * clockwise. + * @param int $color A color identifier created with imagecolorallocate. + * @param int $style A bitwise OR of the following possibilities: + * + * IMG_ARC_PIE + * IMG_ARC_CHORD + * IMG_ARC_NOFILL + * IMG_ARC_EDGED + * + * IMG_ARC_PIE and IMG_ARC_CHORD are + * mutually exclusive; IMG_ARC_CHORD just + * connects the starting and ending angles with a straight line, while + * IMG_ARC_PIE produces a rounded edge. + * IMG_ARC_NOFILL indicates that the arc + * or chord should be outlined, not filled. IMG_ARC_EDGED, + * used together with IMG_ARC_NOFILL, indicates that the + * beginning and ending angles should be connected to the center - this is a + * good way to outline (rather than fill) a 'pie slice'. + * @throws ImageException + * + */ +function imagefilledarc($image, int $center_x, int $center_y, int $width, int $height, int $start_angle, int $end_angle, int $color, int $style): void +{ + error_clear_last(); + $safeResult = \imagefilledarc($image, $center_x, $center_y, $width, $height, $start_angle, $end_angle, $color, $style); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws an ellipse centered at the specified coordinate on the given + * image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $center_x x-coordinate of the center. + * @param int $center_y y-coordinate of the center. + * @param int $width The ellipse width. + * @param int $height The ellipse height. + * @param int $color The fill color. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagefilledellipse($image, int $center_x, int $center_y, int $width, int $height, int $color): void +{ + error_clear_last(); + $safeResult = \imagefilledellipse($image, $center_x, $center_y, $width, $height, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Creates a rectangle filled with color in the given + * image starting at point 1 and ending at point 2. + * 0, 0 is the top left corner of the image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x1 x-coordinate for point 1. + * @param int $y1 y-coordinate for point 1. + * @param int $x2 x-coordinate for point 2. + * @param int $y2 y-coordinate for point 2. + * @param int $color The fill color. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagefilledrectangle($image, int $x1, int $y1, int $x2, int $y2, int $color): void +{ + error_clear_last(); + $safeResult = \imagefilledrectangle($image, $x1, $y1, $x2, $y2, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagefilltoborder performs a flood fill + * whose border color is defined by border_color. + * The starting point for the fill is x, + * y (top left is 0, 0) and the region is + * filled with color color. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x x-coordinate of start. + * @param int $y y-coordinate of start. + * @param int $border_color The border color. A color identifier created with imagecolorallocate. + * @param int $color The fill color. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagefilltoborder($image, int $x, int $y, int $border_color, int $color): void +{ + error_clear_last(); + $safeResult = \imagefilltoborder($image, $x, $y, $border_color, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagefilter applies the given filter + * filter on the image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $filter filter can be one of the following: + * + * + * + * IMG_FILTER_NEGATE: Reverses all colors of + * the image. + * + * + * + * + * IMG_FILTER_GRAYSCALE: Converts the image into + * grayscale by changing the red, green and blue components to their + * weighted sum using the same coefficients as the REC.601 luma (Y') + * calculation. The alpha components are retained. For palette images the + * result may differ due to palette limitations. + * + * + * + * + * IMG_FILTER_BRIGHTNESS: Changes the brightness + * of the image. Use args to set the level of + * brightness. The range for the brightness is -255 to 255. + * + * + * + * + * IMG_FILTER_CONTRAST: Changes the contrast of + * the image. Use args to set the level of + * contrast. + * + * + * + * + * IMG_FILTER_COLORIZE: Like + * IMG_FILTER_GRAYSCALE, except you can specify the + * color. Use args, arg2 and + * arg3 in the form of + * red, green, + * blue and arg4 for the + * alpha channel. The range for each color is 0 to 255. + * + * + * + * + * IMG_FILTER_EDGEDETECT: Uses edge detection to + * highlight the edges in the image. + * + * + * + * + * IMG_FILTER_EMBOSS: Embosses the image. + * + * + * + * + * IMG_FILTER_GAUSSIAN_BLUR: Blurs the image using + * the Gaussian method. + * + * + * + * + * IMG_FILTER_SELECTIVE_BLUR: Blurs the image. + * + * + * + * + * IMG_FILTER_MEAN_REMOVAL: Uses mean removal to + * achieve a "sketchy" effect. + * + * + * + * + * IMG_FILTER_SMOOTH: Makes the image smoother. + * Use args to set the level of smoothness. + * + * + * + * + * IMG_FILTER_PIXELATE: Applies pixelation effect + * to the image, use args to set the block size + * and arg2 to set the pixelation effect mode. + * + * + * + * + * IMG_FILTER_SCATTER: Applies scatter effect + * to the image, use args and + * arg2 to define the effect strength and + * additionally arg3 to only apply the + * on select pixel colors. + * + * + * + * @param int $args + * + * + * IMG_FILTER_BRIGHTNESS: Brightness level. + * + * + * + * + * IMG_FILTER_CONTRAST: Contrast level. + * + * + * + * + * IMG_FILTER_COLORIZE: Value of red component. + * + * + * + * + * IMG_FILTER_SMOOTH: Smoothness level. + * + * + * + * + * IMG_FILTER_PIXELATE: Block size in pixels. + * + * + * + * + * IMG_FILTER_SCATTER: Effect substraction level. + * This must not be higher or equal to the addition level set with + * arg2. + * + * + * + * @throws ImageException + * + */ +function imagefilter($image, int $filter, int ...$args): void +{ + error_clear_last(); + if ($args !== []) { + $safeResult = \imagefilter($image, $filter, ...$args); + } else { + $safeResult = \imagefilter($image, $filter); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Flips the image image using the given + * mode. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $mode Flip mode, this can be one of the IMG_FLIP_* constants: + * + * + * + * + * + * Constant + * Meaning + * + * + * + * + * IMG_FLIP_HORIZONTAL + * + * Flips the image horizontally. + * + * + * + * IMG_FLIP_VERTICAL + * + * Flips the image vertically. + * + * + * + * IMG_FLIP_BOTH + * + * Flips the image both horizontally and vertically. + * + * + * + * + * + * @throws ImageException + * + */ +function imageflip($image, int $mode): void +{ + error_clear_last(); + $safeResult = \imageflip($image, $mode); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * This function calculates and returns the bounding box in pixels + * for a FreeType text. + * + * @param float $size The font size in points. + * @param float $angle Angle in degrees in which string will be + * measured. + * @param string $font_filename The name of the TrueType font file (can be a URL). Depending on + * which version of the GD library that PHP is using, it may attempt to + * search for files that do not begin with a leading '/' by appending + * '.ttf' to the filename and searching along a library-defined font path. + * @param string $string The string to be measured. + * @param array $options + * Possible array indexes for options + * + * + * + * Key + * Type + * Meaning + * + * + * + * + * linespacing + * float + * Defines drawing linespacing + * + * + * + * + * @return array imageftbbox returns an array with 8 + * elements representing four points making the bounding box of the + * text: + * + * + * + * + * 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. + * + * On failure, FALSE is returned. + * @throws ImageException + * + */ +function imageftbbox(float $size, float $angle, string $font_filename, string $string, array $options = []): array +{ + error_clear_last(); + $safeResult = \imageftbbox($size, $angle, $font_filename, $string, $options); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param float $size The font size to use 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 index of the desired color for the text, see + * imagecolorexact. + * @param string $font_filename The path to the TrueType font you wish to use. + * + * Depending on which version of the GD library PHP is using, when + * font_filename 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. + * + * + * ]]> + * + * @param string $text Text to be inserted into image. + * @param array $options + * Possible array indexes for options + * + * + * + * Key + * Type + * Meaning + * + * + * + * + * linespacing + * float + * Defines drawing linespacing + * + * + * + * + * @return array This function returns an array defining the four points of the box, starting in the lower left and moving counter-clockwise: + * + * + * + * + * 0 + * lower left x-coordinate + * + * + * 1 + * lower left y-coordinate + * + * + * 2 + * lower right x-coordinate + * + * + * 3 + * lower right y-coordinate + * + * + * 4 + * upper right x-coordinate + * + * + * 5 + * upper right y-coordinate + * + * + * 6 + * upper left x-coordinate + * + * + * 7 + * upper left y-coordinate + * + * + * + * + * + * On failure, FALSE is returned. + * @throws ImageException + * + */ +function imagefttext($image, float $size, float $angle, int $x, int $y, int $color, string $font_filename, string $text, array $options = []): array +{ + error_clear_last(); + $safeResult = \imagefttext($image, $size, $angle, $x, $y, $color, $font_filename, $text, $options); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Applies gamma correction to the given gd image + * given an input and an output gamma. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param float $input_gamma The input gamma. + * @param float $output_gamma The output gamma. + * @throws ImageException + * + */ +function imagegammacorrect($image, float $input_gamma, float $output_gamma): void +{ + error_clear_last(); + $safeResult = \imagegammacorrect($image, $input_gamma, $output_gamma); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Outputs a GD image to the given file. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @throws ImageException + * + */ +function imagegd($image, $file = null): void +{ + error_clear_last(); + if ($file !== null) { + $safeResult = \imagegd($image, $file); + } else { + $safeResult = \imagegd($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Outputs a GD2 image to the given file. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @param int $chunk_size Chunk size. + * @param int $mode Either IMG_GD2_RAW or + * IMG_GD2_COMPRESSED. Default is + * IMG_GD2_RAW. + * @throws ImageException + * + */ +function imagegd2($image, $file = null, int $chunk_size = 128, int $mode = IMG_GD2_RAW): void +{ + error_clear_last(); + if ($mode !== IMG_GD2_RAW) { + $safeResult = \imagegd2($image, $file, $chunk_size, $mode); + } elseif ($chunk_size !== 128) { + $safeResult = \imagegd2($image, $file, $chunk_size); + } elseif ($file !== null) { + $safeResult = \imagegd2($image, $file); + } else { + $safeResult = \imagegd2($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagegif creates the GIF + * file in file from the image image. The + * image argument is the return from the + * imagecreate or imagecreatefrom* + * function. + * + * The image format will be GIF87a unless the + * image has been made transparent with + * imagecolortransparent, in which case the + * image format will be GIF89a. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @throws ImageException + * + */ +function imagegif($image, $file = null): void +{ + error_clear_last(); + if ($file !== null) { + $safeResult = \imagegif($image, $file); + } else { + $safeResult = \imagegif($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Grabs a screenshot of the whole screen. + * + * @return resource Returns an image object on success, FALSE on failure. + * @throws ImageException + * + */ +function imagegrabscreen() +{ + error_clear_last(); + $safeResult = \imagegrabscreen(); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Grabs a window or its client area using a windows handle (HWND property in COM instance) + * + * @param int $handle The HWND window ID. + * @param bool $client_area Include the client area of the application window. + * @return \GdImage Returns an image object on success, FALSE on failure. + * @throws ImageException + * + */ +function imagegrabwindow(int $handle, bool $client_area = false): \GdImage +{ + error_clear_last(); + $safeResult = \imagegrabwindow($handle, $client_area); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagejpeg creates a JPEG file from + * the given image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @param int $quality quality is optional, and ranges from 0 (worst + * quality, smaller file) to 100 (best quality, biggest file). The + * default (-1) uses the default IJG quality value (about 75). + * @throws ImageException + * + */ +function imagejpeg($image, $file = null, int $quality = -1): void +{ + error_clear_last(); + if ($quality !== -1) { + $safeResult = \imagejpeg($image, $file, $quality); + } elseif ($file !== null) { + $safeResult = \imagejpeg($image, $file); + } else { + $safeResult = \imagejpeg($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Set the alpha blending flag to use layering effects. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $effect One of the following constants: + * + * + * IMG_EFFECT_REPLACE + * + * + * Use pixel replacement (equivalent of passing TRUE to + * imagealphablending) + * + * + * + * + * IMG_EFFECT_ALPHABLEND + * + * + * Use normal pixel blending (equivalent of passing FALSE to + * imagealphablending) + * + * + * + * + * IMG_EFFECT_NORMAL + * + * + * Same as IMG_EFFECT_ALPHABLEND. + * + * + * + * + * IMG_EFFECT_OVERLAY + * + * + * Overlay has the effect that black background pixels will remain + * black, white background pixels will remain white, but grey + * background pixels will take the colour of the foreground pixel. + * + * + * + * + * IMG_EFFECT_MULTIPLY + * + * + * Overlays with a multiply effect. + * + * + * + * + * @throws ImageException + * + */ +function imagelayereffect($image, int $effect): void +{ + error_clear_last(); + $safeResult = \imagelayereffect($image, $effect); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws a line between the two given points. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x1 x-coordinate for first point. + * @param int $y1 y-coordinate for first point. + * @param int $x2 x-coordinate for second point. + * @param int $y2 y-coordinate for second point. + * @param int $color The line color. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imageline($image, int $x1, int $y1, int $x2, int $y2, int $color): void +{ + error_clear_last(); + $safeResult = \imageline($image, $x1, $y1, $x2, $y2, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imageloadfont loads a user-defined bitmap and returns + * its identifier. + * + * @param string $filename The font file format is currently binary and architecture + * dependent. This means you should generate the font files on the + * same type of CPU as the machine you are running PHP on. + * + * + * Font file format + * + * + * + * byte position + * C data type + * description + * + * + * + * + * byte 0-3 + * int + * number of characters in the font + * + * + * byte 4-7 + * int + * + * value of first character in the font (often 32 for space) + * + * + * + * byte 8-11 + * int + * pixel width of each character + * + * + * byte 12-15 + * int + * pixel height of each character + * + * + * byte 16- + * char + * + * array with character data, one byte per pixel in each + * character, for a total of (nchars*width*height) bytes. + * + * + * + * + * + * @return int Returns an GdFont instance. + * @throws ImageException + * + */ +function imageloadfont(string $filename): int +{ + error_clear_last(); + $safeResult = \imageloadfont($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Outputs or saves a PNG image from the given + * image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * + * NULL is invalid if the quality and + * filters arguments are not used. + * @param int $quality Compression level: from 0 (no compression) to 9. + * The default (-1) uses the zlib compression default. + * For more information see the zlib manual. + * @param int $filters Allows reducing the PNG file size. It is a bitmask field which may be + * set to any combination of the PNG_FILTER_XXX + * constants. PNG_NO_FILTER or + * PNG_ALL_FILTERS may also be used to respectively + * disable or activate all filters. + * The default value (-1) disables filtering. + * @throws ImageException + * + */ +function imagepng($image, $file = null, int $quality = -1, int $filters = -1): void +{ + error_clear_last(); + if ($filters !== -1) { + $safeResult = \imagepng($image, $file, $quality, $filters); + } elseif ($quality !== -1) { + $safeResult = \imagepng($image, $file, $quality); + } elseif ($file !== null) { + $safeResult = \imagepng($image, $file); + } else { + $safeResult = \imagepng($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagerectangle creates a rectangle starting at + * the specified coordinates. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x1 Upper left x coordinate. + * @param int $y1 Upper left y coordinate + * 0, 0 is the top left corner of the image. + * @param int $x2 Bottom right x coordinate. + * @param int $y2 Bottom right y coordinate. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagerectangle($image, int $x1, int $y1, int $x2, int $y2, int $color): void +{ + error_clear_last(); + $safeResult = \imagerectangle($image, $x1, $y1, $x2, $y2, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imageresolution allows to set and get the resolution of + * an image in DPI (dots per inch). If the optional parameters are NULL, + * the current resolution is returned as an indexed array. If only + * resolution_x is not NULL, the horizontal and vertical resolution + * are set to this value. If none of the optional parameters are NULL, the horizontal + * and vertical resolution are set to these values, respectively. + * + * The resolution is only used as meta information when images are read from and + * written to formats supporting this kind of information (curently PNG and + * JPEG). It does not affect any drawing operations. The default resolution + * for new images is 96 DPI. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $resolution_x The horizontal resolution in DPI. + * @param int $resolution_y The vertical resolution in DPI. + * @return mixed When used as getter, + * it returns an indexed array of the horizontal and vertical resolution on + * success. + * When used as setter, it returns + * TRUE on success. + * @throws ImageException + * + */ +function imageresolution($image, ?int $resolution_x = null, ?int $resolution_y = null) +{ + error_clear_last(); + if ($resolution_y !== null) { + $safeResult = \imageresolution($image, $resolution_x, $resolution_y); + } elseif ($resolution_x !== null) { + $safeResult = \imageresolution($image, $resolution_x); + } else { + $safeResult = \imageresolution($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Rotates the image image using the given + * angle in degrees. + * + * The center of rotation is the center of the image, and the rotated + * image may have different dimensions than the original image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param float $angle Rotation angle, in degrees. The rotation angle is interpreted as the + * number of degrees to rotate the image anticlockwise. + * @param int $background_color Specifies the color of the uncovered zone after the rotation + * @param bool $ignore_transparent This parameter is unused. + * @return resource Returns an image object for the rotated image. + * @throws ImageException + * + */ +function imagerotate($image, float $angle, int $background_color, bool $ignore_transparent = false) +{ + error_clear_last(); + $safeResult = \imagerotate($image, $angle, $background_color, $ignore_transparent); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagesavealpha sets the flag which determines whether to retain + * full alpha channel information (as opposed to single-color transparency) + * when saving PNG images. + * + * Alphablending has to be disabled (imagealphablending($im, false)) + * to retain the alpha-channel in the first place. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param bool $enable Whether to save the alpha channel or not. Defaults to FALSE. + * @throws ImageException + * + */ +function imagesavealpha($image, bool $enable): void +{ + error_clear_last(); + $safeResult = \imagesavealpha($image, $enable); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagescale scales an image using the given + * interpolation algorithm. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $width The width to scale the image to. + * @param int $height The height to scale the image to. If omitted or negative, the aspect + * ratio will be preserved. + * @param int $mode One of IMG_NEAREST_NEIGHBOUR, + * IMG_BILINEAR_FIXED, + * IMG_BICUBIC, + * IMG_BICUBIC_FIXED or anything else (will use two + * pass). + * + * + * IMG_WEIGHTED4 is not yet supported. + * + * + * @return resource Return the scaled image object on success. + * @throws ImageException + * + */ +function imagescale($image, int $width, int $height = -1, int $mode = IMG_BILINEAR_FIXED) +{ + error_clear_last(); + $safeResult = \imagescale($image, $width, $height, $mode); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagesetbrush sets the brush image to be + * used by all line drawing functions (such as imageline + * and imagepolygon) when drawing with the special + * colors IMG_COLOR_BRUSHED or + * IMG_COLOR_STYLEDBRUSHED. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param resource $brush An image object. + * @throws ImageException + * + */ +function imagesetbrush($image, $brush): void +{ + error_clear_last(); + $safeResult = \imagesetbrush($image, $brush); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagesetclip sets the current clipping rectangle, i.e. + * the area beyond which no pixels will be drawn. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x1 The x-coordinate of the upper left corner. + * @param int $y1 The y-coordinate of the upper left corner. + * @param int $x2 The x-coordinate of the lower right corner. + * @param int $y2 The y-coordinate of the lower right corner. + * @throws ImageException + * + */ +function imagesetclip($image, int $x1, int $y1, int $x2, int $y2): void +{ + error_clear_last(); + $safeResult = \imagesetclip($image, $x1, $y1, $x2, $y2); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Sets the interpolation method, setting an interpolation method affects the rendering + * of various functions in GD, such as the imagerotate function. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $method The interpolation method, which can be one of the following: + * + * + * + * IMG_BELL: Bell filter. + * + * + * + * + * IMG_BESSEL: Bessel filter. + * + * + * + * + * IMG_BICUBIC: Bicubic interpolation. + * + * + * + * + * IMG_BICUBIC_FIXED: Fixed point implementation of the bicubic interpolation. + * + * + * + * + * IMG_BILINEAR_FIXED: Fixed point implementation of the bilinear interpolation (default (also on image creation)). + * + * + * + * + * IMG_BLACKMAN: Blackman window function. + * + * + * + * + * IMG_BOX: Box blur filter. + * + * + * + * + * IMG_BSPLINE: Spline interpolation. + * + * + * + * + * IMG_CATMULLROM: Cubic Hermite spline interpolation. + * + * + * + * + * IMG_GAUSSIAN: Gaussian function. + * + * + * + * + * IMG_GENERALIZED_CUBIC: Generalized cubic spline fractal interpolation. + * + * + * + * + * IMG_HERMITE: Hermite interpolation. + * + * + * + * + * IMG_HAMMING: Hamming filter. + * + * + * + * + * IMG_HANNING: Hanning filter. + * + * + * + * + * IMG_MITCHELL: Mitchell filter. + * + * + * + * + * IMG_POWER: Power interpolation. + * + * + * + * + * IMG_QUADRATIC: Inverse quadratic interpolation. + * + * + * + * + * IMG_SINC: Sinc function. + * + * + * + * + * IMG_NEAREST_NEIGHBOUR: Nearest neighbour interpolation. + * + * + * + * + * IMG_WEIGHTED4: Weighting filter. + * + * + * + * + * IMG_TRIANGLE: Triangle interpolation. + * + * + * + * @throws ImageException + * + */ +function imagesetinterpolation($image, int $method = IMG_BILINEAR_FIXED): void +{ + error_clear_last(); + $safeResult = \imagesetinterpolation($image, $method); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagesetpixel draws a pixel at the specified + * coordinate. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x x-coordinate. + * @param int $y y-coordinate. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagesetpixel($image, int $x, int $y, int $color): void +{ + error_clear_last(); + $safeResult = \imagesetpixel($image, $x, $y, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagesetstyle sets the style to be used by all + * line drawing functions (such as imageline + * and imagepolygon) when drawing with the special + * color IMG_COLOR_STYLED or lines of images with color + * IMG_COLOR_STYLEDBRUSHED. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param array $style An array of pixel colors. You can use the + * IMG_COLOR_TRANSPARENT constant to add a + * transparent pixel. + * Note that style must not be an empty array. + * @throws ImageException + * + */ +function imagesetstyle($image, array $style): void +{ + error_clear_last(); + $safeResult = \imagesetstyle($image, $style); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagesetthickness sets the thickness of the lines + * drawn when drawing rectangles, polygons, arcs etc. to + * thickness pixels. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $thickness Thickness, in pixels. + * @throws ImageException + * + */ +function imagesetthickness($image, int $thickness): void +{ + error_clear_last(); + $safeResult = \imagesetthickness($image, $thickness); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagesettile sets the tile image to be + * used by all region filling functions (such as imagefill + * and imagefilledpolygon) when filling with the special + * color IMG_COLOR_TILED. + * + * A tile is an image used to fill an area with a repeated pattern. Any + * GD image can be used as a tile, and by setting the transparent color index of the tile + * image with imagecolortransparent, a tile allows certain parts + * of the underlying area to shine through can be created. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param resource $tile The image object to be used as a tile. + * @throws ImageException + * + */ +function imagesettile($image, $tile): void +{ + error_clear_last(); + $safeResult = \imagesettile($image, $tile); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws a string at the given coordinates. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $font Can be 1, 2, 3, 4, 5 for built-in + * fonts in latin2 encoding (where higher numbers corresponding to larger fonts) or GdFont instance, + * returned by imageloadfont. + * @param int $x x-coordinate of the upper left corner. + * @param int $y y-coordinate of the upper left corner. + * @param string $string The string to be written. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagestring($image, int $font, int $x, int $y, string $string, int $color): void +{ + error_clear_last(); + $safeResult = \imagestring($image, $font, $x, $y, $string, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws a string vertically at the given + * coordinates. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $font Can be 1, 2, 3, 4, 5 for built-in + * fonts in latin2 encoding (where higher numbers corresponding to larger fonts) or GdFont instance, + * returned by imageloadfont. + * @param int $x x-coordinate of the bottom left corner. + * @param int $y y-coordinate of the bottom left corner. + * @param string $string The string to be written. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagestringup($image, int $font, int $x, int $y, string $string, int $color): void +{ + error_clear_last(); + $safeResult = \imagestringup($image, $font, $x, $y, $string, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Returns the width of the given image object. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @return int Return the width of the images. + * @throws ImageException + * + */ +function imagesx($image): int +{ + error_clear_last(); + $safeResult = \imagesx($image); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Returns the height of the given image object. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @return int Return the height of the images. + * @throws ImageException + * + */ +function imagesy($image): int +{ + error_clear_last(); + $safeResult = \imagesy($image); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagetruecolortopalette converts a truecolor image + * to a palette image. The code for this function was originally drawn from + * the Independent JPEG Group library code, which is excellent. The code + * has been modified to preserve as much alpha channel information as + * possible in the resulting palette, in addition to preserving colors as + * well as possible. This does not work as well as might be hoped. It is + * usually best to simply produce a truecolor output image instead, which + * guarantees the highest output quality. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param bool $dither Indicates if the image should be dithered - if it is TRUE then + * dithering will be used which will result in a more speckled image but + * with better color approximation. + * @param int $num_colors Sets the maximum number of colors that should be retained in the palette. + * @throws ImageException + * + */ +function imagetruecolortopalette($image, bool $dither, int $num_colors): void +{ + error_clear_last(); + $safeResult = \imagetruecolortopalette($image, $dither, $num_colors); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * This function calculates and returns the bounding box in pixels + * for a TrueType text. + * + * @param float $size The font size in points. + * @param float $angle Angle in degrees in which string will be measured. + * @param string $font_filename 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 $string The string to be measured. + * @param array $options + * @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 ImageException + * + */ +function imagettfbbox(float $size, float $angle, string $font_filename, string $string, array $options = []): array +{ + error_clear_last(); + $safeResult = \imagettfbbox($size, $angle, $font_filename, $string, $options); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Writes the given text into the image using TrueType + * fonts. + * + * @param resource $image A GdImage object, 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 $font_filename 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. + * @param array $options + * @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. + * @throws ImageException + * + */ +function imagettftext($image, float $size, float $angle, int $x, int $y, int $color, string $font_filename, string $text, array $options = []): array +{ + error_clear_last(); + $safeResult = \imagettftext($image, $size, $angle, $x, $y, $color, $font_filename, $text, $options); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagewbmp outputs or save a WBMP + * version of the given image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @param int $foreground_color You can set the foreground color with this parameter by setting an + * identifier obtained from imagecolorallocate. + * The default foreground color is black. + * @throws ImageException + * + */ +function imagewbmp($image, $file = null, ?int $foreground_color = null): void +{ + error_clear_last(); + if ($foreground_color !== null) { + $safeResult = \imagewbmp($image, $file, $foreground_color); + } elseif ($file !== null) { + $safeResult = \imagewbmp($image, $file); + } else { + $safeResult = \imagewbmp($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Outputs or saves a WebP version of the given image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @param int $quality quality ranges from 0 (worst + * quality, smaller file) to 100 (best quality, biggest file). + * @throws ImageException + * + */ +function imagewebp($image, $file = null, int $quality = -1): void +{ + error_clear_last(); + if ($quality !== -1) { + $safeResult = \imagewebp($image, $file, $quality); + } elseif ($file !== null) { + $safeResult = \imagewebp($image, $file); + } else { + $safeResult = \imagewebp($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Outputs or save an XBM version of the given + * image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $filename The path to save the file to, given as string. If NULL, the raw image stream will be output 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_color 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 ImageException + * + */ +function imagexbm($image, $filename, ?int $foreground_color = null): void +{ + error_clear_last(); + if ($foreground_color !== null) { + $safeResult = \imagexbm($image, $filename, $foreground_color); + } else { + $safeResult = \imagexbm($image, $filename); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Embeds binary IPTC data into a JPEG image. + * + * @param string $iptc_data The data to be written. + * @param string $filename 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 string|bool If spool is less than 2, the JPEG will be returned. Otherwise returns TRUE on success. + * @throws ImageException + * + */ +function iptcembed(string $iptc_data, string $filename, int $spool = 0) +{ + error_clear_last(); + $safeResult = \iptcembed($iptc_data, $filename, $spool); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Parses an IPTC block into its single tags. + * + * @param string $iptc_block 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 ImageException + * + */ +function iptcparse(string $iptc_block): array +{ + error_clear_last(); + $safeResult = \iptcparse($iptc_block); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 ImageException + * + */ +function jpeg2wbmp(string $jpegname, string $wbmpname, int $dest_height, int $dest_width, int $threshold): void +{ + error_clear_last(); + $safeResult = \jpeg2wbmp($jpegname, $wbmpname, $dest_height, $dest_width, $threshold); + if ($safeResult === false) { + throw 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 ImageException + * + */ +function png2wbmp(string $pngname, string $wbmpname, int $dest_height, int $dest_width, int $threshold): void +{ + error_clear_last(); + $safeResult = \png2wbmp($pngname, $wbmpname, $dest_height, $dest_width, $threshold); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} diff --git a/generated/8.1/imap.php b/generated/8.1/imap.php new file mode 100644 index 00000000..99547fe3 --- /dev/null +++ b/generated/8.1/imap.php @@ -0,0 +1,2283 @@ + + * + * + * @param array $controls Array of LDAP Controls to send with the request. + * @throws LdapException + * + */ +function ldap_add($ldap, string $dn, array $entry, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_add($ldap, $dn, $entry, $controls); + } else { + $safeResult = \ldap_add($ldap, $dn, $entry); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Binds to the LDAP directory with specified RDN and password. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param string|null $dn + * @param string|null $password + * @throws LdapException + * + */ +function ldap_bind($ldap, ?string $dn = null, ?string $password = null): void +{ + error_clear_last(); + if ($password !== null) { + $safeResult = \ldap_bind($ldap, $dn, $password); + } elseif ($dn !== null) { + $safeResult = \ldap_bind($ldap, $dn); + } else { + $safeResult = \ldap_bind($ldap); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Retrieve the pagination information send by the server. + * + * @param resource $link An LDAP resource, returned by ldap_connect. + * @param resource $result + * @param string|null $cookie An opaque structure sent by the server. + * @param int|null $estimated The estimated number of entries to retrieve. + * @throws LdapException + * + */ +function ldap_control_paged_result_response($link, $result, ?string &$cookie = null, ?int &$estimated = null): void +{ + error_clear_last(); + $safeResult = \ldap_control_paged_result_response($link, $result, $cookie, $estimated); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Enable LDAP pagination by sending the pagination control (page size, cookie...). + * + * @param resource $link An LDAP resource, 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 LdapException + * + */ +function ldap_control_paged_result($link, int $pagesize, bool $iscritical = false, string $cookie = ""): void +{ + error_clear_last(); + $safeResult = \ldap_control_paged_result($link, $pagesize, $iscritical, $cookie); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Returns the number of entries stored in the result of previous search + * operations. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $result An LDAP\Result instance, returned by ldap_list or ldap_search. + * @return int Returns number of entries in the result. + * @throws LdapException + * + */ +function ldap_count_entries($ldap, $result): int +{ + error_clear_last(); + $safeResult = \ldap_count_entries($ldap, $result); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Deletes a particular entry in LDAP directory. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param string $dn The distinguished name of an LDAP entity. + * @param array $controls Array of LDAP Controls to send with the request. + * @throws LdapException + * + */ +function ldap_delete($ldap, string $dn, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_delete($ldap, $dn, $controls); + } else { + $safeResult = \ldap_delete($ldap, $dn); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Turns the specified dn, into a more user-friendly + * form, stripping off type names. + * + * @param string $dn The distinguished name of an LDAP entity. + * @return string Returns the user friendly name. + * @throws LdapException + * + */ +function ldap_dn2ufn(string $dn): string +{ + error_clear_last(); + $safeResult = \ldap_dn2ufn($dn); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Performs a PASSWD extended operation. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param string $user dn of the user to change the password of. + * @param string $old_password The old password of this user. May be ommited depending of server configuration. + * @param string $new_password The new password for this user. May be omitted or empty to have a generated password. + * @param array $controls If provided, a password policy request control is send with the request and this is + * filled with an array of LDAP Controls + * returned with the request. + * @return string|bool Returns the generated password if new_password is empty or omitted. + * Otherwise returns TRUE on success. + * @throws LdapException + * + */ +function ldap_exop_passwd($ldap, string $user = "", string $old_password = "", string $new_password = "", ?array &$controls = null) +{ + error_clear_last(); + $safeResult = \ldap_exop_passwd($ldap, $user, $old_password, $new_password, $controls); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Performs a WHOAMI extended operation and returns the data. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @return string|bool The data returned by the server. + * @throws LdapException + * + */ +function ldap_exop_whoami($ldap) +{ + error_clear_last(); + $safeResult = \ldap_exop_whoami($ldap); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Performs an extended operation on the specified link with + * reqoid the OID of the operation and + * reqdata the data. + * + * @param resource $ldap An LDAP\Connection instance, 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|null $serverctrls Array of LDAP Controls to send with the request. + * @param string|null $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|null $retoid Will be filled with the response OID if provided, usually equal to the request OID. + * @return resource|bool When used with retdata, returns TRUE on success. + * When used without retdata, returns a result identifier. + * @throws LdapException + * + */ +function ldap_exop($ldap, string $reqoid, ?string $reqdata = null, ?array $serverctrls = null, ?string &$retdata = null, ?string &$retoid = null) +{ + error_clear_last(); + if ($retoid !== null) { + $safeResult = \ldap_exop($ldap, $reqoid, $reqdata, $serverctrls, $retdata, $retoid); + } elseif ($retdata !== null) { + $safeResult = \ldap_exop($ldap, $reqoid, $reqdata, $serverctrls, $retdata); + } elseif ($serverctrls !== null) { + $safeResult = \ldap_exop($ldap, $reqoid, $reqdata, $serverctrls); + } elseif ($reqdata !== null) { + $safeResult = \ldap_exop($ldap, $reqoid, $reqdata); + } else { + $safeResult = \ldap_exop($ldap, $reqoid); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 LdapException + * + */ +function ldap_explode_dn(string $dn, int $with_attrib): array +{ + error_clear_last(); + $safeResult = \ldap_explode_dn($dn, $with_attrib); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $entry An LDAP\ResultEntry instance. + * @return string Returns the first attribute in the entry on success and FALSE on + * error. + * @throws LdapException + * + */ +function ldap_first_attribute($ldap, $entry): string +{ + error_clear_last(); + $safeResult = \ldap_first_attribute($ldap, $entry); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $result An LDAP\Result instance, returned by ldap_list or ldap_search. + * @return resource Returns an LDAP\ResultEntry instance. + * @throws LdapException + * + */ +function ldap_first_entry($ldap, $result) +{ + error_clear_last(); + $safeResult = \ldap_first_entry($ldap, $result); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 An LDAP\Result instance, returned by ldap_list or ldap_search. + * @throws LdapException + * + */ +function ldap_free_result($result): void +{ + error_clear_last(); + $safeResult = \ldap_free_result($result); + if ($safeResult === false) { + throw 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 $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $entry An LDAP\ResultEntry instance. + * @return array Returns a complete entry information in a multi-dimensional array + * on success and FALSE on error. + * @throws LdapException + * + */ +function ldap_get_attributes($ldap, $entry): array +{ + error_clear_last(); + $safeResult = \ldap_get_attributes($ldap, $entry); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Finds out the DN of an entry in the result. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $entry An LDAP\ResultEntry instance. + * @return string Returns the DN of the result entry and FALSE on error. + * @throws LdapException + * + */ +function ldap_get_dn($ldap, $entry): string +{ + error_clear_last(); + $safeResult = \ldap_get_dn($ldap, $entry); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Reads multiple entries from the given result, and then reading the + * attributes and multiple values. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $result An LDAP\Result instance, returned by ldap_list or ldap_search. + * @return array Returns a complete result information in a multi-dimensional array on + * success. + * + * 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 LdapException + * + */ +function ldap_get_entries($ldap, $result): array +{ + error_clear_last(); + $safeResult = \ldap_get_entries($ldap, $result); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Sets value to the value of the specified option. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param int $option The parameter option can be one of: + * + * + * + * + * Option + * Type + * since + * + * + * + * + * LDAP_OPT_DEREF + * int + * + * + * + * LDAP_OPT_SIZELIMIT + * int + * + * + * + * LDAP_OPT_TIMELIMIT + * int + * + * + * + * LDAP_OPT_NETWORK_TIMEOUT + * int + * + * + * + * LDAP_OPT_PROTOCOL_VERSION + * int + * + * + * + * LDAP_OPT_ERROR_NUMBER + * int + * + * + * + * LDAP_OPT_DIAGNOSTIC_MESSAGE + * int + * + * + * + * LDAP_OPT_REFERRALS + * int + * + * + * + * LDAP_OPT_RESTART + * int + * + * + * + * 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 + * int + * 7.1 + * + * + * LDAP_OPT_X_TLS_CRL_NONE + * int + * 7.1 + * + * + * LDAP_OPT_X_TLS_CRL_PEER + * int + * 7.1 + * + * + * LDAP_OPT_X_TLS_CRL_ALL + * int + * 7.1 + * + * + * LDAP_OPT_X_TLS_CRLFILE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_DHFILE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_KEYFILE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_PACKAGE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_PROTOCOL_MIN + * int + * 7.1 + * + * + * LDAP_OPT_X_TLS_RANDOM_FILE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_REQUIRE_CERT + * int + * + * + * + * + * + * @param mixed $value This will be set to the option value. + * @throws LdapException + * + */ +function ldap_get_option($ldap, int $option, &$value = null): void +{ + error_clear_last(); + $safeResult = \ldap_get_option($ldap, $option, $value); + if ($safeResult === false) { + throw 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 $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $entry An LDAP\ResultEntry instance. + * @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 LdapException + * + */ +function ldap_get_values_len($ldap, $entry, string $attribute): array +{ + error_clear_last(); + $safeResult = \ldap_get_values_len($ldap, $entry, $attribute); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Reads all the values of the attribute in the entry in the result. + * + * This call needs a entry, + * 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 $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $entry An LDAP\ResultEntry instance. + * @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 LdapException + * + */ +function ldap_get_values($ldap, $entry, string $attribute): array +{ + error_clear_last(); + $safeResult = \ldap_get_values($ldap, $entry, $attribute); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Adds one or more attribute values to the specified dn. + * To add a whole new object see ldap_add function. + * + * @param resource $ldap An LDAP\Connection instance, 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 $controls Array of LDAP Controls to send with the request. + * @throws LdapException + * + */ +function ldap_mod_add($ldap, string $dn, array $entry, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_mod_add($ldap, $dn, $entry, $controls); + } else { + $safeResult = \ldap_mod_add($ldap, $dn, $entry); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Removes one or more attribute values from the specified dn. + * Object deletions are done by the + * ldap_delete function. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param string $dn The distinguished name of an LDAP entity. + * @param array $entry + * @param array $controls Array of LDAP Controls to send with the request. + * @throws LdapException + * + */ +function ldap_mod_del($ldap, string $dn, array $entry, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_mod_del($ldap, $dn, $entry, $controls); + } else { + $safeResult = \ldap_mod_del($ldap, $dn, $entry); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Replaces one or more attributes from the specified dn. + * It may also add or remove attributes. + * + * @param resource $ldap An LDAP\Connection instance, 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 $controls Array of LDAP Controls to send with the request. + * @throws LdapException + * + */ +function ldap_mod_replace($ldap, string $dn, array $entry, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_mod_replace($ldap, $dn, $entry, $controls); + } else { + $safeResult = \ldap_mod_replace($ldap, $dn, $entry); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Modifies an existing entry in the LDAP directory. Allows detailed + * specification of the modifications to perform. + * + * @param resource $ldap An LDAP resource, returned by ldap_connect. + * @param string $dn The distinguished name of an LDAP entity. + * @param array $modifications_info 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 $controls Each value specified through values is added (as + * an additional value) to the attribute named by + * attrib. + * @throws LdapException + * + */ +function ldap_modify_batch($ldap, string $dn, array $modifications_info, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_modify_batch($ldap, $dn, $modifications_info, $controls); + } else { + $safeResult = \ldap_modify_batch($ldap, $dn, $modifications_info); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Retrieves the attributes in an entry. The first call to + * ldap_next_attribute is made with the + * entry returned from + * ldap_first_attribute. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $entry An LDAP\ResultEntry instance. + * @return string Returns the next attribute in an entry on success and FALSE on + * error. + * @throws LdapException + * + */ +function ldap_next_attribute($ldap, $entry): string +{ + error_clear_last(); + $safeResult = \ldap_next_attribute($ldap, $entry); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Parse LDAP extended operation data from result object result + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $result An LDAP\Result instance, returned by ldap_list or ldap_search. + * @param string|null $response_data Will be filled by the response data. + * @param string|null $response_oid Will be filled by the response OID. + * @throws LdapException + * + */ +function ldap_parse_exop($ldap, $result, ?string &$response_data = null, ?string &$response_oid = null): void +{ + error_clear_last(); + $safeResult = \ldap_parse_exop($ldap, $result, $response_data, $response_oid); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Parses an LDAP search result. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $result An LDAP\Result instance, returned by ldap_list or ldap_search. + * @param int|null $error_code 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|null $matched_dn 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|null $error_message 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|null $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|null $controls An array of LDAP Controls which have been sent with the response. + * @throws LdapException + * + */ +function ldap_parse_result($ldap, $result, ?int &$error_code, ?string &$matched_dn = null, ?string &$error_message = null, ?array &$referrals = null, ?array &$controls = null): void +{ + error_clear_last(); + $safeResult = \ldap_parse_result($ldap, $result, $error_code, $matched_dn, $error_message, $referrals, $controls); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * The entry specified by dn is renamed/moved. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param string $dn The distinguished name of an LDAP entity. + * @param string $new_rdn The new RDN. + * @param string $new_parent The new parent/superior entry. + * @param bool $delete_old_rdn 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 $controls Array of LDAP Controls to send with the request. + * @throws LdapException + * + */ +function ldap_rename($ldap, string $dn, string $new_rdn, string $new_parent, bool $delete_old_rdn, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_rename($ldap, $dn, $new_rdn, $new_parent, $delete_old_rdn, $controls); + } else { + $safeResult = \ldap_rename($ldap, $dn, $new_rdn, $new_parent, $delete_old_rdn); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * + * + * @param resource $ldap + * @param string $dn + * @param string $password + * @param string $mech + * @param string $realm + * @param string $authc_id + * @param string $authz_id + * @param string $props + * @throws LdapException + * + */ +function ldap_sasl_bind($ldap, ?string $dn = null, ?string $password = null, ?string $mech = null, ?string $realm = null, ?string $authc_id = null, ?string $authz_id = null, ?string $props = null): void +{ + error_clear_last(); + if ($props !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm, $authc_id, $authz_id, $props); + } elseif ($authz_id !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm, $authc_id, $authz_id); + } elseif ($authc_id !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm, $authc_id); + } elseif ($realm !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm); + } elseif ($mech !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech); + } elseif ($password !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn, $password); + } elseif ($dn !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn); + } else { + $safeResult = \ldap_sasl_bind($ldap); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Sets the value of the specified option to be value. + * + * @param resource|null $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param int $option The parameter option can be one of: + * + * + * + * + * Option + * Type + * Available since + * + * + * + * + * LDAP_OPT_DEREF + * int + * + * + * + * LDAP_OPT_SIZELIMIT + * int + * + * + * + * LDAP_OPT_TIMELIMIT + * int + * + * + * + * LDAP_OPT_NETWORK_TIMEOUT + * int + * + * + * + * LDAP_OPT_PROTOCOL_VERSION + * int + * + * + * + * LDAP_OPT_ERROR_NUMBER + * int + * + * + * + * 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 + * int + * 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 + * int + * PHP 7.1.0 + * + * + * LDAP_OPT_X_TLS_RANDOM_FILE + * string + * PHP 7.1.0 + * + * + * LDAP_OPT_X_TLS_REQUIRE_CERT + * int + * 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 $value The new value for the specified option. + * @throws LdapException + * + */ +function ldap_set_option($ldap, int $option, $value): void +{ + error_clear_last(); + $safeResult = \ldap_set_option($ldap, $option, $value); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Unbinds from the LDAP directory. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @throws LdapException + * + */ +function ldap_unbind($ldap): void +{ + error_clear_last(); + $safeResult = \ldap_unbind($ldap); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} diff --git a/generated/8.1/libxml.php b/generated/8.1/libxml.php new file mode 100644 index 00000000..20d32408 --- /dev/null +++ b/generated/8.1/libxml.php @@ -0,0 +1,78 @@ + + * + * 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 (in bytes) 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 (in bytes) 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|null Returns the number of full pattern matches (which might be zero). + * @throws PcreException + * + */ +function preg_match_all(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): ?int +{ + error_clear_last(); + $safeResult = \preg_match_all($pattern, $subject, $matches, $flags, $offset); + if ($safeResult === false) { + throw PcreException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 string[]|null $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 (in bytes) 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 (in bytes) 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 (in bytes) 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 PcreException + * + */ +function preg_match(string $pattern, string $subject, ?iterable &$matches = null, int $flags = 0, int $offset = 0): int +{ + error_clear_last(); + $safeResult = \preg_match($pattern, $subject, $matches, $flags, $offset); + if ($safeResult === false) { + throw PcreException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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". + * @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 PcreException + * + */ +function preg_split(string $pattern, string $subject, ?int $limit = -1, int $flags = 0): array +{ + error_clear_last(); + $safeResult = \preg_split($pattern, $subject, $limit, $flags); + if ($safeResult === false) { + throw PcreException::createFromPhpError(); + } + return $safeResult; +} diff --git a/generated/8.1/pgsql.php b/generated/8.1/pgsql.php new file mode 100644 index 00000000..38b66e9c --- /dev/null +++ b/generated/8.1/pgsql.php @@ -0,0 +1,1360 @@ +ruleWithConfiguration( + RenameFunctionRector::class, + [ 'apache_getenv' => 'Safe\apache_getenv', + 'apache_get_version' => 'Safe\apache_get_version', + 'apache_lookup_uri' => 'Safe\apache_lookup_uri', + 'apache_request_headers' => 'Safe\apache_request_headers', + 'apache_response_headers' => 'Safe\apache_response_headers', + 'apache_setenv' => 'Safe\apache_setenv', + 'apcu_cache_info' => 'Safe\apcu_cache_info', + 'apcu_cas' => 'Safe\apcu_cas', + 'apcu_dec' => 'Safe\apcu_dec', + 'apcu_fetch' => 'Safe\apcu_fetch', + 'apcu_inc' => 'Safe\apcu_inc', + 'apcu_sma_info' => 'Safe\apcu_sma_info', + 'apc_fetch' => 'Safe\apc_fetch', + 'array_combine' => 'Safe\array_combine', + 'array_flip' => 'Safe\array_flip', + 'array_replace' => 'Safe\array_replace', + 'array_replace_recursive' => 'Safe\array_replace_recursive', + 'array_walk_recursive' => 'Safe\array_walk_recursive', + 'assert_options' => 'Safe\assert_options', + 'base64_decode' => 'Safe\base64_decode', + 'bindtextdomain' => 'Safe\bindtextdomain', + 'bzclose' => 'Safe\bzclose', + 'bzflush' => 'Safe\bzflush', + 'bzread' => 'Safe\bzread', + 'bzwrite' => 'Safe\bzwrite', + 'chdir' => 'Safe\chdir', + 'chgrp' => 'Safe\chgrp', + 'chmod' => 'Safe\chmod', + 'chown' => 'Safe\chown', + 'chroot' => 'Safe\chroot', + 'class_alias' => 'Safe\class_alias', + 'class_implements' => 'Safe\class_implements', + 'class_parents' => 'Safe\class_parents', + 'class_uses' => 'Safe\class_uses', + 'cli_set_process_title' => 'Safe\cli_set_process_title', + 'closelog' => 'Safe\closelog', + 'com_create_guid' => 'Safe\com_create_guid', + 'com_event_sink' => 'Safe\com_event_sink', + 'com_load_typelib' => 'Safe\com_load_typelib', + 'com_print_typeinfo' => 'Safe\com_print_typeinfo', + 'convert_uudecode' => 'Safe\convert_uudecode', + 'copy' => 'Safe\copy', + 'create_function' => 'Safe\create_function', + 'cubrid_bind' => 'Safe\cubrid_bind', + 'cubrid_column_names' => 'Safe\cubrid_column_names', + 'cubrid_column_types' => 'Safe\cubrid_column_types', + 'cubrid_col_size' => 'Safe\cubrid_col_size', + 'cubrid_commit' => 'Safe\cubrid_commit', + 'cubrid_connect' => 'Safe\cubrid_connect', + 'cubrid_connect_with_url' => 'Safe\cubrid_connect_with_url', + 'cubrid_current_oid' => 'Safe\cubrid_current_oid', + 'cubrid_disconnect' => 'Safe\cubrid_disconnect', + 'cubrid_drop' => 'Safe\cubrid_drop', + 'cubrid_free_result' => 'Safe\cubrid_free_result', + 'cubrid_get_charset' => 'Safe\cubrid_get_charset', + 'cubrid_get_class_name' => 'Safe\cubrid_get_class_name', + 'cubrid_get_client_info' => 'Safe\cubrid_get_client_info', + 'cubrid_get_db_parameter' => 'Safe\cubrid_get_db_parameter', + 'cubrid_get_query_timeout' => 'Safe\cubrid_get_query_timeout', + 'cubrid_get_server_info' => 'Safe\cubrid_get_server_info', + 'cubrid_insert_id' => 'Safe\cubrid_insert_id', + 'cubrid_lob2_bind' => 'Safe\cubrid_lob2_bind', + 'cubrid_lob2_close' => 'Safe\cubrid_lob2_close', + 'cubrid_lob2_export' => 'Safe\cubrid_lob2_export', + 'cubrid_lob2_import' => 'Safe\cubrid_lob2_import', + 'cubrid_lob2_new' => 'Safe\cubrid_lob2_new', + 'cubrid_lob2_read' => 'Safe\cubrid_lob2_read', + 'cubrid_lob2_seek' => 'Safe\cubrid_lob2_seek', + 'cubrid_lob2_seek64' => 'Safe\cubrid_lob2_seek64', + 'cubrid_lob2_size' => 'Safe\cubrid_lob2_size', + 'cubrid_lob2_size64' => 'Safe\cubrid_lob2_size64', + 'cubrid_lob2_tell' => 'Safe\cubrid_lob2_tell', + 'cubrid_lob2_tell64' => 'Safe\cubrid_lob2_tell64', + 'cubrid_lob2_write' => 'Safe\cubrid_lob2_write', + 'cubrid_lob_close' => 'Safe\cubrid_lob_close', + 'cubrid_lob_export' => 'Safe\cubrid_lob_export', + 'cubrid_lob_get' => 'Safe\cubrid_lob_get', + 'cubrid_lob_send' => 'Safe\cubrid_lob_send', + 'cubrid_lob_size' => 'Safe\cubrid_lob_size', + 'cubrid_lock_read' => 'Safe\cubrid_lock_read', + 'cubrid_lock_write' => 'Safe\cubrid_lock_write', + 'cubrid_move_cursor' => 'Safe\cubrid_move_cursor', + 'cubrid_next_result' => 'Safe\cubrid_next_result', + 'cubrid_pconnect' => 'Safe\cubrid_pconnect', + 'cubrid_pconnect_with_url' => 'Safe\cubrid_pconnect_with_url', + 'cubrid_prepare' => 'Safe\cubrid_prepare', + 'cubrid_put' => 'Safe\cubrid_put', + 'cubrid_rollback' => 'Safe\cubrid_rollback', + 'cubrid_schema' => 'Safe\cubrid_schema', + 'cubrid_seq_drop' => 'Safe\cubrid_seq_drop', + 'cubrid_seq_insert' => 'Safe\cubrid_seq_insert', + 'cubrid_seq_put' => 'Safe\cubrid_seq_put', + 'cubrid_set_add' => 'Safe\cubrid_set_add', + 'cubrid_set_autocommit' => 'Safe\cubrid_set_autocommit', + 'cubrid_set_db_parameter' => 'Safe\cubrid_set_db_parameter', + 'cubrid_set_drop' => 'Safe\cubrid_set_drop', + 'cubrid_set_query_timeout' => 'Safe\cubrid_set_query_timeout', + 'curl_copy_handle' => 'Safe\curl_copy_handle', + 'curl_escape' => 'Safe\curl_escape', + 'curl_exec' => 'Safe\curl_exec', + 'curl_getinfo' => 'Safe\curl_getinfo', + 'curl_init' => 'Safe\curl_init', + 'curl_multi_info_read' => 'Safe\curl_multi_info_read', + 'curl_multi_init' => 'Safe\curl_multi_init', + 'curl_multi_setopt' => 'Safe\curl_multi_setopt', + 'curl_setopt' => 'Safe\curl_setopt', + 'curl_share_errno' => 'Safe\curl_share_errno', + 'curl_share_setopt' => 'Safe\curl_share_setopt', + 'curl_unescape' => 'Safe\curl_unescape', + 'date_parse' => 'Safe\date_parse', + 'date_parse_from_format' => 'Safe\date_parse_from_format', + 'date_sunrise' => 'Safe\date_sunrise', + 'date_sunset' => 'Safe\date_sunset', + 'date_sun_info' => 'Safe\date_sun_info', + 'db2_autocommit' => 'Safe\db2_autocommit', + 'db2_bind_param' => 'Safe\db2_bind_param', + 'db2_client_info' => 'Safe\db2_client_info', + 'db2_close' => 'Safe\db2_close', + 'db2_commit' => 'Safe\db2_commit', + 'db2_execute' => 'Safe\db2_execute', + 'db2_free_result' => 'Safe\db2_free_result', + 'db2_free_stmt' => 'Safe\db2_free_stmt', + 'db2_get_option' => 'Safe\db2_get_option', + 'db2_pclose' => 'Safe\db2_pclose', + 'db2_rollback' => 'Safe\db2_rollback', + 'db2_server_info' => 'Safe\db2_server_info', + 'db2_set_option' => 'Safe\db2_set_option', + 'define' => 'Safe\define', + 'deflate_add' => 'Safe\deflate_add', + 'deflate_init' => 'Safe\deflate_init', + 'disk_free_space' => 'Safe\disk_free_space', + 'disk_total_space' => 'Safe\disk_total_space', + 'dl' => 'Safe\dl', + 'dns_get_record' => 'Safe\dns_get_record', + 'eio_busy' => 'Safe\eio_busy', + 'eio_chmod' => 'Safe\eio_chmod', + 'eio_chown' => 'Safe\eio_chown', + 'eio_close' => 'Safe\eio_close', + 'eio_custom' => 'Safe\eio_custom', + 'eio_dup2' => 'Safe\eio_dup2', + 'eio_event_loop' => 'Safe\eio_event_loop', + 'eio_fallocate' => 'Safe\eio_fallocate', + 'eio_fchmod' => 'Safe\eio_fchmod', + 'eio_fchown' => 'Safe\eio_fchown', + 'eio_fdatasync' => 'Safe\eio_fdatasync', + 'eio_fstat' => 'Safe\eio_fstat', + 'eio_fstatvfs' => 'Safe\eio_fstatvfs', + 'eio_fsync' => 'Safe\eio_fsync', + 'eio_ftruncate' => 'Safe\eio_ftruncate', + 'eio_futime' => 'Safe\eio_futime', + 'eio_grp' => 'Safe\eio_grp', + 'eio_lstat' => 'Safe\eio_lstat', + 'eio_mkdir' => 'Safe\eio_mkdir', + 'eio_mknod' => 'Safe\eio_mknod', + 'eio_nop' => 'Safe\eio_nop', + 'eio_readahead' => 'Safe\eio_readahead', + 'eio_readdir' => 'Safe\eio_readdir', + 'eio_readlink' => 'Safe\eio_readlink', + 'eio_rename' => 'Safe\eio_rename', + 'eio_rmdir' => 'Safe\eio_rmdir', + 'eio_seek' => 'Safe\eio_seek', + 'eio_sendfile' => 'Safe\eio_sendfile', + 'eio_stat' => 'Safe\eio_stat', + 'eio_statvfs' => 'Safe\eio_statvfs', + 'eio_symlink' => 'Safe\eio_symlink', + 'eio_sync' => 'Safe\eio_sync', + 'eio_syncfs' => 'Safe\eio_syncfs', + 'eio_sync_file_range' => 'Safe\eio_sync_file_range', + 'eio_truncate' => 'Safe\eio_truncate', + 'eio_unlink' => 'Safe\eio_unlink', + 'eio_utime' => 'Safe\eio_utime', + 'eio_write' => 'Safe\eio_write', + 'error_log' => 'Safe\error_log', + 'exec' => 'Safe\exec', + 'fastcgi_finish_request' => 'Safe\fastcgi_finish_request', + 'fbird_blob_cancel' => 'Safe\fbird_blob_cancel', + 'fclose' => 'Safe\fclose', + 'fdatasync' => 'Safe\fdatasync', + 'fflush' => 'Safe\fflush', + 'fgetcsv' => 'Safe\fgetcsv', + 'file' => 'Safe\file', + 'fileatime' => 'Safe\fileatime', + 'filectime' => 'Safe\filectime', + 'fileinode' => 'Safe\fileinode', + 'filemtime' => 'Safe\filemtime', + 'fileowner' => 'Safe\fileowner', + 'fileperms' => 'Safe\fileperms', + 'filesize' => 'Safe\filesize', + 'file_get_contents' => 'Safe\file_get_contents', + 'file_put_contents' => 'Safe\file_put_contents', + 'filter_input_array' => 'Safe\filter_input_array', + 'filter_var_array' => 'Safe\filter_var_array', + 'finfo_close' => 'Safe\finfo_close', + 'finfo_open' => 'Safe\finfo_open', + 'flock' => 'Safe\flock', + 'fopen' => 'Safe\fopen', + 'fputcsv' => 'Safe\fputcsv', + 'fread' => 'Safe\fread', + 'fsockopen' => 'Safe\fsockopen', + 'fstat' => 'Safe\fstat', + 'fsync' => 'Safe\fsync', + 'ftp_alloc' => 'Safe\ftp_alloc', + 'ftp_append' => 'Safe\ftp_append', + 'ftp_cdup' => 'Safe\ftp_cdup', + 'ftp_chdir' => 'Safe\ftp_chdir', + 'ftp_chmod' => 'Safe\ftp_chmod', + 'ftp_close' => 'Safe\ftp_close', + 'ftp_connect' => 'Safe\ftp_connect', + 'ftp_delete' => 'Safe\ftp_delete', + 'ftp_fget' => 'Safe\ftp_fget', + 'ftp_fput' => 'Safe\ftp_fput', + 'ftp_get' => 'Safe\ftp_get', + 'ftp_login' => 'Safe\ftp_login', + 'ftp_mkdir' => 'Safe\ftp_mkdir', + 'ftp_mlsd' => 'Safe\ftp_mlsd', + 'ftp_nb_put' => 'Safe\ftp_nb_put', + 'ftp_nlist' => 'Safe\ftp_nlist', + 'ftp_pasv' => 'Safe\ftp_pasv', + 'ftp_put' => 'Safe\ftp_put', + 'ftp_pwd' => 'Safe\ftp_pwd', + 'ftp_rename' => 'Safe\ftp_rename', + 'ftp_rmdir' => 'Safe\ftp_rmdir', + 'ftp_site' => 'Safe\ftp_site', + 'ftp_ssl_connect' => 'Safe\ftp_ssl_connect', + 'ftp_systype' => 'Safe\ftp_systype', + 'ftruncate' => 'Safe\ftruncate', + 'fwrite' => 'Safe\fwrite', + 'getallheaders' => 'Safe\getallheaders', + 'getcwd' => 'Safe\getcwd', + 'gethostname' => 'Safe\gethostname', + 'getimagesize' => 'Safe\getimagesize', + 'getlastmod' => 'Safe\getlastmod', + 'getmygid' => 'Safe\getmygid', + 'getmyinode' => 'Safe\getmyinode', + 'getmypid' => 'Safe\getmypid', + 'getmyuid' => 'Safe\getmyuid', + 'getopt' => 'Safe\getopt', + 'getprotobyname' => 'Safe\getprotobyname', + 'getprotobynumber' => 'Safe\getprotobynumber', + 'getrusage' => 'Safe\getrusage', + 'getservbyport' => 'Safe\getservbyport', + 'get_headers' => 'Safe\get_headers', + 'get_include_path' => 'Safe\get_include_path', + 'get_meta_tags' => 'Safe\get_meta_tags', + 'glob' => 'Safe\glob', + 'gmmktime' => 'Safe\gmmktime', + 'gmp_random_seed' => 'Safe\gmp_random_seed', + 'gmstrftime' => 'Safe\gmstrftime', + 'gnupg_adddecryptkey' => 'Safe\gnupg_adddecryptkey', + 'gnupg_addencryptkey' => 'Safe\gnupg_addencryptkey', + 'gnupg_addsignkey' => 'Safe\gnupg_addsignkey', + 'gnupg_cleardecryptkeys' => 'Safe\gnupg_cleardecryptkeys', + 'gnupg_clearencryptkeys' => 'Safe\gnupg_clearencryptkeys', + 'gnupg_clearsignkeys' => 'Safe\gnupg_clearsignkeys', + 'gnupg_setarmor' => 'Safe\gnupg_setarmor', + 'gnupg_setsignmode' => 'Safe\gnupg_setsignmode', + 'gzclose' => 'Safe\gzclose', + 'gzcompress' => 'Safe\gzcompress', + 'gzdecode' => 'Safe\gzdecode', + 'gzdeflate' => 'Safe\gzdeflate', + 'gzencode' => 'Safe\gzencode', + 'gzfile' => 'Safe\gzfile', + 'gzgets' => 'Safe\gzgets', + 'gzgetss' => 'Safe\gzgetss', + 'gzinflate' => 'Safe\gzinflate', + 'gzopen' => 'Safe\gzopen', + 'gzpassthru' => 'Safe\gzpassthru', + 'gzread' => 'Safe\gzread', + 'gzrewind' => 'Safe\gzrewind', + 'gzuncompress' => 'Safe\gzuncompress', + 'gzwrite' => 'Safe\gzwrite', + 'hash_hkdf' => 'Safe\hash_hkdf', + 'hash_update_file' => 'Safe\hash_update_file', + 'header_register_callback' => 'Safe\header_register_callback', + 'hex2bin' => 'Safe\hex2bin', + 'highlight_file' => 'Safe\highlight_file', + 'highlight_string' => 'Safe\highlight_string', + 'hrtime' => 'Safe\hrtime', + 'ibase_add_user' => 'Safe\ibase_add_user', + 'ibase_backup' => 'Safe\ibase_backup', + 'ibase_blob_cancel' => 'Safe\ibase_blob_cancel', + 'ibase_blob_create' => 'Safe\ibase_blob_create', + 'ibase_blob_get' => 'Safe\ibase_blob_get', + 'ibase_close' => 'Safe\ibase_close', + 'ibase_commit' => 'Safe\ibase_commit', + 'ibase_commit_ret' => 'Safe\ibase_commit_ret', + 'ibase_connect' => 'Safe\ibase_connect', + 'ibase_delete_user' => 'Safe\ibase_delete_user', + 'ibase_drop_db' => 'Safe\ibase_drop_db', + 'ibase_free_event_handler' => 'Safe\ibase_free_event_handler', + 'ibase_free_query' => 'Safe\ibase_free_query', + 'ibase_free_result' => 'Safe\ibase_free_result', + 'ibase_maintain_db' => 'Safe\ibase_maintain_db', + 'ibase_modify_user' => 'Safe\ibase_modify_user', + 'ibase_name_result' => 'Safe\ibase_name_result', + 'ibase_pconnect' => 'Safe\ibase_pconnect', + 'ibase_restore' => 'Safe\ibase_restore', + 'ibase_rollback' => 'Safe\ibase_rollback', + 'ibase_rollback_ret' => 'Safe\ibase_rollback_ret', + 'ibase_service_attach' => 'Safe\ibase_service_attach', + 'ibase_service_detach' => 'Safe\ibase_service_detach', + 'iconv' => 'Safe\iconv', + 'iconv_get_encoding' => 'Safe\iconv_get_encoding', + 'iconv_set_encoding' => 'Safe\iconv_set_encoding', + 'idate' => 'Safe\idate', + 'image2wbmp' => 'Safe\image2wbmp', + 'imageaffine' => 'Safe\imageaffine', + 'imageaffinematrixconcat' => 'Safe\imageaffinematrixconcat', + 'imageaffinematrixget' => 'Safe\imageaffinematrixget', + 'imagealphablending' => 'Safe\imagealphablending', + 'imageantialias' => 'Safe\imageantialias', + 'imagearc' => 'Safe\imagearc', + 'imageavif' => 'Safe\imageavif', + 'imagebmp' => 'Safe\imagebmp', + 'imagechar' => 'Safe\imagechar', + 'imagecharup' => 'Safe\imagecharup', + 'imagecolorat' => 'Safe\imagecolorat', + 'imagecolordeallocate' => 'Safe\imagecolordeallocate', + 'imagecolormatch' => 'Safe\imagecolormatch', + 'imagecolorset' => 'Safe\imagecolorset', + 'imagecolorsforindex' => 'Safe\imagecolorsforindex', + 'imageconvolution' => 'Safe\imageconvolution', + 'imagecopy' => 'Safe\imagecopy', + 'imagecopymerge' => 'Safe\imagecopymerge', + 'imagecopymergegray' => 'Safe\imagecopymergegray', + 'imagecopyresampled' => 'Safe\imagecopyresampled', + 'imagecopyresized' => 'Safe\imagecopyresized', + 'imagecreate' => 'Safe\imagecreate', + 'imagecreatefromavif' => 'Safe\imagecreatefromavif', + 'imagecreatefrombmp' => 'Safe\imagecreatefrombmp', + 'imagecreatefromgd' => 'Safe\imagecreatefromgd', + 'imagecreatefromgd2' => 'Safe\imagecreatefromgd2', + 'imagecreatefromgd2part' => 'Safe\imagecreatefromgd2part', + 'imagecreatefromgif' => 'Safe\imagecreatefromgif', + 'imagecreatefromjpeg' => 'Safe\imagecreatefromjpeg', + 'imagecreatefrompng' => 'Safe\imagecreatefrompng', + 'imagecreatefromstring' => 'Safe\imagecreatefromstring', + 'imagecreatefromtga' => 'Safe\imagecreatefromtga', + 'imagecreatefromwbmp' => 'Safe\imagecreatefromwbmp', + 'imagecreatefromwebp' => 'Safe\imagecreatefromwebp', + 'imagecreatefromxbm' => 'Safe\imagecreatefromxbm', + 'imagecreatefromxpm' => 'Safe\imagecreatefromxpm', + 'imagecreatetruecolor' => 'Safe\imagecreatetruecolor', + 'imagecrop' => 'Safe\imagecrop', + 'imagecropauto' => 'Safe\imagecropauto', + 'imagedashedline' => 'Safe\imagedashedline', + 'imagedestroy' => 'Safe\imagedestroy', + 'imageellipse' => 'Safe\imageellipse', + 'imagefill' => 'Safe\imagefill', + 'imagefilledarc' => 'Safe\imagefilledarc', + 'imagefilledellipse' => 'Safe\imagefilledellipse', + 'imagefilledrectangle' => 'Safe\imagefilledrectangle', + 'imagefilltoborder' => 'Safe\imagefilltoborder', + 'imagefilter' => 'Safe\imagefilter', + 'imageflip' => 'Safe\imageflip', + 'imageftbbox' => 'Safe\imageftbbox', + 'imagefttext' => 'Safe\imagefttext', + 'imagegammacorrect' => 'Safe\imagegammacorrect', + 'imagegd' => 'Safe\imagegd', + 'imagegd2' => 'Safe\imagegd2', + 'imagegif' => 'Safe\imagegif', + 'imagegrabscreen' => 'Safe\imagegrabscreen', + 'imagegrabwindow' => 'Safe\imagegrabwindow', + 'imagejpeg' => 'Safe\imagejpeg', + 'imagelayereffect' => 'Safe\imagelayereffect', + 'imageline' => 'Safe\imageline', + 'imageloadfont' => 'Safe\imageloadfont', + 'imagepng' => 'Safe\imagepng', + 'imagerectangle' => 'Safe\imagerectangle', + 'imageresolution' => 'Safe\imageresolution', + 'imagerotate' => 'Safe\imagerotate', + 'imagesavealpha' => 'Safe\imagesavealpha', + 'imagescale' => 'Safe\imagescale', + 'imagesetbrush' => 'Safe\imagesetbrush', + 'imagesetclip' => 'Safe\imagesetclip', + 'imagesetinterpolation' => 'Safe\imagesetinterpolation', + 'imagesetpixel' => 'Safe\imagesetpixel', + 'imagesetstyle' => 'Safe\imagesetstyle', + 'imagesetthickness' => 'Safe\imagesetthickness', + 'imagesettile' => 'Safe\imagesettile', + 'imagestring' => 'Safe\imagestring', + 'imagestringup' => 'Safe\imagestringup', + 'imagesx' => 'Safe\imagesx', + 'imagesy' => 'Safe\imagesy', + 'imagetruecolortopalette' => 'Safe\imagetruecolortopalette', + 'imagettfbbox' => 'Safe\imagettfbbox', + 'imagettftext' => 'Safe\imagettftext', + 'imagewbmp' => 'Safe\imagewbmp', + 'imagewebp' => 'Safe\imagewebp', + 'imagexbm' => 'Safe\imagexbm', + 'image_type_to_extension' => 'Safe\image_type_to_extension', + 'imap_8bit' => 'Safe\imap_8bit', + 'imap_append' => 'Safe\imap_append', + 'imap_base64' => 'Safe\imap_base64', + 'imap_binary' => 'Safe\imap_binary', + 'imap_body' => 'Safe\imap_body', + 'imap_bodystruct' => 'Safe\imap_bodystruct', + 'imap_check' => 'Safe\imap_check', + 'imap_clearflag_full' => 'Safe\imap_clearflag_full', + 'imap_close' => 'Safe\imap_close', + 'imap_createmailbox' => 'Safe\imap_createmailbox', + 'imap_deletemailbox' => 'Safe\imap_deletemailbox', + 'imap_fetchbody' => 'Safe\imap_fetchbody', + 'imap_fetchheader' => 'Safe\imap_fetchheader', + 'imap_fetchmime' => 'Safe\imap_fetchmime', + 'imap_fetchstructure' => 'Safe\imap_fetchstructure', + 'imap_fetch_overview' => 'Safe\imap_fetch_overview', + 'imap_gc' => 'Safe\imap_gc', + 'imap_getacl' => 'Safe\imap_getacl', + 'imap_getmailboxes' => 'Safe\imap_getmailboxes', + 'imap_getsubscribed' => 'Safe\imap_getsubscribed', + 'imap_headerinfo' => 'Safe\imap_headerinfo', + 'imap_headers' => 'Safe\imap_headers', + 'imap_listscan' => 'Safe\imap_listscan', + 'imap_lsub' => 'Safe\imap_lsub', + 'imap_mail' => 'Safe\imap_mail', + 'imap_mailboxmsginfo' => 'Safe\imap_mailboxmsginfo', + 'imap_mail_compose' => 'Safe\imap_mail_compose', + 'imap_mail_copy' => 'Safe\imap_mail_copy', + 'imap_mail_move' => 'Safe\imap_mail_move', + 'imap_mime_header_decode' => 'Safe\imap_mime_header_decode', + 'imap_mutf7_to_utf8' => 'Safe\imap_mutf7_to_utf8', + 'imap_num_msg' => 'Safe\imap_num_msg', + 'imap_open' => 'Safe\imap_open', + 'imap_qprint' => 'Safe\imap_qprint', + 'imap_renamemailbox' => 'Safe\imap_renamemailbox', + 'imap_rfc822_write_address' => 'Safe\imap_rfc822_write_address', + 'imap_savebody' => 'Safe\imap_savebody', + 'imap_setacl' => 'Safe\imap_setacl', + 'imap_setflag_full' => 'Safe\imap_setflag_full', + 'imap_set_quota' => 'Safe\imap_set_quota', + 'imap_sort' => 'Safe\imap_sort', + 'imap_status' => 'Safe\imap_status', + 'imap_subscribe' => 'Safe\imap_subscribe', + 'imap_thread' => 'Safe\imap_thread', + 'imap_timeout' => 'Safe\imap_timeout', + 'imap_undelete' => 'Safe\imap_undelete', + 'imap_unsubscribe' => 'Safe\imap_unsubscribe', + 'imap_utf8_to_mutf7' => 'Safe\imap_utf8_to_mutf7', + 'inet_ntop' => 'Safe\inet_ntop', + 'inet_pton' => 'Safe\inet_pton', + 'inflate_add' => 'Safe\inflate_add', + 'inflate_get_read_len' => 'Safe\inflate_get_read_len', + 'inflate_get_status' => 'Safe\inflate_get_status', + 'inflate_init' => 'Safe\inflate_init', + 'ini_get' => 'Safe\ini_get', + 'ini_set' => 'Safe\ini_set', + 'inotify_init' => 'Safe\inotify_init', + 'inotify_rm_watch' => 'Safe\inotify_rm_watch', + 'iptcembed' => 'Safe\iptcembed', + 'iptcparse' => 'Safe\iptcparse', + 'jpeg2wbmp' => 'Safe\jpeg2wbmp', + 'json_decode' => 'Safe\json_decode', + 'json_encode' => 'Safe\json_encode', + 'lchgrp' => 'Safe\lchgrp', + 'lchown' => 'Safe\lchown', + 'ldap_8859_to_t61' => 'Safe\ldap_8859_to_t61', + 'ldap_add' => 'Safe\ldap_add', + 'ldap_bind' => 'Safe\ldap_bind', + 'ldap_control_paged_result' => 'Safe\ldap_control_paged_result', + 'ldap_control_paged_result_response' => 'Safe\ldap_control_paged_result_response', + 'ldap_count_entries' => 'Safe\ldap_count_entries', + 'ldap_delete' => 'Safe\ldap_delete', + 'ldap_dn2ufn' => 'Safe\ldap_dn2ufn', + 'ldap_exop' => 'Safe\ldap_exop', + 'ldap_exop_passwd' => 'Safe\ldap_exop_passwd', + 'ldap_exop_whoami' => 'Safe\ldap_exop_whoami', + 'ldap_explode_dn' => 'Safe\ldap_explode_dn', + 'ldap_first_attribute' => 'Safe\ldap_first_attribute', + 'ldap_first_entry' => 'Safe\ldap_first_entry', + 'ldap_free_result' => 'Safe\ldap_free_result', + 'ldap_get_attributes' => 'Safe\ldap_get_attributes', + 'ldap_get_dn' => 'Safe\ldap_get_dn', + 'ldap_get_entries' => 'Safe\ldap_get_entries', + 'ldap_get_option' => 'Safe\ldap_get_option', + 'ldap_get_values' => 'Safe\ldap_get_values', + 'ldap_get_values_len' => 'Safe\ldap_get_values_len', + 'ldap_modify_batch' => 'Safe\ldap_modify_batch', + 'ldap_mod_add' => 'Safe\ldap_mod_add', + 'ldap_mod_del' => 'Safe\ldap_mod_del', + 'ldap_mod_replace' => 'Safe\ldap_mod_replace', + 'ldap_next_attribute' => 'Safe\ldap_next_attribute', + 'ldap_parse_exop' => 'Safe\ldap_parse_exop', + 'ldap_parse_result' => 'Safe\ldap_parse_result', + 'ldap_rename' => 'Safe\ldap_rename', + 'ldap_sasl_bind' => 'Safe\ldap_sasl_bind', + 'ldap_set_option' => 'Safe\ldap_set_option', + 'ldap_unbind' => 'Safe\ldap_unbind', + 'libxml_get_last_error' => 'Safe\libxml_get_last_error', + 'libxml_set_external_entity_loader' => 'Safe\libxml_set_external_entity_loader', + 'link' => 'Safe\link', + 'long2ip' => 'Safe\long2ip', + 'lstat' => 'Safe\lstat', + 'lzf_compress' => 'Safe\lzf_compress', + 'lzf_decompress' => 'Safe\lzf_decompress', + 'mailparse_msg_extract_part_file' => 'Safe\mailparse_msg_extract_part_file', + 'mailparse_msg_free' => 'Safe\mailparse_msg_free', + 'mailparse_msg_parse' => 'Safe\mailparse_msg_parse', + 'mailparse_msg_parse_file' => 'Safe\mailparse_msg_parse_file', + 'mailparse_stream_encode' => 'Safe\mailparse_stream_encode', + 'mb_chr' => 'Safe\mb_chr', + 'mb_convert_encoding' => 'Safe\mb_convert_encoding', + 'mb_detect_order' => 'Safe\mb_detect_order', + 'mb_encoding_aliases' => 'Safe\mb_encoding_aliases', + 'mb_eregi_replace' => 'Safe\mb_eregi_replace', + 'mb_ereg_replace' => 'Safe\mb_ereg_replace', + 'mb_ereg_replace_callback' => 'Safe\mb_ereg_replace_callback', + 'mb_ereg_search_getregs' => 'Safe\mb_ereg_search_getregs', + 'mb_ereg_search_init' => 'Safe\mb_ereg_search_init', + 'mb_ereg_search_regs' => 'Safe\mb_ereg_search_regs', + 'mb_ereg_search_setpos' => 'Safe\mb_ereg_search_setpos', + 'mb_get_info' => 'Safe\mb_get_info', + 'mb_http_output' => 'Safe\mb_http_output', + 'mb_internal_encoding' => 'Safe\mb_internal_encoding', + 'mb_ord' => 'Safe\mb_ord', + 'mb_parse_str' => 'Safe\mb_parse_str', + 'mb_regex_encoding' => 'Safe\mb_regex_encoding', + 'mb_send_mail' => 'Safe\mb_send_mail', + 'mb_split' => 'Safe\mb_split', + 'md5_file' => 'Safe\md5_file', + 'mime_content_type' => 'Safe\mime_content_type', + 'mkdir' => 'Safe\mkdir', + 'mktime' => 'Safe\mktime', + 'msg_get_queue' => 'Safe\msg_get_queue', + 'msg_queue_exists' => 'Safe\msg_queue_exists', + 'msg_receive' => 'Safe\msg_receive', + 'msg_remove_queue' => 'Safe\msg_remove_queue', + 'msg_send' => 'Safe\msg_send', + 'msg_set_queue' => 'Safe\msg_set_queue', + 'msg_stat_queue' => 'Safe\msg_stat_queue', + 'mysqli_get_client_stats' => 'Safe\mysqli_get_client_stats', + 'mysql_close' => 'Safe\mysql_close', + 'mysql_connect' => 'Safe\mysql_connect', + 'mysql_create_db' => 'Safe\mysql_create_db', + 'mysql_data_seek' => 'Safe\mysql_data_seek', + 'mysql_db_name' => 'Safe\mysql_db_name', + 'mysql_db_query' => 'Safe\mysql_db_query', + 'mysql_drop_db' => 'Safe\mysql_drop_db', + 'mysql_fetch_lengths' => 'Safe\mysql_fetch_lengths', + 'mysql_field_flags' => 'Safe\mysql_field_flags', + 'mysql_field_len' => 'Safe\mysql_field_len', + 'mysql_field_name' => 'Safe\mysql_field_name', + 'mysql_field_seek' => 'Safe\mysql_field_seek', + 'mysql_free_result' => 'Safe\mysql_free_result', + 'mysql_get_host_info' => 'Safe\mysql_get_host_info', + 'mysql_get_proto_info' => 'Safe\mysql_get_proto_info', + 'mysql_get_server_info' => 'Safe\mysql_get_server_info', + 'mysql_info' => 'Safe\mysql_info', + 'mysql_list_dbs' => 'Safe\mysql_list_dbs', + 'mysql_list_fields' => 'Safe\mysql_list_fields', + 'mysql_list_processes' => 'Safe\mysql_list_processes', + 'mysql_list_tables' => 'Safe\mysql_list_tables', + 'mysql_num_fields' => 'Safe\mysql_num_fields', + 'mysql_num_rows' => 'Safe\mysql_num_rows', + 'mysql_query' => 'Safe\mysql_query', + 'mysql_real_escape_string' => 'Safe\mysql_real_escape_string', + 'mysql_result' => 'Safe\mysql_result', + 'mysql_select_db' => 'Safe\mysql_select_db', + 'mysql_set_charset' => 'Safe\mysql_set_charset', + 'mysql_tablename' => 'Safe\mysql_tablename', + 'mysql_thread_id' => 'Safe\mysql_thread_id', + 'mysql_unbuffered_query' => 'Safe\mysql_unbuffered_query', + 'ob_clean' => 'Safe\ob_clean', + 'ob_end_clean' => 'Safe\ob_end_clean', + 'ob_end_flush' => 'Safe\ob_end_flush', + 'ob_flush' => 'Safe\ob_flush', + 'ob_start' => 'Safe\ob_start', + 'oci_bind_array_by_name' => 'Safe\oci_bind_array_by_name', + 'oci_bind_by_name' => 'Safe\oci_bind_by_name', + 'oci_cancel' => 'Safe\oci_cancel', + 'oci_commit' => 'Safe\oci_commit', + 'oci_connect' => 'Safe\oci_connect', + 'oci_define_by_name' => 'Safe\oci_define_by_name', + 'oci_execute' => 'Safe\oci_execute', + 'oci_field_name' => 'Safe\oci_field_name', + 'oci_field_precision' => 'Safe\oci_field_precision', + 'oci_field_scale' => 'Safe\oci_field_scale', + 'oci_field_size' => 'Safe\oci_field_size', + 'oci_field_type' => 'Safe\oci_field_type', + 'oci_field_type_raw' => 'Safe\oci_field_type_raw', + 'oci_free_descriptor' => 'Safe\oci_free_descriptor', + 'oci_free_statement' => 'Safe\oci_free_statement', + 'oci_new_collection' => 'Safe\oci_new_collection', + 'oci_new_connect' => 'Safe\oci_new_connect', + 'oci_new_cursor' => 'Safe\oci_new_cursor', + 'oci_new_descriptor' => 'Safe\oci_new_descriptor', + 'oci_num_rows' => 'Safe\oci_num_rows', + 'oci_parse' => 'Safe\oci_parse', + 'oci_pconnect' => 'Safe\oci_pconnect', + 'oci_register_taf_callback' => 'Safe\oci_register_taf_callback', + 'oci_result' => 'Safe\oci_result', + 'oci_rollback' => 'Safe\oci_rollback', + 'oci_server_version' => 'Safe\oci_server_version', + 'oci_set_action' => 'Safe\oci_set_action', + 'oci_set_call_timeout' => 'Safe\oci_set_call_timeout', + 'oci_set_client_identifier' => 'Safe\oci_set_client_identifier', + 'oci_set_client_info' => 'Safe\oci_set_client_info', + 'oci_set_db_operation' => 'Safe\oci_set_db_operation', + 'oci_set_edition' => 'Safe\oci_set_edition', + 'oci_set_module_name' => 'Safe\oci_set_module_name', + 'oci_set_prefetch' => 'Safe\oci_set_prefetch', + 'oci_statement_type' => 'Safe\oci_statement_type', + 'oci_unregister_taf_callback' => 'Safe\oci_unregister_taf_callback', + 'odbc_autocommit' => 'Safe\odbc_autocommit', + 'odbc_binmode' => 'Safe\odbc_binmode', + 'odbc_columnprivileges' => 'Safe\odbc_columnprivileges', + 'odbc_columns' => 'Safe\odbc_columns', + 'odbc_commit' => 'Safe\odbc_commit', + 'odbc_connect' => 'Safe\odbc_connect', + 'odbc_cursor' => 'Safe\odbc_cursor', + 'odbc_data_source' => 'Safe\odbc_data_source', + 'odbc_exec' => 'Safe\odbc_exec', + 'odbc_execute' => 'Safe\odbc_execute', + 'odbc_fetch_into' => 'Safe\odbc_fetch_into', + 'odbc_field_len' => 'Safe\odbc_field_len', + 'odbc_field_name' => 'Safe\odbc_field_name', + 'odbc_field_num' => 'Safe\odbc_field_num', + 'odbc_field_scale' => 'Safe\odbc_field_scale', + 'odbc_field_type' => 'Safe\odbc_field_type', + 'odbc_foreignkeys' => 'Safe\odbc_foreignkeys', + 'odbc_gettypeinfo' => 'Safe\odbc_gettypeinfo', + 'odbc_longreadlen' => 'Safe\odbc_longreadlen', + 'odbc_pconnect' => 'Safe\odbc_pconnect', + 'odbc_prepare' => 'Safe\odbc_prepare', + 'odbc_primarykeys' => 'Safe\odbc_primarykeys', + 'odbc_procedurecolumns' => 'Safe\odbc_procedurecolumns', + 'odbc_procedures' => 'Safe\odbc_procedures', + 'odbc_result' => 'Safe\odbc_result', + 'odbc_result_all' => 'Safe\odbc_result_all', + 'odbc_rollback' => 'Safe\odbc_rollback', + 'odbc_setoption' => 'Safe\odbc_setoption', + 'odbc_specialcolumns' => 'Safe\odbc_specialcolumns', + 'odbc_statistics' => 'Safe\odbc_statistics', + 'odbc_tableprivileges' => 'Safe\odbc_tableprivileges', + 'odbc_tables' => 'Safe\odbc_tables', + 'opcache_compile_file' => 'Safe\opcache_compile_file', + 'opcache_get_status' => 'Safe\opcache_get_status', + 'opendir' => 'Safe\opendir', + 'openlog' => 'Safe\openlog', + 'openssl_cipher_iv_length' => 'Safe\openssl_cipher_iv_length', + 'openssl_cms_decrypt' => 'Safe\openssl_cms_decrypt', + 'openssl_cms_encrypt' => 'Safe\openssl_cms_encrypt', + 'openssl_cms_read' => 'Safe\openssl_cms_read', + 'openssl_cms_sign' => 'Safe\openssl_cms_sign', + 'openssl_cms_verify' => 'Safe\openssl_cms_verify', + 'openssl_csr_export' => 'Safe\openssl_csr_export', + 'openssl_csr_export_to_file' => 'Safe\openssl_csr_export_to_file', + 'openssl_csr_get_public_key' => 'Safe\openssl_csr_get_public_key', + 'openssl_csr_get_subject' => 'Safe\openssl_csr_get_subject', + 'openssl_csr_new' => 'Safe\openssl_csr_new', + 'openssl_csr_sign' => 'Safe\openssl_csr_sign', + 'openssl_decrypt' => 'Safe\openssl_decrypt', + 'openssl_dh_compute_key' => 'Safe\openssl_dh_compute_key', + 'openssl_digest' => 'Safe\openssl_digest', + 'openssl_encrypt' => 'Safe\openssl_encrypt', + 'openssl_get_curve_names' => 'Safe\openssl_get_curve_names', + 'openssl_open' => 'Safe\openssl_open', + 'openssl_pbkdf2' => 'Safe\openssl_pbkdf2', + 'openssl_pkcs7_decrypt' => 'Safe\openssl_pkcs7_decrypt', + 'openssl_pkcs7_encrypt' => 'Safe\openssl_pkcs7_encrypt', + 'openssl_pkcs7_read' => 'Safe\openssl_pkcs7_read', + 'openssl_pkcs7_sign' => 'Safe\openssl_pkcs7_sign', + 'openssl_pkcs12_export' => 'Safe\openssl_pkcs12_export', + 'openssl_pkcs12_export_to_file' => 'Safe\openssl_pkcs12_export_to_file', + 'openssl_pkcs12_read' => 'Safe\openssl_pkcs12_read', + 'openssl_pkey_derive' => 'Safe\openssl_pkey_derive', + 'openssl_pkey_export' => 'Safe\openssl_pkey_export', + 'openssl_pkey_export_to_file' => 'Safe\openssl_pkey_export_to_file', + 'openssl_pkey_get_private' => 'Safe\openssl_pkey_get_private', + 'openssl_pkey_get_public' => 'Safe\openssl_pkey_get_public', + 'openssl_pkey_new' => 'Safe\openssl_pkey_new', + 'openssl_private_decrypt' => 'Safe\openssl_private_decrypt', + 'openssl_private_encrypt' => 'Safe\openssl_private_encrypt', + 'openssl_public_decrypt' => 'Safe\openssl_public_decrypt', + 'openssl_public_encrypt' => 'Safe\openssl_public_encrypt', + 'openssl_random_pseudo_bytes' => 'Safe\openssl_random_pseudo_bytes', + 'openssl_seal' => 'Safe\openssl_seal', + 'openssl_sign' => 'Safe\openssl_sign', + 'openssl_spki_export' => 'Safe\openssl_spki_export', + 'openssl_spki_export_challenge' => 'Safe\openssl_spki_export_challenge', + 'openssl_spki_new' => 'Safe\openssl_spki_new', + 'openssl_spki_verify' => 'Safe\openssl_spki_verify', + 'openssl_verify' => 'Safe\openssl_verify', + 'openssl_x509_export' => 'Safe\openssl_x509_export', + 'openssl_x509_export_to_file' => 'Safe\openssl_x509_export_to_file', + 'openssl_x509_fingerprint' => 'Safe\openssl_x509_fingerprint', + 'openssl_x509_read' => 'Safe\openssl_x509_read', + 'output_add_rewrite_var' => 'Safe\output_add_rewrite_var', + 'output_reset_rewrite_vars' => 'Safe\output_reset_rewrite_vars', + 'pack' => 'Safe\pack', + 'parse_ini_file' => 'Safe\parse_ini_file', + 'parse_ini_string' => 'Safe\parse_ini_string', + 'parse_url' => 'Safe\parse_url', + 'pcntl_getpriority' => 'Safe\pcntl_getpriority', + 'pcntl_setpriority' => 'Safe\pcntl_setpriority', + 'pcntl_signal' => 'Safe\pcntl_signal', + 'pcntl_signal_dispatch' => 'Safe\pcntl_signal_dispatch', + 'pcntl_sigprocmask' => 'Safe\pcntl_sigprocmask', + 'pcntl_sigtimedwait' => 'Safe\pcntl_sigtimedwait', + 'pcntl_sigwaitinfo' => 'Safe\pcntl_sigwaitinfo', + 'pfsockopen' => 'Safe\pfsockopen', + 'pg_cancel_query' => 'Safe\pg_cancel_query', + 'pg_connect' => 'Safe\pg_connect', + 'pg_connection_reset' => 'Safe\pg_connection_reset', + 'pg_convert' => 'Safe\pg_convert', + 'pg_copy_from' => 'Safe\pg_copy_from', + 'pg_copy_to' => 'Safe\pg_copy_to', + 'pg_delete' => 'Safe\pg_delete', + 'pg_end_copy' => 'Safe\pg_end_copy', + 'pg_execute' => 'Safe\pg_execute', + 'pg_field_table' => 'Safe\pg_field_table', + 'pg_flush' => 'Safe\pg_flush', + 'pg_free_result' => 'Safe\pg_free_result', + 'pg_host' => 'Safe\pg_host', + 'pg_insert' => 'Safe\pg_insert', + 'pg_last_oid' => 'Safe\pg_last_oid', + 'pg_lo_close' => 'Safe\pg_lo_close', + 'pg_lo_export' => 'Safe\pg_lo_export', + 'pg_lo_import' => 'Safe\pg_lo_import', + 'pg_lo_open' => 'Safe\pg_lo_open', + 'pg_lo_read' => 'Safe\pg_lo_read', + 'pg_lo_seek' => 'Safe\pg_lo_seek', + 'pg_lo_truncate' => 'Safe\pg_lo_truncate', + 'pg_lo_unlink' => 'Safe\pg_lo_unlink', + 'pg_lo_write' => 'Safe\pg_lo_write', + 'pg_meta_data' => 'Safe\pg_meta_data', + 'pg_parameter_status' => 'Safe\pg_parameter_status', + 'pg_pconnect' => 'Safe\pg_pconnect', + 'pg_ping' => 'Safe\pg_ping', + 'pg_prepare' => 'Safe\pg_prepare', + 'pg_put_line' => 'Safe\pg_put_line', + 'pg_query' => 'Safe\pg_query', + 'pg_query_params' => 'Safe\pg_query_params', + 'pg_result_error_field' => 'Safe\pg_result_error_field', + 'pg_result_seek' => 'Safe\pg_result_seek', + 'pg_select' => 'Safe\pg_select', + 'pg_socket' => 'Safe\pg_socket', + 'pg_trace' => 'Safe\pg_trace', + 'pg_update' => 'Safe\pg_update', + 'phpcredits' => 'Safe\phpcredits', + 'phpinfo' => 'Safe\phpinfo', + 'php_sapi_name' => 'Safe\php_sapi_name', + 'png2wbmp' => 'Safe\png2wbmp', + 'posix_access' => 'Safe\posix_access', + 'posix_getgrgid' => 'Safe\posix_getgrgid', + 'posix_getgrnam' => 'Safe\posix_getgrnam', + 'posix_getgroups' => 'Safe\posix_getgroups', + 'posix_getlogin' => 'Safe\posix_getlogin', + 'posix_getpwuid' => 'Safe\posix_getpwuid', + 'posix_getrlimit' => 'Safe\posix_getrlimit', + 'posix_getsid' => 'Safe\posix_getsid', + 'posix_initgroups' => 'Safe\posix_initgroups', + 'posix_kill' => 'Safe\posix_kill', + 'posix_mkfifo' => 'Safe\posix_mkfifo', + 'posix_mknod' => 'Safe\posix_mknod', + 'posix_setegid' => 'Safe\posix_setegid', + 'posix_seteuid' => 'Safe\posix_seteuid', + 'posix_setgid' => 'Safe\posix_setgid', + 'posix_setpgid' => 'Safe\posix_setpgid', + 'posix_setrlimit' => 'Safe\posix_setrlimit', + 'posix_setuid' => 'Safe\posix_setuid', + 'posix_times' => 'Safe\posix_times', + 'posix_uname' => 'Safe\posix_uname', + 'preg_grep' => 'Safe\preg_grep', + 'preg_match' => 'Safe\preg_match', + 'preg_match_all' => 'Safe\preg_match_all', + 'preg_replace' => 'Safe\preg_replace', + 'preg_split' => 'Safe\preg_split', + 'proc_nice' => 'Safe\proc_nice', + 'pspell_add_to_personal' => 'Safe\pspell_add_to_personal', + 'pspell_add_to_session' => 'Safe\pspell_add_to_session', + 'pspell_clear_session' => 'Safe\pspell_clear_session', + 'pspell_config_create' => 'Safe\pspell_config_create', + 'pspell_config_data_dir' => 'Safe\pspell_config_data_dir', + 'pspell_config_dict_dir' => 'Safe\pspell_config_dict_dir', + 'pspell_config_ignore' => 'Safe\pspell_config_ignore', + 'pspell_config_mode' => 'Safe\pspell_config_mode', + 'pspell_config_personal' => 'Safe\pspell_config_personal', + 'pspell_config_repl' => 'Safe\pspell_config_repl', + 'pspell_config_runtogether' => 'Safe\pspell_config_runtogether', + 'pspell_config_save_repl' => 'Safe\pspell_config_save_repl', + 'pspell_new' => 'Safe\pspell_new', + 'pspell_new_config' => 'Safe\pspell_new_config', + 'pspell_new_personal' => 'Safe\pspell_new_personal', + 'pspell_save_wordlist' => 'Safe\pspell_save_wordlist', + 'pspell_store_replacement' => 'Safe\pspell_store_replacement', + 'ps_add_launchlink' => 'Safe\ps_add_launchlink', + 'ps_add_locallink' => 'Safe\ps_add_locallink', + 'ps_add_note' => 'Safe\ps_add_note', + 'ps_add_pdflink' => 'Safe\ps_add_pdflink', + 'ps_add_weblink' => 'Safe\ps_add_weblink', + 'ps_arc' => 'Safe\ps_arc', + 'ps_arcn' => 'Safe\ps_arcn', + 'ps_begin_page' => 'Safe\ps_begin_page', + 'ps_begin_pattern' => 'Safe\ps_begin_pattern', + 'ps_begin_template' => 'Safe\ps_begin_template', + 'ps_circle' => 'Safe\ps_circle', + 'ps_clip' => 'Safe\ps_clip', + 'ps_close' => 'Safe\ps_close', + 'ps_closepath' => 'Safe\ps_closepath', + 'ps_closepath_stroke' => 'Safe\ps_closepath_stroke', + 'ps_close_image' => 'Safe\ps_close_image', + 'ps_continue_text' => 'Safe\ps_continue_text', + 'ps_curveto' => 'Safe\ps_curveto', + 'ps_delete' => 'Safe\ps_delete', + 'ps_end_page' => 'Safe\ps_end_page', + 'ps_end_pattern' => 'Safe\ps_end_pattern', + 'ps_end_template' => 'Safe\ps_end_template', + 'ps_fill' => 'Safe\ps_fill', + 'ps_fill_stroke' => 'Safe\ps_fill_stroke', + 'ps_get_parameter' => 'Safe\ps_get_parameter', + 'ps_hyphenate' => 'Safe\ps_hyphenate', + 'ps_include_file' => 'Safe\ps_include_file', + 'ps_lineto' => 'Safe\ps_lineto', + 'ps_moveto' => 'Safe\ps_moveto', + 'ps_new' => 'Safe\ps_new', + 'ps_open_file' => 'Safe\ps_open_file', + 'ps_place_image' => 'Safe\ps_place_image', + 'ps_rect' => 'Safe\ps_rect', + 'ps_restore' => 'Safe\ps_restore', + 'ps_rotate' => 'Safe\ps_rotate', + 'ps_save' => 'Safe\ps_save', + 'ps_scale' => 'Safe\ps_scale', + 'ps_setcolor' => 'Safe\ps_setcolor', + 'ps_setdash' => 'Safe\ps_setdash', + 'ps_setflat' => 'Safe\ps_setflat', + 'ps_setfont' => 'Safe\ps_setfont', + 'ps_setgray' => 'Safe\ps_setgray', + 'ps_setlinecap' => 'Safe\ps_setlinecap', + 'ps_setlinejoin' => 'Safe\ps_setlinejoin', + 'ps_setlinewidth' => 'Safe\ps_setlinewidth', + 'ps_setmiterlimit' => 'Safe\ps_setmiterlimit', + 'ps_setoverprintmode' => 'Safe\ps_setoverprintmode', + 'ps_setpolydash' => 'Safe\ps_setpolydash', + 'ps_set_border_color' => 'Safe\ps_set_border_color', + 'ps_set_border_dash' => 'Safe\ps_set_border_dash', + 'ps_set_border_style' => 'Safe\ps_set_border_style', + 'ps_set_info' => 'Safe\ps_set_info', + 'ps_set_parameter' => 'Safe\ps_set_parameter', + 'ps_set_text_pos' => 'Safe\ps_set_text_pos', + 'ps_set_value' => 'Safe\ps_set_value', + 'ps_shading' => 'Safe\ps_shading', + 'ps_shading_pattern' => 'Safe\ps_shading_pattern', + 'ps_shfill' => 'Safe\ps_shfill', + 'ps_show' => 'Safe\ps_show', + 'ps_show2' => 'Safe\ps_show2', + 'ps_show_xy' => 'Safe\ps_show_xy', + 'ps_show_xy2' => 'Safe\ps_show_xy2', + 'ps_stroke' => 'Safe\ps_stroke', + 'ps_symbol' => 'Safe\ps_symbol', + 'ps_translate' => 'Safe\ps_translate', + 'putenv' => 'Safe\putenv', + 'readfile' => 'Safe\readfile', + 'readgzfile' => 'Safe\readgzfile', + 'readline_add_history' => 'Safe\readline_add_history', + 'readline_callback_handler_install' => 'Safe\readline_callback_handler_install', + 'readline_clear_history' => 'Safe\readline_clear_history', + 'readline_completion_function' => 'Safe\readline_completion_function', + 'readline_read_history' => 'Safe\readline_read_history', + 'readline_write_history' => 'Safe\readline_write_history', + 'readlink' => 'Safe\readlink', + 'realpath' => 'Safe\realpath', + 'register_tick_function' => 'Safe\register_tick_function', + 'rename' => 'Safe\rename', + 'rewind' => 'Safe\rewind', + 'rmdir' => 'Safe\rmdir', + 'rpmaddtag' => 'Safe\rpmaddtag', + 'rrd_create' => 'Safe\rrd_create', + 'rrd_first' => 'Safe\rrd_first', + 'rrd_graph' => 'Safe\rrd_graph', + 'rrd_info' => 'Safe\rrd_info', + 'rrd_lastupdate' => 'Safe\rrd_lastupdate', + 'rrd_restore' => 'Safe\rrd_restore', + 'rrd_tune' => 'Safe\rrd_tune', + 'rrd_update' => 'Safe\rrd_update', + 'rrd_xport' => 'Safe\rrd_xport', + 'sapi_windows_cp_conv' => 'Safe\sapi_windows_cp_conv', + 'sapi_windows_cp_set' => 'Safe\sapi_windows_cp_set', + 'sapi_windows_generate_ctrl_event' => 'Safe\sapi_windows_generate_ctrl_event', + 'sapi_windows_set_ctrl_handler' => 'Safe\sapi_windows_set_ctrl_handler', + 'sapi_windows_vt100_support' => 'Safe\sapi_windows_vt100_support', + 'scandir' => 'Safe\scandir', + 'sem_acquire' => 'Safe\sem_acquire', + 'sem_get' => 'Safe\sem_get', + 'sem_release' => 'Safe\sem_release', + 'sem_remove' => 'Safe\sem_remove', + 'session_abort' => 'Safe\session_abort', + 'session_create_id' => 'Safe\session_create_id', + 'session_decode' => 'Safe\session_decode', + 'session_destroy' => 'Safe\session_destroy', + 'session_encode' => 'Safe\session_encode', + 'session_id' => 'Safe\session_id', + 'session_module_name' => 'Safe\session_module_name', + 'session_name' => 'Safe\session_name', + 'session_regenerate_id' => 'Safe\session_regenerate_id', + 'session_reset' => 'Safe\session_reset', + 'session_save_path' => 'Safe\session_save_path', + 'session_unset' => 'Safe\session_unset', + 'session_write_close' => 'Safe\session_write_close', + 'settype' => 'Safe\settype', + 'set_include_path' => 'Safe\set_include_path', + 'set_time_limit' => 'Safe\set_time_limit', + 'sha1_file' => 'Safe\sha1_file', + 'shell_exec' => 'Safe\shell_exec', + 'shmop_delete' => 'Safe\shmop_delete', + 'shmop_read' => 'Safe\shmop_read', + 'shm_attach' => 'Safe\shm_attach', + 'shm_detach' => 'Safe\shm_detach', + 'shm_put_var' => 'Safe\shm_put_var', + 'shm_remove' => 'Safe\shm_remove', + 'shm_remove_var' => 'Safe\shm_remove_var', + 'shuffle' => 'Safe\shuffle', + 'simplexml_import_dom' => 'Safe\simplexml_import_dom', + 'simplexml_load_file' => 'Safe\simplexml_load_file', + 'simplexml_load_string' => 'Safe\simplexml_load_string', + 'sleep' => 'Safe\sleep', + 'socket_accept' => 'Safe\socket_accept', + 'socket_addrinfo_bind' => 'Safe\socket_addrinfo_bind', + 'socket_addrinfo_connect' => 'Safe\socket_addrinfo_connect', + 'socket_addrinfo_lookup' => 'Safe\socket_addrinfo_lookup', + 'socket_bind' => 'Safe\socket_bind', + 'socket_connect' => 'Safe\socket_connect', + 'socket_create' => 'Safe\socket_create', + 'socket_create_listen' => 'Safe\socket_create_listen', + 'socket_create_pair' => 'Safe\socket_create_pair', + 'socket_export_stream' => 'Safe\socket_export_stream', + 'socket_getpeername' => 'Safe\socket_getpeername', + 'socket_getsockname' => 'Safe\socket_getsockname', + 'socket_get_option' => 'Safe\socket_get_option', + 'socket_import_stream' => 'Safe\socket_import_stream', + 'socket_listen' => 'Safe\socket_listen', + 'socket_read' => 'Safe\socket_read', + 'socket_send' => 'Safe\socket_send', + 'socket_sendmsg' => 'Safe\socket_sendmsg', + 'socket_sendto' => 'Safe\socket_sendto', + 'socket_set_block' => 'Safe\socket_set_block', + 'socket_set_nonblock' => 'Safe\socket_set_nonblock', + 'socket_set_option' => 'Safe\socket_set_option', + 'socket_shutdown' => 'Safe\socket_shutdown', + 'socket_write' => 'Safe\socket_write', + 'socket_wsaprotocol_info_export' => 'Safe\socket_wsaprotocol_info_export', + 'socket_wsaprotocol_info_import' => 'Safe\socket_wsaprotocol_info_import', + 'socket_wsaprotocol_info_release' => 'Safe\socket_wsaprotocol_info_release', + 'sodium_crypto_aead_aes256gcm_decrypt' => 'Safe\sodium_crypto_aead_aes256gcm_decrypt', + 'sodium_crypto_aead_chacha20poly1305_decrypt' => 'Safe\sodium_crypto_aead_chacha20poly1305_decrypt', + 'sodium_crypto_aead_chacha20poly1305_encrypt' => 'Safe\sodium_crypto_aead_chacha20poly1305_encrypt', + 'sodium_crypto_aead_chacha20poly1305_ietf_decrypt' => 'Safe\sodium_crypto_aead_chacha20poly1305_ietf_decrypt', + 'sodium_crypto_aead_chacha20poly1305_ietf_encrypt' => 'Safe\sodium_crypto_aead_chacha20poly1305_ietf_encrypt', + 'sodium_crypto_aead_xchacha20poly1305_ietf_decrypt' => 'Safe\sodium_crypto_aead_xchacha20poly1305_ietf_decrypt', + 'sodium_crypto_aead_xchacha20poly1305_ietf_encrypt' => 'Safe\sodium_crypto_aead_xchacha20poly1305_ietf_encrypt', + 'sodium_crypto_auth_verify' => 'Safe\sodium_crypto_auth_verify', + 'sodium_crypto_box_open' => 'Safe\sodium_crypto_box_open', + 'sodium_crypto_box_seal_open' => 'Safe\sodium_crypto_box_seal_open', + 'sodium_crypto_generichash_update' => 'Safe\sodium_crypto_generichash_update', + 'sodium_crypto_secretbox_open' => 'Safe\sodium_crypto_secretbox_open', + 'sodium_crypto_sign_open' => 'Safe\sodium_crypto_sign_open', + 'sodium_crypto_sign_verify_detached' => 'Safe\sodium_crypto_sign_verify_detached', + 'solr_get_version' => 'Safe\solr_get_version', + 'spl_autoload_register' => 'Safe\spl_autoload_register', + 'spl_autoload_unregister' => 'Safe\spl_autoload_unregister', + 'sqlsrv_begin_transaction' => 'Safe\sqlsrv_begin_transaction', + 'sqlsrv_cancel' => 'Safe\sqlsrv_cancel', + 'sqlsrv_client_info' => 'Safe\sqlsrv_client_info', + 'sqlsrv_close' => 'Safe\sqlsrv_close', + 'sqlsrv_commit' => 'Safe\sqlsrv_commit', + 'sqlsrv_configure' => 'Safe\sqlsrv_configure', + 'sqlsrv_execute' => 'Safe\sqlsrv_execute', + 'sqlsrv_free_stmt' => 'Safe\sqlsrv_free_stmt', + 'sqlsrv_get_field' => 'Safe\sqlsrv_get_field', + 'sqlsrv_next_result' => 'Safe\sqlsrv_next_result', + 'sqlsrv_num_fields' => 'Safe\sqlsrv_num_fields', + 'sqlsrv_num_rows' => 'Safe\sqlsrv_num_rows', + 'sqlsrv_prepare' => 'Safe\sqlsrv_prepare', + 'sqlsrv_query' => 'Safe\sqlsrv_query', + 'sqlsrv_rollback' => 'Safe\sqlsrv_rollback', + 'ssdeep_fuzzy_compare' => 'Safe\ssdeep_fuzzy_compare', + 'ssdeep_fuzzy_hash' => 'Safe\ssdeep_fuzzy_hash', + 'ssdeep_fuzzy_hash_filename' => 'Safe\ssdeep_fuzzy_hash_filename', + 'ssh2_auth_agent' => 'Safe\ssh2_auth_agent', + 'ssh2_auth_hostbased_file' => 'Safe\ssh2_auth_hostbased_file', + 'ssh2_auth_password' => 'Safe\ssh2_auth_password', + 'ssh2_auth_pubkey_file' => 'Safe\ssh2_auth_pubkey_file', + 'ssh2_connect' => 'Safe\ssh2_connect', + 'ssh2_disconnect' => 'Safe\ssh2_disconnect', + 'ssh2_exec' => 'Safe\ssh2_exec', + 'ssh2_forward_accept' => 'Safe\ssh2_forward_accept', + 'ssh2_forward_listen' => 'Safe\ssh2_forward_listen', + 'ssh2_publickey_add' => 'Safe\ssh2_publickey_add', + 'ssh2_publickey_init' => 'Safe\ssh2_publickey_init', + 'ssh2_publickey_remove' => 'Safe\ssh2_publickey_remove', + 'ssh2_scp_recv' => 'Safe\ssh2_scp_recv', + 'ssh2_scp_send' => 'Safe\ssh2_scp_send', + 'ssh2_send_eof' => 'Safe\ssh2_send_eof', + 'ssh2_sftp' => 'Safe\ssh2_sftp', + 'ssh2_sftp_chmod' => 'Safe\ssh2_sftp_chmod', + 'ssh2_sftp_mkdir' => 'Safe\ssh2_sftp_mkdir', + 'ssh2_sftp_rename' => 'Safe\ssh2_sftp_rename', + 'ssh2_sftp_rmdir' => 'Safe\ssh2_sftp_rmdir', + 'ssh2_sftp_symlink' => 'Safe\ssh2_sftp_symlink', + 'ssh2_sftp_unlink' => 'Safe\ssh2_sftp_unlink', + 'ssh2_shell' => 'Safe\ssh2_shell', + 'stream_context_set_params' => 'Safe\stream_context_set_params', + 'stream_copy_to_stream' => 'Safe\stream_copy_to_stream', + 'stream_filter_append' => 'Safe\stream_filter_append', + 'stream_filter_prepend' => 'Safe\stream_filter_prepend', + 'stream_filter_register' => 'Safe\stream_filter_register', + 'stream_filter_remove' => 'Safe\stream_filter_remove', + 'stream_get_contents' => 'Safe\stream_get_contents', + 'stream_isatty' => 'Safe\stream_isatty', + 'stream_resolve_include_path' => 'Safe\stream_resolve_include_path', + 'stream_set_blocking' => 'Safe\stream_set_blocking', + 'stream_set_timeout' => 'Safe\stream_set_timeout', + 'stream_socket_accept' => 'Safe\stream_socket_accept', + 'stream_socket_client' => 'Safe\stream_socket_client', + 'stream_socket_pair' => 'Safe\stream_socket_pair', + 'stream_socket_server' => 'Safe\stream_socket_server', + 'stream_socket_shutdown' => 'Safe\stream_socket_shutdown', + 'stream_supports_lock' => 'Safe\stream_supports_lock', + 'stream_wrapper_register' => 'Safe\stream_wrapper_register', + 'stream_wrapper_restore' => 'Safe\stream_wrapper_restore', + 'stream_wrapper_unregister' => 'Safe\stream_wrapper_unregister', + 'strftime' => 'Safe\strftime', + 'strptime' => 'Safe\strptime', + 'strtotime' => 'Safe\strtotime', + 'swoole_async_dns_lookup' => 'Safe\swoole_async_dns_lookup', + 'swoole_async_readfile' => 'Safe\swoole_async_readfile', + 'swoole_async_write' => 'Safe\swoole_async_write', + 'swoole_async_writefile' => 'Safe\swoole_async_writefile', + 'swoole_event_defer' => 'Safe\swoole_event_defer', + 'swoole_event_del' => 'Safe\swoole_event_del', + 'swoole_event_write' => 'Safe\swoole_event_write', + 'symlink' => 'Safe\symlink', + 'syslog' => 'Safe\syslog', + 'system' => 'Safe\system', + 'tempnam' => 'Safe\tempnam', + 'timezone_name_from_abbr' => 'Safe\timezone_name_from_abbr', + 'time_nanosleep' => 'Safe\time_nanosleep', + 'time_sleep_until' => 'Safe\time_sleep_until', + 'tmpfile' => 'Safe\tmpfile', + 'touch' => 'Safe\touch', + 'unixtojd' => 'Safe\unixtojd', + 'unlink' => 'Safe\unlink', + 'unpack' => 'Safe\unpack', + 'uopz_extend' => 'Safe\uopz_extend', + 'uopz_implement' => 'Safe\uopz_implement', + 'variant_date_to_timestamp' => 'Safe\variant_date_to_timestamp', + 'variant_round' => 'Safe\variant_round', + 'virtual' => 'Safe\virtual', + 'xdiff_file_bdiff' => 'Safe\xdiff_file_bdiff', + 'xdiff_file_bpatch' => 'Safe\xdiff_file_bpatch', + 'xdiff_file_diff' => 'Safe\xdiff_file_diff', + 'xdiff_file_diff_binary' => 'Safe\xdiff_file_diff_binary', + 'xdiff_file_patch_binary' => 'Safe\xdiff_file_patch_binary', + 'xdiff_file_rabdiff' => 'Safe\xdiff_file_rabdiff', + 'xdiff_string_bpatch' => 'Safe\xdiff_string_bpatch', + 'xdiff_string_patch' => 'Safe\xdiff_string_patch', + 'xdiff_string_patch_binary' => 'Safe\xdiff_string_patch_binary', + 'xmlrpc_set_type' => 'Safe\xmlrpc_set_type', + 'xml_parser_free' => 'Safe\xml_parser_free', + 'xml_set_character_data_handler' => 'Safe\xml_set_character_data_handler', + 'xml_set_default_handler' => 'Safe\xml_set_default_handler', + 'xml_set_element_handler' => 'Safe\xml_set_element_handler', + 'xml_set_end_namespace_decl_handler' => 'Safe\xml_set_end_namespace_decl_handler', + 'xml_set_external_entity_ref_handler' => 'Safe\xml_set_external_entity_ref_handler', + 'xml_set_notation_decl_handler' => 'Safe\xml_set_notation_decl_handler', + 'xml_set_object' => 'Safe\xml_set_object', + 'xml_set_processing_instruction_handler' => 'Safe\xml_set_processing_instruction_handler', + 'xml_set_start_namespace_decl_handler' => 'Safe\xml_set_start_namespace_decl_handler', + 'xml_set_unparsed_entity_decl_handler' => 'Safe\xml_set_unparsed_entity_decl_handler', + 'yaml_parse' => 'Safe\yaml_parse', + 'yaml_parse_file' => 'Safe\yaml_parse_file', + 'yaml_parse_url' => 'Safe\yaml_parse_url', + 'yaz_ccl_parse' => 'Safe\yaz_ccl_parse', + 'yaz_close' => 'Safe\yaz_close', + 'yaz_connect' => 'Safe\yaz_connect', + 'yaz_database' => 'Safe\yaz_database', + 'yaz_element' => 'Safe\yaz_element', + 'yaz_present' => 'Safe\yaz_present', + 'yaz_search' => 'Safe\yaz_search', + 'yaz_wait' => 'Safe\yaz_wait', + 'zip_entry_close' => 'Safe\zip_entry_close', + 'zip_entry_compressedsize' => 'Safe\zip_entry_compressedsize', + 'zip_entry_compressionmethod' => 'Safe\zip_entry_compressionmethod', + 'zip_entry_filesize' => 'Safe\zip_entry_filesize', + 'zip_entry_name' => 'Safe\zip_entry_name', + 'zip_entry_open' => 'Safe\zip_entry_open', + 'zip_entry_read' => 'Safe\zip_entry_read', + 'zlib_decode' => 'Safe\zlib_decode', + ] + ); +}; diff --git a/generated/8.1/rpminfo.php b/generated/8.1/rpminfo.php new file mode 100644 index 00000000..2cd42fa6 --- /dev/null +++ b/generated/8.1/rpminfo.php @@ -0,0 +1,21 @@ + + * + * + * (pay attention to line endings - PHP uses a native function to + * parse the input, so a Mac file won't work on Unix). + * @param bool $use_include_path Setting use_include_path to TRUE will result + * in PHP trying to open the file along the standard include path as per + * the include_path directive. + * This is used for local files, not URLs. + * @return array Returns an array with all the parsed meta tags. + * + * The value of the name property becomes the key, the value of the content + * property becomes the value of the returned array, so you can easily use + * standard array functions to traverse it or access single values. + * Special characters in the value of the name property are substituted with + * '_', the rest is converted to lower case. If two meta tags have the same + * name, only the last one is returned. + * + * Returns FALSE on failure. + * @throws UrlException + * + */ +function get_meta_tags(string $filename, bool $use_include_path = false): array +{ + error_clear_last(); + $safeResult = \get_meta_tags($filename, $use_include_path); + if ($safeResult === false) { + throw UrlException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * This function parses a URL and returns an associative array containing any + * of the various components of the URL that are present. + * The values of the array elements are not URL decoded. + * + * This function is not meant to validate + * the given URL, it only breaks it up into the above listed parts. Partial and invalid + * URLs are also accepted, parse_url tries its best to + * parse them correctly. + * + * @param string $url The URL to parse. + * @param int $component Specify one of PHP_URL_SCHEME, + * PHP_URL_HOST, PHP_URL_PORT, + * PHP_URL_USER, PHP_URL_PASS, + * PHP_URL_PATH, PHP_URL_QUERY + * or PHP_URL_FRAGMENT to retrieve just a specific + * URL component as a string (except when + * PHP_URL_PORT is given, in which case the return + * value will be an int). + * @return array|int|string|null On seriously malformed URLs, parse_url. + * + * If the component parameter is omitted, an + * associative array is returned. At least one element will be + * present within the array. Potential keys within this array are: + * + * + * + * scheme - e.g. http + * + * + * + * + * host + * + * + * + * + * port + * + * + * + * + * user + * + * + * + * + * pass + * + * + * + * + * path + * + * + * + * + * query - after the question mark ? + * + * + * + * + * fragment - after the hashmark # + * + * + * + * + * If the component parameter is specified, + * parse_url returns a string (or an + * int, in the case of PHP_URL_PORT) + * instead of an array. If the requested component doesn't exist + * within the given URL, NULL will be returned. + * As of PHP 8.0.0, parse_url distinguishes absent and empty + * queries and fragments: + * + * + * + * + * + * + * + * Previously all cases resulted in query and fragment being NULL. + * + * Note that control characters (cf. ctype_cntrl) in the + * components are replaced with underscores (_). + * @throws UrlException + * + */ +function parse_url(string $url, int $component = -1) +{ + error_clear_last(); + $safeResult = \parse_url($url, $component); + if ($safeResult === false) { + throw UrlException::createFromPhpError(); + } + return $safeResult; +} diff --git a/generated/8.1/var.php b/generated/8.1/var.php new file mode 100644 index 00000000..70f048df --- /dev/null +++ b/generated/8.1/var.php @@ -0,0 +1,60 @@ + + * ]]> + * + * See section 4.7 of the XML 1.0 + * spec for the definition of notation declarations. + * + * @param resource $parser A reference to the XML parser to set up notation declaration handler function. + * @param callable $handler handler is a string containing the name of a + * function that must exist when xml_parse is called + * for parser. + * + * The function named by handler must accept + * five parameters: + * + * handler + * XMLParserparser + * stringnotation_name + * stringbase + * stringsystem_id + * stringpublic_id + * + * + * + * + * parser + * + * + * + * The first parameter, parser, is a + * reference to the XML parser calling the handler. + * + * + * + * + * notation_name + * + * + * This is the notation's name, as per + * the notation format described above. + * + * + * + * + * + * base + * + * + * + * This is the base for resolving the system identifier + * (system_id) of the notation declaration. + * Currently this parameter will always be set to an empty string. + * + * + * + * + * system_id + * + * + * System identifier of the external notation declaration. + * + * + * + * + * + * public_id + * + * + * + * Public identifier of the external notation declaration. + * + * + * + * + * + * If a handler function is set to an empty string, or FALSE, the handler + * in question is disabled. + * @throws XmlException + * + */ +function xml_set_notation_decl_handler($parser, callable $handler): void +{ + error_clear_last(); + $safeResult = \xml_set_notation_decl_handler($parser, $handler); + if ($safeResult === false) { + throw XmlException::createFromPhpError(); + } +} + + +/** + * This function allows to use parser inside + * object. All callback functions could be set with + * xml_set_element_handler etc and assumed to be + * methods of object. + * + * @param resource $parser A reference to the XML parser to use inside the object. + * @param object $object The object where to use the XML parser. + * @throws XmlException + * + */ +function xml_set_object($parser, object $object): void +{ + error_clear_last(); + $safeResult = \xml_set_object($parser, $object); + if ($safeResult === false) { + throw XmlException::createFromPhpError(); + } +} + + +/** + * Sets the processing instruction (PI) handler function for the XML parser + * parser. + * + * A processing instruction has the following format: + * + * <?target + * data?> + * + * + * You can put PHP code into such a tag, but be aware of one limitation: in + * an XML PI, the PI end tag (?>) can not be quoted, + * so this character sequence should not appear in the PHP code you embed + * with PIs in XML documents.If it does, the rest of the PHP code, as well + * as the "real" PI end tag, will be treated as character data. + * + * @param resource $parser A reference to the XML parser to set up processing instruction (PI) handler function. + * @param callable $handler handler is a string containing the name of a + * function that must exist when xml_parse is called + * for parser. + * + * The function named by handler must accept + * three parameters: + * + * handler + * XMLParserparser + * stringtarget + * stringdata + * + * + * + * parser + * + * + * The first parameter, parser, is a + * reference to the XML parser calling the handler. + * + * + * + * + * target + * + * + * The second parameter, target, contains the PI + * target. + * + * + * + * + * data + * + * + * The third parameter, data, contains the PI + * data. + * + * + * + * + * + * If a handler function is set to an empty string, or FALSE, the handler + * in question is disabled. + * @throws XmlException + * + */ +function xml_set_processing_instruction_handler($parser, callable $handler): void +{ + error_clear_last(); + $safeResult = \xml_set_processing_instruction_handler($parser, $handler); + if ($safeResult === false) { + throw XmlException::createFromPhpError(); + } +} + + +/** + * Set a handler to be called when a namespace is declared. Namespace + * declarations occur inside start tags. But the namespace declaration start + * handler is called before the start tag handler for each namespace declared + * in that start tag. + * + * @param resource $parser A reference to the XML parser. + * @param callable $handler handler is a string containing the name of a + * function that must exist when xml_parse is called + * for parser. + * + * The function named by handler must accept + * three parameters, and should return an integer value. If the + * value returned from the handler is FALSE (which it will be if no + * value is returned), the XML parser will stop parsing and + * xml_get_error_code will return + * XML_ERROR_EXTERNAL_ENTITY_HANDLING. + * + * handler + * XMLParserparser + * stringprefix + * stringuri + * + * + * + * parser + * + * + * The first parameter, parser, is a + * reference to the XML parser calling the handler. + * + * + * + * + * prefix + * + * + * The prefix is a string used to reference the namespace within an XML object. + * + * + * + * + * uri + * + * + * Uniform Resource Identifier (URI) of namespace. + * + * + * + * + * + * If a handler function is set to an empty string, or FALSE, the handler + * in question is disabled. + * @throws XmlException + * + */ +function xml_set_start_namespace_decl_handler($parser, callable $handler): void +{ + error_clear_last(); + $safeResult = \xml_set_start_namespace_decl_handler($parser, $handler); + if ($safeResult === false) { + throw XmlException::createFromPhpError(); + } +} + + +/** + * Sets the unparsed entity declaration handler function for the XML parser + * parser. + * + * The handler will be called if the XML parser + * encounters an external entity declaration with an NDATA declaration, like + * the following: + * + * name {publicId | systemId} + * NDATA notationName + * ]]> + * + * + * See section 4.2.2 of + * the XML 1.0 spec for the definition of notation declared + * external entities. + * + * @param resource $parser A reference to the XML parser to set up unparsed entity declaration handler function. + * @param callable $handler handler is a string containing the name of a + * function that must exist when xml_parse is called + * for parser. + * + * The function named by handler must accept six + * parameters: + * + * handler + * XMLParserparser + * stringentity_name + * stringbase + * stringsystem_id + * stringpublic_id + * stringnotation_name + * + * + * + * parser + * + * + * The first parameter, parser, is a + * reference to the XML parser calling the + * handler. + * + * + * + * + * entity_name + * + * + * The name of the entity that is about to be defined. + * + * + * + * + * base + * + * + * This is the base for resolving the system identifier + * (systemId) of the external entity.Currently + * this parameter will always be set to an empty string. + * + * + * + * + * system_id + * + * + * System identifier for the external entity. + * + * + * + * + * public_id + * + * + * Public identifier for the external entity. + * + * + * + * + * notation_name + * + * + * Name of the notation of this entity (see + * xml_set_notation_decl_handler). + * + * + * + * + * + * If a handler function is set to an empty string, or FALSE, the handler + * in question is disabled. + * @throws XmlException + * + */ +function xml_set_unparsed_entity_decl_handler($parser, callable $handler): void +{ + error_clear_last(); + $safeResult = \xml_set_unparsed_entity_decl_handler($parser, $handler); + if ($safeResult === false) { + throw XmlException::createFromPhpError(); + } +} diff --git a/generated/8.1/xmlrpc.php b/generated/8.1/xmlrpc.php new file mode 100644 index 00000000..3a1f5362 --- /dev/null +++ b/generated/8.1/xmlrpc.php @@ -0,0 +1,22 @@ + + * + * + * + * The permissions 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 $permissions): void +{ + error_clear_last(); + $safeResult = \chmod($filename, $permissions); + if ($safeResult === false) { + throw 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 FilesystemException + * + */ +function chown(string $filename, $user): void +{ + error_clear_last(); + $safeResult = \chown($filename, $user); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * Makes a copy of the file from to + * to. + * + * If you wish to move a file, use the rename function. + * + * @param string $from Path to the source file. + * @param string $to The destination path. If to 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 FilesystemException + * + */ +function copy(string $from, string $to, $context = null): void +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \copy($from, $to, $context); + } else { + $safeResult = \copy($from, $to); + } + if ($safeResult === false) { + throw 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 FilesystemException + * + */ +function disk_free_space(string $directory): float +{ + error_clear_last(); + $safeResult = \disk_free_space($directory); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function disk_total_space(string $directory): float +{ + error_clear_last(); + $safeResult = \disk_total_space($directory); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * The file pointed to by stream is closed. + * + * @param resource $stream The file pointer must be valid, and must point to a file successfully + * opened by fopen or fsockopen. + * @throws FilesystemException + * + */ +function fclose($stream): void +{ + error_clear_last(); + $safeResult = \fclose($stream); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * This function synchronizes stream contents to storage media, just like fsync does, + * but it does not synchronize file meta-data. + * Note that this function is only effectively different in POSIX systems. + * In Windows, this function is aliased to fsync. + * + * @param resource $stream 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 FilesystemException + * + */ +function fdatasync($stream): void +{ + error_clear_last(); + $safeResult = \fdatasync($stream); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * This function forces a write of all buffered output to the resource + * pointed to by the file stream. + * + * @param resource $stream 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 FilesystemException + * + */ +function fflush($stream): void +{ + error_clear_last(); + $safeResult = \fflush($stream); + if ($safeResult === false) { + throw 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 length 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 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 $length 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 FilesystemException + * + */ +function file_get_contents(string $filename, bool $use_include_path = false, $context = null, int $offset = 0, ?int $length = null): string +{ + error_clear_last(); + if ($length !== null) { + $safeResult = \file_get_contents($filename, $use_include_path, $context, $offset, $length); + } elseif ($offset !== 0) { + $safeResult = \file_get_contents($filename, $use_include_path, $context, $offset); + } elseif ($context !== null) { + $safeResult = \file_get_contents($filename, $use_include_path, $context); + } else { + $safeResult = \file_get_contents($filename, $use_include_path); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * This function is identical to calling fopen, + * fwrite and fclose successively + * to write data to a file. + * + * If filename does not exist, the file is created. + * Otherwise, the existing file is overwritten, unless the + * FILE_APPEND flag is set. + * + * @param string $filename Path to the file where to write the data. + * @param mixed $data The data to write. Can be either a string, an + * array or a stream resource. + * + * If data is a stream resource, the + * remaining buffer of that stream will be copied to the specified file. + * This is similar with using stream_copy_to_stream. + * + * You can also specify the data parameter as a single + * dimension array. This is equivalent to + * file_put_contents($filename, implode('', $array)). + * @param int $flags The value of flags can be any combination of + * the following flags, joined with the binary OR (|) + * operator. + * + * + * Available flags + * + * + * + * Flag + * Description + * + * + * + * + * + * FILE_USE_INCLUDE_PATH + * + * + * Search for filename in the include directory. + * See include_path for more + * information. + * + * + * + * + * FILE_APPEND + * + * + * If file filename already exists, append + * the data to the file instead of overwriting it. + * + * + * + * + * LOCK_EX + * + * + * Acquire an exclusive lock on the file while proceeding to the + * writing. In other words, a flock call happens + * between the fopen call and the + * fwrite call. This is not identical to an + * fopen call with mode "x". + * + * + * + * + * + * @param resource|null $context A valid context resource created with + * stream_context_create. + * @return int This function returns the number of bytes that were written to the file. + * @throws FilesystemException + * + */ +function file_put_contents(string $filename, $data, int $flags = 0, $context = null): int +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \file_put_contents($filename, $data, $flags, $context); + } else { + $safeResult = \file_put_contents($filename, $data, $flags); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Reads an entire file into an array. + * + * @param string $filename Path to the file. + * @param int $flags The optional parameter flags can be one, or + * more, of the following constants: + * + * + * + * FILE_USE_INCLUDE_PATH + * + * + * + * Search for the file in the include_path. + * + * + * + * + * + * FILE_IGNORE_NEW_LINES + * + * + * + * Omit newline at the end of each array element + * + * + * + * + * + * FILE_SKIP_EMPTY_LINES + * + * + * + * Skip empty lines + * + * + * + * + * @param resource $context + * @return array Returns the file in an array. Each element of the array corresponds to a + * line in the file, with the newline still attached. Upon failure, + * file returns FALSE. + * @throws FilesystemException + * + */ +function file(string $filename, int $flags = 0, $context = null): array +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \file($filename, $flags, $context); + } else { + $safeResult = \file($filename, $flags); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * + * + * @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 FilesystemException + * + */ +function fileatime(string $filename): int +{ + error_clear_last(); + $safeResult = \fileatime($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function filectime(string $filename): int +{ + error_clear_last(); + $safeResult = \filectime($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Gets the file inode. + * + * @param string $filename Path to the file. + * @return int Returns the inode number of the file. + * @throws FilesystemException + * + */ +function fileinode(string $filename): int +{ + error_clear_last(); + $safeResult = \fileinode($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function filemtime(string $filename): int +{ + error_clear_last(); + $safeResult = \filemtime($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function fileowner(string $filename): int +{ + error_clear_last(); + $safeResult = \fileowner($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Gets permissions for the given file. + * + * @param string $filename Path to the file. + * @return int Returns the file's permissions as a numeric mode. Lower bits of this mode + * are the same as the permissions expected by chmod, + * however on most platforms the return value will also include information on + * the type of file given as filename. The examples + * below demonstrate how to test the return value for specific permissions and + * file types on POSIX systems, including Linux and macOS. + * + * For local files, the specific return value is that of the + * st_mode member of the structure returned by the C + * library's stat function. Exactly which bits are set + * can vary from platform to platform, and looking up your specific platform's + * documentation is recommended if parsing the non-permission bits of the + * return value is required. + * + * Returns FALSE on failure. + * @throws FilesystemException + * + */ +function fileperms(string $filename): int +{ + error_clear_last(); + $safeResult = \fileperms($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Gets the size for the given file. + * + * @param string $filename Path to the file. + * @return int Returns the size of the file in bytes, or FALSE (and generates an error + * of level E_WARNING) in case of an error. + * @throws FilesystemException + * + */ +function filesize(string $filename): int +{ + error_clear_last(); + $safeResult = \filesize($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * flock allows you to perform a simple reader/writer + * model which can be used on virtually every platform (including most Unix + * derivatives and even Windows). + * + * The lock is released also by fclose, + * or when stream is garbage collected. + * + * PHP supports a portable way of locking complete files in an advisory way + * (which means all accessing programs have to use the same way of locking + * or it will not work). By default, this function will block until the + * requested lock is acquired; this may be controlled with the LOCK_NB option documented below. + * + * @param resource $stream A file system pointer resource + * that is typically created using fopen. + * @param int $operation operation is one of the following: + * + * + * + * LOCK_SH to acquire a shared lock (reader). + * + * + * + * + * LOCK_EX to acquire an exclusive lock (writer). + * + * + * + * + * LOCK_UN to release a lock (shared or exclusive). + * + * + * + * + * It is also possible to add LOCK_NB as a bitmask to one + * of the above operations, if flock should not + * block during the locking attempt. + * @param int|null $would_block The optional third argument is set to 1 if the lock would block + * (EWOULDBLOCK errno condition). + * @throws FilesystemException + * + */ +function flock($stream, int $operation, ?int &$would_block = null): void +{ + error_clear_last(); + $safeResult = \flock($stream, $operation, $would_block); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * 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 + * 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; otherwise it has the + * same behavior as 'w'. + * + * + * + * '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 (Mac OS Classic) used + * \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 is 'b'. + * You can 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 old versions of notepad. You + * should use the 'b' in all other cases. + * + * If you specify the 't' 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 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|null $context A context stream + * resource. + * @return resource Returns a file pointer resource on success + * @throws FilesystemException + * + */ +function fopen(string $filename, string $mode, bool $use_include_path = false, $context = null) +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \fopen($filename, $mode, $use_include_path, $context); + } else { + $safeResult = \fopen($filename, $mode, $use_include_path); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * fread reads up to + * length bytes from the file pointer + * referenced by stream. 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 $stream 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 FilesystemException + * + */ +function fread($stream, int $length): string +{ + error_clear_last(); + $safeResult = \fread($stream, $length); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Gathers the statistics of the file opened by the file + * pointer stream. This function is similar to the + * stat function except that it operates + * on an open file pointer instead of a filename. + * + * @param resource $stream A file system pointer resource + * that is typically created using fopen. + * @return array Returns an array with the statistics of the file; the format of the array + * is described in detail on the stat manual page. + * Returns FALSE on failure. + * @throws FilesystemException + * + */ +function fstat($stream): array +{ + error_clear_last(); + $safeResult = \fstat($stream); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * This function synchronizes changes to the file, including its meta-data. This is similar to fflush, + * but it also instructs the operating system to write to the storage media. + * + * @param resource $stream 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 FilesystemException + * + */ +function fsync($stream): void +{ + error_clear_last(); + $safeResult = \fsync($stream); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * Takes the filepointer, stream, and truncates the file to + * length, size. + * + * @param resource $stream The file pointer. + * + * The stream 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 FilesystemException + * + */ +function ftruncate($stream, int $size): void +{ + error_clear_last(); + $safeResult = \ftruncate($stream, $size); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * + * + * @param resource $stream A file system pointer resource + * that is typically created using fopen. + * @param string $data The string that is to be written. + * @param int $length If length is an integer, writing will stop + * after length bytes have been written or the + * end of data is reached, whichever comes first. + * @return int + * @throws FilesystemException + * + */ +function fwrite($stream, string $data, ?int $length = null): int +{ + error_clear_last(); + if ($length !== null) { + $safeResult = \fwrite($stream, $data, $length); + } else { + $safeResult = \fwrite($stream, $data); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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. + * + * Special characters: + * + * + * + * * - Matches zero or more characters. + * + * + * + * + * ? - Matches exactly one character (any character). + * + * + * + * + * [...] - Matches one character from a group of + * characters. If the first character is !, + * matches any character not in the group. + * + * + * + * + * \ - Escapes the following character, + * except when the GLOB_NOESCAPE flag is used. + * + * + * + * @param int $flags Valid flags: + * + * + * + * GLOB_MARK - Adds a slash (a backslash on Windows) to each directory returned + * + * + * + * + * GLOB_NOSORT - Return files as they appear in the + * directory (no sorting). When this flag is not used, the pathnames are + * sorted alphabetically + * + * + * + * + * GLOB_NOCHECK - Return the search pattern if no + * files matching it were found + * + * + * + * + * GLOB_NOESCAPE - Backslashes do not quote + * metacharacters + * + * + * + * + * GLOB_BRACE - Expands {a,b,c} to match 'a', 'b', + * or 'c' + * + * + * + * + * GLOB_ONLYDIR - Return only directory entries + * which match the pattern + * + * + * + * + * GLOB_ERR - Stop on read errors (like unreadable + * directories), by default errors are ignored. + * + * + * + * + * + * The GLOB_BRACE flag is not available on some non GNU + * systems, like Solaris or Alpine Linux. + * + * + * @return array Returns an array containing the matched files/directories, an empty array + * if no file matched. + * @throws FilesystemException + * + */ +function glob(string $pattern, int $flags = 0): array +{ + error_clear_last(); + $safeResult = \glob($pattern, $flags); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function lchgrp(string $filename, $group): void +{ + error_clear_last(); + $safeResult = \lchgrp($filename, $group); + if ($safeResult === false) { + throw 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 FilesystemException + * + */ +function lchown(string $filename, $user): void +{ + error_clear_last(); + $safeResult = \lchown($filename, $user); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * link creates a hard link. + * + * @param string $target Target of the link. + * @param string $link The link name. + * @throws FilesystemException + * + */ +function link(string $target, string $link): void +{ + error_clear_last(); + $safeResult = \link($target, $link); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * Gathers the statistics of the file or symbolic link named by + * filename. + * + * @param string $filename Path to a file or a symbolic link. + * @return array See the manual page for stat for information on + * the structure of the array that lstat returns. + * This function is identical to the stat function + * except that if the filename parameter is a symbolic + * link, the status of the symbolic link is returned, not the status of the + * file pointed to by the symbolic link. + * + * On failure, FALSE is returned. + * @throws FilesystemException + * + */ +function lstat(string $filename): array +{ + error_clear_last(); + $safeResult = \lstat($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Attempts to create the directory specified by directory. + * + * @param string $directory The directory path. + * A URL can be used as a + * filename with this function if the fopen wrappers have been enabled. + * See fopen for more details on how to specify the + * filename. See the for links to information + * about what abilities the various wrappers have, notes on their usage, + * and information on any predefined variables they may + * provide. + * @param int $permissions The permissions are 0777 by default, which means the widest possible + * access. For more information on permissions, read the details + * on the chmod page. + * + * permissions is ignored on Windows. + * + * Note that you probably want to specify the permissions as an octal number, + * which means it should have a leading zero. The permissions is also modified + * by the current umask, which you can change using + * umask. + * @param bool $recursive If TRUE, then any parent directories to the directory specified will + * also be created, with the same permissions. + * @param resource $context A context stream + * resource. + * @throws FilesystemException + * + */ +function mkdir(string $directory, int $permissions = 0777, bool $recursive = false, $context = null): void +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \mkdir($directory, $permissions, $recursive, $context); + } else { + $safeResult = \mkdir($directory, $permissions, $recursive); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * parse_ini_file loads in the + * ini file specified in filename, + * and returns the settings in it in an associative array. + * + * The structure of the ini file is the same as the php.ini's. + * + * @param string $filename The filename of the ini file being parsed. If a relative path is used, + * it is evaluated relative to the current working directory, then the + * include_path. + * @param bool $process_sections By setting the process_sections + * parameter to TRUE, you get a multidimensional array, with + * the section names and settings included. The default + * for process_sections is FALSE + * @param int $scanner_mode Can either be INI_SCANNER_NORMAL (default) or + * INI_SCANNER_RAW. If INI_SCANNER_RAW + * is supplied, then option values will not be parsed. + * + * + * As of PHP 5.6.1 can also be specified as INI_SCANNER_TYPED. + * In this mode boolean, null and integer types are preserved when possible. + * String values "true", "on" and "yes" + * are converted to TRUE. "false", "off", "no" + * and "none" are considered FALSE. "null" is converted to NULL + * in typed mode. Also, all numeric strings are converted to integer type if it is possible. + * @return array The settings are returned as an associative array on success. + * @throws FilesystemException + * + */ +function parse_ini_file(string $filename, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array +{ + error_clear_last(); + $safeResult = \parse_ini_file($filename, $process_sections, $scanner_mode); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * parse_ini_string returns the settings in string + * ini_string in an associative array. + * + * The structure of the ini string is the same as the php.ini's. + * + * @param string $ini_string The contents of the ini file being parsed. + * @param bool $process_sections By setting the process_sections + * parameter to TRUE, you get a multidimensional array, with + * the section names and settings included. The default + * for process_sections is FALSE + * @param int $scanner_mode Can either be INI_SCANNER_NORMAL (default) or + * INI_SCANNER_RAW. If INI_SCANNER_RAW + * is supplied, then option values will not be parsed. + * + * + * As of PHP 5.6.1 can also be specified as INI_SCANNER_TYPED. + * In this mode boolean, null and integer types are preserved when possible. + * String values "true", "on" and "yes" + * are converted to TRUE. "false", "off", "no" + * and "none" are considered FALSE. "null" is converted to NULL + * in typed mode. Also, all numeric strings are converted to integer type if it is possible. + * @return array The settings are returned as an associative array on success. + * @throws FilesystemException + * + */ +function parse_ini_string(string $ini_string, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array +{ + error_clear_last(); + $safeResult = \parse_ini_string($ini_string, $process_sections, $scanner_mode); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Reads a file and writes it to the output buffer. + * + * @param string $filename The filename being read. + * @param bool $use_include_path You can use the optional second parameter and set it to TRUE, if + * you want to search for the file in the include_path, too. + * @param resource $context A context stream + * resource. + * @return int Returns the number of bytes read from the file on success + * @throws FilesystemException + * + */ +function readfile(string $filename, bool $use_include_path = false, $context = null): int +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \readfile($filename, $use_include_path, $context); + } else { + $safeResult = \readfile($filename, $use_include_path); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function readlink(string $path): string +{ + error_clear_last(); + $safeResult = \readlink($path); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * realpath expands all symbolic links and + * resolves references to /./, /../ and extra / characters in + * the input path and returns the canonicalized + * absolute pathname. + * + * @param string $path The path being checked. + * + * + * Whilst a path must be supplied, the value can be an empty string. + * In this case, the value is interpreted as the current directory. + * + * + * + * Whilst a path must be supplied, the value can be an empty string. + * In this case, the value is interpreted as the current directory. + * @return string Returns the canonicalized absolute pathname on success. The resulting path + * will have no symbolic link, /./ or /../ components. Trailing delimiters, + * such as \ and /, are also removed. + * + * realpath returns FALSE on failure, e.g. if + * the file does not exist. + * @throws FilesystemException + * + */ +function realpath(string $path): string +{ + error_clear_last(); + $safeResult = \realpath($path); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Attempts to rename from to + * to, moving it between directories if necessary. + * If renaming a file and to exists, + * it will be overwritten. If renaming a directory and + * to exists, + * this function will emit a warning. + * + * @param string $from The old name. + * + * The wrapper used in from + * must match the wrapper used in + * to. + * @param string $to The new name. + * + * + * On Windows, if to already exists, it must be writable. + * Otherwise rename fails and issues E_WARNING. + * + * + * @param resource $context A context stream + * resource. + * @throws FilesystemException + * + */ +function rename(string $from, string $to, $context = null): void +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \rename($from, $to, $context); + } else { + $safeResult = \rename($from, $to); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * Sets the file position indicator for stream + * to the beginning of the file stream. + * + * @param resource $stream The file pointer must be valid, and must point to a file + * successfully opened by fopen. + * @throws FilesystemException + * + */ +function rewind($stream): void +{ + error_clear_last(); + $safeResult = \rewind($stream); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * Attempts to remove the directory named by directory. + * The directory must be empty, and the relevant permissions must permit this. + * A E_WARNING level error will be generated on failure. + * + * @param string $directory Path to the directory. + * @param resource $context A context stream + * resource. + * @throws FilesystemException + * + */ +function rmdir(string $directory, $context = null): void +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \rmdir($directory, $context); + } else { + $safeResult = \rmdir($directory); + } + if ($safeResult === false) { + throw 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 FilesystemException + * + */ +function symlink(string $target, string $link): void +{ + error_clear_last(); + $safeResult = \symlink($target, $link); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * Creates a file with a unique filename, with access permission set to 0600, in the specified directory. + * If the directory does not exist or is not writable, tempnam may + * generate a file in the system's temporary directory, and return + * the full path to that file, including its name. + * + * @param string $directory The directory where the temporary filename will be created. + * @param string $prefix The prefix of the generated temporary filename. + * @return string Returns the new temporary filename (with path). + * @throws FilesystemException + * + */ +function tempnam(string $directory, string $prefix): string +{ + error_clear_last(); + $safeResult = \tempnam($directory, $prefix); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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. + * + * @return resource|false Returns a file handle, similar to the one returned by + * fopen, for the new file. + * @throws FilesystemException + * + */ +function tmpfile() +{ + error_clear_last(); + $safeResult = \tmpfile(); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Attempts to set the access and modification times of the file named in the + * filename parameter to the value given in + * mtime. + * 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 $mtime The touch time. If mtime is NULL, + * the current system time is used. + * @param int $atime If not NULL, the access time of the given filename is set to + * the value of atime. Otherwise, it is set to + * the value passed to the mtime parameter. + * If both are NULL, the current system time is used. + * @throws FilesystemException + * + */ +function touch(string $filename, ?int $mtime = null, ?int $atime = null): void +{ + error_clear_last(); + if ($atime !== null) { + $safeResult = \touch($filename, $mtime, $atime); + } elseif ($mtime !== null) { + $safeResult = \touch($filename, $mtime); + } else { + $safeResult = \touch($filename); + } + if ($safeResult === false) { + throw 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. + * + * If the file is a symlink, the symlink will be deleted. On Windows, to delete + * a symlink to a directory, rmdir has to be used instead. + * @param resource $context A context stream + * resource. + * @throws FilesystemException + * + */ +function unlink(string $filename, $context = null): void +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \unlink($filename, $context); + } else { + $safeResult = \unlink($filename); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} diff --git a/generated/8.2/filter.php b/generated/8.2/filter.php new file mode 100644 index 00000000..0508f8e7 --- /dev/null +++ b/generated/8.2/filter.php @@ -0,0 +1,81 @@ + + * + * + * + * channels will be 3 for RGB pictures and 4 for CMYK + * pictures. + * + * bits is the number of bits for each color. + * + * For some image types, the presence of channels and + * bits values can be a bit + * confusing. As an example, GIF always uses 3 channels + * per pixel, but the number of bits per pixel cannot be calculated for an + * animated GIF with a global color table. + * + * On failure, FALSE is returned. + * @throws ImageException + * + */ +function getimagesize(string $filename, ?array &$image_info = null): ?array +{ + error_clear_last(); + $safeResult = \getimagesize($filename, $image_info); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Returns the extension for the given IMAGETYPE_XXX + * constant. + * + * @param int $image_type One of the IMAGETYPE_XXX constant. + * @param bool $include_dot Whether to prepend a dot to the extension or not. Default to TRUE. + * @return string A string with the extension corresponding to the given image type. + * @throws ImageException + * + */ +function image_type_to_extension(int $image_type, bool $include_dot = true): string +{ + error_clear_last(); + $safeResult = \image_type_to_extension($image_type, $include_dot); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * image2wbmp 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 string|null $filename Path to the saved file. If not given, the raw image stream will be + * output 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 ImageException + * + */ +function image2wbmp($image, ?string $filename = null, ?int $foreground = null): void +{ + error_clear_last(); + if ($foreground !== null) { + $safeResult = \image2wbmp($image, $filename, $foreground); + } elseif ($filename !== null) { + $safeResult = \image2wbmp($image, $filename); + } else { + $safeResult = \image2wbmp($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param array $affine Array with keys 0 to 5. + * @param array $clip Array with keys "x", "y", "width" and "height"; or NULL. + * @return resource Return affined image object on success. + * @throws ImageException + * + */ +function imageaffine($image, array $affine, ?array $clip = null) +{ + error_clear_last(); + if ($clip !== null) { + $safeResult = \imageaffine($image, $affine, $clip); + } else { + $safeResult = \imageaffine($image, $affine); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Returns the concatenation of two affine transformation matrices, + * what is useful if multiple transformations should be applied to the same + * image in one go. + * + * @param array $matrix1 An affine transformation matrix (an array with keys + * 0 to 5 and float values). + * @param array $matrix2 An affine transformation matrix (an array with keys + * 0 to 5 and float values). + * @return array{0:float,1:float,2:float,3:float,4:float,5:float} An affine transformation matrix (an array with keys + * 0 to 5 and float values). + * @throws ImageException + * + */ +function imageaffinematrixconcat(array $matrix1, array $matrix2): array +{ + error_clear_last(); + $safeResult = \imageaffinematrixconcat($matrix1, $matrix2); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Returns an affine transformation matrix. + * + * @param int $type One of the IMG_AFFINE_* constants. + * @param array|float $options If type is IMG_AFFINE_TRANSLATE + * or IMG_AFFINE_SCALE, + * options has to be an array with keys x + * and y, both having float values. + * + * If type is IMG_AFFINE_ROTATE, + * IMG_AFFINE_SHEAR_HORIZONTAL or IMG_AFFINE_SHEAR_VERTICAL, + * options has to be a float specifying the angle. + * @return array{0:float,1:float,2:float,3:float,4:float,5:float} An affine transformation matrix (an array with keys + * 0 to 5 and float values). + * @throws ImageException + * + */ +function imageaffinematrixget(int $type, $options): array +{ + error_clear_last(); + $safeResult = \imageaffinematrixget($type, $options); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagealphablending allows for two different + * modes of drawing on truecolor images. In blending mode, the + * alpha channel component of the color supplied to all drawing function, + * such as imagesetpixel determines how much of the + * underlying color should be allowed to shine through. As a result, gd + * automatically blends the existing color at that point with the drawing color, + * and stores the result in the image. The resulting pixel is opaque. In + * non-blending mode, the drawing color is copied literally with its alpha channel + * information, replacing the destination pixel. Blending mode is not available + * when drawing on palette images. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param bool $enable Whether to enable the blending mode or not. On true color images + * the default value is TRUE otherwise the default value is FALSE + * @throws ImageException + * + */ +function imagealphablending($image, bool $enable): void +{ + error_clear_last(); + $safeResult = \imagealphablending($image, $enable); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Activate the fast drawing antialiased methods for lines and wired polygons. + * It does not support alpha components. It works using a direct blend + * operation. It works only with truecolor images. + * + * Thickness and styled are not supported. + * + * Using antialiased primitives with transparent background color can end with + * some unexpected results. The blend method uses the background color as any + * other colors. The lack of alpha component support does not allow an alpha + * based antialiasing method. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param bool $enable Whether to enable antialiasing or not. + * @throws ImageException + * + */ +function imageantialias($image, bool $enable): void +{ + error_clear_last(); + $safeResult = \imageantialias($image, $enable); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagearc draws an arc of circle centered at the given + * coordinates. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $center_x x-coordinate of the center. + * @param int $center_y y-coordinate of the center. + * @param int $width The arc width. + * @param int $height The arc height. + * @param int $start_angle The arc start angle, in degrees. + * @param int $end_angle The arc end angle, in degrees. + * 0° is located at the three-o'clock position, and the arc is drawn + * clockwise. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagearc($image, int $center_x, int $center_y, int $width, int $height, int $start_angle, int $end_angle, int $color): void +{ + error_clear_last(); + $safeResult = \imagearc($image, $center_x, $center_y, $width, $height, $start_angle, $end_angle, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Outputs or saves a AVIF Raster image from the given image. + * + * @param \GdImage $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @param int $quality quality is optional, and ranges from 0 (worst quality, smaller file) + * to 100 (best quality, larger file). + * If -1 is provided, the default value 30 is used. + * @param int $speed speed is optional, and ranges from 0 (slow, smaller file) + * to 10 (fast, larger file). + * If -1 is provided, the default value 6 is used. + * @throws ImageException + * + */ +function imageavif(\GdImage $image, $file = null, int $quality = -1, int $speed = -1): void +{ + error_clear_last(); + if ($speed !== -1) { + $safeResult = \imageavif($image, $file, $quality, $speed); + } elseif ($quality !== -1) { + $safeResult = \imageavif($image, $file, $quality); + } elseif ($file !== null) { + $safeResult = \imageavif($image, $file); + } else { + $safeResult = \imageavif($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Outputs or saves a BMP version of the given image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * + * NULL is invalid if the compressed arguments is + * not used. + * @param bool $compressed Whether the BMP should be compressed with run-length encoding (RLE), or not. + * @throws ImageException + * + */ +function imagebmp($image, $file = null, bool $compressed = true): void +{ + error_clear_last(); + if ($compressed !== true) { + $safeResult = \imagebmp($image, $file, $compressed); + } elseif ($file !== null) { + $safeResult = \imagebmp($image, $file); + } else { + $safeResult = \imagebmp($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagechar draws the first character of + * char in the image identified by + * image with its upper-left at + * x,y (top left is 0, + * 0) with the color color. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $font Can be 1, 2, 3, 4, 5 for built-in + * fonts in latin2 encoding (where higher numbers corresponding to larger fonts) or GdFont instance, + * returned by imageloadfont. + * @param int $x x-coordinate of the start. + * @param int $y y-coordinate of the start. + * @param string $char The character to draw. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagechar($image, int $font, int $x, int $y, string $char, int $color): void +{ + error_clear_last(); + $safeResult = \imagechar($image, $font, $x, $y, $char, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws the character char vertically at the specified + * coordinate on the given image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $font Can be 1, 2, 3, 4, 5 for built-in + * fonts in latin2 encoding (where higher numbers corresponding to larger fonts) or GdFont instance, + * returned by imageloadfont. + * @param int $x x-coordinate of the start. + * @param int $y y-coordinate of the start. + * @param string $char The character to draw. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagecharup($image, int $font, int $x, int $y, string $char, int $color): void +{ + error_clear_last(); + $safeResult = \imagecharup($image, $font, $x, $y, $char, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Returns the index of the color of the pixel at the + * specified location in the image specified by image. + * + * If the image is a + * truecolor image, this function returns the RGB value of that pixel as + * integer. Use bitshifting and masking to access the distinct red, green and blue + * component values: + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x x-coordinate of the point. + * @param int $y y-coordinate of the point. + * @return int Returns the index of the color. + * @throws ImageException + * + */ +function imagecolorat($image, int $x, int $y): int +{ + error_clear_last(); + $safeResult = \imagecolorat($image, $x, $y); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * De-allocates a color previously allocated with + * imagecolorallocate or + * imagecolorallocatealpha. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $color The color identifier. + * @throws ImageException + * + */ +function imagecolordeallocate($image, int $color): void +{ + error_clear_last(); + $safeResult = \imagecolordeallocate($image, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Makes the colors of the palette version of an image more closely match the true color version. + * + * @param resource $image1 A truecolor image object. + * @param resource $image2 A palette image object pointing to an image that has the same + * size as image1. + * @throws ImageException + * + */ +function imagecolormatch($image1, $image2): void +{ + error_clear_last(); + $safeResult = \imagecolormatch($image1, $image2); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * This sets the specified index in the palette to the specified + * color. This is useful for creating flood-fill-like effects in + * palleted images without the overhead of performing the actual + * flood-fill. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $color An index in the palette. + * @param int $red Value of red component. + * @param int $green Value of green component. + * @param int $blue Value of blue component. + * @param int $alpha Value of alpha component. + * @throws ImageException + * + */ +function imagecolorset($image, int $color, int $red, int $green, int $blue, int $alpha = 0): void +{ + error_clear_last(); + $safeResult = \imagecolorset($image, $color, $red, $green, $blue, $alpha); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Applies a convolution matrix on the image, using the given coefficient and + * offset. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param array $matrix A 3x3 matrix: an array of three arrays of three floats. + * @param float $divisor The divisor of the result of the convolution, used for normalization. + * @param float $offset Color offset. + * @throws ImageException + * + */ +function imageconvolution($image, array $matrix, float $divisor, float $offset): void +{ + error_clear_last(); + $safeResult = \imageconvolution($image, $matrix, $divisor, $offset); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Copy a part of src_image onto + * dst_image starting at the x,y coordinates + * src_x, src_y with + * a width of src_width and a height of + * src_height. The portion defined will be copied + * onto the x,y coordinates, dst_x and + * dst_y. + * + * @param resource $dst_image Destination image resource. + * @param resource $src_image Source image resource. + * @param int $dst_x x-coordinate of destination point. + * @param int $dst_y y-coordinate of destination point. + * @param int $src_x x-coordinate of source point. + * @param int $src_y y-coordinate of source point. + * @param int $src_width Source width. + * @param int $src_height Source height. + * @throws ImageException + * + */ +function imagecopy($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height): void +{ + error_clear_last(); + $safeResult = \imagecopy($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $src_width, $src_height); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Copy a part of src_image onto + * dst_image starting at the x,y coordinates + * src_x, src_y with + * a width of src_width and a height of + * src_height. The portion defined will be copied + * onto the x,y coordinates, dst_x and + * dst_y. + * + * @param resource $dst_image Destination image resource. + * @param resource $src_image Source image resource. + * @param int $dst_x x-coordinate of destination point. + * @param int $dst_y y-coordinate of destination point. + * @param int $src_x x-coordinate of source point. + * @param int $src_y y-coordinate of source point. + * @param int $src_width Source width. + * @param int $src_height Source height. + * @param int $pct The two images will be merged according to pct + * which can range from 0 to 100. When pct = 0, + * no action is taken, when 100 this function behaves identically + * to imagecopy for pallete images, except for + * ignoring alpha components, while it implements alpha transparency + * for true colour images. + * @throws ImageException + * + */ +function imagecopymerge($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height, int $pct): void +{ + error_clear_last(); + $safeResult = \imagecopymerge($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $src_width, $src_height, $pct); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagecopymergegray copy a part of src_image onto + * dst_image starting at the x,y coordinates + * src_x, src_y with + * a width of src_width and a height of + * src_height. The portion defined will be copied + * onto the x,y coordinates, dst_x and + * dst_y. + * + * This function is identical to imagecopymerge except + * that when merging it preserves the hue of the source by converting + * the destination pixels to gray scale before the copy operation. + * + * @param resource $dst_image Destination image resource. + * @param resource $src_image Source image resource. + * @param int $dst_x x-coordinate of destination point. + * @param int $dst_y y-coordinate of destination point. + * @param int $src_x x-coordinate of source point. + * @param int $src_y y-coordinate of source point. + * @param int $src_width Source width. + * @param int $src_height Source height. + * @param int $pct The src_image will be changed to grayscale according + * to pct where 0 is fully grayscale and 100 is + * unchanged. When pct = 100 this function behaves + * identically to imagecopy for pallete images, except for + * ignoring alpha components, while + * it implements alpha transparency for true colour images. + * @throws ImageException + * + */ +function imagecopymergegray($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height, int $pct): void +{ + error_clear_last(); + $safeResult = \imagecopymergegray($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $src_width, $src_height, $pct); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagecopyresampled copies a rectangular + * portion of one image to another image, smoothly interpolating pixel + * values so that, in particular, reducing the size of an image still + * retains a great deal of clarity. + * + * In other words, imagecopyresampled will take a + * rectangular area from src_image of width + * src_width and height src_height at + * position (src_x,src_y) + * and place it in a rectangular area of dst_image + * of width dst_width and height dst_height + * at position (dst_x,dst_y). + * + * If the source and destination coordinates and width and heights + * differ, appropriate stretching or shrinking of the image fragment + * will be performed. The coordinates refer to the upper left + * corner. This function can be used to copy regions within the + * same image (if dst_image is the same as + * src_image) but if the regions overlap the + * results will be unpredictable. + * + * @param resource $dst_image Destination image resource. + * @param resource $src_image Source image resource. + * @param int $dst_x x-coordinate of destination point. + * @param int $dst_y y-coordinate of destination point. + * @param int $src_x x-coordinate of source point. + * @param int $src_y y-coordinate of source point. + * @param int $dst_width Destination width. + * @param int $dst_height Destination height. + * @param int $src_width Source width. + * @param int $src_height Source height. + * @throws ImageException + * + */ +function imagecopyresampled($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_width, int $dst_height, int $src_width, int $src_height): void +{ + error_clear_last(); + $safeResult = \imagecopyresampled($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_width, $dst_height, $src_width, $src_height); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagecopyresized copies a rectangular + * portion of one image to another image. + * dst_image is the destination image, + * src_image is the source image identifier. + * + * In other words, imagecopyresized will take a + * rectangular area from src_image of width + * src_width and height src_height at + * position (src_x,src_y) + * and place it in a rectangular area of dst_image + * of width dst_width and height dst_height + * at position (dst_x,dst_y). + * + * If the source and destination coordinates and width and heights + * differ, appropriate stretching or shrinking of the image fragment + * will be performed. The coordinates refer to the upper left + * corner. This function can be used to copy regions within the + * same image (if dst_image is the same as + * src_image) but if the regions overlap the + * results will be unpredictable. + * + * @param resource $dst_image Destination image resource. + * @param resource $src_image Source image resource. + * @param int $dst_x x-coordinate of destination point. + * @param int $dst_y y-coordinate of destination point. + * @param int $src_x x-coordinate of source point. + * @param int $src_y y-coordinate of source point. + * @param int $dst_width Destination width. + * @param int $dst_height Destination height. + * @param int $src_width Source width. + * @param int $src_height Source height. + * @throws ImageException + * + */ +function imagecopyresized($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_width, int $dst_height, int $src_width, int $src_height): void +{ + error_clear_last(); + $safeResult = \imagecopyresized($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_width, $dst_height, $src_width, $src_height); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagecreate returns an image identifier + * representing a blank image of specified size. + * + * In general, we recommend the use of + * imagecreatetruecolor instead of + * imagecreate so that image processing occurs on the + * highest quality image possible. If you want to output a palette image, then + * imagetruecolortopalette should be called immediately + * before saving the image with imagepng or + * imagegif. + * + * @param int $width The image width. + * @param int $height The image height. + * @return resource|false Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreate(int $width, int $height) +{ + error_clear_last(); + $safeResult = \imagecreate($width, $height); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromavif returns an image object + * representing the image obtained from the given filename. + * + * @param string $filename Path to the AVIF raster image. + * @return Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromavif(string $filename): void +{ + error_clear_last(); + $safeResult = \imagecreatefromavif($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagecreatefrombmp returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the BMP image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefrombmp(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefrombmp($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Create a new image from GD file or URL. + * + * @param string $filename Path to the GD file. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromgd(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromgd($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Create a new image from GD2 file or URL. + * + * @param string $filename Path to the GD2 image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromgd2(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromgd2($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Create a new image from a given part of GD2 file or URL. + * + * @param string $filename Path to the GD2 image. + * @param int $x x-coordinate of source point. + * @param int $y y-coordinate of source point. + * @param int $width Source width. + * @param int $height Source height. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromgd2part(string $filename, int $x, int $y, int $width, int $height) +{ + error_clear_last(); + $safeResult = \imagecreatefromgd2part($filename, $x, $y, $width, $height); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromgif returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the GIF image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromgif(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromgif($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromjpeg returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the JPEG image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromjpeg(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromjpeg($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefrompng returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the PNG image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefrompng(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefrompng($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromstring returns an image identifier + * representing the image obtained from the given data. + * These types will be automatically detected if your build of PHP supports + * them: JPEG, PNG, GIF, BMP, WBMP, GD2, and WEBP. + * + * @param string $data A string containing the image data. + * @return resource An image object will be returned on success. FALSE is returned if + * the image type is unsupported, the data is not in a recognised format, + * or the image is corrupt and cannot be loaded. + * @throws ImageException + * + */ +function imagecreatefromstring(string $data) +{ + error_clear_last(); + $safeResult = \imagecreatefromstring($data); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromtga returns an image object + * representing the image obtained from the given filename. + * + * @param string $filename Path to the Truevision TGA image. + * @return Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromtga(string $filename): void +{ + error_clear_last(); + $safeResult = \imagecreatefromtga($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagecreatefromwbmp returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the WBMP image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromwbmp(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromwbmp($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromwebp returns an image identifier + * representing the image obtained from the given filename. + * Note that animated WebP files cannot be read. + * + * @param string $filename Path to the WebP image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromwebp(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromwebp($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromxbm returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the XBM image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromxbm(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromxbm($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromxpm returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the XPM image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromxpm(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromxpm($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatetruecolor returns an image object + * representing a black image of the specified size. + * + * @param int $width Image width. + * @param int $height Image height. + * @return resource|false Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatetruecolor(int $width, int $height) +{ + error_clear_last(); + $safeResult = \imagecreatetruecolor($width, $height); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Crops an image to the given rectangular area and returns the resulting image. + * The given image is not modified. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param array $rectangle The cropping rectangle as array with keys + * x, y, width and + * height. + * @return resource Return cropped image object on success. + * @throws ImageException + * + */ +function imagecrop($image, array $rectangle) +{ + error_clear_last(); + $safeResult = \imagecrop($image, $rectangle); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Automatically crops an image according to the given + * mode. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $mode One of the following constants: + * @param float $threshold + * @param int $color + * @return resource Returns a cropped image object on success. + * If the complete image was cropped, imagecrop returns FALSE. + * @throws ImageException + * + */ +function imagecropauto($image, int $mode = IMG_CROP_DEFAULT, float $threshold = 0.5, int $color = -1) +{ + error_clear_last(); + $safeResult = \imagecropauto($image, $mode, $threshold, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * This function is deprecated. Use combination of + * imagesetstyle and imageline + * instead. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x1 Upper left x coordinate. + * @param int $y1 Upper left y coordinate 0, 0 is the top left corner of the image. + * @param int $x2 Bottom right x coordinate. + * @param int $y2 Bottom right y coordinate. + * @param int $color The fill color. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagedashedline($image, int $x1, int $y1, int $x2, int $y2, int $color): void +{ + error_clear_last(); + $safeResult = \imagedashedline($image, $x1, $y1, $x2, $y2, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Prior to PHP 8.0.0, imagedestroy freed any memory associated + * with image image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @throws ImageException + * + */ +function imagedestroy($image): void +{ + error_clear_last(); + $safeResult = \imagedestroy($image); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws an ellipse centered at the specified coordinates. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $center_x x-coordinate of the center. + * @param int $center_y y-coordinate of the center. + * @param int $width The ellipse width. + * @param int $height The ellipse height. + * @param int $color The color of the ellipse. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imageellipse($image, int $center_x, int $center_y, int $width, int $height, int $color): void +{ + error_clear_last(); + $safeResult = \imageellipse($image, $center_x, $center_y, $width, $height, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Performs a flood fill starting at the given coordinate (top left is 0, 0) + * with the given color in the + * image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x x-coordinate of start point. + * @param int $y y-coordinate of start point. + * @param int $color The fill color. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagefill($image, int $x, int $y, int $color): void +{ + error_clear_last(); + $safeResult = \imagefill($image, $x, $y, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws a partial arc centered at the specified coordinate in the + * given image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $center_x x-coordinate of the center. + * @param int $center_y y-coordinate of the center. + * @param int $width The arc width. + * @param int $height The arc height. + * @param int $start_angle The arc start angle, in degrees. + * @param int $end_angle The arc end angle, in degrees. + * 0° is located at the three-o'clock position, and the arc is drawn + * clockwise. + * @param int $color A color identifier created with imagecolorallocate. + * @param int $style A bitwise OR of the following possibilities: + * + * IMG_ARC_PIE + * IMG_ARC_CHORD + * IMG_ARC_NOFILL + * IMG_ARC_EDGED + * + * IMG_ARC_PIE and IMG_ARC_CHORD are + * mutually exclusive; IMG_ARC_CHORD just + * connects the starting and ending angles with a straight line, while + * IMG_ARC_PIE produces a rounded edge. + * IMG_ARC_NOFILL indicates that the arc + * or chord should be outlined, not filled. IMG_ARC_EDGED, + * used together with IMG_ARC_NOFILL, indicates that the + * beginning and ending angles should be connected to the center - this is a + * good way to outline (rather than fill) a 'pie slice'. + * @throws ImageException + * + */ +function imagefilledarc($image, int $center_x, int $center_y, int $width, int $height, int $start_angle, int $end_angle, int $color, int $style): void +{ + error_clear_last(); + $safeResult = \imagefilledarc($image, $center_x, $center_y, $width, $height, $start_angle, $end_angle, $color, $style); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws an ellipse centered at the specified coordinate on the given + * image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $center_x x-coordinate of the center. + * @param int $center_y y-coordinate of the center. + * @param int $width The ellipse width. + * @param int $height The ellipse height. + * @param int $color The fill color. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagefilledellipse($image, int $center_x, int $center_y, int $width, int $height, int $color): void +{ + error_clear_last(); + $safeResult = \imagefilledellipse($image, $center_x, $center_y, $width, $height, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Creates a rectangle filled with color in the given + * image starting at point 1 and ending at point 2. + * 0, 0 is the top left corner of the image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x1 x-coordinate for point 1. + * @param int $y1 y-coordinate for point 1. + * @param int $x2 x-coordinate for point 2. + * @param int $y2 y-coordinate for point 2. + * @param int $color The fill color. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagefilledrectangle($image, int $x1, int $y1, int $x2, int $y2, int $color): void +{ + error_clear_last(); + $safeResult = \imagefilledrectangle($image, $x1, $y1, $x2, $y2, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagefilltoborder performs a flood fill + * whose border color is defined by border_color. + * The starting point for the fill is x, + * y (top left is 0, 0) and the region is + * filled with color color. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x x-coordinate of start. + * @param int $y y-coordinate of start. + * @param int $border_color The border color. A color identifier created with imagecolorallocate. + * @param int $color The fill color. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagefilltoborder($image, int $x, int $y, int $border_color, int $color): void +{ + error_clear_last(); + $safeResult = \imagefilltoborder($image, $x, $y, $border_color, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagefilter applies the given filter + * filter on the image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $filter filter can be one of the following: + * + * + * + * IMG_FILTER_NEGATE: Reverses all colors of + * the image. + * + * + * + * + * IMG_FILTER_GRAYSCALE: Converts the image into + * grayscale by changing the red, green and blue components to their + * weighted sum using the same coefficients as the REC.601 luma (Y') + * calculation. The alpha components are retained. For palette images the + * result may differ due to palette limitations. + * + * + * + * + * IMG_FILTER_BRIGHTNESS: Changes the brightness + * of the image. Use args to set the level of + * brightness. The range for the brightness is -255 to 255. + * + * + * + * + * IMG_FILTER_CONTRAST: Changes the contrast of + * the image. Use args to set the level of + * contrast. + * + * + * + * + * IMG_FILTER_COLORIZE: Like + * IMG_FILTER_GRAYSCALE, except you can specify the + * color. Use args, arg2 and + * arg3 in the form of + * red, green, + * blue and arg4 for the + * alpha channel. The range for each color is 0 to 255. + * + * + * + * + * IMG_FILTER_EDGEDETECT: Uses edge detection to + * highlight the edges in the image. + * + * + * + * + * IMG_FILTER_EMBOSS: Embosses the image. + * + * + * + * + * IMG_FILTER_GAUSSIAN_BLUR: Blurs the image using + * the Gaussian method. + * + * + * + * + * IMG_FILTER_SELECTIVE_BLUR: Blurs the image. + * + * + * + * + * IMG_FILTER_MEAN_REMOVAL: Uses mean removal to + * achieve a "sketchy" effect. + * + * + * + * + * IMG_FILTER_SMOOTH: Makes the image smoother. + * Use args to set the level of smoothness. + * + * + * + * + * IMG_FILTER_PIXELATE: Applies pixelation effect + * to the image, use args to set the block size + * and arg2 to set the pixelation effect mode. + * + * + * + * + * IMG_FILTER_SCATTER: Applies scatter effect + * to the image, use args and + * arg2 to define the effect strength and + * additionally arg3 to only apply the + * on select pixel colors. + * + * + * + * @param int $args + * + * + * IMG_FILTER_BRIGHTNESS: Brightness level. + * + * + * + * + * IMG_FILTER_CONTRAST: Contrast level. + * + * + * + * + * IMG_FILTER_COLORIZE: Value of red component. + * + * + * + * + * IMG_FILTER_SMOOTH: Smoothness level. + * + * + * + * + * IMG_FILTER_PIXELATE: Block size in pixels. + * + * + * + * + * IMG_FILTER_SCATTER: Effect substraction level. + * This must not be higher or equal to the addition level set with + * arg2. + * + * + * + * @throws ImageException + * + */ +function imagefilter($image, int $filter, int ...$args): void +{ + error_clear_last(); + if ($args !== []) { + $safeResult = \imagefilter($image, $filter, ...$args); + } else { + $safeResult = \imagefilter($image, $filter); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Flips the image image using the given + * mode. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $mode Flip mode, this can be one of the IMG_FLIP_* constants: + * + * + * + * + * + * Constant + * Meaning + * + * + * + * + * IMG_FLIP_HORIZONTAL + * + * Flips the image horizontally. + * + * + * + * IMG_FLIP_VERTICAL + * + * Flips the image vertically. + * + * + * + * IMG_FLIP_BOTH + * + * Flips the image both horizontally and vertically. + * + * + * + * + * + * @throws ImageException + * + */ +function imageflip($image, int $mode): void +{ + error_clear_last(); + $safeResult = \imageflip($image, $mode); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * This function calculates and returns the bounding box in pixels + * for a FreeType text. + * + * @param float $size The font size in points. + * @param float $angle Angle in degrees in which string will be + * measured. + * @param string $font_filename The name of the TrueType font file (can be a URL). Depending on + * which version of the GD library that PHP is using, it may attempt to + * search for files that do not begin with a leading '/' by appending + * '.ttf' to the filename and searching along a library-defined font path. + * @param string $string The string to be measured. + * @param array $options + * Possible array indexes for options + * + * + * + * Key + * Type + * Meaning + * + * + * + * + * linespacing + * float + * Defines drawing linespacing + * + * + * + * + * @return array imageftbbox returns an array with 8 + * elements representing four points making the bounding box of the + * text: + * + * + * + * + * 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. + * + * On failure, FALSE is returned. + * @throws ImageException + * + */ +function imageftbbox(float $size, float $angle, string $font_filename, string $string, array $options = []): array +{ + error_clear_last(); + $safeResult = \imageftbbox($size, $angle, $font_filename, $string, $options); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param float $size The font size to use 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 index of the desired color for the text, see + * imagecolorexact. + * @param string $font_filename The path to the TrueType font you wish to use. + * + * Depending on which version of the GD library PHP is using, when + * font_filename 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. + * + * In many cases where a font resides in the same directory as the script using it + * the following trick will alleviate any include problems. + * + * + * ]]> + * + * @param string $text Text to be inserted into image. + * @param array $options + * Possible array indexes for options + * + * + * + * Key + * Type + * Meaning + * + * + * + * + * linespacing + * float + * Defines drawing linespacing + * + * + * + * + * @return array This function returns an array defining the four points of the box, starting in the lower left and moving counter-clockwise: + * + * + * + * + * 0 + * lower left x-coordinate + * + * + * 1 + * lower left y-coordinate + * + * + * 2 + * lower right x-coordinate + * + * + * 3 + * lower right y-coordinate + * + * + * 4 + * upper right x-coordinate + * + * + * 5 + * upper right y-coordinate + * + * + * 6 + * upper left x-coordinate + * + * + * 7 + * upper left y-coordinate + * + * + * + * + * + * On failure, FALSE is returned. + * @throws ImageException + * + */ +function imagefttext($image, float $size, float $angle, int $x, int $y, int $color, string $font_filename, string $text, array $options = []): array +{ + error_clear_last(); + $safeResult = \imagefttext($image, $size, $angle, $x, $y, $color, $font_filename, $text, $options); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Applies gamma correction to the given gd image + * given an input and an output gamma. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param float $input_gamma The input gamma. + * @param float $output_gamma The output gamma. + * @throws ImageException + * + */ +function imagegammacorrect($image, float $input_gamma, float $output_gamma): void +{ + error_clear_last(); + $safeResult = \imagegammacorrect($image, $input_gamma, $output_gamma); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Outputs a GD image to the given file. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @throws ImageException + * + */ +function imagegd($image, $file = null): void +{ + error_clear_last(); + if ($file !== null) { + $safeResult = \imagegd($image, $file); + } else { + $safeResult = \imagegd($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Outputs a GD2 image to the given file. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @param int $chunk_size Chunk size. + * @param int $mode Either IMG_GD2_RAW or + * IMG_GD2_COMPRESSED. Default is + * IMG_GD2_RAW. + * @throws ImageException + * + */ +function imagegd2($image, $file = null, int $chunk_size = 128, int $mode = IMG_GD2_RAW): void +{ + error_clear_last(); + if ($mode !== IMG_GD2_RAW) { + $safeResult = \imagegd2($image, $file, $chunk_size, $mode); + } elseif ($chunk_size !== 128) { + $safeResult = \imagegd2($image, $file, $chunk_size); + } elseif ($file !== null) { + $safeResult = \imagegd2($image, $file); + } else { + $safeResult = \imagegd2($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagegif creates the GIF + * file in file from the image image. The + * image argument is the return from the + * imagecreate or imagecreatefrom* + * function. + * + * The image format will be GIF87a unless the + * image has been made transparent with + * imagecolortransparent, in which case the + * image format will be GIF89a. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @throws ImageException + * + */ +function imagegif($image, $file = null): void +{ + error_clear_last(); + if ($file !== null) { + $safeResult = \imagegif($image, $file); + } else { + $safeResult = \imagegif($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Grabs a screenshot of the whole screen. + * + * @return resource Returns an image object on success, FALSE on failure. + * @throws ImageException + * + */ +function imagegrabscreen() +{ + error_clear_last(); + $safeResult = \imagegrabscreen(); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Grabs a window or its client area using a windows handle (HWND property in COM instance) + * + * @param int $handle The HWND window ID. + * @param bool $client_area Include the client area of the application window. + * @return \GdImage Returns an image object on success, FALSE on failure. + * @throws ImageException + * + */ +function imagegrabwindow(int $handle, bool $client_area = false): \GdImage +{ + error_clear_last(); + $safeResult = \imagegrabwindow($handle, $client_area); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagejpeg creates a JPEG file from + * the given image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @param int $quality quality is optional, and ranges from 0 (worst + * quality, smaller file) to 100 (best quality, biggest file). The + * default (-1) uses the default IJG quality value (about 75). + * @throws ImageException + * + */ +function imagejpeg($image, $file = null, int $quality = -1): void +{ + error_clear_last(); + if ($quality !== -1) { + $safeResult = \imagejpeg($image, $file, $quality); + } elseif ($file !== null) { + $safeResult = \imagejpeg($image, $file); + } else { + $safeResult = \imagejpeg($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Set the alpha blending flag to use layering effects. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $effect One of the following constants: + * + * + * IMG_EFFECT_REPLACE + * + * + * Use pixel replacement (equivalent of passing TRUE to + * imagealphablending) + * + * + * + * + * IMG_EFFECT_ALPHABLEND + * + * + * Use normal pixel blending (equivalent of passing FALSE to + * imagealphablending) + * + * + * + * + * IMG_EFFECT_NORMAL + * + * + * Same as IMG_EFFECT_ALPHABLEND. + * + * + * + * + * IMG_EFFECT_OVERLAY + * + * + * Overlay has the effect that black background pixels will remain + * black, white background pixels will remain white, but grey + * background pixels will take the colour of the foreground pixel. + * + * + * + * + * IMG_EFFECT_MULTIPLY + * + * + * Overlays with a multiply effect. + * + * + * + * + * @throws ImageException + * + */ +function imagelayereffect($image, int $effect): void +{ + error_clear_last(); + $safeResult = \imagelayereffect($image, $effect); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws a line between the two given points. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x1 x-coordinate for first point. + * @param int $y1 y-coordinate for first point. + * @param int $x2 x-coordinate for second point. + * @param int $y2 y-coordinate for second point. + * @param int $color The line color. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imageline($image, int $x1, int $y1, int $x2, int $y2, int $color): void +{ + error_clear_last(); + $safeResult = \imageline($image, $x1, $y1, $x2, $y2, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imageloadfont loads a user-defined bitmap and returns + * its identifier. + * + * @param string $filename The font file format is currently binary and architecture + * dependent. This means you should generate the font files on the + * same type of CPU as the machine you are running PHP on. + * + * + * Font file format + * + * + * + * byte position + * C data type + * description + * + * + * + * + * byte 0-3 + * int + * number of characters in the font + * + * + * byte 4-7 + * int + * + * value of first character in the font (often 32 for space) + * + * + * + * byte 8-11 + * int + * pixel width of each character + * + * + * byte 12-15 + * int + * pixel height of each character + * + * + * byte 16- + * char + * + * array with character data, one byte per pixel in each + * character, for a total of (nchars*width*height) bytes. + * + * + * + * + * + * @return int Returns an GdFont instance. + * @throws ImageException + * + */ +function imageloadfont(string $filename): int +{ + error_clear_last(); + $safeResult = \imageloadfont($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Outputs or saves a PNG image from the given + * image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * + * NULL is invalid if the quality and + * filters arguments are not used. + * @param int $quality Compression level: from 0 (no compression) to 9. + * The default (-1) uses the zlib compression default. + * For more information see the zlib manual. + * @param int $filters Allows reducing the PNG file size. It is a bitmask field which may be + * set to any combination of the PNG_FILTER_XXX + * constants. PNG_NO_FILTER or + * PNG_ALL_FILTERS may also be used to respectively + * disable or activate all filters. + * The default value (-1) disables filtering. + * @throws ImageException + * + */ +function imagepng($image, $file = null, int $quality = -1, int $filters = -1): void +{ + error_clear_last(); + if ($filters !== -1) { + $safeResult = \imagepng($image, $file, $quality, $filters); + } elseif ($quality !== -1) { + $safeResult = \imagepng($image, $file, $quality); + } elseif ($file !== null) { + $safeResult = \imagepng($image, $file); + } else { + $safeResult = \imagepng($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagerectangle creates a rectangle starting at + * the specified coordinates. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x1 Upper left x coordinate. + * @param int $y1 Upper left y coordinate + * 0, 0 is the top left corner of the image. + * @param int $x2 Bottom right x coordinate. + * @param int $y2 Bottom right y coordinate. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagerectangle($image, int $x1, int $y1, int $x2, int $y2, int $color): void +{ + error_clear_last(); + $safeResult = \imagerectangle($image, $x1, $y1, $x2, $y2, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imageresolution allows to set and get the resolution of + * an image in DPI (dots per inch). If the optional parameters are NULL, + * the current resolution is returned as an indexed array. If only + * resolution_x is not NULL, the horizontal and vertical resolution + * are set to this value. If none of the optional parameters are NULL, the horizontal + * and vertical resolution are set to these values, respectively. + * + * The resolution is only used as meta information when images are read from and + * written to formats supporting this kind of information (curently PNG and + * JPEG). It does not affect any drawing operations. The default resolution + * for new images is 96 DPI. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $resolution_x The horizontal resolution in DPI. + * @param int $resolution_y The vertical resolution in DPI. + * @return mixed When used as getter, + * it returns an indexed array of the horizontal and vertical resolution on + * success. + * When used as setter, it returns + * TRUE on success. + * @throws ImageException + * + */ +function imageresolution($image, ?int $resolution_x = null, ?int $resolution_y = null) +{ + error_clear_last(); + if ($resolution_y !== null) { + $safeResult = \imageresolution($image, $resolution_x, $resolution_y); + } elseif ($resolution_x !== null) { + $safeResult = \imageresolution($image, $resolution_x); + } else { + $safeResult = \imageresolution($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Rotates the image image using the given + * angle in degrees. + * + * The center of rotation is the center of the image, and the rotated + * image may have different dimensions than the original image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param float $angle Rotation angle, in degrees. The rotation angle is interpreted as the + * number of degrees to rotate the image anticlockwise. + * @param int $background_color Specifies the color of the uncovered zone after the rotation + * @param bool $ignore_transparent This parameter is unused. + * @return resource Returns an image object for the rotated image. + * @throws ImageException + * + */ +function imagerotate($image, float $angle, int $background_color, bool $ignore_transparent = false) +{ + error_clear_last(); + $safeResult = \imagerotate($image, $angle, $background_color, $ignore_transparent); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagesavealpha sets the flag which determines whether to retain + * full alpha channel information (as opposed to single-color transparency) + * when saving images. + * This is only supported for image formats which support full alpha channel information, + * i.e. PNG, WebP and AVIF. + * + * + * imagesavealpha is only meaningful for PNG + * images, since the full alpha channel is always saved for WebP + * and AVIF. It is not recommended to rely on this behavior, + * as it may change in the future. Thus, imagesavealpha + * should be called deliberately also for WebP and + * AVIF images. + * + * + * + * Alphablending has to be disabled (imagealphablending($im, false)) + * to retain the alpha-channel in the first place. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param bool $enable Whether to save the alpha channel or not. Defaults to FALSE. + * @throws ImageException + * + */ +function imagesavealpha($image, bool $enable): void +{ + error_clear_last(); + $safeResult = \imagesavealpha($image, $enable); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagescale scales an image using the given + * interpolation algorithm. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $width The width to scale the image to. + * @param int $height The height to scale the image to. If omitted or negative, the aspect + * ratio will be preserved. + * @param int $mode One of IMG_NEAREST_NEIGHBOUR, + * IMG_BILINEAR_FIXED, + * IMG_BICUBIC, + * IMG_BICUBIC_FIXED or anything else (will use two + * pass). + * + * + * IMG_WEIGHTED4 is not yet supported. + * + * + * @return resource Return the scaled image object on success. + * @throws ImageException + * + */ +function imagescale($image, int $width, int $height = -1, int $mode = IMG_BILINEAR_FIXED) +{ + error_clear_last(); + $safeResult = \imagescale($image, $width, $height, $mode); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagesetbrush sets the brush image to be + * used by all line drawing functions (such as imageline + * and imagepolygon) when drawing with the special + * colors IMG_COLOR_BRUSHED or + * IMG_COLOR_STYLEDBRUSHED. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param resource $brush An image object. + * @throws ImageException + * + */ +function imagesetbrush($image, $brush): void +{ + error_clear_last(); + $safeResult = \imagesetbrush($image, $brush); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagesetclip sets the current clipping rectangle, i.e. + * the area beyond which no pixels will be drawn. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x1 The x-coordinate of the upper left corner. + * @param int $y1 The y-coordinate of the upper left corner. + * @param int $x2 The x-coordinate of the lower right corner. + * @param int $y2 The y-coordinate of the lower right corner. + * @throws ImageException + * + */ +function imagesetclip($image, int $x1, int $y1, int $x2, int $y2): void +{ + error_clear_last(); + $safeResult = \imagesetclip($image, $x1, $y1, $x2, $y2); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Sets the interpolation method, setting an interpolation method affects the rendering + * of various functions in GD, such as the imagerotate function. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $method The interpolation method, which can be one of the following: + * + * + * + * IMG_BELL: Bell filter. + * + * + * + * + * IMG_BESSEL: Bessel filter. + * + * + * + * + * IMG_BICUBIC: Bicubic interpolation. + * + * + * + * + * IMG_BICUBIC_FIXED: Fixed point implementation of the bicubic interpolation. + * + * + * + * + * IMG_BILINEAR_FIXED: Fixed point implementation of the bilinear interpolation (default (also on image creation)). + * + * + * + * + * IMG_BLACKMAN: Blackman window function. + * + * + * + * + * IMG_BOX: Box blur filter. + * + * + * + * + * IMG_BSPLINE: Spline interpolation. + * + * + * + * + * IMG_CATMULLROM: Cubic Hermite spline interpolation. + * + * + * + * + * IMG_GAUSSIAN: Gaussian function. + * + * + * + * + * IMG_GENERALIZED_CUBIC: Generalized cubic spline fractal interpolation. + * + * + * + * + * IMG_HERMITE: Hermite interpolation. + * + * + * + * + * IMG_HAMMING: Hamming filter. + * + * + * + * + * IMG_HANNING: Hanning filter. + * + * + * + * + * IMG_MITCHELL: Mitchell filter. + * + * + * + * + * IMG_POWER: Power interpolation. + * + * + * + * + * IMG_QUADRATIC: Inverse quadratic interpolation. + * + * + * + * + * IMG_SINC: Sinc function. + * + * + * + * + * IMG_NEAREST_NEIGHBOUR: Nearest neighbour interpolation. + * + * + * + * + * IMG_WEIGHTED4: Weighting filter. + * + * + * + * + * IMG_TRIANGLE: Triangle interpolation. + * + * + * + * @throws ImageException + * + */ +function imagesetinterpolation($image, int $method = IMG_BILINEAR_FIXED): void +{ + error_clear_last(); + $safeResult = \imagesetinterpolation($image, $method); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagesetpixel draws a pixel at the specified + * coordinate. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x x-coordinate. + * @param int $y y-coordinate. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagesetpixel($image, int $x, int $y, int $color): void +{ + error_clear_last(); + $safeResult = \imagesetpixel($image, $x, $y, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagesetstyle sets the style to be used by all + * line drawing functions (such as imageline + * and imagepolygon) when drawing with the special + * color IMG_COLOR_STYLED or lines of images with color + * IMG_COLOR_STYLEDBRUSHED. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param array $style An array of pixel colors. You can use the + * IMG_COLOR_TRANSPARENT constant to add a + * transparent pixel. + * Note that style must not be an empty array. + * @throws ImageException + * + */ +function imagesetstyle($image, array $style): void +{ + error_clear_last(); + $safeResult = \imagesetstyle($image, $style); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagesetthickness sets the thickness of the lines + * drawn when drawing rectangles, polygons, arcs etc. to + * thickness pixels. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $thickness Thickness, in pixels. + * @throws ImageException + * + */ +function imagesetthickness($image, int $thickness): void +{ + error_clear_last(); + $safeResult = \imagesetthickness($image, $thickness); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagesettile sets the tile image to be + * used by all region filling functions (such as imagefill + * and imagefilledpolygon) when filling with the special + * color IMG_COLOR_TILED. + * + * A tile is an image used to fill an area with a repeated pattern. Any + * GD image can be used as a tile, and by setting the transparent color index of the tile + * image with imagecolortransparent, a tile allows certain parts + * of the underlying area to shine through can be created. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param resource $tile The image object to be used as a tile. + * @throws ImageException + * + */ +function imagesettile($image, $tile): void +{ + error_clear_last(); + $safeResult = \imagesettile($image, $tile); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws a string at the given coordinates. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $font Can be 1, 2, 3, 4, 5 for built-in + * fonts in latin2 encoding (where higher numbers corresponding to larger fonts) or GdFont instance, + * returned by imageloadfont. + * @param int $x x-coordinate of the upper left corner. + * @param int $y y-coordinate of the upper left corner. + * @param string $string The string to be written. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagestring($image, int $font, int $x, int $y, string $string, int $color): void +{ + error_clear_last(); + $safeResult = \imagestring($image, $font, $x, $y, $string, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws a string vertically at the given + * coordinates. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $font Can be 1, 2, 3, 4, 5 for built-in + * fonts in latin2 encoding (where higher numbers corresponding to larger fonts) or GdFont instance, + * returned by imageloadfont. + * @param int $x x-coordinate of the bottom left corner. + * @param int $y y-coordinate of the bottom left corner. + * @param string $string The string to be written. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagestringup($image, int $font, int $x, int $y, string $string, int $color): void +{ + error_clear_last(); + $safeResult = \imagestringup($image, $font, $x, $y, $string, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Returns the width of the given image object. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @return int Return the width of the images. + * @throws ImageException + * + */ +function imagesx($image): int +{ + error_clear_last(); + $safeResult = \imagesx($image); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Returns the height of the given image object. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @return int Return the height of the images. + * @throws ImageException + * + */ +function imagesy($image): int +{ + error_clear_last(); + $safeResult = \imagesy($image); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagetruecolortopalette converts a truecolor image + * to a palette image. The code for this function was originally drawn from + * the Independent JPEG Group library code, which is excellent. The code + * has been modified to preserve as much alpha channel information as + * possible in the resulting palette, in addition to preserving colors as + * well as possible. This does not work as well as might be hoped. It is + * usually best to simply produce a truecolor output image instead, which + * guarantees the highest output quality. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param bool $dither Indicates if the image should be dithered - if it is TRUE then + * dithering will be used which will result in a more speckled image but + * with better color approximation. + * @param int $num_colors Sets the maximum number of colors that should be retained in the palette. + * @throws ImageException + * + */ +function imagetruecolortopalette($image, bool $dither, int $num_colors): void +{ + error_clear_last(); + $safeResult = \imagetruecolortopalette($image, $dither, $num_colors); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * This function calculates and returns the bounding box in pixels + * for a TrueType text. + * + * @param float $size The font size in points. + * @param float $angle Angle in degrees in which string will be measured. + * @param string $font_filename 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 $string The string to be measured. + * @param array $options + * @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 ImageException + * + */ +function imagettfbbox(float $size, float $angle, string $font_filename, string $string, array $options = []): array +{ + error_clear_last(); + $safeResult = \imagettfbbox($size, $angle, $font_filename, $string, $options); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Writes the given text into the image using TrueType + * fonts. + * + * @param resource $image A GdImage object, 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 $font_filename 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. + * @param array $options + * @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. + * @throws ImageException + * + */ +function imagettftext($image, float $size, float $angle, int $x, int $y, int $color, string $font_filename, string $text, array $options = []): array +{ + error_clear_last(); + $safeResult = \imagettftext($image, $size, $angle, $x, $y, $color, $font_filename, $text, $options); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagewbmp outputs or save a WBMP + * version of the given image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @param int $foreground_color You can set the foreground color with this parameter by setting an + * identifier obtained from imagecolorallocate. + * The default foreground color is black. + * @throws ImageException + * + */ +function imagewbmp($image, $file = null, ?int $foreground_color = null): void +{ + error_clear_last(); + if ($foreground_color !== null) { + $safeResult = \imagewbmp($image, $file, $foreground_color); + } elseif ($file !== null) { + $safeResult = \imagewbmp($image, $file); + } else { + $safeResult = \imagewbmp($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Outputs or saves a WebP version of the given image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @param int $quality quality ranges from 0 (worst + * quality, smaller file) to 100 (best quality, biggest file). + * @throws ImageException + * + */ +function imagewebp($image, $file = null, int $quality = -1): void +{ + error_clear_last(); + if ($quality !== -1) { + $safeResult = \imagewebp($image, $file, $quality); + } elseif ($file !== null) { + $safeResult = \imagewebp($image, $file); + } else { + $safeResult = \imagewebp($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Outputs or save an XBM version of the given + * image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $filename The path to save the file to, given as string. If NULL, the raw image stream will be output 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_color 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 ImageException + * + */ +function imagexbm($image, $filename, ?int $foreground_color = null): void +{ + error_clear_last(); + if ($foreground_color !== null) { + $safeResult = \imagexbm($image, $filename, $foreground_color); + } else { + $safeResult = \imagexbm($image, $filename); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Embeds binary IPTC data into a JPEG image. + * + * @param string $iptc_data The data to be written. + * @param string $filename 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 string|bool If spool is less than 2, the JPEG will be returned. Otherwise returns TRUE on success. + * @throws ImageException + * + */ +function iptcembed(string $iptc_data, string $filename, int $spool = 0) +{ + error_clear_last(); + $safeResult = \iptcembed($iptc_data, $filename, $spool); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Parses an IPTC block into its single tags. + * + * @param string $iptc_block 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 ImageException + * + */ +function iptcparse(string $iptc_block): array +{ + error_clear_last(); + $safeResult = \iptcparse($iptc_block); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 ImageException + * + */ +function jpeg2wbmp(string $jpegname, string $wbmpname, int $dest_height, int $dest_width, int $threshold): void +{ + error_clear_last(); + $safeResult = \jpeg2wbmp($jpegname, $wbmpname, $dest_height, $dest_width, $threshold); + if ($safeResult === false) { + throw 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 ImageException + * + */ +function png2wbmp(string $pngname, string $wbmpname, int $dest_height, int $dest_width, int $threshold): void +{ + error_clear_last(); + $safeResult = \png2wbmp($pngname, $wbmpname, $dest_height, $dest_width, $threshold); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} diff --git a/generated/8.2/imap.php b/generated/8.2/imap.php new file mode 100644 index 00000000..9262c489 --- /dev/null +++ b/generated/8.2/imap.php @@ -0,0 +1,2289 @@ + + * + * + * @param array $controls Array of LDAP Controls to send with the request. + * @throws LdapException + * + */ +function ldap_add($ldap, string $dn, array $entry, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_add($ldap, $dn, $entry, $controls); + } else { + $safeResult = \ldap_add($ldap, $dn, $entry); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Binds to the LDAP directory with specified RDN and password. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param string|null $dn + * @param string|null $password + * @throws LdapException + * + */ +function ldap_bind($ldap, ?string $dn = null, ?string $password = null): void +{ + error_clear_last(); + if ($password !== null) { + $safeResult = \ldap_bind($ldap, $dn, $password); + } elseif ($dn !== null) { + $safeResult = \ldap_bind($ldap, $dn); + } else { + $safeResult = \ldap_bind($ldap); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Retrieve the pagination information send by the server. + * + * @param resource $link An LDAP resource, returned by ldap_connect. + * @param resource $result + * @param string|null $cookie An opaque structure sent by the server. + * @param int|null $estimated The estimated number of entries to retrieve. + * @throws LdapException + * + */ +function ldap_control_paged_result_response($link, $result, ?string &$cookie = null, ?int &$estimated = null): void +{ + error_clear_last(); + $safeResult = \ldap_control_paged_result_response($link, $result, $cookie, $estimated); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Enable LDAP pagination by sending the pagination control (page size, cookie...). + * + * @param resource $link An LDAP resource, 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 LdapException + * + */ +function ldap_control_paged_result($link, int $pagesize, bool $iscritical = false, string $cookie = ""): void +{ + error_clear_last(); + $safeResult = \ldap_control_paged_result($link, $pagesize, $iscritical, $cookie); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Returns the number of entries stored in the result of previous search + * operations. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $result An LDAP\Result instance, returned by ldap_list or ldap_search. + * @return int Returns number of entries in the result. + * @throws LdapException + * + */ +function ldap_count_entries($ldap, $result): int +{ + error_clear_last(); + $safeResult = \ldap_count_entries($ldap, $result); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Deletes a particular entry in LDAP directory. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param string $dn The distinguished name of an LDAP entity. + * @param array $controls Array of LDAP Controls to send with the request. + * @throws LdapException + * + */ +function ldap_delete($ldap, string $dn, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_delete($ldap, $dn, $controls); + } else { + $safeResult = \ldap_delete($ldap, $dn); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Turns the specified dn, into a more user-friendly + * form, stripping off type names. + * + * @param string $dn The distinguished name of an LDAP entity. + * @return string Returns the user friendly name. + * @throws LdapException + * + */ +function ldap_dn2ufn(string $dn): string +{ + error_clear_last(); + $safeResult = \ldap_dn2ufn($dn); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Performs a PASSWD extended operation. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param string $user dn of the user to change the password of. + * @param string $old_password The old password of this user. May be ommited depending of server configuration. + * @param string $new_password The new password for this user. May be omitted or empty to have a generated password. + * @param array $controls If provided, a password policy request control is send with the request and this is + * filled with an array of LDAP Controls + * returned with the request. + * @return string|bool Returns the generated password if new_password is empty or omitted. + * Otherwise returns TRUE on success. + * @throws LdapException + * + */ +function ldap_exop_passwd($ldap, string $user = "", string $old_password = "", string $new_password = "", ?array &$controls = null) +{ + error_clear_last(); + $safeResult = \ldap_exop_passwd($ldap, $user, $old_password, $new_password, $controls); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Performs a WHOAMI extended operation and returns the data. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @return string|bool The data returned by the server. + * @throws LdapException + * + */ +function ldap_exop_whoami($ldap) +{ + error_clear_last(); + $safeResult = \ldap_exop_whoami($ldap); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Performs an extended operation on the specified ldap with + * request_oid the OID of the operation and + * request_data the data. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param string $request_oid 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 $request_data 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|null $controls Array of LDAP Controls to send with the request. + * @param string|null $response_data 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|null $response_oid Will be filled with the response OID if provided, usually equal to the request OID. + * @return resource|bool When used with response_data, returns TRUE on success. + * When used without response_data, returns a result identifier. + * @throws LdapException + * + */ +function ldap_exop($ldap, string $request_oid, ?string $request_data = null, ?array $controls = null, ?string &$response_data = null, ?string &$response_oid = null) +{ + error_clear_last(); + if ($response_oid !== null) { + $safeResult = \ldap_exop($ldap, $request_oid, $request_data, $controls, $response_data, $response_oid); + } elseif ($response_data !== null) { + $safeResult = \ldap_exop($ldap, $request_oid, $request_data, $controls, $response_data); + } elseif ($controls !== null) { + $safeResult = \ldap_exop($ldap, $request_oid, $request_data, $controls); + } elseif ($request_data !== null) { + $safeResult = \ldap_exop($ldap, $request_oid, $request_data); + } else { + $safeResult = \ldap_exop($ldap, $request_oid); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 LdapException + * + */ +function ldap_explode_dn(string $dn, int $with_attrib): array +{ + error_clear_last(); + $safeResult = \ldap_explode_dn($dn, $with_attrib); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $entry An LDAP\ResultEntry instance. + * @return string Returns the first attribute in the entry on success and FALSE on + * error. + * @throws LdapException + * + */ +function ldap_first_attribute($ldap, $entry): string +{ + error_clear_last(); + $safeResult = \ldap_first_attribute($ldap, $entry); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $result An LDAP\Result instance, returned by ldap_list or ldap_search. + * @return resource Returns an LDAP\ResultEntry instance. + * @throws LdapException + * + */ +function ldap_first_entry($ldap, $result) +{ + error_clear_last(); + $safeResult = \ldap_first_entry($ldap, $result); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 An LDAP\Result instance, returned by ldap_list or ldap_search. + * @throws LdapException + * + */ +function ldap_free_result($result): void +{ + error_clear_last(); + $safeResult = \ldap_free_result($result); + if ($safeResult === false) { + throw 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 $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $entry An LDAP\ResultEntry instance. + * @return array Returns a complete entry information in a multi-dimensional array + * on success and FALSE on error. + * @throws LdapException + * + */ +function ldap_get_attributes($ldap, $entry): array +{ + error_clear_last(); + $safeResult = \ldap_get_attributes($ldap, $entry); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Finds out the DN of an entry in the result. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $entry An LDAP\ResultEntry instance. + * @return string Returns the DN of the result entry and FALSE on error. + * @throws LdapException + * + */ +function ldap_get_dn($ldap, $entry): string +{ + error_clear_last(); + $safeResult = \ldap_get_dn($ldap, $entry); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Reads multiple entries from the given result, and then reading the + * attributes and multiple values. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $result An LDAP\Result instance, returned by ldap_list or ldap_search. + * @return array Returns a complete result information in a multi-dimensional array on + * success. + * + * 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 LdapException + * + */ +function ldap_get_entries($ldap, $result): array +{ + error_clear_last(); + $safeResult = \ldap_get_entries($ldap, $result); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Sets value to the value of the specified option. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param int $option The parameter option can be one of: + * + * + * + * + * Option + * Type + * since + * + * + * + * + * LDAP_OPT_DEREF + * int + * + * + * + * LDAP_OPT_SIZELIMIT + * int + * + * + * + * LDAP_OPT_TIMELIMIT + * int + * + * + * + * LDAP_OPT_NETWORK_TIMEOUT + * int + * + * + * + * LDAP_OPT_PROTOCOL_VERSION + * int + * + * + * + * LDAP_OPT_ERROR_NUMBER + * int + * + * + * + * LDAP_OPT_DIAGNOSTIC_MESSAGE + * string + * + * + * + * LDAP_OPT_REFERRALS + * int + * + * + * + * LDAP_OPT_RESTART + * int + * + * + * + * 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 + * int + * 7.1 + * + * + * LDAP_OPT_X_TLS_CRL_NONE + * int + * 7.1 + * + * + * LDAP_OPT_X_TLS_CRL_PEER + * int + * 7.1 + * + * + * LDAP_OPT_X_TLS_CRL_ALL + * int + * 7.1 + * + * + * LDAP_OPT_X_TLS_CRLFILE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_DHFILE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_KEYFILE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_PACKAGE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_PROTOCOL_MIN + * int + * 7.1 + * + * + * LDAP_OPT_X_TLS_RANDOM_FILE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_REQUIRE_CERT + * int + * + * + * + * + * + * @param mixed $value This will be set to the option value. + * @throws LdapException + * + */ +function ldap_get_option($ldap, int $option, &$value = null): void +{ + error_clear_last(); + $safeResult = \ldap_get_option($ldap, $option, $value); + if ($safeResult === false) { + throw 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 $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $entry An LDAP\ResultEntry instance. + * @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 LdapException + * + */ +function ldap_get_values_len($ldap, $entry, string $attribute): array +{ + error_clear_last(); + $safeResult = \ldap_get_values_len($ldap, $entry, $attribute); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Reads all the values of the attribute in the entry in the result. + * + * This call needs a entry, + * 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 $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $entry An LDAP\ResultEntry instance. + * @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 LdapException + * + */ +function ldap_get_values($ldap, $entry, string $attribute): array +{ + error_clear_last(); + $safeResult = \ldap_get_values($ldap, $entry, $attribute); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Adds one or more attribute values to the specified dn. + * To add a whole new object see ldap_add function. + * + * @param resource $ldap An LDAP\Connection instance, 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 $controls Array of LDAP Controls to send with the request. + * @throws LdapException + * + */ +function ldap_mod_add($ldap, string $dn, array $entry, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_mod_add($ldap, $dn, $entry, $controls); + } else { + $safeResult = \ldap_mod_add($ldap, $dn, $entry); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Removes one or more attribute values from the specified dn. + * Object deletions are done by the + * ldap_delete function. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param string $dn The distinguished name of an LDAP entity. + * @param array $entry + * @param array $controls Array of LDAP Controls to send with the request. + * @throws LdapException + * + */ +function ldap_mod_del($ldap, string $dn, array $entry, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_mod_del($ldap, $dn, $entry, $controls); + } else { + $safeResult = \ldap_mod_del($ldap, $dn, $entry); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Replaces one or more attributes from the specified dn. + * It may also add or remove attributes. + * + * @param resource $ldap An LDAP\Connection instance, 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 $controls Array of LDAP Controls to send with the request. + * @throws LdapException + * + */ +function ldap_mod_replace($ldap, string $dn, array $entry, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_mod_replace($ldap, $dn, $entry, $controls); + } else { + $safeResult = \ldap_mod_replace($ldap, $dn, $entry); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Modifies an existing entry in the LDAP directory. Allows detailed + * specification of the modifications to perform. + * + * @param resource $ldap An LDAP resource, returned by ldap_connect. + * @param string $dn The distinguished name of an LDAP entity. + * @param array $modifications_info 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 $controls Each value specified through values is added (as + * an additional value) to the attribute named by + * attrib. + * @throws LdapException + * + */ +function ldap_modify_batch($ldap, string $dn, array $modifications_info, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_modify_batch($ldap, $dn, $modifications_info, $controls); + } else { + $safeResult = \ldap_modify_batch($ldap, $dn, $modifications_info); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Retrieves the attributes in an entry. The first call to + * ldap_next_attribute is made with the + * entry returned from + * ldap_first_attribute. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $entry An LDAP\ResultEntry instance. + * @return string Returns the next attribute in an entry on success and FALSE on + * error. + * @throws LdapException + * + */ +function ldap_next_attribute($ldap, $entry): string +{ + error_clear_last(); + $safeResult = \ldap_next_attribute($ldap, $entry); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Parse LDAP extended operation data from result object result + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $result An LDAP\Result instance, returned by ldap_list or ldap_search. + * @param string|null $response_data Will be filled by the response data. + * @param string|null $response_oid Will be filled by the response OID. + * @throws LdapException + * + */ +function ldap_parse_exop($ldap, $result, ?string &$response_data = null, ?string &$response_oid = null): void +{ + error_clear_last(); + $safeResult = \ldap_parse_exop($ldap, $result, $response_data, $response_oid); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Parses an LDAP search result. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $result An LDAP\Result instance, returned by ldap_list or ldap_search. + * @param int|null $error_code 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|null $matched_dn 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|null $error_message 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|null $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|null $controls An array of LDAP Controls which have been sent with the response. + * @throws LdapException + * + */ +function ldap_parse_result($ldap, $result, ?int &$error_code, ?string &$matched_dn = null, ?string &$error_message = null, ?array &$referrals = null, ?array &$controls = null): void +{ + error_clear_last(); + $safeResult = \ldap_parse_result($ldap, $result, $error_code, $matched_dn, $error_message, $referrals, $controls); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * The entry specified by dn is renamed/moved. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param string $dn The distinguished name of an LDAP entity. + * @param string $new_rdn The new RDN. + * @param string $new_parent The new parent/superior entry. + * @param bool $delete_old_rdn 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 $controls Array of LDAP Controls to send with the request. + * @throws LdapException + * + */ +function ldap_rename($ldap, string $dn, string $new_rdn, string $new_parent, bool $delete_old_rdn, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_rename($ldap, $dn, $new_rdn, $new_parent, $delete_old_rdn, $controls); + } else { + $safeResult = \ldap_rename($ldap, $dn, $new_rdn, $new_parent, $delete_old_rdn); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * + * + * @param resource $ldap + * @param string $dn + * @param string $password + * @param string $mech + * @param string $realm + * @param string $authc_id + * @param string $authz_id + * @param string $props + * @throws LdapException + * + */ +function ldap_sasl_bind($ldap, ?string $dn = null, ?string $password = null, ?string $mech = null, ?string $realm = null, ?string $authc_id = null, ?string $authz_id = null, ?string $props = null): void +{ + error_clear_last(); + if ($props !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm, $authc_id, $authz_id, $props); + } elseif ($authz_id !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm, $authc_id, $authz_id); + } elseif ($authc_id !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm, $authc_id); + } elseif ($realm !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm); + } elseif ($mech !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech); + } elseif ($password !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn, $password); + } elseif ($dn !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn); + } else { + $safeResult = \ldap_sasl_bind($ldap); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Sets the value of the specified option to be value. + * + * @param resource|null $ldap Either an LDAP\Connection instance, returned by + * ldap_connect, to set the option for that connection, + * or NULL to set the option globally. + * @param int $option The parameter option can be one of: + * + * + * + * + * Option + * Type + * Available since + * + * + * + * + * LDAP_OPT_DEREF + * int + * + * + * + * LDAP_OPT_SIZELIMIT + * int + * + * + * + * LDAP_OPT_TIMELIMIT + * int + * + * + * + * LDAP_OPT_NETWORK_TIMEOUT + * int + * + * + * + * LDAP_OPT_PROTOCOL_VERSION + * int + * + * + * + * LDAP_OPT_ERROR_NUMBER + * int + * + * + * + * 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 + * int + * 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 + * int + * PHP 7.1.0 + * + * + * LDAP_OPT_X_TLS_RANDOM_FILE + * string + * PHP 7.1.0 + * + * + * LDAP_OPT_X_TLS_REQUIRE_CERT + * int + * 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 $value The new value for the specified option. + * @throws LdapException + * + */ +function ldap_set_option($ldap, int $option, $value): void +{ + error_clear_last(); + $safeResult = \ldap_set_option($ldap, $option, $value); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Unbinds from the LDAP directory. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @throws LdapException + * + */ +function ldap_unbind($ldap): void +{ + error_clear_last(); + $safeResult = \ldap_unbind($ldap); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} diff --git a/generated/8.2/libxml.php b/generated/8.2/libxml.php new file mode 100644 index 00000000..20d32408 --- /dev/null +++ b/generated/8.2/libxml.php @@ -0,0 +1,78 @@ + + * + * 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 (in bytes) 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 (in bytes) 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|null Returns the number of full pattern matches (which might be zero). + * @throws PcreException + * + */ +function preg_match_all(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): ?int +{ + error_clear_last(); + $safeResult = \preg_match_all($pattern, $subject, $matches, $flags, $offset); + if ($safeResult === false) { + throw PcreException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 string[]|null $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 (in bytes) 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 (in bytes) 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 (in bytes) 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 PcreException + * + */ +function preg_match(string $pattern, string $subject, ?iterable &$matches = null, int $flags = 0, int $offset = 0): int +{ + error_clear_last(); + $safeResult = \preg_match($pattern, $subject, $matches, $flags, $offset); + if ($safeResult === false) { + throw PcreException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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". + * @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 PcreException + * + */ +function preg_split(string $pattern, string $subject, ?int $limit = -1, int $flags = 0): array +{ + error_clear_last(); + $safeResult = \preg_split($pattern, $subject, $limit, $flags); + if ($safeResult === false) { + throw PcreException::createFromPhpError(); + } + return $safeResult; +} diff --git a/generated/8.2/pgsql.php b/generated/8.2/pgsql.php new file mode 100644 index 00000000..38b66e9c --- /dev/null +++ b/generated/8.2/pgsql.php @@ -0,0 +1,1360 @@ +ruleWithConfiguration( + RenameFunctionRector::class, + [ 'apache_getenv' => 'Safe\apache_getenv', + 'apache_get_version' => 'Safe\apache_get_version', + 'apache_lookup_uri' => 'Safe\apache_lookup_uri', + 'apache_request_headers' => 'Safe\apache_request_headers', + 'apache_response_headers' => 'Safe\apache_response_headers', + 'apache_setenv' => 'Safe\apache_setenv', + 'apcu_cache_info' => 'Safe\apcu_cache_info', + 'apcu_cas' => 'Safe\apcu_cas', + 'apcu_dec' => 'Safe\apcu_dec', + 'apcu_fetch' => 'Safe\apcu_fetch', + 'apcu_inc' => 'Safe\apcu_inc', + 'apcu_sma_info' => 'Safe\apcu_sma_info', + 'apc_fetch' => 'Safe\apc_fetch', + 'array_walk_recursive' => 'Safe\array_walk_recursive', + 'assert_options' => 'Safe\assert_options', + 'base64_decode' => 'Safe\base64_decode', + 'bindtextdomain' => 'Safe\bindtextdomain', + 'bzclose' => 'Safe\bzclose', + 'bzflush' => 'Safe\bzflush', + 'bzread' => 'Safe\bzread', + 'bzwrite' => 'Safe\bzwrite', + 'chdir' => 'Safe\chdir', + 'chgrp' => 'Safe\chgrp', + 'chmod' => 'Safe\chmod', + 'chown' => 'Safe\chown', + 'chroot' => 'Safe\chroot', + 'class_alias' => 'Safe\class_alias', + 'class_implements' => 'Safe\class_implements', + 'class_parents' => 'Safe\class_parents', + 'class_uses' => 'Safe\class_uses', + 'cli_set_process_title' => 'Safe\cli_set_process_title', + 'closelog' => 'Safe\closelog', + 'com_create_guid' => 'Safe\com_create_guid', + 'com_event_sink' => 'Safe\com_event_sink', + 'com_load_typelib' => 'Safe\com_load_typelib', + 'com_print_typeinfo' => 'Safe\com_print_typeinfo', + 'convert_uudecode' => 'Safe\convert_uudecode', + 'copy' => 'Safe\copy', + 'create_function' => 'Safe\create_function', + 'cubrid_bind' => 'Safe\cubrid_bind', + 'cubrid_column_names' => 'Safe\cubrid_column_names', + 'cubrid_column_types' => 'Safe\cubrid_column_types', + 'cubrid_col_size' => 'Safe\cubrid_col_size', + 'cubrid_commit' => 'Safe\cubrid_commit', + 'cubrid_connect' => 'Safe\cubrid_connect', + 'cubrid_connect_with_url' => 'Safe\cubrid_connect_with_url', + 'cubrid_current_oid' => 'Safe\cubrid_current_oid', + 'cubrid_disconnect' => 'Safe\cubrid_disconnect', + 'cubrid_drop' => 'Safe\cubrid_drop', + 'cubrid_free_result' => 'Safe\cubrid_free_result', + 'cubrid_get_charset' => 'Safe\cubrid_get_charset', + 'cubrid_get_class_name' => 'Safe\cubrid_get_class_name', + 'cubrid_get_client_info' => 'Safe\cubrid_get_client_info', + 'cubrid_get_db_parameter' => 'Safe\cubrid_get_db_parameter', + 'cubrid_get_query_timeout' => 'Safe\cubrid_get_query_timeout', + 'cubrid_get_server_info' => 'Safe\cubrid_get_server_info', + 'cubrid_insert_id' => 'Safe\cubrid_insert_id', + 'cubrid_lob2_bind' => 'Safe\cubrid_lob2_bind', + 'cubrid_lob2_close' => 'Safe\cubrid_lob2_close', + 'cubrid_lob2_export' => 'Safe\cubrid_lob2_export', + 'cubrid_lob2_import' => 'Safe\cubrid_lob2_import', + 'cubrid_lob2_new' => 'Safe\cubrid_lob2_new', + 'cubrid_lob2_read' => 'Safe\cubrid_lob2_read', + 'cubrid_lob2_seek' => 'Safe\cubrid_lob2_seek', + 'cubrid_lob2_seek64' => 'Safe\cubrid_lob2_seek64', + 'cubrid_lob2_size' => 'Safe\cubrid_lob2_size', + 'cubrid_lob2_size64' => 'Safe\cubrid_lob2_size64', + 'cubrid_lob2_tell' => 'Safe\cubrid_lob2_tell', + 'cubrid_lob2_tell64' => 'Safe\cubrid_lob2_tell64', + 'cubrid_lob2_write' => 'Safe\cubrid_lob2_write', + 'cubrid_lob_close' => 'Safe\cubrid_lob_close', + 'cubrid_lob_export' => 'Safe\cubrid_lob_export', + 'cubrid_lob_get' => 'Safe\cubrid_lob_get', + 'cubrid_lob_send' => 'Safe\cubrid_lob_send', + 'cubrid_lob_size' => 'Safe\cubrid_lob_size', + 'cubrid_lock_read' => 'Safe\cubrid_lock_read', + 'cubrid_lock_write' => 'Safe\cubrid_lock_write', + 'cubrid_move_cursor' => 'Safe\cubrid_move_cursor', + 'cubrid_next_result' => 'Safe\cubrid_next_result', + 'cubrid_pconnect' => 'Safe\cubrid_pconnect', + 'cubrid_pconnect_with_url' => 'Safe\cubrid_pconnect_with_url', + 'cubrid_prepare' => 'Safe\cubrid_prepare', + 'cubrid_put' => 'Safe\cubrid_put', + 'cubrid_rollback' => 'Safe\cubrid_rollback', + 'cubrid_schema' => 'Safe\cubrid_schema', + 'cubrid_seq_drop' => 'Safe\cubrid_seq_drop', + 'cubrid_seq_insert' => 'Safe\cubrid_seq_insert', + 'cubrid_seq_put' => 'Safe\cubrid_seq_put', + 'cubrid_set_add' => 'Safe\cubrid_set_add', + 'cubrid_set_autocommit' => 'Safe\cubrid_set_autocommit', + 'cubrid_set_db_parameter' => 'Safe\cubrid_set_db_parameter', + 'cubrid_set_drop' => 'Safe\cubrid_set_drop', + 'cubrid_set_query_timeout' => 'Safe\cubrid_set_query_timeout', + 'curl_copy_handle' => 'Safe\curl_copy_handle', + 'curl_escape' => 'Safe\curl_escape', + 'curl_exec' => 'Safe\curl_exec', + 'curl_getinfo' => 'Safe\curl_getinfo', + 'curl_init' => 'Safe\curl_init', + 'curl_multi_info_read' => 'Safe\curl_multi_info_read', + 'curl_multi_init' => 'Safe\curl_multi_init', + 'curl_multi_setopt' => 'Safe\curl_multi_setopt', + 'curl_setopt' => 'Safe\curl_setopt', + 'curl_share_errno' => 'Safe\curl_share_errno', + 'curl_share_setopt' => 'Safe\curl_share_setopt', + 'curl_unescape' => 'Safe\curl_unescape', + 'curl_upkeep' => 'Safe\curl_upkeep', + 'date' => 'Safe\date', + 'date_parse' => 'Safe\date_parse', + 'date_parse_from_format' => 'Safe\date_parse_from_format', + 'date_sunrise' => 'Safe\date_sunrise', + 'date_sunset' => 'Safe\date_sunset', + 'date_sun_info' => 'Safe\date_sun_info', + 'db2_autocommit' => 'Safe\db2_autocommit', + 'db2_bind_param' => 'Safe\db2_bind_param', + 'db2_client_info' => 'Safe\db2_client_info', + 'db2_close' => 'Safe\db2_close', + 'db2_commit' => 'Safe\db2_commit', + 'db2_execute' => 'Safe\db2_execute', + 'db2_free_result' => 'Safe\db2_free_result', + 'db2_free_stmt' => 'Safe\db2_free_stmt', + 'db2_get_option' => 'Safe\db2_get_option', + 'db2_pclose' => 'Safe\db2_pclose', + 'db2_rollback' => 'Safe\db2_rollback', + 'db2_server_info' => 'Safe\db2_server_info', + 'db2_set_option' => 'Safe\db2_set_option', + 'define' => 'Safe\define', + 'deflate_add' => 'Safe\deflate_add', + 'deflate_init' => 'Safe\deflate_init', + 'disk_free_space' => 'Safe\disk_free_space', + 'disk_total_space' => 'Safe\disk_total_space', + 'dl' => 'Safe\dl', + 'dns_get_record' => 'Safe\dns_get_record', + 'eio_busy' => 'Safe\eio_busy', + 'eio_chmod' => 'Safe\eio_chmod', + 'eio_chown' => 'Safe\eio_chown', + 'eio_close' => 'Safe\eio_close', + 'eio_custom' => 'Safe\eio_custom', + 'eio_dup2' => 'Safe\eio_dup2', + 'eio_event_loop' => 'Safe\eio_event_loop', + 'eio_fallocate' => 'Safe\eio_fallocate', + 'eio_fchmod' => 'Safe\eio_fchmod', + 'eio_fchown' => 'Safe\eio_fchown', + 'eio_fdatasync' => 'Safe\eio_fdatasync', + 'eio_fstat' => 'Safe\eio_fstat', + 'eio_fstatvfs' => 'Safe\eio_fstatvfs', + 'eio_fsync' => 'Safe\eio_fsync', + 'eio_ftruncate' => 'Safe\eio_ftruncate', + 'eio_futime' => 'Safe\eio_futime', + 'eio_grp' => 'Safe\eio_grp', + 'eio_lstat' => 'Safe\eio_lstat', + 'eio_mkdir' => 'Safe\eio_mkdir', + 'eio_mknod' => 'Safe\eio_mknod', + 'eio_nop' => 'Safe\eio_nop', + 'eio_readahead' => 'Safe\eio_readahead', + 'eio_readdir' => 'Safe\eio_readdir', + 'eio_readlink' => 'Safe\eio_readlink', + 'eio_rename' => 'Safe\eio_rename', + 'eio_rmdir' => 'Safe\eio_rmdir', + 'eio_seek' => 'Safe\eio_seek', + 'eio_sendfile' => 'Safe\eio_sendfile', + 'eio_stat' => 'Safe\eio_stat', + 'eio_statvfs' => 'Safe\eio_statvfs', + 'eio_symlink' => 'Safe\eio_symlink', + 'eio_sync' => 'Safe\eio_sync', + 'eio_syncfs' => 'Safe\eio_syncfs', + 'eio_sync_file_range' => 'Safe\eio_sync_file_range', + 'eio_truncate' => 'Safe\eio_truncate', + 'eio_unlink' => 'Safe\eio_unlink', + 'eio_utime' => 'Safe\eio_utime', + 'eio_write' => 'Safe\eio_write', + 'error_log' => 'Safe\error_log', + 'exec' => 'Safe\exec', + 'fastcgi_finish_request' => 'Safe\fastcgi_finish_request', + 'fbird_blob_cancel' => 'Safe\fbird_blob_cancel', + 'fclose' => 'Safe\fclose', + 'fdatasync' => 'Safe\fdatasync', + 'fflush' => 'Safe\fflush', + 'fgetcsv' => 'Safe\fgetcsv', + 'file' => 'Safe\file', + 'fileatime' => 'Safe\fileatime', + 'filectime' => 'Safe\filectime', + 'fileinode' => 'Safe\fileinode', + 'filemtime' => 'Safe\filemtime', + 'fileowner' => 'Safe\fileowner', + 'fileperms' => 'Safe\fileperms', + 'filesize' => 'Safe\filesize', + 'file_get_contents' => 'Safe\file_get_contents', + 'file_put_contents' => 'Safe\file_put_contents', + 'filter_input_array' => 'Safe\filter_input_array', + 'filter_var_array' => 'Safe\filter_var_array', + 'finfo_close' => 'Safe\finfo_close', + 'finfo_open' => 'Safe\finfo_open', + 'flock' => 'Safe\flock', + 'fopen' => 'Safe\fopen', + 'fpm_get_status' => 'Safe\fpm_get_status', + 'fputcsv' => 'Safe\fputcsv', + 'fread' => 'Safe\fread', + 'fsockopen' => 'Safe\fsockopen', + 'fstat' => 'Safe\fstat', + 'fsync' => 'Safe\fsync', + 'ftp_alloc' => 'Safe\ftp_alloc', + 'ftp_append' => 'Safe\ftp_append', + 'ftp_cdup' => 'Safe\ftp_cdup', + 'ftp_chdir' => 'Safe\ftp_chdir', + 'ftp_chmod' => 'Safe\ftp_chmod', + 'ftp_close' => 'Safe\ftp_close', + 'ftp_connect' => 'Safe\ftp_connect', + 'ftp_delete' => 'Safe\ftp_delete', + 'ftp_fget' => 'Safe\ftp_fget', + 'ftp_fput' => 'Safe\ftp_fput', + 'ftp_get' => 'Safe\ftp_get', + 'ftp_login' => 'Safe\ftp_login', + 'ftp_mkdir' => 'Safe\ftp_mkdir', + 'ftp_mlsd' => 'Safe\ftp_mlsd', + 'ftp_nb_put' => 'Safe\ftp_nb_put', + 'ftp_nlist' => 'Safe\ftp_nlist', + 'ftp_pasv' => 'Safe\ftp_pasv', + 'ftp_put' => 'Safe\ftp_put', + 'ftp_pwd' => 'Safe\ftp_pwd', + 'ftp_raw' => 'Safe\ftp_raw', + 'ftp_rename' => 'Safe\ftp_rename', + 'ftp_rmdir' => 'Safe\ftp_rmdir', + 'ftp_site' => 'Safe\ftp_site', + 'ftp_ssl_connect' => 'Safe\ftp_ssl_connect', + 'ftp_systype' => 'Safe\ftp_systype', + 'ftruncate' => 'Safe\ftruncate', + 'fwrite' => 'Safe\fwrite', + 'getallheaders' => 'Safe\getallheaders', + 'getcwd' => 'Safe\getcwd', + 'gethostname' => 'Safe\gethostname', + 'getimagesize' => 'Safe\getimagesize', + 'getlastmod' => 'Safe\getlastmod', + 'getmygid' => 'Safe\getmygid', + 'getmyinode' => 'Safe\getmyinode', + 'getmypid' => 'Safe\getmypid', + 'getmyuid' => 'Safe\getmyuid', + 'getopt' => 'Safe\getopt', + 'getprotobyname' => 'Safe\getprotobyname', + 'getprotobynumber' => 'Safe\getprotobynumber', + 'getrusage' => 'Safe\getrusage', + 'getservbyport' => 'Safe\getservbyport', + 'get_headers' => 'Safe\get_headers', + 'get_include_path' => 'Safe\get_include_path', + 'get_meta_tags' => 'Safe\get_meta_tags', + 'glob' => 'Safe\glob', + 'gmmktime' => 'Safe\gmmktime', + 'gmstrftime' => 'Safe\gmstrftime', + 'gnupg_adddecryptkey' => 'Safe\gnupg_adddecryptkey', + 'gnupg_addencryptkey' => 'Safe\gnupg_addencryptkey', + 'gnupg_addsignkey' => 'Safe\gnupg_addsignkey', + 'gnupg_cleardecryptkeys' => 'Safe\gnupg_cleardecryptkeys', + 'gnupg_clearencryptkeys' => 'Safe\gnupg_clearencryptkeys', + 'gnupg_clearsignkeys' => 'Safe\gnupg_clearsignkeys', + 'gnupg_deletekey' => 'Safe\gnupg_deletekey', + 'gnupg_setarmor' => 'Safe\gnupg_setarmor', + 'gnupg_setsignmode' => 'Safe\gnupg_setsignmode', + 'gzclose' => 'Safe\gzclose', + 'gzcompress' => 'Safe\gzcompress', + 'gzdecode' => 'Safe\gzdecode', + 'gzdeflate' => 'Safe\gzdeflate', + 'gzencode' => 'Safe\gzencode', + 'gzfile' => 'Safe\gzfile', + 'gzgets' => 'Safe\gzgets', + 'gzgetss' => 'Safe\gzgetss', + 'gzinflate' => 'Safe\gzinflate', + 'gzopen' => 'Safe\gzopen', + 'gzpassthru' => 'Safe\gzpassthru', + 'gzread' => 'Safe\gzread', + 'gzrewind' => 'Safe\gzrewind', + 'gzuncompress' => 'Safe\gzuncompress', + 'gzwrite' => 'Safe\gzwrite', + 'hash_update_file' => 'Safe\hash_update_file', + 'header_register_callback' => 'Safe\header_register_callback', + 'hex2bin' => 'Safe\hex2bin', + 'highlight_file' => 'Safe\highlight_file', + 'highlight_string' => 'Safe\highlight_string', + 'hrtime' => 'Safe\hrtime', + 'ibase_add_user' => 'Safe\ibase_add_user', + 'ibase_backup' => 'Safe\ibase_backup', + 'ibase_blob_cancel' => 'Safe\ibase_blob_cancel', + 'ibase_blob_create' => 'Safe\ibase_blob_create', + 'ibase_blob_get' => 'Safe\ibase_blob_get', + 'ibase_close' => 'Safe\ibase_close', + 'ibase_commit' => 'Safe\ibase_commit', + 'ibase_commit_ret' => 'Safe\ibase_commit_ret', + 'ibase_connect' => 'Safe\ibase_connect', + 'ibase_delete_user' => 'Safe\ibase_delete_user', + 'ibase_drop_db' => 'Safe\ibase_drop_db', + 'ibase_free_event_handler' => 'Safe\ibase_free_event_handler', + 'ibase_free_query' => 'Safe\ibase_free_query', + 'ibase_free_result' => 'Safe\ibase_free_result', + 'ibase_maintain_db' => 'Safe\ibase_maintain_db', + 'ibase_modify_user' => 'Safe\ibase_modify_user', + 'ibase_name_result' => 'Safe\ibase_name_result', + 'ibase_pconnect' => 'Safe\ibase_pconnect', + 'ibase_restore' => 'Safe\ibase_restore', + 'ibase_rollback' => 'Safe\ibase_rollback', + 'ibase_rollback_ret' => 'Safe\ibase_rollback_ret', + 'ibase_service_attach' => 'Safe\ibase_service_attach', + 'ibase_service_detach' => 'Safe\ibase_service_detach', + 'iconv' => 'Safe\iconv', + 'iconv_get_encoding' => 'Safe\iconv_get_encoding', + 'iconv_set_encoding' => 'Safe\iconv_set_encoding', + 'idate' => 'Safe\idate', + 'image2wbmp' => 'Safe\image2wbmp', + 'imageaffine' => 'Safe\imageaffine', + 'imageaffinematrixconcat' => 'Safe\imageaffinematrixconcat', + 'imageaffinematrixget' => 'Safe\imageaffinematrixget', + 'imagealphablending' => 'Safe\imagealphablending', + 'imageantialias' => 'Safe\imageantialias', + 'imagearc' => 'Safe\imagearc', + 'imageavif' => 'Safe\imageavif', + 'imagebmp' => 'Safe\imagebmp', + 'imagechar' => 'Safe\imagechar', + 'imagecharup' => 'Safe\imagecharup', + 'imagecolorat' => 'Safe\imagecolorat', + 'imagecolordeallocate' => 'Safe\imagecolordeallocate', + 'imagecolormatch' => 'Safe\imagecolormatch', + 'imagecolorset' => 'Safe\imagecolorset', + 'imageconvolution' => 'Safe\imageconvolution', + 'imagecopy' => 'Safe\imagecopy', + 'imagecopymerge' => 'Safe\imagecopymerge', + 'imagecopymergegray' => 'Safe\imagecopymergegray', + 'imagecopyresampled' => 'Safe\imagecopyresampled', + 'imagecopyresized' => 'Safe\imagecopyresized', + 'imagecreate' => 'Safe\imagecreate', + 'imagecreatefromavif' => 'Safe\imagecreatefromavif', + 'imagecreatefrombmp' => 'Safe\imagecreatefrombmp', + 'imagecreatefromgd' => 'Safe\imagecreatefromgd', + 'imagecreatefromgd2' => 'Safe\imagecreatefromgd2', + 'imagecreatefromgd2part' => 'Safe\imagecreatefromgd2part', + 'imagecreatefromgif' => 'Safe\imagecreatefromgif', + 'imagecreatefromjpeg' => 'Safe\imagecreatefromjpeg', + 'imagecreatefrompng' => 'Safe\imagecreatefrompng', + 'imagecreatefromstring' => 'Safe\imagecreatefromstring', + 'imagecreatefromtga' => 'Safe\imagecreatefromtga', + 'imagecreatefromwbmp' => 'Safe\imagecreatefromwbmp', + 'imagecreatefromwebp' => 'Safe\imagecreatefromwebp', + 'imagecreatefromxbm' => 'Safe\imagecreatefromxbm', + 'imagecreatefromxpm' => 'Safe\imagecreatefromxpm', + 'imagecreatetruecolor' => 'Safe\imagecreatetruecolor', + 'imagecrop' => 'Safe\imagecrop', + 'imagecropauto' => 'Safe\imagecropauto', + 'imagedashedline' => 'Safe\imagedashedline', + 'imagedestroy' => 'Safe\imagedestroy', + 'imageellipse' => 'Safe\imageellipse', + 'imagefill' => 'Safe\imagefill', + 'imagefilledarc' => 'Safe\imagefilledarc', + 'imagefilledellipse' => 'Safe\imagefilledellipse', + 'imagefilledrectangle' => 'Safe\imagefilledrectangle', + 'imagefilltoborder' => 'Safe\imagefilltoborder', + 'imagefilter' => 'Safe\imagefilter', + 'imageflip' => 'Safe\imageflip', + 'imageftbbox' => 'Safe\imageftbbox', + 'imagefttext' => 'Safe\imagefttext', + 'imagegammacorrect' => 'Safe\imagegammacorrect', + 'imagegd' => 'Safe\imagegd', + 'imagegd2' => 'Safe\imagegd2', + 'imagegif' => 'Safe\imagegif', + 'imagegrabscreen' => 'Safe\imagegrabscreen', + 'imagegrabwindow' => 'Safe\imagegrabwindow', + 'imagejpeg' => 'Safe\imagejpeg', + 'imagelayereffect' => 'Safe\imagelayereffect', + 'imageline' => 'Safe\imageline', + 'imageloadfont' => 'Safe\imageloadfont', + 'imagepng' => 'Safe\imagepng', + 'imagerectangle' => 'Safe\imagerectangle', + 'imageresolution' => 'Safe\imageresolution', + 'imagerotate' => 'Safe\imagerotate', + 'imagesavealpha' => 'Safe\imagesavealpha', + 'imagescale' => 'Safe\imagescale', + 'imagesetbrush' => 'Safe\imagesetbrush', + 'imagesetclip' => 'Safe\imagesetclip', + 'imagesetinterpolation' => 'Safe\imagesetinterpolation', + 'imagesetpixel' => 'Safe\imagesetpixel', + 'imagesetstyle' => 'Safe\imagesetstyle', + 'imagesetthickness' => 'Safe\imagesetthickness', + 'imagesettile' => 'Safe\imagesettile', + 'imagestring' => 'Safe\imagestring', + 'imagestringup' => 'Safe\imagestringup', + 'imagesx' => 'Safe\imagesx', + 'imagesy' => 'Safe\imagesy', + 'imagetruecolortopalette' => 'Safe\imagetruecolortopalette', + 'imagettfbbox' => 'Safe\imagettfbbox', + 'imagettftext' => 'Safe\imagettftext', + 'imagewbmp' => 'Safe\imagewbmp', + 'imagewebp' => 'Safe\imagewebp', + 'imagexbm' => 'Safe\imagexbm', + 'image_type_to_extension' => 'Safe\image_type_to_extension', + 'imap_8bit' => 'Safe\imap_8bit', + 'imap_append' => 'Safe\imap_append', + 'imap_base64' => 'Safe\imap_base64', + 'imap_binary' => 'Safe\imap_binary', + 'imap_body' => 'Safe\imap_body', + 'imap_bodystruct' => 'Safe\imap_bodystruct', + 'imap_check' => 'Safe\imap_check', + 'imap_clearflag_full' => 'Safe\imap_clearflag_full', + 'imap_close' => 'Safe\imap_close', + 'imap_createmailbox' => 'Safe\imap_createmailbox', + 'imap_deletemailbox' => 'Safe\imap_deletemailbox', + 'imap_fetchbody' => 'Safe\imap_fetchbody', + 'imap_fetchheader' => 'Safe\imap_fetchheader', + 'imap_fetchmime' => 'Safe\imap_fetchmime', + 'imap_fetchstructure' => 'Safe\imap_fetchstructure', + 'imap_fetch_overview' => 'Safe\imap_fetch_overview', + 'imap_gc' => 'Safe\imap_gc', + 'imap_getacl' => 'Safe\imap_getacl', + 'imap_getmailboxes' => 'Safe\imap_getmailboxes', + 'imap_getsubscribed' => 'Safe\imap_getsubscribed', + 'imap_headerinfo' => 'Safe\imap_headerinfo', + 'imap_headers' => 'Safe\imap_headers', + 'imap_listscan' => 'Safe\imap_listscan', + 'imap_lsub' => 'Safe\imap_lsub', + 'imap_mail' => 'Safe\imap_mail', + 'imap_mailboxmsginfo' => 'Safe\imap_mailboxmsginfo', + 'imap_mail_compose' => 'Safe\imap_mail_compose', + 'imap_mail_copy' => 'Safe\imap_mail_copy', + 'imap_mail_move' => 'Safe\imap_mail_move', + 'imap_mime_header_decode' => 'Safe\imap_mime_header_decode', + 'imap_mutf7_to_utf8' => 'Safe\imap_mutf7_to_utf8', + 'imap_num_msg' => 'Safe\imap_num_msg', + 'imap_open' => 'Safe\imap_open', + 'imap_qprint' => 'Safe\imap_qprint', + 'imap_renamemailbox' => 'Safe\imap_renamemailbox', + 'imap_rfc822_write_address' => 'Safe\imap_rfc822_write_address', + 'imap_savebody' => 'Safe\imap_savebody', + 'imap_setacl' => 'Safe\imap_setacl', + 'imap_setflag_full' => 'Safe\imap_setflag_full', + 'imap_set_quota' => 'Safe\imap_set_quota', + 'imap_sort' => 'Safe\imap_sort', + 'imap_status' => 'Safe\imap_status', + 'imap_subscribe' => 'Safe\imap_subscribe', + 'imap_thread' => 'Safe\imap_thread', + 'imap_timeout' => 'Safe\imap_timeout', + 'imap_undelete' => 'Safe\imap_undelete', + 'imap_unsubscribe' => 'Safe\imap_unsubscribe', + 'imap_utf8_to_mutf7' => 'Safe\imap_utf8_to_mutf7', + 'inet_ntop' => 'Safe\inet_ntop', + 'inet_pton' => 'Safe\inet_pton', + 'inflate_add' => 'Safe\inflate_add', + 'inflate_get_read_len' => 'Safe\inflate_get_read_len', + 'inflate_get_status' => 'Safe\inflate_get_status', + 'inflate_init' => 'Safe\inflate_init', + 'ini_get' => 'Safe\ini_get', + 'ini_set' => 'Safe\ini_set', + 'inotify_init' => 'Safe\inotify_init', + 'inotify_rm_watch' => 'Safe\inotify_rm_watch', + 'iptcembed' => 'Safe\iptcembed', + 'iptcparse' => 'Safe\iptcparse', + 'jpeg2wbmp' => 'Safe\jpeg2wbmp', + 'json_decode' => 'Safe\json_decode', + 'json_encode' => 'Safe\json_encode', + 'lchgrp' => 'Safe\lchgrp', + 'lchown' => 'Safe\lchown', + 'ldap_8859_to_t61' => 'Safe\ldap_8859_to_t61', + 'ldap_add' => 'Safe\ldap_add', + 'ldap_bind' => 'Safe\ldap_bind', + 'ldap_control_paged_result' => 'Safe\ldap_control_paged_result', + 'ldap_control_paged_result_response' => 'Safe\ldap_control_paged_result_response', + 'ldap_count_entries' => 'Safe\ldap_count_entries', + 'ldap_delete' => 'Safe\ldap_delete', + 'ldap_dn2ufn' => 'Safe\ldap_dn2ufn', + 'ldap_exop' => 'Safe\ldap_exop', + 'ldap_exop_passwd' => 'Safe\ldap_exop_passwd', + 'ldap_exop_whoami' => 'Safe\ldap_exop_whoami', + 'ldap_explode_dn' => 'Safe\ldap_explode_dn', + 'ldap_first_attribute' => 'Safe\ldap_first_attribute', + 'ldap_first_entry' => 'Safe\ldap_first_entry', + 'ldap_free_result' => 'Safe\ldap_free_result', + 'ldap_get_attributes' => 'Safe\ldap_get_attributes', + 'ldap_get_dn' => 'Safe\ldap_get_dn', + 'ldap_get_entries' => 'Safe\ldap_get_entries', + 'ldap_get_option' => 'Safe\ldap_get_option', + 'ldap_get_values' => 'Safe\ldap_get_values', + 'ldap_get_values_len' => 'Safe\ldap_get_values_len', + 'ldap_modify_batch' => 'Safe\ldap_modify_batch', + 'ldap_mod_add' => 'Safe\ldap_mod_add', + 'ldap_mod_del' => 'Safe\ldap_mod_del', + 'ldap_mod_replace' => 'Safe\ldap_mod_replace', + 'ldap_next_attribute' => 'Safe\ldap_next_attribute', + 'ldap_parse_exop' => 'Safe\ldap_parse_exop', + 'ldap_parse_result' => 'Safe\ldap_parse_result', + 'ldap_rename' => 'Safe\ldap_rename', + 'ldap_sasl_bind' => 'Safe\ldap_sasl_bind', + 'ldap_set_option' => 'Safe\ldap_set_option', + 'ldap_unbind' => 'Safe\ldap_unbind', + 'libxml_get_last_error' => 'Safe\libxml_get_last_error', + 'libxml_set_external_entity_loader' => 'Safe\libxml_set_external_entity_loader', + 'link' => 'Safe\link', + 'long2ip' => 'Safe\long2ip', + 'lstat' => 'Safe\lstat', + 'lzf_compress' => 'Safe\lzf_compress', + 'lzf_decompress' => 'Safe\lzf_decompress', + 'mailparse_msg_extract_part_file' => 'Safe\mailparse_msg_extract_part_file', + 'mailparse_msg_free' => 'Safe\mailparse_msg_free', + 'mailparse_msg_parse' => 'Safe\mailparse_msg_parse', + 'mailparse_msg_parse_file' => 'Safe\mailparse_msg_parse_file', + 'mailparse_stream_encode' => 'Safe\mailparse_stream_encode', + 'mb_chr' => 'Safe\mb_chr', + 'mb_convert_encoding' => 'Safe\mb_convert_encoding', + 'mb_detect_order' => 'Safe\mb_detect_order', + 'mb_encoding_aliases' => 'Safe\mb_encoding_aliases', + 'mb_eregi_replace' => 'Safe\mb_eregi_replace', + 'mb_ereg_replace' => 'Safe\mb_ereg_replace', + 'mb_ereg_replace_callback' => 'Safe\mb_ereg_replace_callback', + 'mb_ereg_search_getregs' => 'Safe\mb_ereg_search_getregs', + 'mb_ereg_search_init' => 'Safe\mb_ereg_search_init', + 'mb_ereg_search_regs' => 'Safe\mb_ereg_search_regs', + 'mb_ereg_search_setpos' => 'Safe\mb_ereg_search_setpos', + 'mb_get_info' => 'Safe\mb_get_info', + 'mb_http_output' => 'Safe\mb_http_output', + 'mb_internal_encoding' => 'Safe\mb_internal_encoding', + 'mb_ord' => 'Safe\mb_ord', + 'mb_parse_str' => 'Safe\mb_parse_str', + 'mb_regex_encoding' => 'Safe\mb_regex_encoding', + 'mb_send_mail' => 'Safe\mb_send_mail', + 'mb_split' => 'Safe\mb_split', + 'md5_file' => 'Safe\md5_file', + 'mime_content_type' => 'Safe\mime_content_type', + 'mkdir' => 'Safe\mkdir', + 'msg_get_queue' => 'Safe\msg_get_queue', + 'msg_queue_exists' => 'Safe\msg_queue_exists', + 'msg_receive' => 'Safe\msg_receive', + 'msg_remove_queue' => 'Safe\msg_remove_queue', + 'msg_send' => 'Safe\msg_send', + 'msg_set_queue' => 'Safe\msg_set_queue', + 'msg_stat_queue' => 'Safe\msg_stat_queue', + 'mysql_close' => 'Safe\mysql_close', + 'mysql_connect' => 'Safe\mysql_connect', + 'mysql_create_db' => 'Safe\mysql_create_db', + 'mysql_data_seek' => 'Safe\mysql_data_seek', + 'mysql_db_name' => 'Safe\mysql_db_name', + 'mysql_db_query' => 'Safe\mysql_db_query', + 'mysql_drop_db' => 'Safe\mysql_drop_db', + 'mysql_fetch_lengths' => 'Safe\mysql_fetch_lengths', + 'mysql_field_flags' => 'Safe\mysql_field_flags', + 'mysql_field_len' => 'Safe\mysql_field_len', + 'mysql_field_name' => 'Safe\mysql_field_name', + 'mysql_field_seek' => 'Safe\mysql_field_seek', + 'mysql_free_result' => 'Safe\mysql_free_result', + 'mysql_get_host_info' => 'Safe\mysql_get_host_info', + 'mysql_get_proto_info' => 'Safe\mysql_get_proto_info', + 'mysql_get_server_info' => 'Safe\mysql_get_server_info', + 'mysql_info' => 'Safe\mysql_info', + 'mysql_list_dbs' => 'Safe\mysql_list_dbs', + 'mysql_list_fields' => 'Safe\mysql_list_fields', + 'mysql_list_processes' => 'Safe\mysql_list_processes', + 'mysql_list_tables' => 'Safe\mysql_list_tables', + 'mysql_num_fields' => 'Safe\mysql_num_fields', + 'mysql_num_rows' => 'Safe\mysql_num_rows', + 'mysql_query' => 'Safe\mysql_query', + 'mysql_real_escape_string' => 'Safe\mysql_real_escape_string', + 'mysql_result' => 'Safe\mysql_result', + 'mysql_select_db' => 'Safe\mysql_select_db', + 'mysql_set_charset' => 'Safe\mysql_set_charset', + 'mysql_tablename' => 'Safe\mysql_tablename', + 'mysql_thread_id' => 'Safe\mysql_thread_id', + 'mysql_unbuffered_query' => 'Safe\mysql_unbuffered_query', + 'net_get_interfaces' => 'Safe\net_get_interfaces', + 'ob_clean' => 'Safe\ob_clean', + 'ob_end_clean' => 'Safe\ob_end_clean', + 'ob_end_flush' => 'Safe\ob_end_flush', + 'ob_flush' => 'Safe\ob_flush', + 'ob_start' => 'Safe\ob_start', + 'oci_bind_array_by_name' => 'Safe\oci_bind_array_by_name', + 'oci_bind_by_name' => 'Safe\oci_bind_by_name', + 'oci_cancel' => 'Safe\oci_cancel', + 'oci_commit' => 'Safe\oci_commit', + 'oci_connect' => 'Safe\oci_connect', + 'oci_define_by_name' => 'Safe\oci_define_by_name', + 'oci_execute' => 'Safe\oci_execute', + 'oci_field_name' => 'Safe\oci_field_name', + 'oci_field_precision' => 'Safe\oci_field_precision', + 'oci_field_scale' => 'Safe\oci_field_scale', + 'oci_field_size' => 'Safe\oci_field_size', + 'oci_field_type' => 'Safe\oci_field_type', + 'oci_field_type_raw' => 'Safe\oci_field_type_raw', + 'oci_free_descriptor' => 'Safe\oci_free_descriptor', + 'oci_free_statement' => 'Safe\oci_free_statement', + 'oci_new_collection' => 'Safe\oci_new_collection', + 'oci_new_connect' => 'Safe\oci_new_connect', + 'oci_new_cursor' => 'Safe\oci_new_cursor', + 'oci_new_descriptor' => 'Safe\oci_new_descriptor', + 'oci_num_rows' => 'Safe\oci_num_rows', + 'oci_parse' => 'Safe\oci_parse', + 'oci_pconnect' => 'Safe\oci_pconnect', + 'oci_register_taf_callback' => 'Safe\oci_register_taf_callback', + 'oci_result' => 'Safe\oci_result', + 'oci_rollback' => 'Safe\oci_rollback', + 'oci_server_version' => 'Safe\oci_server_version', + 'oci_set_action' => 'Safe\oci_set_action', + 'oci_set_call_timeout' => 'Safe\oci_set_call_timeout', + 'oci_set_client_identifier' => 'Safe\oci_set_client_identifier', + 'oci_set_client_info' => 'Safe\oci_set_client_info', + 'oci_set_db_operation' => 'Safe\oci_set_db_operation', + 'oci_set_edition' => 'Safe\oci_set_edition', + 'oci_set_module_name' => 'Safe\oci_set_module_name', + 'oci_set_prefetch' => 'Safe\oci_set_prefetch', + 'oci_set_prefetch_lob' => 'Safe\oci_set_prefetch_lob', + 'oci_statement_type' => 'Safe\oci_statement_type', + 'oci_unregister_taf_callback' => 'Safe\oci_unregister_taf_callback', + 'odbc_autocommit' => 'Safe\odbc_autocommit', + 'odbc_binmode' => 'Safe\odbc_binmode', + 'odbc_columnprivileges' => 'Safe\odbc_columnprivileges', + 'odbc_columns' => 'Safe\odbc_columns', + 'odbc_commit' => 'Safe\odbc_commit', + 'odbc_connect' => 'Safe\odbc_connect', + 'odbc_cursor' => 'Safe\odbc_cursor', + 'odbc_data_source' => 'Safe\odbc_data_source', + 'odbc_exec' => 'Safe\odbc_exec', + 'odbc_execute' => 'Safe\odbc_execute', + 'odbc_fetch_into' => 'Safe\odbc_fetch_into', + 'odbc_field_len' => 'Safe\odbc_field_len', + 'odbc_field_name' => 'Safe\odbc_field_name', + 'odbc_field_num' => 'Safe\odbc_field_num', + 'odbc_field_scale' => 'Safe\odbc_field_scale', + 'odbc_field_type' => 'Safe\odbc_field_type', + 'odbc_foreignkeys' => 'Safe\odbc_foreignkeys', + 'odbc_gettypeinfo' => 'Safe\odbc_gettypeinfo', + 'odbc_longreadlen' => 'Safe\odbc_longreadlen', + 'odbc_pconnect' => 'Safe\odbc_pconnect', + 'odbc_prepare' => 'Safe\odbc_prepare', + 'odbc_primarykeys' => 'Safe\odbc_primarykeys', + 'odbc_procedurecolumns' => 'Safe\odbc_procedurecolumns', + 'odbc_procedures' => 'Safe\odbc_procedures', + 'odbc_result' => 'Safe\odbc_result', + 'odbc_result_all' => 'Safe\odbc_result_all', + 'odbc_rollback' => 'Safe\odbc_rollback', + 'odbc_setoption' => 'Safe\odbc_setoption', + 'odbc_specialcolumns' => 'Safe\odbc_specialcolumns', + 'odbc_statistics' => 'Safe\odbc_statistics', + 'odbc_tableprivileges' => 'Safe\odbc_tableprivileges', + 'odbc_tables' => 'Safe\odbc_tables', + 'opcache_compile_file' => 'Safe\opcache_compile_file', + 'opcache_get_status' => 'Safe\opcache_get_status', + 'opendir' => 'Safe\opendir', + 'openlog' => 'Safe\openlog', + 'openssl_cipher_iv_length' => 'Safe\openssl_cipher_iv_length', + 'openssl_cipher_key_length' => 'Safe\openssl_cipher_key_length', + 'openssl_cms_decrypt' => 'Safe\openssl_cms_decrypt', + 'openssl_cms_encrypt' => 'Safe\openssl_cms_encrypt', + 'openssl_cms_read' => 'Safe\openssl_cms_read', + 'openssl_cms_sign' => 'Safe\openssl_cms_sign', + 'openssl_cms_verify' => 'Safe\openssl_cms_verify', + 'openssl_csr_export' => 'Safe\openssl_csr_export', + 'openssl_csr_export_to_file' => 'Safe\openssl_csr_export_to_file', + 'openssl_csr_get_public_key' => 'Safe\openssl_csr_get_public_key', + 'openssl_csr_get_subject' => 'Safe\openssl_csr_get_subject', + 'openssl_csr_new' => 'Safe\openssl_csr_new', + 'openssl_csr_sign' => 'Safe\openssl_csr_sign', + 'openssl_decrypt' => 'Safe\openssl_decrypt', + 'openssl_dh_compute_key' => 'Safe\openssl_dh_compute_key', + 'openssl_digest' => 'Safe\openssl_digest', + 'openssl_encrypt' => 'Safe\openssl_encrypt', + 'openssl_get_curve_names' => 'Safe\openssl_get_curve_names', + 'openssl_open' => 'Safe\openssl_open', + 'openssl_pbkdf2' => 'Safe\openssl_pbkdf2', + 'openssl_pkcs7_decrypt' => 'Safe\openssl_pkcs7_decrypt', + 'openssl_pkcs7_encrypt' => 'Safe\openssl_pkcs7_encrypt', + 'openssl_pkcs7_read' => 'Safe\openssl_pkcs7_read', + 'openssl_pkcs7_sign' => 'Safe\openssl_pkcs7_sign', + 'openssl_pkcs12_export' => 'Safe\openssl_pkcs12_export', + 'openssl_pkcs12_export_to_file' => 'Safe\openssl_pkcs12_export_to_file', + 'openssl_pkcs12_read' => 'Safe\openssl_pkcs12_read', + 'openssl_pkey_derive' => 'Safe\openssl_pkey_derive', + 'openssl_pkey_export' => 'Safe\openssl_pkey_export', + 'openssl_pkey_export_to_file' => 'Safe\openssl_pkey_export_to_file', + 'openssl_pkey_get_private' => 'Safe\openssl_pkey_get_private', + 'openssl_pkey_get_public' => 'Safe\openssl_pkey_get_public', + 'openssl_pkey_new' => 'Safe\openssl_pkey_new', + 'openssl_private_decrypt' => 'Safe\openssl_private_decrypt', + 'openssl_private_encrypt' => 'Safe\openssl_private_encrypt', + 'openssl_public_decrypt' => 'Safe\openssl_public_decrypt', + 'openssl_public_encrypt' => 'Safe\openssl_public_encrypt', + 'openssl_seal' => 'Safe\openssl_seal', + 'openssl_sign' => 'Safe\openssl_sign', + 'openssl_spki_export' => 'Safe\openssl_spki_export', + 'openssl_spki_export_challenge' => 'Safe\openssl_spki_export_challenge', + 'openssl_spki_new' => 'Safe\openssl_spki_new', + 'openssl_spki_verify' => 'Safe\openssl_spki_verify', + 'openssl_verify' => 'Safe\openssl_verify', + 'openssl_x509_export' => 'Safe\openssl_x509_export', + 'openssl_x509_export_to_file' => 'Safe\openssl_x509_export_to_file', + 'openssl_x509_fingerprint' => 'Safe\openssl_x509_fingerprint', + 'openssl_x509_read' => 'Safe\openssl_x509_read', + 'output_add_rewrite_var' => 'Safe\output_add_rewrite_var', + 'output_reset_rewrite_vars' => 'Safe\output_reset_rewrite_vars', + 'pack' => 'Safe\pack', + 'parse_ini_file' => 'Safe\parse_ini_file', + 'parse_ini_string' => 'Safe\parse_ini_string', + 'parse_url' => 'Safe\parse_url', + 'passthru' => 'Safe\passthru', + 'pcntl_getpriority' => 'Safe\pcntl_getpriority', + 'pcntl_setpriority' => 'Safe\pcntl_setpriority', + 'pcntl_signal' => 'Safe\pcntl_signal', + 'pcntl_signal_dispatch' => 'Safe\pcntl_signal_dispatch', + 'pcntl_sigprocmask' => 'Safe\pcntl_sigprocmask', + 'pcntl_sigtimedwait' => 'Safe\pcntl_sigtimedwait', + 'pcntl_sigwaitinfo' => 'Safe\pcntl_sigwaitinfo', + 'pfsockopen' => 'Safe\pfsockopen', + 'pg_cancel_query' => 'Safe\pg_cancel_query', + 'pg_connect' => 'Safe\pg_connect', + 'pg_connection_reset' => 'Safe\pg_connection_reset', + 'pg_convert' => 'Safe\pg_convert', + 'pg_copy_from' => 'Safe\pg_copy_from', + 'pg_copy_to' => 'Safe\pg_copy_to', + 'pg_delete' => 'Safe\pg_delete', + 'pg_end_copy' => 'Safe\pg_end_copy', + 'pg_execute' => 'Safe\pg_execute', + 'pg_field_table' => 'Safe\pg_field_table', + 'pg_flush' => 'Safe\pg_flush', + 'pg_free_result' => 'Safe\pg_free_result', + 'pg_host' => 'Safe\pg_host', + 'pg_insert' => 'Safe\pg_insert', + 'pg_last_oid' => 'Safe\pg_last_oid', + 'pg_lo_close' => 'Safe\pg_lo_close', + 'pg_lo_export' => 'Safe\pg_lo_export', + 'pg_lo_import' => 'Safe\pg_lo_import', + 'pg_lo_open' => 'Safe\pg_lo_open', + 'pg_lo_read' => 'Safe\pg_lo_read', + 'pg_lo_seek' => 'Safe\pg_lo_seek', + 'pg_lo_truncate' => 'Safe\pg_lo_truncate', + 'pg_lo_unlink' => 'Safe\pg_lo_unlink', + 'pg_lo_write' => 'Safe\pg_lo_write', + 'pg_meta_data' => 'Safe\pg_meta_data', + 'pg_parameter_status' => 'Safe\pg_parameter_status', + 'pg_pconnect' => 'Safe\pg_pconnect', + 'pg_ping' => 'Safe\pg_ping', + 'pg_prepare' => 'Safe\pg_prepare', + 'pg_put_line' => 'Safe\pg_put_line', + 'pg_query' => 'Safe\pg_query', + 'pg_query_params' => 'Safe\pg_query_params', + 'pg_result_error_field' => 'Safe\pg_result_error_field', + 'pg_result_seek' => 'Safe\pg_result_seek', + 'pg_select' => 'Safe\pg_select', + 'pg_socket' => 'Safe\pg_socket', + 'pg_trace' => 'Safe\pg_trace', + 'pg_update' => 'Safe\pg_update', + 'phpcredits' => 'Safe\phpcredits', + 'phpinfo' => 'Safe\phpinfo', + 'php_sapi_name' => 'Safe\php_sapi_name', + 'png2wbmp' => 'Safe\png2wbmp', + 'posix_access' => 'Safe\posix_access', + 'posix_getgrgid' => 'Safe\posix_getgrgid', + 'posix_getgrnam' => 'Safe\posix_getgrnam', + 'posix_getgroups' => 'Safe\posix_getgroups', + 'posix_getlogin' => 'Safe\posix_getlogin', + 'posix_getpwuid' => 'Safe\posix_getpwuid', + 'posix_getrlimit' => 'Safe\posix_getrlimit', + 'posix_getsid' => 'Safe\posix_getsid', + 'posix_initgroups' => 'Safe\posix_initgroups', + 'posix_kill' => 'Safe\posix_kill', + 'posix_mkfifo' => 'Safe\posix_mkfifo', + 'posix_mknod' => 'Safe\posix_mknod', + 'posix_setegid' => 'Safe\posix_setegid', + 'posix_seteuid' => 'Safe\posix_seteuid', + 'posix_setgid' => 'Safe\posix_setgid', + 'posix_setpgid' => 'Safe\posix_setpgid', + 'posix_setrlimit' => 'Safe\posix_setrlimit', + 'posix_setuid' => 'Safe\posix_setuid', + 'posix_times' => 'Safe\posix_times', + 'posix_uname' => 'Safe\posix_uname', + 'preg_grep' => 'Safe\preg_grep', + 'preg_match' => 'Safe\preg_match', + 'preg_match_all' => 'Safe\preg_match_all', + 'preg_replace' => 'Safe\preg_replace', + 'preg_split' => 'Safe\preg_split', + 'proc_nice' => 'Safe\proc_nice', + 'pspell_add_to_personal' => 'Safe\pspell_add_to_personal', + 'pspell_add_to_session' => 'Safe\pspell_add_to_session', + 'pspell_clear_session' => 'Safe\pspell_clear_session', + 'pspell_config_create' => 'Safe\pspell_config_create', + 'pspell_config_data_dir' => 'Safe\pspell_config_data_dir', + 'pspell_config_dict_dir' => 'Safe\pspell_config_dict_dir', + 'pspell_config_ignore' => 'Safe\pspell_config_ignore', + 'pspell_config_mode' => 'Safe\pspell_config_mode', + 'pspell_config_personal' => 'Safe\pspell_config_personal', + 'pspell_config_repl' => 'Safe\pspell_config_repl', + 'pspell_config_runtogether' => 'Safe\pspell_config_runtogether', + 'pspell_config_save_repl' => 'Safe\pspell_config_save_repl', + 'pspell_new' => 'Safe\pspell_new', + 'pspell_new_config' => 'Safe\pspell_new_config', + 'pspell_new_personal' => 'Safe\pspell_new_personal', + 'pspell_save_wordlist' => 'Safe\pspell_save_wordlist', + 'pspell_store_replacement' => 'Safe\pspell_store_replacement', + 'ps_add_launchlink' => 'Safe\ps_add_launchlink', + 'ps_add_locallink' => 'Safe\ps_add_locallink', + 'ps_add_note' => 'Safe\ps_add_note', + 'ps_add_pdflink' => 'Safe\ps_add_pdflink', + 'ps_add_weblink' => 'Safe\ps_add_weblink', + 'ps_arc' => 'Safe\ps_arc', + 'ps_arcn' => 'Safe\ps_arcn', + 'ps_begin_page' => 'Safe\ps_begin_page', + 'ps_begin_pattern' => 'Safe\ps_begin_pattern', + 'ps_begin_template' => 'Safe\ps_begin_template', + 'ps_circle' => 'Safe\ps_circle', + 'ps_clip' => 'Safe\ps_clip', + 'ps_close' => 'Safe\ps_close', + 'ps_closepath' => 'Safe\ps_closepath', + 'ps_closepath_stroke' => 'Safe\ps_closepath_stroke', + 'ps_close_image' => 'Safe\ps_close_image', + 'ps_continue_text' => 'Safe\ps_continue_text', + 'ps_curveto' => 'Safe\ps_curveto', + 'ps_delete' => 'Safe\ps_delete', + 'ps_end_page' => 'Safe\ps_end_page', + 'ps_end_pattern' => 'Safe\ps_end_pattern', + 'ps_end_template' => 'Safe\ps_end_template', + 'ps_fill' => 'Safe\ps_fill', + 'ps_fill_stroke' => 'Safe\ps_fill_stroke', + 'ps_get_parameter' => 'Safe\ps_get_parameter', + 'ps_hyphenate' => 'Safe\ps_hyphenate', + 'ps_include_file' => 'Safe\ps_include_file', + 'ps_lineto' => 'Safe\ps_lineto', + 'ps_moveto' => 'Safe\ps_moveto', + 'ps_new' => 'Safe\ps_new', + 'ps_open_file' => 'Safe\ps_open_file', + 'ps_place_image' => 'Safe\ps_place_image', + 'ps_rect' => 'Safe\ps_rect', + 'ps_restore' => 'Safe\ps_restore', + 'ps_rotate' => 'Safe\ps_rotate', + 'ps_save' => 'Safe\ps_save', + 'ps_scale' => 'Safe\ps_scale', + 'ps_setcolor' => 'Safe\ps_setcolor', + 'ps_setdash' => 'Safe\ps_setdash', + 'ps_setflat' => 'Safe\ps_setflat', + 'ps_setfont' => 'Safe\ps_setfont', + 'ps_setgray' => 'Safe\ps_setgray', + 'ps_setlinecap' => 'Safe\ps_setlinecap', + 'ps_setlinejoin' => 'Safe\ps_setlinejoin', + 'ps_setlinewidth' => 'Safe\ps_setlinewidth', + 'ps_setmiterlimit' => 'Safe\ps_setmiterlimit', + 'ps_setoverprintmode' => 'Safe\ps_setoverprintmode', + 'ps_setpolydash' => 'Safe\ps_setpolydash', + 'ps_set_border_color' => 'Safe\ps_set_border_color', + 'ps_set_border_dash' => 'Safe\ps_set_border_dash', + 'ps_set_border_style' => 'Safe\ps_set_border_style', + 'ps_set_info' => 'Safe\ps_set_info', + 'ps_set_parameter' => 'Safe\ps_set_parameter', + 'ps_set_text_pos' => 'Safe\ps_set_text_pos', + 'ps_set_value' => 'Safe\ps_set_value', + 'ps_shading' => 'Safe\ps_shading', + 'ps_shading_pattern' => 'Safe\ps_shading_pattern', + 'ps_shfill' => 'Safe\ps_shfill', + 'ps_show' => 'Safe\ps_show', + 'ps_show2' => 'Safe\ps_show2', + 'ps_show_xy' => 'Safe\ps_show_xy', + 'ps_show_xy2' => 'Safe\ps_show_xy2', + 'ps_stroke' => 'Safe\ps_stroke', + 'ps_symbol' => 'Safe\ps_symbol', + 'ps_translate' => 'Safe\ps_translate', + 'putenv' => 'Safe\putenv', + 'readfile' => 'Safe\readfile', + 'readgzfile' => 'Safe\readgzfile', + 'readline_add_history' => 'Safe\readline_add_history', + 'readline_callback_handler_install' => 'Safe\readline_callback_handler_install', + 'readline_clear_history' => 'Safe\readline_clear_history', + 'readline_completion_function' => 'Safe\readline_completion_function', + 'readline_read_history' => 'Safe\readline_read_history', + 'readline_write_history' => 'Safe\readline_write_history', + 'readlink' => 'Safe\readlink', + 'realpath' => 'Safe\realpath', + 'register_tick_function' => 'Safe\register_tick_function', + 'rename' => 'Safe\rename', + 'rewind' => 'Safe\rewind', + 'rmdir' => 'Safe\rmdir', + 'rnp_decrypt' => 'Safe\rnp_decrypt', + 'rnp_dump_packets' => 'Safe\rnp_dump_packets', + 'rnp_dump_packets_to_json' => 'Safe\rnp_dump_packets_to_json', + 'rnp_ffi_create' => 'Safe\rnp_ffi_create', + 'rnp_ffi_set_pass_provider' => 'Safe\rnp_ffi_set_pass_provider', + 'rnp_import_keys' => 'Safe\rnp_import_keys', + 'rnp_import_signatures' => 'Safe\rnp_import_signatures', + 'rnp_key_export' => 'Safe\rnp_key_export', + 'rnp_key_export_autocrypt' => 'Safe\rnp_key_export_autocrypt', + 'rnp_key_export_revocation' => 'Safe\rnp_key_export_revocation', + 'rnp_key_get_info' => 'Safe\rnp_key_get_info', + 'rnp_key_remove' => 'Safe\rnp_key_remove', + 'rnp_key_revoke' => 'Safe\rnp_key_revoke', + 'rnp_list_keys' => 'Safe\rnp_list_keys', + 'rnp_load_keys' => 'Safe\rnp_load_keys', + 'rnp_load_keys_from_path' => 'Safe\rnp_load_keys_from_path', + 'rnp_locate_key' => 'Safe\rnp_locate_key', + 'rnp_op_encrypt' => 'Safe\rnp_op_encrypt', + 'rnp_op_generate_key' => 'Safe\rnp_op_generate_key', + 'rnp_op_sign' => 'Safe\rnp_op_sign', + 'rnp_op_sign_cleartext' => 'Safe\rnp_op_sign_cleartext', + 'rnp_op_sign_detached' => 'Safe\rnp_op_sign_detached', + 'rnp_op_verify' => 'Safe\rnp_op_verify', + 'rnp_op_verify_detached' => 'Safe\rnp_op_verify_detached', + 'rnp_save_keys' => 'Safe\rnp_save_keys', + 'rnp_save_keys_to_path' => 'Safe\rnp_save_keys_to_path', + 'rnp_supported_features' => 'Safe\rnp_supported_features', + 'rpmaddtag' => 'Safe\rpmaddtag', + 'rrd_create' => 'Safe\rrd_create', + 'rrd_first' => 'Safe\rrd_first', + 'rrd_graph' => 'Safe\rrd_graph', + 'rrd_info' => 'Safe\rrd_info', + 'rrd_lastupdate' => 'Safe\rrd_lastupdate', + 'rrd_restore' => 'Safe\rrd_restore', + 'rrd_tune' => 'Safe\rrd_tune', + 'rrd_update' => 'Safe\rrd_update', + 'rrd_xport' => 'Safe\rrd_xport', + 'sapi_windows_cp_conv' => 'Safe\sapi_windows_cp_conv', + 'sapi_windows_cp_set' => 'Safe\sapi_windows_cp_set', + 'sapi_windows_generate_ctrl_event' => 'Safe\sapi_windows_generate_ctrl_event', + 'sapi_windows_set_ctrl_handler' => 'Safe\sapi_windows_set_ctrl_handler', + 'sapi_windows_vt100_support' => 'Safe\sapi_windows_vt100_support', + 'scandir' => 'Safe\scandir', + 'sem_acquire' => 'Safe\sem_acquire', + 'sem_get' => 'Safe\sem_get', + 'sem_release' => 'Safe\sem_release', + 'sem_remove' => 'Safe\sem_remove', + 'session_abort' => 'Safe\session_abort', + 'session_create_id' => 'Safe\session_create_id', + 'session_decode' => 'Safe\session_decode', + 'session_destroy' => 'Safe\session_destroy', + 'session_encode' => 'Safe\session_encode', + 'session_id' => 'Safe\session_id', + 'session_module_name' => 'Safe\session_module_name', + 'session_name' => 'Safe\session_name', + 'session_regenerate_id' => 'Safe\session_regenerate_id', + 'session_reset' => 'Safe\session_reset', + 'session_save_path' => 'Safe\session_save_path', + 'session_unset' => 'Safe\session_unset', + 'session_write_close' => 'Safe\session_write_close', + 'settype' => 'Safe\settype', + 'set_include_path' => 'Safe\set_include_path', + 'set_time_limit' => 'Safe\set_time_limit', + 'sha1_file' => 'Safe\sha1_file', + 'shell_exec' => 'Safe\shell_exec', + 'shmop_delete' => 'Safe\shmop_delete', + 'shmop_read' => 'Safe\shmop_read', + 'shm_attach' => 'Safe\shm_attach', + 'shm_detach' => 'Safe\shm_detach', + 'shm_put_var' => 'Safe\shm_put_var', + 'shm_remove' => 'Safe\shm_remove', + 'shm_remove_var' => 'Safe\shm_remove_var', + 'shuffle' => 'Safe\shuffle', + 'simplexml_import_dom' => 'Safe\simplexml_import_dom', + 'simplexml_load_file' => 'Safe\simplexml_load_file', + 'simplexml_load_string' => 'Safe\simplexml_load_string', + 'socket_accept' => 'Safe\socket_accept', + 'socket_addrinfo_bind' => 'Safe\socket_addrinfo_bind', + 'socket_addrinfo_connect' => 'Safe\socket_addrinfo_connect', + 'socket_addrinfo_lookup' => 'Safe\socket_addrinfo_lookup', + 'socket_bind' => 'Safe\socket_bind', + 'socket_connect' => 'Safe\socket_connect', + 'socket_create' => 'Safe\socket_create', + 'socket_create_listen' => 'Safe\socket_create_listen', + 'socket_create_pair' => 'Safe\socket_create_pair', + 'socket_export_stream' => 'Safe\socket_export_stream', + 'socket_getpeername' => 'Safe\socket_getpeername', + 'socket_getsockname' => 'Safe\socket_getsockname', + 'socket_get_option' => 'Safe\socket_get_option', + 'socket_import_stream' => 'Safe\socket_import_stream', + 'socket_listen' => 'Safe\socket_listen', + 'socket_read' => 'Safe\socket_read', + 'socket_send' => 'Safe\socket_send', + 'socket_sendmsg' => 'Safe\socket_sendmsg', + 'socket_sendto' => 'Safe\socket_sendto', + 'socket_set_block' => 'Safe\socket_set_block', + 'socket_set_nonblock' => 'Safe\socket_set_nonblock', + 'socket_set_option' => 'Safe\socket_set_option', + 'socket_shutdown' => 'Safe\socket_shutdown', + 'socket_write' => 'Safe\socket_write', + 'socket_wsaprotocol_info_export' => 'Safe\socket_wsaprotocol_info_export', + 'socket_wsaprotocol_info_import' => 'Safe\socket_wsaprotocol_info_import', + 'socket_wsaprotocol_info_release' => 'Safe\socket_wsaprotocol_info_release', + 'sodium_crypto_aead_aes256gcm_decrypt' => 'Safe\sodium_crypto_aead_aes256gcm_decrypt', + 'sodium_crypto_aead_chacha20poly1305_decrypt' => 'Safe\sodium_crypto_aead_chacha20poly1305_decrypt', + 'sodium_crypto_aead_chacha20poly1305_encrypt' => 'Safe\sodium_crypto_aead_chacha20poly1305_encrypt', + 'sodium_crypto_aead_chacha20poly1305_ietf_decrypt' => 'Safe\sodium_crypto_aead_chacha20poly1305_ietf_decrypt', + 'sodium_crypto_aead_chacha20poly1305_ietf_encrypt' => 'Safe\sodium_crypto_aead_chacha20poly1305_ietf_encrypt', + 'sodium_crypto_aead_xchacha20poly1305_ietf_decrypt' => 'Safe\sodium_crypto_aead_xchacha20poly1305_ietf_decrypt', + 'sodium_crypto_aead_xchacha20poly1305_ietf_encrypt' => 'Safe\sodium_crypto_aead_xchacha20poly1305_ietf_encrypt', + 'sodium_crypto_auth_verify' => 'Safe\sodium_crypto_auth_verify', + 'sodium_crypto_box_open' => 'Safe\sodium_crypto_box_open', + 'sodium_crypto_box_seal_open' => 'Safe\sodium_crypto_box_seal_open', + 'sodium_crypto_generichash_update' => 'Safe\sodium_crypto_generichash_update', + 'sodium_crypto_secretbox_open' => 'Safe\sodium_crypto_secretbox_open', + 'sodium_crypto_sign_open' => 'Safe\sodium_crypto_sign_open', + 'sodium_crypto_sign_verify_detached' => 'Safe\sodium_crypto_sign_verify_detached', + 'sodium_crypto_stream_xchacha20_xor_ic' => 'Safe\sodium_crypto_stream_xchacha20_xor_ic', + 'solr_get_version' => 'Safe\solr_get_version', + 'spl_autoload_register' => 'Safe\spl_autoload_register', + 'spl_autoload_unregister' => 'Safe\spl_autoload_unregister', + 'sqlsrv_begin_transaction' => 'Safe\sqlsrv_begin_transaction', + 'sqlsrv_cancel' => 'Safe\sqlsrv_cancel', + 'sqlsrv_client_info' => 'Safe\sqlsrv_client_info', + 'sqlsrv_close' => 'Safe\sqlsrv_close', + 'sqlsrv_commit' => 'Safe\sqlsrv_commit', + 'sqlsrv_configure' => 'Safe\sqlsrv_configure', + 'sqlsrv_execute' => 'Safe\sqlsrv_execute', + 'sqlsrv_free_stmt' => 'Safe\sqlsrv_free_stmt', + 'sqlsrv_get_field' => 'Safe\sqlsrv_get_field', + 'sqlsrv_next_result' => 'Safe\sqlsrv_next_result', + 'sqlsrv_num_fields' => 'Safe\sqlsrv_num_fields', + 'sqlsrv_num_rows' => 'Safe\sqlsrv_num_rows', + 'sqlsrv_prepare' => 'Safe\sqlsrv_prepare', + 'sqlsrv_query' => 'Safe\sqlsrv_query', + 'sqlsrv_rollback' => 'Safe\sqlsrv_rollback', + 'ssdeep_fuzzy_compare' => 'Safe\ssdeep_fuzzy_compare', + 'ssdeep_fuzzy_hash' => 'Safe\ssdeep_fuzzy_hash', + 'ssdeep_fuzzy_hash_filename' => 'Safe\ssdeep_fuzzy_hash_filename', + 'ssh2_auth_agent' => 'Safe\ssh2_auth_agent', + 'ssh2_auth_hostbased_file' => 'Safe\ssh2_auth_hostbased_file', + 'ssh2_auth_password' => 'Safe\ssh2_auth_password', + 'ssh2_auth_pubkey_file' => 'Safe\ssh2_auth_pubkey_file', + 'ssh2_connect' => 'Safe\ssh2_connect', + 'ssh2_disconnect' => 'Safe\ssh2_disconnect', + 'ssh2_exec' => 'Safe\ssh2_exec', + 'ssh2_forward_accept' => 'Safe\ssh2_forward_accept', + 'ssh2_forward_listen' => 'Safe\ssh2_forward_listen', + 'ssh2_publickey_add' => 'Safe\ssh2_publickey_add', + 'ssh2_publickey_init' => 'Safe\ssh2_publickey_init', + 'ssh2_publickey_remove' => 'Safe\ssh2_publickey_remove', + 'ssh2_scp_recv' => 'Safe\ssh2_scp_recv', + 'ssh2_scp_send' => 'Safe\ssh2_scp_send', + 'ssh2_send_eof' => 'Safe\ssh2_send_eof', + 'ssh2_sftp' => 'Safe\ssh2_sftp', + 'ssh2_sftp_chmod' => 'Safe\ssh2_sftp_chmod', + 'ssh2_sftp_mkdir' => 'Safe\ssh2_sftp_mkdir', + 'ssh2_sftp_rename' => 'Safe\ssh2_sftp_rename', + 'ssh2_sftp_rmdir' => 'Safe\ssh2_sftp_rmdir', + 'ssh2_sftp_symlink' => 'Safe\ssh2_sftp_symlink', + 'ssh2_sftp_unlink' => 'Safe\ssh2_sftp_unlink', + 'ssh2_shell' => 'Safe\ssh2_shell', + 'stream_context_set_params' => 'Safe\stream_context_set_params', + 'stream_copy_to_stream' => 'Safe\stream_copy_to_stream', + 'stream_filter_append' => 'Safe\stream_filter_append', + 'stream_filter_prepend' => 'Safe\stream_filter_prepend', + 'stream_filter_register' => 'Safe\stream_filter_register', + 'stream_filter_remove' => 'Safe\stream_filter_remove', + 'stream_get_contents' => 'Safe\stream_get_contents', + 'stream_get_line' => 'Safe\stream_get_line', + 'stream_isatty' => 'Safe\stream_isatty', + 'stream_resolve_include_path' => 'Safe\stream_resolve_include_path', + 'stream_set_blocking' => 'Safe\stream_set_blocking', + 'stream_set_timeout' => 'Safe\stream_set_timeout', + 'stream_socket_accept' => 'Safe\stream_socket_accept', + 'stream_socket_client' => 'Safe\stream_socket_client', + 'stream_socket_get_name' => 'Safe\stream_socket_get_name', + 'stream_socket_pair' => 'Safe\stream_socket_pair', + 'stream_socket_recvfrom' => 'Safe\stream_socket_recvfrom', + 'stream_socket_sendto' => 'Safe\stream_socket_sendto', + 'stream_socket_server' => 'Safe\stream_socket_server', + 'stream_socket_shutdown' => 'Safe\stream_socket_shutdown', + 'stream_supports_lock' => 'Safe\stream_supports_lock', + 'stream_wrapper_register' => 'Safe\stream_wrapper_register', + 'stream_wrapper_restore' => 'Safe\stream_wrapper_restore', + 'stream_wrapper_unregister' => 'Safe\stream_wrapper_unregister', + 'strftime' => 'Safe\strftime', + 'strptime' => 'Safe\strptime', + 'strtotime' => 'Safe\strtotime', + 'swoole_async_dns_lookup' => 'Safe\swoole_async_dns_lookup', + 'swoole_async_readfile' => 'Safe\swoole_async_readfile', + 'swoole_async_write' => 'Safe\swoole_async_write', + 'swoole_async_writefile' => 'Safe\swoole_async_writefile', + 'swoole_event_defer' => 'Safe\swoole_event_defer', + 'swoole_event_del' => 'Safe\swoole_event_del', + 'swoole_event_write' => 'Safe\swoole_event_write', + 'symlink' => 'Safe\symlink', + 'syslog' => 'Safe\syslog', + 'system' => 'Safe\system', + 'tempnam' => 'Safe\tempnam', + 'timezone_name_from_abbr' => 'Safe\timezone_name_from_abbr', + 'time_nanosleep' => 'Safe\time_nanosleep', + 'time_sleep_until' => 'Safe\time_sleep_until', + 'tmpfile' => 'Safe\tmpfile', + 'touch' => 'Safe\touch', + 'unixtojd' => 'Safe\unixtojd', + 'unlink' => 'Safe\unlink', + 'unpack' => 'Safe\unpack', + 'uopz_extend' => 'Safe\uopz_extend', + 'uopz_implement' => 'Safe\uopz_implement', + 'variant_date_to_timestamp' => 'Safe\variant_date_to_timestamp', + 'variant_round' => 'Safe\variant_round', + 'virtual' => 'Safe\virtual', + 'xdiff_file_bdiff' => 'Safe\xdiff_file_bdiff', + 'xdiff_file_bpatch' => 'Safe\xdiff_file_bpatch', + 'xdiff_file_diff' => 'Safe\xdiff_file_diff', + 'xdiff_file_diff_binary' => 'Safe\xdiff_file_diff_binary', + 'xdiff_file_patch_binary' => 'Safe\xdiff_file_patch_binary', + 'xdiff_file_rabdiff' => 'Safe\xdiff_file_rabdiff', + 'xdiff_string_bpatch' => 'Safe\xdiff_string_bpatch', + 'xdiff_string_patch' => 'Safe\xdiff_string_patch', + 'xdiff_string_patch_binary' => 'Safe\xdiff_string_patch_binary', + 'xmlrpc_set_type' => 'Safe\xmlrpc_set_type', + 'xml_parser_free' => 'Safe\xml_parser_free', + 'xml_set_character_data_handler' => 'Safe\xml_set_character_data_handler', + 'xml_set_default_handler' => 'Safe\xml_set_default_handler', + 'xml_set_element_handler' => 'Safe\xml_set_element_handler', + 'xml_set_end_namespace_decl_handler' => 'Safe\xml_set_end_namespace_decl_handler', + 'xml_set_external_entity_ref_handler' => 'Safe\xml_set_external_entity_ref_handler', + 'xml_set_notation_decl_handler' => 'Safe\xml_set_notation_decl_handler', + 'xml_set_object' => 'Safe\xml_set_object', + 'xml_set_processing_instruction_handler' => 'Safe\xml_set_processing_instruction_handler', + 'xml_set_start_namespace_decl_handler' => 'Safe\xml_set_start_namespace_decl_handler', + 'xml_set_unparsed_entity_decl_handler' => 'Safe\xml_set_unparsed_entity_decl_handler', + 'yaml_parse' => 'Safe\yaml_parse', + 'yaml_parse_file' => 'Safe\yaml_parse_file', + 'yaml_parse_url' => 'Safe\yaml_parse_url', + 'yaz_ccl_parse' => 'Safe\yaz_ccl_parse', + 'yaz_close' => 'Safe\yaz_close', + 'yaz_connect' => 'Safe\yaz_connect', + 'yaz_database' => 'Safe\yaz_database', + 'yaz_element' => 'Safe\yaz_element', + 'yaz_present' => 'Safe\yaz_present', + 'yaz_search' => 'Safe\yaz_search', + 'yaz_wait' => 'Safe\yaz_wait', + 'zip_entry_close' => 'Safe\zip_entry_close', + 'zip_entry_compressedsize' => 'Safe\zip_entry_compressedsize', + 'zip_entry_compressionmethod' => 'Safe\zip_entry_compressionmethod', + 'zip_entry_filesize' => 'Safe\zip_entry_filesize', + 'zip_entry_name' => 'Safe\zip_entry_name', + 'zip_entry_open' => 'Safe\zip_entry_open', + 'zip_entry_read' => 'Safe\zip_entry_read', + 'zlib_decode' => 'Safe\zlib_decode', + ] + ); +}; diff --git a/generated/8.2/rnp.php b/generated/8.2/rnp.php new file mode 100644 index 00000000..9b5587b6 --- /dev/null +++ b/generated/8.2/rnp.php @@ -0,0 +1,609 @@ + + * + * + * @param bool $use_include_path Setting use_include_path to TRUE will result + * in PHP trying to open the file along the standard include path as per + * the include_path directive. + * This is used for local files, not URLs. + * @return array Returns an array with all the parsed meta tags. + * + * The value of the name property becomes the key, the value of the content + * property becomes the value of the returned array, so you can easily use + * standard array functions to traverse it or access single values. + * Special characters in the value of the name property are substituted with + * '_', the rest is converted to lower case. If two meta tags have the same + * name, only the last one is returned. + * + * Returns FALSE on failure. + * @throws UrlException + * + */ +function get_meta_tags(string $filename, bool $use_include_path = false): array +{ + error_clear_last(); + $safeResult = \get_meta_tags($filename, $use_include_path); + if ($safeResult === false) { + throw UrlException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * This function parses a URL and returns an associative array containing any + * of the various components of the URL that are present. + * The values of the array elements are not URL decoded. + * + * This function is not meant to validate + * the given URL, it only breaks it up into the parts listed below. Partial and invalid + * URLs are also accepted, parse_url tries its best to + * parse them correctly. + * + * @param string $url The URL to parse. + * @param int $component Specify one of PHP_URL_SCHEME, + * PHP_URL_HOST, PHP_URL_PORT, + * PHP_URL_USER, PHP_URL_PASS, + * PHP_URL_PATH, PHP_URL_QUERY + * or PHP_URL_FRAGMENT to retrieve just a specific + * URL component as a string (except when + * PHP_URL_PORT is given, in which case the return + * value will be an int). + * @return array|int|string|null On seriously malformed URLs, parse_url. + * + * If the component parameter is omitted, an + * associative array is returned. At least one element will be + * present within the array. Potential keys within this array are: + * + * + * + * scheme - e.g. http + * + * + * + * + * host + * + * + * + * + * port + * + * + * + * + * user + * + * + * + * + * pass + * + * + * + * + * path + * + * + * + * + * query - after the question mark ? + * + * + * + * + * fragment - after the hashmark # + * + * + * + * + * If the component parameter is specified, + * parse_url returns a string (or an + * int, in the case of PHP_URL_PORT) + * instead of an array. If the requested component doesn't exist + * within the given URL, NULL will be returned. + * As of PHP 8.0.0, parse_url distinguishes absent and empty + * queries and fragments: + * + * + * + * + * + * + * + * Previously all cases resulted in query and fragment being NULL. + * + * Note that control characters (cf. ctype_cntrl) in the + * components are replaced with underscores (_). + * @throws UrlException + * + */ +function parse_url(string $url, int $component = -1) +{ + error_clear_last(); + $safeResult = \parse_url($url, $component); + if ($safeResult === false) { + throw UrlException::createFromPhpError(); + } + return $safeResult; +} diff --git a/generated/8.2/var.php b/generated/8.2/var.php new file mode 100644 index 00000000..70f048df --- /dev/null +++ b/generated/8.2/var.php @@ -0,0 +1,60 @@ + + * ]]> + * + * See section 4.7 of the XML 1.0 + * spec for the definition of notation declarations. + * + * @param resource $parser A reference to the XML parser to set up notation declaration handler function. + * @param callable $handler handler is a string containing the name of a + * function that must exist when xml_parse is called + * for parser. + * + * The function named by handler must accept + * five parameters: + * + * handler + * XMLParserparser + * stringnotation_name + * stringbase + * stringsystem_id + * stringpublic_id + * + * + * + * + * parser + * + * + * + * The first parameter, parser, is a + * reference to the XML parser calling the handler. + * + * + * + * + * notation_name + * + * + * This is the notation's name, as per + * the notation format described above. + * + * + * + * + * + * base + * + * + * + * This is the base for resolving the system identifier + * (system_id) of the notation declaration. + * Currently this parameter will always be set to an empty string. + * + * + * + * + * system_id + * + * + * System identifier of the external notation declaration. + * + * + * + * + * + * public_id + * + * + * + * Public identifier of the external notation declaration. + * + * + * + * + * + * If a handler function is set to an empty string, or FALSE, the handler + * in question is disabled. + * @throws XmlException + * + */ +function xml_set_notation_decl_handler($parser, callable $handler): void +{ + error_clear_last(); + $safeResult = \xml_set_notation_decl_handler($parser, $handler); + if ($safeResult === false) { + throw XmlException::createFromPhpError(); + } +} + + +/** + * This function allows to use parser inside + * object. All callback functions could be set with + * xml_set_element_handler etc and assumed to be + * methods of object. + * + * @param resource $parser A reference to the XML parser to use inside the object. + * @param object $object The object where to use the XML parser. + * @throws XmlException + * + */ +function xml_set_object($parser, object $object): void +{ + error_clear_last(); + $safeResult = \xml_set_object($parser, $object); + if ($safeResult === false) { + throw XmlException::createFromPhpError(); + } +} + + +/** + * Sets the processing instruction (PI) handler function for the XML parser + * parser. + * + * A processing instruction has the following format: + * + * <?target + * data?> + * + * + * You can put PHP code into such a tag, but be aware of one limitation: in + * an XML PI, the PI end tag (?>) can not be quoted, + * so this character sequence should not appear in the PHP code you embed + * with PIs in XML documents.If it does, the rest of the PHP code, as well + * as the "real" PI end tag, will be treated as character data. + * + * @param resource $parser A reference to the XML parser to set up processing instruction (PI) handler function. + * @param callable $handler handler is a string containing the name of a + * function that must exist when xml_parse is called + * for parser. + * + * The function named by handler must accept + * three parameters: + * + * handler + * XMLParserparser + * stringtarget + * stringdata + * + * + * + * parser + * + * + * The first parameter, parser, is a + * reference to the XML parser calling the handler. + * + * + * + * + * target + * + * + * The second parameter, target, contains the PI + * target. + * + * + * + * + * data + * + * + * The third parameter, data, contains the PI + * data. + * + * + * + * + * + * If a handler function is set to an empty string, or FALSE, the handler + * in question is disabled. + * @throws XmlException + * + */ +function xml_set_processing_instruction_handler($parser, callable $handler): void +{ + error_clear_last(); + $safeResult = \xml_set_processing_instruction_handler($parser, $handler); + if ($safeResult === false) { + throw XmlException::createFromPhpError(); + } +} + + +/** + * Set a handler to be called when a namespace is declared. Namespace + * declarations occur inside start tags. But the namespace declaration start + * handler is called before the start tag handler for each namespace declared + * in that start tag. + * + * @param resource $parser A reference to the XML parser. + * @param callable $handler handler is a string containing the name of a + * function that must exist when xml_parse is called + * for parser. + * + * The function named by handler must accept + * three parameters, and should return an integer value. If the + * value returned from the handler is FALSE (which it will be if no + * value is returned), the XML parser will stop parsing and + * xml_get_error_code will return + * XML_ERROR_EXTERNAL_ENTITY_HANDLING. + * + * handler + * XMLParserparser + * stringprefix + * stringuri + * + * + * + * parser + * + * + * The first parameter, parser, is a + * reference to the XML parser calling the handler. + * + * + * + * + * prefix + * + * + * The prefix is a string used to reference the namespace within an XML object. + * + * + * + * + * uri + * + * + * Uniform Resource Identifier (URI) of namespace. + * + * + * + * + * + * If a handler function is set to an empty string, or FALSE, the handler + * in question is disabled. + * @throws XmlException + * + */ +function xml_set_start_namespace_decl_handler($parser, callable $handler): void +{ + error_clear_last(); + $safeResult = \xml_set_start_namespace_decl_handler($parser, $handler); + if ($safeResult === false) { + throw XmlException::createFromPhpError(); + } +} + + +/** + * Sets the unparsed entity declaration handler function for the XML parser + * parser. + * + * The handler will be called if the XML parser + * encounters an external entity declaration with an NDATA declaration, like + * the following: + * + * name {publicId | systemId} + * NDATA notationName + * ]]> + * + * + * See section 4.2.2 of + * the XML 1.0 spec for the definition of notation declared + * external entities. + * + * @param resource $parser A reference to the XML parser to set up unparsed entity declaration handler function. + * @param callable $handler handler is a string containing the name of a + * function that must exist when xml_parse is called + * for parser. + * + * The function named by handler must accept six + * parameters: + * + * handler + * XMLParserparser + * stringentity_name + * stringbase + * stringsystem_id + * stringpublic_id + * stringnotation_name + * + * + * + * parser + * + * + * The first parameter, parser, is a + * reference to the XML parser calling the + * handler. + * + * + * + * + * entity_name + * + * + * The name of the entity that is about to be defined. + * + * + * + * + * base + * + * + * This is the base for resolving the system identifier + * (systemId) of the external entity.Currently + * this parameter will always be set to an empty string. + * + * + * + * + * system_id + * + * + * System identifier for the external entity. + * + * + * + * + * public_id + * + * + * Public identifier for the external entity. + * + * + * + * + * notation_name + * + * + * Name of the notation of this entity (see + * xml_set_notation_decl_handler). + * + * + * + * + * + * If a handler function is set to an empty string, or FALSE, the handler + * in question is disabled. + * @throws XmlException + * + */ +function xml_set_unparsed_entity_decl_handler($parser, callable $handler): void +{ + error_clear_last(); + $safeResult = \xml_set_unparsed_entity_decl_handler($parser, $handler); + if ($safeResult === false) { + throw XmlException::createFromPhpError(); + } +} diff --git a/generated/8.2/xmlrpc.php b/generated/8.2/xmlrpc.php new file mode 100644 index 00000000..3a1f5362 --- /dev/null +++ b/generated/8.2/xmlrpc.php @@ -0,0 +1,22 @@ + + * + * + * + * The permissions 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 $permissions): void +{ + error_clear_last(); + $safeResult = \chmod($filename, $permissions); + if ($safeResult === false) { + throw 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 FilesystemException + * + */ +function chown(string $filename, $user): void +{ + error_clear_last(); + $safeResult = \chown($filename, $user); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * Makes a copy of the file from to + * to. + * + * If you wish to move a file, use the rename function. + * + * @param string $from Path to the source file. + * @param string $to The destination path. If to 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 FilesystemException + * + */ +function copy(string $from, string $to, $context = null): void +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \copy($from, $to, $context); + } else { + $safeResult = \copy($from, $to); + } + if ($safeResult === false) { + throw 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 FilesystemException + * + */ +function disk_free_space(string $directory): float +{ + error_clear_last(); + $safeResult = \disk_free_space($directory); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function disk_total_space(string $directory): float +{ + error_clear_last(); + $safeResult = \disk_total_space($directory); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * The file pointed to by stream is closed. + * + * @param resource $stream The file pointer must be valid, and must point to a file successfully + * opened by fopen or fsockopen. + * @throws FilesystemException + * + */ +function fclose($stream): void +{ + error_clear_last(); + $safeResult = \fclose($stream); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * This function synchronizes stream contents to storage media, just like fsync does, + * but it does not synchronize file meta-data. + * Note that this function is only effectively different in POSIX systems. + * In Windows, this function is aliased to fsync. + * + * @param resource $stream 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 FilesystemException + * + */ +function fdatasync($stream): void +{ + error_clear_last(); + $safeResult = \fdatasync($stream); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * This function forces a write of all buffered output to the resource + * pointed to by the file stream. + * + * @param resource $stream 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 FilesystemException + * + */ +function fflush($stream): void +{ + error_clear_last(); + $safeResult = \fflush($stream); + if ($safeResult === false) { + throw 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 length 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 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 $length 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 FilesystemException + * + */ +function file_get_contents(string $filename, bool $use_include_path = false, $context = null, int $offset = 0, ?int $length = null): string +{ + error_clear_last(); + if ($length !== null) { + $safeResult = \file_get_contents($filename, $use_include_path, $context, $offset, $length); + } elseif ($offset !== 0) { + $safeResult = \file_get_contents($filename, $use_include_path, $context, $offset); + } elseif ($context !== null) { + $safeResult = \file_get_contents($filename, $use_include_path, $context); + } else { + $safeResult = \file_get_contents($filename, $use_include_path); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * This function is identical to calling fopen, + * fwrite and fclose successively + * to write data to a file. + * + * If filename does not exist, the file is created. + * Otherwise, the existing file is overwritten, unless the + * FILE_APPEND flag is set. + * + * @param string $filename Path to the file where to write the data. + * @param mixed $data The data to write. Can be either a string, an + * array or a stream resource. + * + * If data is a stream resource, the + * remaining buffer of that stream will be copied to the specified file. + * This is similar with using stream_copy_to_stream. + * + * You can also specify the data parameter as a single + * dimension array. This is equivalent to + * file_put_contents($filename, implode('', $array)). + * @param int $flags The value of flags can be any combination of + * the following flags, joined with the binary OR (|) + * operator. + * + * + * Available flags + * + * + * + * Flag + * Description + * + * + * + * + * + * FILE_USE_INCLUDE_PATH + * + * + * Search for filename in the include directory. + * See include_path for more + * information. + * + * + * + * + * FILE_APPEND + * + * + * If file filename already exists, append + * the data to the file instead of overwriting it. + * + * + * + * + * LOCK_EX + * + * + * Acquire an exclusive lock on the file while proceeding to the + * writing. In other words, a flock call happens + * between the fopen call and the + * fwrite call. This is not identical to an + * fopen call with mode "x". + * + * + * + * + * + * @param resource|null $context A valid context resource created with + * stream_context_create. + * @return int This function returns the number of bytes that were written to the file. + * @throws FilesystemException + * + */ +function file_put_contents(string $filename, $data, int $flags = 0, $context = null): int +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \file_put_contents($filename, $data, $flags, $context); + } else { + $safeResult = \file_put_contents($filename, $data, $flags); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Reads an entire file into an array. + * + * @param string $filename Path to the file. + * @param int $flags The optional parameter flags can be one, or + * more, of the following constants: + * + * + * + * FILE_USE_INCLUDE_PATH + * + * + * + * Search for the file in the include_path. + * + * + * + * + * + * FILE_IGNORE_NEW_LINES + * + * + * + * Omit newline at the end of each array element + * + * + * + * + * + * FILE_SKIP_EMPTY_LINES + * + * + * + * Skip empty lines + * + * + * + * + * @param resource $context + * @return array Returns the file in an array. Each element of the array corresponds to a + * line in the file, with the newline still attached. Upon failure, + * file returns FALSE. + * @throws FilesystemException + * + */ +function file(string $filename, int $flags = 0, $context = null): array +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \file($filename, $flags, $context); + } else { + $safeResult = \file($filename, $flags); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * + * + * @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 FilesystemException + * + */ +function fileatime(string $filename): int +{ + error_clear_last(); + $safeResult = \fileatime($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function filectime(string $filename): int +{ + error_clear_last(); + $safeResult = \filectime($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Gets the file inode. + * + * @param string $filename Path to the file. + * @return int Returns the inode number of the file. + * @throws FilesystemException + * + */ +function fileinode(string $filename): int +{ + error_clear_last(); + $safeResult = \fileinode($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function filemtime(string $filename): int +{ + error_clear_last(); + $safeResult = \filemtime($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function fileowner(string $filename): int +{ + error_clear_last(); + $safeResult = \fileowner($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Gets permissions for the given file. + * + * @param string $filename Path to the file. + * @return int Returns the file's permissions as a numeric mode. Lower bits of this mode + * are the same as the permissions expected by chmod, + * however on most platforms the return value will also include information on + * the type of file given as filename. The examples + * below demonstrate how to test the return value for specific permissions and + * file types on POSIX systems, including Linux and macOS. + * + * For local files, the specific return value is that of the + * st_mode member of the structure returned by the C + * library's stat function. Exactly which bits are set + * can vary from platform to platform, and looking up your specific platform's + * documentation is recommended if parsing the non-permission bits of the + * return value is required. + * + * Returns FALSE on failure. + * @throws FilesystemException + * + */ +function fileperms(string $filename): int +{ + error_clear_last(); + $safeResult = \fileperms($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Gets the size for the given file. + * + * @param string $filename Path to the file. + * @return int Returns the size of the file in bytes, or FALSE (and generates an error + * of level E_WARNING) in case of an error. + * @throws FilesystemException + * + */ +function filesize(string $filename): int +{ + error_clear_last(); + $safeResult = \filesize($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * flock allows you to perform a simple reader/writer + * model which can be used on virtually every platform (including most Unix + * derivatives and even Windows). + * + * The lock is released also by fclose, + * or when stream is garbage collected. + * + * PHP supports a portable way of locking complete files in an advisory way + * (which means all accessing programs have to use the same way of locking + * or it will not work). By default, this function will block until the + * requested lock is acquired; this may be controlled with the LOCK_NB option documented below. + * + * @param resource $stream A file system pointer resource + * that is typically created using fopen. + * @param int $operation operation is one of the following: + * + * + * + * LOCK_SH to acquire a shared lock (reader). + * + * + * + * + * LOCK_EX to acquire an exclusive lock (writer). + * + * + * + * + * LOCK_UN to release a lock (shared or exclusive). + * + * + * + * + * It is also possible to add LOCK_NB as a bitmask to one + * of the above operations, if flock should not + * block during the locking attempt. + * @param int|null $would_block The optional third argument is set to 1 if the lock would block + * (EWOULDBLOCK errno condition). + * @throws FilesystemException + * + */ +function flock($stream, int $operation, ?int &$would_block = null): void +{ + error_clear_last(); + $safeResult = \flock($stream, $operation, $would_block); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * 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 + * 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; otherwise it has the + * same behavior as 'w'. + * + * + * + * '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 (Mac OS Classic) used + * \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 is 'b'. + * You can 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 old versions of notepad. You + * should use the 'b' in all other cases. + * + * If you specify the 't' 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 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|null $context A context stream + * resource. + * @return resource Returns a file pointer resource on success + * @throws FilesystemException + * + */ +function fopen(string $filename, string $mode, bool $use_include_path = false, $context = null) +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \fopen($filename, $mode, $use_include_path, $context); + } else { + $safeResult = \fopen($filename, $mode, $use_include_path); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * fread reads up to + * length bytes from the file pointer + * referenced by stream. 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 $stream 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 FilesystemException + * + */ +function fread($stream, int $length): string +{ + error_clear_last(); + $safeResult = \fread($stream, $length); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Gathers the statistics of the file opened by the file + * pointer stream. This function is similar to the + * stat function except that it operates + * on an open file pointer instead of a filename. + * + * @param resource $stream A file system pointer resource + * that is typically created using fopen. + * @return array Returns an array with the statistics of the file; the format of the array + * is described in detail on the stat manual page. + * Returns FALSE on failure. + * @throws FilesystemException + * + */ +function fstat($stream): array +{ + error_clear_last(); + $safeResult = \fstat($stream); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * This function synchronizes changes to the file, including its meta-data. This is similar to fflush, + * but it also instructs the operating system to write to the storage media. + * + * @param resource $stream 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 FilesystemException + * + */ +function fsync($stream): void +{ + error_clear_last(); + $safeResult = \fsync($stream); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * Takes the filepointer, stream, and truncates the file to + * length, size. + * + * @param resource $stream The file pointer. + * + * The stream 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 FilesystemException + * + */ +function ftruncate($stream, int $size): void +{ + error_clear_last(); + $safeResult = \ftruncate($stream, $size); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * + * + * @param resource $stream A file system pointer resource + * that is typically created using fopen. + * @param string $data The string that is to be written. + * @param int $length If length is an integer, writing will stop + * after length bytes have been written or the + * end of data is reached, whichever comes first. + * @return int + * @throws FilesystemException + * + */ +function fwrite($stream, string $data, ?int $length = null): int +{ + error_clear_last(); + if ($length !== null) { + $safeResult = \fwrite($stream, $data, $length); + } else { + $safeResult = \fwrite($stream, $data); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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. + * + * Special characters: + * + * + * + * * - Matches zero or more characters. + * + * + * + * + * ? - Matches exactly one character (any character). + * + * + * + * + * [...] - Matches one character from a group of + * characters. If the first character is !, + * matches any character not in the group. + * + * + * + * + * \ - Escapes the following character, + * except when the GLOB_NOESCAPE flag is used. + * + * + * + * @param int $flags Valid flags: + * + * + * + * GLOB_MARK - Adds a slash (a backslash on Windows) to each directory returned + * + * + * + * + * GLOB_NOSORT - Return files as they appear in the + * directory (no sorting). When this flag is not used, the pathnames are + * sorted alphabetically + * + * + * + * + * GLOB_NOCHECK - Return the search pattern if no + * files matching it were found + * + * + * + * + * GLOB_NOESCAPE - Backslashes do not quote + * metacharacters + * + * + * + * + * GLOB_BRACE - Expands {a,b,c} to match 'a', 'b', + * or 'c' + * + * + * + * + * GLOB_ONLYDIR - Return only directory entries + * which match the pattern + * + * + * + * + * GLOB_ERR - Stop on read errors (like unreadable + * directories), by default errors are ignored. + * + * + * + * + * + * The GLOB_BRACE flag is not available on some non GNU + * systems, like Solaris or Alpine Linux. + * + * + * @return array Returns an array containing the matched files/directories, an empty array + * if no file matched. + * @throws FilesystemException + * + */ +function glob(string $pattern, int $flags = 0): array +{ + error_clear_last(); + $safeResult = \glob($pattern, $flags); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function lchgrp(string $filename, $group): void +{ + error_clear_last(); + $safeResult = \lchgrp($filename, $group); + if ($safeResult === false) { + throw 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 FilesystemException + * + */ +function lchown(string $filename, $user): void +{ + error_clear_last(); + $safeResult = \lchown($filename, $user); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * link creates a hard link. + * + * @param string $target Target of the link. + * @param string $link The link name. + * @throws FilesystemException + * + */ +function link(string $target, string $link): void +{ + error_clear_last(); + $safeResult = \link($target, $link); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * Gathers the statistics of the file or symbolic link named by + * filename. + * + * @param string $filename Path to a file or a symbolic link. + * @return array See the manual page for stat for information on + * the structure of the array that lstat returns. + * This function is identical to the stat function + * except that if the filename parameter is a symbolic + * link, the status of the symbolic link is returned, not the status of the + * file pointed to by the symbolic link. + * + * On failure, FALSE is returned. + * @throws FilesystemException + * + */ +function lstat(string $filename): array +{ + error_clear_last(); + $safeResult = \lstat($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Attempts to create the directory specified by directory. + * + * @param string $directory The directory path. + * A URL can be used as a + * filename with this function if the fopen wrappers have been enabled. + * See fopen for more details on how to specify the + * filename. See the for links to information + * about what abilities the various wrappers have, notes on their usage, + * and information on any predefined variables they may + * provide. + * @param int $permissions The permissions are 0777 by default, which means the widest possible + * access. For more information on permissions, read the details + * on the chmod page. + * + * permissions is ignored on Windows. + * + * Note that you probably want to specify the permissions as an octal number, + * which means it should have a leading zero. The permissions is also modified + * by the current umask, which you can change using + * umask. + * @param bool $recursive If TRUE, then any parent directories to the directory specified will + * also be created, with the same permissions. + * @param resource $context A context stream + * resource. + * @throws FilesystemException + * + */ +function mkdir(string $directory, int $permissions = 0777, bool $recursive = false, $context = null): void +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \mkdir($directory, $permissions, $recursive, $context); + } else { + $safeResult = \mkdir($directory, $permissions, $recursive); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * parse_ini_file loads in the + * ini file specified in filename, + * and returns the settings in it in an associative array. + * + * The structure of the ini file is the same as the php.ini's. + * + * @param string $filename The filename of the ini file being parsed. If a relative path is used, + * it is evaluated relative to the current working directory, then the + * include_path. + * @param bool $process_sections By setting the process_sections + * parameter to TRUE, you get a multidimensional array, with + * the section names and settings included. The default + * for process_sections is FALSE + * @param int $scanner_mode Can either be INI_SCANNER_NORMAL (default) or + * INI_SCANNER_RAW. If INI_SCANNER_RAW + * is supplied, then option values will not be parsed. + * + * + * As of PHP 5.6.1 can also be specified as INI_SCANNER_TYPED. + * In this mode boolean, null and integer types are preserved when possible. + * String values "true", "on" and "yes" + * are converted to TRUE. "false", "off", "no" + * and "none" are considered FALSE. "null" is converted to NULL + * in typed mode. Also, all numeric strings are converted to integer type if it is possible. + * @return array The settings are returned as an associative array on success. + * @throws FilesystemException + * + */ +function parse_ini_file(string $filename, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array +{ + error_clear_last(); + $safeResult = \parse_ini_file($filename, $process_sections, $scanner_mode); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * parse_ini_string returns the settings in string + * ini_string in an associative array. + * + * The structure of the ini string is the same as the php.ini's. + * + * @param string $ini_string The contents of the ini file being parsed. + * @param bool $process_sections By setting the process_sections + * parameter to TRUE, you get a multidimensional array, with + * the section names and settings included. The default + * for process_sections is FALSE + * @param int $scanner_mode Can either be INI_SCANNER_NORMAL (default) or + * INI_SCANNER_RAW. If INI_SCANNER_RAW + * is supplied, then option values will not be parsed. + * + * + * As of PHP 5.6.1 can also be specified as INI_SCANNER_TYPED. + * In this mode boolean, null and integer types are preserved when possible. + * String values "true", "on" and "yes" + * are converted to TRUE. "false", "off", "no" + * and "none" are considered FALSE. "null" is converted to NULL + * in typed mode. Also, all numeric strings are converted to integer type if it is possible. + * @return array The settings are returned as an associative array on success. + * @throws FilesystemException + * + */ +function parse_ini_string(string $ini_string, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array +{ + error_clear_last(); + $safeResult = \parse_ini_string($ini_string, $process_sections, $scanner_mode); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Reads a file and writes it to the output buffer. + * + * @param string $filename The filename being read. + * @param bool $use_include_path You can use the optional second parameter and set it to TRUE, if + * you want to search for the file in the include_path, too. + * @param resource $context A context stream + * resource. + * @return int Returns the number of bytes read from the file on success + * @throws FilesystemException + * + */ +function readfile(string $filename, bool $use_include_path = false, $context = null): int +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \readfile($filename, $use_include_path, $context); + } else { + $safeResult = \readfile($filename, $use_include_path); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function readlink(string $path): string +{ + error_clear_last(); + $safeResult = \readlink($path); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * realpath expands all symbolic links and + * resolves references to /./, /../ and extra / characters in + * the input path and returns the canonicalized + * absolute pathname. + * + * @param string $path The path being checked. + * + * + * Whilst a path must be supplied, the value can be an empty string. + * In this case, the value is interpreted as the current directory. + * + * + * + * Whilst a path must be supplied, the value can be an empty string. + * In this case, the value is interpreted as the current directory. + * @return string Returns the canonicalized absolute pathname on success. The resulting path + * will have no symbolic link, /./ or /../ components. Trailing delimiters, + * such as \ and /, are also removed. + * + * realpath returns FALSE on failure, e.g. if + * the file does not exist. + * @throws FilesystemException + * + */ +function realpath(string $path): string +{ + error_clear_last(); + $safeResult = \realpath($path); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Attempts to rename from to + * to, moving it between directories if necessary. + * If renaming a file and to exists, + * it will be overwritten. If renaming a directory and + * to exists, + * this function will emit a warning. + * + * @param string $from The old name. + * + * The wrapper used in from + * must match the wrapper used in + * to. + * @param string $to The new name. + * + * + * On Windows, if to already exists, it must be writable. + * Otherwise rename fails and issues E_WARNING. + * + * + * @param resource $context A context stream + * resource. + * @throws FilesystemException + * + */ +function rename(string $from, string $to, $context = null): void +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \rename($from, $to, $context); + } else { + $safeResult = \rename($from, $to); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * Sets the file position indicator for stream + * to the beginning of the file stream. + * + * @param resource $stream The file pointer must be valid, and must point to a file + * successfully opened by fopen. + * @throws FilesystemException + * + */ +function rewind($stream): void +{ + error_clear_last(); + $safeResult = \rewind($stream); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * Attempts to remove the directory named by directory. + * The directory must be empty, and the relevant permissions must permit this. + * A E_WARNING level error will be generated on failure. + * + * @param string $directory Path to the directory. + * @param resource $context A context stream + * resource. + * @throws FilesystemException + * + */ +function rmdir(string $directory, $context = null): void +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \rmdir($directory, $context); + } else { + $safeResult = \rmdir($directory); + } + if ($safeResult === false) { + throw 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 FilesystemException + * + */ +function symlink(string $target, string $link): void +{ + error_clear_last(); + $safeResult = \symlink($target, $link); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * Creates a file with a unique filename, with access permission set to 0600, in the specified directory. + * If the directory does not exist or is not writable, tempnam may + * generate a file in the system's temporary directory, and return + * the full path to that file, including its name. + * + * @param string $directory The directory where the temporary filename will be created. + * @param string $prefix The prefix of the generated temporary filename. + * @return string Returns the new temporary filename (with path). + * @throws FilesystemException + * + */ +function tempnam(string $directory, string $prefix): string +{ + error_clear_last(); + $safeResult = \tempnam($directory, $prefix); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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. + * + * @return resource|false Returns a file handle, similar to the one returned by + * fopen, for the new file. + * @throws FilesystemException + * + */ +function tmpfile() +{ + error_clear_last(); + $safeResult = \tmpfile(); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Attempts to set the access and modification times of the file named in the + * filename parameter to the value given in + * mtime. + * 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 $mtime The touch time. If mtime is NULL, + * the current system time is used. + * @param int $atime If not NULL, the access time of the given filename is set to + * the value of atime. Otherwise, it is set to + * the value passed to the mtime parameter. + * If both are NULL, the current system time is used. + * @throws FilesystemException + * + */ +function touch(string $filename, ?int $mtime = null, ?int $atime = null): void +{ + error_clear_last(); + if ($atime !== null) { + $safeResult = \touch($filename, $mtime, $atime); + } elseif ($mtime !== null) { + $safeResult = \touch($filename, $mtime); + } else { + $safeResult = \touch($filename); + } + if ($safeResult === false) { + throw 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. + * + * If the file is a symlink, the symlink will be deleted. On Windows, to delete + * a symlink to a directory, rmdir has to be used instead. + * @param resource $context A context stream + * resource. + * @throws FilesystemException + * + */ +function unlink(string $filename, $context = null): void +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \unlink($filename, $context); + } else { + $safeResult = \unlink($filename); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} diff --git a/generated/8.3/filter.php b/generated/8.3/filter.php new file mode 100644 index 00000000..0508f8e7 --- /dev/null +++ b/generated/8.3/filter.php @@ -0,0 +1,81 @@ + + * + * + * + * channels will be 3 for RGB pictures and 4 for CMYK + * pictures. + * + * bits is the number of bits for each color. + * + * For some image types, the presence of channels and + * bits values can be a bit + * confusing. As an example, GIF always uses 3 channels + * per pixel, but the number of bits per pixel cannot be calculated for an + * animated GIF with a global color table. + * + * On failure, FALSE is returned. + * @throws ImageException + * + */ +function getimagesize(string $filename, ?array &$image_info = null): ?array +{ + error_clear_last(); + $safeResult = \getimagesize($filename, $image_info); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Returns the extension for the given IMAGETYPE_XXX + * constant. + * + * @param int $image_type One of the IMAGETYPE_XXX constant. + * @param bool $include_dot Whether to prepend a dot to the extension or not. Default to TRUE. + * @return string A string with the extension corresponding to the given image type. + * @throws ImageException + * + */ +function image_type_to_extension(int $image_type, bool $include_dot = true): string +{ + error_clear_last(); + $safeResult = \image_type_to_extension($image_type, $include_dot); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * image2wbmp 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 string|null $filename Path to the saved file. If not given, the raw image stream will be + * output 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 ImageException + * + */ +function image2wbmp($image, ?string $filename = null, ?int $foreground = null): void +{ + error_clear_last(); + if ($foreground !== null) { + $safeResult = \image2wbmp($image, $filename, $foreground); + } elseif ($filename !== null) { + $safeResult = \image2wbmp($image, $filename); + } else { + $safeResult = \image2wbmp($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param array $affine Array with keys 0 to 5. + * @param array $clip Array with keys "x", "y", "width" and "height"; or NULL. + * @return resource Return affined image object on success. + * @throws ImageException + * + */ +function imageaffine($image, array $affine, ?array $clip = null) +{ + error_clear_last(); + if ($clip !== null) { + $safeResult = \imageaffine($image, $affine, $clip); + } else { + $safeResult = \imageaffine($image, $affine); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Returns the concatenation of two affine transformation matrices, + * what is useful if multiple transformations should be applied to the same + * image in one go. + * + * @param array $matrix1 An affine transformation matrix (an array with keys + * 0 to 5 and float values). + * @param array $matrix2 An affine transformation matrix (an array with keys + * 0 to 5 and float values). + * @return array{0:float,1:float,2:float,3:float,4:float,5:float} An affine transformation matrix (an array with keys + * 0 to 5 and float values). + * @throws ImageException + * + */ +function imageaffinematrixconcat(array $matrix1, array $matrix2): array +{ + error_clear_last(); + $safeResult = \imageaffinematrixconcat($matrix1, $matrix2); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Returns an affine transformation matrix. + * + * @param int $type One of the IMG_AFFINE_* constants. + * @param array|float $options If type is IMG_AFFINE_TRANSLATE + * or IMG_AFFINE_SCALE, + * options has to be an array with keys x + * and y, both having float values. + * + * If type is IMG_AFFINE_ROTATE, + * IMG_AFFINE_SHEAR_HORIZONTAL or IMG_AFFINE_SHEAR_VERTICAL, + * options has to be a float specifying the angle. + * @return array{0:float,1:float,2:float,3:float,4:float,5:float} An affine transformation matrix (an array with keys + * 0 to 5 and float values). + * @throws ImageException + * + */ +function imageaffinematrixget(int $type, $options): array +{ + error_clear_last(); + $safeResult = \imageaffinematrixget($type, $options); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagealphablending allows for two different + * modes of drawing on truecolor images. In blending mode, the + * alpha channel component of the color supplied to all drawing function, + * such as imagesetpixel determines how much of the + * underlying color should be allowed to shine through. As a result, gd + * automatically blends the existing color at that point with the drawing color, + * and stores the result in the image. The resulting pixel is opaque. In + * non-blending mode, the drawing color is copied literally with its alpha channel + * information, replacing the destination pixel. Blending mode is not available + * when drawing on palette images. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param bool $enable Whether to enable the blending mode or not. On true color images + * the default value is TRUE otherwise the default value is FALSE + * @throws ImageException + * + */ +function imagealphablending($image, bool $enable): void +{ + error_clear_last(); + $safeResult = \imagealphablending($image, $enable); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Activate the fast drawing antialiased methods for lines and wired polygons. + * It does not support alpha components. It works using a direct blend + * operation. It works only with truecolor images. + * + * Thickness and styled are not supported. + * + * Using antialiased primitives with transparent background color can end with + * some unexpected results. The blend method uses the background color as any + * other colors. The lack of alpha component support does not allow an alpha + * based antialiasing method. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param bool $enable Whether to enable antialiasing or not. + * @throws ImageException + * + */ +function imageantialias($image, bool $enable): void +{ + error_clear_last(); + $safeResult = \imageantialias($image, $enable); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagearc draws an arc of circle centered at the given + * coordinates. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $center_x x-coordinate of the center. + * @param int $center_y y-coordinate of the center. + * @param int $width The arc width. + * @param int $height The arc height. + * @param int $start_angle The arc start angle, in degrees. + * @param int $end_angle The arc end angle, in degrees. + * 0° is located at the three-o'clock position, and the arc is drawn + * clockwise. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagearc($image, int $center_x, int $center_y, int $width, int $height, int $start_angle, int $end_angle, int $color): void +{ + error_clear_last(); + $safeResult = \imagearc($image, $center_x, $center_y, $width, $height, $start_angle, $end_angle, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Outputs or saves a AVIF Raster image from the given image. + * + * @param \GdImage $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @param int $quality quality is optional, and ranges from 0 (worst quality, smaller file) + * to 100 (best quality, larger file). + * If -1 is provided, the default value 30 is used. + * @param int $speed speed is optional, and ranges from 0 (slow, smaller file) + * to 10 (fast, larger file). + * If -1 is provided, the default value 6 is used. + * @throws ImageException + * + */ +function imageavif(\GdImage $image, $file = null, int $quality = -1, int $speed = -1): void +{ + error_clear_last(); + if ($speed !== -1) { + $safeResult = \imageavif($image, $file, $quality, $speed); + } elseif ($quality !== -1) { + $safeResult = \imageavif($image, $file, $quality); + } elseif ($file !== null) { + $safeResult = \imageavif($image, $file); + } else { + $safeResult = \imageavif($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Outputs or saves a BMP version of the given image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * + * NULL is invalid if the compressed arguments is + * not used. + * @param bool $compressed Whether the BMP should be compressed with run-length encoding (RLE), or not. + * @throws ImageException + * + */ +function imagebmp($image, $file = null, bool $compressed = true): void +{ + error_clear_last(); + if ($compressed !== true) { + $safeResult = \imagebmp($image, $file, $compressed); + } elseif ($file !== null) { + $safeResult = \imagebmp($image, $file); + } else { + $safeResult = \imagebmp($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagechar draws the first character of + * char in the image identified by + * image with its upper-left at + * x,y (top left is 0, + * 0) with the color color. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $font Can be 1, 2, 3, 4, 5 for built-in + * fonts in latin2 encoding (where higher numbers corresponding to larger fonts) or GdFont instance, + * returned by imageloadfont. + * @param int $x x-coordinate of the start. + * @param int $y y-coordinate of the start. + * @param string $char The character to draw. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagechar($image, int $font, int $x, int $y, string $char, int $color): void +{ + error_clear_last(); + $safeResult = \imagechar($image, $font, $x, $y, $char, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws the character char vertically at the specified + * coordinate on the given image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $font Can be 1, 2, 3, 4, 5 for built-in + * fonts in latin2 encoding (where higher numbers corresponding to larger fonts) or GdFont instance, + * returned by imageloadfont. + * @param int $x x-coordinate of the start. + * @param int $y y-coordinate of the start. + * @param string $char The character to draw. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagecharup($image, int $font, int $x, int $y, string $char, int $color): void +{ + error_clear_last(); + $safeResult = \imagecharup($image, $font, $x, $y, $char, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Returns the index of the color of the pixel at the + * specified location in the image specified by image. + * + * If the image is a + * truecolor image, this function returns the RGB value of that pixel as + * integer. Use bitshifting and masking to access the distinct red, green and blue + * component values: + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x x-coordinate of the point. + * @param int $y y-coordinate of the point. + * @return int Returns the index of the color. + * @throws ImageException + * + */ +function imagecolorat($image, int $x, int $y): int +{ + error_clear_last(); + $safeResult = \imagecolorat($image, $x, $y); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * De-allocates a color previously allocated with + * imagecolorallocate or + * imagecolorallocatealpha. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $color The color identifier. + * @throws ImageException + * + */ +function imagecolordeallocate($image, int $color): void +{ + error_clear_last(); + $safeResult = \imagecolordeallocate($image, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Makes the colors of the palette version of an image more closely match the true color version. + * + * @param resource $image1 A truecolor image object. + * @param resource $image2 A palette image object pointing to an image that has the same + * size as image1. + * @throws ImageException + * + */ +function imagecolormatch($image1, $image2): void +{ + error_clear_last(); + $safeResult = \imagecolormatch($image1, $image2); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * This sets the specified index in the palette to the specified + * color. This is useful for creating flood-fill-like effects in + * palleted images without the overhead of performing the actual + * flood-fill. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $color An index in the palette. + * @param int $red Value of red component. + * @param int $green Value of green component. + * @param int $blue Value of blue component. + * @param int $alpha Value of alpha component. + * @throws ImageException + * + */ +function imagecolorset($image, int $color, int $red, int $green, int $blue, int $alpha = 0): void +{ + error_clear_last(); + $safeResult = \imagecolorset($image, $color, $red, $green, $blue, $alpha); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Applies a convolution matrix on the image, using the given coefficient and + * offset. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param array $matrix A 3x3 matrix: an array of three arrays of three floats. + * @param float $divisor The divisor of the result of the convolution, used for normalization. + * @param float $offset Color offset. + * @throws ImageException + * + */ +function imageconvolution($image, array $matrix, float $divisor, float $offset): void +{ + error_clear_last(); + $safeResult = \imageconvolution($image, $matrix, $divisor, $offset); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Copy a part of src_image onto + * dst_image starting at the x,y coordinates + * src_x, src_y with + * a width of src_width and a height of + * src_height. The portion defined will be copied + * onto the x,y coordinates, dst_x and + * dst_y. + * + * @param resource $dst_image Destination image resource. + * @param resource $src_image Source image resource. + * @param int $dst_x x-coordinate of destination point. + * @param int $dst_y y-coordinate of destination point. + * @param int $src_x x-coordinate of source point. + * @param int $src_y y-coordinate of source point. + * @param int $src_width Source width. + * @param int $src_height Source height. + * @throws ImageException + * + */ +function imagecopy($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height): void +{ + error_clear_last(); + $safeResult = \imagecopy($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $src_width, $src_height); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Copy a part of src_image onto + * dst_image starting at the x,y coordinates + * src_x, src_y with + * a width of src_width and a height of + * src_height. The portion defined will be copied + * onto the x,y coordinates, dst_x and + * dst_y. + * + * @param resource $dst_image Destination image resource. + * @param resource $src_image Source image resource. + * @param int $dst_x x-coordinate of destination point. + * @param int $dst_y y-coordinate of destination point. + * @param int $src_x x-coordinate of source point. + * @param int $src_y y-coordinate of source point. + * @param int $src_width Source width. + * @param int $src_height Source height. + * @param int $pct The two images will be merged according to pct + * which can range from 0 to 100. When pct = 0, + * no action is taken, when 100 this function behaves identically + * to imagecopy for pallete images, except for + * ignoring alpha components, while it implements alpha transparency + * for true colour images. + * @throws ImageException + * + */ +function imagecopymerge($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height, int $pct): void +{ + error_clear_last(); + $safeResult = \imagecopymerge($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $src_width, $src_height, $pct); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagecopymergegray copy a part of src_image onto + * dst_image starting at the x,y coordinates + * src_x, src_y with + * a width of src_width and a height of + * src_height. The portion defined will be copied + * onto the x,y coordinates, dst_x and + * dst_y. + * + * This function is identical to imagecopymerge except + * that when merging it preserves the hue of the source by converting + * the destination pixels to gray scale before the copy operation. + * + * @param resource $dst_image Destination image resource. + * @param resource $src_image Source image resource. + * @param int $dst_x x-coordinate of destination point. + * @param int $dst_y y-coordinate of destination point. + * @param int $src_x x-coordinate of source point. + * @param int $src_y y-coordinate of source point. + * @param int $src_width Source width. + * @param int $src_height Source height. + * @param int $pct The src_image will be changed to grayscale according + * to pct where 0 is fully grayscale and 100 is + * unchanged. When pct = 100 this function behaves + * identically to imagecopy for pallete images, except for + * ignoring alpha components, while + * it implements alpha transparency for true colour images. + * @throws ImageException + * + */ +function imagecopymergegray($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height, int $pct): void +{ + error_clear_last(); + $safeResult = \imagecopymergegray($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $src_width, $src_height, $pct); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagecopyresampled copies a rectangular + * portion of one image to another image, smoothly interpolating pixel + * values so that, in particular, reducing the size of an image still + * retains a great deal of clarity. + * + * In other words, imagecopyresampled will take a + * rectangular area from src_image of width + * src_width and height src_height at + * position (src_x,src_y) + * and place it in a rectangular area of dst_image + * of width dst_width and height dst_height + * at position (dst_x,dst_y). + * + * If the source and destination coordinates and width and heights + * differ, appropriate stretching or shrinking of the image fragment + * will be performed. The coordinates refer to the upper left + * corner. This function can be used to copy regions within the + * same image (if dst_image is the same as + * src_image) but if the regions overlap the + * results will be unpredictable. + * + * @param resource $dst_image Destination image resource. + * @param resource $src_image Source image resource. + * @param int $dst_x x-coordinate of destination point. + * @param int $dst_y y-coordinate of destination point. + * @param int $src_x x-coordinate of source point. + * @param int $src_y y-coordinate of source point. + * @param int $dst_width Destination width. + * @param int $dst_height Destination height. + * @param int $src_width Source width. + * @param int $src_height Source height. + * @throws ImageException + * + */ +function imagecopyresampled($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_width, int $dst_height, int $src_width, int $src_height): void +{ + error_clear_last(); + $safeResult = \imagecopyresampled($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_width, $dst_height, $src_width, $src_height); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagecopyresized copies a rectangular + * portion of one image to another image. + * dst_image is the destination image, + * src_image is the source image identifier. + * + * In other words, imagecopyresized will take a + * rectangular area from src_image of width + * src_width and height src_height at + * position (src_x,src_y) + * and place it in a rectangular area of dst_image + * of width dst_width and height dst_height + * at position (dst_x,dst_y). + * + * If the source and destination coordinates and width and heights + * differ, appropriate stretching or shrinking of the image fragment + * will be performed. The coordinates refer to the upper left + * corner. This function can be used to copy regions within the + * same image (if dst_image is the same as + * src_image) but if the regions overlap the + * results will be unpredictable. + * + * @param resource $dst_image Destination image resource. + * @param resource $src_image Source image resource. + * @param int $dst_x x-coordinate of destination point. + * @param int $dst_y y-coordinate of destination point. + * @param int $src_x x-coordinate of source point. + * @param int $src_y y-coordinate of source point. + * @param int $dst_width Destination width. + * @param int $dst_height Destination height. + * @param int $src_width Source width. + * @param int $src_height Source height. + * @throws ImageException + * + */ +function imagecopyresized($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_width, int $dst_height, int $src_width, int $src_height): void +{ + error_clear_last(); + $safeResult = \imagecopyresized($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_width, $dst_height, $src_width, $src_height); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagecreate returns an image identifier + * representing a blank image of specified size. + * + * In general, we recommend the use of + * imagecreatetruecolor instead of + * imagecreate so that image processing occurs on the + * highest quality image possible. If you want to output a palette image, then + * imagetruecolortopalette should be called immediately + * before saving the image with imagepng or + * imagegif. + * + * @param int $width The image width. + * @param int $height The image height. + * @return resource|false Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreate(int $width, int $height) +{ + error_clear_last(); + $safeResult = \imagecreate($width, $height); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromavif returns an image object + * representing the image obtained from the given filename. + * + * @param string $filename Path to the AVIF raster image. + * @return Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromavif(string $filename): void +{ + error_clear_last(); + $safeResult = \imagecreatefromavif($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagecreatefrombmp returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the BMP image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefrombmp(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefrombmp($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Create a new image from GD file or URL. + * + * @param string $filename Path to the GD file. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromgd(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromgd($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Create a new image from GD2 file or URL. + * + * @param string $filename Path to the GD2 image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromgd2(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromgd2($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Create a new image from a given part of GD2 file or URL. + * + * @param string $filename Path to the GD2 image. + * @param int $x x-coordinate of source point. + * @param int $y y-coordinate of source point. + * @param int $width Source width. + * @param int $height Source height. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromgd2part(string $filename, int $x, int $y, int $width, int $height) +{ + error_clear_last(); + $safeResult = \imagecreatefromgd2part($filename, $x, $y, $width, $height); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromgif returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the GIF image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromgif(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromgif($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromjpeg returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the JPEG image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromjpeg(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromjpeg($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefrompng returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the PNG image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefrompng(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefrompng($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromstring returns an image identifier + * representing the image obtained from the given data. + * These types will be automatically detected if your build of PHP supports + * them: JPEG, PNG, GIF, BMP, WBMP, GD2, and WEBP. + * + * @param string $data A string containing the image data. + * @return resource An image object will be returned on success. FALSE is returned if + * the image type is unsupported, the data is not in a recognised format, + * or the image is corrupt and cannot be loaded. + * @throws ImageException + * + */ +function imagecreatefromstring(string $data) +{ + error_clear_last(); + $safeResult = \imagecreatefromstring($data); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromtga returns an image object + * representing the image obtained from the given filename. + * + * @param string $filename Path to the Truevision TGA image. + * @return Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromtga(string $filename): void +{ + error_clear_last(); + $safeResult = \imagecreatefromtga($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagecreatefromwbmp returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the WBMP image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromwbmp(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromwbmp($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromwebp returns an image identifier + * representing the image obtained from the given filename. + * Note that animated WebP files cannot be read. + * + * @param string $filename Path to the WebP image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromwebp(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromwebp($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromxbm returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the XBM image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromxbm(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromxbm($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromxpm returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the XPM image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromxpm(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromxpm($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatetruecolor returns an image object + * representing a black image of the specified size. + * + * @param int $width Image width. + * @param int $height Image height. + * @return resource|false Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatetruecolor(int $width, int $height) +{ + error_clear_last(); + $safeResult = \imagecreatetruecolor($width, $height); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Crops an image to the given rectangular area and returns the resulting image. + * The given image is not modified. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param array $rectangle The cropping rectangle as array with keys + * x, y, width and + * height. + * @return resource Return cropped image object on success. + * @throws ImageException + * + */ +function imagecrop($image, array $rectangle) +{ + error_clear_last(); + $safeResult = \imagecrop($image, $rectangle); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Automatically crops an image according to the given + * mode. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $mode One of the following constants: + * @param float $threshold + * @param int $color + * @return resource Returns a cropped image object on success. + * If the complete image was cropped, imagecrop returns FALSE. + * @throws ImageException + * + */ +function imagecropauto($image, int $mode = IMG_CROP_DEFAULT, float $threshold = 0.5, int $color = -1) +{ + error_clear_last(); + $safeResult = \imagecropauto($image, $mode, $threshold, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * This function is deprecated. Use combination of + * imagesetstyle and imageline + * instead. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x1 Upper left x coordinate. + * @param int $y1 Upper left y coordinate 0, 0 is the top left corner of the image. + * @param int $x2 Bottom right x coordinate. + * @param int $y2 Bottom right y coordinate. + * @param int $color The fill color. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagedashedline($image, int $x1, int $y1, int $x2, int $y2, int $color): void +{ + error_clear_last(); + $safeResult = \imagedashedline($image, $x1, $y1, $x2, $y2, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Prior to PHP 8.0.0, imagedestroy freed any memory associated + * with image image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @throws ImageException + * + */ +function imagedestroy($image): void +{ + error_clear_last(); + $safeResult = \imagedestroy($image); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws an ellipse centered at the specified coordinates. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $center_x x-coordinate of the center. + * @param int $center_y y-coordinate of the center. + * @param int $width The ellipse width. + * @param int $height The ellipse height. + * @param int $color The color of the ellipse. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imageellipse($image, int $center_x, int $center_y, int $width, int $height, int $color): void +{ + error_clear_last(); + $safeResult = \imageellipse($image, $center_x, $center_y, $width, $height, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Performs a flood fill starting at the given coordinate (top left is 0, 0) + * with the given color in the + * image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x x-coordinate of start point. + * @param int $y y-coordinate of start point. + * @param int $color The fill color. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagefill($image, int $x, int $y, int $color): void +{ + error_clear_last(); + $safeResult = \imagefill($image, $x, $y, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws a partial arc centered at the specified coordinate in the + * given image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $center_x x-coordinate of the center. + * @param int $center_y y-coordinate of the center. + * @param int $width The arc width. + * @param int $height The arc height. + * @param int $start_angle The arc start angle, in degrees. + * @param int $end_angle The arc end angle, in degrees. + * 0° is located at the three-o'clock position, and the arc is drawn + * clockwise. + * @param int $color A color identifier created with imagecolorallocate. + * @param int $style A bitwise OR of the following possibilities: + * + * IMG_ARC_PIE + * IMG_ARC_CHORD + * IMG_ARC_NOFILL + * IMG_ARC_EDGED + * + * IMG_ARC_PIE and IMG_ARC_CHORD are + * mutually exclusive; IMG_ARC_CHORD just + * connects the starting and ending angles with a straight line, while + * IMG_ARC_PIE produces a rounded edge. + * IMG_ARC_NOFILL indicates that the arc + * or chord should be outlined, not filled. IMG_ARC_EDGED, + * used together with IMG_ARC_NOFILL, indicates that the + * beginning and ending angles should be connected to the center - this is a + * good way to outline (rather than fill) a 'pie slice'. + * @throws ImageException + * + */ +function imagefilledarc($image, int $center_x, int $center_y, int $width, int $height, int $start_angle, int $end_angle, int $color, int $style): void +{ + error_clear_last(); + $safeResult = \imagefilledarc($image, $center_x, $center_y, $width, $height, $start_angle, $end_angle, $color, $style); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws an ellipse centered at the specified coordinate on the given + * image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $center_x x-coordinate of the center. + * @param int $center_y y-coordinate of the center. + * @param int $width The ellipse width. + * @param int $height The ellipse height. + * @param int $color The fill color. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagefilledellipse($image, int $center_x, int $center_y, int $width, int $height, int $color): void +{ + error_clear_last(); + $safeResult = \imagefilledellipse($image, $center_x, $center_y, $width, $height, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Creates a rectangle filled with color in the given + * image starting at point 1 and ending at point 2. + * 0, 0 is the top left corner of the image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x1 x-coordinate for point 1. + * @param int $y1 y-coordinate for point 1. + * @param int $x2 x-coordinate for point 2. + * @param int $y2 y-coordinate for point 2. + * @param int $color The fill color. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagefilledrectangle($image, int $x1, int $y1, int $x2, int $y2, int $color): void +{ + error_clear_last(); + $safeResult = \imagefilledrectangle($image, $x1, $y1, $x2, $y2, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagefilltoborder performs a flood fill + * whose border color is defined by border_color. + * The starting point for the fill is x, + * y (top left is 0, 0) and the region is + * filled with color color. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x x-coordinate of start. + * @param int $y y-coordinate of start. + * @param int $border_color The border color. A color identifier created with imagecolorallocate. + * @param int $color The fill color. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagefilltoborder($image, int $x, int $y, int $border_color, int $color): void +{ + error_clear_last(); + $safeResult = \imagefilltoborder($image, $x, $y, $border_color, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagefilter applies the given filter + * filter on the image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $filter filter can be one of the following: + * + * + * + * IMG_FILTER_NEGATE: Reverses all colors of + * the image. + * + * + * + * + * IMG_FILTER_GRAYSCALE: Converts the image into + * grayscale by changing the red, green and blue components to their + * weighted sum using the same coefficients as the REC.601 luma (Y') + * calculation. The alpha components are retained. For palette images the + * result may differ due to palette limitations. + * + * + * + * + * IMG_FILTER_BRIGHTNESS: Changes the brightness + * of the image. Use args to set the level of + * brightness. The range for the brightness is -255 to 255. + * + * + * + * + * IMG_FILTER_CONTRAST: Changes the contrast of + * the image. Use args to set the level of + * contrast. + * + * + * + * + * IMG_FILTER_COLORIZE: Like + * IMG_FILTER_GRAYSCALE, except you can specify the + * color. Use args, arg2 and + * arg3 in the form of + * red, green, + * blue and arg4 for the + * alpha channel. The range for each color is 0 to 255. + * + * + * + * + * IMG_FILTER_EDGEDETECT: Uses edge detection to + * highlight the edges in the image. + * + * + * + * + * IMG_FILTER_EMBOSS: Embosses the image. + * + * + * + * + * IMG_FILTER_GAUSSIAN_BLUR: Blurs the image using + * the Gaussian method. + * + * + * + * + * IMG_FILTER_SELECTIVE_BLUR: Blurs the image. + * + * + * + * + * IMG_FILTER_MEAN_REMOVAL: Uses mean removal to + * achieve a "sketchy" effect. + * + * + * + * + * IMG_FILTER_SMOOTH: Makes the image smoother. + * Use args to set the level of smoothness. + * + * + * + * + * IMG_FILTER_PIXELATE: Applies pixelation effect + * to the image, use args to set the block size + * and arg2 to set the pixelation effect mode. + * + * + * + * + * IMG_FILTER_SCATTER: Applies scatter effect + * to the image, use args and + * arg2 to define the effect strength and + * additionally arg3 to only apply the + * on select pixel colors. + * + * + * + * @param int $args + * + * + * IMG_FILTER_BRIGHTNESS: Brightness level. + * + * + * + * + * IMG_FILTER_CONTRAST: Contrast level. + * + * + * + * + * IMG_FILTER_COLORIZE: Value of red component. + * + * + * + * + * IMG_FILTER_SMOOTH: Smoothness level. + * + * + * + * + * IMG_FILTER_PIXELATE: Block size in pixels. + * + * + * + * + * IMG_FILTER_SCATTER: Effect substraction level. + * This must not be higher or equal to the addition level set with + * arg2. + * + * + * + * @throws ImageException + * + */ +function imagefilter($image, int $filter, int ...$args): void +{ + error_clear_last(); + if ($args !== []) { + $safeResult = \imagefilter($image, $filter, ...$args); + } else { + $safeResult = \imagefilter($image, $filter); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Flips the image image using the given + * mode. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $mode Flip mode, this can be one of the IMG_FLIP_* constants: + * + * + * + * + * + * Constant + * Meaning + * + * + * + * + * IMG_FLIP_HORIZONTAL + * + * Flips the image horizontally. + * + * + * + * IMG_FLIP_VERTICAL + * + * Flips the image vertically. + * + * + * + * IMG_FLIP_BOTH + * + * Flips the image both horizontally and vertically. + * + * + * + * + * + * @throws ImageException + * + */ +function imageflip($image, int $mode): void +{ + error_clear_last(); + $safeResult = \imageflip($image, $mode); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * This function calculates and returns the bounding box in pixels + * for a FreeType text. + * + * @param float $size The font size in points. + * @param float $angle Angle in degrees in which string will be + * measured. + * @param string $font_filename The name of the TrueType font file (can be a URL). Depending on + * which version of the GD library that PHP is using, it may attempt to + * search for files that do not begin with a leading '/' by appending + * '.ttf' to the filename and searching along a library-defined font path. + * @param string $string The string to be measured. + * @param array $options + * Possible array indexes for options + * + * + * + * Key + * Type + * Meaning + * + * + * + * + * linespacing + * float + * Defines drawing linespacing + * + * + * + * + * @return array imageftbbox returns an array with 8 + * elements representing four points making the bounding box of the + * text: + * + * + * + * + * 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. + * + * On failure, FALSE is returned. + * @throws ImageException + * + */ +function imageftbbox(float $size, float $angle, string $font_filename, string $string, array $options = []): array +{ + error_clear_last(); + $safeResult = \imageftbbox($size, $angle, $font_filename, $string, $options); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param float $size The font size to use 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 index of the desired color for the text, see + * imagecolorexact. + * @param string $font_filename The path to the TrueType font you wish to use. + * + * Depending on which version of the GD library PHP is using, when + * font_filename 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. + * + * In many cases where a font resides in the same directory as the script using it + * the following trick will alleviate any include problems. + * + * + * ]]> + * + * @param string $text Text to be inserted into image. + * @param array $options + * Possible array indexes for options + * + * + * + * Key + * Type + * Meaning + * + * + * + * + * linespacing + * float + * Defines drawing linespacing + * + * + * + * + * @return array This function returns an array defining the four points of the box, starting in the lower left and moving counter-clockwise: + * + * + * + * + * 0 + * lower left x-coordinate + * + * + * 1 + * lower left y-coordinate + * + * + * 2 + * lower right x-coordinate + * + * + * 3 + * lower right y-coordinate + * + * + * 4 + * upper right x-coordinate + * + * + * 5 + * upper right y-coordinate + * + * + * 6 + * upper left x-coordinate + * + * + * 7 + * upper left y-coordinate + * + * + * + * + * + * On failure, FALSE is returned. + * @throws ImageException + * + */ +function imagefttext($image, float $size, float $angle, int $x, int $y, int $color, string $font_filename, string $text, array $options = []): array +{ + error_clear_last(); + $safeResult = \imagefttext($image, $size, $angle, $x, $y, $color, $font_filename, $text, $options); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Applies gamma correction to the given gd image + * given an input and an output gamma. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param float $input_gamma The input gamma. + * @param float $output_gamma The output gamma. + * @throws ImageException + * + */ +function imagegammacorrect($image, float $input_gamma, float $output_gamma): void +{ + error_clear_last(); + $safeResult = \imagegammacorrect($image, $input_gamma, $output_gamma); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Outputs a GD image to the given file. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @throws ImageException + * + */ +function imagegd($image, $file = null): void +{ + error_clear_last(); + if ($file !== null) { + $safeResult = \imagegd($image, $file); + } else { + $safeResult = \imagegd($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Outputs a GD2 image to the given file. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @param int $chunk_size Chunk size. + * @param int $mode Either IMG_GD2_RAW or + * IMG_GD2_COMPRESSED. Default is + * IMG_GD2_RAW. + * @throws ImageException + * + */ +function imagegd2($image, $file = null, int $chunk_size = 128, int $mode = IMG_GD2_RAW): void +{ + error_clear_last(); + if ($mode !== IMG_GD2_RAW) { + $safeResult = \imagegd2($image, $file, $chunk_size, $mode); + } elseif ($chunk_size !== 128) { + $safeResult = \imagegd2($image, $file, $chunk_size); + } elseif ($file !== null) { + $safeResult = \imagegd2($image, $file); + } else { + $safeResult = \imagegd2($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagegif creates the GIF + * file in file from the image image. The + * image argument is the return from the + * imagecreate or imagecreatefrom* + * function. + * + * The image format will be GIF87a unless the + * image has been made transparent with + * imagecolortransparent, in which case the + * image format will be GIF89a. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @throws ImageException + * + */ +function imagegif($image, $file = null): void +{ + error_clear_last(); + if ($file !== null) { + $safeResult = \imagegif($image, $file); + } else { + $safeResult = \imagegif($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Grabs a screenshot of the whole screen. + * + * @return resource Returns an image object on success, FALSE on failure. + * @throws ImageException + * + */ +function imagegrabscreen() +{ + error_clear_last(); + $safeResult = \imagegrabscreen(); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Grabs a window or its client area using a windows handle (HWND property in COM instance) + * + * @param int $handle The HWND window ID. + * @param bool $client_area Include the client area of the application window. + * @return \GdImage Returns an image object on success, FALSE on failure. + * @throws ImageException + * + */ +function imagegrabwindow(int $handle, bool $client_area = false): \GdImage +{ + error_clear_last(); + $safeResult = \imagegrabwindow($handle, $client_area); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagejpeg creates a JPEG file from + * the given image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @param int $quality quality is optional, and ranges from 0 (worst + * quality, smaller file) to 100 (best quality, biggest file). The + * default (-1) uses the default IJG quality value (about 75). + * @throws ImageException + * + */ +function imagejpeg($image, $file = null, int $quality = -1): void +{ + error_clear_last(); + if ($quality !== -1) { + $safeResult = \imagejpeg($image, $file, $quality); + } elseif ($file !== null) { + $safeResult = \imagejpeg($image, $file); + } else { + $safeResult = \imagejpeg($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Set the alpha blending flag to use layering effects. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $effect One of the following constants: + * + * + * IMG_EFFECT_REPLACE + * + * + * Use pixel replacement (equivalent of passing TRUE to + * imagealphablending) + * + * + * + * + * IMG_EFFECT_ALPHABLEND + * + * + * Use normal pixel blending (equivalent of passing FALSE to + * imagealphablending) + * + * + * + * + * IMG_EFFECT_NORMAL + * + * + * Same as IMG_EFFECT_ALPHABLEND. + * + * + * + * + * IMG_EFFECT_OVERLAY + * + * + * Overlay has the effect that black background pixels will remain + * black, white background pixels will remain white, but grey + * background pixels will take the colour of the foreground pixel. + * + * + * + * + * IMG_EFFECT_MULTIPLY + * + * + * Overlays with a multiply effect. + * + * + * + * + * @throws ImageException + * + */ +function imagelayereffect($image, int $effect): void +{ + error_clear_last(); + $safeResult = \imagelayereffect($image, $effect); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws a line between the two given points. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x1 x-coordinate for first point. + * @param int $y1 y-coordinate for first point. + * @param int $x2 x-coordinate for second point. + * @param int $y2 y-coordinate for second point. + * @param int $color The line color. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imageline($image, int $x1, int $y1, int $x2, int $y2, int $color): void +{ + error_clear_last(); + $safeResult = \imageline($image, $x1, $y1, $x2, $y2, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imageloadfont loads a user-defined bitmap and returns + * its identifier. + * + * @param string $filename The font file format is currently binary and architecture + * dependent. This means you should generate the font files on the + * same type of CPU as the machine you are running PHP on. + * + * + * Font file format + * + * + * + * byte position + * C data type + * description + * + * + * + * + * byte 0-3 + * int + * number of characters in the font + * + * + * byte 4-7 + * int + * + * value of first character in the font (often 32 for space) + * + * + * + * byte 8-11 + * int + * pixel width of each character + * + * + * byte 12-15 + * int + * pixel height of each character + * + * + * byte 16- + * char + * + * array with character data, one byte per pixel in each + * character, for a total of (nchars*width*height) bytes. + * + * + * + * + * + * @return int Returns an GdFont instance. + * @throws ImageException + * + */ +function imageloadfont(string $filename): int +{ + error_clear_last(); + $safeResult = \imageloadfont($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Outputs or saves a PNG image from the given + * image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * + * NULL is invalid if the quality and + * filters arguments are not used. + * @param int $quality Compression level: from 0 (no compression) to 9. + * The default (-1) uses the zlib compression default. + * For more information see the zlib manual. + * @param int $filters Allows reducing the PNG file size. It is a bitmask field which may be + * set to any combination of the PNG_FILTER_XXX + * constants. PNG_NO_FILTER or + * PNG_ALL_FILTERS may also be used to respectively + * disable or activate all filters. + * The default value (-1) disables filtering. + * @throws ImageException + * + */ +function imagepng($image, $file = null, int $quality = -1, int $filters = -1): void +{ + error_clear_last(); + if ($filters !== -1) { + $safeResult = \imagepng($image, $file, $quality, $filters); + } elseif ($quality !== -1) { + $safeResult = \imagepng($image, $file, $quality); + } elseif ($file !== null) { + $safeResult = \imagepng($image, $file); + } else { + $safeResult = \imagepng($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagerectangle creates a rectangle starting at + * the specified coordinates. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x1 Upper left x coordinate. + * @param int $y1 Upper left y coordinate + * 0, 0 is the top left corner of the image. + * @param int $x2 Bottom right x coordinate. + * @param int $y2 Bottom right y coordinate. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagerectangle($image, int $x1, int $y1, int $x2, int $y2, int $color): void +{ + error_clear_last(); + $safeResult = \imagerectangle($image, $x1, $y1, $x2, $y2, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imageresolution allows to set and get the resolution of + * an image in DPI (dots per inch). If the optional parameters are NULL, + * the current resolution is returned as an indexed array. If only + * resolution_x is not NULL, the horizontal and vertical resolution + * are set to this value. If none of the optional parameters are NULL, the horizontal + * and vertical resolution are set to these values, respectively. + * + * The resolution is only used as meta information when images are read from and + * written to formats supporting this kind of information (curently PNG and + * JPEG). It does not affect any drawing operations. The default resolution + * for new images is 96 DPI. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $resolution_x The horizontal resolution in DPI. + * @param int $resolution_y The vertical resolution in DPI. + * @return mixed When used as getter, + * it returns an indexed array of the horizontal and vertical resolution on + * success. + * When used as setter, it returns + * TRUE on success. + * @throws ImageException + * + */ +function imageresolution($image, ?int $resolution_x = null, ?int $resolution_y = null) +{ + error_clear_last(); + if ($resolution_y !== null) { + $safeResult = \imageresolution($image, $resolution_x, $resolution_y); + } elseif ($resolution_x !== null) { + $safeResult = \imageresolution($image, $resolution_x); + } else { + $safeResult = \imageresolution($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Rotates the image image using the given + * angle in degrees. + * + * The center of rotation is the center of the image, and the rotated + * image may have different dimensions than the original image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param float $angle Rotation angle, in degrees. The rotation angle is interpreted as the + * number of degrees to rotate the image anticlockwise. + * @param int $background_color Specifies the color of the uncovered zone after the rotation + * @param bool $ignore_transparent This parameter is unused. + * @return resource Returns an image object for the rotated image. + * @throws ImageException + * + */ +function imagerotate($image, float $angle, int $background_color, bool $ignore_transparent = false) +{ + error_clear_last(); + $safeResult = \imagerotate($image, $angle, $background_color, $ignore_transparent); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagesavealpha sets the flag which determines whether to retain + * full alpha channel information (as opposed to single-color transparency) + * when saving PNG images. + * + * Alphablending has to be disabled (imagealphablending($im, false)) + * to retain the alpha-channel in the first place. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param bool $enable Whether to save the alpha channel or not. Defaults to FALSE. + * @throws ImageException + * + */ +function imagesavealpha($image, bool $enable): void +{ + error_clear_last(); + $safeResult = \imagesavealpha($image, $enable); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagescale scales an image using the given + * interpolation algorithm. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $width The width to scale the image to. + * @param int $height The height to scale the image to. If omitted or negative, the aspect + * ratio will be preserved. + * @param int $mode One of IMG_NEAREST_NEIGHBOUR, + * IMG_BILINEAR_FIXED, + * IMG_BICUBIC, + * IMG_BICUBIC_FIXED or anything else (will use two + * pass). + * + * + * IMG_WEIGHTED4 is not yet supported. + * + * + * @return resource Return the scaled image object on success. + * @throws ImageException + * + */ +function imagescale($image, int $width, int $height = -1, int $mode = IMG_BILINEAR_FIXED) +{ + error_clear_last(); + $safeResult = \imagescale($image, $width, $height, $mode); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagesetbrush sets the brush image to be + * used by all line drawing functions (such as imageline + * and imagepolygon) when drawing with the special + * colors IMG_COLOR_BRUSHED or + * IMG_COLOR_STYLEDBRUSHED. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param resource $brush An image object. + * @throws ImageException + * + */ +function imagesetbrush($image, $brush): void +{ + error_clear_last(); + $safeResult = \imagesetbrush($image, $brush); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagesetclip sets the current clipping rectangle, i.e. + * the area beyond which no pixels will be drawn. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x1 The x-coordinate of the upper left corner. + * @param int $y1 The y-coordinate of the upper left corner. + * @param int $x2 The x-coordinate of the lower right corner. + * @param int $y2 The y-coordinate of the lower right corner. + * @throws ImageException + * + */ +function imagesetclip($image, int $x1, int $y1, int $x2, int $y2): void +{ + error_clear_last(); + $safeResult = \imagesetclip($image, $x1, $y1, $x2, $y2); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Sets the interpolation method, setting an interpolation method affects the rendering + * of various functions in GD, such as the imagerotate function. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $method The interpolation method, which can be one of the following: + * + * + * + * IMG_BELL: Bell filter. + * + * + * + * + * IMG_BESSEL: Bessel filter. + * + * + * + * + * IMG_BICUBIC: Bicubic interpolation. + * + * + * + * + * IMG_BICUBIC_FIXED: Fixed point implementation of the bicubic interpolation. + * + * + * + * + * IMG_BILINEAR_FIXED: Fixed point implementation of the bilinear interpolation (default (also on image creation)). + * + * + * + * + * IMG_BLACKMAN: Blackman window function. + * + * + * + * + * IMG_BOX: Box blur filter. + * + * + * + * + * IMG_BSPLINE: Spline interpolation. + * + * + * + * + * IMG_CATMULLROM: Cubic Hermite spline interpolation. + * + * + * + * + * IMG_GAUSSIAN: Gaussian function. + * + * + * + * + * IMG_GENERALIZED_CUBIC: Generalized cubic spline fractal interpolation. + * + * + * + * + * IMG_HERMITE: Hermite interpolation. + * + * + * + * + * IMG_HAMMING: Hamming filter. + * + * + * + * + * IMG_HANNING: Hanning filter. + * + * + * + * + * IMG_MITCHELL: Mitchell filter. + * + * + * + * + * IMG_POWER: Power interpolation. + * + * + * + * + * IMG_QUADRATIC: Inverse quadratic interpolation. + * + * + * + * + * IMG_SINC: Sinc function. + * + * + * + * + * IMG_NEAREST_NEIGHBOUR: Nearest neighbour interpolation. + * + * + * + * + * IMG_WEIGHTED4: Weighting filter. + * + * + * + * + * IMG_TRIANGLE: Triangle interpolation. + * + * + * + * @throws ImageException + * + */ +function imagesetinterpolation($image, int $method = IMG_BILINEAR_FIXED): void +{ + error_clear_last(); + $safeResult = \imagesetinterpolation($image, $method); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagesetpixel draws a pixel at the specified + * coordinate. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x x-coordinate. + * @param int $y y-coordinate. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagesetpixel($image, int $x, int $y, int $color): void +{ + error_clear_last(); + $safeResult = \imagesetpixel($image, $x, $y, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagesetstyle sets the style to be used by all + * line drawing functions (such as imageline + * and imagepolygon) when drawing with the special + * color IMG_COLOR_STYLED or lines of images with color + * IMG_COLOR_STYLEDBRUSHED. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param array $style An array of pixel colors. You can use the + * IMG_COLOR_TRANSPARENT constant to add a + * transparent pixel. + * Note that style must not be an empty array. + * @throws ImageException + * + */ +function imagesetstyle($image, array $style): void +{ + error_clear_last(); + $safeResult = \imagesetstyle($image, $style); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagesetthickness sets the thickness of the lines + * drawn when drawing rectangles, polygons, arcs etc. to + * thickness pixels. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $thickness Thickness, in pixels. + * @throws ImageException + * + */ +function imagesetthickness($image, int $thickness): void +{ + error_clear_last(); + $safeResult = \imagesetthickness($image, $thickness); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagesettile sets the tile image to be + * used by all region filling functions (such as imagefill + * and imagefilledpolygon) when filling with the special + * color IMG_COLOR_TILED. + * + * A tile is an image used to fill an area with a repeated pattern. Any + * GD image can be used as a tile, and by setting the transparent color index of the tile + * image with imagecolortransparent, a tile allows certain parts + * of the underlying area to shine through can be created. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param resource $tile The image object to be used as a tile. + * @throws ImageException + * + */ +function imagesettile($image, $tile): void +{ + error_clear_last(); + $safeResult = \imagesettile($image, $tile); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws a string at the given coordinates. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $font Can be 1, 2, 3, 4, 5 for built-in + * fonts in latin2 encoding (where higher numbers corresponding to larger fonts) or GdFont instance, + * returned by imageloadfont. + * @param int $x x-coordinate of the upper left corner. + * @param int $y y-coordinate of the upper left corner. + * @param string $string The string to be written. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagestring($image, int $font, int $x, int $y, string $string, int $color): void +{ + error_clear_last(); + $safeResult = \imagestring($image, $font, $x, $y, $string, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws a string vertically at the given + * coordinates. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $font Can be 1, 2, 3, 4, 5 for built-in + * fonts in latin2 encoding (where higher numbers corresponding to larger fonts) or GdFont instance, + * returned by imageloadfont. + * @param int $x x-coordinate of the bottom left corner. + * @param int $y y-coordinate of the bottom left corner. + * @param string $string The string to be written. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagestringup($image, int $font, int $x, int $y, string $string, int $color): void +{ + error_clear_last(); + $safeResult = \imagestringup($image, $font, $x, $y, $string, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Returns the width of the given image object. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @return int Return the width of the images. + * @throws ImageException + * + */ +function imagesx($image): int +{ + error_clear_last(); + $safeResult = \imagesx($image); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Returns the height of the given image object. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @return int Return the height of the images. + * @throws ImageException + * + */ +function imagesy($image): int +{ + error_clear_last(); + $safeResult = \imagesy($image); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagetruecolortopalette converts a truecolor image + * to a palette image. The code for this function was originally drawn from + * the Independent JPEG Group library code, which is excellent. The code + * has been modified to preserve as much alpha channel information as + * possible in the resulting palette, in addition to preserving colors as + * well as possible. This does not work as well as might be hoped. It is + * usually best to simply produce a truecolor output image instead, which + * guarantees the highest output quality. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param bool $dither Indicates if the image should be dithered - if it is TRUE then + * dithering will be used which will result in a more speckled image but + * with better color approximation. + * @param int $num_colors Sets the maximum number of colors that should be retained in the palette. + * @throws ImageException + * + */ +function imagetruecolortopalette($image, bool $dither, int $num_colors): void +{ + error_clear_last(); + $safeResult = \imagetruecolortopalette($image, $dither, $num_colors); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * This function calculates and returns the bounding box in pixels + * for a TrueType text. + * + * @param float $size The font size in points. + * @param float $angle Angle in degrees in which string will be measured. + * @param string $font_filename 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 $string The string to be measured. + * @param array $options + * @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 ImageException + * + */ +function imagettfbbox(float $size, float $angle, string $font_filename, string $string, array $options = []): array +{ + error_clear_last(); + $safeResult = \imagettfbbox($size, $angle, $font_filename, $string, $options); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Writes the given text into the image using TrueType + * fonts. + * + * @param resource $image A GdImage object, 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 $font_filename 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. + * @param array $options + * @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. + * @throws ImageException + * + */ +function imagettftext($image, float $size, float $angle, int $x, int $y, int $color, string $font_filename, string $text, array $options = []): array +{ + error_clear_last(); + $safeResult = \imagettftext($image, $size, $angle, $x, $y, $color, $font_filename, $text, $options); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagewbmp outputs or save a WBMP + * version of the given image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @param int $foreground_color You can set the foreground color with this parameter by setting an + * identifier obtained from imagecolorallocate. + * The default foreground color is black. + * @throws ImageException + * + */ +function imagewbmp($image, $file = null, ?int $foreground_color = null): void +{ + error_clear_last(); + if ($foreground_color !== null) { + $safeResult = \imagewbmp($image, $file, $foreground_color); + } elseif ($file !== null) { + $safeResult = \imagewbmp($image, $file); + } else { + $safeResult = \imagewbmp($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Outputs or saves a WebP version of the given image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @param int $quality quality ranges from 0 (worst + * quality, smaller file) to 100 (best quality, biggest file). + * @throws ImageException + * + */ +function imagewebp($image, $file = null, int $quality = -1): void +{ + error_clear_last(); + if ($quality !== -1) { + $safeResult = \imagewebp($image, $file, $quality); + } elseif ($file !== null) { + $safeResult = \imagewebp($image, $file); + } else { + $safeResult = \imagewebp($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Outputs or save an XBM version of the given + * image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $filename The path to save the file to, given as string. If NULL, the raw image stream will be output 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_color 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 ImageException + * + */ +function imagexbm($image, $filename, ?int $foreground_color = null): void +{ + error_clear_last(); + if ($foreground_color !== null) { + $safeResult = \imagexbm($image, $filename, $foreground_color); + } else { + $safeResult = \imagexbm($image, $filename); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Embeds binary IPTC data into a JPEG image. + * + * @param string $iptc_data The data to be written. + * @param string $filename 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 string|bool If spool is less than 2, the JPEG will be returned. Otherwise returns TRUE on success. + * @throws ImageException + * + */ +function iptcembed(string $iptc_data, string $filename, int $spool = 0) +{ + error_clear_last(); + $safeResult = \iptcembed($iptc_data, $filename, $spool); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Parses an IPTC block into its single tags. + * + * @param string $iptc_block 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 ImageException + * + */ +function iptcparse(string $iptc_block): array +{ + error_clear_last(); + $safeResult = \iptcparse($iptc_block); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 ImageException + * + */ +function jpeg2wbmp(string $jpegname, string $wbmpname, int $dest_height, int $dest_width, int $threshold): void +{ + error_clear_last(); + $safeResult = \jpeg2wbmp($jpegname, $wbmpname, $dest_height, $dest_width, $threshold); + if ($safeResult === false) { + throw 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 ImageException + * + */ +function png2wbmp(string $pngname, string $wbmpname, int $dest_height, int $dest_width, int $threshold): void +{ + error_clear_last(); + $safeResult = \png2wbmp($pngname, $wbmpname, $dest_height, $dest_width, $threshold); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} diff --git a/generated/8.3/imap.php b/generated/8.3/imap.php new file mode 100644 index 00000000..9262c489 --- /dev/null +++ b/generated/8.3/imap.php @@ -0,0 +1,2289 @@ + + * + * + * @param array $controls Array of LDAP Controls to send with the request. + * @throws LdapException + * + */ +function ldap_add($ldap, string $dn, array $entry, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_add($ldap, $dn, $entry, $controls); + } else { + $safeResult = \ldap_add($ldap, $dn, $entry); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Binds to the LDAP directory with specified RDN and password. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param string|null $dn + * @param string|null $password + * @throws LdapException + * + */ +function ldap_bind($ldap, ?string $dn = null, ?string $password = null): void +{ + error_clear_last(); + if ($password !== null) { + $safeResult = \ldap_bind($ldap, $dn, $password); + } elseif ($dn !== null) { + $safeResult = \ldap_bind($ldap, $dn); + } else { + $safeResult = \ldap_bind($ldap); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Retrieve the pagination information send by the server. + * + * @param resource $link An LDAP resource, returned by ldap_connect. + * @param resource $result + * @param string|null $cookie An opaque structure sent by the server. + * @param int|null $estimated The estimated number of entries to retrieve. + * @throws LdapException + * + */ +function ldap_control_paged_result_response($link, $result, ?string &$cookie = null, ?int &$estimated = null): void +{ + error_clear_last(); + $safeResult = \ldap_control_paged_result_response($link, $result, $cookie, $estimated); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Enable LDAP pagination by sending the pagination control (page size, cookie...). + * + * @param resource $link An LDAP resource, 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 LdapException + * + */ +function ldap_control_paged_result($link, int $pagesize, bool $iscritical = false, string $cookie = ""): void +{ + error_clear_last(); + $safeResult = \ldap_control_paged_result($link, $pagesize, $iscritical, $cookie); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Returns the number of entries stored in the result of previous search + * operations. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $result An LDAP\Result instance, returned by ldap_list or ldap_search. + * @return int Returns number of entries in the result. + * @throws LdapException + * + */ +function ldap_count_entries($ldap, $result): int +{ + error_clear_last(); + $safeResult = \ldap_count_entries($ldap, $result); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Deletes a particular entry in LDAP directory. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param string $dn The distinguished name of an LDAP entity. + * @param array $controls Array of LDAP Controls to send with the request. + * @throws LdapException + * + */ +function ldap_delete($ldap, string $dn, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_delete($ldap, $dn, $controls); + } else { + $safeResult = \ldap_delete($ldap, $dn); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Turns the specified dn, into a more user-friendly + * form, stripping off type names. + * + * @param string $dn The distinguished name of an LDAP entity. + * @return string Returns the user friendly name. + * @throws LdapException + * + */ +function ldap_dn2ufn(string $dn): string +{ + error_clear_last(); + $safeResult = \ldap_dn2ufn($dn); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Performs a PASSWD extended operation. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param string $user dn of the user to change the password of. + * @param string $old_password The old password of this user. May be ommited depending of server configuration. + * @param string $new_password The new password for this user. May be omitted or empty to have a generated password. + * @param array $controls If provided, a password policy request control is send with the request and this is + * filled with an array of LDAP Controls + * returned with the request. + * @return string|bool Returns the generated password if new_password is empty or omitted. + * Otherwise returns TRUE on success. + * @throws LdapException + * + */ +function ldap_exop_passwd($ldap, string $user = "", string $old_password = "", string $new_password = "", ?array &$controls = null) +{ + error_clear_last(); + $safeResult = \ldap_exop_passwd($ldap, $user, $old_password, $new_password, $controls); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Performs a WHOAMI extended operation and returns the data. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @return string|bool The data returned by the server. + * @throws LdapException + * + */ +function ldap_exop_whoami($ldap) +{ + error_clear_last(); + $safeResult = \ldap_exop_whoami($ldap); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Performs an extended operation on the specified ldap with + * request_oid the OID of the operation and + * request_data the data. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param string $request_oid 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 $request_data 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|null $controls Array of LDAP Controls to send with the request. + * @param string|null $response_data 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|null $response_oid Will be filled with the response OID if provided, usually equal to the request OID. + * @return resource|bool When used with response_data, returns TRUE on success. + * When used without response_data, returns a result identifier. + * @throws LdapException + * + */ +function ldap_exop($ldap, string $request_oid, ?string $request_data = null, ?array $controls = null, ?string &$response_data = null, ?string &$response_oid = null) +{ + error_clear_last(); + if ($response_oid !== null) { + $safeResult = \ldap_exop($ldap, $request_oid, $request_data, $controls, $response_data, $response_oid); + } elseif ($response_data !== null) { + $safeResult = \ldap_exop($ldap, $request_oid, $request_data, $controls, $response_data); + } elseif ($controls !== null) { + $safeResult = \ldap_exop($ldap, $request_oid, $request_data, $controls); + } elseif ($request_data !== null) { + $safeResult = \ldap_exop($ldap, $request_oid, $request_data); + } else { + $safeResult = \ldap_exop($ldap, $request_oid); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 LdapException + * + */ +function ldap_explode_dn(string $dn, int $with_attrib): array +{ + error_clear_last(); + $safeResult = \ldap_explode_dn($dn, $with_attrib); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $entry An LDAP\ResultEntry instance. + * @return string Returns the first attribute in the entry on success and FALSE on + * error. + * @throws LdapException + * + */ +function ldap_first_attribute($ldap, $entry): string +{ + error_clear_last(); + $safeResult = \ldap_first_attribute($ldap, $entry); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $result An LDAP\Result instance, returned by ldap_list or ldap_search. + * @return resource Returns an LDAP\ResultEntry instance. + * @throws LdapException + * + */ +function ldap_first_entry($ldap, $result) +{ + error_clear_last(); + $safeResult = \ldap_first_entry($ldap, $result); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 An LDAP\Result instance, returned by ldap_list or ldap_search. + * @throws LdapException + * + */ +function ldap_free_result($result): void +{ + error_clear_last(); + $safeResult = \ldap_free_result($result); + if ($safeResult === false) { + throw 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 $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $entry An LDAP\ResultEntry instance. + * @return array Returns a complete entry information in a multi-dimensional array + * on success and FALSE on error. + * @throws LdapException + * + */ +function ldap_get_attributes($ldap, $entry): array +{ + error_clear_last(); + $safeResult = \ldap_get_attributes($ldap, $entry); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Finds out the DN of an entry in the result. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $entry An LDAP\ResultEntry instance. + * @return string Returns the DN of the result entry and FALSE on error. + * @throws LdapException + * + */ +function ldap_get_dn($ldap, $entry): string +{ + error_clear_last(); + $safeResult = \ldap_get_dn($ldap, $entry); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Reads multiple entries from the given result, and then reading the + * attributes and multiple values. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $result An LDAP\Result instance, returned by ldap_list or ldap_search. + * @return array Returns a complete result information in a multi-dimensional array on + * success. + * + * 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 LdapException + * + */ +function ldap_get_entries($ldap, $result): array +{ + error_clear_last(); + $safeResult = \ldap_get_entries($ldap, $result); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Sets value to the value of the specified option. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param int $option The parameter option can be one of: + * + * + * + * + * Option + * Type + * since + * + * + * + * + * LDAP_OPT_DEREF + * int + * + * + * + * LDAP_OPT_SIZELIMIT + * int + * + * + * + * LDAP_OPT_TIMELIMIT + * int + * + * + * + * LDAP_OPT_NETWORK_TIMEOUT + * int + * + * + * + * LDAP_OPT_PROTOCOL_VERSION + * int + * + * + * + * LDAP_OPT_ERROR_NUMBER + * int + * + * + * + * LDAP_OPT_DIAGNOSTIC_MESSAGE + * string + * + * + * + * LDAP_OPT_REFERRALS + * int + * + * + * + * LDAP_OPT_RESTART + * int + * + * + * + * 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 + * int + * 7.1 + * + * + * LDAP_OPT_X_TLS_CRL_NONE + * int + * 7.1 + * + * + * LDAP_OPT_X_TLS_CRL_PEER + * int + * 7.1 + * + * + * LDAP_OPT_X_TLS_CRL_ALL + * int + * 7.1 + * + * + * LDAP_OPT_X_TLS_CRLFILE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_DHFILE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_KEYFILE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_PACKAGE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_PROTOCOL_MIN + * int + * 7.1 + * + * + * LDAP_OPT_X_TLS_RANDOM_FILE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_REQUIRE_CERT + * int + * + * + * + * + * + * @param mixed $value This will be set to the option value. + * @throws LdapException + * + */ +function ldap_get_option($ldap, int $option, &$value = null): void +{ + error_clear_last(); + $safeResult = \ldap_get_option($ldap, $option, $value); + if ($safeResult === false) { + throw 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 $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $entry An LDAP\ResultEntry instance. + * @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 LdapException + * + */ +function ldap_get_values_len($ldap, $entry, string $attribute): array +{ + error_clear_last(); + $safeResult = \ldap_get_values_len($ldap, $entry, $attribute); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Reads all the values of the attribute in the entry in the result. + * + * This call needs a entry, + * 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 $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $entry An LDAP\ResultEntry instance. + * @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 LdapException + * + */ +function ldap_get_values($ldap, $entry, string $attribute): array +{ + error_clear_last(); + $safeResult = \ldap_get_values($ldap, $entry, $attribute); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Adds one or more attribute values to the specified dn. + * To add a whole new object see ldap_add function. + * + * @param resource $ldap An LDAP\Connection instance, 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 $controls Array of LDAP Controls to send with the request. + * @throws LdapException + * + */ +function ldap_mod_add($ldap, string $dn, array $entry, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_mod_add($ldap, $dn, $entry, $controls); + } else { + $safeResult = \ldap_mod_add($ldap, $dn, $entry); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Removes one or more attribute values from the specified dn. + * Object deletions are done by the + * ldap_delete function. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param string $dn The distinguished name of an LDAP entity. + * @param array $entry + * @param array $controls Array of LDAP Controls to send with the request. + * @throws LdapException + * + */ +function ldap_mod_del($ldap, string $dn, array $entry, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_mod_del($ldap, $dn, $entry, $controls); + } else { + $safeResult = \ldap_mod_del($ldap, $dn, $entry); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Replaces one or more attributes from the specified dn. + * It may also add or remove attributes. + * + * @param resource $ldap An LDAP\Connection instance, 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 $controls Array of LDAP Controls to send with the request. + * @throws LdapException + * + */ +function ldap_mod_replace($ldap, string $dn, array $entry, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_mod_replace($ldap, $dn, $entry, $controls); + } else { + $safeResult = \ldap_mod_replace($ldap, $dn, $entry); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Modifies an existing entry in the LDAP directory. Allows detailed + * specification of the modifications to perform. + * + * @param resource $ldap An LDAP resource, returned by ldap_connect. + * @param string $dn The distinguished name of an LDAP entity. + * @param array $modifications_info 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 $controls Each value specified through values is added (as + * an additional value) to the attribute named by + * attrib. + * @throws LdapException + * + */ +function ldap_modify_batch($ldap, string $dn, array $modifications_info, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_modify_batch($ldap, $dn, $modifications_info, $controls); + } else { + $safeResult = \ldap_modify_batch($ldap, $dn, $modifications_info); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Retrieves the attributes in an entry. The first call to + * ldap_next_attribute is made with the + * entry returned from + * ldap_first_attribute. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $entry An LDAP\ResultEntry instance. + * @return string Returns the next attribute in an entry on success and FALSE on + * error. + * @throws LdapException + * + */ +function ldap_next_attribute($ldap, $entry): string +{ + error_clear_last(); + $safeResult = \ldap_next_attribute($ldap, $entry); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Parse LDAP extended operation data from result object result + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $result An LDAP\Result instance, returned by ldap_list or ldap_search. + * @param string|null $response_data Will be filled by the response data. + * @param string|null $response_oid Will be filled by the response OID. + * @throws LdapException + * + */ +function ldap_parse_exop($ldap, $result, ?string &$response_data = null, ?string &$response_oid = null): void +{ + error_clear_last(); + $safeResult = \ldap_parse_exop($ldap, $result, $response_data, $response_oid); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Parses an LDAP search result. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $result An LDAP\Result instance, returned by ldap_list or ldap_search. + * @param int|null $error_code 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|null $matched_dn 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|null $error_message 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|null $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|null $controls An array of LDAP Controls which have been sent with the response. + * @throws LdapException + * + */ +function ldap_parse_result($ldap, $result, ?int &$error_code, ?string &$matched_dn = null, ?string &$error_message = null, ?array &$referrals = null, ?array &$controls = null): void +{ + error_clear_last(); + $safeResult = \ldap_parse_result($ldap, $result, $error_code, $matched_dn, $error_message, $referrals, $controls); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * The entry specified by dn is renamed/moved. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param string $dn The distinguished name of an LDAP entity. + * @param string $new_rdn The new RDN. + * @param string $new_parent The new parent/superior entry. + * @param bool $delete_old_rdn 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 $controls Array of LDAP Controls to send with the request. + * @throws LdapException + * + */ +function ldap_rename($ldap, string $dn, string $new_rdn, string $new_parent, bool $delete_old_rdn, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_rename($ldap, $dn, $new_rdn, $new_parent, $delete_old_rdn, $controls); + } else { + $safeResult = \ldap_rename($ldap, $dn, $new_rdn, $new_parent, $delete_old_rdn); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * + * + * @param resource $ldap + * @param string $dn + * @param string $password + * @param string $mech + * @param string $realm + * @param string $authc_id + * @param string $authz_id + * @param string $props + * @throws LdapException + * + */ +function ldap_sasl_bind($ldap, ?string $dn = null, ?string $password = null, ?string $mech = null, ?string $realm = null, ?string $authc_id = null, ?string $authz_id = null, ?string $props = null): void +{ + error_clear_last(); + if ($props !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm, $authc_id, $authz_id, $props); + } elseif ($authz_id !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm, $authc_id, $authz_id); + } elseif ($authc_id !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm, $authc_id); + } elseif ($realm !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm); + } elseif ($mech !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech); + } elseif ($password !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn, $password); + } elseif ($dn !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn); + } else { + $safeResult = \ldap_sasl_bind($ldap); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Sets the value of the specified option to be value. + * + * @param resource|null $ldap Either an LDAP\Connection instance, returned by + * ldap_connect, to set the option for that connection, + * or NULL to set the option globally. + * @param int $option The parameter option can be one of: + * + * + * + * + * Option + * Type + * Available since + * + * + * + * + * LDAP_OPT_DEREF + * int + * + * + * + * LDAP_OPT_SIZELIMIT + * int + * + * + * + * LDAP_OPT_TIMELIMIT + * int + * + * + * + * LDAP_OPT_NETWORK_TIMEOUT + * int + * + * + * + * LDAP_OPT_PROTOCOL_VERSION + * int + * + * + * + * LDAP_OPT_ERROR_NUMBER + * int + * + * + * + * 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 + * int + * 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 + * int + * PHP 7.1.0 + * + * + * LDAP_OPT_X_TLS_RANDOM_FILE + * string + * PHP 7.1.0 + * + * + * LDAP_OPT_X_TLS_REQUIRE_CERT + * int + * 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 $value The new value for the specified option. + * @throws LdapException + * + */ +function ldap_set_option($ldap, int $option, $value): void +{ + error_clear_last(); + $safeResult = \ldap_set_option($ldap, $option, $value); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Unbinds from the LDAP directory. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @throws LdapException + * + */ +function ldap_unbind($ldap): void +{ + error_clear_last(); + $safeResult = \ldap_unbind($ldap); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} diff --git a/generated/8.3/libxml.php b/generated/8.3/libxml.php new file mode 100644 index 00000000..20d32408 --- /dev/null +++ b/generated/8.3/libxml.php @@ -0,0 +1,78 @@ + + * + * 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 (in bytes) 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 (in bytes) 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|null Returns the number of full pattern matches (which might be zero). + * @throws PcreException + * + */ +function preg_match_all(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): ?int +{ + error_clear_last(); + $safeResult = \preg_match_all($pattern, $subject, $matches, $flags, $offset); + if ($safeResult === false) { + throw PcreException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 string[]|null $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 (in bytes) 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 (in bytes) 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 (in bytes) 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 PcreException + * + */ +function preg_match(string $pattern, string $subject, ?iterable &$matches = null, int $flags = 0, int $offset = 0): int +{ + error_clear_last(); + $safeResult = \preg_match($pattern, $subject, $matches, $flags, $offset); + if ($safeResult === false) { + throw PcreException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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". + * @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 PcreException + * + */ +function preg_split(string $pattern, string $subject, ?int $limit = -1, int $flags = 0): array +{ + error_clear_last(); + $safeResult = \preg_split($pattern, $subject, $limit, $flags); + if ($safeResult === false) { + throw PcreException::createFromPhpError(); + } + return $safeResult; +} diff --git a/generated/8.3/pgsql.php b/generated/8.3/pgsql.php new file mode 100644 index 00000000..38b66e9c --- /dev/null +++ b/generated/8.3/pgsql.php @@ -0,0 +1,1360 @@ +ruleWithConfiguration( + RenameFunctionRector::class, + [ 'apache_getenv' => 'Safe\apache_getenv', + 'apache_get_version' => 'Safe\apache_get_version', + 'apache_lookup_uri' => 'Safe\apache_lookup_uri', + 'apache_request_headers' => 'Safe\apache_request_headers', + 'apache_response_headers' => 'Safe\apache_response_headers', + 'apache_setenv' => 'Safe\apache_setenv', + 'apcu_cache_info' => 'Safe\apcu_cache_info', + 'apcu_cas' => 'Safe\apcu_cas', + 'apcu_dec' => 'Safe\apcu_dec', + 'apcu_fetch' => 'Safe\apcu_fetch', + 'apcu_inc' => 'Safe\apcu_inc', + 'apcu_sma_info' => 'Safe\apcu_sma_info', + 'apc_fetch' => 'Safe\apc_fetch', + 'array_walk_recursive' => 'Safe\array_walk_recursive', + 'assert_options' => 'Safe\assert_options', + 'base64_decode' => 'Safe\base64_decode', + 'bindtextdomain' => 'Safe\bindtextdomain', + 'bzclose' => 'Safe\bzclose', + 'bzflush' => 'Safe\bzflush', + 'bzread' => 'Safe\bzread', + 'bzwrite' => 'Safe\bzwrite', + 'chdir' => 'Safe\chdir', + 'chgrp' => 'Safe\chgrp', + 'chmod' => 'Safe\chmod', + 'chown' => 'Safe\chown', + 'chroot' => 'Safe\chroot', + 'class_alias' => 'Safe\class_alias', + 'class_implements' => 'Safe\class_implements', + 'class_parents' => 'Safe\class_parents', + 'class_uses' => 'Safe\class_uses', + 'cli_set_process_title' => 'Safe\cli_set_process_title', + 'closelog' => 'Safe\closelog', + 'com_create_guid' => 'Safe\com_create_guid', + 'com_event_sink' => 'Safe\com_event_sink', + 'com_load_typelib' => 'Safe\com_load_typelib', + 'com_print_typeinfo' => 'Safe\com_print_typeinfo', + 'convert_uudecode' => 'Safe\convert_uudecode', + 'copy' => 'Safe\copy', + 'create_function' => 'Safe\create_function', + 'cubrid_bind' => 'Safe\cubrid_bind', + 'cubrid_column_names' => 'Safe\cubrid_column_names', + 'cubrid_column_types' => 'Safe\cubrid_column_types', + 'cubrid_col_size' => 'Safe\cubrid_col_size', + 'cubrid_commit' => 'Safe\cubrid_commit', + 'cubrid_connect' => 'Safe\cubrid_connect', + 'cubrid_connect_with_url' => 'Safe\cubrid_connect_with_url', + 'cubrid_current_oid' => 'Safe\cubrid_current_oid', + 'cubrid_disconnect' => 'Safe\cubrid_disconnect', + 'cubrid_drop' => 'Safe\cubrid_drop', + 'cubrid_free_result' => 'Safe\cubrid_free_result', + 'cubrid_get_charset' => 'Safe\cubrid_get_charset', + 'cubrid_get_class_name' => 'Safe\cubrid_get_class_name', + 'cubrid_get_client_info' => 'Safe\cubrid_get_client_info', + 'cubrid_get_db_parameter' => 'Safe\cubrid_get_db_parameter', + 'cubrid_get_query_timeout' => 'Safe\cubrid_get_query_timeout', + 'cubrid_get_server_info' => 'Safe\cubrid_get_server_info', + 'cubrid_insert_id' => 'Safe\cubrid_insert_id', + 'cubrid_lob2_bind' => 'Safe\cubrid_lob2_bind', + 'cubrid_lob2_close' => 'Safe\cubrid_lob2_close', + 'cubrid_lob2_export' => 'Safe\cubrid_lob2_export', + 'cubrid_lob2_import' => 'Safe\cubrid_lob2_import', + 'cubrid_lob2_new' => 'Safe\cubrid_lob2_new', + 'cubrid_lob2_read' => 'Safe\cubrid_lob2_read', + 'cubrid_lob2_seek' => 'Safe\cubrid_lob2_seek', + 'cubrid_lob2_seek64' => 'Safe\cubrid_lob2_seek64', + 'cubrid_lob2_size' => 'Safe\cubrid_lob2_size', + 'cubrid_lob2_size64' => 'Safe\cubrid_lob2_size64', + 'cubrid_lob2_tell' => 'Safe\cubrid_lob2_tell', + 'cubrid_lob2_tell64' => 'Safe\cubrid_lob2_tell64', + 'cubrid_lob2_write' => 'Safe\cubrid_lob2_write', + 'cubrid_lob_close' => 'Safe\cubrid_lob_close', + 'cubrid_lob_export' => 'Safe\cubrid_lob_export', + 'cubrid_lob_get' => 'Safe\cubrid_lob_get', + 'cubrid_lob_send' => 'Safe\cubrid_lob_send', + 'cubrid_lob_size' => 'Safe\cubrid_lob_size', + 'cubrid_lock_read' => 'Safe\cubrid_lock_read', + 'cubrid_lock_write' => 'Safe\cubrid_lock_write', + 'cubrid_move_cursor' => 'Safe\cubrid_move_cursor', + 'cubrid_next_result' => 'Safe\cubrid_next_result', + 'cubrid_pconnect' => 'Safe\cubrid_pconnect', + 'cubrid_pconnect_with_url' => 'Safe\cubrid_pconnect_with_url', + 'cubrid_prepare' => 'Safe\cubrid_prepare', + 'cubrid_put' => 'Safe\cubrid_put', + 'cubrid_rollback' => 'Safe\cubrid_rollback', + 'cubrid_schema' => 'Safe\cubrid_schema', + 'cubrid_seq_drop' => 'Safe\cubrid_seq_drop', + 'cubrid_seq_insert' => 'Safe\cubrid_seq_insert', + 'cubrid_seq_put' => 'Safe\cubrid_seq_put', + 'cubrid_set_add' => 'Safe\cubrid_set_add', + 'cubrid_set_autocommit' => 'Safe\cubrid_set_autocommit', + 'cubrid_set_db_parameter' => 'Safe\cubrid_set_db_parameter', + 'cubrid_set_drop' => 'Safe\cubrid_set_drop', + 'cubrid_set_query_timeout' => 'Safe\cubrid_set_query_timeout', + 'curl_copy_handle' => 'Safe\curl_copy_handle', + 'curl_escape' => 'Safe\curl_escape', + 'curl_exec' => 'Safe\curl_exec', + 'curl_getinfo' => 'Safe\curl_getinfo', + 'curl_init' => 'Safe\curl_init', + 'curl_multi_info_read' => 'Safe\curl_multi_info_read', + 'curl_multi_init' => 'Safe\curl_multi_init', + 'curl_multi_setopt' => 'Safe\curl_multi_setopt', + 'curl_setopt' => 'Safe\curl_setopt', + 'curl_share_errno' => 'Safe\curl_share_errno', + 'curl_share_setopt' => 'Safe\curl_share_setopt', + 'curl_unescape' => 'Safe\curl_unescape', + 'curl_upkeep' => 'Safe\curl_upkeep', + 'date' => 'Safe\date', + 'date_parse' => 'Safe\date_parse', + 'date_parse_from_format' => 'Safe\date_parse_from_format', + 'date_sunrise' => 'Safe\date_sunrise', + 'date_sunset' => 'Safe\date_sunset', + 'date_sun_info' => 'Safe\date_sun_info', + 'db2_autocommit' => 'Safe\db2_autocommit', + 'db2_bind_param' => 'Safe\db2_bind_param', + 'db2_client_info' => 'Safe\db2_client_info', + 'db2_close' => 'Safe\db2_close', + 'db2_commit' => 'Safe\db2_commit', + 'db2_execute' => 'Safe\db2_execute', + 'db2_free_result' => 'Safe\db2_free_result', + 'db2_free_stmt' => 'Safe\db2_free_stmt', + 'db2_get_option' => 'Safe\db2_get_option', + 'db2_pclose' => 'Safe\db2_pclose', + 'db2_rollback' => 'Safe\db2_rollback', + 'db2_server_info' => 'Safe\db2_server_info', + 'db2_set_option' => 'Safe\db2_set_option', + 'define' => 'Safe\define', + 'deflate_add' => 'Safe\deflate_add', + 'deflate_init' => 'Safe\deflate_init', + 'disk_free_space' => 'Safe\disk_free_space', + 'disk_total_space' => 'Safe\disk_total_space', + 'dl' => 'Safe\dl', + 'dns_get_record' => 'Safe\dns_get_record', + 'eio_busy' => 'Safe\eio_busy', + 'eio_chmod' => 'Safe\eio_chmod', + 'eio_chown' => 'Safe\eio_chown', + 'eio_close' => 'Safe\eio_close', + 'eio_custom' => 'Safe\eio_custom', + 'eio_dup2' => 'Safe\eio_dup2', + 'eio_event_loop' => 'Safe\eio_event_loop', + 'eio_fallocate' => 'Safe\eio_fallocate', + 'eio_fchmod' => 'Safe\eio_fchmod', + 'eio_fchown' => 'Safe\eio_fchown', + 'eio_fdatasync' => 'Safe\eio_fdatasync', + 'eio_fstat' => 'Safe\eio_fstat', + 'eio_fstatvfs' => 'Safe\eio_fstatvfs', + 'eio_fsync' => 'Safe\eio_fsync', + 'eio_ftruncate' => 'Safe\eio_ftruncate', + 'eio_futime' => 'Safe\eio_futime', + 'eio_grp' => 'Safe\eio_grp', + 'eio_lstat' => 'Safe\eio_lstat', + 'eio_mkdir' => 'Safe\eio_mkdir', + 'eio_mknod' => 'Safe\eio_mknod', + 'eio_nop' => 'Safe\eio_nop', + 'eio_readahead' => 'Safe\eio_readahead', + 'eio_readdir' => 'Safe\eio_readdir', + 'eio_readlink' => 'Safe\eio_readlink', + 'eio_rename' => 'Safe\eio_rename', + 'eio_rmdir' => 'Safe\eio_rmdir', + 'eio_seek' => 'Safe\eio_seek', + 'eio_sendfile' => 'Safe\eio_sendfile', + 'eio_stat' => 'Safe\eio_stat', + 'eio_statvfs' => 'Safe\eio_statvfs', + 'eio_symlink' => 'Safe\eio_symlink', + 'eio_sync' => 'Safe\eio_sync', + 'eio_syncfs' => 'Safe\eio_syncfs', + 'eio_sync_file_range' => 'Safe\eio_sync_file_range', + 'eio_truncate' => 'Safe\eio_truncate', + 'eio_unlink' => 'Safe\eio_unlink', + 'eio_utime' => 'Safe\eio_utime', + 'eio_write' => 'Safe\eio_write', + 'error_log' => 'Safe\error_log', + 'exec' => 'Safe\exec', + 'fastcgi_finish_request' => 'Safe\fastcgi_finish_request', + 'fbird_blob_cancel' => 'Safe\fbird_blob_cancel', + 'fclose' => 'Safe\fclose', + 'fdatasync' => 'Safe\fdatasync', + 'fflush' => 'Safe\fflush', + 'fgetcsv' => 'Safe\fgetcsv', + 'file' => 'Safe\file', + 'fileatime' => 'Safe\fileatime', + 'filectime' => 'Safe\filectime', + 'fileinode' => 'Safe\fileinode', + 'filemtime' => 'Safe\filemtime', + 'fileowner' => 'Safe\fileowner', + 'fileperms' => 'Safe\fileperms', + 'filesize' => 'Safe\filesize', + 'file_get_contents' => 'Safe\file_get_contents', + 'file_put_contents' => 'Safe\file_put_contents', + 'filter_input_array' => 'Safe\filter_input_array', + 'filter_var_array' => 'Safe\filter_var_array', + 'finfo_close' => 'Safe\finfo_close', + 'finfo_open' => 'Safe\finfo_open', + 'flock' => 'Safe\flock', + 'fopen' => 'Safe\fopen', + 'fpm_get_status' => 'Safe\fpm_get_status', + 'fputcsv' => 'Safe\fputcsv', + 'fread' => 'Safe\fread', + 'fsockopen' => 'Safe\fsockopen', + 'fstat' => 'Safe\fstat', + 'fsync' => 'Safe\fsync', + 'ftp_alloc' => 'Safe\ftp_alloc', + 'ftp_append' => 'Safe\ftp_append', + 'ftp_cdup' => 'Safe\ftp_cdup', + 'ftp_chdir' => 'Safe\ftp_chdir', + 'ftp_chmod' => 'Safe\ftp_chmod', + 'ftp_close' => 'Safe\ftp_close', + 'ftp_connect' => 'Safe\ftp_connect', + 'ftp_delete' => 'Safe\ftp_delete', + 'ftp_fget' => 'Safe\ftp_fget', + 'ftp_fput' => 'Safe\ftp_fput', + 'ftp_get' => 'Safe\ftp_get', + 'ftp_login' => 'Safe\ftp_login', + 'ftp_mkdir' => 'Safe\ftp_mkdir', + 'ftp_mlsd' => 'Safe\ftp_mlsd', + 'ftp_nb_put' => 'Safe\ftp_nb_put', + 'ftp_nlist' => 'Safe\ftp_nlist', + 'ftp_pasv' => 'Safe\ftp_pasv', + 'ftp_put' => 'Safe\ftp_put', + 'ftp_pwd' => 'Safe\ftp_pwd', + 'ftp_raw' => 'Safe\ftp_raw', + 'ftp_rename' => 'Safe\ftp_rename', + 'ftp_rmdir' => 'Safe\ftp_rmdir', + 'ftp_site' => 'Safe\ftp_site', + 'ftp_ssl_connect' => 'Safe\ftp_ssl_connect', + 'ftp_systype' => 'Safe\ftp_systype', + 'ftruncate' => 'Safe\ftruncate', + 'fwrite' => 'Safe\fwrite', + 'getallheaders' => 'Safe\getallheaders', + 'getcwd' => 'Safe\getcwd', + 'gethostname' => 'Safe\gethostname', + 'getimagesize' => 'Safe\getimagesize', + 'getlastmod' => 'Safe\getlastmod', + 'getmygid' => 'Safe\getmygid', + 'getmyinode' => 'Safe\getmyinode', + 'getmypid' => 'Safe\getmypid', + 'getmyuid' => 'Safe\getmyuid', + 'getopt' => 'Safe\getopt', + 'getprotobyname' => 'Safe\getprotobyname', + 'getprotobynumber' => 'Safe\getprotobynumber', + 'getrusage' => 'Safe\getrusage', + 'getservbyport' => 'Safe\getservbyport', + 'get_headers' => 'Safe\get_headers', + 'get_include_path' => 'Safe\get_include_path', + 'get_meta_tags' => 'Safe\get_meta_tags', + 'glob' => 'Safe\glob', + 'gmmktime' => 'Safe\gmmktime', + 'gmstrftime' => 'Safe\gmstrftime', + 'gnupg_adddecryptkey' => 'Safe\gnupg_adddecryptkey', + 'gnupg_addencryptkey' => 'Safe\gnupg_addencryptkey', + 'gnupg_addsignkey' => 'Safe\gnupg_addsignkey', + 'gnupg_cleardecryptkeys' => 'Safe\gnupg_cleardecryptkeys', + 'gnupg_clearencryptkeys' => 'Safe\gnupg_clearencryptkeys', + 'gnupg_clearsignkeys' => 'Safe\gnupg_clearsignkeys', + 'gnupg_deletekey' => 'Safe\gnupg_deletekey', + 'gnupg_setarmor' => 'Safe\gnupg_setarmor', + 'gnupg_setsignmode' => 'Safe\gnupg_setsignmode', + 'gzclose' => 'Safe\gzclose', + 'gzcompress' => 'Safe\gzcompress', + 'gzdecode' => 'Safe\gzdecode', + 'gzdeflate' => 'Safe\gzdeflate', + 'gzencode' => 'Safe\gzencode', + 'gzfile' => 'Safe\gzfile', + 'gzgets' => 'Safe\gzgets', + 'gzgetss' => 'Safe\gzgetss', + 'gzinflate' => 'Safe\gzinflate', + 'gzopen' => 'Safe\gzopen', + 'gzpassthru' => 'Safe\gzpassthru', + 'gzread' => 'Safe\gzread', + 'gzrewind' => 'Safe\gzrewind', + 'gzuncompress' => 'Safe\gzuncompress', + 'gzwrite' => 'Safe\gzwrite', + 'hash_update_file' => 'Safe\hash_update_file', + 'header_register_callback' => 'Safe\header_register_callback', + 'hex2bin' => 'Safe\hex2bin', + 'highlight_file' => 'Safe\highlight_file', + 'highlight_string' => 'Safe\highlight_string', + 'hrtime' => 'Safe\hrtime', + 'ibase_add_user' => 'Safe\ibase_add_user', + 'ibase_backup' => 'Safe\ibase_backup', + 'ibase_blob_cancel' => 'Safe\ibase_blob_cancel', + 'ibase_blob_create' => 'Safe\ibase_blob_create', + 'ibase_blob_get' => 'Safe\ibase_blob_get', + 'ibase_close' => 'Safe\ibase_close', + 'ibase_commit' => 'Safe\ibase_commit', + 'ibase_commit_ret' => 'Safe\ibase_commit_ret', + 'ibase_connect' => 'Safe\ibase_connect', + 'ibase_delete_user' => 'Safe\ibase_delete_user', + 'ibase_drop_db' => 'Safe\ibase_drop_db', + 'ibase_free_event_handler' => 'Safe\ibase_free_event_handler', + 'ibase_free_query' => 'Safe\ibase_free_query', + 'ibase_free_result' => 'Safe\ibase_free_result', + 'ibase_maintain_db' => 'Safe\ibase_maintain_db', + 'ibase_modify_user' => 'Safe\ibase_modify_user', + 'ibase_name_result' => 'Safe\ibase_name_result', + 'ibase_pconnect' => 'Safe\ibase_pconnect', + 'ibase_restore' => 'Safe\ibase_restore', + 'ibase_rollback' => 'Safe\ibase_rollback', + 'ibase_rollback_ret' => 'Safe\ibase_rollback_ret', + 'ibase_service_attach' => 'Safe\ibase_service_attach', + 'ibase_service_detach' => 'Safe\ibase_service_detach', + 'iconv' => 'Safe\iconv', + 'iconv_get_encoding' => 'Safe\iconv_get_encoding', + 'iconv_set_encoding' => 'Safe\iconv_set_encoding', + 'idate' => 'Safe\idate', + 'image2wbmp' => 'Safe\image2wbmp', + 'imageaffine' => 'Safe\imageaffine', + 'imageaffinematrixconcat' => 'Safe\imageaffinematrixconcat', + 'imageaffinematrixget' => 'Safe\imageaffinematrixget', + 'imagealphablending' => 'Safe\imagealphablending', + 'imageantialias' => 'Safe\imageantialias', + 'imagearc' => 'Safe\imagearc', + 'imageavif' => 'Safe\imageavif', + 'imagebmp' => 'Safe\imagebmp', + 'imagechar' => 'Safe\imagechar', + 'imagecharup' => 'Safe\imagecharup', + 'imagecolorat' => 'Safe\imagecolorat', + 'imagecolordeallocate' => 'Safe\imagecolordeallocate', + 'imagecolormatch' => 'Safe\imagecolormatch', + 'imagecolorset' => 'Safe\imagecolorset', + 'imageconvolution' => 'Safe\imageconvolution', + 'imagecopy' => 'Safe\imagecopy', + 'imagecopymerge' => 'Safe\imagecopymerge', + 'imagecopymergegray' => 'Safe\imagecopymergegray', + 'imagecopyresampled' => 'Safe\imagecopyresampled', + 'imagecopyresized' => 'Safe\imagecopyresized', + 'imagecreate' => 'Safe\imagecreate', + 'imagecreatefromavif' => 'Safe\imagecreatefromavif', + 'imagecreatefrombmp' => 'Safe\imagecreatefrombmp', + 'imagecreatefromgd' => 'Safe\imagecreatefromgd', + 'imagecreatefromgd2' => 'Safe\imagecreatefromgd2', + 'imagecreatefromgd2part' => 'Safe\imagecreatefromgd2part', + 'imagecreatefromgif' => 'Safe\imagecreatefromgif', + 'imagecreatefromjpeg' => 'Safe\imagecreatefromjpeg', + 'imagecreatefrompng' => 'Safe\imagecreatefrompng', + 'imagecreatefromstring' => 'Safe\imagecreatefromstring', + 'imagecreatefromtga' => 'Safe\imagecreatefromtga', + 'imagecreatefromwbmp' => 'Safe\imagecreatefromwbmp', + 'imagecreatefromwebp' => 'Safe\imagecreatefromwebp', + 'imagecreatefromxbm' => 'Safe\imagecreatefromxbm', + 'imagecreatefromxpm' => 'Safe\imagecreatefromxpm', + 'imagecreatetruecolor' => 'Safe\imagecreatetruecolor', + 'imagecrop' => 'Safe\imagecrop', + 'imagecropauto' => 'Safe\imagecropauto', + 'imagedashedline' => 'Safe\imagedashedline', + 'imagedestroy' => 'Safe\imagedestroy', + 'imageellipse' => 'Safe\imageellipse', + 'imagefill' => 'Safe\imagefill', + 'imagefilledarc' => 'Safe\imagefilledarc', + 'imagefilledellipse' => 'Safe\imagefilledellipse', + 'imagefilledrectangle' => 'Safe\imagefilledrectangle', + 'imagefilltoborder' => 'Safe\imagefilltoborder', + 'imagefilter' => 'Safe\imagefilter', + 'imageflip' => 'Safe\imageflip', + 'imageftbbox' => 'Safe\imageftbbox', + 'imagefttext' => 'Safe\imagefttext', + 'imagegammacorrect' => 'Safe\imagegammacorrect', + 'imagegd' => 'Safe\imagegd', + 'imagegd2' => 'Safe\imagegd2', + 'imagegif' => 'Safe\imagegif', + 'imagegrabscreen' => 'Safe\imagegrabscreen', + 'imagegrabwindow' => 'Safe\imagegrabwindow', + 'imagejpeg' => 'Safe\imagejpeg', + 'imagelayereffect' => 'Safe\imagelayereffect', + 'imageline' => 'Safe\imageline', + 'imageloadfont' => 'Safe\imageloadfont', + 'imagepng' => 'Safe\imagepng', + 'imagerectangle' => 'Safe\imagerectangle', + 'imageresolution' => 'Safe\imageresolution', + 'imagerotate' => 'Safe\imagerotate', + 'imagesavealpha' => 'Safe\imagesavealpha', + 'imagescale' => 'Safe\imagescale', + 'imagesetbrush' => 'Safe\imagesetbrush', + 'imagesetclip' => 'Safe\imagesetclip', + 'imagesetinterpolation' => 'Safe\imagesetinterpolation', + 'imagesetpixel' => 'Safe\imagesetpixel', + 'imagesetstyle' => 'Safe\imagesetstyle', + 'imagesetthickness' => 'Safe\imagesetthickness', + 'imagesettile' => 'Safe\imagesettile', + 'imagestring' => 'Safe\imagestring', + 'imagestringup' => 'Safe\imagestringup', + 'imagesx' => 'Safe\imagesx', + 'imagesy' => 'Safe\imagesy', + 'imagetruecolortopalette' => 'Safe\imagetruecolortopalette', + 'imagettfbbox' => 'Safe\imagettfbbox', + 'imagettftext' => 'Safe\imagettftext', + 'imagewbmp' => 'Safe\imagewbmp', + 'imagewebp' => 'Safe\imagewebp', + 'imagexbm' => 'Safe\imagexbm', + 'image_type_to_extension' => 'Safe\image_type_to_extension', + 'imap_8bit' => 'Safe\imap_8bit', + 'imap_append' => 'Safe\imap_append', + 'imap_base64' => 'Safe\imap_base64', + 'imap_binary' => 'Safe\imap_binary', + 'imap_body' => 'Safe\imap_body', + 'imap_bodystruct' => 'Safe\imap_bodystruct', + 'imap_check' => 'Safe\imap_check', + 'imap_clearflag_full' => 'Safe\imap_clearflag_full', + 'imap_close' => 'Safe\imap_close', + 'imap_createmailbox' => 'Safe\imap_createmailbox', + 'imap_deletemailbox' => 'Safe\imap_deletemailbox', + 'imap_fetchbody' => 'Safe\imap_fetchbody', + 'imap_fetchheader' => 'Safe\imap_fetchheader', + 'imap_fetchmime' => 'Safe\imap_fetchmime', + 'imap_fetchstructure' => 'Safe\imap_fetchstructure', + 'imap_fetch_overview' => 'Safe\imap_fetch_overview', + 'imap_gc' => 'Safe\imap_gc', + 'imap_getacl' => 'Safe\imap_getacl', + 'imap_getmailboxes' => 'Safe\imap_getmailboxes', + 'imap_getsubscribed' => 'Safe\imap_getsubscribed', + 'imap_headerinfo' => 'Safe\imap_headerinfo', + 'imap_headers' => 'Safe\imap_headers', + 'imap_listscan' => 'Safe\imap_listscan', + 'imap_lsub' => 'Safe\imap_lsub', + 'imap_mail' => 'Safe\imap_mail', + 'imap_mailboxmsginfo' => 'Safe\imap_mailboxmsginfo', + 'imap_mail_compose' => 'Safe\imap_mail_compose', + 'imap_mail_copy' => 'Safe\imap_mail_copy', + 'imap_mail_move' => 'Safe\imap_mail_move', + 'imap_mime_header_decode' => 'Safe\imap_mime_header_decode', + 'imap_mutf7_to_utf8' => 'Safe\imap_mutf7_to_utf8', + 'imap_num_msg' => 'Safe\imap_num_msg', + 'imap_open' => 'Safe\imap_open', + 'imap_qprint' => 'Safe\imap_qprint', + 'imap_renamemailbox' => 'Safe\imap_renamemailbox', + 'imap_rfc822_write_address' => 'Safe\imap_rfc822_write_address', + 'imap_savebody' => 'Safe\imap_savebody', + 'imap_setacl' => 'Safe\imap_setacl', + 'imap_setflag_full' => 'Safe\imap_setflag_full', + 'imap_set_quota' => 'Safe\imap_set_quota', + 'imap_sort' => 'Safe\imap_sort', + 'imap_status' => 'Safe\imap_status', + 'imap_subscribe' => 'Safe\imap_subscribe', + 'imap_thread' => 'Safe\imap_thread', + 'imap_timeout' => 'Safe\imap_timeout', + 'imap_undelete' => 'Safe\imap_undelete', + 'imap_unsubscribe' => 'Safe\imap_unsubscribe', + 'imap_utf8_to_mutf7' => 'Safe\imap_utf8_to_mutf7', + 'inet_ntop' => 'Safe\inet_ntop', + 'inet_pton' => 'Safe\inet_pton', + 'inflate_add' => 'Safe\inflate_add', + 'inflate_get_read_len' => 'Safe\inflate_get_read_len', + 'inflate_get_status' => 'Safe\inflate_get_status', + 'inflate_init' => 'Safe\inflate_init', + 'ini_get' => 'Safe\ini_get', + 'ini_set' => 'Safe\ini_set', + 'inotify_init' => 'Safe\inotify_init', + 'inotify_rm_watch' => 'Safe\inotify_rm_watch', + 'iptcembed' => 'Safe\iptcembed', + 'iptcparse' => 'Safe\iptcparse', + 'jpeg2wbmp' => 'Safe\jpeg2wbmp', + 'json_decode' => 'Safe\json_decode', + 'json_encode' => 'Safe\json_encode', + 'lchgrp' => 'Safe\lchgrp', + 'lchown' => 'Safe\lchown', + 'ldap_8859_to_t61' => 'Safe\ldap_8859_to_t61', + 'ldap_add' => 'Safe\ldap_add', + 'ldap_bind' => 'Safe\ldap_bind', + 'ldap_control_paged_result' => 'Safe\ldap_control_paged_result', + 'ldap_control_paged_result_response' => 'Safe\ldap_control_paged_result_response', + 'ldap_count_entries' => 'Safe\ldap_count_entries', + 'ldap_delete' => 'Safe\ldap_delete', + 'ldap_dn2ufn' => 'Safe\ldap_dn2ufn', + 'ldap_exop' => 'Safe\ldap_exop', + 'ldap_exop_passwd' => 'Safe\ldap_exop_passwd', + 'ldap_exop_whoami' => 'Safe\ldap_exop_whoami', + 'ldap_explode_dn' => 'Safe\ldap_explode_dn', + 'ldap_first_attribute' => 'Safe\ldap_first_attribute', + 'ldap_first_entry' => 'Safe\ldap_first_entry', + 'ldap_free_result' => 'Safe\ldap_free_result', + 'ldap_get_attributes' => 'Safe\ldap_get_attributes', + 'ldap_get_dn' => 'Safe\ldap_get_dn', + 'ldap_get_entries' => 'Safe\ldap_get_entries', + 'ldap_get_option' => 'Safe\ldap_get_option', + 'ldap_get_values' => 'Safe\ldap_get_values', + 'ldap_get_values_len' => 'Safe\ldap_get_values_len', + 'ldap_modify_batch' => 'Safe\ldap_modify_batch', + 'ldap_mod_add' => 'Safe\ldap_mod_add', + 'ldap_mod_del' => 'Safe\ldap_mod_del', + 'ldap_mod_replace' => 'Safe\ldap_mod_replace', + 'ldap_next_attribute' => 'Safe\ldap_next_attribute', + 'ldap_parse_exop' => 'Safe\ldap_parse_exop', + 'ldap_parse_result' => 'Safe\ldap_parse_result', + 'ldap_rename' => 'Safe\ldap_rename', + 'ldap_sasl_bind' => 'Safe\ldap_sasl_bind', + 'ldap_set_option' => 'Safe\ldap_set_option', + 'ldap_unbind' => 'Safe\ldap_unbind', + 'libxml_get_last_error' => 'Safe\libxml_get_last_error', + 'libxml_set_external_entity_loader' => 'Safe\libxml_set_external_entity_loader', + 'link' => 'Safe\link', + 'long2ip' => 'Safe\long2ip', + 'lstat' => 'Safe\lstat', + 'lzf_compress' => 'Safe\lzf_compress', + 'lzf_decompress' => 'Safe\lzf_decompress', + 'mailparse_msg_extract_part_file' => 'Safe\mailparse_msg_extract_part_file', + 'mailparse_msg_free' => 'Safe\mailparse_msg_free', + 'mailparse_msg_parse' => 'Safe\mailparse_msg_parse', + 'mailparse_msg_parse_file' => 'Safe\mailparse_msg_parse_file', + 'mailparse_stream_encode' => 'Safe\mailparse_stream_encode', + 'mb_chr' => 'Safe\mb_chr', + 'mb_convert_encoding' => 'Safe\mb_convert_encoding', + 'mb_detect_order' => 'Safe\mb_detect_order', + 'mb_encoding_aliases' => 'Safe\mb_encoding_aliases', + 'mb_eregi_replace' => 'Safe\mb_eregi_replace', + 'mb_ereg_replace' => 'Safe\mb_ereg_replace', + 'mb_ereg_replace_callback' => 'Safe\mb_ereg_replace_callback', + 'mb_ereg_search_getregs' => 'Safe\mb_ereg_search_getregs', + 'mb_ereg_search_init' => 'Safe\mb_ereg_search_init', + 'mb_ereg_search_regs' => 'Safe\mb_ereg_search_regs', + 'mb_ereg_search_setpos' => 'Safe\mb_ereg_search_setpos', + 'mb_get_info' => 'Safe\mb_get_info', + 'mb_http_output' => 'Safe\mb_http_output', + 'mb_internal_encoding' => 'Safe\mb_internal_encoding', + 'mb_ord' => 'Safe\mb_ord', + 'mb_parse_str' => 'Safe\mb_parse_str', + 'mb_regex_encoding' => 'Safe\mb_regex_encoding', + 'mb_send_mail' => 'Safe\mb_send_mail', + 'mb_split' => 'Safe\mb_split', + 'md5_file' => 'Safe\md5_file', + 'mime_content_type' => 'Safe\mime_content_type', + 'mkdir' => 'Safe\mkdir', + 'msg_get_queue' => 'Safe\msg_get_queue', + 'msg_queue_exists' => 'Safe\msg_queue_exists', + 'msg_receive' => 'Safe\msg_receive', + 'msg_remove_queue' => 'Safe\msg_remove_queue', + 'msg_send' => 'Safe\msg_send', + 'msg_set_queue' => 'Safe\msg_set_queue', + 'msg_stat_queue' => 'Safe\msg_stat_queue', + 'mysql_close' => 'Safe\mysql_close', + 'mysql_connect' => 'Safe\mysql_connect', + 'mysql_create_db' => 'Safe\mysql_create_db', + 'mysql_data_seek' => 'Safe\mysql_data_seek', + 'mysql_db_name' => 'Safe\mysql_db_name', + 'mysql_db_query' => 'Safe\mysql_db_query', + 'mysql_drop_db' => 'Safe\mysql_drop_db', + 'mysql_fetch_lengths' => 'Safe\mysql_fetch_lengths', + 'mysql_field_flags' => 'Safe\mysql_field_flags', + 'mysql_field_len' => 'Safe\mysql_field_len', + 'mysql_field_name' => 'Safe\mysql_field_name', + 'mysql_field_seek' => 'Safe\mysql_field_seek', + 'mysql_free_result' => 'Safe\mysql_free_result', + 'mysql_get_host_info' => 'Safe\mysql_get_host_info', + 'mysql_get_proto_info' => 'Safe\mysql_get_proto_info', + 'mysql_get_server_info' => 'Safe\mysql_get_server_info', + 'mysql_info' => 'Safe\mysql_info', + 'mysql_list_dbs' => 'Safe\mysql_list_dbs', + 'mysql_list_fields' => 'Safe\mysql_list_fields', + 'mysql_list_processes' => 'Safe\mysql_list_processes', + 'mysql_list_tables' => 'Safe\mysql_list_tables', + 'mysql_num_fields' => 'Safe\mysql_num_fields', + 'mysql_num_rows' => 'Safe\mysql_num_rows', + 'mysql_query' => 'Safe\mysql_query', + 'mysql_real_escape_string' => 'Safe\mysql_real_escape_string', + 'mysql_result' => 'Safe\mysql_result', + 'mysql_select_db' => 'Safe\mysql_select_db', + 'mysql_set_charset' => 'Safe\mysql_set_charset', + 'mysql_tablename' => 'Safe\mysql_tablename', + 'mysql_thread_id' => 'Safe\mysql_thread_id', + 'mysql_unbuffered_query' => 'Safe\mysql_unbuffered_query', + 'net_get_interfaces' => 'Safe\net_get_interfaces', + 'ob_clean' => 'Safe\ob_clean', + 'ob_end_clean' => 'Safe\ob_end_clean', + 'ob_end_flush' => 'Safe\ob_end_flush', + 'ob_flush' => 'Safe\ob_flush', + 'ob_start' => 'Safe\ob_start', + 'oci_bind_array_by_name' => 'Safe\oci_bind_array_by_name', + 'oci_bind_by_name' => 'Safe\oci_bind_by_name', + 'oci_cancel' => 'Safe\oci_cancel', + 'oci_commit' => 'Safe\oci_commit', + 'oci_connect' => 'Safe\oci_connect', + 'oci_define_by_name' => 'Safe\oci_define_by_name', + 'oci_execute' => 'Safe\oci_execute', + 'oci_field_name' => 'Safe\oci_field_name', + 'oci_field_precision' => 'Safe\oci_field_precision', + 'oci_field_scale' => 'Safe\oci_field_scale', + 'oci_field_size' => 'Safe\oci_field_size', + 'oci_field_type' => 'Safe\oci_field_type', + 'oci_field_type_raw' => 'Safe\oci_field_type_raw', + 'oci_free_descriptor' => 'Safe\oci_free_descriptor', + 'oci_free_statement' => 'Safe\oci_free_statement', + 'oci_new_collection' => 'Safe\oci_new_collection', + 'oci_new_connect' => 'Safe\oci_new_connect', + 'oci_new_cursor' => 'Safe\oci_new_cursor', + 'oci_new_descriptor' => 'Safe\oci_new_descriptor', + 'oci_num_rows' => 'Safe\oci_num_rows', + 'oci_parse' => 'Safe\oci_parse', + 'oci_pconnect' => 'Safe\oci_pconnect', + 'oci_register_taf_callback' => 'Safe\oci_register_taf_callback', + 'oci_result' => 'Safe\oci_result', + 'oci_rollback' => 'Safe\oci_rollback', + 'oci_server_version' => 'Safe\oci_server_version', + 'oci_set_action' => 'Safe\oci_set_action', + 'oci_set_call_timeout' => 'Safe\oci_set_call_timeout', + 'oci_set_client_identifier' => 'Safe\oci_set_client_identifier', + 'oci_set_client_info' => 'Safe\oci_set_client_info', + 'oci_set_db_operation' => 'Safe\oci_set_db_operation', + 'oci_set_edition' => 'Safe\oci_set_edition', + 'oci_set_module_name' => 'Safe\oci_set_module_name', + 'oci_set_prefetch' => 'Safe\oci_set_prefetch', + 'oci_set_prefetch_lob' => 'Safe\oci_set_prefetch_lob', + 'oci_statement_type' => 'Safe\oci_statement_type', + 'oci_unregister_taf_callback' => 'Safe\oci_unregister_taf_callback', + 'odbc_autocommit' => 'Safe\odbc_autocommit', + 'odbc_binmode' => 'Safe\odbc_binmode', + 'odbc_columnprivileges' => 'Safe\odbc_columnprivileges', + 'odbc_columns' => 'Safe\odbc_columns', + 'odbc_commit' => 'Safe\odbc_commit', + 'odbc_connect' => 'Safe\odbc_connect', + 'odbc_cursor' => 'Safe\odbc_cursor', + 'odbc_data_source' => 'Safe\odbc_data_source', + 'odbc_exec' => 'Safe\odbc_exec', + 'odbc_execute' => 'Safe\odbc_execute', + 'odbc_fetch_into' => 'Safe\odbc_fetch_into', + 'odbc_field_len' => 'Safe\odbc_field_len', + 'odbc_field_name' => 'Safe\odbc_field_name', + 'odbc_field_num' => 'Safe\odbc_field_num', + 'odbc_field_scale' => 'Safe\odbc_field_scale', + 'odbc_field_type' => 'Safe\odbc_field_type', + 'odbc_foreignkeys' => 'Safe\odbc_foreignkeys', + 'odbc_gettypeinfo' => 'Safe\odbc_gettypeinfo', + 'odbc_longreadlen' => 'Safe\odbc_longreadlen', + 'odbc_pconnect' => 'Safe\odbc_pconnect', + 'odbc_prepare' => 'Safe\odbc_prepare', + 'odbc_primarykeys' => 'Safe\odbc_primarykeys', + 'odbc_procedurecolumns' => 'Safe\odbc_procedurecolumns', + 'odbc_procedures' => 'Safe\odbc_procedures', + 'odbc_result' => 'Safe\odbc_result', + 'odbc_result_all' => 'Safe\odbc_result_all', + 'odbc_rollback' => 'Safe\odbc_rollback', + 'odbc_setoption' => 'Safe\odbc_setoption', + 'odbc_specialcolumns' => 'Safe\odbc_specialcolumns', + 'odbc_statistics' => 'Safe\odbc_statistics', + 'odbc_tableprivileges' => 'Safe\odbc_tableprivileges', + 'odbc_tables' => 'Safe\odbc_tables', + 'opcache_compile_file' => 'Safe\opcache_compile_file', + 'opcache_get_status' => 'Safe\opcache_get_status', + 'opendir' => 'Safe\opendir', + 'openlog' => 'Safe\openlog', + 'openssl_cipher_iv_length' => 'Safe\openssl_cipher_iv_length', + 'openssl_cipher_key_length' => 'Safe\openssl_cipher_key_length', + 'openssl_cms_decrypt' => 'Safe\openssl_cms_decrypt', + 'openssl_cms_encrypt' => 'Safe\openssl_cms_encrypt', + 'openssl_cms_read' => 'Safe\openssl_cms_read', + 'openssl_cms_sign' => 'Safe\openssl_cms_sign', + 'openssl_cms_verify' => 'Safe\openssl_cms_verify', + 'openssl_csr_export' => 'Safe\openssl_csr_export', + 'openssl_csr_export_to_file' => 'Safe\openssl_csr_export_to_file', + 'openssl_csr_get_public_key' => 'Safe\openssl_csr_get_public_key', + 'openssl_csr_get_subject' => 'Safe\openssl_csr_get_subject', + 'openssl_csr_new' => 'Safe\openssl_csr_new', + 'openssl_csr_sign' => 'Safe\openssl_csr_sign', + 'openssl_decrypt' => 'Safe\openssl_decrypt', + 'openssl_dh_compute_key' => 'Safe\openssl_dh_compute_key', + 'openssl_digest' => 'Safe\openssl_digest', + 'openssl_encrypt' => 'Safe\openssl_encrypt', + 'openssl_get_curve_names' => 'Safe\openssl_get_curve_names', + 'openssl_open' => 'Safe\openssl_open', + 'openssl_pbkdf2' => 'Safe\openssl_pbkdf2', + 'openssl_pkcs7_decrypt' => 'Safe\openssl_pkcs7_decrypt', + 'openssl_pkcs7_encrypt' => 'Safe\openssl_pkcs7_encrypt', + 'openssl_pkcs7_read' => 'Safe\openssl_pkcs7_read', + 'openssl_pkcs7_sign' => 'Safe\openssl_pkcs7_sign', + 'openssl_pkcs12_export' => 'Safe\openssl_pkcs12_export', + 'openssl_pkcs12_export_to_file' => 'Safe\openssl_pkcs12_export_to_file', + 'openssl_pkcs12_read' => 'Safe\openssl_pkcs12_read', + 'openssl_pkey_derive' => 'Safe\openssl_pkey_derive', + 'openssl_pkey_export' => 'Safe\openssl_pkey_export', + 'openssl_pkey_export_to_file' => 'Safe\openssl_pkey_export_to_file', + 'openssl_pkey_get_private' => 'Safe\openssl_pkey_get_private', + 'openssl_pkey_get_public' => 'Safe\openssl_pkey_get_public', + 'openssl_pkey_new' => 'Safe\openssl_pkey_new', + 'openssl_private_decrypt' => 'Safe\openssl_private_decrypt', + 'openssl_private_encrypt' => 'Safe\openssl_private_encrypt', + 'openssl_public_decrypt' => 'Safe\openssl_public_decrypt', + 'openssl_public_encrypt' => 'Safe\openssl_public_encrypt', + 'openssl_seal' => 'Safe\openssl_seal', + 'openssl_sign' => 'Safe\openssl_sign', + 'openssl_spki_export' => 'Safe\openssl_spki_export', + 'openssl_spki_export_challenge' => 'Safe\openssl_spki_export_challenge', + 'openssl_spki_new' => 'Safe\openssl_spki_new', + 'openssl_spki_verify' => 'Safe\openssl_spki_verify', + 'openssl_verify' => 'Safe\openssl_verify', + 'openssl_x509_export' => 'Safe\openssl_x509_export', + 'openssl_x509_export_to_file' => 'Safe\openssl_x509_export_to_file', + 'openssl_x509_fingerprint' => 'Safe\openssl_x509_fingerprint', + 'openssl_x509_read' => 'Safe\openssl_x509_read', + 'output_add_rewrite_var' => 'Safe\output_add_rewrite_var', + 'output_reset_rewrite_vars' => 'Safe\output_reset_rewrite_vars', + 'pack' => 'Safe\pack', + 'parse_ini_file' => 'Safe\parse_ini_file', + 'parse_ini_string' => 'Safe\parse_ini_string', + 'parse_url' => 'Safe\parse_url', + 'passthru' => 'Safe\passthru', + 'pcntl_getpriority' => 'Safe\pcntl_getpriority', + 'pcntl_setpriority' => 'Safe\pcntl_setpriority', + 'pcntl_signal' => 'Safe\pcntl_signal', + 'pcntl_signal_dispatch' => 'Safe\pcntl_signal_dispatch', + 'pcntl_sigprocmask' => 'Safe\pcntl_sigprocmask', + 'pcntl_sigtimedwait' => 'Safe\pcntl_sigtimedwait', + 'pcntl_sigwaitinfo' => 'Safe\pcntl_sigwaitinfo', + 'pfsockopen' => 'Safe\pfsockopen', + 'pg_cancel_query' => 'Safe\pg_cancel_query', + 'pg_connect' => 'Safe\pg_connect', + 'pg_connection_reset' => 'Safe\pg_connection_reset', + 'pg_convert' => 'Safe\pg_convert', + 'pg_copy_from' => 'Safe\pg_copy_from', + 'pg_copy_to' => 'Safe\pg_copy_to', + 'pg_delete' => 'Safe\pg_delete', + 'pg_end_copy' => 'Safe\pg_end_copy', + 'pg_execute' => 'Safe\pg_execute', + 'pg_field_table' => 'Safe\pg_field_table', + 'pg_flush' => 'Safe\pg_flush', + 'pg_free_result' => 'Safe\pg_free_result', + 'pg_host' => 'Safe\pg_host', + 'pg_insert' => 'Safe\pg_insert', + 'pg_last_oid' => 'Safe\pg_last_oid', + 'pg_lo_close' => 'Safe\pg_lo_close', + 'pg_lo_export' => 'Safe\pg_lo_export', + 'pg_lo_import' => 'Safe\pg_lo_import', + 'pg_lo_open' => 'Safe\pg_lo_open', + 'pg_lo_read' => 'Safe\pg_lo_read', + 'pg_lo_seek' => 'Safe\pg_lo_seek', + 'pg_lo_truncate' => 'Safe\pg_lo_truncate', + 'pg_lo_unlink' => 'Safe\pg_lo_unlink', + 'pg_lo_write' => 'Safe\pg_lo_write', + 'pg_meta_data' => 'Safe\pg_meta_data', + 'pg_parameter_status' => 'Safe\pg_parameter_status', + 'pg_pconnect' => 'Safe\pg_pconnect', + 'pg_ping' => 'Safe\pg_ping', + 'pg_prepare' => 'Safe\pg_prepare', + 'pg_put_line' => 'Safe\pg_put_line', + 'pg_query' => 'Safe\pg_query', + 'pg_query_params' => 'Safe\pg_query_params', + 'pg_result_error_field' => 'Safe\pg_result_error_field', + 'pg_result_seek' => 'Safe\pg_result_seek', + 'pg_select' => 'Safe\pg_select', + 'pg_socket' => 'Safe\pg_socket', + 'pg_trace' => 'Safe\pg_trace', + 'pg_update' => 'Safe\pg_update', + 'phpcredits' => 'Safe\phpcredits', + 'phpinfo' => 'Safe\phpinfo', + 'php_sapi_name' => 'Safe\php_sapi_name', + 'png2wbmp' => 'Safe\png2wbmp', + 'posix_access' => 'Safe\posix_access', + 'posix_getgrgid' => 'Safe\posix_getgrgid', + 'posix_getgrnam' => 'Safe\posix_getgrnam', + 'posix_getgroups' => 'Safe\posix_getgroups', + 'posix_getlogin' => 'Safe\posix_getlogin', + 'posix_getpwuid' => 'Safe\posix_getpwuid', + 'posix_getrlimit' => 'Safe\posix_getrlimit', + 'posix_getsid' => 'Safe\posix_getsid', + 'posix_initgroups' => 'Safe\posix_initgroups', + 'posix_kill' => 'Safe\posix_kill', + 'posix_mkfifo' => 'Safe\posix_mkfifo', + 'posix_mknod' => 'Safe\posix_mknod', + 'posix_setegid' => 'Safe\posix_setegid', + 'posix_seteuid' => 'Safe\posix_seteuid', + 'posix_setgid' => 'Safe\posix_setgid', + 'posix_setpgid' => 'Safe\posix_setpgid', + 'posix_setrlimit' => 'Safe\posix_setrlimit', + 'posix_setuid' => 'Safe\posix_setuid', + 'posix_times' => 'Safe\posix_times', + 'posix_uname' => 'Safe\posix_uname', + 'preg_grep' => 'Safe\preg_grep', + 'preg_match' => 'Safe\preg_match', + 'preg_match_all' => 'Safe\preg_match_all', + 'preg_replace' => 'Safe\preg_replace', + 'preg_split' => 'Safe\preg_split', + 'proc_nice' => 'Safe\proc_nice', + 'pspell_add_to_personal' => 'Safe\pspell_add_to_personal', + 'pspell_add_to_session' => 'Safe\pspell_add_to_session', + 'pspell_clear_session' => 'Safe\pspell_clear_session', + 'pspell_config_create' => 'Safe\pspell_config_create', + 'pspell_config_data_dir' => 'Safe\pspell_config_data_dir', + 'pspell_config_dict_dir' => 'Safe\pspell_config_dict_dir', + 'pspell_config_ignore' => 'Safe\pspell_config_ignore', + 'pspell_config_mode' => 'Safe\pspell_config_mode', + 'pspell_config_personal' => 'Safe\pspell_config_personal', + 'pspell_config_repl' => 'Safe\pspell_config_repl', + 'pspell_config_runtogether' => 'Safe\pspell_config_runtogether', + 'pspell_config_save_repl' => 'Safe\pspell_config_save_repl', + 'pspell_new' => 'Safe\pspell_new', + 'pspell_new_config' => 'Safe\pspell_new_config', + 'pspell_new_personal' => 'Safe\pspell_new_personal', + 'pspell_save_wordlist' => 'Safe\pspell_save_wordlist', + 'pspell_store_replacement' => 'Safe\pspell_store_replacement', + 'ps_add_launchlink' => 'Safe\ps_add_launchlink', + 'ps_add_locallink' => 'Safe\ps_add_locallink', + 'ps_add_note' => 'Safe\ps_add_note', + 'ps_add_pdflink' => 'Safe\ps_add_pdflink', + 'ps_add_weblink' => 'Safe\ps_add_weblink', + 'ps_arc' => 'Safe\ps_arc', + 'ps_arcn' => 'Safe\ps_arcn', + 'ps_begin_page' => 'Safe\ps_begin_page', + 'ps_begin_pattern' => 'Safe\ps_begin_pattern', + 'ps_begin_template' => 'Safe\ps_begin_template', + 'ps_circle' => 'Safe\ps_circle', + 'ps_clip' => 'Safe\ps_clip', + 'ps_close' => 'Safe\ps_close', + 'ps_closepath' => 'Safe\ps_closepath', + 'ps_closepath_stroke' => 'Safe\ps_closepath_stroke', + 'ps_close_image' => 'Safe\ps_close_image', + 'ps_continue_text' => 'Safe\ps_continue_text', + 'ps_curveto' => 'Safe\ps_curveto', + 'ps_delete' => 'Safe\ps_delete', + 'ps_end_page' => 'Safe\ps_end_page', + 'ps_end_pattern' => 'Safe\ps_end_pattern', + 'ps_end_template' => 'Safe\ps_end_template', + 'ps_fill' => 'Safe\ps_fill', + 'ps_fill_stroke' => 'Safe\ps_fill_stroke', + 'ps_get_parameter' => 'Safe\ps_get_parameter', + 'ps_hyphenate' => 'Safe\ps_hyphenate', + 'ps_include_file' => 'Safe\ps_include_file', + 'ps_lineto' => 'Safe\ps_lineto', + 'ps_moveto' => 'Safe\ps_moveto', + 'ps_new' => 'Safe\ps_new', + 'ps_open_file' => 'Safe\ps_open_file', + 'ps_place_image' => 'Safe\ps_place_image', + 'ps_rect' => 'Safe\ps_rect', + 'ps_restore' => 'Safe\ps_restore', + 'ps_rotate' => 'Safe\ps_rotate', + 'ps_save' => 'Safe\ps_save', + 'ps_scale' => 'Safe\ps_scale', + 'ps_setcolor' => 'Safe\ps_setcolor', + 'ps_setdash' => 'Safe\ps_setdash', + 'ps_setflat' => 'Safe\ps_setflat', + 'ps_setfont' => 'Safe\ps_setfont', + 'ps_setgray' => 'Safe\ps_setgray', + 'ps_setlinecap' => 'Safe\ps_setlinecap', + 'ps_setlinejoin' => 'Safe\ps_setlinejoin', + 'ps_setlinewidth' => 'Safe\ps_setlinewidth', + 'ps_setmiterlimit' => 'Safe\ps_setmiterlimit', + 'ps_setoverprintmode' => 'Safe\ps_setoverprintmode', + 'ps_setpolydash' => 'Safe\ps_setpolydash', + 'ps_set_border_color' => 'Safe\ps_set_border_color', + 'ps_set_border_dash' => 'Safe\ps_set_border_dash', + 'ps_set_border_style' => 'Safe\ps_set_border_style', + 'ps_set_info' => 'Safe\ps_set_info', + 'ps_set_parameter' => 'Safe\ps_set_parameter', + 'ps_set_text_pos' => 'Safe\ps_set_text_pos', + 'ps_set_value' => 'Safe\ps_set_value', + 'ps_shading' => 'Safe\ps_shading', + 'ps_shading_pattern' => 'Safe\ps_shading_pattern', + 'ps_shfill' => 'Safe\ps_shfill', + 'ps_show' => 'Safe\ps_show', + 'ps_show2' => 'Safe\ps_show2', + 'ps_show_xy' => 'Safe\ps_show_xy', + 'ps_show_xy2' => 'Safe\ps_show_xy2', + 'ps_stroke' => 'Safe\ps_stroke', + 'ps_symbol' => 'Safe\ps_symbol', + 'ps_translate' => 'Safe\ps_translate', + 'putenv' => 'Safe\putenv', + 'readfile' => 'Safe\readfile', + 'readgzfile' => 'Safe\readgzfile', + 'readline_add_history' => 'Safe\readline_add_history', + 'readline_callback_handler_install' => 'Safe\readline_callback_handler_install', + 'readline_clear_history' => 'Safe\readline_clear_history', + 'readline_completion_function' => 'Safe\readline_completion_function', + 'readline_read_history' => 'Safe\readline_read_history', + 'readline_write_history' => 'Safe\readline_write_history', + 'readlink' => 'Safe\readlink', + 'realpath' => 'Safe\realpath', + 'register_tick_function' => 'Safe\register_tick_function', + 'rename' => 'Safe\rename', + 'rewind' => 'Safe\rewind', + 'rmdir' => 'Safe\rmdir', + 'rnp_decrypt' => 'Safe\rnp_decrypt', + 'rnp_dump_packets' => 'Safe\rnp_dump_packets', + 'rnp_dump_packets_to_json' => 'Safe\rnp_dump_packets_to_json', + 'rnp_ffi_create' => 'Safe\rnp_ffi_create', + 'rnp_ffi_set_pass_provider' => 'Safe\rnp_ffi_set_pass_provider', + 'rnp_import_keys' => 'Safe\rnp_import_keys', + 'rnp_import_signatures' => 'Safe\rnp_import_signatures', + 'rnp_key_export' => 'Safe\rnp_key_export', + 'rnp_key_export_autocrypt' => 'Safe\rnp_key_export_autocrypt', + 'rnp_key_export_revocation' => 'Safe\rnp_key_export_revocation', + 'rnp_key_get_info' => 'Safe\rnp_key_get_info', + 'rnp_key_remove' => 'Safe\rnp_key_remove', + 'rnp_key_revoke' => 'Safe\rnp_key_revoke', + 'rnp_list_keys' => 'Safe\rnp_list_keys', + 'rnp_load_keys' => 'Safe\rnp_load_keys', + 'rnp_load_keys_from_path' => 'Safe\rnp_load_keys_from_path', + 'rnp_locate_key' => 'Safe\rnp_locate_key', + 'rnp_op_encrypt' => 'Safe\rnp_op_encrypt', + 'rnp_op_generate_key' => 'Safe\rnp_op_generate_key', + 'rnp_op_sign' => 'Safe\rnp_op_sign', + 'rnp_op_sign_cleartext' => 'Safe\rnp_op_sign_cleartext', + 'rnp_op_sign_detached' => 'Safe\rnp_op_sign_detached', + 'rnp_op_verify' => 'Safe\rnp_op_verify', + 'rnp_op_verify_detached' => 'Safe\rnp_op_verify_detached', + 'rnp_save_keys' => 'Safe\rnp_save_keys', + 'rnp_save_keys_to_path' => 'Safe\rnp_save_keys_to_path', + 'rnp_supported_features' => 'Safe\rnp_supported_features', + 'rpmaddtag' => 'Safe\rpmaddtag', + 'rrd_create' => 'Safe\rrd_create', + 'rrd_first' => 'Safe\rrd_first', + 'rrd_graph' => 'Safe\rrd_graph', + 'rrd_info' => 'Safe\rrd_info', + 'rrd_lastupdate' => 'Safe\rrd_lastupdate', + 'rrd_restore' => 'Safe\rrd_restore', + 'rrd_tune' => 'Safe\rrd_tune', + 'rrd_update' => 'Safe\rrd_update', + 'rrd_xport' => 'Safe\rrd_xport', + 'sapi_windows_cp_conv' => 'Safe\sapi_windows_cp_conv', + 'sapi_windows_cp_set' => 'Safe\sapi_windows_cp_set', + 'sapi_windows_generate_ctrl_event' => 'Safe\sapi_windows_generate_ctrl_event', + 'sapi_windows_set_ctrl_handler' => 'Safe\sapi_windows_set_ctrl_handler', + 'sapi_windows_vt100_support' => 'Safe\sapi_windows_vt100_support', + 'scandir' => 'Safe\scandir', + 'sem_acquire' => 'Safe\sem_acquire', + 'sem_get' => 'Safe\sem_get', + 'sem_release' => 'Safe\sem_release', + 'sem_remove' => 'Safe\sem_remove', + 'session_abort' => 'Safe\session_abort', + 'session_create_id' => 'Safe\session_create_id', + 'session_decode' => 'Safe\session_decode', + 'session_destroy' => 'Safe\session_destroy', + 'session_encode' => 'Safe\session_encode', + 'session_id' => 'Safe\session_id', + 'session_module_name' => 'Safe\session_module_name', + 'session_name' => 'Safe\session_name', + 'session_regenerate_id' => 'Safe\session_regenerate_id', + 'session_reset' => 'Safe\session_reset', + 'session_save_path' => 'Safe\session_save_path', + 'session_unset' => 'Safe\session_unset', + 'session_write_close' => 'Safe\session_write_close', + 'settype' => 'Safe\settype', + 'set_include_path' => 'Safe\set_include_path', + 'set_time_limit' => 'Safe\set_time_limit', + 'sha1_file' => 'Safe\sha1_file', + 'shell_exec' => 'Safe\shell_exec', + 'shmop_delete' => 'Safe\shmop_delete', + 'shmop_read' => 'Safe\shmop_read', + 'shm_attach' => 'Safe\shm_attach', + 'shm_detach' => 'Safe\shm_detach', + 'shm_put_var' => 'Safe\shm_put_var', + 'shm_remove' => 'Safe\shm_remove', + 'shm_remove_var' => 'Safe\shm_remove_var', + 'shuffle' => 'Safe\shuffle', + 'simplexml_import_dom' => 'Safe\simplexml_import_dom', + 'simplexml_load_file' => 'Safe\simplexml_load_file', + 'simplexml_load_string' => 'Safe\simplexml_load_string', + 'socket_accept' => 'Safe\socket_accept', + 'socket_addrinfo_bind' => 'Safe\socket_addrinfo_bind', + 'socket_addrinfo_connect' => 'Safe\socket_addrinfo_connect', + 'socket_addrinfo_lookup' => 'Safe\socket_addrinfo_lookup', + 'socket_bind' => 'Safe\socket_bind', + 'socket_connect' => 'Safe\socket_connect', + 'socket_create' => 'Safe\socket_create', + 'socket_create_listen' => 'Safe\socket_create_listen', + 'socket_create_pair' => 'Safe\socket_create_pair', + 'socket_export_stream' => 'Safe\socket_export_stream', + 'socket_getpeername' => 'Safe\socket_getpeername', + 'socket_getsockname' => 'Safe\socket_getsockname', + 'socket_get_option' => 'Safe\socket_get_option', + 'socket_import_stream' => 'Safe\socket_import_stream', + 'socket_listen' => 'Safe\socket_listen', + 'socket_read' => 'Safe\socket_read', + 'socket_send' => 'Safe\socket_send', + 'socket_sendmsg' => 'Safe\socket_sendmsg', + 'socket_sendto' => 'Safe\socket_sendto', + 'socket_set_block' => 'Safe\socket_set_block', + 'socket_set_nonblock' => 'Safe\socket_set_nonblock', + 'socket_set_option' => 'Safe\socket_set_option', + 'socket_shutdown' => 'Safe\socket_shutdown', + 'socket_write' => 'Safe\socket_write', + 'socket_wsaprotocol_info_export' => 'Safe\socket_wsaprotocol_info_export', + 'socket_wsaprotocol_info_import' => 'Safe\socket_wsaprotocol_info_import', + 'socket_wsaprotocol_info_release' => 'Safe\socket_wsaprotocol_info_release', + 'sodium_crypto_aead_aes256gcm_decrypt' => 'Safe\sodium_crypto_aead_aes256gcm_decrypt', + 'sodium_crypto_aead_chacha20poly1305_decrypt' => 'Safe\sodium_crypto_aead_chacha20poly1305_decrypt', + 'sodium_crypto_aead_chacha20poly1305_encrypt' => 'Safe\sodium_crypto_aead_chacha20poly1305_encrypt', + 'sodium_crypto_aead_chacha20poly1305_ietf_decrypt' => 'Safe\sodium_crypto_aead_chacha20poly1305_ietf_decrypt', + 'sodium_crypto_aead_chacha20poly1305_ietf_encrypt' => 'Safe\sodium_crypto_aead_chacha20poly1305_ietf_encrypt', + 'sodium_crypto_aead_xchacha20poly1305_ietf_decrypt' => 'Safe\sodium_crypto_aead_xchacha20poly1305_ietf_decrypt', + 'sodium_crypto_aead_xchacha20poly1305_ietf_encrypt' => 'Safe\sodium_crypto_aead_xchacha20poly1305_ietf_encrypt', + 'sodium_crypto_auth_verify' => 'Safe\sodium_crypto_auth_verify', + 'sodium_crypto_box_open' => 'Safe\sodium_crypto_box_open', + 'sodium_crypto_box_seal_open' => 'Safe\sodium_crypto_box_seal_open', + 'sodium_crypto_generichash_update' => 'Safe\sodium_crypto_generichash_update', + 'sodium_crypto_secretbox_open' => 'Safe\sodium_crypto_secretbox_open', + 'sodium_crypto_sign_open' => 'Safe\sodium_crypto_sign_open', + 'sodium_crypto_sign_verify_detached' => 'Safe\sodium_crypto_sign_verify_detached', + 'sodium_crypto_stream_xchacha20_xor_ic' => 'Safe\sodium_crypto_stream_xchacha20_xor_ic', + 'solr_get_version' => 'Safe\solr_get_version', + 'spl_autoload_register' => 'Safe\spl_autoload_register', + 'spl_autoload_unregister' => 'Safe\spl_autoload_unregister', + 'sqlsrv_begin_transaction' => 'Safe\sqlsrv_begin_transaction', + 'sqlsrv_cancel' => 'Safe\sqlsrv_cancel', + 'sqlsrv_client_info' => 'Safe\sqlsrv_client_info', + 'sqlsrv_close' => 'Safe\sqlsrv_close', + 'sqlsrv_commit' => 'Safe\sqlsrv_commit', + 'sqlsrv_configure' => 'Safe\sqlsrv_configure', + 'sqlsrv_execute' => 'Safe\sqlsrv_execute', + 'sqlsrv_free_stmt' => 'Safe\sqlsrv_free_stmt', + 'sqlsrv_get_field' => 'Safe\sqlsrv_get_field', + 'sqlsrv_next_result' => 'Safe\sqlsrv_next_result', + 'sqlsrv_num_fields' => 'Safe\sqlsrv_num_fields', + 'sqlsrv_num_rows' => 'Safe\sqlsrv_num_rows', + 'sqlsrv_prepare' => 'Safe\sqlsrv_prepare', + 'sqlsrv_query' => 'Safe\sqlsrv_query', + 'sqlsrv_rollback' => 'Safe\sqlsrv_rollback', + 'ssdeep_fuzzy_compare' => 'Safe\ssdeep_fuzzy_compare', + 'ssdeep_fuzzy_hash' => 'Safe\ssdeep_fuzzy_hash', + 'ssdeep_fuzzy_hash_filename' => 'Safe\ssdeep_fuzzy_hash_filename', + 'ssh2_auth_agent' => 'Safe\ssh2_auth_agent', + 'ssh2_auth_hostbased_file' => 'Safe\ssh2_auth_hostbased_file', + 'ssh2_auth_password' => 'Safe\ssh2_auth_password', + 'ssh2_auth_pubkey_file' => 'Safe\ssh2_auth_pubkey_file', + 'ssh2_connect' => 'Safe\ssh2_connect', + 'ssh2_disconnect' => 'Safe\ssh2_disconnect', + 'ssh2_exec' => 'Safe\ssh2_exec', + 'ssh2_forward_accept' => 'Safe\ssh2_forward_accept', + 'ssh2_forward_listen' => 'Safe\ssh2_forward_listen', + 'ssh2_publickey_add' => 'Safe\ssh2_publickey_add', + 'ssh2_publickey_init' => 'Safe\ssh2_publickey_init', + 'ssh2_publickey_remove' => 'Safe\ssh2_publickey_remove', + 'ssh2_scp_recv' => 'Safe\ssh2_scp_recv', + 'ssh2_scp_send' => 'Safe\ssh2_scp_send', + 'ssh2_send_eof' => 'Safe\ssh2_send_eof', + 'ssh2_sftp' => 'Safe\ssh2_sftp', + 'ssh2_sftp_chmod' => 'Safe\ssh2_sftp_chmod', + 'ssh2_sftp_mkdir' => 'Safe\ssh2_sftp_mkdir', + 'ssh2_sftp_rename' => 'Safe\ssh2_sftp_rename', + 'ssh2_sftp_rmdir' => 'Safe\ssh2_sftp_rmdir', + 'ssh2_sftp_symlink' => 'Safe\ssh2_sftp_symlink', + 'ssh2_sftp_unlink' => 'Safe\ssh2_sftp_unlink', + 'ssh2_shell' => 'Safe\ssh2_shell', + 'stream_context_set_params' => 'Safe\stream_context_set_params', + 'stream_copy_to_stream' => 'Safe\stream_copy_to_stream', + 'stream_filter_append' => 'Safe\stream_filter_append', + 'stream_filter_prepend' => 'Safe\stream_filter_prepend', + 'stream_filter_register' => 'Safe\stream_filter_register', + 'stream_filter_remove' => 'Safe\stream_filter_remove', + 'stream_get_contents' => 'Safe\stream_get_contents', + 'stream_get_line' => 'Safe\stream_get_line', + 'stream_isatty' => 'Safe\stream_isatty', + 'stream_resolve_include_path' => 'Safe\stream_resolve_include_path', + 'stream_set_blocking' => 'Safe\stream_set_blocking', + 'stream_set_timeout' => 'Safe\stream_set_timeout', + 'stream_socket_accept' => 'Safe\stream_socket_accept', + 'stream_socket_client' => 'Safe\stream_socket_client', + 'stream_socket_get_name' => 'Safe\stream_socket_get_name', + 'stream_socket_pair' => 'Safe\stream_socket_pair', + 'stream_socket_recvfrom' => 'Safe\stream_socket_recvfrom', + 'stream_socket_sendto' => 'Safe\stream_socket_sendto', + 'stream_socket_server' => 'Safe\stream_socket_server', + 'stream_socket_shutdown' => 'Safe\stream_socket_shutdown', + 'stream_supports_lock' => 'Safe\stream_supports_lock', + 'stream_wrapper_register' => 'Safe\stream_wrapper_register', + 'stream_wrapper_restore' => 'Safe\stream_wrapper_restore', + 'stream_wrapper_unregister' => 'Safe\stream_wrapper_unregister', + 'strftime' => 'Safe\strftime', + 'strptime' => 'Safe\strptime', + 'strtotime' => 'Safe\strtotime', + 'swoole_async_dns_lookup' => 'Safe\swoole_async_dns_lookup', + 'swoole_async_readfile' => 'Safe\swoole_async_readfile', + 'swoole_async_write' => 'Safe\swoole_async_write', + 'swoole_async_writefile' => 'Safe\swoole_async_writefile', + 'swoole_event_defer' => 'Safe\swoole_event_defer', + 'swoole_event_del' => 'Safe\swoole_event_del', + 'swoole_event_write' => 'Safe\swoole_event_write', + 'symlink' => 'Safe\symlink', + 'syslog' => 'Safe\syslog', + 'system' => 'Safe\system', + 'tempnam' => 'Safe\tempnam', + 'timezone_name_from_abbr' => 'Safe\timezone_name_from_abbr', + 'time_nanosleep' => 'Safe\time_nanosleep', + 'time_sleep_until' => 'Safe\time_sleep_until', + 'tmpfile' => 'Safe\tmpfile', + 'touch' => 'Safe\touch', + 'unixtojd' => 'Safe\unixtojd', + 'unlink' => 'Safe\unlink', + 'unpack' => 'Safe\unpack', + 'uopz_extend' => 'Safe\uopz_extend', + 'uopz_implement' => 'Safe\uopz_implement', + 'variant_date_to_timestamp' => 'Safe\variant_date_to_timestamp', + 'variant_round' => 'Safe\variant_round', + 'virtual' => 'Safe\virtual', + 'xdiff_file_bdiff' => 'Safe\xdiff_file_bdiff', + 'xdiff_file_bpatch' => 'Safe\xdiff_file_bpatch', + 'xdiff_file_diff' => 'Safe\xdiff_file_diff', + 'xdiff_file_diff_binary' => 'Safe\xdiff_file_diff_binary', + 'xdiff_file_patch_binary' => 'Safe\xdiff_file_patch_binary', + 'xdiff_file_rabdiff' => 'Safe\xdiff_file_rabdiff', + 'xdiff_string_bpatch' => 'Safe\xdiff_string_bpatch', + 'xdiff_string_patch' => 'Safe\xdiff_string_patch', + 'xdiff_string_patch_binary' => 'Safe\xdiff_string_patch_binary', + 'xmlrpc_set_type' => 'Safe\xmlrpc_set_type', + 'xml_parser_free' => 'Safe\xml_parser_free', + 'xml_set_character_data_handler' => 'Safe\xml_set_character_data_handler', + 'xml_set_default_handler' => 'Safe\xml_set_default_handler', + 'xml_set_element_handler' => 'Safe\xml_set_element_handler', + 'xml_set_end_namespace_decl_handler' => 'Safe\xml_set_end_namespace_decl_handler', + 'xml_set_external_entity_ref_handler' => 'Safe\xml_set_external_entity_ref_handler', + 'xml_set_notation_decl_handler' => 'Safe\xml_set_notation_decl_handler', + 'xml_set_object' => 'Safe\xml_set_object', + 'xml_set_processing_instruction_handler' => 'Safe\xml_set_processing_instruction_handler', + 'xml_set_start_namespace_decl_handler' => 'Safe\xml_set_start_namespace_decl_handler', + 'xml_set_unparsed_entity_decl_handler' => 'Safe\xml_set_unparsed_entity_decl_handler', + 'yaml_parse' => 'Safe\yaml_parse', + 'yaml_parse_file' => 'Safe\yaml_parse_file', + 'yaml_parse_url' => 'Safe\yaml_parse_url', + 'yaz_ccl_parse' => 'Safe\yaz_ccl_parse', + 'yaz_close' => 'Safe\yaz_close', + 'yaz_connect' => 'Safe\yaz_connect', + 'yaz_database' => 'Safe\yaz_database', + 'yaz_element' => 'Safe\yaz_element', + 'yaz_present' => 'Safe\yaz_present', + 'yaz_search' => 'Safe\yaz_search', + 'yaz_wait' => 'Safe\yaz_wait', + 'zip_entry_close' => 'Safe\zip_entry_close', + 'zip_entry_compressedsize' => 'Safe\zip_entry_compressedsize', + 'zip_entry_compressionmethod' => 'Safe\zip_entry_compressionmethod', + 'zip_entry_filesize' => 'Safe\zip_entry_filesize', + 'zip_entry_name' => 'Safe\zip_entry_name', + 'zip_entry_open' => 'Safe\zip_entry_open', + 'zip_entry_read' => 'Safe\zip_entry_read', + 'zlib_decode' => 'Safe\zlib_decode', + ] + ); +}; diff --git a/generated/8.3/rnp.php b/generated/8.3/rnp.php new file mode 100644 index 00000000..9b5587b6 --- /dev/null +++ b/generated/8.3/rnp.php @@ -0,0 +1,609 @@ + + * + * + * @param bool $use_include_path Setting use_include_path to TRUE will result + * in PHP trying to open the file along the standard include path as per + * the include_path directive. + * This is used for local files, not URLs. + * @return array Returns an array with all the parsed meta tags. + * + * The value of the name property becomes the key, the value of the content + * property becomes the value of the returned array, so you can easily use + * standard array functions to traverse it or access single values. + * Special characters in the value of the name property are substituted with + * '_', the rest is converted to lower case. If two meta tags have the same + * name, only the last one is returned. + * + * Returns FALSE on failure. + * @throws UrlException + * + */ +function get_meta_tags(string $filename, bool $use_include_path = false): array +{ + error_clear_last(); + $safeResult = \get_meta_tags($filename, $use_include_path); + if ($safeResult === false) { + throw UrlException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * This function parses a URL and returns an associative array containing any + * of the various components of the URL that are present. + * The values of the array elements are not URL decoded. + * + * This function is not meant to validate + * the given URL, it only breaks it up into the parts listed below. Partial and invalid + * URLs are also accepted, parse_url tries its best to + * parse them correctly. + * + * @param string $url The URL to parse. + * @param int $component Specify one of PHP_URL_SCHEME, + * PHP_URL_HOST, PHP_URL_PORT, + * PHP_URL_USER, PHP_URL_PASS, + * PHP_URL_PATH, PHP_URL_QUERY + * or PHP_URL_FRAGMENT to retrieve just a specific + * URL component as a string (except when + * PHP_URL_PORT is given, in which case the return + * value will be an int). + * @return array|int|string|null On seriously malformed URLs, parse_url. + * + * If the component parameter is omitted, an + * associative array is returned. At least one element will be + * present within the array. Potential keys within this array are: + * + * + * + * scheme - e.g. http + * + * + * + * + * host + * + * + * + * + * port + * + * + * + * + * user + * + * + * + * + * pass + * + * + * + * + * path + * + * + * + * + * query - after the question mark ? + * + * + * + * + * fragment - after the hashmark # + * + * + * + * + * If the component parameter is specified, + * parse_url returns a string (or an + * int, in the case of PHP_URL_PORT) + * instead of an array. If the requested component doesn't exist + * within the given URL, NULL will be returned. + * As of PHP 8.0.0, parse_url distinguishes absent and empty + * queries and fragments: + * + * + * + * + * + * + * + * Previously all cases resulted in query and fragment being NULL. + * + * Note that control characters (cf. ctype_cntrl) in the + * components are replaced with underscores (_). + * @throws UrlException + * + */ +function parse_url(string $url, int $component = -1) +{ + error_clear_last(); + $safeResult = \parse_url($url, $component); + if ($safeResult === false) { + throw UrlException::createFromPhpError(); + } + return $safeResult; +} diff --git a/generated/8.3/var.php b/generated/8.3/var.php new file mode 100644 index 00000000..70f048df --- /dev/null +++ b/generated/8.3/var.php @@ -0,0 +1,60 @@ + + * ]]> + * + * See section 4.7 of the XML 1.0 + * spec for the definition of notation declarations. + * + * @param resource $parser A reference to the XML parser to set up notation declaration handler function. + * @param callable $handler handler is a string containing the name of a + * function that must exist when xml_parse is called + * for parser. + * + * The function named by handler must accept + * five parameters: + * + * handler + * XMLParserparser + * stringnotation_name + * stringbase + * stringsystem_id + * stringpublic_id + * + * + * + * + * parser + * + * + * + * The first parameter, parser, is a + * reference to the XML parser calling the handler. + * + * + * + * + * notation_name + * + * + * This is the notation's name, as per + * the notation format described above. + * + * + * + * + * + * base + * + * + * + * This is the base for resolving the system identifier + * (system_id) of the notation declaration. + * Currently this parameter will always be set to an empty string. + * + * + * + * + * system_id + * + * + * System identifier of the external notation declaration. + * + * + * + * + * + * public_id + * + * + * + * Public identifier of the external notation declaration. + * + * + * + * + * + * If a handler function is set to an empty string, or FALSE, the handler + * in question is disabled. + * @throws XmlException + * + */ +function xml_set_notation_decl_handler($parser, callable $handler): void +{ + error_clear_last(); + $safeResult = \xml_set_notation_decl_handler($parser, $handler); + if ($safeResult === false) { + throw XmlException::createFromPhpError(); + } +} + + +/** + * This function allows to use parser inside + * object. All callback functions could be set with + * xml_set_element_handler etc and assumed to be + * methods of object. + * + * @param resource $parser A reference to the XML parser to use inside the object. + * @param object $object The object where to use the XML parser. + * @throws XmlException + * + */ +function xml_set_object($parser, object $object): void +{ + error_clear_last(); + $safeResult = \xml_set_object($parser, $object); + if ($safeResult === false) { + throw XmlException::createFromPhpError(); + } +} + + +/** + * Sets the processing instruction (PI) handler function for the XML parser + * parser. + * + * A processing instruction has the following format: + * + * <?target + * data?> + * + * + * You can put PHP code into such a tag, but be aware of one limitation: in + * an XML PI, the PI end tag (?>) can not be quoted, + * so this character sequence should not appear in the PHP code you embed + * with PIs in XML documents.If it does, the rest of the PHP code, as well + * as the "real" PI end tag, will be treated as character data. + * + * @param resource $parser A reference to the XML parser to set up processing instruction (PI) handler function. + * @param callable $handler handler is a string containing the name of a + * function that must exist when xml_parse is called + * for parser. + * + * The function named by handler must accept + * three parameters: + * + * handler + * XMLParserparser + * stringtarget + * stringdata + * + * + * + * parser + * + * + * The first parameter, parser, is a + * reference to the XML parser calling the handler. + * + * + * + * + * target + * + * + * The second parameter, target, contains the PI + * target. + * + * + * + * + * data + * + * + * The third parameter, data, contains the PI + * data. + * + * + * + * + * + * If a handler function is set to an empty string, or FALSE, the handler + * in question is disabled. + * @throws XmlException + * + */ +function xml_set_processing_instruction_handler($parser, callable $handler): void +{ + error_clear_last(); + $safeResult = \xml_set_processing_instruction_handler($parser, $handler); + if ($safeResult === false) { + throw XmlException::createFromPhpError(); + } +} + + +/** + * Set a handler to be called when a namespace is declared. Namespace + * declarations occur inside start tags. But the namespace declaration start + * handler is called before the start tag handler for each namespace declared + * in that start tag. + * + * @param resource $parser A reference to the XML parser. + * @param callable $handler handler is a string containing the name of a + * function that must exist when xml_parse is called + * for parser. + * + * The function named by handler must accept + * three parameters, and should return an integer value. If the + * value returned from the handler is FALSE (which it will be if no + * value is returned), the XML parser will stop parsing and + * xml_get_error_code will return + * XML_ERROR_EXTERNAL_ENTITY_HANDLING. + * + * handler + * XMLParserparser + * stringprefix + * stringuri + * + * + * + * parser + * + * + * The first parameter, parser, is a + * reference to the XML parser calling the handler. + * + * + * + * + * prefix + * + * + * The prefix is a string used to reference the namespace within an XML object. + * + * + * + * + * uri + * + * + * Uniform Resource Identifier (URI) of namespace. + * + * + * + * + * + * If a handler function is set to an empty string, or FALSE, the handler + * in question is disabled. + * @throws XmlException + * + */ +function xml_set_start_namespace_decl_handler($parser, callable $handler): void +{ + error_clear_last(); + $safeResult = \xml_set_start_namespace_decl_handler($parser, $handler); + if ($safeResult === false) { + throw XmlException::createFromPhpError(); + } +} + + +/** + * Sets the unparsed entity declaration handler function for the XML parser + * parser. + * + * The handler will be called if the XML parser + * encounters an external entity declaration with an NDATA declaration, like + * the following: + * + * name {publicId | systemId} + * NDATA notationName + * ]]> + * + * + * See section 4.2.2 of + * the XML 1.0 spec for the definition of notation declared + * external entities. + * + * @param resource $parser A reference to the XML parser to set up unparsed entity declaration handler function. + * @param callable $handler handler is a string containing the name of a + * function that must exist when xml_parse is called + * for parser. + * + * The function named by handler must accept six + * parameters: + * + * handler + * XMLParserparser + * stringentity_name + * stringbase + * stringsystem_id + * stringpublic_id + * stringnotation_name + * + * + * + * parser + * + * + * The first parameter, parser, is a + * reference to the XML parser calling the + * handler. + * + * + * + * + * entity_name + * + * + * The name of the entity that is about to be defined. + * + * + * + * + * base + * + * + * This is the base for resolving the system identifier + * (systemId) of the external entity.Currently + * this parameter will always be set to an empty string. + * + * + * + * + * system_id + * + * + * System identifier for the external entity. + * + * + * + * + * public_id + * + * + * Public identifier for the external entity. + * + * + * + * + * notation_name + * + * + * Name of the notation of this entity (see + * xml_set_notation_decl_handler). + * + * + * + * + * + * If a handler function is set to an empty string, or FALSE, the handler + * in question is disabled. + * @throws XmlException + * + */ +function xml_set_unparsed_entity_decl_handler($parser, callable $handler): void +{ + error_clear_last(); + $safeResult = \xml_set_unparsed_entity_decl_handler($parser, $handler); + if ($safeResult === false) { + throw XmlException::createFromPhpError(); + } +} diff --git a/generated/8.3/xmlrpc.php b/generated/8.3/xmlrpc.php new file mode 100644 index 00000000..3a1f5362 --- /dev/null +++ b/generated/8.3/xmlrpc.php @@ -0,0 +1,22 @@ + + * + * + * + * The permissions 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 $permissions): void +{ + error_clear_last(); + $safeResult = \chmod($filename, $permissions); + if ($safeResult === false) { + throw 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 FilesystemException + * + */ +function chown(string $filename, $user): void +{ + error_clear_last(); + $safeResult = \chown($filename, $user); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * Makes a copy of the file from to + * to. + * + * If you wish to move a file, use the rename function. + * + * @param string $from Path to the source file. + * @param string $to The destination path. If to 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 FilesystemException + * + */ +function copy(string $from, string $to, $context = null): void +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \copy($from, $to, $context); + } else { + $safeResult = \copy($from, $to); + } + if ($safeResult === false) { + throw 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 FilesystemException + * + */ +function disk_free_space(string $directory): float +{ + error_clear_last(); + $safeResult = \disk_free_space($directory); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function disk_total_space(string $directory): float +{ + error_clear_last(); + $safeResult = \disk_total_space($directory); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * The file pointed to by stream is closed. + * + * @param resource $stream The file pointer must be valid, and must point to a file successfully + * opened by fopen or fsockopen. + * @throws FilesystemException + * + */ +function fclose($stream): void +{ + error_clear_last(); + $safeResult = \fclose($stream); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * This function synchronizes stream contents to storage media, just like fsync does, + * but it does not synchronize file meta-data. + * Note that this function is only effectively different in POSIX systems. + * In Windows, this function is aliased to fsync. + * + * @param resource $stream 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 FilesystemException + * + */ +function fdatasync($stream): void +{ + error_clear_last(); + $safeResult = \fdatasync($stream); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * This function forces a write of all buffered output to the resource + * pointed to by the file stream. + * + * @param resource $stream 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 FilesystemException + * + */ +function fflush($stream): void +{ + error_clear_last(); + $safeResult = \fflush($stream); + if ($safeResult === false) { + throw 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 length 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 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 $length 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 FilesystemException + * + */ +function file_get_contents(string $filename, bool $use_include_path = false, $context = null, int $offset = 0, ?int $length = null): string +{ + error_clear_last(); + if ($length !== null) { + $safeResult = \file_get_contents($filename, $use_include_path, $context, $offset, $length); + } elseif ($offset !== 0) { + $safeResult = \file_get_contents($filename, $use_include_path, $context, $offset); + } elseif ($context !== null) { + $safeResult = \file_get_contents($filename, $use_include_path, $context); + } else { + $safeResult = \file_get_contents($filename, $use_include_path); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * This function is identical to calling fopen, + * fwrite and fclose successively + * to write data to a file. + * + * If filename does not exist, the file is created. + * Otherwise, the existing file is overwritten, unless the + * FILE_APPEND flag is set. + * + * @param string $filename Path to the file where to write the data. + * @param mixed $data The data to write. Can be either a string, an + * array or a stream resource. + * + * If data is a stream resource, the + * remaining buffer of that stream will be copied to the specified file. + * This is similar with using stream_copy_to_stream. + * + * You can also specify the data parameter as a single + * dimension array. This is equivalent to + * file_put_contents($filename, implode('', $array)). + * @param int $flags The value of flags can be any combination of + * the following flags, joined with the binary OR (|) + * operator. + * + * + * Available flags + * + * + * + * Flag + * Description + * + * + * + * + * + * FILE_USE_INCLUDE_PATH + * + * + * Search for filename in the include directory. + * See include_path for more + * information. + * + * + * + * + * FILE_APPEND + * + * + * If file filename already exists, append + * the data to the file instead of overwriting it. + * + * + * + * + * LOCK_EX + * + * + * Acquire an exclusive lock on the file while proceeding to the + * writing. In other words, a flock call happens + * between the fopen call and the + * fwrite call. This is not identical to an + * fopen call with mode "x". + * + * + * + * + * + * @param resource|null $context A valid context resource created with + * stream_context_create. + * @return int This function returns the number of bytes that were written to the file. + * @throws FilesystemException + * + */ +function file_put_contents(string $filename, $data, int $flags = 0, $context = null): int +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \file_put_contents($filename, $data, $flags, $context); + } else { + $safeResult = \file_put_contents($filename, $data, $flags); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Reads an entire file into an array. + * + * @param string $filename Path to the file. + * @param int $flags The optional parameter flags can be one, or + * more, of the following constants: + * + * + * + * FILE_USE_INCLUDE_PATH + * + * + * + * Search for the file in the include_path. + * + * + * + * + * + * FILE_IGNORE_NEW_LINES + * + * + * + * Omit newline at the end of each array element + * + * + * + * + * + * FILE_SKIP_EMPTY_LINES + * + * + * + * Skip empty lines + * + * + * + * + * + * FILE_NO_DEFAULT_CONTEXT + * + * + * + * Don't use the default context + * + * + * + * + * @param resource $context + * @return array Returns the file in an array. Each element of the array corresponds to a + * line in the file, with the newline still attached. Upon failure, + * file returns FALSE. + * @throws FilesystemException + * + */ +function file(string $filename, int $flags = 0, $context = null): array +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \file($filename, $flags, $context); + } else { + $safeResult = \file($filename, $flags); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * + * + * @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 FilesystemException + * + */ +function fileatime(string $filename): int +{ + error_clear_last(); + $safeResult = \fileatime($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function filectime(string $filename): int +{ + error_clear_last(); + $safeResult = \filectime($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Gets the file inode. + * + * @param string $filename Path to the file. + * @return int Returns the inode number of the file. + * @throws FilesystemException + * + */ +function fileinode(string $filename): int +{ + error_clear_last(); + $safeResult = \fileinode($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function filemtime(string $filename): int +{ + error_clear_last(); + $safeResult = \filemtime($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function fileowner(string $filename): int +{ + error_clear_last(); + $safeResult = \fileowner($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Gets permissions for the given file. + * + * @param string $filename Path to the file. + * @return int Returns the file's permissions as a numeric mode. Lower bits of this mode + * are the same as the permissions expected by chmod, + * however on most platforms the return value will also include information on + * the type of file given as filename. The examples + * below demonstrate how to test the return value for specific permissions and + * file types on POSIX systems, including Linux and macOS. + * + * For local files, the specific return value is that of the + * st_mode member of the structure returned by the C + * library's stat function. Exactly which bits are set + * can vary from platform to platform, and looking up your specific platform's + * documentation is recommended if parsing the non-permission bits of the + * return value is required. + * + * Returns FALSE on failure. + * @throws FilesystemException + * + */ +function fileperms(string $filename): int +{ + error_clear_last(); + $safeResult = \fileperms($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Gets the size for the given file. + * + * @param string $filename Path to the file. + * @return int Returns the size of the file in bytes, or FALSE (and generates an error + * of level E_WARNING) in case of an error. + * @throws FilesystemException + * + */ +function filesize(string $filename): int +{ + error_clear_last(); + $safeResult = \filesize($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * flock allows you to perform a simple reader/writer + * model which can be used on virtually every platform (including most Unix + * derivatives and even Windows). + * + * The lock is released also by fclose, + * or when stream is garbage collected. + * + * PHP supports a portable way of locking complete files in an advisory way + * (which means all accessing programs have to use the same way of locking + * or it will not work). By default, this function will block until the + * requested lock is acquired; this may be controlled with the LOCK_NB option documented below. + * + * @param resource $stream A file system pointer resource + * that is typically created using fopen. + * @param int $operation operation is one of the following: + * + * + * + * LOCK_SH to acquire a shared lock (reader). + * + * + * + * + * LOCK_EX to acquire an exclusive lock (writer). + * + * + * + * + * LOCK_UN to release a lock (shared or exclusive). + * + * + * + * + * It is also possible to add LOCK_NB as a bitmask to one + * of the above operations, if flock should not + * block during the locking attempt. + * @param int|null $would_block The optional third argument is set to 1 if the lock would block + * (EWOULDBLOCK errno condition). + * @throws FilesystemException + * + */ +function flock($stream, int $operation, ?int &$would_block = null): void +{ + error_clear_last(); + $safeResult = \flock($stream, $operation, $would_block); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * 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 + * 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; otherwise it has the + * same behavior as 'w'. + * + * + * + * '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 (Mac OS Classic) used + * \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 is 'b'. + * You can 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 old versions of notepad. You + * should use the 'b' in all other cases. + * + * If you specify the 't' 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 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 TRUE if you want to search for the file in the + * include_path, too. + * @param resource|null $context A context stream + * resource. + * @return resource Returns a file pointer resource on success + * @throws FilesystemException + * + */ +function fopen(string $filename, string $mode, bool $use_include_path = false, $context = null) +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \fopen($filename, $mode, $use_include_path, $context); + } else { + $safeResult = \fopen($filename, $mode, $use_include_path); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * fread reads up to + * length bytes from the file pointer + * referenced by stream. 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 $stream 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 FilesystemException + * + */ +function fread($stream, int $length): string +{ + error_clear_last(); + $safeResult = \fread($stream, $length); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Gathers the statistics of the file opened by the file + * pointer stream. This function is similar to the + * stat function except that it operates + * on an open file pointer instead of a filename. + * + * @param resource $stream A file system pointer resource + * that is typically created using fopen. + * @return array Returns an array with the statistics of the file; the format of the array + * is described in detail on the stat manual page. + * Returns FALSE on failure. + * @throws FilesystemException + * + */ +function fstat($stream): array +{ + error_clear_last(); + $safeResult = \fstat($stream); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * This function synchronizes changes to the file, including its meta-data. This is similar to fflush, + * but it also instructs the operating system to write to the storage media. + * + * @param resource $stream 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 FilesystemException + * + */ +function fsync($stream): void +{ + error_clear_last(); + $safeResult = \fsync($stream); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * Takes the filepointer, stream, and truncates the file to + * length, size. + * + * @param resource $stream The file pointer. + * + * The stream 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 FilesystemException + * + */ +function ftruncate($stream, int $size): void +{ + error_clear_last(); + $safeResult = \ftruncate($stream, $size); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * + * + * @param resource $stream A file system pointer resource + * that is typically created using fopen. + * @param string $data The string that is to be written. + * @param int $length If length is an integer, writing will stop + * after length bytes have been written or the + * end of data is reached, whichever comes first. + * @return int + * @throws FilesystemException + * + */ +function fwrite($stream, string $data, ?int $length = null): int +{ + error_clear_last(); + if ($length !== null) { + $safeResult = \fwrite($stream, $data, $length); + } else { + $safeResult = \fwrite($stream, $data); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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. + * + * Special characters: + * + * + * + * * - Matches zero or more characters. + * + * + * + * + * ? - Matches exactly one character (any character). + * + * + * + * + * [...] - Matches one character from a group of + * characters. If the first character is !, + * matches any character not in the group. + * + * + * + * + * \ - Escapes the following character, + * except when the GLOB_NOESCAPE flag is used. + * + * + * + * @param int $flags Any of the GLOB_* constants. + * @return array Returns an array containing the matched files/directories, an empty array + * if no file matched. + * Unless GLOB_NOSORT was used, the names will + * be sorted alphanumerically. + * @throws FilesystemException + * + */ +function glob(string $pattern, int $flags = 0): array +{ + error_clear_last(); + $safeResult = \glob($pattern, $flags); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function lchgrp(string $filename, $group): void +{ + error_clear_last(); + $safeResult = \lchgrp($filename, $group); + if ($safeResult === false) { + throw 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 FilesystemException + * + */ +function lchown(string $filename, $user): void +{ + error_clear_last(); + $safeResult = \lchown($filename, $user); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * link creates a hard link. + * + * @param string $target Target of the link. + * @param string $link The link name. + * @throws FilesystemException + * + */ +function link(string $target, string $link): void +{ + error_clear_last(); + $safeResult = \link($target, $link); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * Gathers the statistics of the file or symbolic link named by + * filename. + * + * @param string $filename Path to a file or a symbolic link. + * @return array See the manual page for stat for information on + * the structure of the array that lstat returns. + * This function is identical to the stat function + * except that if the filename parameter is a symbolic + * link, the status of the symbolic link is returned, not the status of the + * file pointed to by the symbolic link. + * + * On failure, FALSE is returned. + * @throws FilesystemException + * + */ +function lstat(string $filename): array +{ + error_clear_last(); + $safeResult = \lstat($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Attempts to create the directory specified by directory. + * + * @param string $directory The directory path. + * A URL can be used as a + * filename with this function if the fopen wrappers have been enabled. + * See fopen for more details on how to specify the + * filename. See the for links to information + * about what abilities the various wrappers have, notes on their usage, + * and information on any predefined variables they may + * provide. + * @param int $permissions The permissions are 0777 by default, which means the widest possible + * access. For more information on permissions, read the details + * on the chmod page. + * + * permissions is ignored on Windows. + * + * Note that you probably want to specify the permissions as an octal number, + * which means it should have a leading zero. The permissions is also modified + * by the current umask, which you can change using + * umask. + * @param bool $recursive If TRUE, then any parent directories to the directory specified will + * also be created, with the same permissions. + * @param resource $context A context stream + * resource. + * @throws FilesystemException + * + */ +function mkdir(string $directory, int $permissions = 0777, bool $recursive = false, $context = null): void +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \mkdir($directory, $permissions, $recursive, $context); + } else { + $safeResult = \mkdir($directory, $permissions, $recursive); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * parse_ini_file loads in the + * ini file specified in filename, + * and returns the settings in it in an associative array. + * + * The structure of the ini file is the same as the php.ini's. + * + * @param string $filename The filename of the ini file being parsed. If a relative path is used, + * it is evaluated relative to the current working directory, then the + * include_path. + * @param bool $process_sections By setting the process_sections + * parameter to TRUE, you get a multidimensional array, with + * the section names and settings included. The default + * for process_sections is FALSE + * @param int $scanner_mode Can either be INI_SCANNER_NORMAL (default) or + * INI_SCANNER_RAW. If INI_SCANNER_RAW + * is supplied, then option values will not be parsed. + * + * + * As of PHP 5.6.1 can also be specified as INI_SCANNER_TYPED. + * In this mode boolean, null and integer types are preserved when possible. + * String values "true", "on" and "yes" + * are converted to TRUE. "false", "off", "no" + * and "none" are considered FALSE. "null" is converted to NULL + * in typed mode. Also, all numeric strings are converted to integer type if it is possible. + * @return array The settings are returned as an associative array on success. + * @throws FilesystemException + * + */ +function parse_ini_file(string $filename, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array +{ + error_clear_last(); + $safeResult = \parse_ini_file($filename, $process_sections, $scanner_mode); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * parse_ini_string returns the settings in string + * ini_string in an associative array. + * + * The structure of the ini string is the same as the php.ini's. + * + * @param string $ini_string The contents of the ini file being parsed. + * @param bool $process_sections By setting the process_sections + * parameter to TRUE, you get a multidimensional array, with + * the section names and settings included. The default + * for process_sections is FALSE + * @param int $scanner_mode Can either be INI_SCANNER_NORMAL (default) or + * INI_SCANNER_RAW. If INI_SCANNER_RAW + * is supplied, then option values will not be parsed. + * + * + * As of PHP 5.6.1 can also be specified as INI_SCANNER_TYPED. + * In this mode boolean, null and integer types are preserved when possible. + * String values "true", "on" and "yes" + * are converted to TRUE. "false", "off", "no" + * and "none" are considered FALSE. "null" is converted to NULL + * in typed mode. Also, all numeric strings are converted to integer type if it is possible. + * @return array The settings are returned as an associative array on success. + * @throws FilesystemException + * + */ +function parse_ini_string(string $ini_string, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array +{ + error_clear_last(); + $safeResult = \parse_ini_string($ini_string, $process_sections, $scanner_mode); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Reads a file and writes it to the output buffer. + * + * @param string $filename The filename being read. + * @param bool $use_include_path You can use the optional second parameter and set it to TRUE, if + * you want to search for the file in the include_path, too. + * @param resource $context A context stream + * resource. + * @return int Returns the number of bytes read from the file on success + * @throws FilesystemException + * + */ +function readfile(string $filename, bool $use_include_path = false, $context = null): int +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \readfile($filename, $use_include_path, $context); + } else { + $safeResult = \readfile($filename, $use_include_path); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function readlink(string $path): string +{ + error_clear_last(); + $safeResult = \readlink($path); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * realpath expands all symbolic links and + * resolves references to /./, /../ and extra / characters in + * the input path and returns the canonicalized + * absolute pathname. + * + * @param string $path The path being checked. + * + * + * Whilst a path must be supplied, the value can be an empty string. + * In this case, the value is interpreted as the current directory. + * + * + * + * Whilst a path must be supplied, the value can be an empty string. + * In this case, the value is interpreted as the current directory. + * @return string Returns the canonicalized absolute pathname on success. The resulting path + * will have no symbolic link, /./ or /../ components. Trailing delimiters, + * such as \ and /, are also removed. + * + * realpath returns FALSE on failure, e.g. if + * the file does not exist. + * @throws FilesystemException + * + */ +function realpath(string $path): string +{ + error_clear_last(); + $safeResult = \realpath($path); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Attempts to rename from to + * to, moving it between directories if necessary. + * If renaming a file and to exists, + * it will be overwritten. If renaming a directory and + * to exists, + * this function will emit a warning. + * + * @param string $from The old name. + * + * The wrapper used in from + * must match the wrapper used in + * to. + * @param string $to The new name. + * + * + * On Windows, if to already exists, it must be writable. + * Otherwise rename fails and issues E_WARNING. + * + * + * @param resource $context A context stream + * resource. + * @throws FilesystemException + * + */ +function rename(string $from, string $to, $context = null): void +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \rename($from, $to, $context); + } else { + $safeResult = \rename($from, $to); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * Sets the file position indicator for stream + * to the beginning of the file stream. + * + * @param resource $stream The file pointer must be valid, and must point to a file + * successfully opened by fopen. + * @throws FilesystemException + * + */ +function rewind($stream): void +{ + error_clear_last(); + $safeResult = \rewind($stream); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * Attempts to remove the directory named by directory. + * The directory must be empty, and the relevant permissions must permit this. + * A E_WARNING level error will be generated on failure. + * + * @param string $directory Path to the directory. + * @param resource $context A context stream + * resource. + * @throws FilesystemException + * + */ +function rmdir(string $directory, $context = null): void +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \rmdir($directory, $context); + } else { + $safeResult = \rmdir($directory); + } + if ($safeResult === false) { + throw 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 FilesystemException + * + */ +function symlink(string $target, string $link): void +{ + error_clear_last(); + $safeResult = \symlink($target, $link); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * Creates a file with a unique filename, with access permission set to 0600, in the specified directory. + * If the directory does not exist or is not writable, tempnam may + * generate a file in the system's temporary directory, and return + * the full path to that file, including its name. + * + * @param string $directory The directory where the temporary filename will be created. + * @param string $prefix The prefix of the generated temporary filename. + * @return string Returns the new temporary filename (with path). + * @throws FilesystemException + * + */ +function tempnam(string $directory, string $prefix): string +{ + error_clear_last(); + $safeResult = \tempnam($directory, $prefix); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Creates a temporary file with a unique name in read-write-binary (w+b) mode and + * returns a file handle. + * + * The file is automatically removed when closed (for example, by calling + * fclose, or when there are no remaining references to + * the file handle returned by tmpfile), or when the + * script ends. + * + * @return resource|false Returns a file handle, similar to the one returned by + * fopen, for the new file. + * @throws FilesystemException + * + */ +function tmpfile() +{ + error_clear_last(); + $safeResult = \tmpfile(); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Attempts to set the access and modification times of the file named in the + * filename parameter to the value given in + * mtime. + * 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 $mtime The touch time. If mtime is NULL, + * the current system time is used. + * @param int $atime If not NULL, the access time of the given filename is set to + * the value of atime. Otherwise, it is set to + * the value passed to the mtime parameter. + * If both are NULL, the current system time is used. + * @throws FilesystemException + * + */ +function touch(string $filename, ?int $mtime = null, ?int $atime = null): void +{ + error_clear_last(); + if ($atime !== null) { + $safeResult = \touch($filename, $mtime, $atime); + } elseif ($mtime !== null) { + $safeResult = \touch($filename, $mtime); + } else { + $safeResult = \touch($filename); + } + if ($safeResult === false) { + throw 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. + * + * If the file is a symlink, the symlink will be deleted. On Windows, to delete + * a symlink to a directory, rmdir has to be used instead. + * @param resource $context A context stream + * resource. + * @throws FilesystemException + * + */ +function unlink(string $filename, $context = null): void +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \unlink($filename, $context); + } else { + $safeResult = \unlink($filename); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} diff --git a/generated/8.4/filter.php b/generated/8.4/filter.php new file mode 100644 index 00000000..3963e269 --- /dev/null +++ b/generated/8.4/filter.php @@ -0,0 +1,48 @@ + + * + * + * + * channels will be 3 for RGB pictures and 4 for CMYK + * pictures. + * + * bits is the number of bits for each color. + * + * For some image types, the presence of channels and + * bits values can be a bit + * confusing. As an example, GIF always uses 3 channels + * per pixel, but the number of bits per pixel cannot be calculated for an + * animated GIF with a global color table. + * + * On failure, FALSE is returned. + * @throws ImageException + * + */ +function getimagesize(string $filename, ?array &$image_info = null): ?array +{ + error_clear_last(); + $safeResult = \getimagesize($filename, $image_info); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Returns the extension for the given IMAGETYPE_* + * constant. + * + * @param int $image_type One of the IMAGETYPE_* constant. + * @param bool $include_dot Whether to prepend a dot to the extension or not. Default to TRUE. + * @return string A string with the extension corresponding to the given image type. + * @throws ImageException + * + */ +function image_type_to_extension(int $image_type, bool $include_dot = true): string +{ + error_clear_last(); + $safeResult = \image_type_to_extension($image_type, $include_dot); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * image2wbmp 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 string|null $filename Path to the saved file. If not given, the raw image stream will be + * output 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 ImageException + * + */ +function image2wbmp($image, ?string $filename = null, ?int $foreground = null): void +{ + error_clear_last(); + if ($foreground !== null) { + $safeResult = \image2wbmp($image, $filename, $foreground); + } elseif ($filename !== null) { + $safeResult = \image2wbmp($image, $filename); + } else { + $safeResult = \image2wbmp($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param array $affine Array with keys 0 to 5. + * @param array $clip Array with keys "x", "y", "width" and "height"; or NULL. + * @return resource Return affined image object on success. + * @throws ImageException + * + */ +function imageaffine($image, array $affine, ?array $clip = null) +{ + error_clear_last(); + if ($clip !== null) { + $safeResult = \imageaffine($image, $affine, $clip); + } else { + $safeResult = \imageaffine($image, $affine); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Returns the concatenation of two affine transformation matrices, + * what is useful if multiple transformations should be applied to the same + * image in one go. + * + * @param array $matrix1 An affine transformation matrix (an array with keys + * 0 to 5 and float values). + * @param array $matrix2 An affine transformation matrix (an array with keys + * 0 to 5 and float values). + * @return array{0:float,1:float,2:float,3:float,4:float,5:float} An affine transformation matrix (an array with keys + * 0 to 5 and float values). + * @throws ImageException + * + */ +function imageaffinematrixconcat(array $matrix1, array $matrix2): array +{ + error_clear_last(); + $safeResult = \imageaffinematrixconcat($matrix1, $matrix2); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Returns an affine transformation matrix. + * + * @param int $type One of the IMG_AFFINE_* constants. + * @param array|float $options If type is IMG_AFFINE_TRANSLATE + * or IMG_AFFINE_SCALE, + * options has to be an array with keys x + * and y, both having float values. + * + * If type is IMG_AFFINE_ROTATE, + * IMG_AFFINE_SHEAR_HORIZONTAL or IMG_AFFINE_SHEAR_VERTICAL, + * options has to be a float specifying the angle. + * @return array{0:float,1:float,2:float,3:float,4:float,5:float} An affine transformation matrix (an array with keys + * 0 to 5 and float values). + * @throws ImageException + * + */ +function imageaffinematrixget(int $type, $options): array +{ + error_clear_last(); + $safeResult = \imageaffinematrixget($type, $options); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagealphablending allows for two different + * modes of drawing on truecolor images. In blending mode, the + * alpha channel component of the color supplied to all drawing function, + * such as imagesetpixel determines how much of the + * underlying color should be allowed to shine through. As a result, gd + * automatically blends the existing color at that point with the drawing color, + * and stores the result in the image. The resulting pixel is opaque. In + * non-blending mode, the drawing color is copied literally with its alpha channel + * information, replacing the destination pixel. Blending mode is not available + * when drawing on palette images. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param bool $enable Whether to enable the blending mode or not. On true color images + * the default value is TRUE otherwise the default value is FALSE + * @throws ImageException + * + */ +function imagealphablending($image, bool $enable): void +{ + error_clear_last(); + $safeResult = \imagealphablending($image, $enable); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Activate the fast drawing antialiased methods for lines and wired polygons. + * It does not support alpha components. It works using a direct blend + * operation. It works only with truecolor images. + * + * Thickness and styled are not supported. + * + * Using antialiased primitives with transparent background color can end with + * some unexpected results. The blend method uses the background color as any + * other colors. The lack of alpha component support does not allow an alpha + * based antialiasing method. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param bool $enable Whether to enable antialiasing or not. + * @throws ImageException + * + */ +function imageantialias($image, bool $enable): void +{ + error_clear_last(); + $safeResult = \imageantialias($image, $enable); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagearc draws an arc of circle centered at the given + * coordinates. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $center_x x-coordinate of the center. + * @param int $center_y y-coordinate of the center. + * @param int $width The arc width. + * @param int $height The arc height. + * @param int $start_angle The arc start angle, in degrees. + * @param int $end_angle The arc end angle, in degrees. + * 0° is located at the three-o'clock position, and the arc is drawn + * clockwise. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagearc($image, int $center_x, int $center_y, int $width, int $height, int $start_angle, int $end_angle, int $color): void +{ + error_clear_last(); + $safeResult = \imagearc($image, $center_x, $center_y, $width, $height, $start_angle, $end_angle, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Outputs or saves a AVIF Raster image from the given image. + * + * @param \GdImage $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @param int $quality quality is optional, and ranges from 0 (worst quality, smaller file) + * to 100 (best quality, larger file). + * If -1 is provided, the default value 30 is used. + * @param int $speed speed is optional, and ranges from 0 (slow, smaller file) + * to 10 (fast, larger file). + * If -1 is provided, the default value 6 is used. + * @throws ImageException + * + */ +function imageavif(\GdImage $image, $file = null, int $quality = -1, int $speed = -1): void +{ + error_clear_last(); + if ($speed !== -1) { + $safeResult = \imageavif($image, $file, $quality, $speed); + } elseif ($quality !== -1) { + $safeResult = \imageavif($image, $file, $quality); + } elseif ($file !== null) { + $safeResult = \imageavif($image, $file); + } else { + $safeResult = \imageavif($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Outputs or saves a BMP version of the given image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * + * NULL is invalid if the compressed arguments is + * not used. + * @param bool $compressed Whether the BMP should be compressed with run-length encoding (RLE), or not. + * @throws ImageException + * + */ +function imagebmp($image, $file = null, bool $compressed = true): void +{ + error_clear_last(); + if ($compressed !== true) { + $safeResult = \imagebmp($image, $file, $compressed); + } elseif ($file !== null) { + $safeResult = \imagebmp($image, $file); + } else { + $safeResult = \imagebmp($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagechar draws the first character of + * char in the image identified by + * image with its upper-left at + * x,y (top left is 0, + * 0) with the color color. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $font Can be 1, 2, 3, 4, 5 for built-in + * fonts in latin2 encoding (where higher numbers corresponding to larger fonts) or GdFont instance, + * returned by imageloadfont. + * @param int $x x-coordinate of the start. + * @param int $y y-coordinate of the start. + * @param string $char The character to draw. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagechar($image, int $font, int $x, int $y, string $char, int $color): void +{ + error_clear_last(); + $safeResult = \imagechar($image, $font, $x, $y, $char, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws the character char vertically at the specified + * coordinate on the given image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $font Can be 1, 2, 3, 4, 5 for built-in + * fonts in latin2 encoding (where higher numbers corresponding to larger fonts) or GdFont instance, + * returned by imageloadfont. + * @param int $x x-coordinate of the start. + * @param int $y y-coordinate of the start. + * @param string $char The character to draw. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagecharup($image, int $font, int $x, int $y, string $char, int $color): void +{ + error_clear_last(); + $safeResult = \imagecharup($image, $font, $x, $y, $char, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Returns the index of the color of the pixel at the + * specified location in the image specified by image. + * + * If the image is a + * truecolor image, this function returns the RGB value of that pixel as + * integer. Use bitshifting and masking to access the distinct red, green and blue + * component values: + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x x-coordinate of the point. + * @param int $y y-coordinate of the point. + * @return int Returns the index of the color. + * @throws ImageException + * + */ +function imagecolorat($image, int $x, int $y): int +{ + error_clear_last(); + $safeResult = \imagecolorat($image, $x, $y); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * De-allocates a color previously allocated with + * imagecolorallocate or + * imagecolorallocatealpha. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $color The color identifier. + * @throws ImageException + * + */ +function imagecolordeallocate($image, int $color): void +{ + error_clear_last(); + $safeResult = \imagecolordeallocate($image, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Makes the colors of the palette version of an image more closely match the true color version. + * + * @param resource $image1 A truecolor image object. + * @param resource $image2 A palette image object pointing to an image that has the same + * size as image1. + * @throws ImageException + * + */ +function imagecolormatch($image1, $image2): void +{ + error_clear_last(); + $safeResult = \imagecolormatch($image1, $image2); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * This sets the specified index in the palette to the specified + * color. This is useful for creating flood-fill-like effects in + * palleted images without the overhead of performing the actual + * flood-fill. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $color An index in the palette. + * @param int $red Value of red component. + * @param int $green Value of green component. + * @param int $blue Value of blue component. + * @param int $alpha Value of alpha component. + * @throws ImageException + * + */ +function imagecolorset($image, int $color, int $red, int $green, int $blue, int $alpha = 0): void +{ + error_clear_last(); + $safeResult = \imagecolorset($image, $color, $red, $green, $blue, $alpha); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Applies a convolution matrix on the image, using the given coefficient and + * offset. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param array $matrix A 3x3 matrix: an array of three arrays of three floats. + * @param float $divisor The divisor of the result of the convolution, used for normalization. + * @param float $offset Color offset. + * @throws ImageException + * + */ +function imageconvolution($image, array $matrix, float $divisor, float $offset): void +{ + error_clear_last(); + $safeResult = \imageconvolution($image, $matrix, $divisor, $offset); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Copy a part of src_image onto + * dst_image starting at the x,y coordinates + * src_x, src_y with + * a width of src_width and a height of + * src_height. The portion defined will be copied + * onto the x,y coordinates, dst_x and + * dst_y. + * + * @param resource $dst_image Destination image resource. + * @param resource $src_image Source image resource. + * @param int $dst_x x-coordinate of destination point. + * @param int $dst_y y-coordinate of destination point. + * @param int $src_x x-coordinate of source point. + * @param int $src_y y-coordinate of source point. + * @param int $src_width Source width. + * @param int $src_height Source height. + * @throws ImageException + * + */ +function imagecopy($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height): void +{ + error_clear_last(); + $safeResult = \imagecopy($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $src_width, $src_height); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Copy a part of src_image onto + * dst_image starting at the x,y coordinates + * src_x, src_y with + * a width of src_width and a height of + * src_height. The portion defined will be copied + * onto the x,y coordinates, dst_x and + * dst_y. + * + * @param resource $dst_image Destination image resource. + * @param resource $src_image Source image resource. + * @param int $dst_x x-coordinate of destination point. + * @param int $dst_y y-coordinate of destination point. + * @param int $src_x x-coordinate of source point. + * @param int $src_y y-coordinate of source point. + * @param int $src_width Source width. + * @param int $src_height Source height. + * @param int $pct The two images will be merged according to pct + * which can range from 0 to 100. When pct = 0, + * no action is taken, when 100 this function behaves identically + * to imagecopy for pallete images, except for + * ignoring alpha components, while it implements alpha transparency + * for true colour images. + * @throws ImageException + * + */ +function imagecopymerge($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height, int $pct): void +{ + error_clear_last(); + $safeResult = \imagecopymerge($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $src_width, $src_height, $pct); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagecopymergegray copy a part of src_image onto + * dst_image starting at the x,y coordinates + * src_x, src_y with + * a width of src_width and a height of + * src_height. The portion defined will be copied + * onto the x,y coordinates, dst_x and + * dst_y. + * + * This function is identical to imagecopymerge except + * that when merging it preserves the hue of the source by converting + * the destination pixels to gray scale before the copy operation. + * + * @param resource $dst_image Destination image resource. + * @param resource $src_image Source image resource. + * @param int $dst_x x-coordinate of destination point. + * @param int $dst_y y-coordinate of destination point. + * @param int $src_x x-coordinate of source point. + * @param int $src_y y-coordinate of source point. + * @param int $src_width Source width. + * @param int $src_height Source height. + * @param int $pct The src_image will be changed to grayscale according + * to pct where 0 is fully grayscale and 100 is + * unchanged. When pct = 100 this function behaves + * identically to imagecopy for pallete images, except for + * ignoring alpha components, while + * it implements alpha transparency for true colour images. + * @throws ImageException + * + */ +function imagecopymergegray($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height, int $pct): void +{ + error_clear_last(); + $safeResult = \imagecopymergegray($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $src_width, $src_height, $pct); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagecopyresampled copies a rectangular + * portion of one image to another image, smoothly interpolating pixel + * values so that, in particular, reducing the size of an image still + * retains a great deal of clarity. + * + * In other words, imagecopyresampled will take a + * rectangular area from src_image of width + * src_width and height src_height at + * position (src_x,src_y) + * and place it in a rectangular area of dst_image + * of width dst_width and height dst_height + * at position (dst_x,dst_y). + * + * If the source and destination coordinates and width and heights + * differ, appropriate stretching or shrinking of the image fragment + * will be performed. The coordinates refer to the upper left + * corner. This function can be used to copy regions within the + * same image (if dst_image is the same as + * src_image) but if the regions overlap the + * results will be unpredictable. + * + * @param resource $dst_image Destination image resource. + * @param resource $src_image Source image resource. + * @param int $dst_x x-coordinate of destination point. + * @param int $dst_y y-coordinate of destination point. + * @param int $src_x x-coordinate of source point. + * @param int $src_y y-coordinate of source point. + * @param int $dst_width Destination width. + * @param int $dst_height Destination height. + * @param int $src_width Source width. + * @param int $src_height Source height. + * @throws ImageException + * + */ +function imagecopyresampled($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_width, int $dst_height, int $src_width, int $src_height): void +{ + error_clear_last(); + $safeResult = \imagecopyresampled($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_width, $dst_height, $src_width, $src_height); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagecopyresized copies a rectangular + * portion of one image to another image. + * dst_image is the destination image, + * src_image is the source image identifier. + * + * In other words, imagecopyresized will take a + * rectangular area from src_image of width + * src_width and height src_height at + * position (src_x,src_y) + * and place it in a rectangular area of dst_image + * of width dst_width and height dst_height + * at position (dst_x,dst_y). + * + * If the source and destination coordinates and width and heights + * differ, appropriate stretching or shrinking of the image fragment + * will be performed. The coordinates refer to the upper left + * corner. This function can be used to copy regions within the + * same image (if dst_image is the same as + * src_image) but if the regions overlap the + * results will be unpredictable. + * + * @param resource $dst_image Destination image resource. + * @param resource $src_image Source image resource. + * @param int $dst_x x-coordinate of destination point. + * @param int $dst_y y-coordinate of destination point. + * @param int $src_x x-coordinate of source point. + * @param int $src_y y-coordinate of source point. + * @param int $dst_width Destination width. + * @param int $dst_height Destination height. + * @param int $src_width Source width. + * @param int $src_height Source height. + * @throws ImageException + * + */ +function imagecopyresized($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_width, int $dst_height, int $src_width, int $src_height): void +{ + error_clear_last(); + $safeResult = \imagecopyresized($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_width, $dst_height, $src_width, $src_height); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagecreate returns an image identifier + * representing a blank image of specified size. + * + * In general, we recommend the use of + * imagecreatetruecolor instead of + * imagecreate so that image processing occurs on the + * highest quality image possible. If you want to output a palette image, then + * imagetruecolortopalette should be called immediately + * before saving the image with imagepng or + * imagegif. + * + * @param int $width The image width. + * @param int $height The image height. + * @return resource|false Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreate(int $width, int $height) +{ + error_clear_last(); + $safeResult = \imagecreate($width, $height); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromavif returns an image object + * representing the image obtained from the given filename. + * + * @param string $filename Path to the AVIF raster image. + * @return Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromavif(string $filename): void +{ + error_clear_last(); + $safeResult = \imagecreatefromavif($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagecreatefrombmp returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the BMP image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefrombmp(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefrombmp($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Create a new image from GD file or URL. + * + * @param string $filename Path to the GD file. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromgd(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromgd($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Create a new image from GD2 file or URL. + * + * @param string $filename Path to the GD2 image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromgd2(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromgd2($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Create a new image from a given part of GD2 file or URL. + * + * @param string $filename Path to the GD2 image. + * @param int $x x-coordinate of source point. + * @param int $y y-coordinate of source point. + * @param int $width Source width. + * @param int $height Source height. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromgd2part(string $filename, int $x, int $y, int $width, int $height) +{ + error_clear_last(); + $safeResult = \imagecreatefromgd2part($filename, $x, $y, $width, $height); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromgif returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the GIF image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromgif(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromgif($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromjpeg returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the JPEG image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromjpeg(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromjpeg($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefrompng returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the PNG image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefrompng(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefrompng($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromstring returns an image identifier + * representing the image obtained from the given data. + * These types will be automatically detected if your build of PHP supports + * them: JPEG, PNG, GIF, BMP, WBMP, GD2, WEBP and AVIF. + * + * @param string $data A string containing the image data. + * @return resource An image object will be returned on success. FALSE is returned if + * the image type is unsupported, the data is not in a recognised format, + * or the image is corrupt and cannot be loaded. + * @throws ImageException + * + */ +function imagecreatefromstring(string $data) +{ + error_clear_last(); + $safeResult = \imagecreatefromstring($data); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromtga returns an image object + * representing the image obtained from the given filename. + * + * @param string $filename Path to the Truevision TGA image. + * @return Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromtga(string $filename): void +{ + error_clear_last(); + $safeResult = \imagecreatefromtga($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagecreatefromwbmp returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the WBMP image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromwbmp(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromwbmp($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromwebp returns an image identifier + * representing the image obtained from the given filename. + * Note that animated WebP files cannot be read. + * + * @param string $filename Path to the WebP image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromwebp(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromwebp($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromxbm returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the XBM image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromxbm(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromxbm($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromxpm returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the XPM image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromxpm(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromxpm($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatetruecolor returns an image object + * representing a black image of the specified size. + * + * @param int $width Image width. + * @param int $height Image height. + * @return resource|false Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatetruecolor(int $width, int $height) +{ + error_clear_last(); + $safeResult = \imagecreatetruecolor($width, $height); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Crops an image to the given rectangular area and returns the resulting image. + * The given image is not modified. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param array $rectangle The cropping rectangle as array with keys + * x, y, width and + * height. + * @return resource Return cropped image object on success. + * @throws ImageException + * + */ +function imagecrop($image, array $rectangle) +{ + error_clear_last(); + $safeResult = \imagecrop($image, $rectangle); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Automatically crops an image according to the given + * mode. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $mode One of the following constants: + * @param float $threshold + * @param int $color + * @return resource Returns a cropped image object on success. + * FALSE is also returned if the whole image was cropped. + * @throws ImageException + * + */ +function imagecropauto($image, int $mode = IMG_CROP_DEFAULT, float $threshold = 0.5, int $color = -1) +{ + error_clear_last(); + $safeResult = \imagecropauto($image, $mode, $threshold, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * This function is deprecated. Use combination of + * imagesetstyle and imageline + * instead. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x1 Upper left x coordinate. + * @param int $y1 Upper left y coordinate 0, 0 is the top left corner of the image. + * @param int $x2 Bottom right x coordinate. + * @param int $y2 Bottom right y coordinate. + * @param int $color The fill color. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagedashedline($image, int $x1, int $y1, int $x2, int $y2, int $color): void +{ + error_clear_last(); + $safeResult = \imagedashedline($image, $x1, $y1, $x2, $y2, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Prior to PHP 8.0.0, imagedestroy freed any memory associated + * with image image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @throws ImageException + * + */ +function imagedestroy($image): void +{ + error_clear_last(); + $safeResult = \imagedestroy($image); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws an ellipse centered at the specified coordinates. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $center_x x-coordinate of the center. + * @param int $center_y y-coordinate of the center. + * @param int $width The ellipse width. + * @param int $height The ellipse height. + * @param int $color The color of the ellipse. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imageellipse($image, int $center_x, int $center_y, int $width, int $height, int $color): void +{ + error_clear_last(); + $safeResult = \imageellipse($image, $center_x, $center_y, $width, $height, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Performs a flood fill starting at the given coordinate (top left is 0, 0) + * with the given color in the + * image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x x-coordinate of start point. + * @param int $y y-coordinate of start point. + * @param int $color The fill color. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagefill($image, int $x, int $y, int $color): void +{ + error_clear_last(); + $safeResult = \imagefill($image, $x, $y, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws a partial arc centered at the specified coordinate in the + * given image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $center_x x-coordinate of the center. + * @param int $center_y y-coordinate of the center. + * @param int $width The arc width. + * @param int $height The arc height. + * @param int $start_angle The arc start angle, in degrees. + * @param int $end_angle The arc end angle, in degrees. + * 0° is located at the three-o'clock position, and the arc is drawn + * clockwise. + * @param int $color A color identifier created with imagecolorallocate. + * @param int $style A bitwise OR of the following possibilities: + * + * IMG_ARC_PIE + * IMG_ARC_CHORD + * IMG_ARC_NOFILL + * IMG_ARC_EDGED + * + * IMG_ARC_PIE and IMG_ARC_CHORD are + * mutually exclusive; IMG_ARC_CHORD just + * connects the starting and ending angles with a straight line, while + * IMG_ARC_PIE produces a rounded edge. + * IMG_ARC_NOFILL indicates that the arc + * or chord should be outlined, not filled. IMG_ARC_EDGED, + * used together with IMG_ARC_NOFILL, indicates that the + * beginning and ending angles should be connected to the center - this is a + * good way to outline (rather than fill) a 'pie slice'. + * @throws ImageException + * + */ +function imagefilledarc($image, int $center_x, int $center_y, int $width, int $height, int $start_angle, int $end_angle, int $color, int $style): void +{ + error_clear_last(); + $safeResult = \imagefilledarc($image, $center_x, $center_y, $width, $height, $start_angle, $end_angle, $color, $style); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws an ellipse centered at the specified coordinate on the given + * image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $center_x x-coordinate of the center. + * @param int $center_y y-coordinate of the center. + * @param int $width The ellipse width. + * @param int $height The ellipse height. + * @param int $color The fill color. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagefilledellipse($image, int $center_x, int $center_y, int $width, int $height, int $color): void +{ + error_clear_last(); + $safeResult = \imagefilledellipse($image, $center_x, $center_y, $width, $height, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Creates a rectangle filled with color in the given + * image starting at point 1 and ending at point 2. + * 0, 0 is the top left corner of the image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x1 x-coordinate for point 1. + * @param int $y1 y-coordinate for point 1. + * @param int $x2 x-coordinate for point 2. + * @param int $y2 y-coordinate for point 2. + * @param int $color The fill color. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagefilledrectangle($image, int $x1, int $y1, int $x2, int $y2, int $color): void +{ + error_clear_last(); + $safeResult = \imagefilledrectangle($image, $x1, $y1, $x2, $y2, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagefilltoborder performs a flood fill + * whose border color is defined by border_color. + * The starting point for the fill is x, + * y (top left is 0, 0) and the region is + * filled with color color. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x x-coordinate of start. + * @param int $y y-coordinate of start. + * @param int $border_color The border color. A color identifier created with imagecolorallocate. + * @param int $color The fill color. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagefilltoborder($image, int $x, int $y, int $border_color, int $color): void +{ + error_clear_last(); + $safeResult = \imagefilltoborder($image, $x, $y, $border_color, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagefilter applies the given filter + * filter on the image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $filter filter can be one of the following: + * + * + * + * IMG_FILTER_NEGATE: Reverses all colors of + * the image. + * + * + * + * + * IMG_FILTER_GRAYSCALE: Converts the image into + * grayscale by changing the red, green and blue components to their + * weighted sum using the same coefficients as the REC.601 luma (Y') + * calculation. The alpha components are retained. For palette images the + * result may differ due to palette limitations. + * + * + * + * + * IMG_FILTER_BRIGHTNESS: Changes the brightness + * of the image. Use args to set the level of + * brightness. The range for the brightness is -255 to 255. + * + * + * + * + * IMG_FILTER_CONTRAST: Changes the contrast of + * the image. Use args to set the level of + * contrast. + * + * + * + * + * IMG_FILTER_COLORIZE: Like + * IMG_FILTER_GRAYSCALE, except you can specify the + * color. Use args, arg2 and + * arg3 in the form of + * red, green, + * blue and arg4 for the + * alpha channel. The range for each color is 0 to 255. + * + * + * + * + * IMG_FILTER_EDGEDETECT: Uses edge detection to + * highlight the edges in the image. + * + * + * + * + * IMG_FILTER_EMBOSS: Embosses the image. + * + * + * + * + * IMG_FILTER_GAUSSIAN_BLUR: Blurs the image using + * the Gaussian method. + * + * + * + * + * IMG_FILTER_SELECTIVE_BLUR: Blurs the image. + * + * + * + * + * IMG_FILTER_MEAN_REMOVAL: Uses mean removal to + * achieve a "sketchy" effect. + * + * + * + * + * IMG_FILTER_SMOOTH: Makes the image smoother. + * Use args to set the level of smoothness. + * + * + * + * + * IMG_FILTER_PIXELATE: Applies pixelation effect + * to the image, use args to set the block size + * and arg2 to set the pixelation effect mode. + * + * + * + * + * IMG_FILTER_SCATTER: Applies scatter effect + * to the image, use args and + * arg2 to define the effect strength and + * additionally arg3 to only apply the + * on select pixel colors. + * + * + * + * @param int $args + * + * + * IMG_FILTER_BRIGHTNESS: Brightness level. + * + * + * + * + * IMG_FILTER_CONTRAST: Contrast level. + * + * + * + * + * IMG_FILTER_COLORIZE: Value of red component. + * + * + * + * + * IMG_FILTER_SMOOTH: Smoothness level. + * + * + * + * + * IMG_FILTER_PIXELATE: Block size in pixels. + * + * + * + * + * IMG_FILTER_SCATTER: Effect substraction level. + * This must not be higher or equal to the addition level set with + * arg2. + * + * + * + * @throws ImageException + * + */ +function imagefilter($image, int $filter, int ...$args): void +{ + error_clear_last(); + if ($args !== []) { + $safeResult = \imagefilter($image, $filter, ...$args); + } else { + $safeResult = \imagefilter($image, $filter); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Flips the image image using the given + * mode. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $mode Flip mode, this can be one of the IMG_FLIP_* constants: + * + * + * + * + * + * Constant + * Meaning + * + * + * + * + * IMG_FLIP_HORIZONTAL + * + * Flips the image horizontally. + * + * + * + * IMG_FLIP_VERTICAL + * + * Flips the image vertically. + * + * + * + * IMG_FLIP_BOTH + * + * Flips the image both horizontally and vertically. + * + * + * + * + * + * @throws ImageException + * + */ +function imageflip($image, int $mode): void +{ + error_clear_last(); + $safeResult = \imageflip($image, $mode); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * This function calculates and returns the bounding box in pixels + * for a FreeType text. + * + * @param float $size The font size in points. + * @param float $angle Angle in degrees in which string will be + * measured. + * @param string $font_filename The name of the TrueType font file (can be a URL). Depending on + * which version of the GD library that PHP is using, it may attempt to + * search for files that do not begin with a leading '/' by appending + * '.ttf' to the filename and searching along a library-defined font path. + * @param string $string The string to be measured. + * @param array $options + * Possible array indexes for options + * + * + * + * Key + * Type + * Meaning + * + * + * + * + * linespacing + * float + * Defines drawing linespacing + * + * + * + * + * @return array imageftbbox returns an array with 8 + * elements representing four points making the bounding box of the + * text: + * + * + * + * + * 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. + * + * On failure, FALSE is returned. + * @throws ImageException + * + */ +function imageftbbox(float $size, float $angle, string $font_filename, string $string, array $options = []): array +{ + error_clear_last(); + $safeResult = \imageftbbox($size, $angle, $font_filename, $string, $options); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param float $size The font size to use 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 index of the desired color for the text, see + * imagecolorexact. + * @param string $font_filename The path to the TrueType font you wish to use. + * + * Depending on which version of the GD library PHP is using, when + * font_filename 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. + * + * In many cases where a font resides in the same directory as the script using it + * the following trick will alleviate any include problems. + * + * + * ]]> + * + * @param string $text Text to be inserted into image. + * @param array $options + * Possible array indexes for options + * + * + * + * Key + * Type + * Meaning + * + * + * + * + * linespacing + * float + * Defines drawing linespacing + * + * + * + * + * @return array This function returns an array defining the four points of the box, starting in the lower left and moving counter-clockwise: + * + * + * + * + * 0 + * lower left x-coordinate + * + * + * 1 + * lower left y-coordinate + * + * + * 2 + * lower right x-coordinate + * + * + * 3 + * lower right y-coordinate + * + * + * 4 + * upper right x-coordinate + * + * + * 5 + * upper right y-coordinate + * + * + * 6 + * upper left x-coordinate + * + * + * 7 + * upper left y-coordinate + * + * + * + * + * + * On failure, FALSE is returned. + * @throws ImageException + * + */ +function imagefttext($image, float $size, float $angle, int $x, int $y, int $color, string $font_filename, string $text, array $options = []): array +{ + error_clear_last(); + $safeResult = \imagefttext($image, $size, $angle, $x, $y, $color, $font_filename, $text, $options); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Applies gamma correction to the given gd image + * given an input and an output gamma. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param float $input_gamma The input gamma. + * @param float $output_gamma The output gamma. + * @throws ImageException + * + */ +function imagegammacorrect($image, float $input_gamma, float $output_gamma): void +{ + error_clear_last(); + $safeResult = \imagegammacorrect($image, $input_gamma, $output_gamma); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Outputs a GD image to the given file. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @throws ImageException + * + */ +function imagegd($image, $file = null): void +{ + error_clear_last(); + if ($file !== null) { + $safeResult = \imagegd($image, $file); + } else { + $safeResult = \imagegd($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Outputs a GD2 image to the given file. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @param int $chunk_size Chunk size. + * @param int $mode Either IMG_GD2_RAW or + * IMG_GD2_COMPRESSED. Default is + * IMG_GD2_RAW. + * @throws ImageException + * + */ +function imagegd2($image, $file = null, int $chunk_size = 128, int $mode = IMG_GD2_RAW): void +{ + error_clear_last(); + if ($mode !== IMG_GD2_RAW) { + $safeResult = \imagegd2($image, $file, $chunk_size, $mode); + } elseif ($chunk_size !== 128) { + $safeResult = \imagegd2($image, $file, $chunk_size); + } elseif ($file !== null) { + $safeResult = \imagegd2($image, $file); + } else { + $safeResult = \imagegd2($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagegif creates the GIF + * file in file from the image image. The + * image argument is the return from the + * imagecreate or imagecreatefrom* + * function. + * + * The image format will be GIF87a unless the + * image has been made transparent with + * imagecolortransparent, in which case the + * image format will be GIF89a. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @throws ImageException + * + */ +function imagegif($image, $file = null): void +{ + error_clear_last(); + if ($file !== null) { + $safeResult = \imagegif($image, $file); + } else { + $safeResult = \imagegif($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Grabs a screenshot of the whole screen. + * + * @return resource Returns an image object on success, FALSE on failure. + * @throws ImageException + * + */ +function imagegrabscreen() +{ + error_clear_last(); + $safeResult = \imagegrabscreen(); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Grabs a window or its client area using a windows handle (HWND property in COM instance) + * + * @param int $handle The HWND window ID. + * @param bool $client_area Include the client area of the application window. + * @return \GdImage Returns an image object on success, FALSE on failure. + * @throws ImageException + * + */ +function imagegrabwindow(int $handle, bool $client_area = false): \GdImage +{ + error_clear_last(); + $safeResult = \imagegrabwindow($handle, $client_area); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagejpeg creates a JPEG file from + * the given image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @param int $quality quality is optional, and ranges from 0 (worst + * quality, smaller file) to 100 (best quality, biggest file). The + * default (-1) uses the default IJG quality value (about 75). + * @throws ImageException + * + */ +function imagejpeg($image, $file = null, int $quality = -1): void +{ + error_clear_last(); + if ($quality !== -1) { + $safeResult = \imagejpeg($image, $file, $quality); + } elseif ($file !== null) { + $safeResult = \imagejpeg($image, $file); + } else { + $safeResult = \imagejpeg($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Set the alpha blending flag to use layering effects. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $effect One of the following constants: + * + * + * IMG_EFFECT_REPLACE + * + * + * Use pixel replacement (equivalent of passing TRUE to + * imagealphablending) + * + * + * + * + * IMG_EFFECT_ALPHABLEND + * + * + * Use normal pixel blending (equivalent of passing FALSE to + * imagealphablending) + * + * + * + * + * IMG_EFFECT_NORMAL + * + * + * Same as IMG_EFFECT_ALPHABLEND. + * + * + * + * + * IMG_EFFECT_OVERLAY + * + * + * Overlay has the effect that black background pixels will remain + * black, white background pixels will remain white, but grey + * background pixels will take the colour of the foreground pixel. + * + * + * + * + * IMG_EFFECT_MULTIPLY + * + * + * Overlays with a multiply effect. + * + * + * + * + * @throws ImageException + * + */ +function imagelayereffect($image, int $effect): void +{ + error_clear_last(); + $safeResult = \imagelayereffect($image, $effect); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws a line between the two given points. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x1 x-coordinate for first point. + * @param int $y1 y-coordinate for first point. + * @param int $x2 x-coordinate for second point. + * @param int $y2 y-coordinate for second point. + * @param int $color The line color. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imageline($image, int $x1, int $y1, int $x2, int $y2, int $color): void +{ + error_clear_last(); + $safeResult = \imageline($image, $x1, $y1, $x2, $y2, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imageloadfont loads a user-defined bitmap and returns + * its identifier. + * + * @param string $filename The font file format is currently binary and architecture + * dependent. This means you should generate the font files on the + * same type of CPU as the machine you are running PHP on. + * + * + * Font file format + * + * + * + * byte position + * C data type + * description + * + * + * + * + * byte 0-3 + * int + * number of characters in the font + * + * + * byte 4-7 + * int + * + * value of first character in the font (often 32 for space) + * + * + * + * byte 8-11 + * int + * pixel width of each character + * + * + * byte 12-15 + * int + * pixel height of each character + * + * + * byte 16- + * char + * + * array with character data, one byte per pixel in each + * character, for a total of (nchars*width*height) bytes. + * + * + * + * + * + * @return int Returns an GdFont instance. + * @throws ImageException + * + */ +function imageloadfont(string $filename): int +{ + error_clear_last(); + $safeResult = \imageloadfont($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Outputs or saves a PNG image from the given + * image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * + * NULL is invalid if the quality and + * filters arguments are not used. + * @param int $quality Compression level: from 0 (no compression) to 9. + * The default (-1) uses the zlib compression default. + * For more information see the zlib manual. + * @param int $filters Allows reducing the PNG file size. It is a bitmask field which may be + * set to any combination of the PNG_FILTER_* + * constants. PNG_NO_FILTER or + * PNG_ALL_FILTERS may also be used to respectively + * disable or activate all filters. + * The default value (-1) disables filtering. + * @throws ImageException + * + */ +function imagepng($image, $file = null, int $quality = -1, int $filters = -1): void +{ + error_clear_last(); + if ($filters !== -1) { + $safeResult = \imagepng($image, $file, $quality, $filters); + } elseif ($quality !== -1) { + $safeResult = \imagepng($image, $file, $quality); + } elseif ($file !== null) { + $safeResult = \imagepng($image, $file); + } else { + $safeResult = \imagepng($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagerectangle creates a rectangle starting at + * the specified coordinates. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x1 Upper left x coordinate. + * @param int $y1 Upper left y coordinate + * 0, 0 is the top left corner of the image. + * @param int $x2 Bottom right x coordinate. + * @param int $y2 Bottom right y coordinate. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagerectangle($image, int $x1, int $y1, int $x2, int $y2, int $color): void +{ + error_clear_last(); + $safeResult = \imagerectangle($image, $x1, $y1, $x2, $y2, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imageresolution allows to set and get the resolution of + * an image in DPI (dots per inch). If the optional parameters are NULL, + * the current resolution is returned as an indexed array. If only + * resolution_x is not NULL, the horizontal and vertical resolution + * are set to this value. If none of the optional parameters are NULL, the horizontal + * and vertical resolution are set to these values, respectively. + * + * The resolution is only used as meta information when images are read from and + * written to formats supporting this kind of information (curently PNG and + * JPEG). It does not affect any drawing operations. The default resolution + * for new images is 96 DPI. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $resolution_x The horizontal resolution in DPI. + * @param int $resolution_y The vertical resolution in DPI. + * @return mixed When used as getter, + * it returns an indexed array of the horizontal and vertical resolution on + * success. + * When used as setter, it returns + * TRUE on success. + * @throws ImageException + * + */ +function imageresolution($image, ?int $resolution_x = null, ?int $resolution_y = null) +{ + error_clear_last(); + if ($resolution_y !== null) { + $safeResult = \imageresolution($image, $resolution_x, $resolution_y); + } elseif ($resolution_x !== null) { + $safeResult = \imageresolution($image, $resolution_x); + } else { + $safeResult = \imageresolution($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Rotates the image image using the given + * angle in degrees. + * + * The center of rotation is the center of the image, and the rotated + * image may have different dimensions than the original image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param float $angle Rotation angle, in degrees. The rotation angle is interpreted as the + * number of degrees to rotate the image anticlockwise. + * @param int $background_color Specifies the color of the uncovered zone after the rotation + * @return resource Returns an image object for the rotated image. + * @throws ImageException + * + */ +function imagerotate($image, float $angle, int $background_color) +{ + error_clear_last(); + $safeResult = \imagerotate($image, $angle, $background_color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagesavealpha sets the flag which determines whether to retain + * full alpha channel information (as opposed to single-color transparency) + * when saving images. + * This is only supported for image formats which support full alpha channel information, + * i.e. PNG, WebP and AVIF. + * + * + * imagesavealpha is only meaningful for PNG + * images, since the full alpha channel is always saved for WebP + * and AVIF. It is not recommended to rely on this behavior, + * as it may change in the future. Thus, imagesavealpha + * should be called deliberately also for WebP and + * AVIF images. + * + * + * + * Alphablending has to be disabled (imagealphablending($im, false)) + * to retain the alpha-channel in the first place. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param bool $enable Whether to save the alpha channel or not. Defaults to FALSE. + * @throws ImageException + * + */ +function imagesavealpha($image, bool $enable): void +{ + error_clear_last(); + $safeResult = \imagesavealpha($image, $enable); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagescale scales an image using the given + * interpolation algorithm. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $width The width to scale the image to. + * @param int $height The height to scale the image to. If omitted or negative, the aspect + * ratio will be preserved. + * @param int $mode One of IMG_NEAREST_NEIGHBOUR, + * IMG_BILINEAR_FIXED, + * IMG_BICUBIC, + * IMG_BICUBIC_FIXED or anything else (will use two + * pass). + * + * + * IMG_WEIGHTED4 is not yet supported. + * + * + * @return resource Return the scaled image object on success. + * @throws ImageException + * + */ +function imagescale($image, int $width, int $height = -1, int $mode = IMG_BILINEAR_FIXED) +{ + error_clear_last(); + $safeResult = \imagescale($image, $width, $height, $mode); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagesetbrush sets the brush image to be + * used by all line drawing functions (such as imageline + * and imagepolygon) when drawing with the special + * colors IMG_COLOR_BRUSHED or + * IMG_COLOR_STYLEDBRUSHED. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param resource $brush An image object. + * @throws ImageException + * + */ +function imagesetbrush($image, $brush): void +{ + error_clear_last(); + $safeResult = \imagesetbrush($image, $brush); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagesetclip sets the current clipping rectangle, i.e. + * the area beyond which no pixels will be drawn. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x1 The x-coordinate of the upper left corner. + * @param int $y1 The y-coordinate of the upper left corner. + * @param int $x2 The x-coordinate of the lower right corner. + * @param int $y2 The y-coordinate of the lower right corner. + * @throws ImageException + * + */ +function imagesetclip($image, int $x1, int $y1, int $x2, int $y2): void +{ + error_clear_last(); + $safeResult = \imagesetclip($image, $x1, $y1, $x2, $y2); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Sets the interpolation method, setting an interpolation method affects the rendering + * of various functions in GD, such as the imagerotate function. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $method The interpolation method, which can be one of the following: + * + * + * + * IMG_BELL: Bell filter. + * + * + * + * + * IMG_BESSEL: Bessel filter. + * + * + * + * + * IMG_BICUBIC: Bicubic interpolation. + * + * + * + * + * IMG_BICUBIC_FIXED: Fixed point implementation of the bicubic interpolation. + * + * + * + * + * IMG_BILINEAR_FIXED: Fixed point implementation of the bilinear interpolation (default (also on image creation)). + * + * + * + * + * IMG_BLACKMAN: Blackman window function. + * + * + * + * + * IMG_BOX: Box blur filter. + * + * + * + * + * IMG_BSPLINE: Spline interpolation. + * + * + * + * + * IMG_CATMULLROM: Cubic Hermite spline interpolation. + * + * + * + * + * IMG_GAUSSIAN: Gaussian function. + * + * + * + * + * IMG_GENERALIZED_CUBIC: Generalized cubic spline fractal interpolation. + * + * + * + * + * IMG_HERMITE: Hermite interpolation. + * + * + * + * + * IMG_HAMMING: Hamming filter. + * + * + * + * + * IMG_HANNING: Hanning filter. + * + * + * + * + * IMG_MITCHELL: Mitchell filter. + * + * + * + * + * IMG_POWER: Power interpolation. + * + * + * + * + * IMG_QUADRATIC: Inverse quadratic interpolation. + * + * + * + * + * IMG_SINC: Sinc function. + * + * + * + * + * IMG_NEAREST_NEIGHBOUR: Nearest neighbour interpolation. + * + * + * + * + * IMG_WEIGHTED4: Weighting filter. + * + * + * + * + * IMG_TRIANGLE: Triangle interpolation. + * + * + * + * @throws ImageException + * + */ +function imagesetinterpolation($image, int $method = IMG_BILINEAR_FIXED): void +{ + error_clear_last(); + $safeResult = \imagesetinterpolation($image, $method); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagesetpixel draws a pixel at the specified + * coordinate. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x x-coordinate. + * @param int $y y-coordinate. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagesetpixel($image, int $x, int $y, int $color): void +{ + error_clear_last(); + $safeResult = \imagesetpixel($image, $x, $y, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagesetstyle sets the style to be used by all + * line drawing functions (such as imageline + * and imagepolygon) when drawing with the special + * color IMG_COLOR_STYLED or lines of images with color + * IMG_COLOR_STYLEDBRUSHED. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param array $style An array of pixel colors. You can use the + * IMG_COLOR_TRANSPARENT constant to add a + * transparent pixel. + * Note that style must not be an empty array. + * @throws ImageException + * + */ +function imagesetstyle($image, array $style): void +{ + error_clear_last(); + $safeResult = \imagesetstyle($image, $style); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagesetthickness sets the thickness of the lines + * drawn when drawing rectangles, polygons, arcs etc. to + * thickness pixels. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $thickness Thickness, in pixels. + * @throws ImageException + * + */ +function imagesetthickness($image, int $thickness): void +{ + error_clear_last(); + $safeResult = \imagesetthickness($image, $thickness); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagesettile sets the tile image to be + * used by all region filling functions (such as imagefill + * and imagefilledpolygon) when filling with the special + * color IMG_COLOR_TILED. + * + * A tile is an image used to fill an area with a repeated pattern. Any + * GD image can be used as a tile, and by setting the transparent color index of the tile + * image with imagecolortransparent, a tile allows certain parts + * of the underlying area to shine through can be created. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param resource $tile The image object to be used as a tile. + * @throws ImageException + * + */ +function imagesettile($image, $tile): void +{ + error_clear_last(); + $safeResult = \imagesettile($image, $tile); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws a string at the given coordinates. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $font Can be 1, 2, 3, 4, 5 for built-in + * fonts in latin2 encoding (where higher numbers corresponding to larger fonts) or GdFont instance, + * returned by imageloadfont. + * @param int $x x-coordinate of the upper left corner. + * @param int $y y-coordinate of the upper left corner. + * @param string $string The string to be written. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagestring($image, int $font, int $x, int $y, string $string, int $color): void +{ + error_clear_last(); + $safeResult = \imagestring($image, $font, $x, $y, $string, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws a string vertically at the given + * coordinates. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $font Can be 1, 2, 3, 4, 5 for built-in + * fonts in latin2 encoding (where higher numbers corresponding to larger fonts) or GdFont instance, + * returned by imageloadfont. + * @param int $x x-coordinate of the bottom left corner. + * @param int $y y-coordinate of the bottom left corner. + * @param string $string The string to be written. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagestringup($image, int $font, int $x, int $y, string $string, int $color): void +{ + error_clear_last(); + $safeResult = \imagestringup($image, $font, $x, $y, $string, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagetruecolortopalette converts a truecolor image + * to a palette image. The code for this function was originally drawn from + * the Independent JPEG Group library code, which is excellent. The code + * has been modified to preserve as much alpha channel information as + * possible in the resulting palette, in addition to preserving colors as + * well as possible. This does not work as well as might be hoped. It is + * usually best to simply produce a truecolor output image instead, which + * guarantees the highest output quality. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param bool $dither Indicates if the image should be dithered - if it is TRUE then + * dithering will be used which will result in a more speckled image but + * with better color approximation. + * @param int $num_colors Sets the maximum number of colors that should be retained in the palette. + * @throws ImageException + * + */ +function imagetruecolortopalette($image, bool $dither, int $num_colors): void +{ + error_clear_last(); + $safeResult = \imagetruecolortopalette($image, $dither, $num_colors); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * This function calculates and returns the bounding box in pixels + * for a TrueType text. + * + * @param float $size The font size in points. + * @param float $angle Angle in degrees in which string will be measured. + * @param string $font_filename 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 $string The string to be measured. + * @param array $options + * @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 ImageException + * + */ +function imagettfbbox(float $size, float $angle, string $font_filename, string $string, array $options = []): array +{ + error_clear_last(); + $safeResult = \imagettfbbox($size, $angle, $font_filename, $string, $options); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Writes the given text into the image using TrueType + * fonts. + * + * @param resource $image A GdImage object, 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 $font_filename 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. + * @param array $options + * @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. + * @throws ImageException + * + */ +function imagettftext($image, float $size, float $angle, int $x, int $y, int $color, string $font_filename, string $text, array $options = []): array +{ + error_clear_last(); + $safeResult = \imagettftext($image, $size, $angle, $x, $y, $color, $font_filename, $text, $options); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagewbmp outputs or save a WBMP + * version of the given image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @param int $foreground_color You can set the foreground color with this parameter by setting an + * identifier obtained from imagecolorallocate. + * The default foreground color is black. + * @throws ImageException + * + */ +function imagewbmp($image, $file = null, ?int $foreground_color = null): void +{ + error_clear_last(); + if ($foreground_color !== null) { + $safeResult = \imagewbmp($image, $file, $foreground_color); + } elseif ($file !== null) { + $safeResult = \imagewbmp($image, $file); + } else { + $safeResult = \imagewbmp($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Outputs or saves a WebP version of the given image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @param int $quality quality ranges from 0 (worst + * quality, smaller file) to 100 (best quality, biggest file). + * @throws ImageException + * + */ +function imagewebp($image, $file = null, int $quality = -1): void +{ + error_clear_last(); + if ($quality !== -1) { + $safeResult = \imagewebp($image, $file, $quality); + } elseif ($file !== null) { + $safeResult = \imagewebp($image, $file); + } else { + $safeResult = \imagewebp($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Outputs or save an XBM version of the given + * image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $filename The path to save the file to, given as string. If NULL, the raw image stream will be output 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_color 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 ImageException + * + */ +function imagexbm($image, $filename, ?int $foreground_color = null): void +{ + error_clear_last(); + if ($foreground_color !== null) { + $safeResult = \imagexbm($image, $filename, $foreground_color); + } else { + $safeResult = \imagexbm($image, $filename); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Embeds binary IPTC data into a JPEG image. + * + * @param string $iptc_data The data to be written. + * @param string $filename 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 string|bool If spool is less than 2, the JPEG will be returned. Otherwise returns TRUE on success. + * @throws ImageException + * + */ +function iptcembed(string $iptc_data, string $filename, int $spool = 0) +{ + error_clear_last(); + $safeResult = \iptcembed($iptc_data, $filename, $spool); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Parses an IPTC block into its single tags. + * + * @param string $iptc_block 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 ImageException + * + */ +function iptcparse(string $iptc_block): array +{ + error_clear_last(); + $safeResult = \iptcparse($iptc_block); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 ImageException + * + */ +function jpeg2wbmp(string $jpegname, string $wbmpname, int $dest_height, int $dest_width, int $threshold): void +{ + error_clear_last(); + $safeResult = \jpeg2wbmp($jpegname, $wbmpname, $dest_height, $dest_width, $threshold); + if ($safeResult === false) { + throw 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 ImageException + * + */ +function png2wbmp(string $pngname, string $wbmpname, int $dest_height, int $dest_width, int $threshold): void +{ + error_clear_last(); + $safeResult = \png2wbmp($pngname, $wbmpname, $dest_height, $dest_width, $threshold); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} diff --git a/generated/8.4/imap.php b/generated/8.4/imap.php new file mode 100644 index 00000000..f654cc34 --- /dev/null +++ b/generated/8.4/imap.php @@ -0,0 +1,2092 @@ + + * + * + * @param array $controls Array of LDAP Controls to send with the request. + * @throws LdapException + * + */ +function ldap_add($ldap, string $dn, array $entry, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_add($ldap, $dn, $entry, $controls); + } else { + $safeResult = \ldap_add($ldap, $dn, $entry); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Binds to the LDAP directory with specified RDN and password. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param string|null $dn + * @param string|null $password + * @throws LdapException + * + */ +function ldap_bind($ldap, ?string $dn = null, ?string $password = null): void +{ + error_clear_last(); + if ($password !== null) { + $safeResult = \ldap_bind($ldap, $dn, $password); + } elseif ($dn !== null) { + $safeResult = \ldap_bind($ldap, $dn); + } else { + $safeResult = \ldap_bind($ldap); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Retrieve the pagination information send by the server. + * + * @param resource $link An LDAP resource, returned by ldap_connect. + * @param resource $result + * @param string|null $cookie An opaque structure sent by the server. + * @param int|null $estimated The estimated number of entries to retrieve. + * @throws LdapException + * + */ +function ldap_control_paged_result_response($link, $result, ?string &$cookie = null, ?int &$estimated = null): void +{ + error_clear_last(); + $safeResult = \ldap_control_paged_result_response($link, $result, $cookie, $estimated); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Enable LDAP pagination by sending the pagination control (page size, cookie...). + * + * @param resource $link An LDAP resource, 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 LdapException + * + */ +function ldap_control_paged_result($link, int $pagesize, bool $iscritical = false, string $cookie = ""): void +{ + error_clear_last(); + $safeResult = \ldap_control_paged_result($link, $pagesize, $iscritical, $cookie); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Returns the number of entries stored in the result of previous search + * operations. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $result An LDAP\Result instance, returned by ldap_list or ldap_search. + * @return int Returns number of entries in the result. + * @throws LdapException + * + */ +function ldap_count_entries($ldap, $result): int +{ + error_clear_last(); + $safeResult = \ldap_count_entries($ldap, $result); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Deletes a particular entry in LDAP directory. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param string $dn The distinguished name of an LDAP entity. + * @param array $controls Array of LDAP Controls to send with the request. + * @throws LdapException + * + */ +function ldap_delete($ldap, string $dn, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_delete($ldap, $dn, $controls); + } else { + $safeResult = \ldap_delete($ldap, $dn); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Turns the specified dn, into a more user-friendly + * form, stripping off type names. + * + * @param string $dn The distinguished name of an LDAP entity. + * @return string Returns the user friendly name. + * @throws LdapException + * + */ +function ldap_dn2ufn(string $dn): string +{ + error_clear_last(); + $safeResult = \ldap_dn2ufn($dn); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Performs a PASSWD extended operation. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param string $user dn of the user to change the password of. + * @param string $old_password The old password of this user. May be ommited depending of server configuration. + * @param string $new_password The new password for this user. May be omitted or empty to have a generated password. + * @param array $controls If provided, a password policy request control is send with the request and this is + * filled with an array of LDAP Controls + * returned with the request. + * @return string|bool Returns the generated password if new_password is empty or omitted. + * Otherwise returns TRUE on success. + * @throws LdapException + * + */ +function ldap_exop_passwd($ldap, string $user = "", string $old_password = "", string $new_password = "", ?array &$controls = null) +{ + error_clear_last(); + $safeResult = \ldap_exop_passwd($ldap, $user, $old_password, $new_password, $controls); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Performs a WHOAMI extended operation and returns the data. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @return string|bool The data returned by the server. + * @throws LdapException + * + */ +function ldap_exop_whoami($ldap) +{ + error_clear_last(); + $safeResult = \ldap_exop_whoami($ldap); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Performs an extended operation on the specified ldap with + * request_oid the OID of the operation and + * request_data the data. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param string $request_oid 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 $request_data 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|null $controls Array of LDAP Controls to send with the request. + * @param string|null $response_data 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|null $response_oid Will be filled with the response OID if provided, usually equal to the request OID. + * @return resource|bool When used with response_data, returns TRUE on success. + * When used without response_data, returns a result identifier. + * @throws LdapException + * + */ +function ldap_exop($ldap, string $request_oid, ?string $request_data = null, ?array $controls = null, ?string &$response_data = null, ?string &$response_oid = null) +{ + error_clear_last(); + if ($response_oid !== null) { + $safeResult = \ldap_exop($ldap, $request_oid, $request_data, $controls, $response_data, $response_oid); + } elseif ($response_data !== null) { + $safeResult = \ldap_exop($ldap, $request_oid, $request_data, $controls, $response_data); + } elseif ($controls !== null) { + $safeResult = \ldap_exop($ldap, $request_oid, $request_data, $controls); + } elseif ($request_data !== null) { + $safeResult = \ldap_exop($ldap, $request_oid, $request_data); + } else { + $safeResult = \ldap_exop($ldap, $request_oid); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 LdapException + * + */ +function ldap_explode_dn(string $dn, int $with_attrib): array +{ + error_clear_last(); + $safeResult = \ldap_explode_dn($dn, $with_attrib); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $entry An LDAP\ResultEntry instance. + * @return string Returns the first attribute in the entry on success and FALSE on + * error. + * @throws LdapException + * + */ +function ldap_first_attribute($ldap, $entry): string +{ + error_clear_last(); + $safeResult = \ldap_first_attribute($ldap, $entry); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $result An LDAP\Result instance, returned by ldap_list or ldap_search. + * @return resource Returns an LDAP\ResultEntry instance. + * @throws LdapException + * + */ +function ldap_first_entry($ldap, $result) +{ + error_clear_last(); + $safeResult = \ldap_first_entry($ldap, $result); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 An LDAP\Result instance, returned by ldap_list or ldap_search. + * @throws LdapException + * + */ +function ldap_free_result($result): void +{ + error_clear_last(); + $safeResult = \ldap_free_result($result); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Finds out the DN of an entry in the result. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $entry An LDAP\ResultEntry instance. + * @return string Returns the DN of the result entry and FALSE on error. + * @throws LdapException + * + */ +function ldap_get_dn($ldap, $entry): string +{ + error_clear_last(); + $safeResult = \ldap_get_dn($ldap, $entry); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Reads multiple entries from the given result, and then reading the + * attributes and multiple values. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $result An LDAP\Result instance, returned by ldap_list or ldap_search. + * @return array Returns a complete result information in a multi-dimensional array on + * success. + * + * 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 LdapException + * + */ +function ldap_get_entries($ldap, $result): array +{ + error_clear_last(); + $safeResult = \ldap_get_entries($ldap, $result); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Sets value to the value of the specified option. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param int $option The parameter option can be one of: + * + * + * + * + * Option + * Type + * since + * + * + * + * + * LDAP_OPT_DEREF + * int + * + * + * + * LDAP_OPT_SIZELIMIT + * int + * + * + * + * LDAP_OPT_TIMELIMIT + * int + * + * + * + * LDAP_OPT_NETWORK_TIMEOUT + * int + * + * + * + * LDAP_OPT_PROTOCOL_VERSION + * int + * + * + * + * LDAP_OPT_ERROR_NUMBER + * int + * + * + * + * LDAP_OPT_DIAGNOSTIC_MESSAGE + * string + * + * + * + * LDAP_OPT_REFERRALS + * int + * + * + * + * LDAP_OPT_RESTART + * int + * + * + * + * 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 + * int + * 7.1 + * + * + * LDAP_OPT_X_TLS_CRL_NONE + * int + * 7.1 + * + * + * LDAP_OPT_X_TLS_CRL_PEER + * int + * 7.1 + * + * + * LDAP_OPT_X_TLS_CRL_ALL + * int + * 7.1 + * + * + * LDAP_OPT_X_TLS_CRLFILE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_DHFILE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_KEYFILE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_PACKAGE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_PROTOCOL_MIN + * int + * 7.1 + * + * + * LDAP_OPT_X_TLS_RANDOM_FILE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_REQUIRE_CERT + * int + * + * + * + * + * + * @param mixed $value This will be set to the option value. + * @throws LdapException + * + */ +function ldap_get_option($ldap, int $option, &$value = null): void +{ + error_clear_last(); + $safeResult = \ldap_get_option($ldap, $option, $value); + if ($safeResult === false) { + throw 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 $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $entry An LDAP\ResultEntry instance. + * @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 LdapException + * + */ +function ldap_get_values_len($ldap, $entry, string $attribute): array +{ + error_clear_last(); + $safeResult = \ldap_get_values_len($ldap, $entry, $attribute); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Reads all the values of the attribute in the entry in the result. + * + * This call needs a entry, + * 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 $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $entry An LDAP\ResultEntry instance. + * @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 LdapException + * + */ +function ldap_get_values($ldap, $entry, string $attribute): array +{ + error_clear_last(); + $safeResult = \ldap_get_values($ldap, $entry, $attribute); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Adds one or more attribute values to the specified dn. + * To add a whole new object see ldap_add function. + * + * @param resource $ldap An LDAP\Connection instance, 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 $controls Array of LDAP Controls to send with the request. + * @throws LdapException + * + */ +function ldap_mod_add($ldap, string $dn, array $entry, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_mod_add($ldap, $dn, $entry, $controls); + } else { + $safeResult = \ldap_mod_add($ldap, $dn, $entry); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Removes one or more attribute values from the specified dn. + * Object deletions are done by the + * ldap_delete function. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param string $dn The distinguished name of an LDAP entity. + * @param array $entry + * @param array $controls Array of LDAP Controls to send with the request. + * @throws LdapException + * + */ +function ldap_mod_del($ldap, string $dn, array $entry, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_mod_del($ldap, $dn, $entry, $controls); + } else { + $safeResult = \ldap_mod_del($ldap, $dn, $entry); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Replaces one or more attributes from the specified dn. + * It may also add or remove attributes. + * + * @param resource $ldap An LDAP\Connection instance, 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 $controls Array of LDAP Controls to send with the request. + * @throws LdapException + * + */ +function ldap_mod_replace($ldap, string $dn, array $entry, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_mod_replace($ldap, $dn, $entry, $controls); + } else { + $safeResult = \ldap_mod_replace($ldap, $dn, $entry); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Modifies an existing entry in the LDAP directory. Allows detailed + * specification of the modifications to perform. + * + * @param resource $ldap An LDAP resource, returned by ldap_connect. + * @param string $dn The distinguished name of an LDAP entity. + * @param array $modifications_info 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 $controls Each value specified through values is added (as + * an additional value) to the attribute named by + * attrib. + * @throws LdapException + * + */ +function ldap_modify_batch($ldap, string $dn, array $modifications_info, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_modify_batch($ldap, $dn, $modifications_info, $controls); + } else { + $safeResult = \ldap_modify_batch($ldap, $dn, $modifications_info); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Retrieves the attributes in an entry. The first call to + * ldap_next_attribute is made with the + * entry returned from + * ldap_first_attribute. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $entry An LDAP\ResultEntry instance. + * @return string Returns the next attribute in an entry on success and FALSE on + * error. + * @throws LdapException + * + */ +function ldap_next_attribute($ldap, $entry): string +{ + error_clear_last(); + $safeResult = \ldap_next_attribute($ldap, $entry); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Parse LDAP extended operation data from result object result + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $result An LDAP\Result instance, returned by ldap_list or ldap_search. + * @param string|null $response_data Will be filled by the response data. + * @param string|null $response_oid Will be filled by the response OID. + * @throws LdapException + * + */ +function ldap_parse_exop($ldap, $result, ?string &$response_data = null, ?string &$response_oid = null): void +{ + error_clear_last(); + $safeResult = \ldap_parse_exop($ldap, $result, $response_data, $response_oid); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Parses an LDAP search result. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $result An LDAP\Result instance, returned by ldap_list or ldap_search. + * @param int|null $error_code 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|null $matched_dn 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|null $error_message 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|null $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|null $controls An array of LDAP Controls which have been sent with the response. + * @throws LdapException + * + */ +function ldap_parse_result($ldap, $result, ?int &$error_code, ?string &$matched_dn = null, ?string &$error_message = null, ?array &$referrals = null, ?array &$controls = null): void +{ + error_clear_last(); + $safeResult = \ldap_parse_result($ldap, $result, $error_code, $matched_dn, $error_message, $referrals, $controls); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * The entry specified by dn is renamed/moved. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param string $dn The distinguished name of an LDAP entity. + * @param string $new_rdn The new RDN. + * @param string $new_parent The new parent/superior entry. + * @param bool $delete_old_rdn 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 $controls Array of LDAP Controls to send with the request. + * @throws LdapException + * + */ +function ldap_rename($ldap, string $dn, string $new_rdn, string $new_parent, bool $delete_old_rdn, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_rename($ldap, $dn, $new_rdn, $new_parent, $delete_old_rdn, $controls); + } else { + $safeResult = \ldap_rename($ldap, $dn, $new_rdn, $new_parent, $delete_old_rdn); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * + * + * @param resource $ldap + * @param string $dn + * @param string $password + * @param string $mech + * @param string $realm + * @param string $authc_id + * @param string $authz_id + * @param string $props + * @throws LdapException + * + */ +function ldap_sasl_bind($ldap, ?string $dn = null, ?string $password = null, ?string $mech = null, ?string $realm = null, ?string $authc_id = null, ?string $authz_id = null, ?string $props = null): void +{ + error_clear_last(); + if ($props !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm, $authc_id, $authz_id, $props); + } elseif ($authz_id !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm, $authc_id, $authz_id); + } elseif ($authc_id !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm, $authc_id); + } elseif ($realm !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm); + } elseif ($mech !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech); + } elseif ($password !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn, $password); + } elseif ($dn !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn); + } else { + $safeResult = \ldap_sasl_bind($ldap); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Sets the value of the specified option to be value. + * + * @param resource|null $ldap Either an LDAP\Connection instance, returned by + * ldap_connect, to set the option for that connection, + * or NULL to set the option globally. + * @param int $option The parameter option can be one of: + * + * + * + * + * Option + * Type + * Available since + * + * + * + * + * LDAP_OPT_DEREF + * int + * + * + * + * LDAP_OPT_SIZELIMIT + * int + * + * + * + * LDAP_OPT_TIMELIMIT + * int + * + * + * + * LDAP_OPT_NETWORK_TIMEOUT + * int + * + * + * + * LDAP_OPT_PROTOCOL_VERSION + * int + * + * + * + * LDAP_OPT_ERROR_NUMBER + * int + * + * + * + * 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 + * int + * 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 + * int + * PHP 7.1.0 + * + * + * LDAP_OPT_X_TLS_RANDOM_FILE + * string + * PHP 7.1.0 + * + * + * LDAP_OPT_X_TLS_REQUIRE_CERT + * int + * 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 $value The new value for the specified option. + * @throws LdapException + * + */ +function ldap_set_option($ldap, int $option, $value): void +{ + error_clear_last(); + $safeResult = \ldap_set_option($ldap, $option, $value); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Unbinds from the LDAP directory. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @throws LdapException + * + */ +function ldap_unbind($ldap): void +{ + error_clear_last(); + $safeResult = \ldap_unbind($ldap); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} diff --git a/generated/8.4/libxml.php b/generated/8.4/libxml.php new file mode 100644 index 00000000..a2c9c99c --- /dev/null +++ b/generated/8.4/libxml.php @@ -0,0 +1,78 @@ + + * + * The above example will output: + * + * example: , this is a test + * example: , this is a test + * ]]> + * + * + * So, $out[0] contains an array of strings that matched the full pattern, + * and $out[1] contains an array of strings enclosed by tags. + * + * + * + * + * If the pattern contains named subpatterns, $matches + * additionally contains entries for keys with the subpattern name. + * + * + * 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 (in bytes) 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 an array of strings that matched the full pattern, + * and $out[1] contains an array of strings enclosed by tags. + * + * + * + * The above example will output: + * + * So, $out[0] contains an array of strings that matched the full pattern, + * and $out[1] contains an array of strings enclosed by tags. + * + * If the pattern contains named subpatterns, $matches + * additionally contains entries for keys with the subpattern name. + * + * 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 (in bytes) 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 an array of strings that matched the full pattern, + * and $out[1] contains an array of strings enclosed by tags. + * + * + * + * The above example will output: + * + * So, $out[0] contains an array of strings that matched the full pattern, + * and $out[1] contains an array of strings enclosed by tags. + * + * If the pattern contains named subpatterns, $matches + * additionally contains entries for keys with the subpattern name. + * + * 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|null Returns the number of full pattern matches (which might be zero). + * @throws PcreException + * + */ +function preg_match_all(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): ?int +{ + error_clear_last(); + $safeResult = \preg_match_all($pattern, $subject, $matches, $flags, $offset); + if ($safeResult === false) { + throw PcreException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 string[]|null $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 (in bytes) 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 (in bytes) 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 (in bytes) 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 PcreException + * + */ +function preg_match(string $pattern, string $subject, ?iterable &$matches = null, int $flags = 0, int $offset = 0): int +{ + error_clear_last(); + $safeResult = \preg_match($pattern, $subject, $matches, $flags, $offset); + if ($safeResult === false) { + throw PcreException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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". + * @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 PcreException + * + */ +function preg_split(string $pattern, string $subject, ?int $limit = -1, int $flags = 0): array +{ + error_clear_last(); + $safeResult = \preg_split($pattern, $subject, $limit, $flags); + if ($safeResult === false) { + throw PcreException::createFromPhpError(); + } + return $safeResult; +} diff --git a/generated/8.4/pgsql.php b/generated/8.4/pgsql.php new file mode 100644 index 00000000..0e2bfea1 --- /dev/null +++ b/generated/8.4/pgsql.php @@ -0,0 +1,1398 @@ +ruleWithConfiguration( + RenameFunctionRector::class, + [ 'apache_getenv' => 'Safe\apache_getenv', + 'apache_get_version' => 'Safe\apache_get_version', + 'apache_lookup_uri' => 'Safe\apache_lookup_uri', + 'apache_setenv' => 'Safe\apache_setenv', + 'apcu_cache_info' => 'Safe\apcu_cache_info', + 'apcu_cas' => 'Safe\apcu_cas', + 'apcu_dec' => 'Safe\apcu_dec', + 'apcu_fetch' => 'Safe\apcu_fetch', + 'apcu_inc' => 'Safe\apcu_inc', + 'apcu_sma_info' => 'Safe\apcu_sma_info', + 'apc_fetch' => 'Safe\apc_fetch', + 'array_all' => 'Safe\array_all', + 'base64_decode' => 'Safe\base64_decode', + 'bindtextdomain' => 'Safe\bindtextdomain', + 'bzclose' => 'Safe\bzclose', + 'bzflush' => 'Safe\bzflush', + 'bzread' => 'Safe\bzread', + 'bzwrite' => 'Safe\bzwrite', + 'chdir' => 'Safe\chdir', + 'chgrp' => 'Safe\chgrp', + 'chmod' => 'Safe\chmod', + 'chown' => 'Safe\chown', + 'chroot' => 'Safe\chroot', + 'class_alias' => 'Safe\class_alias', + 'class_implements' => 'Safe\class_implements', + 'class_parents' => 'Safe\class_parents', + 'class_uses' => 'Safe\class_uses', + 'cli_set_process_title' => 'Safe\cli_set_process_title', + 'com_create_guid' => 'Safe\com_create_guid', + 'com_event_sink' => 'Safe\com_event_sink', + 'com_load_typelib' => 'Safe\com_load_typelib', + 'com_print_typeinfo' => 'Safe\com_print_typeinfo', + 'convert_uudecode' => 'Safe\convert_uudecode', + 'copy' => 'Safe\copy', + 'create_function' => 'Safe\create_function', + 'cubrid_bind' => 'Safe\cubrid_bind', + 'cubrid_column_names' => 'Safe\cubrid_column_names', + 'cubrid_column_types' => 'Safe\cubrid_column_types', + 'cubrid_col_size' => 'Safe\cubrid_col_size', + 'cubrid_commit' => 'Safe\cubrid_commit', + 'cubrid_connect' => 'Safe\cubrid_connect', + 'cubrid_connect_with_url' => 'Safe\cubrid_connect_with_url', + 'cubrid_current_oid' => 'Safe\cubrid_current_oid', + 'cubrid_disconnect' => 'Safe\cubrid_disconnect', + 'cubrid_drop' => 'Safe\cubrid_drop', + 'cubrid_free_result' => 'Safe\cubrid_free_result', + 'cubrid_get_charset' => 'Safe\cubrid_get_charset', + 'cubrid_get_class_name' => 'Safe\cubrid_get_class_name', + 'cubrid_get_client_info' => 'Safe\cubrid_get_client_info', + 'cubrid_get_db_parameter' => 'Safe\cubrid_get_db_parameter', + 'cubrid_get_query_timeout' => 'Safe\cubrid_get_query_timeout', + 'cubrid_get_server_info' => 'Safe\cubrid_get_server_info', + 'cubrid_insert_id' => 'Safe\cubrid_insert_id', + 'cubrid_lob2_bind' => 'Safe\cubrid_lob2_bind', + 'cubrid_lob2_close' => 'Safe\cubrid_lob2_close', + 'cubrid_lob2_export' => 'Safe\cubrid_lob2_export', + 'cubrid_lob2_import' => 'Safe\cubrid_lob2_import', + 'cubrid_lob2_new' => 'Safe\cubrid_lob2_new', + 'cubrid_lob2_read' => 'Safe\cubrid_lob2_read', + 'cubrid_lob2_seek' => 'Safe\cubrid_lob2_seek', + 'cubrid_lob2_seek64' => 'Safe\cubrid_lob2_seek64', + 'cubrid_lob2_size' => 'Safe\cubrid_lob2_size', + 'cubrid_lob2_size64' => 'Safe\cubrid_lob2_size64', + 'cubrid_lob2_tell' => 'Safe\cubrid_lob2_tell', + 'cubrid_lob2_tell64' => 'Safe\cubrid_lob2_tell64', + 'cubrid_lob2_write' => 'Safe\cubrid_lob2_write', + 'cubrid_lob_close' => 'Safe\cubrid_lob_close', + 'cubrid_lob_export' => 'Safe\cubrid_lob_export', + 'cubrid_lob_get' => 'Safe\cubrid_lob_get', + 'cubrid_lob_send' => 'Safe\cubrid_lob_send', + 'cubrid_lob_size' => 'Safe\cubrid_lob_size', + 'cubrid_lock_read' => 'Safe\cubrid_lock_read', + 'cubrid_lock_write' => 'Safe\cubrid_lock_write', + 'cubrid_move_cursor' => 'Safe\cubrid_move_cursor', + 'cubrid_next_result' => 'Safe\cubrid_next_result', + 'cubrid_pconnect' => 'Safe\cubrid_pconnect', + 'cubrid_pconnect_with_url' => 'Safe\cubrid_pconnect_with_url', + 'cubrid_prepare' => 'Safe\cubrid_prepare', + 'cubrid_put' => 'Safe\cubrid_put', + 'cubrid_rollback' => 'Safe\cubrid_rollback', + 'cubrid_schema' => 'Safe\cubrid_schema', + 'cubrid_seq_drop' => 'Safe\cubrid_seq_drop', + 'cubrid_seq_insert' => 'Safe\cubrid_seq_insert', + 'cubrid_seq_put' => 'Safe\cubrid_seq_put', + 'cubrid_set_add' => 'Safe\cubrid_set_add', + 'cubrid_set_autocommit' => 'Safe\cubrid_set_autocommit', + 'cubrid_set_db_parameter' => 'Safe\cubrid_set_db_parameter', + 'cubrid_set_drop' => 'Safe\cubrid_set_drop', + 'cubrid_set_query_timeout' => 'Safe\cubrid_set_query_timeout', + 'curl_copy_handle' => 'Safe\curl_copy_handle', + 'curl_escape' => 'Safe\curl_escape', + 'curl_exec' => 'Safe\curl_exec', + 'curl_getinfo' => 'Safe\curl_getinfo', + 'curl_init' => 'Safe\curl_init', + 'curl_multi_info_read' => 'Safe\curl_multi_info_read', + 'curl_multi_setopt' => 'Safe\curl_multi_setopt', + 'curl_setopt' => 'Safe\curl_setopt', + 'curl_share_setopt' => 'Safe\curl_share_setopt', + 'curl_unescape' => 'Safe\curl_unescape', + 'curl_upkeep' => 'Safe\curl_upkeep', + 'date_create' => 'Safe\date_create', + 'date_create_immutable' => 'Safe\date_create_immutable', + 'date_parse_from_format' => 'Safe\date_parse_from_format', + 'date_sunrise' => 'Safe\date_sunrise', + 'date_sunset' => 'Safe\date_sunset', + 'db2_autocommit' => 'Safe\db2_autocommit', + 'db2_bind_param' => 'Safe\db2_bind_param', + 'db2_client_info' => 'Safe\db2_client_info', + 'db2_close' => 'Safe\db2_close', + 'db2_commit' => 'Safe\db2_commit', + 'db2_execute' => 'Safe\db2_execute', + 'db2_free_result' => 'Safe\db2_free_result', + 'db2_free_stmt' => 'Safe\db2_free_stmt', + 'db2_get_option' => 'Safe\db2_get_option', + 'db2_num_rows' => 'Safe\db2_num_rows', + 'db2_pclose' => 'Safe\db2_pclose', + 'db2_rollback' => 'Safe\db2_rollback', + 'db2_server_info' => 'Safe\db2_server_info', + 'db2_set_option' => 'Safe\db2_set_option', + 'define' => 'Safe\define', + 'deflate_add' => 'Safe\deflate_add', + 'deflate_init' => 'Safe\deflate_init', + 'disk_free_space' => 'Safe\disk_free_space', + 'disk_total_space' => 'Safe\disk_total_space', + 'dl' => 'Safe\dl', + 'dns_get_record' => 'Safe\dns_get_record', + 'eio_busy' => 'Safe\eio_busy', + 'eio_chmod' => 'Safe\eio_chmod', + 'eio_chown' => 'Safe\eio_chown', + 'eio_close' => 'Safe\eio_close', + 'eio_custom' => 'Safe\eio_custom', + 'eio_dup2' => 'Safe\eio_dup2', + 'eio_event_loop' => 'Safe\eio_event_loop', + 'eio_fallocate' => 'Safe\eio_fallocate', + 'eio_fchmod' => 'Safe\eio_fchmod', + 'eio_fchown' => 'Safe\eio_fchown', + 'eio_fdatasync' => 'Safe\eio_fdatasync', + 'eio_fstat' => 'Safe\eio_fstat', + 'eio_fstatvfs' => 'Safe\eio_fstatvfs', + 'eio_fsync' => 'Safe\eio_fsync', + 'eio_ftruncate' => 'Safe\eio_ftruncate', + 'eio_futime' => 'Safe\eio_futime', + 'eio_grp' => 'Safe\eio_grp', + 'eio_lstat' => 'Safe\eio_lstat', + 'eio_mkdir' => 'Safe\eio_mkdir', + 'eio_mknod' => 'Safe\eio_mknod', + 'eio_nop' => 'Safe\eio_nop', + 'eio_readahead' => 'Safe\eio_readahead', + 'eio_readdir' => 'Safe\eio_readdir', + 'eio_readlink' => 'Safe\eio_readlink', + 'eio_rename' => 'Safe\eio_rename', + 'eio_rmdir' => 'Safe\eio_rmdir', + 'eio_seek' => 'Safe\eio_seek', + 'eio_sendfile' => 'Safe\eio_sendfile', + 'eio_stat' => 'Safe\eio_stat', + 'eio_statvfs' => 'Safe\eio_statvfs', + 'eio_symlink' => 'Safe\eio_symlink', + 'eio_sync' => 'Safe\eio_sync', + 'eio_syncfs' => 'Safe\eio_syncfs', + 'eio_sync_file_range' => 'Safe\eio_sync_file_range', + 'eio_truncate' => 'Safe\eio_truncate', + 'eio_unlink' => 'Safe\eio_unlink', + 'eio_utime' => 'Safe\eio_utime', + 'eio_write' => 'Safe\eio_write', + 'error_log' => 'Safe\error_log', + 'exec' => 'Safe\exec', + 'fastcgi_finish_request' => 'Safe\fastcgi_finish_request', + 'fbird_blob_cancel' => 'Safe\fbird_blob_cancel', + 'fclose' => 'Safe\fclose', + 'fdatasync' => 'Safe\fdatasync', + 'fflush' => 'Safe\fflush', + 'fgetcsv' => 'Safe\fgetcsv', + 'file' => 'Safe\file', + 'fileatime' => 'Safe\fileatime', + 'filectime' => 'Safe\filectime', + 'fileinode' => 'Safe\fileinode', + 'filemtime' => 'Safe\filemtime', + 'fileowner' => 'Safe\fileowner', + 'fileperms' => 'Safe\fileperms', + 'filesize' => 'Safe\filesize', + 'file_get_contents' => 'Safe\file_get_contents', + 'file_put_contents' => 'Safe\file_put_contents', + 'filter_input_array' => 'Safe\filter_input_array', + 'filter_var_array' => 'Safe\filter_var_array', + 'finfo_close' => 'Safe\finfo_close', + 'finfo_open' => 'Safe\finfo_open', + 'flock' => 'Safe\flock', + 'fopen' => 'Safe\fopen', + 'fpm_get_status' => 'Safe\fpm_get_status', + 'fputcsv' => 'Safe\fputcsv', + 'fread' => 'Safe\fread', + 'fsockopen' => 'Safe\fsockopen', + 'fstat' => 'Safe\fstat', + 'fsync' => 'Safe\fsync', + 'ftp_alloc' => 'Safe\ftp_alloc', + 'ftp_append' => 'Safe\ftp_append', + 'ftp_cdup' => 'Safe\ftp_cdup', + 'ftp_chdir' => 'Safe\ftp_chdir', + 'ftp_chmod' => 'Safe\ftp_chmod', + 'ftp_close' => 'Safe\ftp_close', + 'ftp_connect' => 'Safe\ftp_connect', + 'ftp_delete' => 'Safe\ftp_delete', + 'ftp_fget' => 'Safe\ftp_fget', + 'ftp_fput' => 'Safe\ftp_fput', + 'ftp_get' => 'Safe\ftp_get', + 'ftp_login' => 'Safe\ftp_login', + 'ftp_mkdir' => 'Safe\ftp_mkdir', + 'ftp_mlsd' => 'Safe\ftp_mlsd', + 'ftp_nb_get' => 'Safe\ftp_nb_get', + 'ftp_nb_put' => 'Safe\ftp_nb_put', + 'ftp_nlist' => 'Safe\ftp_nlist', + 'ftp_pasv' => 'Safe\ftp_pasv', + 'ftp_put' => 'Safe\ftp_put', + 'ftp_pwd' => 'Safe\ftp_pwd', + 'ftp_raw' => 'Safe\ftp_raw', + 'ftp_rename' => 'Safe\ftp_rename', + 'ftp_rmdir' => 'Safe\ftp_rmdir', + 'ftp_site' => 'Safe\ftp_site', + 'ftp_ssl_connect' => 'Safe\ftp_ssl_connect', + 'ftp_systype' => 'Safe\ftp_systype', + 'ftruncate' => 'Safe\ftruncate', + 'fwrite' => 'Safe\fwrite', + 'getcwd' => 'Safe\getcwd', + 'gethostname' => 'Safe\gethostname', + 'getimagesize' => 'Safe\getimagesize', + 'getlastmod' => 'Safe\getlastmod', + 'getmygid' => 'Safe\getmygid', + 'getmyinode' => 'Safe\getmyinode', + 'getmypid' => 'Safe\getmypid', + 'getmyuid' => 'Safe\getmyuid', + 'getopt' => 'Safe\getopt', + 'getprotobyname' => 'Safe\getprotobyname', + 'getprotobynumber' => 'Safe\getprotobynumber', + 'getrusage' => 'Safe\getrusage', + 'getservbyport' => 'Safe\getservbyport', + 'get_headers' => 'Safe\get_headers', + 'get_include_path' => 'Safe\get_include_path', + 'get_meta_tags' => 'Safe\get_meta_tags', + 'glob' => 'Safe\glob', + 'gmstrftime' => 'Safe\gmstrftime', + 'gnupg_adddecryptkey' => 'Safe\gnupg_adddecryptkey', + 'gnupg_addencryptkey' => 'Safe\gnupg_addencryptkey', + 'gnupg_addsignkey' => 'Safe\gnupg_addsignkey', + 'gnupg_cleardecryptkeys' => 'Safe\gnupg_cleardecryptkeys', + 'gnupg_clearencryptkeys' => 'Safe\gnupg_clearencryptkeys', + 'gnupg_clearsignkeys' => 'Safe\gnupg_clearsignkeys', + 'gnupg_deletekey' => 'Safe\gnupg_deletekey', + 'gnupg_setarmor' => 'Safe\gnupg_setarmor', + 'gnupg_setsignmode' => 'Safe\gnupg_setsignmode', + 'gzclose' => 'Safe\gzclose', + 'gzcompress' => 'Safe\gzcompress', + 'gzdecode' => 'Safe\gzdecode', + 'gzdeflate' => 'Safe\gzdeflate', + 'gzencode' => 'Safe\gzencode', + 'gzfile' => 'Safe\gzfile', + 'gzgets' => 'Safe\gzgets', + 'gzgetss' => 'Safe\gzgetss', + 'gzinflate' => 'Safe\gzinflate', + 'gzopen' => 'Safe\gzopen', + 'gzread' => 'Safe\gzread', + 'gzrewind' => 'Safe\gzrewind', + 'gzuncompress' => 'Safe\gzuncompress', + 'gzwrite' => 'Safe\gzwrite', + 'hash_update_file' => 'Safe\hash_update_file', + 'header_register_callback' => 'Safe\header_register_callback', + 'hex2bin' => 'Safe\hex2bin', + 'highlight_file' => 'Safe\highlight_file', + 'hrtime' => 'Safe\hrtime', + 'ibase_add_user' => 'Safe\ibase_add_user', + 'ibase_backup' => 'Safe\ibase_backup', + 'ibase_blob_cancel' => 'Safe\ibase_blob_cancel', + 'ibase_blob_create' => 'Safe\ibase_blob_create', + 'ibase_blob_get' => 'Safe\ibase_blob_get', + 'ibase_close' => 'Safe\ibase_close', + 'ibase_commit' => 'Safe\ibase_commit', + 'ibase_commit_ret' => 'Safe\ibase_commit_ret', + 'ibase_connect' => 'Safe\ibase_connect', + 'ibase_delete_user' => 'Safe\ibase_delete_user', + 'ibase_drop_db' => 'Safe\ibase_drop_db', + 'ibase_free_event_handler' => 'Safe\ibase_free_event_handler', + 'ibase_free_query' => 'Safe\ibase_free_query', + 'ibase_free_result' => 'Safe\ibase_free_result', + 'ibase_maintain_db' => 'Safe\ibase_maintain_db', + 'ibase_modify_user' => 'Safe\ibase_modify_user', + 'ibase_name_result' => 'Safe\ibase_name_result', + 'ibase_pconnect' => 'Safe\ibase_pconnect', + 'ibase_restore' => 'Safe\ibase_restore', + 'ibase_rollback' => 'Safe\ibase_rollback', + 'ibase_rollback_ret' => 'Safe\ibase_rollback_ret', + 'ibase_service_attach' => 'Safe\ibase_service_attach', + 'ibase_service_detach' => 'Safe\ibase_service_detach', + 'iconv' => 'Safe\iconv', + 'iconv_get_encoding' => 'Safe\iconv_get_encoding', + 'iconv_set_encoding' => 'Safe\iconv_set_encoding', + 'idate' => 'Safe\idate', + 'image2wbmp' => 'Safe\image2wbmp', + 'imageaffine' => 'Safe\imageaffine', + 'imageaffinematrixconcat' => 'Safe\imageaffinematrixconcat', + 'imageaffinematrixget' => 'Safe\imageaffinematrixget', + 'imagealphablending' => 'Safe\imagealphablending', + 'imageantialias' => 'Safe\imageantialias', + 'imagearc' => 'Safe\imagearc', + 'imageavif' => 'Safe\imageavif', + 'imagebmp' => 'Safe\imagebmp', + 'imagechar' => 'Safe\imagechar', + 'imagecharup' => 'Safe\imagecharup', + 'imagecolorat' => 'Safe\imagecolorat', + 'imagecolordeallocate' => 'Safe\imagecolordeallocate', + 'imagecolormatch' => 'Safe\imagecolormatch', + 'imagecolorset' => 'Safe\imagecolorset', + 'imageconvolution' => 'Safe\imageconvolution', + 'imagecopy' => 'Safe\imagecopy', + 'imagecopymerge' => 'Safe\imagecopymerge', + 'imagecopymergegray' => 'Safe\imagecopymergegray', + 'imagecopyresampled' => 'Safe\imagecopyresampled', + 'imagecopyresized' => 'Safe\imagecopyresized', + 'imagecreate' => 'Safe\imagecreate', + 'imagecreatefromavif' => 'Safe\imagecreatefromavif', + 'imagecreatefrombmp' => 'Safe\imagecreatefrombmp', + 'imagecreatefromgd' => 'Safe\imagecreatefromgd', + 'imagecreatefromgd2' => 'Safe\imagecreatefromgd2', + 'imagecreatefromgd2part' => 'Safe\imagecreatefromgd2part', + 'imagecreatefromgif' => 'Safe\imagecreatefromgif', + 'imagecreatefromjpeg' => 'Safe\imagecreatefromjpeg', + 'imagecreatefrompng' => 'Safe\imagecreatefrompng', + 'imagecreatefromstring' => 'Safe\imagecreatefromstring', + 'imagecreatefromtga' => 'Safe\imagecreatefromtga', + 'imagecreatefromwbmp' => 'Safe\imagecreatefromwbmp', + 'imagecreatefromwebp' => 'Safe\imagecreatefromwebp', + 'imagecreatefromxbm' => 'Safe\imagecreatefromxbm', + 'imagecreatefromxpm' => 'Safe\imagecreatefromxpm', + 'imagecreatetruecolor' => 'Safe\imagecreatetruecolor', + 'imagecrop' => 'Safe\imagecrop', + 'imagecropauto' => 'Safe\imagecropauto', + 'imagedashedline' => 'Safe\imagedashedline', + 'imagedestroy' => 'Safe\imagedestroy', + 'imageellipse' => 'Safe\imageellipse', + 'imagefill' => 'Safe\imagefill', + 'imagefilledarc' => 'Safe\imagefilledarc', + 'imagefilledellipse' => 'Safe\imagefilledellipse', + 'imagefilledrectangle' => 'Safe\imagefilledrectangle', + 'imagefilltoborder' => 'Safe\imagefilltoborder', + 'imagefilter' => 'Safe\imagefilter', + 'imageflip' => 'Safe\imageflip', + 'imageftbbox' => 'Safe\imageftbbox', + 'imagefttext' => 'Safe\imagefttext', + 'imagegammacorrect' => 'Safe\imagegammacorrect', + 'imagegd' => 'Safe\imagegd', + 'imagegd2' => 'Safe\imagegd2', + 'imagegif' => 'Safe\imagegif', + 'imagegrabscreen' => 'Safe\imagegrabscreen', + 'imagegrabwindow' => 'Safe\imagegrabwindow', + 'imagejpeg' => 'Safe\imagejpeg', + 'imagelayereffect' => 'Safe\imagelayereffect', + 'imageline' => 'Safe\imageline', + 'imageloadfont' => 'Safe\imageloadfont', + 'imagepng' => 'Safe\imagepng', + 'imagerectangle' => 'Safe\imagerectangle', + 'imageresolution' => 'Safe\imageresolution', + 'imagerotate' => 'Safe\imagerotate', + 'imagesavealpha' => 'Safe\imagesavealpha', + 'imagescale' => 'Safe\imagescale', + 'imagesetbrush' => 'Safe\imagesetbrush', + 'imagesetclip' => 'Safe\imagesetclip', + 'imagesetinterpolation' => 'Safe\imagesetinterpolation', + 'imagesetpixel' => 'Safe\imagesetpixel', + 'imagesetstyle' => 'Safe\imagesetstyle', + 'imagesetthickness' => 'Safe\imagesetthickness', + 'imagesettile' => 'Safe\imagesettile', + 'imagestring' => 'Safe\imagestring', + 'imagestringup' => 'Safe\imagestringup', + 'imagetruecolortopalette' => 'Safe\imagetruecolortopalette', + 'imagettfbbox' => 'Safe\imagettfbbox', + 'imagettftext' => 'Safe\imagettftext', + 'imagewbmp' => 'Safe\imagewbmp', + 'imagewebp' => 'Safe\imagewebp', + 'imagexbm' => 'Safe\imagexbm', + 'image_type_to_extension' => 'Safe\image_type_to_extension', + 'imap_8bit' => 'Safe\imap_8bit', + 'imap_append' => 'Safe\imap_append', + 'imap_base64' => 'Safe\imap_base64', + 'imap_binary' => 'Safe\imap_binary', + 'imap_body' => 'Safe\imap_body', + 'imap_bodystruct' => 'Safe\imap_bodystruct', + 'imap_check' => 'Safe\imap_check', + 'imap_createmailbox' => 'Safe\imap_createmailbox', + 'imap_deletemailbox' => 'Safe\imap_deletemailbox', + 'imap_fetchbody' => 'Safe\imap_fetchbody', + 'imap_fetchheader' => 'Safe\imap_fetchheader', + 'imap_fetchmime' => 'Safe\imap_fetchmime', + 'imap_fetchstructure' => 'Safe\imap_fetchstructure', + 'imap_fetch_overview' => 'Safe\imap_fetch_overview', + 'imap_getacl' => 'Safe\imap_getacl', + 'imap_getmailboxes' => 'Safe\imap_getmailboxes', + 'imap_getsubscribed' => 'Safe\imap_getsubscribed', + 'imap_headerinfo' => 'Safe\imap_headerinfo', + 'imap_headers' => 'Safe\imap_headers', + 'imap_listscan' => 'Safe\imap_listscan', + 'imap_lsub' => 'Safe\imap_lsub', + 'imap_mail' => 'Safe\imap_mail', + 'imap_mail_compose' => 'Safe\imap_mail_compose', + 'imap_mail_copy' => 'Safe\imap_mail_copy', + 'imap_mail_move' => 'Safe\imap_mail_move', + 'imap_mime_header_decode' => 'Safe\imap_mime_header_decode', + 'imap_mutf7_to_utf8' => 'Safe\imap_mutf7_to_utf8', + 'imap_num_msg' => 'Safe\imap_num_msg', + 'imap_open' => 'Safe\imap_open', + 'imap_qprint' => 'Safe\imap_qprint', + 'imap_renamemailbox' => 'Safe\imap_renamemailbox', + 'imap_rfc822_write_address' => 'Safe\imap_rfc822_write_address', + 'imap_savebody' => 'Safe\imap_savebody', + 'imap_setacl' => 'Safe\imap_setacl', + 'imap_set_quota' => 'Safe\imap_set_quota', + 'imap_sort' => 'Safe\imap_sort', + 'imap_status' => 'Safe\imap_status', + 'imap_subscribe' => 'Safe\imap_subscribe', + 'imap_thread' => 'Safe\imap_thread', + 'imap_timeout' => 'Safe\imap_timeout', + 'imap_unsubscribe' => 'Safe\imap_unsubscribe', + 'imap_utf8_to_mutf7' => 'Safe\imap_utf8_to_mutf7', + 'inet_ntop' => 'Safe\inet_ntop', + 'inet_pton' => 'Safe\inet_pton', + 'inflate_add' => 'Safe\inflate_add', + 'inflate_get_read_len' => 'Safe\inflate_get_read_len', + 'inflate_init' => 'Safe\inflate_init', + 'ini_get' => 'Safe\ini_get', + 'ini_set' => 'Safe\ini_set', + 'inotify_add_watch' => 'Safe\inotify_add_watch', + 'inotify_init' => 'Safe\inotify_init', + 'inotify_rm_watch' => 'Safe\inotify_rm_watch', + 'iptcembed' => 'Safe\iptcembed', + 'iptcparse' => 'Safe\iptcparse', + 'jpeg2wbmp' => 'Safe\jpeg2wbmp', + 'json_decode' => 'Safe\json_decode', + 'json_encode' => 'Safe\json_encode', + 'lchgrp' => 'Safe\lchgrp', + 'lchown' => 'Safe\lchown', + 'ldap_8859_to_t61' => 'Safe\ldap_8859_to_t61', + 'ldap_add' => 'Safe\ldap_add', + 'ldap_bind' => 'Safe\ldap_bind', + 'ldap_control_paged_result' => 'Safe\ldap_control_paged_result', + 'ldap_control_paged_result_response' => 'Safe\ldap_control_paged_result_response', + 'ldap_count_entries' => 'Safe\ldap_count_entries', + 'ldap_delete' => 'Safe\ldap_delete', + 'ldap_dn2ufn' => 'Safe\ldap_dn2ufn', + 'ldap_exop' => 'Safe\ldap_exop', + 'ldap_exop_passwd' => 'Safe\ldap_exop_passwd', + 'ldap_exop_whoami' => 'Safe\ldap_exop_whoami', + 'ldap_explode_dn' => 'Safe\ldap_explode_dn', + 'ldap_first_attribute' => 'Safe\ldap_first_attribute', + 'ldap_first_entry' => 'Safe\ldap_first_entry', + 'ldap_free_result' => 'Safe\ldap_free_result', + 'ldap_get_dn' => 'Safe\ldap_get_dn', + 'ldap_get_entries' => 'Safe\ldap_get_entries', + 'ldap_get_option' => 'Safe\ldap_get_option', + 'ldap_get_values' => 'Safe\ldap_get_values', + 'ldap_get_values_len' => 'Safe\ldap_get_values_len', + 'ldap_modify_batch' => 'Safe\ldap_modify_batch', + 'ldap_mod_add' => 'Safe\ldap_mod_add', + 'ldap_mod_del' => 'Safe\ldap_mod_del', + 'ldap_mod_replace' => 'Safe\ldap_mod_replace', + 'ldap_next_attribute' => 'Safe\ldap_next_attribute', + 'ldap_parse_exop' => 'Safe\ldap_parse_exop', + 'ldap_parse_result' => 'Safe\ldap_parse_result', + 'ldap_rename' => 'Safe\ldap_rename', + 'ldap_sasl_bind' => 'Safe\ldap_sasl_bind', + 'ldap_set_option' => 'Safe\ldap_set_option', + 'ldap_unbind' => 'Safe\ldap_unbind', + 'libxml_get_last_error' => 'Safe\libxml_get_last_error', + 'libxml_set_external_entity_loader' => 'Safe\libxml_set_external_entity_loader', + 'link' => 'Safe\link', + 'lstat' => 'Safe\lstat', + 'lzf_compress' => 'Safe\lzf_compress', + 'lzf_decompress' => 'Safe\lzf_decompress', + 'mailparse_msg_extract_part_file' => 'Safe\mailparse_msg_extract_part_file', + 'mailparse_msg_free' => 'Safe\mailparse_msg_free', + 'mailparse_msg_parse' => 'Safe\mailparse_msg_parse', + 'mailparse_msg_parse_file' => 'Safe\mailparse_msg_parse_file', + 'mailparse_stream_encode' => 'Safe\mailparse_stream_encode', + 'mb_chr' => 'Safe\mb_chr', + 'mb_convert_encoding' => 'Safe\mb_convert_encoding', + 'mb_detect_order' => 'Safe\mb_detect_order', + 'mb_eregi_replace' => 'Safe\mb_eregi_replace', + 'mb_ereg_replace' => 'Safe\mb_ereg_replace', + 'mb_ereg_replace_callback' => 'Safe\mb_ereg_replace_callback', + 'mb_ereg_search_getregs' => 'Safe\mb_ereg_search_getregs', + 'mb_ereg_search_init' => 'Safe\mb_ereg_search_init', + 'mb_ereg_search_regs' => 'Safe\mb_ereg_search_regs', + 'mb_ereg_search_setpos' => 'Safe\mb_ereg_search_setpos', + 'mb_get_info' => 'Safe\mb_get_info', + 'mb_http_output' => 'Safe\mb_http_output', + 'mb_internal_encoding' => 'Safe\mb_internal_encoding', + 'mb_ord' => 'Safe\mb_ord', + 'mb_parse_str' => 'Safe\mb_parse_str', + 'mb_regex_encoding' => 'Safe\mb_regex_encoding', + 'mb_send_mail' => 'Safe\mb_send_mail', + 'mb_split' => 'Safe\mb_split', + 'md5_file' => 'Safe\md5_file', + 'mime_content_type' => 'Safe\mime_content_type', + 'mkdir' => 'Safe\mkdir', + 'msg_get_queue' => 'Safe\msg_get_queue', + 'msg_queue_exists' => 'Safe\msg_queue_exists', + 'msg_receive' => 'Safe\msg_receive', + 'msg_remove_queue' => 'Safe\msg_remove_queue', + 'msg_send' => 'Safe\msg_send', + 'msg_set_queue' => 'Safe\msg_set_queue', + 'msg_stat_queue' => 'Safe\msg_stat_queue', + 'mysql_close' => 'Safe\mysql_close', + 'mysql_connect' => 'Safe\mysql_connect', + 'mysql_create_db' => 'Safe\mysql_create_db', + 'mysql_data_seek' => 'Safe\mysql_data_seek', + 'mysql_db_name' => 'Safe\mysql_db_name', + 'mysql_db_query' => 'Safe\mysql_db_query', + 'mysql_drop_db' => 'Safe\mysql_drop_db', + 'mysql_fetch_lengths' => 'Safe\mysql_fetch_lengths', + 'mysql_field_flags' => 'Safe\mysql_field_flags', + 'mysql_field_len' => 'Safe\mysql_field_len', + 'mysql_field_name' => 'Safe\mysql_field_name', + 'mysql_field_seek' => 'Safe\mysql_field_seek', + 'mysql_free_result' => 'Safe\mysql_free_result', + 'mysql_get_host_info' => 'Safe\mysql_get_host_info', + 'mysql_get_proto_info' => 'Safe\mysql_get_proto_info', + 'mysql_get_server_info' => 'Safe\mysql_get_server_info', + 'mysql_info' => 'Safe\mysql_info', + 'mysql_list_dbs' => 'Safe\mysql_list_dbs', + 'mysql_list_fields' => 'Safe\mysql_list_fields', + 'mysql_list_processes' => 'Safe\mysql_list_processes', + 'mysql_list_tables' => 'Safe\mysql_list_tables', + 'mysql_num_fields' => 'Safe\mysql_num_fields', + 'mysql_num_rows' => 'Safe\mysql_num_rows', + 'mysql_query' => 'Safe\mysql_query', + 'mysql_real_escape_string' => 'Safe\mysql_real_escape_string', + 'mysql_result' => 'Safe\mysql_result', + 'mysql_select_db' => 'Safe\mysql_select_db', + 'mysql_set_charset' => 'Safe\mysql_set_charset', + 'mysql_tablename' => 'Safe\mysql_tablename', + 'mysql_thread_id' => 'Safe\mysql_thread_id', + 'mysql_unbuffered_query' => 'Safe\mysql_unbuffered_query', + 'net_get_interfaces' => 'Safe\net_get_interfaces', + 'ob_clean' => 'Safe\ob_clean', + 'ob_end_clean' => 'Safe\ob_end_clean', + 'ob_end_flush' => 'Safe\ob_end_flush', + 'ob_flush' => 'Safe\ob_flush', + 'ob_get_clean' => 'Safe\ob_get_clean', + 'ob_get_flush' => 'Safe\ob_get_flush', + 'ob_start' => 'Safe\ob_start', + 'oci_bind_array_by_name' => 'Safe\oci_bind_array_by_name', + 'oci_bind_by_name' => 'Safe\oci_bind_by_name', + 'oci_cancel' => 'Safe\oci_cancel', + 'oci_commit' => 'Safe\oci_commit', + 'oci_connect' => 'Safe\oci_connect', + 'oci_define_by_name' => 'Safe\oci_define_by_name', + 'oci_execute' => 'Safe\oci_execute', + 'oci_field_name' => 'Safe\oci_field_name', + 'oci_field_precision' => 'Safe\oci_field_precision', + 'oci_field_scale' => 'Safe\oci_field_scale', + 'oci_field_size' => 'Safe\oci_field_size', + 'oci_field_type' => 'Safe\oci_field_type', + 'oci_field_type_raw' => 'Safe\oci_field_type_raw', + 'oci_free_descriptor' => 'Safe\oci_free_descriptor', + 'oci_free_statement' => 'Safe\oci_free_statement', + 'oci_new_collection' => 'Safe\oci_new_collection', + 'oci_new_connect' => 'Safe\oci_new_connect', + 'oci_new_cursor' => 'Safe\oci_new_cursor', + 'oci_new_descriptor' => 'Safe\oci_new_descriptor', + 'oci_num_rows' => 'Safe\oci_num_rows', + 'oci_parse' => 'Safe\oci_parse', + 'oci_pconnect' => 'Safe\oci_pconnect', + 'oci_register_taf_callback' => 'Safe\oci_register_taf_callback', + 'oci_result' => 'Safe\oci_result', + 'oci_rollback' => 'Safe\oci_rollback', + 'oci_server_version' => 'Safe\oci_server_version', + 'oci_set_action' => 'Safe\oci_set_action', + 'oci_set_call_timeout' => 'Safe\oci_set_call_timeout', + 'oci_set_client_identifier' => 'Safe\oci_set_client_identifier', + 'oci_set_client_info' => 'Safe\oci_set_client_info', + 'oci_set_db_operation' => 'Safe\oci_set_db_operation', + 'oci_set_edition' => 'Safe\oci_set_edition', + 'oci_set_module_name' => 'Safe\oci_set_module_name', + 'oci_set_prefetch' => 'Safe\oci_set_prefetch', + 'oci_set_prefetch_lob' => 'Safe\oci_set_prefetch_lob', + 'oci_statement_type' => 'Safe\oci_statement_type', + 'oci_unregister_taf_callback' => 'Safe\oci_unregister_taf_callback', + 'odbc_autocommit' => 'Safe\odbc_autocommit', + 'odbc_commit' => 'Safe\odbc_commit', + 'odbc_connect' => 'Safe\odbc_connect', + 'odbc_cursor' => 'Safe\odbc_cursor', + 'odbc_data_source' => 'Safe\odbc_data_source', + 'odbc_exec' => 'Safe\odbc_exec', + 'odbc_execute' => 'Safe\odbc_execute', + 'odbc_fetch_into' => 'Safe\odbc_fetch_into', + 'odbc_field_len' => 'Safe\odbc_field_len', + 'odbc_field_name' => 'Safe\odbc_field_name', + 'odbc_field_num' => 'Safe\odbc_field_num', + 'odbc_field_scale' => 'Safe\odbc_field_scale', + 'odbc_field_type' => 'Safe\odbc_field_type', + 'odbc_pconnect' => 'Safe\odbc_pconnect', + 'odbc_prepare' => 'Safe\odbc_prepare', + 'odbc_procedures' => 'Safe\odbc_procedures', + 'odbc_result' => 'Safe\odbc_result', + 'odbc_result_all' => 'Safe\odbc_result_all', + 'odbc_rollback' => 'Safe\odbc_rollback', + 'odbc_setoption' => 'Safe\odbc_setoption', + 'odbc_tables' => 'Safe\odbc_tables', + 'opcache_compile_file' => 'Safe\opcache_compile_file', + 'opcache_get_status' => 'Safe\opcache_get_status', + 'opendir' => 'Safe\opendir', + 'openssl_cipher_iv_length' => 'Safe\openssl_cipher_iv_length', + 'openssl_cipher_key_length' => 'Safe\openssl_cipher_key_length', + 'openssl_cms_decrypt' => 'Safe\openssl_cms_decrypt', + 'openssl_cms_encrypt' => 'Safe\openssl_cms_encrypt', + 'openssl_cms_read' => 'Safe\openssl_cms_read', + 'openssl_cms_sign' => 'Safe\openssl_cms_sign', + 'openssl_cms_verify' => 'Safe\openssl_cms_verify', + 'openssl_csr_export' => 'Safe\openssl_csr_export', + 'openssl_csr_export_to_file' => 'Safe\openssl_csr_export_to_file', + 'openssl_csr_get_public_key' => 'Safe\openssl_csr_get_public_key', + 'openssl_csr_get_subject' => 'Safe\openssl_csr_get_subject', + 'openssl_csr_new' => 'Safe\openssl_csr_new', + 'openssl_csr_sign' => 'Safe\openssl_csr_sign', + 'openssl_decrypt' => 'Safe\openssl_decrypt', + 'openssl_dh_compute_key' => 'Safe\openssl_dh_compute_key', + 'openssl_digest' => 'Safe\openssl_digest', + 'openssl_encrypt' => 'Safe\openssl_encrypt', + 'openssl_get_curve_names' => 'Safe\openssl_get_curve_names', + 'openssl_open' => 'Safe\openssl_open', + 'openssl_pbkdf2' => 'Safe\openssl_pbkdf2', + 'openssl_pkcs7_decrypt' => 'Safe\openssl_pkcs7_decrypt', + 'openssl_pkcs7_encrypt' => 'Safe\openssl_pkcs7_encrypt', + 'openssl_pkcs7_read' => 'Safe\openssl_pkcs7_read', + 'openssl_pkcs7_sign' => 'Safe\openssl_pkcs7_sign', + 'openssl_pkcs12_export' => 'Safe\openssl_pkcs12_export', + 'openssl_pkcs12_export_to_file' => 'Safe\openssl_pkcs12_export_to_file', + 'openssl_pkcs12_read' => 'Safe\openssl_pkcs12_read', + 'openssl_pkey_derive' => 'Safe\openssl_pkey_derive', + 'openssl_pkey_export' => 'Safe\openssl_pkey_export', + 'openssl_pkey_export_to_file' => 'Safe\openssl_pkey_export_to_file', + 'openssl_pkey_get_details' => 'Safe\openssl_pkey_get_details', + 'openssl_pkey_get_private' => 'Safe\openssl_pkey_get_private', + 'openssl_pkey_get_public' => 'Safe\openssl_pkey_get_public', + 'openssl_pkey_new' => 'Safe\openssl_pkey_new', + 'openssl_private_decrypt' => 'Safe\openssl_private_decrypt', + 'openssl_private_encrypt' => 'Safe\openssl_private_encrypt', + 'openssl_public_decrypt' => 'Safe\openssl_public_decrypt', + 'openssl_public_encrypt' => 'Safe\openssl_public_encrypt', + 'openssl_seal' => 'Safe\openssl_seal', + 'openssl_sign' => 'Safe\openssl_sign', + 'openssl_spki_export' => 'Safe\openssl_spki_export', + 'openssl_spki_export_challenge' => 'Safe\openssl_spki_export_challenge', + 'openssl_spki_new' => 'Safe\openssl_spki_new', + 'openssl_spki_verify' => 'Safe\openssl_spki_verify', + 'openssl_verify' => 'Safe\openssl_verify', + 'openssl_x509_export' => 'Safe\openssl_x509_export', + 'openssl_x509_export_to_file' => 'Safe\openssl_x509_export_to_file', + 'openssl_x509_fingerprint' => 'Safe\openssl_x509_fingerprint', + 'openssl_x509_read' => 'Safe\openssl_x509_read', + 'output_add_rewrite_var' => 'Safe\output_add_rewrite_var', + 'output_reset_rewrite_vars' => 'Safe\output_reset_rewrite_vars', + 'parse_ini_file' => 'Safe\parse_ini_file', + 'parse_ini_string' => 'Safe\parse_ini_string', + 'parse_url' => 'Safe\parse_url', + 'passthru' => 'Safe\passthru', + 'pcntl_getpriority' => 'Safe\pcntl_getpriority', + 'pcntl_setpriority' => 'Safe\pcntl_setpriority', + 'pcntl_signal' => 'Safe\pcntl_signal', + 'pcntl_signal_dispatch' => 'Safe\pcntl_signal_dispatch', + 'pcntl_sigprocmask' => 'Safe\pcntl_sigprocmask', + 'pcntl_sigtimedwait' => 'Safe\pcntl_sigtimedwait', + 'pcntl_sigwaitinfo' => 'Safe\pcntl_sigwaitinfo', + 'pfsockopen' => 'Safe\pfsockopen', + 'pg_cancel_query' => 'Safe\pg_cancel_query', + 'pg_connect' => 'Safe\pg_connect', + 'pg_connection_reset' => 'Safe\pg_connection_reset', + 'pg_convert' => 'Safe\pg_convert', + 'pg_copy_from' => 'Safe\pg_copy_from', + 'pg_copy_to' => 'Safe\pg_copy_to', + 'pg_delete' => 'Safe\pg_delete', + 'pg_end_copy' => 'Safe\pg_end_copy', + 'pg_execute' => 'Safe\pg_execute', + 'pg_field_table' => 'Safe\pg_field_table', + 'pg_flush' => 'Safe\pg_flush', + 'pg_free_result' => 'Safe\pg_free_result', + 'pg_host' => 'Safe\pg_host', + 'pg_insert' => 'Safe\pg_insert', + 'pg_last_oid' => 'Safe\pg_last_oid', + 'pg_lo_close' => 'Safe\pg_lo_close', + 'pg_lo_export' => 'Safe\pg_lo_export', + 'pg_lo_import' => 'Safe\pg_lo_import', + 'pg_lo_open' => 'Safe\pg_lo_open', + 'pg_lo_read' => 'Safe\pg_lo_read', + 'pg_lo_seek' => 'Safe\pg_lo_seek', + 'pg_lo_truncate' => 'Safe\pg_lo_truncate', + 'pg_lo_unlink' => 'Safe\pg_lo_unlink', + 'pg_lo_write' => 'Safe\pg_lo_write', + 'pg_meta_data' => 'Safe\pg_meta_data', + 'pg_parameter_status' => 'Safe\pg_parameter_status', + 'pg_pconnect' => 'Safe\pg_pconnect', + 'pg_ping' => 'Safe\pg_ping', + 'pg_prepare' => 'Safe\pg_prepare', + 'pg_put_line' => 'Safe\pg_put_line', + 'pg_query' => 'Safe\pg_query', + 'pg_query_params' => 'Safe\pg_query_params', + 'pg_result_error_field' => 'Safe\pg_result_error_field', + 'pg_result_seek' => 'Safe\pg_result_seek', + 'pg_select' => 'Safe\pg_select', + 'pg_set_chunked_rows_size' => 'Safe\pg_set_chunked_rows_size', + 'pg_socket' => 'Safe\pg_socket', + 'pg_trace' => 'Safe\pg_trace', + 'pg_update' => 'Safe\pg_update', + 'php_sapi_name' => 'Safe\php_sapi_name', + 'png2wbmp' => 'Safe\png2wbmp', + 'posix_access' => 'Safe\posix_access', + 'posix_eaccess' => 'Safe\posix_eaccess', + 'posix_getgrgid' => 'Safe\posix_getgrgid', + 'posix_getgrnam' => 'Safe\posix_getgrnam', + 'posix_getgroups' => 'Safe\posix_getgroups', + 'posix_getlogin' => 'Safe\posix_getlogin', + 'posix_getpwuid' => 'Safe\posix_getpwuid', + 'posix_getrlimit' => 'Safe\posix_getrlimit', + 'posix_getsid' => 'Safe\posix_getsid', + 'posix_initgroups' => 'Safe\posix_initgroups', + 'posix_kill' => 'Safe\posix_kill', + 'posix_mkfifo' => 'Safe\posix_mkfifo', + 'posix_mknod' => 'Safe\posix_mknod', + 'posix_setegid' => 'Safe\posix_setegid', + 'posix_seteuid' => 'Safe\posix_seteuid', + 'posix_setgid' => 'Safe\posix_setgid', + 'posix_setpgid' => 'Safe\posix_setpgid', + 'posix_setrlimit' => 'Safe\posix_setrlimit', + 'posix_setuid' => 'Safe\posix_setuid', + 'posix_times' => 'Safe\posix_times', + 'posix_uname' => 'Safe\posix_uname', + 'preg_grep' => 'Safe\preg_grep', + 'preg_match' => 'Safe\preg_match', + 'preg_match_all' => 'Safe\preg_match_all', + 'preg_replace' => 'Safe\preg_replace', + 'preg_split' => 'Safe\preg_split', + 'proc_nice' => 'Safe\proc_nice', + 'pspell_add_to_personal' => 'Safe\pspell_add_to_personal', + 'pspell_add_to_session' => 'Safe\pspell_add_to_session', + 'pspell_clear_session' => 'Safe\pspell_clear_session', + 'pspell_config_data_dir' => 'Safe\pspell_config_data_dir', + 'pspell_config_dict_dir' => 'Safe\pspell_config_dict_dir', + 'pspell_config_ignore' => 'Safe\pspell_config_ignore', + 'pspell_config_mode' => 'Safe\pspell_config_mode', + 'pspell_config_personal' => 'Safe\pspell_config_personal', + 'pspell_config_repl' => 'Safe\pspell_config_repl', + 'pspell_config_runtogether' => 'Safe\pspell_config_runtogether', + 'pspell_config_save_repl' => 'Safe\pspell_config_save_repl', + 'pspell_new' => 'Safe\pspell_new', + 'pspell_new_config' => 'Safe\pspell_new_config', + 'pspell_new_personal' => 'Safe\pspell_new_personal', + 'pspell_save_wordlist' => 'Safe\pspell_save_wordlist', + 'pspell_store_replacement' => 'Safe\pspell_store_replacement', + 'ps_add_launchlink' => 'Safe\ps_add_launchlink', + 'ps_add_locallink' => 'Safe\ps_add_locallink', + 'ps_add_note' => 'Safe\ps_add_note', + 'ps_add_pdflink' => 'Safe\ps_add_pdflink', + 'ps_add_weblink' => 'Safe\ps_add_weblink', + 'ps_arc' => 'Safe\ps_arc', + 'ps_arcn' => 'Safe\ps_arcn', + 'ps_begin_page' => 'Safe\ps_begin_page', + 'ps_begin_pattern' => 'Safe\ps_begin_pattern', + 'ps_begin_template' => 'Safe\ps_begin_template', + 'ps_circle' => 'Safe\ps_circle', + 'ps_clip' => 'Safe\ps_clip', + 'ps_close' => 'Safe\ps_close', + 'ps_closepath' => 'Safe\ps_closepath', + 'ps_closepath_stroke' => 'Safe\ps_closepath_stroke', + 'ps_close_image' => 'Safe\ps_close_image', + 'ps_continue_text' => 'Safe\ps_continue_text', + 'ps_curveto' => 'Safe\ps_curveto', + 'ps_delete' => 'Safe\ps_delete', + 'ps_end_page' => 'Safe\ps_end_page', + 'ps_end_pattern' => 'Safe\ps_end_pattern', + 'ps_end_template' => 'Safe\ps_end_template', + 'ps_fill' => 'Safe\ps_fill', + 'ps_fill_stroke' => 'Safe\ps_fill_stroke', + 'ps_get_parameter' => 'Safe\ps_get_parameter', + 'ps_hyphenate' => 'Safe\ps_hyphenate', + 'ps_include_file' => 'Safe\ps_include_file', + 'ps_lineto' => 'Safe\ps_lineto', + 'ps_moveto' => 'Safe\ps_moveto', + 'ps_new' => 'Safe\ps_new', + 'ps_open_file' => 'Safe\ps_open_file', + 'ps_place_image' => 'Safe\ps_place_image', + 'ps_rect' => 'Safe\ps_rect', + 'ps_restore' => 'Safe\ps_restore', + 'ps_rotate' => 'Safe\ps_rotate', + 'ps_save' => 'Safe\ps_save', + 'ps_scale' => 'Safe\ps_scale', + 'ps_setcolor' => 'Safe\ps_setcolor', + 'ps_setdash' => 'Safe\ps_setdash', + 'ps_setflat' => 'Safe\ps_setflat', + 'ps_setfont' => 'Safe\ps_setfont', + 'ps_setgray' => 'Safe\ps_setgray', + 'ps_setlinecap' => 'Safe\ps_setlinecap', + 'ps_setlinejoin' => 'Safe\ps_setlinejoin', + 'ps_setlinewidth' => 'Safe\ps_setlinewidth', + 'ps_setmiterlimit' => 'Safe\ps_setmiterlimit', + 'ps_setoverprintmode' => 'Safe\ps_setoverprintmode', + 'ps_setpolydash' => 'Safe\ps_setpolydash', + 'ps_set_border_color' => 'Safe\ps_set_border_color', + 'ps_set_border_dash' => 'Safe\ps_set_border_dash', + 'ps_set_border_style' => 'Safe\ps_set_border_style', + 'ps_set_info' => 'Safe\ps_set_info', + 'ps_set_parameter' => 'Safe\ps_set_parameter', + 'ps_set_text_pos' => 'Safe\ps_set_text_pos', + 'ps_set_value' => 'Safe\ps_set_value', + 'ps_shading' => 'Safe\ps_shading', + 'ps_shading_pattern' => 'Safe\ps_shading_pattern', + 'ps_shfill' => 'Safe\ps_shfill', + 'ps_show' => 'Safe\ps_show', + 'ps_show2' => 'Safe\ps_show2', + 'ps_show_xy' => 'Safe\ps_show_xy', + 'ps_show_xy2' => 'Safe\ps_show_xy2', + 'ps_stroke' => 'Safe\ps_stroke', + 'ps_symbol' => 'Safe\ps_symbol', + 'ps_translate' => 'Safe\ps_translate', + 'putenv' => 'Safe\putenv', + 'readfile' => 'Safe\readfile', + 'readgzfile' => 'Safe\readgzfile', + 'readline_completion_function' => 'Safe\readline_completion_function', + 'readline_read_history' => 'Safe\readline_read_history', + 'readline_write_history' => 'Safe\readline_write_history', + 'readlink' => 'Safe\readlink', + 'realpath' => 'Safe\realpath', + 'register_tick_function' => 'Safe\register_tick_function', + 'rename' => 'Safe\rename', + 'rewind' => 'Safe\rewind', + 'rmdir' => 'Safe\rmdir', + 'rnp_decrypt' => 'Safe\rnp_decrypt', + 'rnp_dump_packets' => 'Safe\rnp_dump_packets', + 'rnp_dump_packets_to_json' => 'Safe\rnp_dump_packets_to_json', + 'rnp_ffi_create' => 'Safe\rnp_ffi_create', + 'rnp_ffi_set_pass_provider' => 'Safe\rnp_ffi_set_pass_provider', + 'rnp_import_keys' => 'Safe\rnp_import_keys', + 'rnp_import_signatures' => 'Safe\rnp_import_signatures', + 'rnp_key_export' => 'Safe\rnp_key_export', + 'rnp_key_export_autocrypt' => 'Safe\rnp_key_export_autocrypt', + 'rnp_key_export_revocation' => 'Safe\rnp_key_export_revocation', + 'rnp_key_get_info' => 'Safe\rnp_key_get_info', + 'rnp_key_remove' => 'Safe\rnp_key_remove', + 'rnp_key_revoke' => 'Safe\rnp_key_revoke', + 'rnp_list_keys' => 'Safe\rnp_list_keys', + 'rnp_load_keys' => 'Safe\rnp_load_keys', + 'rnp_load_keys_from_path' => 'Safe\rnp_load_keys_from_path', + 'rnp_locate_key' => 'Safe\rnp_locate_key', + 'rnp_op_encrypt' => 'Safe\rnp_op_encrypt', + 'rnp_op_generate_key' => 'Safe\rnp_op_generate_key', + 'rnp_op_sign' => 'Safe\rnp_op_sign', + 'rnp_op_sign_cleartext' => 'Safe\rnp_op_sign_cleartext', + 'rnp_op_sign_detached' => 'Safe\rnp_op_sign_detached', + 'rnp_op_verify' => 'Safe\rnp_op_verify', + 'rnp_op_verify_detached' => 'Safe\rnp_op_verify_detached', + 'rnp_save_keys' => 'Safe\rnp_save_keys', + 'rnp_save_keys_to_path' => 'Safe\rnp_save_keys_to_path', + 'rnp_supported_features' => 'Safe\rnp_supported_features', + 'rpmaddtag' => 'Safe\rpmaddtag', + 'rrd_create' => 'Safe\rrd_create', + 'rrd_first' => 'Safe\rrd_first', + 'rrd_graph' => 'Safe\rrd_graph', + 'rrd_info' => 'Safe\rrd_info', + 'rrd_lastupdate' => 'Safe\rrd_lastupdate', + 'rrd_restore' => 'Safe\rrd_restore', + 'rrd_tune' => 'Safe\rrd_tune', + 'rrd_update' => 'Safe\rrd_update', + 'rrd_xport' => 'Safe\rrd_xport', + 'sapi_windows_cp_conv' => 'Safe\sapi_windows_cp_conv', + 'sapi_windows_cp_set' => 'Safe\sapi_windows_cp_set', + 'sapi_windows_generate_ctrl_event' => 'Safe\sapi_windows_generate_ctrl_event', + 'sapi_windows_set_ctrl_handler' => 'Safe\sapi_windows_set_ctrl_handler', + 'sapi_windows_vt100_support' => 'Safe\sapi_windows_vt100_support', + 'scandir' => 'Safe\scandir', + 'sem_acquire' => 'Safe\sem_acquire', + 'sem_get' => 'Safe\sem_get', + 'sem_release' => 'Safe\sem_release', + 'sem_remove' => 'Safe\sem_remove', + 'session_abort' => 'Safe\session_abort', + 'session_create_id' => 'Safe\session_create_id', + 'session_decode' => 'Safe\session_decode', + 'session_destroy' => 'Safe\session_destroy', + 'session_encode' => 'Safe\session_encode', + 'session_id' => 'Safe\session_id', + 'session_module_name' => 'Safe\session_module_name', + 'session_name' => 'Safe\session_name', + 'session_regenerate_id' => 'Safe\session_regenerate_id', + 'session_reset' => 'Safe\session_reset', + 'session_save_path' => 'Safe\session_save_path', + 'session_unset' => 'Safe\session_unset', + 'session_write_close' => 'Safe\session_write_close', + 'settype' => 'Safe\settype', + 'set_include_path' => 'Safe\set_include_path', + 'set_time_limit' => 'Safe\set_time_limit', + 'sha1_file' => 'Safe\sha1_file', + 'shell_exec' => 'Safe\shell_exec', + 'shmop_delete' => 'Safe\shmop_delete', + 'shmop_read' => 'Safe\shmop_read', + 'shm_attach' => 'Safe\shm_attach', + 'shm_detach' => 'Safe\shm_detach', + 'shm_put_var' => 'Safe\shm_put_var', + 'shm_remove' => 'Safe\shm_remove', + 'shm_remove_var' => 'Safe\shm_remove_var', + 'simplexml_import_dom' => 'Safe\simplexml_import_dom', + 'simplexml_load_file' => 'Safe\simplexml_load_file', + 'simplexml_load_string' => 'Safe\simplexml_load_string', + 'socket_accept' => 'Safe\socket_accept', + 'socket_addrinfo_bind' => 'Safe\socket_addrinfo_bind', + 'socket_addrinfo_connect' => 'Safe\socket_addrinfo_connect', + 'socket_addrinfo_lookup' => 'Safe\socket_addrinfo_lookup', + 'socket_atmark' => 'Safe\socket_atmark', + 'socket_bind' => 'Safe\socket_bind', + 'socket_connect' => 'Safe\socket_connect', + 'socket_create' => 'Safe\socket_create', + 'socket_create_listen' => 'Safe\socket_create_listen', + 'socket_create_pair' => 'Safe\socket_create_pair', + 'socket_export_stream' => 'Safe\socket_export_stream', + 'socket_getpeername' => 'Safe\socket_getpeername', + 'socket_getsockname' => 'Safe\socket_getsockname', + 'socket_get_option' => 'Safe\socket_get_option', + 'socket_import_stream' => 'Safe\socket_import_stream', + 'socket_listen' => 'Safe\socket_listen', + 'socket_read' => 'Safe\socket_read', + 'socket_send' => 'Safe\socket_send', + 'socket_sendmsg' => 'Safe\socket_sendmsg', + 'socket_sendto' => 'Safe\socket_sendto', + 'socket_set_block' => 'Safe\socket_set_block', + 'socket_set_nonblock' => 'Safe\socket_set_nonblock', + 'socket_set_option' => 'Safe\socket_set_option', + 'socket_shutdown' => 'Safe\socket_shutdown', + 'socket_write' => 'Safe\socket_write', + 'socket_wsaprotocol_info_export' => 'Safe\socket_wsaprotocol_info_export', + 'socket_wsaprotocol_info_import' => 'Safe\socket_wsaprotocol_info_import', + 'socket_wsaprotocol_info_release' => 'Safe\socket_wsaprotocol_info_release', + 'sodium_crypto_aead_aegis128l_decrypt' => 'Safe\sodium_crypto_aead_aegis128l_decrypt', + 'sodium_crypto_aead_aegis256_decrypt' => 'Safe\sodium_crypto_aead_aegis256_decrypt', + 'sodium_crypto_aead_aes256gcm_decrypt' => 'Safe\sodium_crypto_aead_aes256gcm_decrypt', + 'sodium_crypto_aead_chacha20poly1305_decrypt' => 'Safe\sodium_crypto_aead_chacha20poly1305_decrypt', + 'sodium_crypto_aead_chacha20poly1305_encrypt' => 'Safe\sodium_crypto_aead_chacha20poly1305_encrypt', + 'sodium_crypto_aead_chacha20poly1305_ietf_decrypt' => 'Safe\sodium_crypto_aead_chacha20poly1305_ietf_decrypt', + 'sodium_crypto_aead_chacha20poly1305_ietf_encrypt' => 'Safe\sodium_crypto_aead_chacha20poly1305_ietf_encrypt', + 'sodium_crypto_aead_xchacha20poly1305_ietf_decrypt' => 'Safe\sodium_crypto_aead_xchacha20poly1305_ietf_decrypt', + 'sodium_crypto_aead_xchacha20poly1305_ietf_encrypt' => 'Safe\sodium_crypto_aead_xchacha20poly1305_ietf_encrypt', + 'sodium_crypto_auth_verify' => 'Safe\sodium_crypto_auth_verify', + 'sodium_crypto_box_open' => 'Safe\sodium_crypto_box_open', + 'sodium_crypto_box_seal_open' => 'Safe\sodium_crypto_box_seal_open', + 'sodium_crypto_secretbox_open' => 'Safe\sodium_crypto_secretbox_open', + 'sodium_crypto_sign_open' => 'Safe\sodium_crypto_sign_open', + 'sodium_crypto_sign_verify_detached' => 'Safe\sodium_crypto_sign_verify_detached', + 'sodium_crypto_stream_xchacha20_xor_ic' => 'Safe\sodium_crypto_stream_xchacha20_xor_ic', + 'solr_get_version' => 'Safe\solr_get_version', + 'spl_autoload_register' => 'Safe\spl_autoload_register', + 'spl_autoload_unregister' => 'Safe\spl_autoload_unregister', + 'sqlsrv_begin_transaction' => 'Safe\sqlsrv_begin_transaction', + 'sqlsrv_cancel' => 'Safe\sqlsrv_cancel', + 'sqlsrv_client_info' => 'Safe\sqlsrv_client_info', + 'sqlsrv_close' => 'Safe\sqlsrv_close', + 'sqlsrv_commit' => 'Safe\sqlsrv_commit', + 'sqlsrv_configure' => 'Safe\sqlsrv_configure', + 'sqlsrv_execute' => 'Safe\sqlsrv_execute', + 'sqlsrv_free_stmt' => 'Safe\sqlsrv_free_stmt', + 'sqlsrv_get_field' => 'Safe\sqlsrv_get_field', + 'sqlsrv_next_result' => 'Safe\sqlsrv_next_result', + 'sqlsrv_num_fields' => 'Safe\sqlsrv_num_fields', + 'sqlsrv_num_rows' => 'Safe\sqlsrv_num_rows', + 'sqlsrv_prepare' => 'Safe\sqlsrv_prepare', + 'sqlsrv_query' => 'Safe\sqlsrv_query', + 'sqlsrv_rollback' => 'Safe\sqlsrv_rollback', + 'ssdeep_fuzzy_compare' => 'Safe\ssdeep_fuzzy_compare', + 'ssdeep_fuzzy_hash' => 'Safe\ssdeep_fuzzy_hash', + 'ssdeep_fuzzy_hash_filename' => 'Safe\ssdeep_fuzzy_hash_filename', + 'ssh2_auth_agent' => 'Safe\ssh2_auth_agent', + 'ssh2_auth_hostbased_file' => 'Safe\ssh2_auth_hostbased_file', + 'ssh2_auth_password' => 'Safe\ssh2_auth_password', + 'ssh2_auth_pubkey_file' => 'Safe\ssh2_auth_pubkey_file', + 'ssh2_connect' => 'Safe\ssh2_connect', + 'ssh2_disconnect' => 'Safe\ssh2_disconnect', + 'ssh2_exec' => 'Safe\ssh2_exec', + 'ssh2_forward_accept' => 'Safe\ssh2_forward_accept', + 'ssh2_forward_listen' => 'Safe\ssh2_forward_listen', + 'ssh2_publickey_add' => 'Safe\ssh2_publickey_add', + 'ssh2_publickey_init' => 'Safe\ssh2_publickey_init', + 'ssh2_publickey_remove' => 'Safe\ssh2_publickey_remove', + 'ssh2_scp_recv' => 'Safe\ssh2_scp_recv', + 'ssh2_scp_send' => 'Safe\ssh2_scp_send', + 'ssh2_send_eof' => 'Safe\ssh2_send_eof', + 'ssh2_sftp' => 'Safe\ssh2_sftp', + 'ssh2_sftp_chmod' => 'Safe\ssh2_sftp_chmod', + 'ssh2_sftp_mkdir' => 'Safe\ssh2_sftp_mkdir', + 'ssh2_sftp_rename' => 'Safe\ssh2_sftp_rename', + 'ssh2_sftp_rmdir' => 'Safe\ssh2_sftp_rmdir', + 'ssh2_sftp_symlink' => 'Safe\ssh2_sftp_symlink', + 'ssh2_sftp_unlink' => 'Safe\ssh2_sftp_unlink', + 'ssh2_shell' => 'Safe\ssh2_shell', + 'stream_context_set_options' => 'Safe\stream_context_set_options', + 'stream_context_set_params' => 'Safe\stream_context_set_params', + 'stream_copy_to_stream' => 'Safe\stream_copy_to_stream', + 'stream_filter_append' => 'Safe\stream_filter_append', + 'stream_filter_prepend' => 'Safe\stream_filter_prepend', + 'stream_filter_register' => 'Safe\stream_filter_register', + 'stream_filter_remove' => 'Safe\stream_filter_remove', + 'stream_get_contents' => 'Safe\stream_get_contents', + 'stream_get_line' => 'Safe\stream_get_line', + 'stream_isatty' => 'Safe\stream_isatty', + 'stream_resolve_include_path' => 'Safe\stream_resolve_include_path', + 'stream_set_blocking' => 'Safe\stream_set_blocking', + 'stream_set_timeout' => 'Safe\stream_set_timeout', + 'stream_socket_accept' => 'Safe\stream_socket_accept', + 'stream_socket_client' => 'Safe\stream_socket_client', + 'stream_socket_get_name' => 'Safe\stream_socket_get_name', + 'stream_socket_pair' => 'Safe\stream_socket_pair', + 'stream_socket_recvfrom' => 'Safe\stream_socket_recvfrom', + 'stream_socket_sendto' => 'Safe\stream_socket_sendto', + 'stream_socket_server' => 'Safe\stream_socket_server', + 'stream_socket_shutdown' => 'Safe\stream_socket_shutdown', + 'stream_supports_lock' => 'Safe\stream_supports_lock', + 'stream_wrapper_register' => 'Safe\stream_wrapper_register', + 'stream_wrapper_restore' => 'Safe\stream_wrapper_restore', + 'stream_wrapper_unregister' => 'Safe\stream_wrapper_unregister', + 'strftime' => 'Safe\strftime', + 'strptime' => 'Safe\strptime', + 'strtotime' => 'Safe\strtotime', + 'swoole_async_dns_lookup' => 'Safe\swoole_async_dns_lookup', + 'swoole_async_readfile' => 'Safe\swoole_async_readfile', + 'swoole_async_write' => 'Safe\swoole_async_write', + 'swoole_async_writefile' => 'Safe\swoole_async_writefile', + 'swoole_event_defer' => 'Safe\swoole_event_defer', + 'swoole_event_del' => 'Safe\swoole_event_del', + 'swoole_event_write' => 'Safe\swoole_event_write', + 'symlink' => 'Safe\symlink', + 'system' => 'Safe\system', + 'tempnam' => 'Safe\tempnam', + 'timezone_name_from_abbr' => 'Safe\timezone_name_from_abbr', + 'time_nanosleep' => 'Safe\time_nanosleep', + 'time_sleep_until' => 'Safe\time_sleep_until', + 'tmpfile' => 'Safe\tmpfile', + 'touch' => 'Safe\touch', + 'unixtojd' => 'Safe\unixtojd', + 'unlink' => 'Safe\unlink', + 'unpack' => 'Safe\unpack', + 'uopz_extend' => 'Safe\uopz_extend', + 'uopz_implement' => 'Safe\uopz_implement', + 'variant_date_to_timestamp' => 'Safe\variant_date_to_timestamp', + 'variant_round' => 'Safe\variant_round', + 'virtual' => 'Safe\virtual', + 'xdiff_file_bdiff' => 'Safe\xdiff_file_bdiff', + 'xdiff_file_bpatch' => 'Safe\xdiff_file_bpatch', + 'xdiff_file_diff' => 'Safe\xdiff_file_diff', + 'xdiff_file_diff_binary' => 'Safe\xdiff_file_diff_binary', + 'xdiff_file_patch_binary' => 'Safe\xdiff_file_patch_binary', + 'xdiff_file_rabdiff' => 'Safe\xdiff_file_rabdiff', + 'xdiff_string_bpatch' => 'Safe\xdiff_string_bpatch', + 'xdiff_string_patch' => 'Safe\xdiff_string_patch', + 'xdiff_string_patch_binary' => 'Safe\xdiff_string_patch_binary', + 'xmlrpc_set_type' => 'Safe\xmlrpc_set_type', + 'xml_parser_free' => 'Safe\xml_parser_free', + 'xml_parser_set_option' => 'Safe\xml_parser_set_option', + 'yaml_parse' => 'Safe\yaml_parse', + 'yaml_parse_file' => 'Safe\yaml_parse_file', + 'yaml_parse_url' => 'Safe\yaml_parse_url', + 'yaz_ccl_parse' => 'Safe\yaz_ccl_parse', + 'yaz_close' => 'Safe\yaz_close', + 'yaz_connect' => 'Safe\yaz_connect', + 'yaz_database' => 'Safe\yaz_database', + 'yaz_element' => 'Safe\yaz_element', + 'yaz_present' => 'Safe\yaz_present', + 'yaz_search' => 'Safe\yaz_search', + 'yaz_wait' => 'Safe\yaz_wait', + 'zip_entry_close' => 'Safe\zip_entry_close', + 'zip_entry_compressedsize' => 'Safe\zip_entry_compressedsize', + 'zip_entry_compressionmethod' => 'Safe\zip_entry_compressionmethod', + 'zip_entry_filesize' => 'Safe\zip_entry_filesize', + 'zip_entry_name' => 'Safe\zip_entry_name', + 'zip_entry_open' => 'Safe\zip_entry_open', + 'zip_entry_read' => 'Safe\zip_entry_read', + 'zlib_decode' => 'Safe\zlib_decode', + ] + ); +}; diff --git a/generated/8.4/rnp.php b/generated/8.4/rnp.php new file mode 100644 index 00000000..9b5587b6 --- /dev/null +++ b/generated/8.4/rnp.php @@ -0,0 +1,609 @@ + + * + * + * @param bool $use_include_path Setting use_include_path to TRUE will result + * in PHP trying to open the file along the standard include path as per + * the include_path directive. + * This is used for local files, not URLs. + * @return array Returns an array with all the parsed meta tags. + * + * The value of the name property becomes the key, the value of the content + * property becomes the value of the returned array, so you can easily use + * standard array functions to traverse it or access single values. + * Special characters in the value of the name property are substituted with + * '_', the rest is converted to lower case. If two meta tags have the same + * name, only the last one is returned. + * + * Returns FALSE on failure. + * @throws UrlException + * + */ +function get_meta_tags(string $filename, bool $use_include_path = false): array +{ + error_clear_last(); + $safeResult = \get_meta_tags($filename, $use_include_path); + if ($safeResult === false) { + throw UrlException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * This function parses a URL and returns an associative array containing any + * of the various components of the URL that are present. + * The values of the array elements are not URL decoded. + * + * This function is not meant to validate + * the given URL, it only breaks it up into the parts listed below. Partial and invalid + * URLs are also accepted, parse_url tries its best to + * parse them correctly. + * + * @param string $url The URL to parse. + * @param int $component Specify one of PHP_URL_SCHEME, + * PHP_URL_HOST, PHP_URL_PORT, + * PHP_URL_USER, PHP_URL_PASS, + * PHP_URL_PATH, PHP_URL_QUERY + * or PHP_URL_FRAGMENT to retrieve just a specific + * URL component as a string (except when + * PHP_URL_PORT is given, in which case the return + * value will be an int). + * @return array|int|string|null On seriously malformed URLs, parse_url. + * + * If the component parameter is omitted, an + * associative array is returned. At least one element will be + * present within the array. Potential keys within this array are: + * + * + * + * scheme - e.g. http + * + * + * + * + * host + * + * + * + * + * port + * + * + * + * + * user + * + * + * + * + * pass + * + * + * + * + * path + * + * + * + * + * query - after the question mark ? + * + * + * + * + * fragment - after the hashmark # + * + * + * + * + * If the component parameter is specified, + * parse_url returns a string (or an + * int, in the case of PHP_URL_PORT) + * instead of an array. If the requested component doesn't exist + * within the given URL, NULL will be returned. + * As of PHP 8.0.0, parse_url distinguishes absent and empty + * queries and fragments: + * + * + * + * + * + * + * + * Previously all cases resulted in query and fragment being NULL. + * + * Note that control characters (cf. ctype_cntrl) in the + * components are replaced with underscores (_). + * @throws UrlException + * + */ +function parse_url(string $url, int $component = -1) +{ + error_clear_last(); + $safeResult = \parse_url($url, $component); + if ($safeResult === false) { + throw UrlException::createFromPhpError(); + } + return $safeResult; +} diff --git a/generated/8.4/var.php b/generated/8.4/var.php new file mode 100644 index 00000000..70f048df --- /dev/null +++ b/generated/8.4/var.php @@ -0,0 +1,60 @@ + + * + * + * + * The permissions 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 $permissions): void +{ + error_clear_last(); + $safeResult = \chmod($filename, $permissions); + if ($safeResult === false) { + throw 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 FilesystemException + * + */ +function chown(string $filename, $user): void +{ + error_clear_last(); + $safeResult = \chown($filename, $user); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * Makes a copy of the file from to + * to. + * + * If you wish to move a file, use the rename function. + * + * @param string $from Path to the source file. + * @param string $to The destination path. If to 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 FilesystemException + * + */ +function copy(string $from, string $to, $context = null): void +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \copy($from, $to, $context); + } else { + $safeResult = \copy($from, $to); + } + if ($safeResult === false) { + throw 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 FilesystemException + * + */ +function disk_free_space(string $directory): float +{ + error_clear_last(); + $safeResult = \disk_free_space($directory); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function disk_total_space(string $directory): float +{ + error_clear_last(); + $safeResult = \disk_total_space($directory); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * The file pointed to by stream is closed. + * + * @param resource $stream The file pointer must be valid, and must point to a file successfully + * opened by fopen or fsockopen. + * @throws FilesystemException + * + */ +function fclose($stream): void +{ + error_clear_last(); + $safeResult = \fclose($stream); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * This function synchronizes stream contents to storage media, just like fsync does, + * but it does not synchronize file meta-data. + * Note that this function is only effectively different in POSIX systems. + * In Windows, this function is aliased to fsync. + * + * @param resource $stream 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 FilesystemException + * + */ +function fdatasync($stream): void +{ + error_clear_last(); + $safeResult = \fdatasync($stream); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * This function forces a write of all buffered output to the resource + * pointed to by the file stream. + * + * @param resource $stream 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 FilesystemException + * + */ +function fflush($stream): void +{ + error_clear_last(); + $safeResult = \fflush($stream); + if ($safeResult === false) { + throw 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 length 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 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 $length 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 FilesystemException + * + */ +function file_get_contents(string $filename, bool $use_include_path = false, $context = null, int $offset = 0, ?int $length = null): string +{ + error_clear_last(); + if ($length !== null) { + $safeResult = \file_get_contents($filename, $use_include_path, $context, $offset, $length); + } elseif ($offset !== 0) { + $safeResult = \file_get_contents($filename, $use_include_path, $context, $offset); + } elseif ($context !== null) { + $safeResult = \file_get_contents($filename, $use_include_path, $context); + } else { + $safeResult = \file_get_contents($filename, $use_include_path); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * This function is identical to calling fopen, + * fwrite and fclose successively + * to write data to a file. + * + * If filename does not exist, the file is created. + * Otherwise, the existing file is overwritten, unless the + * FILE_APPEND flag is set. + * + * @param string $filename Path to the file where to write the data. + * @param mixed $data The data to write. Can be either a string, an + * array or a stream resource. + * + * If data is a stream resource, the + * remaining buffer of that stream will be copied to the specified file. + * This is similar with using stream_copy_to_stream. + * + * You can also specify the data parameter as a single + * dimension array. This is equivalent to + * file_put_contents($filename, implode('', $array)). + * @param int $flags The value of flags can be any combination of + * the following flags, joined with the binary OR (|) + * operator. + * + * + * Available flags + * + * + * + * Flag + * Description + * + * + * + * + * + * FILE_USE_INCLUDE_PATH + * + * + * Search for filename in the include directory. + * See include_path for more + * information. + * + * + * + * + * FILE_APPEND + * + * + * If file filename already exists, append + * the data to the file instead of overwriting it. + * + * + * + * + * LOCK_EX + * + * + * Acquire an exclusive lock on the file while proceeding to the + * writing. In other words, a flock call happens + * between the fopen call and the + * fwrite call. This is not identical to an + * fopen call with mode "x". + * + * + * + * + * + * @param resource|null $context A valid context resource created with + * stream_context_create. + * @return int This function returns the number of bytes that were written to the file. + * @throws FilesystemException + * + */ +function file_put_contents(string $filename, $data, int $flags = 0, $context = null): int +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \file_put_contents($filename, $data, $flags, $context); + } else { + $safeResult = \file_put_contents($filename, $data, $flags); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Reads an entire file into an array. + * + * @param string $filename Path to the file. + * @param int $flags The optional parameter flags can be one, or + * more, of the following constants: + * + * + * + * FILE_USE_INCLUDE_PATH + * + * + * + * Search for the file in the include_path. + * + * + * + * + * + * FILE_IGNORE_NEW_LINES + * + * + * + * Omit newline at the end of each array element + * + * + * + * + * + * FILE_SKIP_EMPTY_LINES + * + * + * + * Skip empty lines + * + * + * + * + * + * FILE_NO_DEFAULT_CONTEXT + * + * + * + * Don't use the default context + * + * + * + * + * @param resource $context + * @return array Returns the file in an array. Each element of the array corresponds to a + * line in the file, with the newline still attached. Upon failure, + * file returns FALSE. + * @throws FilesystemException + * + */ +function file(string $filename, int $flags = 0, $context = null): array +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \file($filename, $flags, $context); + } else { + $safeResult = \file($filename, $flags); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * + * + * @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 FilesystemException + * + */ +function fileatime(string $filename): int +{ + error_clear_last(); + $safeResult = \fileatime($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function filectime(string $filename): int +{ + error_clear_last(); + $safeResult = \filectime($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Gets the file inode. + * + * @param string $filename Path to the file. + * @return int Returns the inode number of the file. + * @throws FilesystemException + * + */ +function fileinode(string $filename): int +{ + error_clear_last(); + $safeResult = \fileinode($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function filemtime(string $filename): int +{ + error_clear_last(); + $safeResult = \filemtime($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function fileowner(string $filename): int +{ + error_clear_last(); + $safeResult = \fileowner($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Gets permissions for the given file. + * + * @param string $filename Path to the file. + * @return int Returns the file's permissions as a numeric mode. Lower bits of this mode + * are the same as the permissions expected by chmod, + * however on most platforms the return value will also include information on + * the type of file given as filename. The examples + * below demonstrate how to test the return value for specific permissions and + * file types on POSIX systems, including Linux and macOS. + * + * For local files, the specific return value is that of the + * st_mode member of the structure returned by the C + * library's stat function. Exactly which bits are set + * can vary from platform to platform, and looking up your specific platform's + * documentation is recommended if parsing the non-permission bits of the + * return value is required. + * + * Returns FALSE on failure. + * @throws FilesystemException + * + */ +function fileperms(string $filename): int +{ + error_clear_last(); + $safeResult = \fileperms($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Gets the size for the given file. + * + * @param string $filename Path to the file. + * @return int Returns the size of the file in bytes, or FALSE (and generates an error + * of level E_WARNING) in case of an error. + * @throws FilesystemException + * + */ +function filesize(string $filename): int +{ + error_clear_last(); + $safeResult = \filesize($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * flock allows you to perform a simple reader/writer + * model which can be used on virtually every platform (including most Unix + * derivatives and even Windows). + * + * The lock is released also by fclose, + * or when stream is garbage collected. + * + * PHP supports a portable way of locking complete files in an advisory way + * (which means all accessing programs have to use the same way of locking + * or it will not work). By default, this function will block until the + * requested lock is acquired; this may be controlled with the LOCK_NB option documented below. + * + * @param resource $stream A file system pointer resource + * that is typically created using fopen. + * @param int $operation operation is one of the following: + * + * + * + * LOCK_SH to acquire a shared lock (reader). + * + * + * + * + * LOCK_EX to acquire an exclusive lock (writer). + * + * + * + * + * LOCK_UN to release a lock (shared or exclusive). + * + * + * + * + * It is also possible to add LOCK_NB as a bitmask to one + * of the above operations, if flock should not + * block during the locking attempt. + * @param int|null $would_block The optional third argument is set to 1 if the lock would block + * (EWOULDBLOCK errno condition). + * @throws FilesystemException + * + */ +function flock($stream, int $operation, ?int &$would_block = null): void +{ + error_clear_last(); + $safeResult = \flock($stream, $operation, $would_block); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * 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 + * 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; otherwise it has the + * same behavior as 'w'. + * + * + * + * '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 (Mac OS Classic) used + * \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 is 'b'. + * You can 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 old versions of notepad. You + * should use the 'b' in all other cases. + * + * If you specify the 't' 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 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 TRUE if you want to search for the file in the + * include_path, too. + * @param resource|null $context A context stream + * resource. + * @return resource Returns a file pointer resource on success + * @throws FilesystemException + * + */ +function fopen(string $filename, string $mode, bool $use_include_path = false, $context = null) +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \fopen($filename, $mode, $use_include_path, $context); + } else { + $safeResult = \fopen($filename, $mode, $use_include_path); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * fread reads up to + * length bytes from the file pointer + * referenced by stream. 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 $stream 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 FilesystemException + * + */ +function fread($stream, int $length): string +{ + error_clear_last(); + $safeResult = \fread($stream, $length); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Gathers the statistics of the file opened by the file + * pointer stream. This function is similar to the + * stat function except that it operates + * on an open file pointer instead of a filename. + * + * @param resource $stream A file system pointer resource + * that is typically created using fopen. + * @return array Returns an array with the statistics of the file; the format of the array + * is described in detail on the stat manual page. + * Returns FALSE on failure. + * @throws FilesystemException + * + */ +function fstat($stream): array +{ + error_clear_last(); + $safeResult = \fstat($stream); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * This function synchronizes changes to the file, including its meta-data. This is similar to fflush, + * but it also instructs the operating system to write to the storage media. + * + * @param resource $stream 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 FilesystemException + * + */ +function fsync($stream): void +{ + error_clear_last(); + $safeResult = \fsync($stream); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * Takes the filepointer, stream, and truncates the file to + * length, size. + * + * @param resource $stream The file pointer. + * + * The stream 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 FilesystemException + * + */ +function ftruncate($stream, int $size): void +{ + error_clear_last(); + $safeResult = \ftruncate($stream, $size); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * + * + * @param resource $stream A file system pointer resource + * that is typically created using fopen. + * @param string $data The string that is to be written. + * @param int $length If length is an integer, writing will stop + * after length bytes have been written or the + * end of data is reached, whichever comes first. + * @return int + * @throws FilesystemException + * + */ +function fwrite($stream, string $data, ?int $length = null): int +{ + error_clear_last(); + if ($length !== null) { + $safeResult = \fwrite($stream, $data, $length); + } else { + $safeResult = \fwrite($stream, $data); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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. + * + * Special characters: + * + * + * + * * - Matches zero or more characters. + * + * + * + * + * ? - Matches exactly one character (any character). + * + * + * + * + * [...] - Matches one character from a group of + * characters. If the first character is !, + * matches any character not in the group. + * + * + * + * + * \ - Escapes the following character, + * except when the GLOB_NOESCAPE flag is used. + * + * + * + * @param int $flags Any of the GLOB_* constants. + * @return array Returns an array containing the matched files/directories, an empty array + * if no file matched. + * Unless GLOB_NOSORT was used, the names will + * be sorted alphanumerically. + * @throws FilesystemException + * + */ +function glob(string $pattern, int $flags = 0): array +{ + error_clear_last(); + $safeResult = \glob($pattern, $flags); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function lchgrp(string $filename, $group): void +{ + error_clear_last(); + $safeResult = \lchgrp($filename, $group); + if ($safeResult === false) { + throw 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 FilesystemException + * + */ +function lchown(string $filename, $user): void +{ + error_clear_last(); + $safeResult = \lchown($filename, $user); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * link creates a hard link. + * + * @param string $target Target of the link. + * @param string $link The link name. + * @throws FilesystemException + * + */ +function link(string $target, string $link): void +{ + error_clear_last(); + $safeResult = \link($target, $link); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * Gathers the statistics of the file or symbolic link named by + * filename. + * + * @param string $filename Path to a file or a symbolic link. + * @return array See the manual page for stat for information on + * the structure of the array that lstat returns. + * This function is identical to the stat function + * except that if the filename parameter is a symbolic + * link, the status of the symbolic link is returned, not the status of the + * file pointed to by the symbolic link. + * + * On failure, FALSE is returned. + * @throws FilesystemException + * + */ +function lstat(string $filename): array +{ + error_clear_last(); + $safeResult = \lstat($filename); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Attempts to create the directory specified by directory. + * + * @param string $directory The directory path. + * A URL can be used as a + * filename with this function if the fopen wrappers have been enabled. + * See fopen for more details on how to specify the + * filename. See the for links to information + * about what abilities the various wrappers have, notes on their usage, + * and information on any predefined variables they may + * provide. + * @param int $permissions The permissions are 0777 by default, which means the widest possible + * access. For more information on permissions, read the details + * on the chmod page. + * + * permissions is ignored on Windows. + * + * Note that you probably want to specify the permissions as an octal number, + * which means it should have a leading zero. The permissions is also modified + * by the current umask, which you can change using + * umask. + * @param bool $recursive If TRUE, then any parent directories to the directory specified will + * also be created, with the same permissions. + * @param resource $context A context stream + * resource. + * @throws FilesystemException + * + */ +function mkdir(string $directory, int $permissions = 0777, bool $recursive = false, $context = null): void +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \mkdir($directory, $permissions, $recursive, $context); + } else { + $safeResult = \mkdir($directory, $permissions, $recursive); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * parse_ini_file loads in the + * ini file specified in filename, + * and returns the settings in it in an associative array. + * + * The structure of the ini file is the same as the php.ini's. + * + * @param string $filename The filename of the ini file being parsed. If a relative path is used, + * it is evaluated relative to the current working directory, then the + * include_path. + * @param bool $process_sections By setting the process_sections + * parameter to TRUE, you get a multidimensional array, with + * the section names and settings included. The default + * for process_sections is FALSE + * @param int $scanner_mode Can either be INI_SCANNER_NORMAL (default) or + * INI_SCANNER_RAW. If INI_SCANNER_RAW + * is supplied, then option values will not be parsed. + * + * + * As of PHP 5.6.1 can also be specified as INI_SCANNER_TYPED. + * In this mode boolean, null and integer types are preserved when possible. + * String values "true", "on" and "yes" + * are converted to TRUE. "false", "off", "no" + * and "none" are considered FALSE. "null" is converted to NULL + * in typed mode. Also, all numeric strings are converted to integer type if it is possible. + * @return array The settings are returned as an associative array on success. + * @throws FilesystemException + * + */ +function parse_ini_file(string $filename, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array +{ + error_clear_last(); + $safeResult = \parse_ini_file($filename, $process_sections, $scanner_mode); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * parse_ini_string returns the settings in string + * ini_string in an associative array. + * + * The structure of the ini string is the same as the php.ini's. + * + * @param string $ini_string The contents of the ini file being parsed. + * @param bool $process_sections By setting the process_sections + * parameter to TRUE, you get a multidimensional array, with + * the section names and settings included. The default + * for process_sections is FALSE + * @param int $scanner_mode Can either be INI_SCANNER_NORMAL (default) or + * INI_SCANNER_RAW. If INI_SCANNER_RAW + * is supplied, then option values will not be parsed. + * + * + * As of PHP 5.6.1 can also be specified as INI_SCANNER_TYPED. + * In this mode boolean, null and integer types are preserved when possible. + * String values "true", "on" and "yes" + * are converted to TRUE. "false", "off", "no" + * and "none" are considered FALSE. "null" is converted to NULL + * in typed mode. Also, all numeric strings are converted to integer type if it is possible. + * @return array The settings are returned as an associative array on success. + * @throws FilesystemException + * + */ +function parse_ini_string(string $ini_string, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array +{ + error_clear_last(); + $safeResult = \parse_ini_string($ini_string, $process_sections, $scanner_mode); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Reads a file and writes it to the output buffer. + * + * @param string $filename The filename being read. + * @param bool $use_include_path You can use the optional second parameter and set it to TRUE, if + * you want to search for the file in the include_path, too. + * @param resource $context A context stream + * resource. + * @return int Returns the number of bytes read from the file on success + * @throws FilesystemException + * + */ +function readfile(string $filename, bool $use_include_path = false, $context = null): int +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \readfile($filename, $use_include_path, $context); + } else { + $safeResult = \readfile($filename, $use_include_path); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 FilesystemException + * + */ +function readlink(string $path): string +{ + error_clear_last(); + $safeResult = \readlink($path); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * realpath expands all symbolic links and + * resolves references to /./, /../ and extra / characters in + * the input path and returns the canonicalized + * absolute pathname. + * + * @param string $path The path being checked. + * + * + * Whilst a path must be supplied, the value can be an empty string. + * In this case, the value is interpreted as the current directory. + * + * + * + * Whilst a path must be supplied, the value can be an empty string. + * In this case, the value is interpreted as the current directory. + * @return string Returns the canonicalized absolute pathname on success. The resulting path + * will have no symbolic link, /./ or /../ components. Trailing delimiters, + * such as \ and /, are also removed. + * + * realpath returns FALSE on failure, e.g. if + * the file does not exist. + * @throws FilesystemException + * + */ +function realpath(string $path): string +{ + error_clear_last(); + $safeResult = \realpath($path); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Attempts to rename from to + * to, moving it between directories if necessary. + * If renaming a file and to exists, + * it will be overwritten. If renaming a directory and + * to exists, + * this function will emit a warning. + * + * @param string $from The old name. + * + * The wrapper used in from + * must match the wrapper used in + * to. + * @param string $to The new name. + * + * + * On Windows, if to already exists, it must be writable. + * Otherwise rename fails and issues E_WARNING. + * + * + * @param resource $context A context stream + * resource. + * @throws FilesystemException + * + */ +function rename(string $from, string $to, $context = null): void +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \rename($from, $to, $context); + } else { + $safeResult = \rename($from, $to); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * Sets the file position indicator for stream + * to the beginning of the file stream. + * + * @param resource $stream The file pointer must be valid, and must point to a file + * successfully opened by fopen. + * @throws FilesystemException + * + */ +function rewind($stream): void +{ + error_clear_last(); + $safeResult = \rewind($stream); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * Attempts to remove the directory named by directory. + * The directory must be empty, and the relevant permissions must permit this. + * A E_WARNING level error will be generated on failure. + * + * @param string $directory Path to the directory. + * @param resource $context A context stream + * resource. + * @throws FilesystemException + * + */ +function rmdir(string $directory, $context = null): void +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \rmdir($directory, $context); + } else { + $safeResult = \rmdir($directory); + } + if ($safeResult === false) { + throw 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 FilesystemException + * + */ +function symlink(string $target, string $link): void +{ + error_clear_last(); + $safeResult = \symlink($target, $link); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} + + +/** + * Creates a file with a unique filename, with access permission set to 0600, in the specified directory. + * If the directory does not exist or is not writable, tempnam may + * generate a file in the system's temporary directory, and return + * the full path to that file, including its name. + * + * @param string $directory The directory where the temporary filename will be created. + * @param string $prefix The prefix of the generated temporary filename. + * @return string Returns the new temporary filename (with path). + * @throws FilesystemException + * + */ +function tempnam(string $directory, string $prefix): string +{ + error_clear_last(); + $safeResult = \tempnam($directory, $prefix); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Creates a temporary file with a unique name in read-write-binary (w+b) mode and + * returns a file handle. + * + * The file is automatically removed when closed (for example, by calling + * fclose, or when there are no remaining references to + * the file handle returned by tmpfile), or when the + * script ends. + * + * @return resource|false Returns a file handle, similar to the one returned by + * fopen, for the new file. + * @throws FilesystemException + * + */ +function tmpfile() +{ + error_clear_last(); + $safeResult = \tmpfile(); + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Attempts to set the access and modification times of the file named in the + * filename parameter to the value given in + * mtime. + * 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 $mtime The touch time. If mtime is NULL, + * the current system time is used. + * @param int $atime If not NULL, the access time of the given filename is set to + * the value of atime. Otherwise, it is set to + * the value passed to the mtime parameter. + * If both are NULL, the current system time is used. + * @throws FilesystemException + * + */ +function touch(string $filename, ?int $mtime = null, ?int $atime = null): void +{ + error_clear_last(); + if ($atime !== null) { + $safeResult = \touch($filename, $mtime, $atime); + } elseif ($mtime !== null) { + $safeResult = \touch($filename, $mtime); + } else { + $safeResult = \touch($filename); + } + if ($safeResult === false) { + throw 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. + * + * If the file is a symlink, the symlink will be deleted. On Windows, to delete + * a symlink to a directory, rmdir has to be used instead. + * @param resource $context A context stream + * resource. + * @throws FilesystemException + * + */ +function unlink(string $filename, $context = null): void +{ + error_clear_last(); + if ($context !== null) { + $safeResult = \unlink($filename, $context); + } else { + $safeResult = \unlink($filename); + } + if ($safeResult === false) { + throw FilesystemException::createFromPhpError(); + } +} diff --git a/generated/8.5/filter.php b/generated/8.5/filter.php new file mode 100644 index 00000000..3963e269 --- /dev/null +++ b/generated/8.5/filter.php @@ -0,0 +1,48 @@ + + * + * + * + * channels will be 3 for RGB pictures and 4 for CMYK + * pictures. + * + * bits is the number of bits for each color. + * + * For some image types, the presence of channels and + * bits values can be a bit + * confusing. As an example, GIF always uses 3 channels + * per pixel, but the number of bits per pixel cannot be calculated for an + * animated GIF with a global color table. + * + * On failure, FALSE is returned. + * @throws ImageException + * + */ +function getimagesize(string $filename, ?array &$image_info = null): ?array +{ + error_clear_last(); + $safeResult = \getimagesize($filename, $image_info); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Returns the extension for the given IMAGETYPE_* + * constant. + * + * @param int $image_type One of the IMAGETYPE_* constant. + * @param bool $include_dot Whether to prepend a dot to the extension or not. Default to TRUE. + * @return string A string with the extension corresponding to the given image type. + * @throws ImageException + * + */ +function image_type_to_extension(int $image_type, bool $include_dot = true): string +{ + error_clear_last(); + $safeResult = \image_type_to_extension($image_type, $include_dot); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * image2wbmp 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 string|null $filename Path to the saved file. If not given, the raw image stream will be + * output 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 ImageException + * + */ +function image2wbmp($image, ?string $filename = null, ?int $foreground = null): void +{ + error_clear_last(); + if ($foreground !== null) { + $safeResult = \image2wbmp($image, $filename, $foreground); + } elseif ($filename !== null) { + $safeResult = \image2wbmp($image, $filename); + } else { + $safeResult = \image2wbmp($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param array $affine Array with keys 0 to 5. + * @param array $clip Array with keys "x", "y", "width" and "height"; or NULL. + * @return resource Return affined image object on success. + * @throws ImageException + * + */ +function imageaffine($image, array $affine, ?array $clip = null) +{ + error_clear_last(); + if ($clip !== null) { + $safeResult = \imageaffine($image, $affine, $clip); + } else { + $safeResult = \imageaffine($image, $affine); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Returns the concatenation of two affine transformation matrices, + * what is useful if multiple transformations should be applied to the same + * image in one go. + * + * @param array $matrix1 An affine transformation matrix (an array with keys + * 0 to 5 and float values). + * @param array $matrix2 An affine transformation matrix (an array with keys + * 0 to 5 and float values). + * @return array{0:float,1:float,2:float,3:float,4:float,5:float} An affine transformation matrix (an array with keys + * 0 to 5 and float values). + * @throws ImageException + * + */ +function imageaffinematrixconcat(array $matrix1, array $matrix2): array +{ + error_clear_last(); + $safeResult = \imageaffinematrixconcat($matrix1, $matrix2); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Returns an affine transformation matrix. + * + * @param int $type One of the IMG_AFFINE_* constants. + * @param array|float $options If type is IMG_AFFINE_TRANSLATE + * or IMG_AFFINE_SCALE, + * options has to be an array with keys x + * and y, both having float values. + * + * If type is IMG_AFFINE_ROTATE, + * IMG_AFFINE_SHEAR_HORIZONTAL or IMG_AFFINE_SHEAR_VERTICAL, + * options has to be a float specifying the angle. + * @return array{0:float,1:float,2:float,3:float,4:float,5:float} An affine transformation matrix (an array with keys + * 0 to 5 and float values). + * @throws ImageException + * + */ +function imageaffinematrixget(int $type, $options): array +{ + error_clear_last(); + $safeResult = \imageaffinematrixget($type, $options); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagealphablending allows for two different + * modes of drawing on truecolor images. In blending mode, the + * alpha channel component of the color supplied to all drawing function, + * such as imagesetpixel determines how much of the + * underlying color should be allowed to shine through. As a result, gd + * automatically blends the existing color at that point with the drawing color, + * and stores the result in the image. The resulting pixel is opaque. In + * non-blending mode, the drawing color is copied literally with its alpha channel + * information, replacing the destination pixel. Blending mode is not available + * when drawing on palette images. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param bool $enable Whether to enable the blending mode or not. On true color images + * the default value is TRUE otherwise the default value is FALSE + * @throws ImageException + * + */ +function imagealphablending($image, bool $enable): void +{ + error_clear_last(); + $safeResult = \imagealphablending($image, $enable); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Activate the fast drawing antialiased methods for lines and wired polygons. + * It does not support alpha components. It works using a direct blend + * operation. It works only with truecolor images. + * + * Thickness and styled are not supported. + * + * Using antialiased primitives with transparent background color can end with + * some unexpected results. The blend method uses the background color as any + * other colors. The lack of alpha component support does not allow an alpha + * based antialiasing method. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param bool $enable Whether to enable antialiasing or not. + * @throws ImageException + * + */ +function imageantialias($image, bool $enable): void +{ + error_clear_last(); + $safeResult = \imageantialias($image, $enable); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagearc draws an arc of circle centered at the given + * coordinates. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $center_x x-coordinate of the center. + * @param int $center_y y-coordinate of the center. + * @param int $width The arc width. + * @param int $height The arc height. + * @param int $start_angle The arc start angle, in degrees. + * @param int $end_angle The arc end angle, in degrees. + * 0° is located at the three-o'clock position, and the arc is drawn + * clockwise. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagearc($image, int $center_x, int $center_y, int $width, int $height, int $start_angle, int $end_angle, int $color): void +{ + error_clear_last(); + $safeResult = \imagearc($image, $center_x, $center_y, $width, $height, $start_angle, $end_angle, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Outputs or saves a AVIF Raster image from the given image. + * + * @param \GdImage $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @param int $quality quality is optional, and ranges from 0 (worst quality, smaller file) + * to 100 (best quality, larger file). + * If -1 is provided, the default value 30 is used. + * @param int $speed speed is optional, and ranges from 0 (slow, smaller file) + * to 10 (fast, larger file). + * If -1 is provided, the default value 6 is used. + * @throws ImageException + * + */ +function imageavif(\GdImage $image, $file = null, int $quality = -1, int $speed = -1): void +{ + error_clear_last(); + if ($speed !== -1) { + $safeResult = \imageavif($image, $file, $quality, $speed); + } elseif ($quality !== -1) { + $safeResult = \imageavif($image, $file, $quality); + } elseif ($file !== null) { + $safeResult = \imageavif($image, $file); + } else { + $safeResult = \imageavif($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Outputs or saves a BMP version of the given image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * + * NULL is invalid if the compressed arguments is + * not used. + * @param bool $compressed Whether the BMP should be compressed with run-length encoding (RLE), or not. + * @throws ImageException + * + */ +function imagebmp($image, $file = null, bool $compressed = true): void +{ + error_clear_last(); + if ($compressed !== true) { + $safeResult = \imagebmp($image, $file, $compressed); + } elseif ($file !== null) { + $safeResult = \imagebmp($image, $file); + } else { + $safeResult = \imagebmp($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagechar draws the first character of + * char in the image identified by + * image with its upper-left at + * x,y (top left is 0, + * 0) with the color color. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $font Can be 1, 2, 3, 4, 5 for built-in + * fonts in latin2 encoding (where higher numbers corresponding to larger fonts) or GdFont instance, + * returned by imageloadfont. + * @param int $x x-coordinate of the start. + * @param int $y y-coordinate of the start. + * @param string $char The character to draw. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagechar($image, int $font, int $x, int $y, string $char, int $color): void +{ + error_clear_last(); + $safeResult = \imagechar($image, $font, $x, $y, $char, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws the character char vertically at the specified + * coordinate on the given image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $font Can be 1, 2, 3, 4, 5 for built-in + * fonts in latin2 encoding (where higher numbers corresponding to larger fonts) or GdFont instance, + * returned by imageloadfont. + * @param int $x x-coordinate of the start. + * @param int $y y-coordinate of the start. + * @param string $char The character to draw. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagecharup($image, int $font, int $x, int $y, string $char, int $color): void +{ + error_clear_last(); + $safeResult = \imagecharup($image, $font, $x, $y, $char, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Returns the index of the color of the pixel at the + * specified location in the image specified by image. + * + * If the image is a + * truecolor image, this function returns the RGB value of that pixel as + * integer. Use bitshifting and masking to access the distinct red, green and blue + * component values: + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x x-coordinate of the point. + * @param int $y y-coordinate of the point. + * @return int Returns the index of the color. + * @throws ImageException + * + */ +function imagecolorat($image, int $x, int $y): int +{ + error_clear_last(); + $safeResult = \imagecolorat($image, $x, $y); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * De-allocates a color previously allocated with + * imagecolorallocate or + * imagecolorallocatealpha. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $color The color identifier. + * @throws ImageException + * + */ +function imagecolordeallocate($image, int $color): void +{ + error_clear_last(); + $safeResult = \imagecolordeallocate($image, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Makes the colors of the palette version of an image more closely match the true color version. + * + * @param resource $image1 A truecolor image object. + * @param resource $image2 A palette image object pointing to an image that has the same + * size as image1. + * @throws ImageException + * + */ +function imagecolormatch($image1, $image2): void +{ + error_clear_last(); + $safeResult = \imagecolormatch($image1, $image2); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * This sets the specified index in the palette to the specified + * color. This is useful for creating flood-fill-like effects in + * palleted images without the overhead of performing the actual + * flood-fill. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $color An index in the palette. + * @param int $red Value of red component. + * @param int $green Value of green component. + * @param int $blue Value of blue component. + * @param int $alpha Value of alpha component. + * @throws ImageException + * + */ +function imagecolorset($image, int $color, int $red, int $green, int $blue, int $alpha = 0): void +{ + error_clear_last(); + $safeResult = \imagecolorset($image, $color, $red, $green, $blue, $alpha); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Applies a convolution matrix on the image, using the given coefficient and + * offset. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param array $matrix A 3x3 matrix: an array of three arrays of three floats. + * @param float $divisor The divisor of the result of the convolution, used for normalization. + * @param float $offset Color offset. + * @throws ImageException + * + */ +function imageconvolution($image, array $matrix, float $divisor, float $offset): void +{ + error_clear_last(); + $safeResult = \imageconvolution($image, $matrix, $divisor, $offset); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Copy a part of src_image onto + * dst_image starting at the x,y coordinates + * src_x, src_y with + * a width of src_width and a height of + * src_height. The portion defined will be copied + * onto the x,y coordinates, dst_x and + * dst_y. + * + * @param resource $dst_image Destination image resource. + * @param resource $src_image Source image resource. + * @param int $dst_x x-coordinate of destination point. + * @param int $dst_y y-coordinate of destination point. + * @param int $src_x x-coordinate of source point. + * @param int $src_y y-coordinate of source point. + * @param int $src_width Source width. + * @param int $src_height Source height. + * @throws ImageException + * + */ +function imagecopy($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height): void +{ + error_clear_last(); + $safeResult = \imagecopy($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $src_width, $src_height); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Copy a part of src_image onto + * dst_image starting at the x,y coordinates + * src_x, src_y with + * a width of src_width and a height of + * src_height. The portion defined will be copied + * onto the x,y coordinates, dst_x and + * dst_y. + * + * @param resource $dst_image Destination image resource. + * @param resource $src_image Source image resource. + * @param int $dst_x x-coordinate of destination point. + * @param int $dst_y y-coordinate of destination point. + * @param int $src_x x-coordinate of source point. + * @param int $src_y y-coordinate of source point. + * @param int $src_width Source width. + * @param int $src_height Source height. + * @param int $pct The two images will be merged according to pct + * which can range from 0 to 100. When pct = 0, + * no action is taken, when 100 this function behaves identically + * to imagecopy for pallete images, except for + * ignoring alpha components, while it implements alpha transparency + * for true colour images. + * @throws ImageException + * + */ +function imagecopymerge($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height, int $pct): void +{ + error_clear_last(); + $safeResult = \imagecopymerge($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $src_width, $src_height, $pct); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagecopymergegray copy a part of src_image onto + * dst_image starting at the x,y coordinates + * src_x, src_y with + * a width of src_width and a height of + * src_height. The portion defined will be copied + * onto the x,y coordinates, dst_x and + * dst_y. + * + * This function is identical to imagecopymerge except + * that when merging it preserves the hue of the source by converting + * the destination pixels to gray scale before the copy operation. + * + * @param resource $dst_image Destination image resource. + * @param resource $src_image Source image resource. + * @param int $dst_x x-coordinate of destination point. + * @param int $dst_y y-coordinate of destination point. + * @param int $src_x x-coordinate of source point. + * @param int $src_y y-coordinate of source point. + * @param int $src_width Source width. + * @param int $src_height Source height. + * @param int $pct The src_image will be changed to grayscale according + * to pct where 0 is fully grayscale and 100 is + * unchanged. When pct = 100 this function behaves + * identically to imagecopy for pallete images, except for + * ignoring alpha components, while + * it implements alpha transparency for true colour images. + * @throws ImageException + * + */ +function imagecopymergegray($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height, int $pct): void +{ + error_clear_last(); + $safeResult = \imagecopymergegray($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $src_width, $src_height, $pct); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagecopyresampled copies a rectangular + * portion of one image to another image, smoothly interpolating pixel + * values so that, in particular, reducing the size of an image still + * retains a great deal of clarity. + * + * In other words, imagecopyresampled will take a + * rectangular area from src_image of width + * src_width and height src_height at + * position (src_x,src_y) + * and place it in a rectangular area of dst_image + * of width dst_width and height dst_height + * at position (dst_x,dst_y). + * + * If the source and destination coordinates and width and heights + * differ, appropriate stretching or shrinking of the image fragment + * will be performed. The coordinates refer to the upper left + * corner. This function can be used to copy regions within the + * same image (if dst_image is the same as + * src_image) but if the regions overlap the + * results will be unpredictable. + * + * @param resource $dst_image Destination image resource. + * @param resource $src_image Source image resource. + * @param int $dst_x x-coordinate of destination point. + * @param int $dst_y y-coordinate of destination point. + * @param int $src_x x-coordinate of source point. + * @param int $src_y y-coordinate of source point. + * @param int $dst_width Destination width. + * @param int $dst_height Destination height. + * @param int $src_width Source width. + * @param int $src_height Source height. + * @throws ImageException + * + */ +function imagecopyresampled($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_width, int $dst_height, int $src_width, int $src_height): void +{ + error_clear_last(); + $safeResult = \imagecopyresampled($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_width, $dst_height, $src_width, $src_height); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagecopyresized copies a rectangular + * portion of one image to another image. + * dst_image is the destination image, + * src_image is the source image identifier. + * + * In other words, imagecopyresized will take a + * rectangular area from src_image of width + * src_width and height src_height at + * position (src_x,src_y) + * and place it in a rectangular area of dst_image + * of width dst_width and height dst_height + * at position (dst_x,dst_y). + * + * If the source and destination coordinates and width and heights + * differ, appropriate stretching or shrinking of the image fragment + * will be performed. The coordinates refer to the upper left + * corner. This function can be used to copy regions within the + * same image (if dst_image is the same as + * src_image) but if the regions overlap the + * results will be unpredictable. + * + * @param resource $dst_image Destination image resource. + * @param resource $src_image Source image resource. + * @param int $dst_x x-coordinate of destination point. + * @param int $dst_y y-coordinate of destination point. + * @param int $src_x x-coordinate of source point. + * @param int $src_y y-coordinate of source point. + * @param int $dst_width Destination width. + * @param int $dst_height Destination height. + * @param int $src_width Source width. + * @param int $src_height Source height. + * @throws ImageException + * + */ +function imagecopyresized($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_width, int $dst_height, int $src_width, int $src_height): void +{ + error_clear_last(); + $safeResult = \imagecopyresized($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_width, $dst_height, $src_width, $src_height); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagecreate returns an image identifier + * representing a blank image of specified size. + * + * In general, we recommend the use of + * imagecreatetruecolor instead of + * imagecreate so that image processing occurs on the + * highest quality image possible. If you want to output a palette image, then + * imagetruecolortopalette should be called immediately + * before saving the image with imagepng or + * imagegif. + * + * @param int $width The image width. + * @param int $height The image height. + * @return resource|false Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreate(int $width, int $height) +{ + error_clear_last(); + $safeResult = \imagecreate($width, $height); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromavif returns an image object + * representing the image obtained from the given filename. + * + * @param string $filename Path to the AVIF raster image. + * @return Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromavif(string $filename): void +{ + error_clear_last(); + $safeResult = \imagecreatefromavif($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagecreatefrombmp returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the BMP image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefrombmp(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefrombmp($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Create a new image from GD file or URL. + * + * @param string $filename Path to the GD file. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromgd(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromgd($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Create a new image from GD2 file or URL. + * + * @param string $filename Path to the GD2 image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromgd2(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromgd2($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Create a new image from a given part of GD2 file or URL. + * + * @param string $filename Path to the GD2 image. + * @param int $x x-coordinate of source point. + * @param int $y y-coordinate of source point. + * @param int $width Source width. + * @param int $height Source height. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromgd2part(string $filename, int $x, int $y, int $width, int $height) +{ + error_clear_last(); + $safeResult = \imagecreatefromgd2part($filename, $x, $y, $width, $height); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromgif returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the GIF image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromgif(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromgif($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromjpeg returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the JPEG image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromjpeg(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromjpeg($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefrompng returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the PNG image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefrompng(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefrompng($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromstring returns an image identifier + * representing the image obtained from the given data. + * These types will be automatically detected if your build of PHP supports + * them: JPEG, PNG, GIF, BMP, WBMP, GD2, WEBP and AVIF. + * + * @param string $data A string containing the image data. + * @return resource An image object will be returned on success. FALSE is returned if + * the image type is unsupported, the data is not in a recognised format, + * or the image is corrupt and cannot be loaded. + * @throws ImageException + * + */ +function imagecreatefromstring(string $data) +{ + error_clear_last(); + $safeResult = \imagecreatefromstring($data); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromtga returns an image object + * representing the image obtained from the given filename. + * + * @param string $filename Path to the Truevision TGA image. + * @return Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromtga(string $filename): void +{ + error_clear_last(); + $safeResult = \imagecreatefromtga($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagecreatefromwbmp returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the WBMP image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromwbmp(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromwbmp($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromwebp returns an image identifier + * representing the image obtained from the given filename. + * Note that animated WebP files cannot be read. + * + * @param string $filename Path to the WebP image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromwebp(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromwebp($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromxbm returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the XBM image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromxbm(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromxbm($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatefromxpm returns an image identifier + * representing the image obtained from the given filename. + * + * @param string $filename Path to the XPM image. + * @return resource Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatefromxpm(string $filename) +{ + error_clear_last(); + $safeResult = \imagecreatefromxpm($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagecreatetruecolor returns an image object + * representing a black image of the specified size. + * + * @param int $width Image width. + * @param int $height Image height. + * @return resource|false Returns an image object on success, FALSE on errors. + * @throws ImageException + * + */ +function imagecreatetruecolor(int $width, int $height) +{ + error_clear_last(); + $safeResult = \imagecreatetruecolor($width, $height); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Crops an image to the given rectangular area and returns the resulting image. + * The given image is not modified. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param array $rectangle The cropping rectangle as array with keys + * x, y, width and + * height. + * @return resource Return cropped image object on success. + * @throws ImageException + * + */ +function imagecrop($image, array $rectangle) +{ + error_clear_last(); + $safeResult = \imagecrop($image, $rectangle); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Automatically crops an image according to the given + * mode. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $mode One of the following constants: + * @param float $threshold + * @param int $color + * @return resource Returns a cropped image object on success. + * FALSE is also returned if the whole image was cropped. + * @throws ImageException + * + */ +function imagecropauto($image, int $mode = IMG_CROP_DEFAULT, float $threshold = 0.5, int $color = -1) +{ + error_clear_last(); + $safeResult = \imagecropauto($image, $mode, $threshold, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * This function is deprecated. Use combination of + * imagesetstyle and imageline + * instead. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x1 Upper left x coordinate. + * @param int $y1 Upper left y coordinate 0, 0 is the top left corner of the image. + * @param int $x2 Bottom right x coordinate. + * @param int $y2 Bottom right y coordinate. + * @param int $color The fill color. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagedashedline($image, int $x1, int $y1, int $x2, int $y2, int $color): void +{ + error_clear_last(); + $safeResult = \imagedashedline($image, $x1, $y1, $x2, $y2, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Prior to PHP 8.0.0, imagedestroy freed any memory associated + * with image image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @throws ImageException + * + */ +function imagedestroy($image): void +{ + error_clear_last(); + $safeResult = \imagedestroy($image); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws an ellipse centered at the specified coordinates. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $center_x x-coordinate of the center. + * @param int $center_y y-coordinate of the center. + * @param int $width The ellipse width. + * @param int $height The ellipse height. + * @param int $color The color of the ellipse. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imageellipse($image, int $center_x, int $center_y, int $width, int $height, int $color): void +{ + error_clear_last(); + $safeResult = \imageellipse($image, $center_x, $center_y, $width, $height, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Performs a flood fill starting at the given coordinate (top left is 0, 0) + * with the given color in the + * image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x x-coordinate of start point. + * @param int $y y-coordinate of start point. + * @param int $color The fill color. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagefill($image, int $x, int $y, int $color): void +{ + error_clear_last(); + $safeResult = \imagefill($image, $x, $y, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws a partial arc centered at the specified coordinate in the + * given image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $center_x x-coordinate of the center. + * @param int $center_y y-coordinate of the center. + * @param int $width The arc width. + * @param int $height The arc height. + * @param int $start_angle The arc start angle, in degrees. + * @param int $end_angle The arc end angle, in degrees. + * 0° is located at the three-o'clock position, and the arc is drawn + * clockwise. + * @param int $color A color identifier created with imagecolorallocate. + * @param int $style A bitwise OR of the following possibilities: + * + * IMG_ARC_PIE + * IMG_ARC_CHORD + * IMG_ARC_NOFILL + * IMG_ARC_EDGED + * + * IMG_ARC_PIE and IMG_ARC_CHORD are + * mutually exclusive; IMG_ARC_CHORD just + * connects the starting and ending angles with a straight line, while + * IMG_ARC_PIE produces a rounded edge. + * IMG_ARC_NOFILL indicates that the arc + * or chord should be outlined, not filled. IMG_ARC_EDGED, + * used together with IMG_ARC_NOFILL, indicates that the + * beginning and ending angles should be connected to the center - this is a + * good way to outline (rather than fill) a 'pie slice'. + * @throws ImageException + * + */ +function imagefilledarc($image, int $center_x, int $center_y, int $width, int $height, int $start_angle, int $end_angle, int $color, int $style): void +{ + error_clear_last(); + $safeResult = \imagefilledarc($image, $center_x, $center_y, $width, $height, $start_angle, $end_angle, $color, $style); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws an ellipse centered at the specified coordinate on the given + * image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $center_x x-coordinate of the center. + * @param int $center_y y-coordinate of the center. + * @param int $width The ellipse width. + * @param int $height The ellipse height. + * @param int $color The fill color. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagefilledellipse($image, int $center_x, int $center_y, int $width, int $height, int $color): void +{ + error_clear_last(); + $safeResult = \imagefilledellipse($image, $center_x, $center_y, $width, $height, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Creates a rectangle filled with color in the given + * image starting at point 1 and ending at point 2. + * 0, 0 is the top left corner of the image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x1 x-coordinate for point 1. + * @param int $y1 y-coordinate for point 1. + * @param int $x2 x-coordinate for point 2. + * @param int $y2 y-coordinate for point 2. + * @param int $color The fill color. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagefilledrectangle($image, int $x1, int $y1, int $x2, int $y2, int $color): void +{ + error_clear_last(); + $safeResult = \imagefilledrectangle($image, $x1, $y1, $x2, $y2, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagefilltoborder performs a flood fill + * whose border color is defined by border_color. + * The starting point for the fill is x, + * y (top left is 0, 0) and the region is + * filled with color color. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x x-coordinate of start. + * @param int $y y-coordinate of start. + * @param int $border_color The border color. A color identifier created with imagecolorallocate. + * @param int $color The fill color. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagefilltoborder($image, int $x, int $y, int $border_color, int $color): void +{ + error_clear_last(); + $safeResult = \imagefilltoborder($image, $x, $y, $border_color, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagefilter applies the given filter + * filter on the image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $filter filter can be one of the following: + * + * + * + * IMG_FILTER_NEGATE: Reverses all colors of + * the image. + * + * + * + * + * IMG_FILTER_GRAYSCALE: Converts the image into + * grayscale by changing the red, green and blue components to their + * weighted sum using the same coefficients as the REC.601 luma (Y') + * calculation. The alpha components are retained. For palette images the + * result may differ due to palette limitations. + * + * + * + * + * IMG_FILTER_BRIGHTNESS: Changes the brightness + * of the image. Use args to set the level of + * brightness. The range for the brightness is -255 to 255. + * + * + * + * + * IMG_FILTER_CONTRAST: Changes the contrast of + * the image. Use args to set the level of + * contrast. + * + * + * + * + * IMG_FILTER_COLORIZE: Like + * IMG_FILTER_GRAYSCALE, except you can specify the + * color. Use args, arg2 and + * arg3 in the form of + * red, green, + * blue and arg4 for the + * alpha channel. The range for each color is 0 to 255. + * + * + * + * + * IMG_FILTER_EDGEDETECT: Uses edge detection to + * highlight the edges in the image. + * + * + * + * + * IMG_FILTER_EMBOSS: Embosses the image. + * + * + * + * + * IMG_FILTER_GAUSSIAN_BLUR: Blurs the image using + * the Gaussian method. + * + * + * + * + * IMG_FILTER_SELECTIVE_BLUR: Blurs the image. + * + * + * + * + * IMG_FILTER_MEAN_REMOVAL: Uses mean removal to + * achieve a "sketchy" effect. + * + * + * + * + * IMG_FILTER_SMOOTH: Makes the image smoother. + * Use args to set the level of smoothness. + * + * + * + * + * IMG_FILTER_PIXELATE: Applies pixelation effect + * to the image, use args to set the block size + * and arg2 to set the pixelation effect mode. + * + * + * + * + * IMG_FILTER_SCATTER: Applies scatter effect + * to the image, use args and + * arg2 to define the effect strength and + * additionally arg3 to only apply the + * on select pixel colors. + * + * + * + * @param int $args + * + * + * IMG_FILTER_BRIGHTNESS: Brightness level. + * + * + * + * + * IMG_FILTER_CONTRAST: Contrast level. + * + * + * + * + * IMG_FILTER_COLORIZE: Value of red component. + * + * + * + * + * IMG_FILTER_SMOOTH: Smoothness level. + * + * + * + * + * IMG_FILTER_PIXELATE: Block size in pixels. + * + * + * + * + * IMG_FILTER_SCATTER: Effect substraction level. + * This must not be higher or equal to the addition level set with + * arg2. + * + * + * + * @throws ImageException + * + */ +function imagefilter($image, int $filter, int ...$args): void +{ + error_clear_last(); + if ($args !== []) { + $safeResult = \imagefilter($image, $filter, ...$args); + } else { + $safeResult = \imagefilter($image, $filter); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Flips the image image using the given + * mode. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $mode Flip mode, this can be one of the IMG_FLIP_* constants: + * + * + * + * + * + * Constant + * Meaning + * + * + * + * + * IMG_FLIP_HORIZONTAL + * + * Flips the image horizontally. + * + * + * + * IMG_FLIP_VERTICAL + * + * Flips the image vertically. + * + * + * + * IMG_FLIP_BOTH + * + * Flips the image both horizontally and vertically. + * + * + * + * + * + * @throws ImageException + * + */ +function imageflip($image, int $mode): void +{ + error_clear_last(); + $safeResult = \imageflip($image, $mode); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * This function calculates and returns the bounding box in pixels + * for a FreeType text. + * + * @param float $size The font size in points. + * @param float $angle Angle in degrees in which string will be + * measured. + * @param string $font_filename The name of the TrueType font file (can be a URL). Depending on + * which version of the GD library that PHP is using, it may attempt to + * search for files that do not begin with a leading '/' by appending + * '.ttf' to the filename and searching along a library-defined font path. + * @param string $string The string to be measured. + * @param array $options + * Possible array indexes for options + * + * + * + * Key + * Type + * Meaning + * + * + * + * + * linespacing + * float + * Defines drawing linespacing + * + * + * + * + * @return array imageftbbox returns an array with 8 + * elements representing four points making the bounding box of the + * text: + * + * + * + * + * 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. + * + * On failure, FALSE is returned. + * @throws ImageException + * + */ +function imageftbbox(float $size, float $angle, string $font_filename, string $string, array $options = []): array +{ + error_clear_last(); + $safeResult = \imageftbbox($size, $angle, $font_filename, $string, $options); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param float $size The font size to use 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 index of the desired color for the text, see + * imagecolorexact. + * @param string $font_filename The path to the TrueType font you wish to use. + * + * Depending on which version of the GD library PHP is using, when + * font_filename 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. + * + * In many cases where a font resides in the same directory as the script using it + * the following trick will alleviate any include problems. + * + * + * ]]> + * + * @param string $text Text to be inserted into image. + * @param array $options + * Possible array indexes for options + * + * + * + * Key + * Type + * Meaning + * + * + * + * + * linespacing + * float + * Defines drawing linespacing + * + * + * + * + * @return array This function returns an array defining the four points of the box, starting in the lower left and moving counter-clockwise: + * + * + * + * + * 0 + * lower left x-coordinate + * + * + * 1 + * lower left y-coordinate + * + * + * 2 + * lower right x-coordinate + * + * + * 3 + * lower right y-coordinate + * + * + * 4 + * upper right x-coordinate + * + * + * 5 + * upper right y-coordinate + * + * + * 6 + * upper left x-coordinate + * + * + * 7 + * upper left y-coordinate + * + * + * + * + * + * On failure, FALSE is returned. + * @throws ImageException + * + */ +function imagefttext($image, float $size, float $angle, int $x, int $y, int $color, string $font_filename, string $text, array $options = []): array +{ + error_clear_last(); + $safeResult = \imagefttext($image, $size, $angle, $x, $y, $color, $font_filename, $text, $options); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Applies gamma correction to the given gd image + * given an input and an output gamma. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param float $input_gamma The input gamma. + * @param float $output_gamma The output gamma. + * @throws ImageException + * + */ +function imagegammacorrect($image, float $input_gamma, float $output_gamma): void +{ + error_clear_last(); + $safeResult = \imagegammacorrect($image, $input_gamma, $output_gamma); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Outputs a GD image to the given file. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @throws ImageException + * + */ +function imagegd($image, $file = null): void +{ + error_clear_last(); + if ($file !== null) { + $safeResult = \imagegd($image, $file); + } else { + $safeResult = \imagegd($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Outputs a GD2 image to the given file. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @param int $chunk_size Chunk size. + * @param int $mode Either IMG_GD2_RAW or + * IMG_GD2_COMPRESSED. Default is + * IMG_GD2_RAW. + * @throws ImageException + * + */ +function imagegd2($image, $file = null, int $chunk_size = 128, int $mode = IMG_GD2_RAW): void +{ + error_clear_last(); + if ($mode !== IMG_GD2_RAW) { + $safeResult = \imagegd2($image, $file, $chunk_size, $mode); + } elseif ($chunk_size !== 128) { + $safeResult = \imagegd2($image, $file, $chunk_size); + } elseif ($file !== null) { + $safeResult = \imagegd2($image, $file); + } else { + $safeResult = \imagegd2($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagegif creates the GIF + * file in file from the image image. The + * image argument is the return from the + * imagecreate or imagecreatefrom* + * function. + * + * The image format will be GIF87a unless the + * image has been made transparent with + * imagecolortransparent, in which case the + * image format will be GIF89a. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @throws ImageException + * + */ +function imagegif($image, $file = null): void +{ + error_clear_last(); + if ($file !== null) { + $safeResult = \imagegif($image, $file); + } else { + $safeResult = \imagegif($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Grabs a screenshot of the whole screen. + * + * @return resource Returns an image object on success, FALSE on failure. + * @throws ImageException + * + */ +function imagegrabscreen() +{ + error_clear_last(); + $safeResult = \imagegrabscreen(); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Grabs a window or its client area using a windows handle (HWND property in COM instance) + * + * @param int $handle The HWND window ID. + * @param bool $client_area Include the client area of the application window. + * @return \GdImage Returns an image object on success, FALSE on failure. + * @throws ImageException + * + */ +function imagegrabwindow(int $handle, bool $client_area = false): \GdImage +{ + error_clear_last(); + $safeResult = \imagegrabwindow($handle, $client_area); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagejpeg creates a JPEG file from + * the given image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @param int $quality quality is optional, and ranges from 0 (worst + * quality, smaller file) to 100 (best quality, biggest file). The + * default (-1) uses the default IJG quality value (about 75). + * @throws ImageException + * + */ +function imagejpeg($image, $file = null, int $quality = -1): void +{ + error_clear_last(); + if ($quality !== -1) { + $safeResult = \imagejpeg($image, $file, $quality); + } elseif ($file !== null) { + $safeResult = \imagejpeg($image, $file); + } else { + $safeResult = \imagejpeg($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Set the alpha blending flag to use layering effects. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $effect One of the following constants: + * + * + * IMG_EFFECT_REPLACE + * + * + * Use pixel replacement (equivalent of passing TRUE to + * imagealphablending) + * + * + * + * + * IMG_EFFECT_ALPHABLEND + * + * + * Use normal pixel blending (equivalent of passing FALSE to + * imagealphablending) + * + * + * + * + * IMG_EFFECT_NORMAL + * + * + * Same as IMG_EFFECT_ALPHABLEND. + * + * + * + * + * IMG_EFFECT_OVERLAY + * + * + * Overlay has the effect that black background pixels will remain + * black, white background pixels will remain white, but grey + * background pixels will take the colour of the foreground pixel. + * + * + * + * + * IMG_EFFECT_MULTIPLY + * + * + * Overlays with a multiply effect. + * + * + * + * + * @throws ImageException + * + */ +function imagelayereffect($image, int $effect): void +{ + error_clear_last(); + $safeResult = \imagelayereffect($image, $effect); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws a line between the two given points. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x1 x-coordinate for first point. + * @param int $y1 y-coordinate for first point. + * @param int $x2 x-coordinate for second point. + * @param int $y2 y-coordinate for second point. + * @param int $color The line color. A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imageline($image, int $x1, int $y1, int $x2, int $y2, int $color): void +{ + error_clear_last(); + $safeResult = \imageline($image, $x1, $y1, $x2, $y2, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imageloadfont loads a user-defined bitmap and returns + * its identifier. + * + * @param string $filename The font file format is currently binary and architecture + * dependent. This means you should generate the font files on the + * same type of CPU as the machine you are running PHP on. + * + * + * Font file format + * + * + * + * byte position + * C data type + * description + * + * + * + * + * byte 0-3 + * int + * number of characters in the font + * + * + * byte 4-7 + * int + * + * value of first character in the font (often 32 for space) + * + * + * + * byte 8-11 + * int + * pixel width of each character + * + * + * byte 12-15 + * int + * pixel height of each character + * + * + * byte 16- + * char + * + * array with character data, one byte per pixel in each + * character, for a total of (nchars*width*height) bytes. + * + * + * + * + * + * @return int Returns an GdFont instance. + * @throws ImageException + * + */ +function imageloadfont(string $filename): int +{ + error_clear_last(); + $safeResult = \imageloadfont($filename); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Outputs or saves a PNG image from the given + * image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * + * NULL is invalid if the quality and + * filters arguments are not used. + * @param int $quality Compression level: from 0 (no compression) to 9. + * The default (-1) uses the zlib compression default. + * For more information see the zlib manual. + * @param int $filters Allows reducing the PNG file size. It is a bitmask field which may be + * set to any combination of the PNG_FILTER_* + * constants. PNG_NO_FILTER or + * PNG_ALL_FILTERS may also be used to respectively + * disable or activate all filters. + * The default value (-1) disables filtering. + * @throws ImageException + * + */ +function imagepng($image, $file = null, int $quality = -1, int $filters = -1): void +{ + error_clear_last(); + if ($filters !== -1) { + $safeResult = \imagepng($image, $file, $quality, $filters); + } elseif ($quality !== -1) { + $safeResult = \imagepng($image, $file, $quality); + } elseif ($file !== null) { + $safeResult = \imagepng($image, $file); + } else { + $safeResult = \imagepng($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagerectangle creates a rectangle starting at + * the specified coordinates. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x1 Upper left x coordinate. + * @param int $y1 Upper left y coordinate + * 0, 0 is the top left corner of the image. + * @param int $x2 Bottom right x coordinate. + * @param int $y2 Bottom right y coordinate. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagerectangle($image, int $x1, int $y1, int $x2, int $y2, int $color): void +{ + error_clear_last(); + $safeResult = \imagerectangle($image, $x1, $y1, $x2, $y2, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imageresolution allows to set and get the resolution of + * an image in DPI (dots per inch). If the optional parameters are NULL, + * the current resolution is returned as an indexed array. If only + * resolution_x is not NULL, the horizontal and vertical resolution + * are set to this value. If none of the optional parameters are NULL, the horizontal + * and vertical resolution are set to these values, respectively. + * + * The resolution is only used as meta information when images are read from and + * written to formats supporting this kind of information (curently PNG and + * JPEG). It does not affect any drawing operations. The default resolution + * for new images is 96 DPI. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $resolution_x The horizontal resolution in DPI. + * @param int $resolution_y The vertical resolution in DPI. + * @return mixed When used as getter, + * it returns an indexed array of the horizontal and vertical resolution on + * success. + * When used as setter, it returns + * TRUE on success. + * @throws ImageException + * + */ +function imageresolution($image, ?int $resolution_x = null, ?int $resolution_y = null) +{ + error_clear_last(); + if ($resolution_y !== null) { + $safeResult = \imageresolution($image, $resolution_x, $resolution_y); + } elseif ($resolution_x !== null) { + $safeResult = \imageresolution($image, $resolution_x); + } else { + $safeResult = \imageresolution($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Rotates the image image using the given + * angle in degrees. + * + * The center of rotation is the center of the image, and the rotated + * image may have different dimensions than the original image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param float $angle Rotation angle, in degrees. The rotation angle is interpreted as the + * number of degrees to rotate the image anticlockwise. + * @param int $background_color Specifies the color of the uncovered zone after the rotation + * @return resource Returns an image object for the rotated image. + * @throws ImageException + * + */ +function imagerotate($image, float $angle, int $background_color) +{ + error_clear_last(); + $safeResult = \imagerotate($image, $angle, $background_color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagesavealpha sets the flag which determines whether to retain + * full alpha channel information (as opposed to single-color transparency) + * when saving images. + * This is only supported for image formats which support full alpha channel information, + * i.e. PNG, WebP and AVIF. + * + * + * imagesavealpha is only meaningful for PNG + * images, since the full alpha channel is always saved for WebP + * and AVIF. It is not recommended to rely on this behavior, + * as it may change in the future. Thus, imagesavealpha + * should be called deliberately also for WebP and + * AVIF images. + * + * + * + * Alphablending has to be disabled (imagealphablending($im, false)) + * to retain the alpha-channel in the first place. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param bool $enable Whether to save the alpha channel or not. Defaults to FALSE. + * @throws ImageException + * + */ +function imagesavealpha($image, bool $enable): void +{ + error_clear_last(); + $safeResult = \imagesavealpha($image, $enable); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagescale scales an image using the given + * interpolation algorithm. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $width The width to scale the image to. + * @param int $height The height to scale the image to. If omitted or negative, the aspect + * ratio will be preserved. + * @param int $mode One of IMG_NEAREST_NEIGHBOUR, + * IMG_BILINEAR_FIXED, + * IMG_BICUBIC, + * IMG_BICUBIC_FIXED or anything else (will use two + * pass). + * + * + * IMG_WEIGHTED4 is not yet supported. + * + * + * @return resource Return the scaled image object on success. + * @throws ImageException + * + */ +function imagescale($image, int $width, int $height = -1, int $mode = IMG_BILINEAR_FIXED) +{ + error_clear_last(); + $safeResult = \imagescale($image, $width, $height, $mode); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagesetbrush sets the brush image to be + * used by all line drawing functions (such as imageline + * and imagepolygon) when drawing with the special + * colors IMG_COLOR_BRUSHED or + * IMG_COLOR_STYLEDBRUSHED. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param resource $brush An image object. + * @throws ImageException + * + */ +function imagesetbrush($image, $brush): void +{ + error_clear_last(); + $safeResult = \imagesetbrush($image, $brush); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagesetclip sets the current clipping rectangle, i.e. + * the area beyond which no pixels will be drawn. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x1 The x-coordinate of the upper left corner. + * @param int $y1 The y-coordinate of the upper left corner. + * @param int $x2 The x-coordinate of the lower right corner. + * @param int $y2 The y-coordinate of the lower right corner. + * @throws ImageException + * + */ +function imagesetclip($image, int $x1, int $y1, int $x2, int $y2): void +{ + error_clear_last(); + $safeResult = \imagesetclip($image, $x1, $y1, $x2, $y2); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Sets the interpolation method, setting an interpolation method affects the rendering + * of various functions in GD, such as the imagerotate function. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $method The interpolation method, which can be one of the following: + * + * + * + * IMG_BELL: Bell filter. + * + * + * + * + * IMG_BESSEL: Bessel filter. + * + * + * + * + * IMG_BICUBIC: Bicubic interpolation. + * + * + * + * + * IMG_BICUBIC_FIXED: Fixed point implementation of the bicubic interpolation. + * + * + * + * + * IMG_BILINEAR_FIXED: Fixed point implementation of the bilinear interpolation (default (also on image creation)). + * + * + * + * + * IMG_BLACKMAN: Blackman window function. + * + * + * + * + * IMG_BOX: Box blur filter. + * + * + * + * + * IMG_BSPLINE: Spline interpolation. + * + * + * + * + * IMG_CATMULLROM: Cubic Hermite spline interpolation. + * + * + * + * + * IMG_GAUSSIAN: Gaussian function. + * + * + * + * + * IMG_GENERALIZED_CUBIC: Generalized cubic spline fractal interpolation. + * + * + * + * + * IMG_HERMITE: Hermite interpolation. + * + * + * + * + * IMG_HAMMING: Hamming filter. + * + * + * + * + * IMG_HANNING: Hanning filter. + * + * + * + * + * IMG_MITCHELL: Mitchell filter. + * + * + * + * + * IMG_POWER: Power interpolation. + * + * + * + * + * IMG_QUADRATIC: Inverse quadratic interpolation. + * + * + * + * + * IMG_SINC: Sinc function. + * + * + * + * + * IMG_NEAREST_NEIGHBOUR: Nearest neighbour interpolation. + * + * + * + * + * IMG_WEIGHTED4: Weighting filter. + * + * + * + * + * IMG_TRIANGLE: Triangle interpolation. + * + * + * + * @throws ImageException + * + */ +function imagesetinterpolation($image, int $method = IMG_BILINEAR_FIXED): void +{ + error_clear_last(); + $safeResult = \imagesetinterpolation($image, $method); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagesetpixel draws a pixel at the specified + * coordinate. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $x x-coordinate. + * @param int $y y-coordinate. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagesetpixel($image, int $x, int $y, int $color): void +{ + error_clear_last(); + $safeResult = \imagesetpixel($image, $x, $y, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagesetstyle sets the style to be used by all + * line drawing functions (such as imageline + * and imagepolygon) when drawing with the special + * color IMG_COLOR_STYLED or lines of images with color + * IMG_COLOR_STYLEDBRUSHED. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param array $style An array of pixel colors. You can use the + * IMG_COLOR_TRANSPARENT constant to add a + * transparent pixel. + * Note that style must not be an empty array. + * @throws ImageException + * + */ +function imagesetstyle($image, array $style): void +{ + error_clear_last(); + $safeResult = \imagesetstyle($image, $style); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagesetthickness sets the thickness of the lines + * drawn when drawing rectangles, polygons, arcs etc. to + * thickness pixels. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $thickness Thickness, in pixels. + * @throws ImageException + * + */ +function imagesetthickness($image, int $thickness): void +{ + error_clear_last(); + $safeResult = \imagesetthickness($image, $thickness); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagesettile sets the tile image to be + * used by all region filling functions (such as imagefill + * and imagefilledpolygon) when filling with the special + * color IMG_COLOR_TILED. + * + * A tile is an image used to fill an area with a repeated pattern. Any + * GD image can be used as a tile, and by setting the transparent color index of the tile + * image with imagecolortransparent, a tile allows certain parts + * of the underlying area to shine through can be created. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param resource $tile The image object to be used as a tile. + * @throws ImageException + * + */ +function imagesettile($image, $tile): void +{ + error_clear_last(); + $safeResult = \imagesettile($image, $tile); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws a string at the given coordinates. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $font Can be 1, 2, 3, 4, 5 for built-in + * fonts in latin2 encoding (where higher numbers corresponding to larger fonts) or GdFont instance, + * returned by imageloadfont. + * @param int $x x-coordinate of the upper left corner. + * @param int $y y-coordinate of the upper left corner. + * @param string $string The string to be written. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagestring($image, int $font, int $x, int $y, string $string, int $color): void +{ + error_clear_last(); + $safeResult = \imagestring($image, $font, $x, $y, $string, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Draws a string vertically at the given + * coordinates. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param int $font Can be 1, 2, 3, 4, 5 for built-in + * fonts in latin2 encoding (where higher numbers corresponding to larger fonts) or GdFont instance, + * returned by imageloadfont. + * @param int $x x-coordinate of the bottom left corner. + * @param int $y y-coordinate of the bottom left corner. + * @param string $string The string to be written. + * @param int $color A color identifier created with imagecolorallocate. + * @throws ImageException + * + */ +function imagestringup($image, int $font, int $x, int $y, string $string, int $color): void +{ + error_clear_last(); + $safeResult = \imagestringup($image, $font, $x, $y, $string, $color); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * imagetruecolortopalette converts a truecolor image + * to a palette image. The code for this function was originally drawn from + * the Independent JPEG Group library code, which is excellent. The code + * has been modified to preserve as much alpha channel information as + * possible in the resulting palette, in addition to preserving colors as + * well as possible. This does not work as well as might be hoped. It is + * usually best to simply produce a truecolor output image instead, which + * guarantees the highest output quality. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param bool $dither Indicates if the image should be dithered - if it is TRUE then + * dithering will be used which will result in a more speckled image but + * with better color approximation. + * @param int $num_colors Sets the maximum number of colors that should be retained in the palette. + * @throws ImageException + * + */ +function imagetruecolortopalette($image, bool $dither, int $num_colors): void +{ + error_clear_last(); + $safeResult = \imagetruecolortopalette($image, $dither, $num_colors); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * This function calculates and returns the bounding box in pixels + * for a TrueType text. + * + * @param float $size The font size in points. + * @param float $angle Angle in degrees in which string will be measured. + * @param string $font_filename 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 $string The string to be measured. + * @param array $options + * @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 ImageException + * + */ +function imagettfbbox(float $size, float $angle, string $font_filename, string $string, array $options = []): array +{ + error_clear_last(); + $safeResult = \imagettfbbox($size, $angle, $font_filename, $string, $options); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Writes the given text into the image using TrueType + * fonts. + * + * @param resource $image A GdImage object, 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 $font_filename 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. + * @param array $options + * @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. + * @throws ImageException + * + */ +function imagettftext($image, float $size, float $angle, int $x, int $y, int $color, string $font_filename, string $text, array $options = []): array +{ + error_clear_last(); + $safeResult = \imagettftext($image, $size, $angle, $x, $y, $color, $font_filename, $text, $options); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * imagewbmp outputs or save a WBMP + * version of the given image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @param int $foreground_color You can set the foreground color with this parameter by setting an + * identifier obtained from imagecolorallocate. + * The default foreground color is black. + * @throws ImageException + * + */ +function imagewbmp($image, $file = null, ?int $foreground_color = null): void +{ + error_clear_last(); + if ($foreground_color !== null) { + $safeResult = \imagewbmp($image, $file, $foreground_color); + } elseif ($file !== null) { + $safeResult = \imagewbmp($image, $file); + } else { + $safeResult = \imagewbmp($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Outputs or saves a WebP version of the given image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. + * @param int $quality quality ranges from 0 (worst + * quality, smaller file) to 100 (best quality, biggest file). + * @throws ImageException + * + */ +function imagewebp($image, $file = null, int $quality = -1): void +{ + error_clear_last(); + if ($quality !== -1) { + $safeResult = \imagewebp($image, $file, $quality); + } elseif ($file !== null) { + $safeResult = \imagewebp($image, $file); + } else { + $safeResult = \imagewebp($image); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Outputs or save an XBM version of the given + * image. + * + * @param resource $image A GdImage object, returned by one of the image creation functions, + * such as imagecreatetruecolor. + * @param string|resource|null $filename The path to save the file to, given as string. If NULL, the raw image stream will be output 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_color 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 ImageException + * + */ +function imagexbm($image, $filename, ?int $foreground_color = null): void +{ + error_clear_last(); + if ($foreground_color !== null) { + $safeResult = \imagexbm($image, $filename, $foreground_color); + } else { + $safeResult = \imagexbm($image, $filename); + } + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} + + +/** + * Embeds binary IPTC data into a JPEG image. + * + * @param string $iptc_data The data to be written. + * @param string $filename 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 string|bool If spool is less than 2, the JPEG will be returned. Otherwise returns TRUE on success. + * @throws ImageException + * + */ +function iptcembed(string $iptc_data, string $filename, int $spool = 0) +{ + error_clear_last(); + $safeResult = \iptcembed($iptc_data, $filename, $spool); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Parses an IPTC block into its single tags. + * + * @param string $iptc_block 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 ImageException + * + */ +function iptcparse(string $iptc_block): array +{ + error_clear_last(); + $safeResult = \iptcparse($iptc_block); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 ImageException + * + */ +function jpeg2wbmp(string $jpegname, string $wbmpname, int $dest_height, int $dest_width, int $threshold): void +{ + error_clear_last(); + $safeResult = \jpeg2wbmp($jpegname, $wbmpname, $dest_height, $dest_width, $threshold); + if ($safeResult === false) { + throw 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 ImageException + * + */ +function png2wbmp(string $pngname, string $wbmpname, int $dest_height, int $dest_width, int $threshold): void +{ + error_clear_last(); + $safeResult = \png2wbmp($pngname, $wbmpname, $dest_height, $dest_width, $threshold); + if ($safeResult === false) { + throw ImageException::createFromPhpError(); + } +} diff --git a/generated/8.5/imap.php b/generated/8.5/imap.php new file mode 100644 index 00000000..f654cc34 --- /dev/null +++ b/generated/8.5/imap.php @@ -0,0 +1,2092 @@ + + * + * + * @param array $controls Array of LDAP Controls to send with the request. + * @throws LdapException + * + */ +function ldap_add($ldap, string $dn, array $entry, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_add($ldap, $dn, $entry, $controls); + } else { + $safeResult = \ldap_add($ldap, $dn, $entry); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Binds to the LDAP directory with specified RDN and password. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param string|null $dn + * @param string|null $password + * @throws LdapException + * + */ +function ldap_bind($ldap, ?string $dn = null, ?string $password = null): void +{ + error_clear_last(); + if ($password !== null) { + $safeResult = \ldap_bind($ldap, $dn, $password); + } elseif ($dn !== null) { + $safeResult = \ldap_bind($ldap, $dn); + } else { + $safeResult = \ldap_bind($ldap); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Retrieve the pagination information send by the server. + * + * @param resource $link An LDAP resource, returned by ldap_connect. + * @param resource $result + * @param string|null $cookie An opaque structure sent by the server. + * @param int|null $estimated The estimated number of entries to retrieve. + * @throws LdapException + * + */ +function ldap_control_paged_result_response($link, $result, ?string &$cookie = null, ?int &$estimated = null): void +{ + error_clear_last(); + $safeResult = \ldap_control_paged_result_response($link, $result, $cookie, $estimated); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Enable LDAP pagination by sending the pagination control (page size, cookie...). + * + * @param resource $link An LDAP resource, 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 LdapException + * + */ +function ldap_control_paged_result($link, int $pagesize, bool $iscritical = false, string $cookie = ""): void +{ + error_clear_last(); + $safeResult = \ldap_control_paged_result($link, $pagesize, $iscritical, $cookie); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Returns the number of entries stored in the result of previous search + * operations. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $result An LDAP\Result instance, returned by ldap_list or ldap_search. + * @return int Returns number of entries in the result. + * @throws LdapException + * + */ +function ldap_count_entries($ldap, $result): int +{ + error_clear_last(); + $safeResult = \ldap_count_entries($ldap, $result); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Deletes a particular entry in LDAP directory. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param string $dn The distinguished name of an LDAP entity. + * @param array $controls Array of LDAP Controls to send with the request. + * @throws LdapException + * + */ +function ldap_delete($ldap, string $dn, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_delete($ldap, $dn, $controls); + } else { + $safeResult = \ldap_delete($ldap, $dn); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Turns the specified dn, into a more user-friendly + * form, stripping off type names. + * + * @param string $dn The distinguished name of an LDAP entity. + * @return string Returns the user friendly name. + * @throws LdapException + * + */ +function ldap_dn2ufn(string $dn): string +{ + error_clear_last(); + $safeResult = \ldap_dn2ufn($dn); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Performs a PASSWD extended operation. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param string $user dn of the user to change the password of. + * @param string $old_password The old password of this user. May be ommited depending of server configuration. + * @param string $new_password The new password for this user. May be omitted or empty to have a generated password. + * @param array $controls If provided, a password policy request control is send with the request and this is + * filled with an array of LDAP Controls + * returned with the request. + * @return string|bool Returns the generated password if new_password is empty or omitted. + * Otherwise returns TRUE on success. + * @throws LdapException + * + */ +function ldap_exop_passwd($ldap, string $user = "", string $old_password = "", string $new_password = "", ?array &$controls = null) +{ + error_clear_last(); + $safeResult = \ldap_exop_passwd($ldap, $user, $old_password, $new_password, $controls); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Performs a WHOAMI extended operation and returns the data. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @return string|bool The data returned by the server. + * @throws LdapException + * + */ +function ldap_exop_whoami($ldap) +{ + error_clear_last(); + $safeResult = \ldap_exop_whoami($ldap); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Performs an extended operation on the specified ldap with + * request_oid the OID of the operation and + * request_data the data. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param string $request_oid 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 $request_data 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|null $controls Array of LDAP Controls to send with the request. + * @param string|null $response_data 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|null $response_oid Will be filled with the response OID if provided, usually equal to the request OID. + * @return resource|bool When used with response_data, returns TRUE on success. + * When used without response_data, returns a result identifier. + * @throws LdapException + * + */ +function ldap_exop($ldap, string $request_oid, ?string $request_data = null, ?array $controls = null, ?string &$response_data = null, ?string &$response_oid = null) +{ + error_clear_last(); + if ($response_oid !== null) { + $safeResult = \ldap_exop($ldap, $request_oid, $request_data, $controls, $response_data, $response_oid); + } elseif ($response_data !== null) { + $safeResult = \ldap_exop($ldap, $request_oid, $request_data, $controls, $response_data); + } elseif ($controls !== null) { + $safeResult = \ldap_exop($ldap, $request_oid, $request_data, $controls); + } elseif ($request_data !== null) { + $safeResult = \ldap_exop($ldap, $request_oid, $request_data); + } else { + $safeResult = \ldap_exop($ldap, $request_oid); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 LdapException + * + */ +function ldap_explode_dn(string $dn, int $with_attrib): array +{ + error_clear_last(); + $safeResult = \ldap_explode_dn($dn, $with_attrib); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $entry An LDAP\ResultEntry instance. + * @return string Returns the first attribute in the entry on success and FALSE on + * error. + * @throws LdapException + * + */ +function ldap_first_attribute($ldap, $entry): string +{ + error_clear_last(); + $safeResult = \ldap_first_attribute($ldap, $entry); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $result An LDAP\Result instance, returned by ldap_list or ldap_search. + * @return resource Returns an LDAP\ResultEntry instance. + * @throws LdapException + * + */ +function ldap_first_entry($ldap, $result) +{ + error_clear_last(); + $safeResult = \ldap_first_entry($ldap, $result); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 An LDAP\Result instance, returned by ldap_list or ldap_search. + * @throws LdapException + * + */ +function ldap_free_result($result): void +{ + error_clear_last(); + $safeResult = \ldap_free_result($result); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Finds out the DN of an entry in the result. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $entry An LDAP\ResultEntry instance. + * @return string Returns the DN of the result entry and FALSE on error. + * @throws LdapException + * + */ +function ldap_get_dn($ldap, $entry): string +{ + error_clear_last(); + $safeResult = \ldap_get_dn($ldap, $entry); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Reads multiple entries from the given result, and then reading the + * attributes and multiple values. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $result An LDAP\Result instance, returned by ldap_list or ldap_search. + * @return array Returns a complete result information in a multi-dimensional array on + * success. + * + * 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 LdapException + * + */ +function ldap_get_entries($ldap, $result): array +{ + error_clear_last(); + $safeResult = \ldap_get_entries($ldap, $result); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Sets value to the value of the specified option. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param int $option The parameter option can be one of: + * + * + * + * + * Option + * Type + * since + * + * + * + * + * LDAP_OPT_DEREF + * int + * + * + * + * LDAP_OPT_SIZELIMIT + * int + * + * + * + * LDAP_OPT_TIMELIMIT + * int + * + * + * + * LDAP_OPT_NETWORK_TIMEOUT + * int + * + * + * + * LDAP_OPT_PROTOCOL_VERSION + * int + * + * + * + * LDAP_OPT_ERROR_NUMBER + * int + * + * + * + * LDAP_OPT_DIAGNOSTIC_MESSAGE + * string + * + * + * + * LDAP_OPT_REFERRALS + * int + * + * + * + * LDAP_OPT_RESTART + * int + * + * + * + * 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 + * int + * 7.1 + * + * + * LDAP_OPT_X_TLS_CRL_NONE + * int + * 7.1 + * + * + * LDAP_OPT_X_TLS_CRL_PEER + * int + * 7.1 + * + * + * LDAP_OPT_X_TLS_CRL_ALL + * int + * 7.1 + * + * + * LDAP_OPT_X_TLS_CRLFILE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_DHFILE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_KEYFILE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_PACKAGE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_PROTOCOL_MIN + * int + * 7.1 + * + * + * LDAP_OPT_X_TLS_RANDOM_FILE + * string + * 7.1 + * + * + * LDAP_OPT_X_TLS_REQUIRE_CERT + * int + * + * + * + * + * + * @param mixed $value This will be set to the option value. + * @throws LdapException + * + */ +function ldap_get_option($ldap, int $option, &$value = null): void +{ + error_clear_last(); + $safeResult = \ldap_get_option($ldap, $option, $value); + if ($safeResult === false) { + throw 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 $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $entry An LDAP\ResultEntry instance. + * @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 LdapException + * + */ +function ldap_get_values_len($ldap, $entry, string $attribute): array +{ + error_clear_last(); + $safeResult = \ldap_get_values_len($ldap, $entry, $attribute); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Reads all the values of the attribute in the entry in the result. + * + * This call needs a entry, + * 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 $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $entry An LDAP\ResultEntry instance. + * @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 LdapException + * + */ +function ldap_get_values($ldap, $entry, string $attribute): array +{ + error_clear_last(); + $safeResult = \ldap_get_values($ldap, $entry, $attribute); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Adds one or more attribute values to the specified dn. + * To add a whole new object see ldap_add function. + * + * @param resource $ldap An LDAP\Connection instance, 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 $controls Array of LDAP Controls to send with the request. + * @throws LdapException + * + */ +function ldap_mod_add($ldap, string $dn, array $entry, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_mod_add($ldap, $dn, $entry, $controls); + } else { + $safeResult = \ldap_mod_add($ldap, $dn, $entry); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Removes one or more attribute values from the specified dn. + * Object deletions are done by the + * ldap_delete function. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param string $dn The distinguished name of an LDAP entity. + * @param array $entry + * @param array $controls Array of LDAP Controls to send with the request. + * @throws LdapException + * + */ +function ldap_mod_del($ldap, string $dn, array $entry, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_mod_del($ldap, $dn, $entry, $controls); + } else { + $safeResult = \ldap_mod_del($ldap, $dn, $entry); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Replaces one or more attributes from the specified dn. + * It may also add or remove attributes. + * + * @param resource $ldap An LDAP\Connection instance, 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 $controls Array of LDAP Controls to send with the request. + * @throws LdapException + * + */ +function ldap_mod_replace($ldap, string $dn, array $entry, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_mod_replace($ldap, $dn, $entry, $controls); + } else { + $safeResult = \ldap_mod_replace($ldap, $dn, $entry); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Modifies an existing entry in the LDAP directory. Allows detailed + * specification of the modifications to perform. + * + * @param resource $ldap An LDAP resource, returned by ldap_connect. + * @param string $dn The distinguished name of an LDAP entity. + * @param array $modifications_info 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 $controls Each value specified through values is added (as + * an additional value) to the attribute named by + * attrib. + * @throws LdapException + * + */ +function ldap_modify_batch($ldap, string $dn, array $modifications_info, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_modify_batch($ldap, $dn, $modifications_info, $controls); + } else { + $safeResult = \ldap_modify_batch($ldap, $dn, $modifications_info); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Retrieves the attributes in an entry. The first call to + * ldap_next_attribute is made with the + * entry returned from + * ldap_first_attribute. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $entry An LDAP\ResultEntry instance. + * @return string Returns the next attribute in an entry on success and FALSE on + * error. + * @throws LdapException + * + */ +function ldap_next_attribute($ldap, $entry): string +{ + error_clear_last(); + $safeResult = \ldap_next_attribute($ldap, $entry); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * Parse LDAP extended operation data from result object result + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $result An LDAP\Result instance, returned by ldap_list or ldap_search. + * @param string|null $response_data Will be filled by the response data. + * @param string|null $response_oid Will be filled by the response OID. + * @throws LdapException + * + */ +function ldap_parse_exop($ldap, $result, ?string &$response_data = null, ?string &$response_oid = null): void +{ + error_clear_last(); + $safeResult = \ldap_parse_exop($ldap, $result, $response_data, $response_oid); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Parses an LDAP search result. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param resource $result An LDAP\Result instance, returned by ldap_list or ldap_search. + * @param int|null $error_code 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|null $matched_dn 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|null $error_message 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|null $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|null $controls An array of LDAP Controls which have been sent with the response. + * @throws LdapException + * + */ +function ldap_parse_result($ldap, $result, ?int &$error_code, ?string &$matched_dn = null, ?string &$error_message = null, ?array &$referrals = null, ?array &$controls = null): void +{ + error_clear_last(); + $safeResult = \ldap_parse_result($ldap, $result, $error_code, $matched_dn, $error_message, $referrals, $controls); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * The entry specified by dn is renamed/moved. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @param string $dn The distinguished name of an LDAP entity. + * @param string $new_rdn The new RDN. + * @param string $new_parent The new parent/superior entry. + * @param bool $delete_old_rdn 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 $controls Array of LDAP Controls to send with the request. + * @throws LdapException + * + */ +function ldap_rename($ldap, string $dn, string $new_rdn, string $new_parent, bool $delete_old_rdn, ?array $controls = null): void +{ + error_clear_last(); + if ($controls !== null) { + $safeResult = \ldap_rename($ldap, $dn, $new_rdn, $new_parent, $delete_old_rdn, $controls); + } else { + $safeResult = \ldap_rename($ldap, $dn, $new_rdn, $new_parent, $delete_old_rdn); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * + * + * @param resource $ldap + * @param string $dn + * @param string $password + * @param string $mech + * @param string $realm + * @param string $authc_id + * @param string $authz_id + * @param string $props + * @throws LdapException + * + */ +function ldap_sasl_bind($ldap, ?string $dn = null, ?string $password = null, ?string $mech = null, ?string $realm = null, ?string $authc_id = null, ?string $authz_id = null, ?string $props = null): void +{ + error_clear_last(); + if ($props !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm, $authc_id, $authz_id, $props); + } elseif ($authz_id !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm, $authc_id, $authz_id); + } elseif ($authc_id !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm, $authc_id); + } elseif ($realm !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm); + } elseif ($mech !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech); + } elseif ($password !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn, $password); + } elseif ($dn !== null) { + $safeResult = \ldap_sasl_bind($ldap, $dn); + } else { + $safeResult = \ldap_sasl_bind($ldap); + } + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Sets the value of the specified option to be value. + * + * @param resource|null $ldap Either an LDAP\Connection instance, returned by + * ldap_connect, to set the option for that connection, + * or NULL to set the option globally. + * @param int $option The parameter option can be one of: + * + * + * + * + * Option + * Type + * Available since + * + * + * + * + * LDAP_OPT_DEREF + * int + * + * + * + * LDAP_OPT_SIZELIMIT + * int + * + * + * + * LDAP_OPT_TIMELIMIT + * int + * + * + * + * LDAP_OPT_NETWORK_TIMEOUT + * int + * + * + * + * LDAP_OPT_PROTOCOL_VERSION + * int + * + * + * + * LDAP_OPT_ERROR_NUMBER + * int + * + * + * + * 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 + * int + * 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 + * int + * PHP 7.1.0 + * + * + * LDAP_OPT_X_TLS_RANDOM_FILE + * string + * PHP 7.1.0 + * + * + * LDAP_OPT_X_TLS_REQUIRE_CERT + * int + * 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 $value The new value for the specified option. + * @throws LdapException + * + */ +function ldap_set_option($ldap, int $option, $value): void +{ + error_clear_last(); + $safeResult = \ldap_set_option($ldap, $option, $value); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} + + +/** + * Unbinds from the LDAP directory. + * + * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. + * @throws LdapException + * + */ +function ldap_unbind($ldap): void +{ + error_clear_last(); + $safeResult = \ldap_unbind($ldap); + if ($safeResult === false) { + throw LdapException::createFromPhpError(); + } +} diff --git a/generated/8.5/libxml.php b/generated/8.5/libxml.php new file mode 100644 index 00000000..a2c9c99c --- /dev/null +++ b/generated/8.5/libxml.php @@ -0,0 +1,78 @@ + + * + * The above example will output: + * + * example: , this is a test + * example: , this is a test + * ]]> + * + * + * So, $out[0] contains an array of strings that matched the full pattern, + * and $out[1] contains an array of strings enclosed by tags. + * + * + * + * + * If the pattern contains named subpatterns, $matches + * additionally contains entries for keys with the subpattern name. + * + * + * 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 (in bytes) 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 an array of strings that matched the full pattern, + * and $out[1] contains an array of strings enclosed by tags. + * + * + * + * The above example will output: + * + * So, $out[0] contains an array of strings that matched the full pattern, + * and $out[1] contains an array of strings enclosed by tags. + * + * If the pattern contains named subpatterns, $matches + * additionally contains entries for keys with the subpattern name. + * + * 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 (in bytes) 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 an array of strings that matched the full pattern, + * and $out[1] contains an array of strings enclosed by tags. + * + * + * + * The above example will output: + * + * So, $out[0] contains an array of strings that matched the full pattern, + * and $out[1] contains an array of strings enclosed by tags. + * + * If the pattern contains named subpatterns, $matches + * additionally contains entries for keys with the subpattern name. + * + * 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|null Returns the number of full pattern matches (which might be zero). + * @throws PcreException + * + */ +function preg_match_all(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): ?int +{ + error_clear_last(); + $safeResult = \preg_match_all($pattern, $subject, $matches, $flags, $offset); + if ($safeResult === false) { + throw PcreException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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 string[]|null $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 (in bytes) 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 (in bytes) 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 (in bytes) 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 PcreException + * + */ +function preg_match(string $pattern, string $subject, ?iterable &$matches = null, int $flags = 0, int $offset = 0): int +{ + error_clear_last(); + $safeResult = \preg_match($pattern, $subject, $matches, $flags, $offset); + if ($safeResult === false) { + throw PcreException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * 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". + * @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 PcreException + * + */ +function preg_split(string $pattern, string $subject, ?int $limit = -1, int $flags = 0): array +{ + error_clear_last(); + $safeResult = \preg_split($pattern, $subject, $limit, $flags); + if ($safeResult === false) { + throw PcreException::createFromPhpError(); + } + return $safeResult; +} diff --git a/generated/8.5/pgsql.php b/generated/8.5/pgsql.php new file mode 100644 index 00000000..0e2bfea1 --- /dev/null +++ b/generated/8.5/pgsql.php @@ -0,0 +1,1398 @@ +ruleWithConfiguration( + RenameFunctionRector::class, + [ 'apache_getenv' => 'Safe\apache_getenv', + 'apache_get_version' => 'Safe\apache_get_version', + 'apache_lookup_uri' => 'Safe\apache_lookup_uri', + 'apache_setenv' => 'Safe\apache_setenv', + 'apcu_cache_info' => 'Safe\apcu_cache_info', + 'apcu_cas' => 'Safe\apcu_cas', + 'apcu_dec' => 'Safe\apcu_dec', + 'apcu_fetch' => 'Safe\apcu_fetch', + 'apcu_inc' => 'Safe\apcu_inc', + 'apcu_sma_info' => 'Safe\apcu_sma_info', + 'apc_fetch' => 'Safe\apc_fetch', + 'array_all' => 'Safe\array_all', + 'base64_decode' => 'Safe\base64_decode', + 'bindtextdomain' => 'Safe\bindtextdomain', + 'bzclose' => 'Safe\bzclose', + 'bzflush' => 'Safe\bzflush', + 'bzread' => 'Safe\bzread', + 'bzwrite' => 'Safe\bzwrite', + 'chdir' => 'Safe\chdir', + 'chgrp' => 'Safe\chgrp', + 'chmod' => 'Safe\chmod', + 'chown' => 'Safe\chown', + 'chroot' => 'Safe\chroot', + 'class_alias' => 'Safe\class_alias', + 'class_implements' => 'Safe\class_implements', + 'class_parents' => 'Safe\class_parents', + 'class_uses' => 'Safe\class_uses', + 'cli_set_process_title' => 'Safe\cli_set_process_title', + 'com_create_guid' => 'Safe\com_create_guid', + 'com_event_sink' => 'Safe\com_event_sink', + 'com_load_typelib' => 'Safe\com_load_typelib', + 'com_print_typeinfo' => 'Safe\com_print_typeinfo', + 'convert_uudecode' => 'Safe\convert_uudecode', + 'copy' => 'Safe\copy', + 'create_function' => 'Safe\create_function', + 'cubrid_bind' => 'Safe\cubrid_bind', + 'cubrid_column_names' => 'Safe\cubrid_column_names', + 'cubrid_column_types' => 'Safe\cubrid_column_types', + 'cubrid_col_size' => 'Safe\cubrid_col_size', + 'cubrid_commit' => 'Safe\cubrid_commit', + 'cubrid_connect' => 'Safe\cubrid_connect', + 'cubrid_connect_with_url' => 'Safe\cubrid_connect_with_url', + 'cubrid_current_oid' => 'Safe\cubrid_current_oid', + 'cubrid_disconnect' => 'Safe\cubrid_disconnect', + 'cubrid_drop' => 'Safe\cubrid_drop', + 'cubrid_free_result' => 'Safe\cubrid_free_result', + 'cubrid_get_charset' => 'Safe\cubrid_get_charset', + 'cubrid_get_class_name' => 'Safe\cubrid_get_class_name', + 'cubrid_get_client_info' => 'Safe\cubrid_get_client_info', + 'cubrid_get_db_parameter' => 'Safe\cubrid_get_db_parameter', + 'cubrid_get_query_timeout' => 'Safe\cubrid_get_query_timeout', + 'cubrid_get_server_info' => 'Safe\cubrid_get_server_info', + 'cubrid_insert_id' => 'Safe\cubrid_insert_id', + 'cubrid_lob2_bind' => 'Safe\cubrid_lob2_bind', + 'cubrid_lob2_close' => 'Safe\cubrid_lob2_close', + 'cubrid_lob2_export' => 'Safe\cubrid_lob2_export', + 'cubrid_lob2_import' => 'Safe\cubrid_lob2_import', + 'cubrid_lob2_new' => 'Safe\cubrid_lob2_new', + 'cubrid_lob2_read' => 'Safe\cubrid_lob2_read', + 'cubrid_lob2_seek' => 'Safe\cubrid_lob2_seek', + 'cubrid_lob2_seek64' => 'Safe\cubrid_lob2_seek64', + 'cubrid_lob2_size' => 'Safe\cubrid_lob2_size', + 'cubrid_lob2_size64' => 'Safe\cubrid_lob2_size64', + 'cubrid_lob2_tell' => 'Safe\cubrid_lob2_tell', + 'cubrid_lob2_tell64' => 'Safe\cubrid_lob2_tell64', + 'cubrid_lob2_write' => 'Safe\cubrid_lob2_write', + 'cubrid_lob_close' => 'Safe\cubrid_lob_close', + 'cubrid_lob_export' => 'Safe\cubrid_lob_export', + 'cubrid_lob_get' => 'Safe\cubrid_lob_get', + 'cubrid_lob_send' => 'Safe\cubrid_lob_send', + 'cubrid_lob_size' => 'Safe\cubrid_lob_size', + 'cubrid_lock_read' => 'Safe\cubrid_lock_read', + 'cubrid_lock_write' => 'Safe\cubrid_lock_write', + 'cubrid_move_cursor' => 'Safe\cubrid_move_cursor', + 'cubrid_next_result' => 'Safe\cubrid_next_result', + 'cubrid_pconnect' => 'Safe\cubrid_pconnect', + 'cubrid_pconnect_with_url' => 'Safe\cubrid_pconnect_with_url', + 'cubrid_prepare' => 'Safe\cubrid_prepare', + 'cubrid_put' => 'Safe\cubrid_put', + 'cubrid_rollback' => 'Safe\cubrid_rollback', + 'cubrid_schema' => 'Safe\cubrid_schema', + 'cubrid_seq_drop' => 'Safe\cubrid_seq_drop', + 'cubrid_seq_insert' => 'Safe\cubrid_seq_insert', + 'cubrid_seq_put' => 'Safe\cubrid_seq_put', + 'cubrid_set_add' => 'Safe\cubrid_set_add', + 'cubrid_set_autocommit' => 'Safe\cubrid_set_autocommit', + 'cubrid_set_db_parameter' => 'Safe\cubrid_set_db_parameter', + 'cubrid_set_drop' => 'Safe\cubrid_set_drop', + 'cubrid_set_query_timeout' => 'Safe\cubrid_set_query_timeout', + 'curl_copy_handle' => 'Safe\curl_copy_handle', + 'curl_escape' => 'Safe\curl_escape', + 'curl_exec' => 'Safe\curl_exec', + 'curl_getinfo' => 'Safe\curl_getinfo', + 'curl_init' => 'Safe\curl_init', + 'curl_multi_info_read' => 'Safe\curl_multi_info_read', + 'curl_multi_setopt' => 'Safe\curl_multi_setopt', + 'curl_setopt' => 'Safe\curl_setopt', + 'curl_share_setopt' => 'Safe\curl_share_setopt', + 'curl_unescape' => 'Safe\curl_unescape', + 'curl_upkeep' => 'Safe\curl_upkeep', + 'date_create' => 'Safe\date_create', + 'date_create_immutable' => 'Safe\date_create_immutable', + 'date_parse_from_format' => 'Safe\date_parse_from_format', + 'date_sunrise' => 'Safe\date_sunrise', + 'date_sunset' => 'Safe\date_sunset', + 'db2_autocommit' => 'Safe\db2_autocommit', + 'db2_bind_param' => 'Safe\db2_bind_param', + 'db2_client_info' => 'Safe\db2_client_info', + 'db2_close' => 'Safe\db2_close', + 'db2_commit' => 'Safe\db2_commit', + 'db2_execute' => 'Safe\db2_execute', + 'db2_free_result' => 'Safe\db2_free_result', + 'db2_free_stmt' => 'Safe\db2_free_stmt', + 'db2_get_option' => 'Safe\db2_get_option', + 'db2_num_rows' => 'Safe\db2_num_rows', + 'db2_pclose' => 'Safe\db2_pclose', + 'db2_rollback' => 'Safe\db2_rollback', + 'db2_server_info' => 'Safe\db2_server_info', + 'db2_set_option' => 'Safe\db2_set_option', + 'define' => 'Safe\define', + 'deflate_add' => 'Safe\deflate_add', + 'deflate_init' => 'Safe\deflate_init', + 'disk_free_space' => 'Safe\disk_free_space', + 'disk_total_space' => 'Safe\disk_total_space', + 'dl' => 'Safe\dl', + 'dns_get_record' => 'Safe\dns_get_record', + 'eio_busy' => 'Safe\eio_busy', + 'eio_chmod' => 'Safe\eio_chmod', + 'eio_chown' => 'Safe\eio_chown', + 'eio_close' => 'Safe\eio_close', + 'eio_custom' => 'Safe\eio_custom', + 'eio_dup2' => 'Safe\eio_dup2', + 'eio_event_loop' => 'Safe\eio_event_loop', + 'eio_fallocate' => 'Safe\eio_fallocate', + 'eio_fchmod' => 'Safe\eio_fchmod', + 'eio_fchown' => 'Safe\eio_fchown', + 'eio_fdatasync' => 'Safe\eio_fdatasync', + 'eio_fstat' => 'Safe\eio_fstat', + 'eio_fstatvfs' => 'Safe\eio_fstatvfs', + 'eio_fsync' => 'Safe\eio_fsync', + 'eio_ftruncate' => 'Safe\eio_ftruncate', + 'eio_futime' => 'Safe\eio_futime', + 'eio_grp' => 'Safe\eio_grp', + 'eio_lstat' => 'Safe\eio_lstat', + 'eio_mkdir' => 'Safe\eio_mkdir', + 'eio_mknod' => 'Safe\eio_mknod', + 'eio_nop' => 'Safe\eio_nop', + 'eio_readahead' => 'Safe\eio_readahead', + 'eio_readdir' => 'Safe\eio_readdir', + 'eio_readlink' => 'Safe\eio_readlink', + 'eio_rename' => 'Safe\eio_rename', + 'eio_rmdir' => 'Safe\eio_rmdir', + 'eio_seek' => 'Safe\eio_seek', + 'eio_sendfile' => 'Safe\eio_sendfile', + 'eio_stat' => 'Safe\eio_stat', + 'eio_statvfs' => 'Safe\eio_statvfs', + 'eio_symlink' => 'Safe\eio_symlink', + 'eio_sync' => 'Safe\eio_sync', + 'eio_syncfs' => 'Safe\eio_syncfs', + 'eio_sync_file_range' => 'Safe\eio_sync_file_range', + 'eio_truncate' => 'Safe\eio_truncate', + 'eio_unlink' => 'Safe\eio_unlink', + 'eio_utime' => 'Safe\eio_utime', + 'eio_write' => 'Safe\eio_write', + 'error_log' => 'Safe\error_log', + 'exec' => 'Safe\exec', + 'fastcgi_finish_request' => 'Safe\fastcgi_finish_request', + 'fbird_blob_cancel' => 'Safe\fbird_blob_cancel', + 'fclose' => 'Safe\fclose', + 'fdatasync' => 'Safe\fdatasync', + 'fflush' => 'Safe\fflush', + 'fgetcsv' => 'Safe\fgetcsv', + 'file' => 'Safe\file', + 'fileatime' => 'Safe\fileatime', + 'filectime' => 'Safe\filectime', + 'fileinode' => 'Safe\fileinode', + 'filemtime' => 'Safe\filemtime', + 'fileowner' => 'Safe\fileowner', + 'fileperms' => 'Safe\fileperms', + 'filesize' => 'Safe\filesize', + 'file_get_contents' => 'Safe\file_get_contents', + 'file_put_contents' => 'Safe\file_put_contents', + 'filter_input_array' => 'Safe\filter_input_array', + 'filter_var_array' => 'Safe\filter_var_array', + 'finfo_close' => 'Safe\finfo_close', + 'finfo_open' => 'Safe\finfo_open', + 'flock' => 'Safe\flock', + 'fopen' => 'Safe\fopen', + 'fpm_get_status' => 'Safe\fpm_get_status', + 'fputcsv' => 'Safe\fputcsv', + 'fread' => 'Safe\fread', + 'fsockopen' => 'Safe\fsockopen', + 'fstat' => 'Safe\fstat', + 'fsync' => 'Safe\fsync', + 'ftp_alloc' => 'Safe\ftp_alloc', + 'ftp_append' => 'Safe\ftp_append', + 'ftp_cdup' => 'Safe\ftp_cdup', + 'ftp_chdir' => 'Safe\ftp_chdir', + 'ftp_chmod' => 'Safe\ftp_chmod', + 'ftp_close' => 'Safe\ftp_close', + 'ftp_connect' => 'Safe\ftp_connect', + 'ftp_delete' => 'Safe\ftp_delete', + 'ftp_fget' => 'Safe\ftp_fget', + 'ftp_fput' => 'Safe\ftp_fput', + 'ftp_get' => 'Safe\ftp_get', + 'ftp_login' => 'Safe\ftp_login', + 'ftp_mkdir' => 'Safe\ftp_mkdir', + 'ftp_mlsd' => 'Safe\ftp_mlsd', + 'ftp_nb_get' => 'Safe\ftp_nb_get', + 'ftp_nb_put' => 'Safe\ftp_nb_put', + 'ftp_nlist' => 'Safe\ftp_nlist', + 'ftp_pasv' => 'Safe\ftp_pasv', + 'ftp_put' => 'Safe\ftp_put', + 'ftp_pwd' => 'Safe\ftp_pwd', + 'ftp_raw' => 'Safe\ftp_raw', + 'ftp_rename' => 'Safe\ftp_rename', + 'ftp_rmdir' => 'Safe\ftp_rmdir', + 'ftp_site' => 'Safe\ftp_site', + 'ftp_ssl_connect' => 'Safe\ftp_ssl_connect', + 'ftp_systype' => 'Safe\ftp_systype', + 'ftruncate' => 'Safe\ftruncate', + 'fwrite' => 'Safe\fwrite', + 'getcwd' => 'Safe\getcwd', + 'gethostname' => 'Safe\gethostname', + 'getimagesize' => 'Safe\getimagesize', + 'getlastmod' => 'Safe\getlastmod', + 'getmygid' => 'Safe\getmygid', + 'getmyinode' => 'Safe\getmyinode', + 'getmypid' => 'Safe\getmypid', + 'getmyuid' => 'Safe\getmyuid', + 'getopt' => 'Safe\getopt', + 'getprotobyname' => 'Safe\getprotobyname', + 'getprotobynumber' => 'Safe\getprotobynumber', + 'getrusage' => 'Safe\getrusage', + 'getservbyport' => 'Safe\getservbyport', + 'get_headers' => 'Safe\get_headers', + 'get_include_path' => 'Safe\get_include_path', + 'get_meta_tags' => 'Safe\get_meta_tags', + 'glob' => 'Safe\glob', + 'gmstrftime' => 'Safe\gmstrftime', + 'gnupg_adddecryptkey' => 'Safe\gnupg_adddecryptkey', + 'gnupg_addencryptkey' => 'Safe\gnupg_addencryptkey', + 'gnupg_addsignkey' => 'Safe\gnupg_addsignkey', + 'gnupg_cleardecryptkeys' => 'Safe\gnupg_cleardecryptkeys', + 'gnupg_clearencryptkeys' => 'Safe\gnupg_clearencryptkeys', + 'gnupg_clearsignkeys' => 'Safe\gnupg_clearsignkeys', + 'gnupg_deletekey' => 'Safe\gnupg_deletekey', + 'gnupg_setarmor' => 'Safe\gnupg_setarmor', + 'gnupg_setsignmode' => 'Safe\gnupg_setsignmode', + 'gzclose' => 'Safe\gzclose', + 'gzcompress' => 'Safe\gzcompress', + 'gzdecode' => 'Safe\gzdecode', + 'gzdeflate' => 'Safe\gzdeflate', + 'gzencode' => 'Safe\gzencode', + 'gzfile' => 'Safe\gzfile', + 'gzgets' => 'Safe\gzgets', + 'gzgetss' => 'Safe\gzgetss', + 'gzinflate' => 'Safe\gzinflate', + 'gzopen' => 'Safe\gzopen', + 'gzread' => 'Safe\gzread', + 'gzrewind' => 'Safe\gzrewind', + 'gzuncompress' => 'Safe\gzuncompress', + 'gzwrite' => 'Safe\gzwrite', + 'hash_update_file' => 'Safe\hash_update_file', + 'header_register_callback' => 'Safe\header_register_callback', + 'hex2bin' => 'Safe\hex2bin', + 'highlight_file' => 'Safe\highlight_file', + 'hrtime' => 'Safe\hrtime', + 'ibase_add_user' => 'Safe\ibase_add_user', + 'ibase_backup' => 'Safe\ibase_backup', + 'ibase_blob_cancel' => 'Safe\ibase_blob_cancel', + 'ibase_blob_create' => 'Safe\ibase_blob_create', + 'ibase_blob_get' => 'Safe\ibase_blob_get', + 'ibase_close' => 'Safe\ibase_close', + 'ibase_commit' => 'Safe\ibase_commit', + 'ibase_commit_ret' => 'Safe\ibase_commit_ret', + 'ibase_connect' => 'Safe\ibase_connect', + 'ibase_delete_user' => 'Safe\ibase_delete_user', + 'ibase_drop_db' => 'Safe\ibase_drop_db', + 'ibase_free_event_handler' => 'Safe\ibase_free_event_handler', + 'ibase_free_query' => 'Safe\ibase_free_query', + 'ibase_free_result' => 'Safe\ibase_free_result', + 'ibase_maintain_db' => 'Safe\ibase_maintain_db', + 'ibase_modify_user' => 'Safe\ibase_modify_user', + 'ibase_name_result' => 'Safe\ibase_name_result', + 'ibase_pconnect' => 'Safe\ibase_pconnect', + 'ibase_restore' => 'Safe\ibase_restore', + 'ibase_rollback' => 'Safe\ibase_rollback', + 'ibase_rollback_ret' => 'Safe\ibase_rollback_ret', + 'ibase_service_attach' => 'Safe\ibase_service_attach', + 'ibase_service_detach' => 'Safe\ibase_service_detach', + 'iconv' => 'Safe\iconv', + 'iconv_get_encoding' => 'Safe\iconv_get_encoding', + 'iconv_set_encoding' => 'Safe\iconv_set_encoding', + 'idate' => 'Safe\idate', + 'image2wbmp' => 'Safe\image2wbmp', + 'imageaffine' => 'Safe\imageaffine', + 'imageaffinematrixconcat' => 'Safe\imageaffinematrixconcat', + 'imageaffinematrixget' => 'Safe\imageaffinematrixget', + 'imagealphablending' => 'Safe\imagealphablending', + 'imageantialias' => 'Safe\imageantialias', + 'imagearc' => 'Safe\imagearc', + 'imageavif' => 'Safe\imageavif', + 'imagebmp' => 'Safe\imagebmp', + 'imagechar' => 'Safe\imagechar', + 'imagecharup' => 'Safe\imagecharup', + 'imagecolorat' => 'Safe\imagecolorat', + 'imagecolordeallocate' => 'Safe\imagecolordeallocate', + 'imagecolormatch' => 'Safe\imagecolormatch', + 'imagecolorset' => 'Safe\imagecolorset', + 'imageconvolution' => 'Safe\imageconvolution', + 'imagecopy' => 'Safe\imagecopy', + 'imagecopymerge' => 'Safe\imagecopymerge', + 'imagecopymergegray' => 'Safe\imagecopymergegray', + 'imagecopyresampled' => 'Safe\imagecopyresampled', + 'imagecopyresized' => 'Safe\imagecopyresized', + 'imagecreate' => 'Safe\imagecreate', + 'imagecreatefromavif' => 'Safe\imagecreatefromavif', + 'imagecreatefrombmp' => 'Safe\imagecreatefrombmp', + 'imagecreatefromgd' => 'Safe\imagecreatefromgd', + 'imagecreatefromgd2' => 'Safe\imagecreatefromgd2', + 'imagecreatefromgd2part' => 'Safe\imagecreatefromgd2part', + 'imagecreatefromgif' => 'Safe\imagecreatefromgif', + 'imagecreatefromjpeg' => 'Safe\imagecreatefromjpeg', + 'imagecreatefrompng' => 'Safe\imagecreatefrompng', + 'imagecreatefromstring' => 'Safe\imagecreatefromstring', + 'imagecreatefromtga' => 'Safe\imagecreatefromtga', + 'imagecreatefromwbmp' => 'Safe\imagecreatefromwbmp', + 'imagecreatefromwebp' => 'Safe\imagecreatefromwebp', + 'imagecreatefromxbm' => 'Safe\imagecreatefromxbm', + 'imagecreatefromxpm' => 'Safe\imagecreatefromxpm', + 'imagecreatetruecolor' => 'Safe\imagecreatetruecolor', + 'imagecrop' => 'Safe\imagecrop', + 'imagecropauto' => 'Safe\imagecropauto', + 'imagedashedline' => 'Safe\imagedashedline', + 'imagedestroy' => 'Safe\imagedestroy', + 'imageellipse' => 'Safe\imageellipse', + 'imagefill' => 'Safe\imagefill', + 'imagefilledarc' => 'Safe\imagefilledarc', + 'imagefilledellipse' => 'Safe\imagefilledellipse', + 'imagefilledrectangle' => 'Safe\imagefilledrectangle', + 'imagefilltoborder' => 'Safe\imagefilltoborder', + 'imagefilter' => 'Safe\imagefilter', + 'imageflip' => 'Safe\imageflip', + 'imageftbbox' => 'Safe\imageftbbox', + 'imagefttext' => 'Safe\imagefttext', + 'imagegammacorrect' => 'Safe\imagegammacorrect', + 'imagegd' => 'Safe\imagegd', + 'imagegd2' => 'Safe\imagegd2', + 'imagegif' => 'Safe\imagegif', + 'imagegrabscreen' => 'Safe\imagegrabscreen', + 'imagegrabwindow' => 'Safe\imagegrabwindow', + 'imagejpeg' => 'Safe\imagejpeg', + 'imagelayereffect' => 'Safe\imagelayereffect', + 'imageline' => 'Safe\imageline', + 'imageloadfont' => 'Safe\imageloadfont', + 'imagepng' => 'Safe\imagepng', + 'imagerectangle' => 'Safe\imagerectangle', + 'imageresolution' => 'Safe\imageresolution', + 'imagerotate' => 'Safe\imagerotate', + 'imagesavealpha' => 'Safe\imagesavealpha', + 'imagescale' => 'Safe\imagescale', + 'imagesetbrush' => 'Safe\imagesetbrush', + 'imagesetclip' => 'Safe\imagesetclip', + 'imagesetinterpolation' => 'Safe\imagesetinterpolation', + 'imagesetpixel' => 'Safe\imagesetpixel', + 'imagesetstyle' => 'Safe\imagesetstyle', + 'imagesetthickness' => 'Safe\imagesetthickness', + 'imagesettile' => 'Safe\imagesettile', + 'imagestring' => 'Safe\imagestring', + 'imagestringup' => 'Safe\imagestringup', + 'imagetruecolortopalette' => 'Safe\imagetruecolortopalette', + 'imagettfbbox' => 'Safe\imagettfbbox', + 'imagettftext' => 'Safe\imagettftext', + 'imagewbmp' => 'Safe\imagewbmp', + 'imagewebp' => 'Safe\imagewebp', + 'imagexbm' => 'Safe\imagexbm', + 'image_type_to_extension' => 'Safe\image_type_to_extension', + 'imap_8bit' => 'Safe\imap_8bit', + 'imap_append' => 'Safe\imap_append', + 'imap_base64' => 'Safe\imap_base64', + 'imap_binary' => 'Safe\imap_binary', + 'imap_body' => 'Safe\imap_body', + 'imap_bodystruct' => 'Safe\imap_bodystruct', + 'imap_check' => 'Safe\imap_check', + 'imap_createmailbox' => 'Safe\imap_createmailbox', + 'imap_deletemailbox' => 'Safe\imap_deletemailbox', + 'imap_fetchbody' => 'Safe\imap_fetchbody', + 'imap_fetchheader' => 'Safe\imap_fetchheader', + 'imap_fetchmime' => 'Safe\imap_fetchmime', + 'imap_fetchstructure' => 'Safe\imap_fetchstructure', + 'imap_fetch_overview' => 'Safe\imap_fetch_overview', + 'imap_getacl' => 'Safe\imap_getacl', + 'imap_getmailboxes' => 'Safe\imap_getmailboxes', + 'imap_getsubscribed' => 'Safe\imap_getsubscribed', + 'imap_headerinfo' => 'Safe\imap_headerinfo', + 'imap_headers' => 'Safe\imap_headers', + 'imap_listscan' => 'Safe\imap_listscan', + 'imap_lsub' => 'Safe\imap_lsub', + 'imap_mail' => 'Safe\imap_mail', + 'imap_mail_compose' => 'Safe\imap_mail_compose', + 'imap_mail_copy' => 'Safe\imap_mail_copy', + 'imap_mail_move' => 'Safe\imap_mail_move', + 'imap_mime_header_decode' => 'Safe\imap_mime_header_decode', + 'imap_mutf7_to_utf8' => 'Safe\imap_mutf7_to_utf8', + 'imap_num_msg' => 'Safe\imap_num_msg', + 'imap_open' => 'Safe\imap_open', + 'imap_qprint' => 'Safe\imap_qprint', + 'imap_renamemailbox' => 'Safe\imap_renamemailbox', + 'imap_rfc822_write_address' => 'Safe\imap_rfc822_write_address', + 'imap_savebody' => 'Safe\imap_savebody', + 'imap_setacl' => 'Safe\imap_setacl', + 'imap_set_quota' => 'Safe\imap_set_quota', + 'imap_sort' => 'Safe\imap_sort', + 'imap_status' => 'Safe\imap_status', + 'imap_subscribe' => 'Safe\imap_subscribe', + 'imap_thread' => 'Safe\imap_thread', + 'imap_timeout' => 'Safe\imap_timeout', + 'imap_unsubscribe' => 'Safe\imap_unsubscribe', + 'imap_utf8_to_mutf7' => 'Safe\imap_utf8_to_mutf7', + 'inet_ntop' => 'Safe\inet_ntop', + 'inet_pton' => 'Safe\inet_pton', + 'inflate_add' => 'Safe\inflate_add', + 'inflate_get_read_len' => 'Safe\inflate_get_read_len', + 'inflate_init' => 'Safe\inflate_init', + 'ini_get' => 'Safe\ini_get', + 'ini_set' => 'Safe\ini_set', + 'inotify_add_watch' => 'Safe\inotify_add_watch', + 'inotify_init' => 'Safe\inotify_init', + 'inotify_rm_watch' => 'Safe\inotify_rm_watch', + 'iptcembed' => 'Safe\iptcembed', + 'iptcparse' => 'Safe\iptcparse', + 'jpeg2wbmp' => 'Safe\jpeg2wbmp', + 'json_decode' => 'Safe\json_decode', + 'json_encode' => 'Safe\json_encode', + 'lchgrp' => 'Safe\lchgrp', + 'lchown' => 'Safe\lchown', + 'ldap_8859_to_t61' => 'Safe\ldap_8859_to_t61', + 'ldap_add' => 'Safe\ldap_add', + 'ldap_bind' => 'Safe\ldap_bind', + 'ldap_control_paged_result' => 'Safe\ldap_control_paged_result', + 'ldap_control_paged_result_response' => 'Safe\ldap_control_paged_result_response', + 'ldap_count_entries' => 'Safe\ldap_count_entries', + 'ldap_delete' => 'Safe\ldap_delete', + 'ldap_dn2ufn' => 'Safe\ldap_dn2ufn', + 'ldap_exop' => 'Safe\ldap_exop', + 'ldap_exop_passwd' => 'Safe\ldap_exop_passwd', + 'ldap_exop_whoami' => 'Safe\ldap_exop_whoami', + 'ldap_explode_dn' => 'Safe\ldap_explode_dn', + 'ldap_first_attribute' => 'Safe\ldap_first_attribute', + 'ldap_first_entry' => 'Safe\ldap_first_entry', + 'ldap_free_result' => 'Safe\ldap_free_result', + 'ldap_get_dn' => 'Safe\ldap_get_dn', + 'ldap_get_entries' => 'Safe\ldap_get_entries', + 'ldap_get_option' => 'Safe\ldap_get_option', + 'ldap_get_values' => 'Safe\ldap_get_values', + 'ldap_get_values_len' => 'Safe\ldap_get_values_len', + 'ldap_modify_batch' => 'Safe\ldap_modify_batch', + 'ldap_mod_add' => 'Safe\ldap_mod_add', + 'ldap_mod_del' => 'Safe\ldap_mod_del', + 'ldap_mod_replace' => 'Safe\ldap_mod_replace', + 'ldap_next_attribute' => 'Safe\ldap_next_attribute', + 'ldap_parse_exop' => 'Safe\ldap_parse_exop', + 'ldap_parse_result' => 'Safe\ldap_parse_result', + 'ldap_rename' => 'Safe\ldap_rename', + 'ldap_sasl_bind' => 'Safe\ldap_sasl_bind', + 'ldap_set_option' => 'Safe\ldap_set_option', + 'ldap_unbind' => 'Safe\ldap_unbind', + 'libxml_get_last_error' => 'Safe\libxml_get_last_error', + 'libxml_set_external_entity_loader' => 'Safe\libxml_set_external_entity_loader', + 'link' => 'Safe\link', + 'lstat' => 'Safe\lstat', + 'lzf_compress' => 'Safe\lzf_compress', + 'lzf_decompress' => 'Safe\lzf_decompress', + 'mailparse_msg_extract_part_file' => 'Safe\mailparse_msg_extract_part_file', + 'mailparse_msg_free' => 'Safe\mailparse_msg_free', + 'mailparse_msg_parse' => 'Safe\mailparse_msg_parse', + 'mailparse_msg_parse_file' => 'Safe\mailparse_msg_parse_file', + 'mailparse_stream_encode' => 'Safe\mailparse_stream_encode', + 'mb_chr' => 'Safe\mb_chr', + 'mb_convert_encoding' => 'Safe\mb_convert_encoding', + 'mb_detect_order' => 'Safe\mb_detect_order', + 'mb_eregi_replace' => 'Safe\mb_eregi_replace', + 'mb_ereg_replace' => 'Safe\mb_ereg_replace', + 'mb_ereg_replace_callback' => 'Safe\mb_ereg_replace_callback', + 'mb_ereg_search_getregs' => 'Safe\mb_ereg_search_getregs', + 'mb_ereg_search_init' => 'Safe\mb_ereg_search_init', + 'mb_ereg_search_regs' => 'Safe\mb_ereg_search_regs', + 'mb_ereg_search_setpos' => 'Safe\mb_ereg_search_setpos', + 'mb_get_info' => 'Safe\mb_get_info', + 'mb_http_output' => 'Safe\mb_http_output', + 'mb_internal_encoding' => 'Safe\mb_internal_encoding', + 'mb_ord' => 'Safe\mb_ord', + 'mb_parse_str' => 'Safe\mb_parse_str', + 'mb_regex_encoding' => 'Safe\mb_regex_encoding', + 'mb_send_mail' => 'Safe\mb_send_mail', + 'mb_split' => 'Safe\mb_split', + 'md5_file' => 'Safe\md5_file', + 'mime_content_type' => 'Safe\mime_content_type', + 'mkdir' => 'Safe\mkdir', + 'msg_get_queue' => 'Safe\msg_get_queue', + 'msg_queue_exists' => 'Safe\msg_queue_exists', + 'msg_receive' => 'Safe\msg_receive', + 'msg_remove_queue' => 'Safe\msg_remove_queue', + 'msg_send' => 'Safe\msg_send', + 'msg_set_queue' => 'Safe\msg_set_queue', + 'msg_stat_queue' => 'Safe\msg_stat_queue', + 'mysql_close' => 'Safe\mysql_close', + 'mysql_connect' => 'Safe\mysql_connect', + 'mysql_create_db' => 'Safe\mysql_create_db', + 'mysql_data_seek' => 'Safe\mysql_data_seek', + 'mysql_db_name' => 'Safe\mysql_db_name', + 'mysql_db_query' => 'Safe\mysql_db_query', + 'mysql_drop_db' => 'Safe\mysql_drop_db', + 'mysql_fetch_lengths' => 'Safe\mysql_fetch_lengths', + 'mysql_field_flags' => 'Safe\mysql_field_flags', + 'mysql_field_len' => 'Safe\mysql_field_len', + 'mysql_field_name' => 'Safe\mysql_field_name', + 'mysql_field_seek' => 'Safe\mysql_field_seek', + 'mysql_free_result' => 'Safe\mysql_free_result', + 'mysql_get_host_info' => 'Safe\mysql_get_host_info', + 'mysql_get_proto_info' => 'Safe\mysql_get_proto_info', + 'mysql_get_server_info' => 'Safe\mysql_get_server_info', + 'mysql_info' => 'Safe\mysql_info', + 'mysql_list_dbs' => 'Safe\mysql_list_dbs', + 'mysql_list_fields' => 'Safe\mysql_list_fields', + 'mysql_list_processes' => 'Safe\mysql_list_processes', + 'mysql_list_tables' => 'Safe\mysql_list_tables', + 'mysql_num_fields' => 'Safe\mysql_num_fields', + 'mysql_num_rows' => 'Safe\mysql_num_rows', + 'mysql_query' => 'Safe\mysql_query', + 'mysql_real_escape_string' => 'Safe\mysql_real_escape_string', + 'mysql_result' => 'Safe\mysql_result', + 'mysql_select_db' => 'Safe\mysql_select_db', + 'mysql_set_charset' => 'Safe\mysql_set_charset', + 'mysql_tablename' => 'Safe\mysql_tablename', + 'mysql_thread_id' => 'Safe\mysql_thread_id', + 'mysql_unbuffered_query' => 'Safe\mysql_unbuffered_query', + 'net_get_interfaces' => 'Safe\net_get_interfaces', + 'ob_clean' => 'Safe\ob_clean', + 'ob_end_clean' => 'Safe\ob_end_clean', + 'ob_end_flush' => 'Safe\ob_end_flush', + 'ob_flush' => 'Safe\ob_flush', + 'ob_get_clean' => 'Safe\ob_get_clean', + 'ob_get_flush' => 'Safe\ob_get_flush', + 'ob_start' => 'Safe\ob_start', + 'oci_bind_array_by_name' => 'Safe\oci_bind_array_by_name', + 'oci_bind_by_name' => 'Safe\oci_bind_by_name', + 'oci_cancel' => 'Safe\oci_cancel', + 'oci_commit' => 'Safe\oci_commit', + 'oci_connect' => 'Safe\oci_connect', + 'oci_define_by_name' => 'Safe\oci_define_by_name', + 'oci_execute' => 'Safe\oci_execute', + 'oci_field_name' => 'Safe\oci_field_name', + 'oci_field_precision' => 'Safe\oci_field_precision', + 'oci_field_scale' => 'Safe\oci_field_scale', + 'oci_field_size' => 'Safe\oci_field_size', + 'oci_field_type' => 'Safe\oci_field_type', + 'oci_field_type_raw' => 'Safe\oci_field_type_raw', + 'oci_free_descriptor' => 'Safe\oci_free_descriptor', + 'oci_free_statement' => 'Safe\oci_free_statement', + 'oci_new_collection' => 'Safe\oci_new_collection', + 'oci_new_connect' => 'Safe\oci_new_connect', + 'oci_new_cursor' => 'Safe\oci_new_cursor', + 'oci_new_descriptor' => 'Safe\oci_new_descriptor', + 'oci_num_rows' => 'Safe\oci_num_rows', + 'oci_parse' => 'Safe\oci_parse', + 'oci_pconnect' => 'Safe\oci_pconnect', + 'oci_register_taf_callback' => 'Safe\oci_register_taf_callback', + 'oci_result' => 'Safe\oci_result', + 'oci_rollback' => 'Safe\oci_rollback', + 'oci_server_version' => 'Safe\oci_server_version', + 'oci_set_action' => 'Safe\oci_set_action', + 'oci_set_call_timeout' => 'Safe\oci_set_call_timeout', + 'oci_set_client_identifier' => 'Safe\oci_set_client_identifier', + 'oci_set_client_info' => 'Safe\oci_set_client_info', + 'oci_set_db_operation' => 'Safe\oci_set_db_operation', + 'oci_set_edition' => 'Safe\oci_set_edition', + 'oci_set_module_name' => 'Safe\oci_set_module_name', + 'oci_set_prefetch' => 'Safe\oci_set_prefetch', + 'oci_set_prefetch_lob' => 'Safe\oci_set_prefetch_lob', + 'oci_statement_type' => 'Safe\oci_statement_type', + 'oci_unregister_taf_callback' => 'Safe\oci_unregister_taf_callback', + 'odbc_autocommit' => 'Safe\odbc_autocommit', + 'odbc_commit' => 'Safe\odbc_commit', + 'odbc_connect' => 'Safe\odbc_connect', + 'odbc_cursor' => 'Safe\odbc_cursor', + 'odbc_data_source' => 'Safe\odbc_data_source', + 'odbc_exec' => 'Safe\odbc_exec', + 'odbc_execute' => 'Safe\odbc_execute', + 'odbc_fetch_into' => 'Safe\odbc_fetch_into', + 'odbc_field_len' => 'Safe\odbc_field_len', + 'odbc_field_name' => 'Safe\odbc_field_name', + 'odbc_field_num' => 'Safe\odbc_field_num', + 'odbc_field_scale' => 'Safe\odbc_field_scale', + 'odbc_field_type' => 'Safe\odbc_field_type', + 'odbc_pconnect' => 'Safe\odbc_pconnect', + 'odbc_prepare' => 'Safe\odbc_prepare', + 'odbc_procedures' => 'Safe\odbc_procedures', + 'odbc_result' => 'Safe\odbc_result', + 'odbc_result_all' => 'Safe\odbc_result_all', + 'odbc_rollback' => 'Safe\odbc_rollback', + 'odbc_setoption' => 'Safe\odbc_setoption', + 'odbc_tables' => 'Safe\odbc_tables', + 'opcache_compile_file' => 'Safe\opcache_compile_file', + 'opcache_get_status' => 'Safe\opcache_get_status', + 'opendir' => 'Safe\opendir', + 'openssl_cipher_iv_length' => 'Safe\openssl_cipher_iv_length', + 'openssl_cipher_key_length' => 'Safe\openssl_cipher_key_length', + 'openssl_cms_decrypt' => 'Safe\openssl_cms_decrypt', + 'openssl_cms_encrypt' => 'Safe\openssl_cms_encrypt', + 'openssl_cms_read' => 'Safe\openssl_cms_read', + 'openssl_cms_sign' => 'Safe\openssl_cms_sign', + 'openssl_cms_verify' => 'Safe\openssl_cms_verify', + 'openssl_csr_export' => 'Safe\openssl_csr_export', + 'openssl_csr_export_to_file' => 'Safe\openssl_csr_export_to_file', + 'openssl_csr_get_public_key' => 'Safe\openssl_csr_get_public_key', + 'openssl_csr_get_subject' => 'Safe\openssl_csr_get_subject', + 'openssl_csr_new' => 'Safe\openssl_csr_new', + 'openssl_csr_sign' => 'Safe\openssl_csr_sign', + 'openssl_decrypt' => 'Safe\openssl_decrypt', + 'openssl_dh_compute_key' => 'Safe\openssl_dh_compute_key', + 'openssl_digest' => 'Safe\openssl_digest', + 'openssl_encrypt' => 'Safe\openssl_encrypt', + 'openssl_get_curve_names' => 'Safe\openssl_get_curve_names', + 'openssl_open' => 'Safe\openssl_open', + 'openssl_pbkdf2' => 'Safe\openssl_pbkdf2', + 'openssl_pkcs7_decrypt' => 'Safe\openssl_pkcs7_decrypt', + 'openssl_pkcs7_encrypt' => 'Safe\openssl_pkcs7_encrypt', + 'openssl_pkcs7_read' => 'Safe\openssl_pkcs7_read', + 'openssl_pkcs7_sign' => 'Safe\openssl_pkcs7_sign', + 'openssl_pkcs12_export' => 'Safe\openssl_pkcs12_export', + 'openssl_pkcs12_export_to_file' => 'Safe\openssl_pkcs12_export_to_file', + 'openssl_pkcs12_read' => 'Safe\openssl_pkcs12_read', + 'openssl_pkey_derive' => 'Safe\openssl_pkey_derive', + 'openssl_pkey_export' => 'Safe\openssl_pkey_export', + 'openssl_pkey_export_to_file' => 'Safe\openssl_pkey_export_to_file', + 'openssl_pkey_get_details' => 'Safe\openssl_pkey_get_details', + 'openssl_pkey_get_private' => 'Safe\openssl_pkey_get_private', + 'openssl_pkey_get_public' => 'Safe\openssl_pkey_get_public', + 'openssl_pkey_new' => 'Safe\openssl_pkey_new', + 'openssl_private_decrypt' => 'Safe\openssl_private_decrypt', + 'openssl_private_encrypt' => 'Safe\openssl_private_encrypt', + 'openssl_public_decrypt' => 'Safe\openssl_public_decrypt', + 'openssl_public_encrypt' => 'Safe\openssl_public_encrypt', + 'openssl_seal' => 'Safe\openssl_seal', + 'openssl_sign' => 'Safe\openssl_sign', + 'openssl_spki_export' => 'Safe\openssl_spki_export', + 'openssl_spki_export_challenge' => 'Safe\openssl_spki_export_challenge', + 'openssl_spki_new' => 'Safe\openssl_spki_new', + 'openssl_spki_verify' => 'Safe\openssl_spki_verify', + 'openssl_verify' => 'Safe\openssl_verify', + 'openssl_x509_export' => 'Safe\openssl_x509_export', + 'openssl_x509_export_to_file' => 'Safe\openssl_x509_export_to_file', + 'openssl_x509_fingerprint' => 'Safe\openssl_x509_fingerprint', + 'openssl_x509_read' => 'Safe\openssl_x509_read', + 'output_add_rewrite_var' => 'Safe\output_add_rewrite_var', + 'output_reset_rewrite_vars' => 'Safe\output_reset_rewrite_vars', + 'parse_ini_file' => 'Safe\parse_ini_file', + 'parse_ini_string' => 'Safe\parse_ini_string', + 'parse_url' => 'Safe\parse_url', + 'passthru' => 'Safe\passthru', + 'pcntl_getpriority' => 'Safe\pcntl_getpriority', + 'pcntl_setpriority' => 'Safe\pcntl_setpriority', + 'pcntl_signal' => 'Safe\pcntl_signal', + 'pcntl_signal_dispatch' => 'Safe\pcntl_signal_dispatch', + 'pcntl_sigprocmask' => 'Safe\pcntl_sigprocmask', + 'pcntl_sigtimedwait' => 'Safe\pcntl_sigtimedwait', + 'pcntl_sigwaitinfo' => 'Safe\pcntl_sigwaitinfo', + 'pfsockopen' => 'Safe\pfsockopen', + 'pg_cancel_query' => 'Safe\pg_cancel_query', + 'pg_connect' => 'Safe\pg_connect', + 'pg_connection_reset' => 'Safe\pg_connection_reset', + 'pg_convert' => 'Safe\pg_convert', + 'pg_copy_from' => 'Safe\pg_copy_from', + 'pg_copy_to' => 'Safe\pg_copy_to', + 'pg_delete' => 'Safe\pg_delete', + 'pg_end_copy' => 'Safe\pg_end_copy', + 'pg_execute' => 'Safe\pg_execute', + 'pg_field_table' => 'Safe\pg_field_table', + 'pg_flush' => 'Safe\pg_flush', + 'pg_free_result' => 'Safe\pg_free_result', + 'pg_host' => 'Safe\pg_host', + 'pg_insert' => 'Safe\pg_insert', + 'pg_last_oid' => 'Safe\pg_last_oid', + 'pg_lo_close' => 'Safe\pg_lo_close', + 'pg_lo_export' => 'Safe\pg_lo_export', + 'pg_lo_import' => 'Safe\pg_lo_import', + 'pg_lo_open' => 'Safe\pg_lo_open', + 'pg_lo_read' => 'Safe\pg_lo_read', + 'pg_lo_seek' => 'Safe\pg_lo_seek', + 'pg_lo_truncate' => 'Safe\pg_lo_truncate', + 'pg_lo_unlink' => 'Safe\pg_lo_unlink', + 'pg_lo_write' => 'Safe\pg_lo_write', + 'pg_meta_data' => 'Safe\pg_meta_data', + 'pg_parameter_status' => 'Safe\pg_parameter_status', + 'pg_pconnect' => 'Safe\pg_pconnect', + 'pg_ping' => 'Safe\pg_ping', + 'pg_prepare' => 'Safe\pg_prepare', + 'pg_put_line' => 'Safe\pg_put_line', + 'pg_query' => 'Safe\pg_query', + 'pg_query_params' => 'Safe\pg_query_params', + 'pg_result_error_field' => 'Safe\pg_result_error_field', + 'pg_result_seek' => 'Safe\pg_result_seek', + 'pg_select' => 'Safe\pg_select', + 'pg_set_chunked_rows_size' => 'Safe\pg_set_chunked_rows_size', + 'pg_socket' => 'Safe\pg_socket', + 'pg_trace' => 'Safe\pg_trace', + 'pg_update' => 'Safe\pg_update', + 'php_sapi_name' => 'Safe\php_sapi_name', + 'png2wbmp' => 'Safe\png2wbmp', + 'posix_access' => 'Safe\posix_access', + 'posix_eaccess' => 'Safe\posix_eaccess', + 'posix_getgrgid' => 'Safe\posix_getgrgid', + 'posix_getgrnam' => 'Safe\posix_getgrnam', + 'posix_getgroups' => 'Safe\posix_getgroups', + 'posix_getlogin' => 'Safe\posix_getlogin', + 'posix_getpwuid' => 'Safe\posix_getpwuid', + 'posix_getrlimit' => 'Safe\posix_getrlimit', + 'posix_getsid' => 'Safe\posix_getsid', + 'posix_initgroups' => 'Safe\posix_initgroups', + 'posix_kill' => 'Safe\posix_kill', + 'posix_mkfifo' => 'Safe\posix_mkfifo', + 'posix_mknod' => 'Safe\posix_mknod', + 'posix_setegid' => 'Safe\posix_setegid', + 'posix_seteuid' => 'Safe\posix_seteuid', + 'posix_setgid' => 'Safe\posix_setgid', + 'posix_setpgid' => 'Safe\posix_setpgid', + 'posix_setrlimit' => 'Safe\posix_setrlimit', + 'posix_setuid' => 'Safe\posix_setuid', + 'posix_times' => 'Safe\posix_times', + 'posix_uname' => 'Safe\posix_uname', + 'preg_grep' => 'Safe\preg_grep', + 'preg_match' => 'Safe\preg_match', + 'preg_match_all' => 'Safe\preg_match_all', + 'preg_replace' => 'Safe\preg_replace', + 'preg_split' => 'Safe\preg_split', + 'proc_nice' => 'Safe\proc_nice', + 'pspell_add_to_personal' => 'Safe\pspell_add_to_personal', + 'pspell_add_to_session' => 'Safe\pspell_add_to_session', + 'pspell_clear_session' => 'Safe\pspell_clear_session', + 'pspell_config_data_dir' => 'Safe\pspell_config_data_dir', + 'pspell_config_dict_dir' => 'Safe\pspell_config_dict_dir', + 'pspell_config_ignore' => 'Safe\pspell_config_ignore', + 'pspell_config_mode' => 'Safe\pspell_config_mode', + 'pspell_config_personal' => 'Safe\pspell_config_personal', + 'pspell_config_repl' => 'Safe\pspell_config_repl', + 'pspell_config_runtogether' => 'Safe\pspell_config_runtogether', + 'pspell_config_save_repl' => 'Safe\pspell_config_save_repl', + 'pspell_new' => 'Safe\pspell_new', + 'pspell_new_config' => 'Safe\pspell_new_config', + 'pspell_new_personal' => 'Safe\pspell_new_personal', + 'pspell_save_wordlist' => 'Safe\pspell_save_wordlist', + 'pspell_store_replacement' => 'Safe\pspell_store_replacement', + 'ps_add_launchlink' => 'Safe\ps_add_launchlink', + 'ps_add_locallink' => 'Safe\ps_add_locallink', + 'ps_add_note' => 'Safe\ps_add_note', + 'ps_add_pdflink' => 'Safe\ps_add_pdflink', + 'ps_add_weblink' => 'Safe\ps_add_weblink', + 'ps_arc' => 'Safe\ps_arc', + 'ps_arcn' => 'Safe\ps_arcn', + 'ps_begin_page' => 'Safe\ps_begin_page', + 'ps_begin_pattern' => 'Safe\ps_begin_pattern', + 'ps_begin_template' => 'Safe\ps_begin_template', + 'ps_circle' => 'Safe\ps_circle', + 'ps_clip' => 'Safe\ps_clip', + 'ps_close' => 'Safe\ps_close', + 'ps_closepath' => 'Safe\ps_closepath', + 'ps_closepath_stroke' => 'Safe\ps_closepath_stroke', + 'ps_close_image' => 'Safe\ps_close_image', + 'ps_continue_text' => 'Safe\ps_continue_text', + 'ps_curveto' => 'Safe\ps_curveto', + 'ps_delete' => 'Safe\ps_delete', + 'ps_end_page' => 'Safe\ps_end_page', + 'ps_end_pattern' => 'Safe\ps_end_pattern', + 'ps_end_template' => 'Safe\ps_end_template', + 'ps_fill' => 'Safe\ps_fill', + 'ps_fill_stroke' => 'Safe\ps_fill_stroke', + 'ps_get_parameter' => 'Safe\ps_get_parameter', + 'ps_hyphenate' => 'Safe\ps_hyphenate', + 'ps_include_file' => 'Safe\ps_include_file', + 'ps_lineto' => 'Safe\ps_lineto', + 'ps_moveto' => 'Safe\ps_moveto', + 'ps_new' => 'Safe\ps_new', + 'ps_open_file' => 'Safe\ps_open_file', + 'ps_place_image' => 'Safe\ps_place_image', + 'ps_rect' => 'Safe\ps_rect', + 'ps_restore' => 'Safe\ps_restore', + 'ps_rotate' => 'Safe\ps_rotate', + 'ps_save' => 'Safe\ps_save', + 'ps_scale' => 'Safe\ps_scale', + 'ps_setcolor' => 'Safe\ps_setcolor', + 'ps_setdash' => 'Safe\ps_setdash', + 'ps_setflat' => 'Safe\ps_setflat', + 'ps_setfont' => 'Safe\ps_setfont', + 'ps_setgray' => 'Safe\ps_setgray', + 'ps_setlinecap' => 'Safe\ps_setlinecap', + 'ps_setlinejoin' => 'Safe\ps_setlinejoin', + 'ps_setlinewidth' => 'Safe\ps_setlinewidth', + 'ps_setmiterlimit' => 'Safe\ps_setmiterlimit', + 'ps_setoverprintmode' => 'Safe\ps_setoverprintmode', + 'ps_setpolydash' => 'Safe\ps_setpolydash', + 'ps_set_border_color' => 'Safe\ps_set_border_color', + 'ps_set_border_dash' => 'Safe\ps_set_border_dash', + 'ps_set_border_style' => 'Safe\ps_set_border_style', + 'ps_set_info' => 'Safe\ps_set_info', + 'ps_set_parameter' => 'Safe\ps_set_parameter', + 'ps_set_text_pos' => 'Safe\ps_set_text_pos', + 'ps_set_value' => 'Safe\ps_set_value', + 'ps_shading' => 'Safe\ps_shading', + 'ps_shading_pattern' => 'Safe\ps_shading_pattern', + 'ps_shfill' => 'Safe\ps_shfill', + 'ps_show' => 'Safe\ps_show', + 'ps_show2' => 'Safe\ps_show2', + 'ps_show_xy' => 'Safe\ps_show_xy', + 'ps_show_xy2' => 'Safe\ps_show_xy2', + 'ps_stroke' => 'Safe\ps_stroke', + 'ps_symbol' => 'Safe\ps_symbol', + 'ps_translate' => 'Safe\ps_translate', + 'putenv' => 'Safe\putenv', + 'readfile' => 'Safe\readfile', + 'readgzfile' => 'Safe\readgzfile', + 'readline_completion_function' => 'Safe\readline_completion_function', + 'readline_read_history' => 'Safe\readline_read_history', + 'readline_write_history' => 'Safe\readline_write_history', + 'readlink' => 'Safe\readlink', + 'realpath' => 'Safe\realpath', + 'register_tick_function' => 'Safe\register_tick_function', + 'rename' => 'Safe\rename', + 'rewind' => 'Safe\rewind', + 'rmdir' => 'Safe\rmdir', + 'rnp_decrypt' => 'Safe\rnp_decrypt', + 'rnp_dump_packets' => 'Safe\rnp_dump_packets', + 'rnp_dump_packets_to_json' => 'Safe\rnp_dump_packets_to_json', + 'rnp_ffi_create' => 'Safe\rnp_ffi_create', + 'rnp_ffi_set_pass_provider' => 'Safe\rnp_ffi_set_pass_provider', + 'rnp_import_keys' => 'Safe\rnp_import_keys', + 'rnp_import_signatures' => 'Safe\rnp_import_signatures', + 'rnp_key_export' => 'Safe\rnp_key_export', + 'rnp_key_export_autocrypt' => 'Safe\rnp_key_export_autocrypt', + 'rnp_key_export_revocation' => 'Safe\rnp_key_export_revocation', + 'rnp_key_get_info' => 'Safe\rnp_key_get_info', + 'rnp_key_remove' => 'Safe\rnp_key_remove', + 'rnp_key_revoke' => 'Safe\rnp_key_revoke', + 'rnp_list_keys' => 'Safe\rnp_list_keys', + 'rnp_load_keys' => 'Safe\rnp_load_keys', + 'rnp_load_keys_from_path' => 'Safe\rnp_load_keys_from_path', + 'rnp_locate_key' => 'Safe\rnp_locate_key', + 'rnp_op_encrypt' => 'Safe\rnp_op_encrypt', + 'rnp_op_generate_key' => 'Safe\rnp_op_generate_key', + 'rnp_op_sign' => 'Safe\rnp_op_sign', + 'rnp_op_sign_cleartext' => 'Safe\rnp_op_sign_cleartext', + 'rnp_op_sign_detached' => 'Safe\rnp_op_sign_detached', + 'rnp_op_verify' => 'Safe\rnp_op_verify', + 'rnp_op_verify_detached' => 'Safe\rnp_op_verify_detached', + 'rnp_save_keys' => 'Safe\rnp_save_keys', + 'rnp_save_keys_to_path' => 'Safe\rnp_save_keys_to_path', + 'rnp_supported_features' => 'Safe\rnp_supported_features', + 'rpmaddtag' => 'Safe\rpmaddtag', + 'rrd_create' => 'Safe\rrd_create', + 'rrd_first' => 'Safe\rrd_first', + 'rrd_graph' => 'Safe\rrd_graph', + 'rrd_info' => 'Safe\rrd_info', + 'rrd_lastupdate' => 'Safe\rrd_lastupdate', + 'rrd_restore' => 'Safe\rrd_restore', + 'rrd_tune' => 'Safe\rrd_tune', + 'rrd_update' => 'Safe\rrd_update', + 'rrd_xport' => 'Safe\rrd_xport', + 'sapi_windows_cp_conv' => 'Safe\sapi_windows_cp_conv', + 'sapi_windows_cp_set' => 'Safe\sapi_windows_cp_set', + 'sapi_windows_generate_ctrl_event' => 'Safe\sapi_windows_generate_ctrl_event', + 'sapi_windows_set_ctrl_handler' => 'Safe\sapi_windows_set_ctrl_handler', + 'sapi_windows_vt100_support' => 'Safe\sapi_windows_vt100_support', + 'scandir' => 'Safe\scandir', + 'sem_acquire' => 'Safe\sem_acquire', + 'sem_get' => 'Safe\sem_get', + 'sem_release' => 'Safe\sem_release', + 'sem_remove' => 'Safe\sem_remove', + 'session_abort' => 'Safe\session_abort', + 'session_create_id' => 'Safe\session_create_id', + 'session_decode' => 'Safe\session_decode', + 'session_destroy' => 'Safe\session_destroy', + 'session_encode' => 'Safe\session_encode', + 'session_id' => 'Safe\session_id', + 'session_module_name' => 'Safe\session_module_name', + 'session_name' => 'Safe\session_name', + 'session_regenerate_id' => 'Safe\session_regenerate_id', + 'session_reset' => 'Safe\session_reset', + 'session_save_path' => 'Safe\session_save_path', + 'session_unset' => 'Safe\session_unset', + 'session_write_close' => 'Safe\session_write_close', + 'settype' => 'Safe\settype', + 'set_include_path' => 'Safe\set_include_path', + 'set_time_limit' => 'Safe\set_time_limit', + 'sha1_file' => 'Safe\sha1_file', + 'shell_exec' => 'Safe\shell_exec', + 'shmop_delete' => 'Safe\shmop_delete', + 'shmop_read' => 'Safe\shmop_read', + 'shm_attach' => 'Safe\shm_attach', + 'shm_detach' => 'Safe\shm_detach', + 'shm_put_var' => 'Safe\shm_put_var', + 'shm_remove' => 'Safe\shm_remove', + 'shm_remove_var' => 'Safe\shm_remove_var', + 'simplexml_import_dom' => 'Safe\simplexml_import_dom', + 'simplexml_load_file' => 'Safe\simplexml_load_file', + 'simplexml_load_string' => 'Safe\simplexml_load_string', + 'socket_accept' => 'Safe\socket_accept', + 'socket_addrinfo_bind' => 'Safe\socket_addrinfo_bind', + 'socket_addrinfo_connect' => 'Safe\socket_addrinfo_connect', + 'socket_addrinfo_lookup' => 'Safe\socket_addrinfo_lookup', + 'socket_atmark' => 'Safe\socket_atmark', + 'socket_bind' => 'Safe\socket_bind', + 'socket_connect' => 'Safe\socket_connect', + 'socket_create' => 'Safe\socket_create', + 'socket_create_listen' => 'Safe\socket_create_listen', + 'socket_create_pair' => 'Safe\socket_create_pair', + 'socket_export_stream' => 'Safe\socket_export_stream', + 'socket_getpeername' => 'Safe\socket_getpeername', + 'socket_getsockname' => 'Safe\socket_getsockname', + 'socket_get_option' => 'Safe\socket_get_option', + 'socket_import_stream' => 'Safe\socket_import_stream', + 'socket_listen' => 'Safe\socket_listen', + 'socket_read' => 'Safe\socket_read', + 'socket_send' => 'Safe\socket_send', + 'socket_sendmsg' => 'Safe\socket_sendmsg', + 'socket_sendto' => 'Safe\socket_sendto', + 'socket_set_block' => 'Safe\socket_set_block', + 'socket_set_nonblock' => 'Safe\socket_set_nonblock', + 'socket_set_option' => 'Safe\socket_set_option', + 'socket_shutdown' => 'Safe\socket_shutdown', + 'socket_write' => 'Safe\socket_write', + 'socket_wsaprotocol_info_export' => 'Safe\socket_wsaprotocol_info_export', + 'socket_wsaprotocol_info_import' => 'Safe\socket_wsaprotocol_info_import', + 'socket_wsaprotocol_info_release' => 'Safe\socket_wsaprotocol_info_release', + 'sodium_crypto_aead_aegis128l_decrypt' => 'Safe\sodium_crypto_aead_aegis128l_decrypt', + 'sodium_crypto_aead_aegis256_decrypt' => 'Safe\sodium_crypto_aead_aegis256_decrypt', + 'sodium_crypto_aead_aes256gcm_decrypt' => 'Safe\sodium_crypto_aead_aes256gcm_decrypt', + 'sodium_crypto_aead_chacha20poly1305_decrypt' => 'Safe\sodium_crypto_aead_chacha20poly1305_decrypt', + 'sodium_crypto_aead_chacha20poly1305_encrypt' => 'Safe\sodium_crypto_aead_chacha20poly1305_encrypt', + 'sodium_crypto_aead_chacha20poly1305_ietf_decrypt' => 'Safe\sodium_crypto_aead_chacha20poly1305_ietf_decrypt', + 'sodium_crypto_aead_chacha20poly1305_ietf_encrypt' => 'Safe\sodium_crypto_aead_chacha20poly1305_ietf_encrypt', + 'sodium_crypto_aead_xchacha20poly1305_ietf_decrypt' => 'Safe\sodium_crypto_aead_xchacha20poly1305_ietf_decrypt', + 'sodium_crypto_aead_xchacha20poly1305_ietf_encrypt' => 'Safe\sodium_crypto_aead_xchacha20poly1305_ietf_encrypt', + 'sodium_crypto_auth_verify' => 'Safe\sodium_crypto_auth_verify', + 'sodium_crypto_box_open' => 'Safe\sodium_crypto_box_open', + 'sodium_crypto_box_seal_open' => 'Safe\sodium_crypto_box_seal_open', + 'sodium_crypto_secretbox_open' => 'Safe\sodium_crypto_secretbox_open', + 'sodium_crypto_sign_open' => 'Safe\sodium_crypto_sign_open', + 'sodium_crypto_sign_verify_detached' => 'Safe\sodium_crypto_sign_verify_detached', + 'sodium_crypto_stream_xchacha20_xor_ic' => 'Safe\sodium_crypto_stream_xchacha20_xor_ic', + 'solr_get_version' => 'Safe\solr_get_version', + 'spl_autoload_register' => 'Safe\spl_autoload_register', + 'spl_autoload_unregister' => 'Safe\spl_autoload_unregister', + 'sqlsrv_begin_transaction' => 'Safe\sqlsrv_begin_transaction', + 'sqlsrv_cancel' => 'Safe\sqlsrv_cancel', + 'sqlsrv_client_info' => 'Safe\sqlsrv_client_info', + 'sqlsrv_close' => 'Safe\sqlsrv_close', + 'sqlsrv_commit' => 'Safe\sqlsrv_commit', + 'sqlsrv_configure' => 'Safe\sqlsrv_configure', + 'sqlsrv_execute' => 'Safe\sqlsrv_execute', + 'sqlsrv_free_stmt' => 'Safe\sqlsrv_free_stmt', + 'sqlsrv_get_field' => 'Safe\sqlsrv_get_field', + 'sqlsrv_next_result' => 'Safe\sqlsrv_next_result', + 'sqlsrv_num_fields' => 'Safe\sqlsrv_num_fields', + 'sqlsrv_num_rows' => 'Safe\sqlsrv_num_rows', + 'sqlsrv_prepare' => 'Safe\sqlsrv_prepare', + 'sqlsrv_query' => 'Safe\sqlsrv_query', + 'sqlsrv_rollback' => 'Safe\sqlsrv_rollback', + 'ssdeep_fuzzy_compare' => 'Safe\ssdeep_fuzzy_compare', + 'ssdeep_fuzzy_hash' => 'Safe\ssdeep_fuzzy_hash', + 'ssdeep_fuzzy_hash_filename' => 'Safe\ssdeep_fuzzy_hash_filename', + 'ssh2_auth_agent' => 'Safe\ssh2_auth_agent', + 'ssh2_auth_hostbased_file' => 'Safe\ssh2_auth_hostbased_file', + 'ssh2_auth_password' => 'Safe\ssh2_auth_password', + 'ssh2_auth_pubkey_file' => 'Safe\ssh2_auth_pubkey_file', + 'ssh2_connect' => 'Safe\ssh2_connect', + 'ssh2_disconnect' => 'Safe\ssh2_disconnect', + 'ssh2_exec' => 'Safe\ssh2_exec', + 'ssh2_forward_accept' => 'Safe\ssh2_forward_accept', + 'ssh2_forward_listen' => 'Safe\ssh2_forward_listen', + 'ssh2_publickey_add' => 'Safe\ssh2_publickey_add', + 'ssh2_publickey_init' => 'Safe\ssh2_publickey_init', + 'ssh2_publickey_remove' => 'Safe\ssh2_publickey_remove', + 'ssh2_scp_recv' => 'Safe\ssh2_scp_recv', + 'ssh2_scp_send' => 'Safe\ssh2_scp_send', + 'ssh2_send_eof' => 'Safe\ssh2_send_eof', + 'ssh2_sftp' => 'Safe\ssh2_sftp', + 'ssh2_sftp_chmod' => 'Safe\ssh2_sftp_chmod', + 'ssh2_sftp_mkdir' => 'Safe\ssh2_sftp_mkdir', + 'ssh2_sftp_rename' => 'Safe\ssh2_sftp_rename', + 'ssh2_sftp_rmdir' => 'Safe\ssh2_sftp_rmdir', + 'ssh2_sftp_symlink' => 'Safe\ssh2_sftp_symlink', + 'ssh2_sftp_unlink' => 'Safe\ssh2_sftp_unlink', + 'ssh2_shell' => 'Safe\ssh2_shell', + 'stream_context_set_options' => 'Safe\stream_context_set_options', + 'stream_context_set_params' => 'Safe\stream_context_set_params', + 'stream_copy_to_stream' => 'Safe\stream_copy_to_stream', + 'stream_filter_append' => 'Safe\stream_filter_append', + 'stream_filter_prepend' => 'Safe\stream_filter_prepend', + 'stream_filter_register' => 'Safe\stream_filter_register', + 'stream_filter_remove' => 'Safe\stream_filter_remove', + 'stream_get_contents' => 'Safe\stream_get_contents', + 'stream_get_line' => 'Safe\stream_get_line', + 'stream_isatty' => 'Safe\stream_isatty', + 'stream_resolve_include_path' => 'Safe\stream_resolve_include_path', + 'stream_set_blocking' => 'Safe\stream_set_blocking', + 'stream_set_timeout' => 'Safe\stream_set_timeout', + 'stream_socket_accept' => 'Safe\stream_socket_accept', + 'stream_socket_client' => 'Safe\stream_socket_client', + 'stream_socket_get_name' => 'Safe\stream_socket_get_name', + 'stream_socket_pair' => 'Safe\stream_socket_pair', + 'stream_socket_recvfrom' => 'Safe\stream_socket_recvfrom', + 'stream_socket_sendto' => 'Safe\stream_socket_sendto', + 'stream_socket_server' => 'Safe\stream_socket_server', + 'stream_socket_shutdown' => 'Safe\stream_socket_shutdown', + 'stream_supports_lock' => 'Safe\stream_supports_lock', + 'stream_wrapper_register' => 'Safe\stream_wrapper_register', + 'stream_wrapper_restore' => 'Safe\stream_wrapper_restore', + 'stream_wrapper_unregister' => 'Safe\stream_wrapper_unregister', + 'strftime' => 'Safe\strftime', + 'strptime' => 'Safe\strptime', + 'strtotime' => 'Safe\strtotime', + 'swoole_async_dns_lookup' => 'Safe\swoole_async_dns_lookup', + 'swoole_async_readfile' => 'Safe\swoole_async_readfile', + 'swoole_async_write' => 'Safe\swoole_async_write', + 'swoole_async_writefile' => 'Safe\swoole_async_writefile', + 'swoole_event_defer' => 'Safe\swoole_event_defer', + 'swoole_event_del' => 'Safe\swoole_event_del', + 'swoole_event_write' => 'Safe\swoole_event_write', + 'symlink' => 'Safe\symlink', + 'system' => 'Safe\system', + 'tempnam' => 'Safe\tempnam', + 'timezone_name_from_abbr' => 'Safe\timezone_name_from_abbr', + 'time_nanosleep' => 'Safe\time_nanosleep', + 'time_sleep_until' => 'Safe\time_sleep_until', + 'tmpfile' => 'Safe\tmpfile', + 'touch' => 'Safe\touch', + 'unixtojd' => 'Safe\unixtojd', + 'unlink' => 'Safe\unlink', + 'unpack' => 'Safe\unpack', + 'uopz_extend' => 'Safe\uopz_extend', + 'uopz_implement' => 'Safe\uopz_implement', + 'variant_date_to_timestamp' => 'Safe\variant_date_to_timestamp', + 'variant_round' => 'Safe\variant_round', + 'virtual' => 'Safe\virtual', + 'xdiff_file_bdiff' => 'Safe\xdiff_file_bdiff', + 'xdiff_file_bpatch' => 'Safe\xdiff_file_bpatch', + 'xdiff_file_diff' => 'Safe\xdiff_file_diff', + 'xdiff_file_diff_binary' => 'Safe\xdiff_file_diff_binary', + 'xdiff_file_patch_binary' => 'Safe\xdiff_file_patch_binary', + 'xdiff_file_rabdiff' => 'Safe\xdiff_file_rabdiff', + 'xdiff_string_bpatch' => 'Safe\xdiff_string_bpatch', + 'xdiff_string_patch' => 'Safe\xdiff_string_patch', + 'xdiff_string_patch_binary' => 'Safe\xdiff_string_patch_binary', + 'xmlrpc_set_type' => 'Safe\xmlrpc_set_type', + 'xml_parser_free' => 'Safe\xml_parser_free', + 'xml_parser_set_option' => 'Safe\xml_parser_set_option', + 'yaml_parse' => 'Safe\yaml_parse', + 'yaml_parse_file' => 'Safe\yaml_parse_file', + 'yaml_parse_url' => 'Safe\yaml_parse_url', + 'yaz_ccl_parse' => 'Safe\yaz_ccl_parse', + 'yaz_close' => 'Safe\yaz_close', + 'yaz_connect' => 'Safe\yaz_connect', + 'yaz_database' => 'Safe\yaz_database', + 'yaz_element' => 'Safe\yaz_element', + 'yaz_present' => 'Safe\yaz_present', + 'yaz_search' => 'Safe\yaz_search', + 'yaz_wait' => 'Safe\yaz_wait', + 'zip_entry_close' => 'Safe\zip_entry_close', + 'zip_entry_compressedsize' => 'Safe\zip_entry_compressedsize', + 'zip_entry_compressionmethod' => 'Safe\zip_entry_compressionmethod', + 'zip_entry_filesize' => 'Safe\zip_entry_filesize', + 'zip_entry_name' => 'Safe\zip_entry_name', + 'zip_entry_open' => 'Safe\zip_entry_open', + 'zip_entry_read' => 'Safe\zip_entry_read', + 'zlib_decode' => 'Safe\zlib_decode', + ] + ); +}; diff --git a/generated/8.5/rnp.php b/generated/8.5/rnp.php new file mode 100644 index 00000000..9b5587b6 --- /dev/null +++ b/generated/8.5/rnp.php @@ -0,0 +1,609 @@ + + * + * + * @param bool $use_include_path Setting use_include_path to TRUE will result + * in PHP trying to open the file along the standard include path as per + * the include_path directive. + * This is used for local files, not URLs. + * @return array Returns an array with all the parsed meta tags. + * + * The value of the name property becomes the key, the value of the content + * property becomes the value of the returned array, so you can easily use + * standard array functions to traverse it or access single values. + * Special characters in the value of the name property are substituted with + * '_', the rest is converted to lower case. If two meta tags have the same + * name, only the last one is returned. + * + * Returns FALSE on failure. + * @throws UrlException + * + */ +function get_meta_tags(string $filename, bool $use_include_path = false): array +{ + error_clear_last(); + $safeResult = \get_meta_tags($filename, $use_include_path); + if ($safeResult === false) { + throw UrlException::createFromPhpError(); + } + return $safeResult; +} + + +/** + * This function parses a URL and returns an associative array containing any + * of the various components of the URL that are present. + * The values of the array elements are not URL decoded. + * + * This function is not meant to validate + * the given URL, it only breaks it up into the parts listed below. Partial and invalid + * URLs are also accepted, parse_url tries its best to + * parse them correctly. + * + * @param string $url The URL to parse. + * @param int $component Specify one of PHP_URL_SCHEME, + * PHP_URL_HOST, PHP_URL_PORT, + * PHP_URL_USER, PHP_URL_PASS, + * PHP_URL_PATH, PHP_URL_QUERY + * or PHP_URL_FRAGMENT to retrieve just a specific + * URL component as a string (except when + * PHP_URL_PORT is given, in which case the return + * value will be an int). + * @return array|int|string|null On seriously malformed URLs, parse_url. + * + * If the component parameter is omitted, an + * associative array is returned. At least one element will be + * present within the array. Potential keys within this array are: + * + * + * + * scheme - e.g. http + * + * + * + * + * host + * + * + * + * + * port + * + * + * + * + * user + * + * + * + * + * pass + * + * + * + * + * path + * + * + * + * + * query - after the question mark ? + * + * + * + * + * fragment - after the hashmark # + * + * + * + * + * If the component parameter is specified, + * parse_url returns a string (or an + * int, in the case of PHP_URL_PORT) + * instead of an array. If the requested component doesn't exist + * within the given URL, NULL will be returned. + * As of PHP 8.0.0, parse_url distinguishes absent and empty + * queries and fragments: + * + * + * + * + * + * + * + * Previously all cases resulted in query and fragment being NULL. + * + * Note that control characters (cf. ctype_cntrl) in the + * components are replaced with underscores (_). + * @throws UrlException + * + */ +function parse_url(string $url, int $component = -1) +{ + error_clear_last(); + $safeResult = \parse_url($url, $component); + if ($safeResult === false) { + throw UrlException::createFromPhpError(); + } + return $safeResult; +} diff --git a/generated/8.5/var.php b/generated/8.5/var.php new file mode 100644 index 00000000..70f048df --- /dev/null +++ b/generated/8.5/var.php @@ -0,0 +1,60 @@ + - * - * - * - * The permissions 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 $permissions): void -{ - error_clear_last(); - $safeResult = \chmod($filename, $permissions); - if ($safeResult === false) { - throw 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 FilesystemException - * - */ -function chown(string $filename, $user): void -{ - error_clear_last(); - $safeResult = \chown($filename, $user); - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } -} - - -/** - * Makes a copy of the file from to - * to. - * - * If you wish to move a file, use the rename function. - * - * @param string $from Path to the source file. - * @param string $to The destination path. If to 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 FilesystemException - * - */ -function copy(string $from, string $to, $context = null): void -{ - error_clear_last(); - if ($context !== null) { - $safeResult = \copy($from, $to, $context); - } else { - $safeResult = \copy($from, $to); - } - if ($safeResult === false) { - throw 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 FilesystemException - * - */ -function disk_free_space(string $directory): float -{ - error_clear_last(); - $safeResult = \disk_free_space($directory); - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * 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 FilesystemException - * - */ -function disk_total_space(string $directory): float -{ - error_clear_last(); - $safeResult = \disk_total_space($directory); - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * The file pointed to by stream is closed. - * - * @param resource $stream The file pointer must be valid, and must point to a file successfully - * opened by fopen or fsockopen. - * @throws FilesystemException - * - */ -function fclose($stream): void -{ - error_clear_last(); - $safeResult = \fclose($stream); - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } -} - - -/** - * This function synchronizes stream contents to storage media, just like fsync does, - * but it does not synchronize file meta-data. - * Note that this function is only effectively different in POSIX systems. - * In Windows, this function is aliased to fsync. - * - * @param resource $stream 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 FilesystemException - * - */ -function fdatasync($stream): void -{ - error_clear_last(); - $safeResult = \fdatasync($stream); - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } -} - - -/** - * This function forces a write of all buffered output to the resource - * pointed to by the file stream. - * - * @param resource $stream 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 FilesystemException - * - */ -function fflush($stream): void -{ - error_clear_last(); - $safeResult = \fflush($stream); - if ($safeResult === false) { - throw 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 length 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 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 $length 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 FilesystemException - * - */ -function file_get_contents(string $filename, bool $use_include_path = false, $context = null, int $offset = 0, ?int $length = null): string -{ - error_clear_last(); - if ($length !== null) { - $safeResult = \file_get_contents($filename, $use_include_path, $context, $offset, $length); - } elseif ($offset !== 0) { - $safeResult = \file_get_contents($filename, $use_include_path, $context, $offset); - } elseif ($context !== null) { - $safeResult = \file_get_contents($filename, $use_include_path, $context); - } else { - $safeResult = \file_get_contents($filename, $use_include_path); - } - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * This function is identical to calling fopen, - * fwrite and fclose successively - * to write data to a file. - * - * If filename does not exist, the file is created. - * Otherwise, the existing file is overwritten, unless the - * FILE_APPEND flag is set. - * - * @param string $filename Path to the file where to write the data. - * @param mixed $data The data to write. Can be either a string, an - * array or a stream resource. - * - * If data is a stream resource, the - * remaining buffer of that stream will be copied to the specified file. - * This is similar with using stream_copy_to_stream. - * - * You can also specify the data parameter as a single - * dimension array. This is equivalent to - * file_put_contents($filename, implode('', $array)). - * @param int $flags The value of flags can be any combination of - * the following flags, joined with the binary OR (|) - * operator. - * - * - * Available flags - * - * - * - * Flag - * Description - * - * - * - * - * - * FILE_USE_INCLUDE_PATH - * - * - * Search for filename in the include directory. - * See include_path for more - * information. - * - * - * - * - * FILE_APPEND - * - * - * If file filename already exists, append - * the data to the file instead of overwriting it. - * - * - * - * - * LOCK_EX - * - * - * Acquire an exclusive lock on the file while proceeding to the - * writing. In other words, a flock call happens - * between the fopen call and the - * fwrite call. This is not identical to an - * fopen call with mode "x". - * - * - * - * - * - * @param resource|null $context A valid context resource created with - * stream_context_create. - * @return int This function returns the number of bytes that were written to the file. - * @throws FilesystemException - * - */ -function file_put_contents(string $filename, $data, int $flags = 0, $context = null): int -{ - error_clear_last(); - if ($context !== null) { - $safeResult = \file_put_contents($filename, $data, $flags, $context); - } else { - $safeResult = \file_put_contents($filename, $data, $flags); - } - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Reads an entire file into an array. - * - * @param string $filename Path to the file. - * @param int $flags The optional parameter flags can be one, or - * more, of the following constants: - * - * - * - * FILE_USE_INCLUDE_PATH - * - * - * - * Search for the file in the include_path. - * - * - * - * - * - * FILE_IGNORE_NEW_LINES - * - * - * - * Omit newline at the end of each array element - * - * - * - * - * - * FILE_SKIP_EMPTY_LINES - * - * - * - * Skip empty lines - * - * - * - * - * - * FILE_NO_DEFAULT_CONTEXT - * - * - * - * Don't use the default context - * - * - * - * - * @param resource $context - * @return array Returns the file in an array. Each element of the array corresponds to a - * line in the file, with the newline still attached. Upon failure, - * file returns FALSE. - * @throws FilesystemException - * - */ -function file(string $filename, int $flags = 0, $context = null): array -{ - error_clear_last(); - if ($context !== null) { - $safeResult = \file($filename, $flags, $context); - } else { - $safeResult = \file($filename, $flags); - } - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * - * - * @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 FilesystemException - * - */ -function fileatime(string $filename): int -{ - error_clear_last(); - $safeResult = \fileatime($filename); - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * 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 FilesystemException - * - */ -function filectime(string $filename): int -{ - error_clear_last(); - $safeResult = \filectime($filename); - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Gets the file inode. - * - * @param string $filename Path to the file. - * @return int Returns the inode number of the file. - * @throws FilesystemException - * - */ -function fileinode(string $filename): int -{ - error_clear_last(); - $safeResult = \fileinode($filename); - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * 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 FilesystemException - * - */ -function filemtime(string $filename): int -{ - error_clear_last(); - $safeResult = \filemtime($filename); - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * 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 FilesystemException - * - */ -function fileowner(string $filename): int -{ - error_clear_last(); - $safeResult = \fileowner($filename); - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Gets permissions for the given file. - * - * @param string $filename Path to the file. - * @return int Returns the file's permissions as a numeric mode. Lower bits of this mode - * are the same as the permissions expected by chmod, - * however on most platforms the return value will also include information on - * the type of file given as filename. The examples - * below demonstrate how to test the return value for specific permissions and - * file types on POSIX systems, including Linux and macOS. - * - * For local files, the specific return value is that of the - * st_mode member of the structure returned by the C - * library's stat function. Exactly which bits are set - * can vary from platform to platform, and looking up your specific platform's - * documentation is recommended if parsing the non-permission bits of the - * return value is required. - * - * Returns FALSE on failure. - * @throws FilesystemException - * - */ -function fileperms(string $filename): int -{ - error_clear_last(); - $safeResult = \fileperms($filename); - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Gets the size for the given file. - * - * @param string $filename Path to the file. - * @return int Returns the size of the file in bytes, or FALSE (and generates an error - * of level E_WARNING) in case of an error. - * @throws FilesystemException - * - */ -function filesize(string $filename): int -{ - error_clear_last(); - $safeResult = \filesize($filename); - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * flock allows you to perform a simple reader/writer - * model which can be used on virtually every platform (including most Unix - * derivatives and even Windows). - * - * The lock is released also by fclose, - * or when stream is garbage collected. - * - * PHP supports a portable way of locking complete files in an advisory way - * (which means all accessing programs have to use the same way of locking - * or it will not work). By default, this function will block until the - * requested lock is acquired; this may be controlled with the LOCK_NB option documented below. - * - * @param resource $stream A file system pointer resource - * that is typically created using fopen. - * @param int $operation operation is one of the following: - * - * - * - * LOCK_SH to acquire a shared lock (reader). - * - * - * - * - * LOCK_EX to acquire an exclusive lock (writer). - * - * - * - * - * LOCK_UN to release a lock (shared or exclusive). - * - * - * - * - * It is also possible to add LOCK_NB as a bitmask to one - * of the above operations, if flock should not - * block during the locking attempt. - * @param int|null $would_block The optional third argument is set to 1 if the lock would block - * (EWOULDBLOCK errno condition). - * @throws FilesystemException - * - */ -function flock($stream, int $operation, ?int &$would_block = null): void -{ - error_clear_last(); - $safeResult = \flock($stream, $operation, $would_block); - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } -} - - -/** - * 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 - * 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; otherwise it has the - * same behavior as 'w'. - * - * - * - * '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 (Mac OS Classic) used - * \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 is 'b'. - * You can 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 old versions of notepad. You - * should use the 'b' in all other cases. - * - * If you specify the 't' 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 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 TRUE if you want to search for the file in the - * include_path, too. - * @param resource|null $context A context stream - * resource. - * @return resource Returns a file pointer resource on success - * @throws FilesystemException - * - */ -function fopen(string $filename, string $mode, bool $use_include_path = false, $context = null) -{ - error_clear_last(); - if ($context !== null) { - $safeResult = \fopen($filename, $mode, $use_include_path, $context); - } else { - $safeResult = \fopen($filename, $mode, $use_include_path); - } - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * fread reads up to - * length bytes from the file pointer - * referenced by stream. 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 $stream 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 FilesystemException - * - */ -function fread($stream, int $length): string -{ - error_clear_last(); - $safeResult = \fread($stream, $length); - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } - return $safeResult; +if (strpos(PHP_VERSION, "8.1.") === 0) { + require_once __DIR__ . '/8.1/filesystem.php'; } - - -/** - * Gathers the statistics of the file opened by the file - * pointer stream. This function is similar to the - * stat function except that it operates - * on an open file pointer instead of a filename. - * - * @param resource $stream A file system pointer resource - * that is typically created using fopen. - * @return array Returns an array with the statistics of the file; the format of the array - * is described in detail on the stat manual page. - * Returns FALSE on failure. - * @throws FilesystemException - * - */ -function fstat($stream): array -{ - error_clear_last(); - $safeResult = \fstat($stream); - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } - return $safeResult; +if (strpos(PHP_VERSION, "8.2.") === 0) { + require_once __DIR__ . '/8.2/filesystem.php'; } - - -/** - * This function synchronizes changes to the file, including its meta-data. This is similar to fflush, - * but it also instructs the operating system to write to the storage media. - * - * @param resource $stream 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 FilesystemException - * - */ -function fsync($stream): void -{ - error_clear_last(); - $safeResult = \fsync($stream); - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } +if (strpos(PHP_VERSION, "8.3.") === 0) { + require_once __DIR__ . '/8.3/filesystem.php'; } - - -/** - * Takes the filepointer, stream, and truncates the file to - * length, size. - * - * @param resource $stream The file pointer. - * - * The stream 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 FilesystemException - * - */ -function ftruncate($stream, int $size): void -{ - error_clear_last(); - $safeResult = \ftruncate($stream, $size); - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } -} - - -/** - * - * - * @param resource $stream A file system pointer resource - * that is typically created using fopen. - * @param string $data The string that is to be written. - * @param int $length If length is an integer, writing will stop - * after length bytes have been written or the - * end of data is reached, whichever comes first. - * @return int - * @throws FilesystemException - * - */ -function fwrite($stream, string $data, ?int $length = null): int -{ - error_clear_last(); - if ($length !== null) { - $safeResult = \fwrite($stream, $data, $length); - } else { - $safeResult = \fwrite($stream, $data); - } - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * 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. - * - * Special characters: - * - * - * - * * - Matches zero or more characters. - * - * - * - * - * ? - Matches exactly one character (any character). - * - * - * - * - * [...] - Matches one character from a group of - * characters. If the first character is !, - * matches any character not in the group. - * - * - * - * - * \ - Escapes the following character, - * except when the GLOB_NOESCAPE flag is used. - * - * - * - * @param int $flags Any of the GLOB_* constants. - * @return array Returns an array containing the matched files/directories, an empty array - * if no file matched. - * Unless GLOB_NOSORT was used, the names will - * be sorted alphanumerically. - * @throws FilesystemException - * - */ -function glob(string $pattern, int $flags = 0): array -{ - error_clear_last(); - $safeResult = \glob($pattern, $flags); - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * 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 FilesystemException - * - */ -function lchgrp(string $filename, $group): void -{ - error_clear_last(); - $safeResult = \lchgrp($filename, $group); - if ($safeResult === false) { - throw 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 FilesystemException - * - */ -function lchown(string $filename, $user): void -{ - error_clear_last(); - $safeResult = \lchown($filename, $user); - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } -} - - -/** - * link creates a hard link. - * - * @param string $target Target of the link. - * @param string $link The link name. - * @throws FilesystemException - * - */ -function link(string $target, string $link): void -{ - error_clear_last(); - $safeResult = \link($target, $link); - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } -} - - -/** - * Gathers the statistics of the file or symbolic link named by - * filename. - * - * @param string $filename Path to a file or a symbolic link. - * @return array See the manual page for stat for information on - * the structure of the array that lstat returns. - * This function is identical to the stat function - * except that if the filename parameter is a symbolic - * link, the status of the symbolic link is returned, not the status of the - * file pointed to by the symbolic link. - * - * On failure, FALSE is returned. - * @throws FilesystemException - * - */ -function lstat(string $filename): array -{ - error_clear_last(); - $safeResult = \lstat($filename); - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Attempts to create the directory specified by directory. - * - * @param string $directory The directory path. - * A URL can be used as a - * filename with this function if the fopen wrappers have been enabled. - * See fopen for more details on how to specify the - * filename. See the for links to information - * about what abilities the various wrappers have, notes on their usage, - * and information on any predefined variables they may - * provide. - * @param int $permissions The permissions are 0777 by default, which means the widest possible - * access. For more information on permissions, read the details - * on the chmod page. - * - * permissions is ignored on Windows. - * - * Note that you probably want to specify the permissions as an octal number, - * which means it should have a leading zero. The permissions is also modified - * by the current umask, which you can change using - * umask. - * @param bool $recursive If TRUE, then any parent directories to the directory specified will - * also be created, with the same permissions. - * @param resource $context A context stream - * resource. - * @throws FilesystemException - * - */ -function mkdir(string $directory, int $permissions = 0777, bool $recursive = false, $context = null): void -{ - error_clear_last(); - if ($context !== null) { - $safeResult = \mkdir($directory, $permissions, $recursive, $context); - } else { - $safeResult = \mkdir($directory, $permissions, $recursive); - } - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } -} - - -/** - * parse_ini_file loads in the - * ini file specified in filename, - * and returns the settings in it in an associative array. - * - * The structure of the ini file is the same as the php.ini's. - * - * @param string $filename The filename of the ini file being parsed. If a relative path is used, - * it is evaluated relative to the current working directory, then the - * include_path. - * @param bool $process_sections By setting the process_sections - * parameter to TRUE, you get a multidimensional array, with - * the section names and settings included. The default - * for process_sections is FALSE - * @param int $scanner_mode Can either be INI_SCANNER_NORMAL (default) or - * INI_SCANNER_RAW. If INI_SCANNER_RAW - * is supplied, then option values will not be parsed. - * - * - * As of PHP 5.6.1 can also be specified as INI_SCANNER_TYPED. - * In this mode boolean, null and integer types are preserved when possible. - * String values "true", "on" and "yes" - * are converted to TRUE. "false", "off", "no" - * and "none" are considered FALSE. "null" is converted to NULL - * in typed mode. Also, all numeric strings are converted to integer type if it is possible. - * @return array The settings are returned as an associative array on success. - * @throws FilesystemException - * - */ -function parse_ini_file(string $filename, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array -{ - error_clear_last(); - $safeResult = \parse_ini_file($filename, $process_sections, $scanner_mode); - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * parse_ini_string returns the settings in string - * ini_string in an associative array. - * - * The structure of the ini string is the same as the php.ini's. - * - * @param string $ini_string The contents of the ini file being parsed. - * @param bool $process_sections By setting the process_sections - * parameter to TRUE, you get a multidimensional array, with - * the section names and settings included. The default - * for process_sections is FALSE - * @param int $scanner_mode Can either be INI_SCANNER_NORMAL (default) or - * INI_SCANNER_RAW. If INI_SCANNER_RAW - * is supplied, then option values will not be parsed. - * - * - * As of PHP 5.6.1 can also be specified as INI_SCANNER_TYPED. - * In this mode boolean, null and integer types are preserved when possible. - * String values "true", "on" and "yes" - * are converted to TRUE. "false", "off", "no" - * and "none" are considered FALSE. "null" is converted to NULL - * in typed mode. Also, all numeric strings are converted to integer type if it is possible. - * @return array The settings are returned as an associative array on success. - * @throws FilesystemException - * - */ -function parse_ini_string(string $ini_string, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array -{ - error_clear_last(); - $safeResult = \parse_ini_string($ini_string, $process_sections, $scanner_mode); - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } - return $safeResult; +if (strpos(PHP_VERSION, "8.4.") === 0) { + require_once __DIR__ . '/8.4/filesystem.php'; } - - -/** - * Reads a file and writes it to the output buffer. - * - * @param string $filename The filename being read. - * @param bool $use_include_path You can use the optional second parameter and set it to TRUE, if - * you want to search for the file in the include_path, too. - * @param resource $context A context stream - * resource. - * @return int Returns the number of bytes read from the file on success - * @throws FilesystemException - * - */ -function readfile(string $filename, bool $use_include_path = false, $context = null): int -{ - error_clear_last(); - if ($context !== null) { - $safeResult = \readfile($filename, $use_include_path, $context); - } else { - $safeResult = \readfile($filename, $use_include_path); - } - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * 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 FilesystemException - * - */ -function readlink(string $path): string -{ - error_clear_last(); - $safeResult = \readlink($path); - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * realpath expands all symbolic links and - * resolves references to /./, /../ and extra / characters in - * the input path and returns the canonicalized - * absolute pathname. - * - * @param string $path The path being checked. - * - * - * Whilst a path must be supplied, the value can be an empty string. - * In this case, the value is interpreted as the current directory. - * - * - * - * Whilst a path must be supplied, the value can be an empty string. - * In this case, the value is interpreted as the current directory. - * @return string Returns the canonicalized absolute pathname on success. The resulting path - * will have no symbolic link, /./ or /../ components. Trailing delimiters, - * such as \ and /, are also removed. - * - * realpath returns FALSE on failure, e.g. if - * the file does not exist. - * @throws FilesystemException - * - */ -function realpath(string $path): string -{ - error_clear_last(); - $safeResult = \realpath($path); - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Attempts to rename from to - * to, moving it between directories if necessary. - * If renaming a file and to exists, - * it will be overwritten. If renaming a directory and - * to exists, - * this function will emit a warning. - * - * @param string $from The old name. - * - * The wrapper used in from - * must match the wrapper used in - * to. - * @param string $to The new name. - * - * - * On Windows, if to already exists, it must be writable. - * Otherwise rename fails and issues E_WARNING. - * - * - * @param resource $context A context stream - * resource. - * @throws FilesystemException - * - */ -function rename(string $from, string $to, $context = null): void -{ - error_clear_last(); - if ($context !== null) { - $safeResult = \rename($from, $to, $context); - } else { - $safeResult = \rename($from, $to); - } - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } -} - - -/** - * Sets the file position indicator for stream - * to the beginning of the file stream. - * - * @param resource $stream The file pointer must be valid, and must point to a file - * successfully opened by fopen. - * @throws FilesystemException - * - */ -function rewind($stream): void -{ - error_clear_last(); - $safeResult = \rewind($stream); - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } -} - - -/** - * Attempts to remove the directory named by directory. - * The directory must be empty, and the relevant permissions must permit this. - * A E_WARNING level error will be generated on failure. - * - * @param string $directory Path to the directory. - * @param resource $context A context stream - * resource. - * @throws FilesystemException - * - */ -function rmdir(string $directory, $context = null): void -{ - error_clear_last(); - if ($context !== null) { - $safeResult = \rmdir($directory, $context); - } else { - $safeResult = \rmdir($directory); - } - if ($safeResult === false) { - throw 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 FilesystemException - * - */ -function symlink(string $target, string $link): void -{ - error_clear_last(); - $safeResult = \symlink($target, $link); - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } -} - - -/** - * Creates a file with a unique filename, with access permission set to 0600, in the specified directory. - * If the directory does not exist or is not writable, tempnam may - * generate a file in the system's temporary directory, and return - * the full path to that file, including its name. - * - * @param string $directory The directory where the temporary filename will be created. - * @param string $prefix The prefix of the generated temporary filename. - * @return string Returns the new temporary filename (with path). - * @throws FilesystemException - * - */ -function tempnam(string $directory, string $prefix): string -{ - error_clear_last(); - $safeResult = \tempnam($directory, $prefix); - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Creates a temporary file with a unique name in read-write-binary (w+b) mode and - * returns a file handle. - * - * The file is automatically removed when closed (for example, by calling - * fclose, or when there are no remaining references to - * the file handle returned by tmpfile), or when the - * script ends. - * - * @return resource|false Returns a file handle, similar to the one returned by - * fopen, for the new file. - * @throws FilesystemException - * - */ -function tmpfile() -{ - error_clear_last(); - $safeResult = \tmpfile(); - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Attempts to set the access and modification times of the file named in the - * filename parameter to the value given in - * mtime. - * 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 $mtime The touch time. If mtime is NULL, - * the current system time is used. - * @param int $atime If not NULL, the access time of the given filename is set to - * the value of atime. Otherwise, it is set to - * the value passed to the mtime parameter. - * If both are NULL, the current system time is used. - * @throws FilesystemException - * - */ -function touch(string $filename, ?int $mtime = null, ?int $atime = null): void -{ - error_clear_last(); - if ($atime !== null) { - $safeResult = \touch($filename, $mtime, $atime); - } elseif ($mtime !== null) { - $safeResult = \touch($filename, $mtime); - } else { - $safeResult = \touch($filename); - } - if ($safeResult === false) { - throw 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. - * - * If the file is a symlink, the symlink will be deleted. On Windows, to delete - * a symlink to a directory, rmdir has to be used instead. - * @param resource $context A context stream - * resource. - * @throws FilesystemException - * - */ -function unlink(string $filename, $context = null): void -{ - error_clear_last(); - if ($context !== null) { - $safeResult = \unlink($filename, $context); - } else { - $safeResult = \unlink($filename); - } - if ($safeResult === false) { - throw FilesystemException::createFromPhpError(); - } +if (strpos(PHP_VERSION, "8.5.") === 0) { + require_once __DIR__ . '/8.5/filesystem.php'; } diff --git a/generated/filter.php b/generated/filter.php index 3963e269..98cebb34 100644 --- a/generated/filter.php +++ b/generated/filter.php @@ -1,48 +1,17 @@ - * - * - * - * channels will be 3 for RGB pictures and 4 for CMYK - * pictures. - * - * bits is the number of bits for each color. - * - * For some image types, the presence of channels and - * bits values can be a bit - * confusing. As an example, GIF always uses 3 channels - * per pixel, but the number of bits per pixel cannot be calculated for an - * animated GIF with a global color table. - * - * On failure, FALSE is returned. - * @throws ImageException - * - */ -function getimagesize(string $filename, ?array &$image_info = null): ?array -{ - error_clear_last(); - $safeResult = \getimagesize($filename, $image_info); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Returns the extension for the given IMAGETYPE_* - * constant. - * - * @param int $image_type One of the IMAGETYPE_* constant. - * @param bool $include_dot Whether to prepend a dot to the extension or not. Default to TRUE. - * @return string A string with the extension corresponding to the given image type. - * @throws ImageException - * - */ -function image_type_to_extension(int $image_type, bool $include_dot = true): string -{ - error_clear_last(); - $safeResult = \image_type_to_extension($image_type, $include_dot); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * image2wbmp 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 string|null $filename Path to the saved file. If not given, the raw image stream will be - * output 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 ImageException - * - */ -function image2wbmp($image, ?string $filename = null, ?int $foreground = null): void -{ - error_clear_last(); - if ($foreground !== null) { - $safeResult = \image2wbmp($image, $filename, $foreground); - } elseif ($filename !== null) { - $safeResult = \image2wbmp($image, $filename); - } else { - $safeResult = \image2wbmp($image); - } - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param array $affine Array with keys 0 to 5. - * @param array $clip Array with keys "x", "y", "width" and "height"; or NULL. - * @return resource Return affined image object on success. - * @throws ImageException - * - */ -function imageaffine($image, array $affine, ?array $clip = null) -{ - error_clear_last(); - if ($clip !== null) { - $safeResult = \imageaffine($image, $affine, $clip); - } else { - $safeResult = \imageaffine($image, $affine); - } - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Returns the concatenation of two affine transformation matrices, - * what is useful if multiple transformations should be applied to the same - * image in one go. - * - * @param array $matrix1 An affine transformation matrix (an array with keys - * 0 to 5 and float values). - * @param array $matrix2 An affine transformation matrix (an array with keys - * 0 to 5 and float values). - * @return array{0:float,1:float,2:float,3:float,4:float,5:float} An affine transformation matrix (an array with keys - * 0 to 5 and float values). - * @throws ImageException - * - */ -function imageaffinematrixconcat(array $matrix1, array $matrix2): array -{ - error_clear_last(); - $safeResult = \imageaffinematrixconcat($matrix1, $matrix2); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Returns an affine transformation matrix. - * - * @param int $type One of the IMG_AFFINE_* constants. - * @param array|float $options If type is IMG_AFFINE_TRANSLATE - * or IMG_AFFINE_SCALE, - * options has to be an array with keys x - * and y, both having float values. - * - * If type is IMG_AFFINE_ROTATE, - * IMG_AFFINE_SHEAR_HORIZONTAL or IMG_AFFINE_SHEAR_VERTICAL, - * options has to be a float specifying the angle. - * @return array{0:float,1:float,2:float,3:float,4:float,5:float} An affine transformation matrix (an array with keys - * 0 to 5 and float values). - * @throws ImageException - * - */ -function imageaffinematrixget(int $type, $options): array -{ - error_clear_last(); - $safeResult = \imageaffinematrixget($type, $options); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * imagealphablending allows for two different - * modes of drawing on truecolor images. In blending mode, the - * alpha channel component of the color supplied to all drawing function, - * such as imagesetpixel determines how much of the - * underlying color should be allowed to shine through. As a result, gd - * automatically blends the existing color at that point with the drawing color, - * and stores the result in the image. The resulting pixel is opaque. In - * non-blending mode, the drawing color is copied literally with its alpha channel - * information, replacing the destination pixel. Blending mode is not available - * when drawing on palette images. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param bool $enable Whether to enable the blending mode or not. On true color images - * the default value is TRUE otherwise the default value is FALSE - * @throws ImageException - * - */ -function imagealphablending($image, bool $enable): void -{ - error_clear_last(); - $safeResult = \imagealphablending($image, $enable); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Activate the fast drawing antialiased methods for lines and wired polygons. - * It does not support alpha components. It works using a direct blend - * operation. It works only with truecolor images. - * - * Thickness and styled are not supported. - * - * Using antialiased primitives with transparent background color can end with - * some unexpected results. The blend method uses the background color as any - * other colors. The lack of alpha component support does not allow an alpha - * based antialiasing method. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param bool $enable Whether to enable antialiasing or not. - * @throws ImageException - * - */ -function imageantialias($image, bool $enable): void -{ - error_clear_last(); - $safeResult = \imageantialias($image, $enable); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagearc draws an arc of circle centered at the given - * coordinates. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $center_x x-coordinate of the center. - * @param int $center_y y-coordinate of the center. - * @param int $width The arc width. - * @param int $height The arc height. - * @param int $start_angle The arc start angle, in degrees. - * @param int $end_angle The arc end angle, in degrees. - * 0° is located at the three-o'clock position, and the arc is drawn - * clockwise. - * @param int $color A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imagearc($image, int $center_x, int $center_y, int $width, int $height, int $start_angle, int $end_angle, int $color): void -{ - error_clear_last(); - $safeResult = \imagearc($image, $center_x, $center_y, $width, $height, $start_angle, $end_angle, $color); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Outputs or saves a AVIF Raster image from the given image. - * - * @param \GdImage $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. - * @param int $quality quality is optional, and ranges from 0 (worst quality, smaller file) - * to 100 (best quality, larger file). - * If -1 is provided, the default value 30 is used. - * @param int $speed speed is optional, and ranges from 0 (slow, smaller file) - * to 10 (fast, larger file). - * If -1 is provided, the default value 6 is used. - * @throws ImageException - * - */ -function imageavif(\GdImage $image, $file = null, int $quality = -1, int $speed = -1): void -{ - error_clear_last(); - if ($speed !== -1) { - $safeResult = \imageavif($image, $file, $quality, $speed); - } elseif ($quality !== -1) { - $safeResult = \imageavif($image, $file, $quality); - } elseif ($file !== null) { - $safeResult = \imageavif($image, $file); - } else { - $safeResult = \imageavif($image); - } - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Outputs or saves a BMP version of the given image. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. - * - * NULL is invalid if the compressed arguments is - * not used. - * @param bool $compressed Whether the BMP should be compressed with run-length encoding (RLE), or not. - * @throws ImageException - * - */ -function imagebmp($image, $file = null, bool $compressed = true): void -{ - error_clear_last(); - if ($compressed !== true) { - $safeResult = \imagebmp($image, $file, $compressed); - } elseif ($file !== null) { - $safeResult = \imagebmp($image, $file); - } else { - $safeResult = \imagebmp($image); - } - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagechar draws the first character of - * char in the image identified by - * image with its upper-left at - * x,y (top left is 0, - * 0) with the color color. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $font Can be 1, 2, 3, 4, 5 for built-in - * fonts in latin2 encoding (where higher numbers corresponding to larger fonts) or GdFont instance, - * returned by imageloadfont. - * @param int $x x-coordinate of the start. - * @param int $y y-coordinate of the start. - * @param string $char The character to draw. - * @param int $color A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imagechar($image, int $font, int $x, int $y, string $char, int $color): void -{ - error_clear_last(); - $safeResult = \imagechar($image, $font, $x, $y, $char, $color); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Draws the character char vertically at the specified - * coordinate on the given image. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $font Can be 1, 2, 3, 4, 5 for built-in - * fonts in latin2 encoding (where higher numbers corresponding to larger fonts) or GdFont instance, - * returned by imageloadfont. - * @param int $x x-coordinate of the start. - * @param int $y y-coordinate of the start. - * @param string $char The character to draw. - * @param int $color A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imagecharup($image, int $font, int $x, int $y, string $char, int $color): void -{ - error_clear_last(); - $safeResult = \imagecharup($image, $font, $x, $y, $char, $color); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Returns the index of the color of the pixel at the - * specified location in the image specified by image. - * - * If the image is a - * truecolor image, this function returns the RGB value of that pixel as - * integer. Use bitshifting and masking to access the distinct red, green and blue - * component values: - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $x x-coordinate of the point. - * @param int $y y-coordinate of the point. - * @return int Returns the index of the color. - * @throws ImageException - * - */ -function imagecolorat($image, int $x, int $y): int -{ - error_clear_last(); - $safeResult = \imagecolorat($image, $x, $y); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * De-allocates a color previously allocated with - * imagecolorallocate or - * imagecolorallocatealpha. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $color The color identifier. - * @throws ImageException - * - */ -function imagecolordeallocate($image, int $color): void -{ - error_clear_last(); - $safeResult = \imagecolordeallocate($image, $color); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Makes the colors of the palette version of an image more closely match the true color version. - * - * @param resource $image1 A truecolor image object. - * @param resource $image2 A palette image object pointing to an image that has the same - * size as image1. - * @throws ImageException - * - */ -function imagecolormatch($image1, $image2): void -{ - error_clear_last(); - $safeResult = \imagecolormatch($image1, $image2); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * This sets the specified index in the palette to the specified - * color. This is useful for creating flood-fill-like effects in - * palleted images without the overhead of performing the actual - * flood-fill. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $color An index in the palette. - * @param int $red Value of red component. - * @param int $green Value of green component. - * @param int $blue Value of blue component. - * @param int $alpha Value of alpha component. - * @throws ImageException - * - */ -function imagecolorset($image, int $color, int $red, int $green, int $blue, int $alpha = 0): void -{ - error_clear_last(); - $safeResult = \imagecolorset($image, $color, $red, $green, $blue, $alpha); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Applies a convolution matrix on the image, using the given coefficient and - * offset. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param array $matrix A 3x3 matrix: an array of three arrays of three floats. - * @param float $divisor The divisor of the result of the convolution, used for normalization. - * @param float $offset Color offset. - * @throws ImageException - * - */ -function imageconvolution($image, array $matrix, float $divisor, float $offset): void -{ - error_clear_last(); - $safeResult = \imageconvolution($image, $matrix, $divisor, $offset); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Copy a part of src_image onto - * dst_image starting at the x,y coordinates - * src_x, src_y with - * a width of src_width and a height of - * src_height. The portion defined will be copied - * onto the x,y coordinates, dst_x and - * dst_y. - * - * @param resource $dst_image Destination image resource. - * @param resource $src_image Source image resource. - * @param int $dst_x x-coordinate of destination point. - * @param int $dst_y y-coordinate of destination point. - * @param int $src_x x-coordinate of source point. - * @param int $src_y y-coordinate of source point. - * @param int $src_width Source width. - * @param int $src_height Source height. - * @throws ImageException - * - */ -function imagecopy($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height): void -{ - error_clear_last(); - $safeResult = \imagecopy($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $src_width, $src_height); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Copy a part of src_image onto - * dst_image starting at the x,y coordinates - * src_x, src_y with - * a width of src_width and a height of - * src_height. The portion defined will be copied - * onto the x,y coordinates, dst_x and - * dst_y. - * - * @param resource $dst_image Destination image resource. - * @param resource $src_image Source image resource. - * @param int $dst_x x-coordinate of destination point. - * @param int $dst_y y-coordinate of destination point. - * @param int $src_x x-coordinate of source point. - * @param int $src_y y-coordinate of source point. - * @param int $src_width Source width. - * @param int $src_height Source height. - * @param int $pct The two images will be merged according to pct - * which can range from 0 to 100. When pct = 0, - * no action is taken, when 100 this function behaves identically - * to imagecopy for pallete images, except for - * ignoring alpha components, while it implements alpha transparency - * for true colour images. - * @throws ImageException - * - */ -function imagecopymerge($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height, int $pct): void -{ - error_clear_last(); - $safeResult = \imagecopymerge($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $src_width, $src_height, $pct); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagecopymergegray copy a part of src_image onto - * dst_image starting at the x,y coordinates - * src_x, src_y with - * a width of src_width and a height of - * src_height. The portion defined will be copied - * onto the x,y coordinates, dst_x and - * dst_y. - * - * This function is identical to imagecopymerge except - * that when merging it preserves the hue of the source by converting - * the destination pixels to gray scale before the copy operation. - * - * @param resource $dst_image Destination image resource. - * @param resource $src_image Source image resource. - * @param int $dst_x x-coordinate of destination point. - * @param int $dst_y y-coordinate of destination point. - * @param int $src_x x-coordinate of source point. - * @param int $src_y y-coordinate of source point. - * @param int $src_width Source width. - * @param int $src_height Source height. - * @param int $pct The src_image will be changed to grayscale according - * to pct where 0 is fully grayscale and 100 is - * unchanged. When pct = 100 this function behaves - * identically to imagecopy for pallete images, except for - * ignoring alpha components, while - * it implements alpha transparency for true colour images. - * @throws ImageException - * - */ -function imagecopymergegray($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height, int $pct): void -{ - error_clear_last(); - $safeResult = \imagecopymergegray($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $src_width, $src_height, $pct); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagecopyresampled copies a rectangular - * portion of one image to another image, smoothly interpolating pixel - * values so that, in particular, reducing the size of an image still - * retains a great deal of clarity. - * - * In other words, imagecopyresampled will take a - * rectangular area from src_image of width - * src_width and height src_height at - * position (src_x,src_y) - * and place it in a rectangular area of dst_image - * of width dst_width and height dst_height - * at position (dst_x,dst_y). - * - * If the source and destination coordinates and width and heights - * differ, appropriate stretching or shrinking of the image fragment - * will be performed. The coordinates refer to the upper left - * corner. This function can be used to copy regions within the - * same image (if dst_image is the same as - * src_image) but if the regions overlap the - * results will be unpredictable. - * - * @param resource $dst_image Destination image resource. - * @param resource $src_image Source image resource. - * @param int $dst_x x-coordinate of destination point. - * @param int $dst_y y-coordinate of destination point. - * @param int $src_x x-coordinate of source point. - * @param int $src_y y-coordinate of source point. - * @param int $dst_width Destination width. - * @param int $dst_height Destination height. - * @param int $src_width Source width. - * @param int $src_height Source height. - * @throws ImageException - * - */ -function imagecopyresampled($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_width, int $dst_height, int $src_width, int $src_height): void -{ - error_clear_last(); - $safeResult = \imagecopyresampled($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_width, $dst_height, $src_width, $src_height); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } +if (strpos(PHP_VERSION, "8.1.") === 0) { + require_once __DIR__ . '/8.1/image.php'; } - - -/** - * imagecopyresized copies a rectangular - * portion of one image to another image. - * dst_image is the destination image, - * src_image is the source image identifier. - * - * In other words, imagecopyresized will take a - * rectangular area from src_image of width - * src_width and height src_height at - * position (src_x,src_y) - * and place it in a rectangular area of dst_image - * of width dst_width and height dst_height - * at position (dst_x,dst_y). - * - * If the source and destination coordinates and width and heights - * differ, appropriate stretching or shrinking of the image fragment - * will be performed. The coordinates refer to the upper left - * corner. This function can be used to copy regions within the - * same image (if dst_image is the same as - * src_image) but if the regions overlap the - * results will be unpredictable. - * - * @param resource $dst_image Destination image resource. - * @param resource $src_image Source image resource. - * @param int $dst_x x-coordinate of destination point. - * @param int $dst_y y-coordinate of destination point. - * @param int $src_x x-coordinate of source point. - * @param int $src_y y-coordinate of source point. - * @param int $dst_width Destination width. - * @param int $dst_height Destination height. - * @param int $src_width Source width. - * @param int $src_height Source height. - * @throws ImageException - * - */ -function imagecopyresized($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_width, int $dst_height, int $src_width, int $src_height): void -{ - error_clear_last(); - $safeResult = \imagecopyresized($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_width, $dst_height, $src_width, $src_height); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } +if (strpos(PHP_VERSION, "8.2.") === 0) { + require_once __DIR__ . '/8.2/image.php'; } - - -/** - * imagecreate returns an image identifier - * representing a blank image of specified size. - * - * In general, we recommend the use of - * imagecreatetruecolor instead of - * imagecreate so that image processing occurs on the - * highest quality image possible. If you want to output a palette image, then - * imagetruecolortopalette should be called immediately - * before saving the image with imagepng or - * imagegif. - * - * @param int $width The image width. - * @param int $height The image height. - * @return resource|false Returns an image object on success, FALSE on errors. - * @throws ImageException - * - */ -function imagecreate(int $width, int $height) -{ - error_clear_last(); - $safeResult = \imagecreate($width, $height); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; +if (strpos(PHP_VERSION, "8.3.") === 0) { + require_once __DIR__ . '/8.3/image.php'; } - - -/** - * imagecreatefromavif returns an image object - * representing the image obtained from the given filename. - * - * @param string $filename Path to the AVIF raster image. - * @return Returns an image object on success, FALSE on errors. - * @throws ImageException - * - */ -function imagecreatefromavif(string $filename): void -{ - error_clear_last(); - $safeResult = \imagecreatefromavif($filename); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagecreatefrombmp returns an image identifier - * representing the image obtained from the given filename. - * - * @param string $filename Path to the BMP image. - * @return resource Returns an image object on success, FALSE on errors. - * @throws ImageException - * - */ -function imagecreatefrombmp(string $filename) -{ - error_clear_last(); - $safeResult = \imagecreatefrombmp($filename); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Create a new image from GD file or URL. - * - * @param string $filename Path to the GD file. - * @return resource Returns an image object on success, FALSE on errors. - * @throws ImageException - * - */ -function imagecreatefromgd(string $filename) -{ - error_clear_last(); - $safeResult = \imagecreatefromgd($filename); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Create a new image from GD2 file or URL. - * - * @param string $filename Path to the GD2 image. - * @return resource Returns an image object on success, FALSE on errors. - * @throws ImageException - * - */ -function imagecreatefromgd2(string $filename) -{ - error_clear_last(); - $safeResult = \imagecreatefromgd2($filename); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Create a new image from a given part of GD2 file or URL. - * - * @param string $filename Path to the GD2 image. - * @param int $x x-coordinate of source point. - * @param int $y y-coordinate of source point. - * @param int $width Source width. - * @param int $height Source height. - * @return resource Returns an image object on success, FALSE on errors. - * @throws ImageException - * - */ -function imagecreatefromgd2part(string $filename, int $x, int $y, int $width, int $height) -{ - error_clear_last(); - $safeResult = \imagecreatefromgd2part($filename, $x, $y, $width, $height); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * imagecreatefromgif returns an image identifier - * representing the image obtained from the given filename. - * - * @param string $filename Path to the GIF image. - * @return resource Returns an image object on success, FALSE on errors. - * @throws ImageException - * - */ -function imagecreatefromgif(string $filename) -{ - error_clear_last(); - $safeResult = \imagecreatefromgif($filename); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * imagecreatefromjpeg returns an image identifier - * representing the image obtained from the given filename. - * - * @param string $filename Path to the JPEG image. - * @return resource Returns an image object on success, FALSE on errors. - * @throws ImageException - * - */ -function imagecreatefromjpeg(string $filename) -{ - error_clear_last(); - $safeResult = \imagecreatefromjpeg($filename); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * imagecreatefrompng returns an image identifier - * representing the image obtained from the given filename. - * - * @param string $filename Path to the PNG image. - * @return resource Returns an image object on success, FALSE on errors. - * @throws ImageException - * - */ -function imagecreatefrompng(string $filename) -{ - error_clear_last(); - $safeResult = \imagecreatefrompng($filename); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * imagecreatefromstring returns an image identifier - * representing the image obtained from the given data. - * These types will be automatically detected if your build of PHP supports - * them: JPEG, PNG, GIF, BMP, WBMP, GD2, WEBP and AVIF. - * - * @param string $data A string containing the image data. - * @return resource An image object will be returned on success. FALSE is returned if - * the image type is unsupported, the data is not in a recognised format, - * or the image is corrupt and cannot be loaded. - * @throws ImageException - * - */ -function imagecreatefromstring(string $data) -{ - error_clear_last(); - $safeResult = \imagecreatefromstring($data); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * imagecreatefromtga returns an image object - * representing the image obtained from the given filename. - * - * @param string $filename Path to the Truevision TGA image. - * @return Returns an image object on success, FALSE on errors. - * @throws ImageException - * - */ -function imagecreatefromtga(string $filename): void -{ - error_clear_last(); - $safeResult = \imagecreatefromtga($filename); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } +if (strpos(PHP_VERSION, "8.4.") === 0) { + require_once __DIR__ . '/8.4/image.php'; } - - -/** - * imagecreatefromwbmp returns an image identifier - * representing the image obtained from the given filename. - * - * @param string $filename Path to the WBMP image. - * @return resource Returns an image object on success, FALSE on errors. - * @throws ImageException - * - */ -function imagecreatefromwbmp(string $filename) -{ - error_clear_last(); - $safeResult = \imagecreatefromwbmp($filename); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * imagecreatefromwebp returns an image identifier - * representing the image obtained from the given filename. - * Note that animated WebP files cannot be read. - * - * @param string $filename Path to the WebP image. - * @return resource Returns an image object on success, FALSE on errors. - * @throws ImageException - * - */ -function imagecreatefromwebp(string $filename) -{ - error_clear_last(); - $safeResult = \imagecreatefromwebp($filename); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * imagecreatefromxbm returns an image identifier - * representing the image obtained from the given filename. - * - * @param string $filename Path to the XBM image. - * @return resource Returns an image object on success, FALSE on errors. - * @throws ImageException - * - */ -function imagecreatefromxbm(string $filename) -{ - error_clear_last(); - $safeResult = \imagecreatefromxbm($filename); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * imagecreatefromxpm returns an image identifier - * representing the image obtained from the given filename. - * - * @param string $filename Path to the XPM image. - * @return resource Returns an image object on success, FALSE on errors. - * @throws ImageException - * - */ -function imagecreatefromxpm(string $filename) -{ - error_clear_last(); - $safeResult = \imagecreatefromxpm($filename); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * imagecreatetruecolor returns an image object - * representing a black image of the specified size. - * - * @param int $width Image width. - * @param int $height Image height. - * @return resource|false Returns an image object on success, FALSE on errors. - * @throws ImageException - * - */ -function imagecreatetruecolor(int $width, int $height) -{ - error_clear_last(); - $safeResult = \imagecreatetruecolor($width, $height); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Crops an image to the given rectangular area and returns the resulting image. - * The given image is not modified. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param array $rectangle The cropping rectangle as array with keys - * x, y, width and - * height. - * @return resource Return cropped image object on success. - * @throws ImageException - * - */ -function imagecrop($image, array $rectangle) -{ - error_clear_last(); - $safeResult = \imagecrop($image, $rectangle); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Automatically crops an image according to the given - * mode. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $mode One of the following constants: - * @param float $threshold - * @param int $color - * @return resource Returns a cropped image object on success. - * FALSE is also returned if the whole image was cropped. - * @throws ImageException - * - */ -function imagecropauto($image, int $mode = IMG_CROP_DEFAULT, float $threshold = 0.5, int $color = -1) -{ - error_clear_last(); - $safeResult = \imagecropauto($image, $mode, $threshold, $color); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * This function is deprecated. Use combination of - * imagesetstyle and imageline - * instead. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $x1 Upper left x coordinate. - * @param int $y1 Upper left y coordinate 0, 0 is the top left corner of the image. - * @param int $x2 Bottom right x coordinate. - * @param int $y2 Bottom right y coordinate. - * @param int $color The fill color. A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imagedashedline($image, int $x1, int $y1, int $x2, int $y2, int $color): void -{ - error_clear_last(); - $safeResult = \imagedashedline($image, $x1, $y1, $x2, $y2, $color); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Prior to PHP 8.0.0, imagedestroy freed any memory associated - * with image image. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @throws ImageException - * - */ -function imagedestroy($image): void -{ - error_clear_last(); - $safeResult = \imagedestroy($image); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Draws an ellipse centered at the specified coordinates. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $center_x x-coordinate of the center. - * @param int $center_y y-coordinate of the center. - * @param int $width The ellipse width. - * @param int $height The ellipse height. - * @param int $color The color of the ellipse. A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imageellipse($image, int $center_x, int $center_y, int $width, int $height, int $color): void -{ - error_clear_last(); - $safeResult = \imageellipse($image, $center_x, $center_y, $width, $height, $color); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Performs a flood fill starting at the given coordinate (top left is 0, 0) - * with the given color in the - * image. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $x x-coordinate of start point. - * @param int $y y-coordinate of start point. - * @param int $color The fill color. A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imagefill($image, int $x, int $y, int $color): void -{ - error_clear_last(); - $safeResult = \imagefill($image, $x, $y, $color); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Draws a partial arc centered at the specified coordinate in the - * given image. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $center_x x-coordinate of the center. - * @param int $center_y y-coordinate of the center. - * @param int $width The arc width. - * @param int $height The arc height. - * @param int $start_angle The arc start angle, in degrees. - * @param int $end_angle The arc end angle, in degrees. - * 0° is located at the three-o'clock position, and the arc is drawn - * clockwise. - * @param int $color A color identifier created with imagecolorallocate. - * @param int $style A bitwise OR of the following possibilities: - * - * IMG_ARC_PIE - * IMG_ARC_CHORD - * IMG_ARC_NOFILL - * IMG_ARC_EDGED - * - * IMG_ARC_PIE and IMG_ARC_CHORD are - * mutually exclusive; IMG_ARC_CHORD just - * connects the starting and ending angles with a straight line, while - * IMG_ARC_PIE produces a rounded edge. - * IMG_ARC_NOFILL indicates that the arc - * or chord should be outlined, not filled. IMG_ARC_EDGED, - * used together with IMG_ARC_NOFILL, indicates that the - * beginning and ending angles should be connected to the center - this is a - * good way to outline (rather than fill) a 'pie slice'. - * @throws ImageException - * - */ -function imagefilledarc($image, int $center_x, int $center_y, int $width, int $height, int $start_angle, int $end_angle, int $color, int $style): void -{ - error_clear_last(); - $safeResult = \imagefilledarc($image, $center_x, $center_y, $width, $height, $start_angle, $end_angle, $color, $style); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Draws an ellipse centered at the specified coordinate on the given - * image. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $center_x x-coordinate of the center. - * @param int $center_y y-coordinate of the center. - * @param int $width The ellipse width. - * @param int $height The ellipse height. - * @param int $color The fill color. A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imagefilledellipse($image, int $center_x, int $center_y, int $width, int $height, int $color): void -{ - error_clear_last(); - $safeResult = \imagefilledellipse($image, $center_x, $center_y, $width, $height, $color); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Creates a rectangle filled with color in the given - * image starting at point 1 and ending at point 2. - * 0, 0 is the top left corner of the image. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $x1 x-coordinate for point 1. - * @param int $y1 y-coordinate for point 1. - * @param int $x2 x-coordinate for point 2. - * @param int $y2 y-coordinate for point 2. - * @param int $color The fill color. A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imagefilledrectangle($image, int $x1, int $y1, int $x2, int $y2, int $color): void -{ - error_clear_last(); - $safeResult = \imagefilledrectangle($image, $x1, $y1, $x2, $y2, $color); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagefilltoborder performs a flood fill - * whose border color is defined by border_color. - * The starting point for the fill is x, - * y (top left is 0, 0) and the region is - * filled with color color. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $x x-coordinate of start. - * @param int $y y-coordinate of start. - * @param int $border_color The border color. A color identifier created with imagecolorallocate. - * @param int $color The fill color. A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imagefilltoborder($image, int $x, int $y, int $border_color, int $color): void -{ - error_clear_last(); - $safeResult = \imagefilltoborder($image, $x, $y, $border_color, $color); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagefilter applies the given filter - * filter on the image. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $filter filter can be one of the following: - * - * - * - * IMG_FILTER_NEGATE: Reverses all colors of - * the image. - * - * - * - * - * IMG_FILTER_GRAYSCALE: Converts the image into - * grayscale by changing the red, green and blue components to their - * weighted sum using the same coefficients as the REC.601 luma (Y') - * calculation. The alpha components are retained. For palette images the - * result may differ due to palette limitations. - * - * - * - * - * IMG_FILTER_BRIGHTNESS: Changes the brightness - * of the image. Use args to set the level of - * brightness. The range for the brightness is -255 to 255. - * - * - * - * - * IMG_FILTER_CONTRAST: Changes the contrast of - * the image. Use args to set the level of - * contrast. - * - * - * - * - * IMG_FILTER_COLORIZE: Like - * IMG_FILTER_GRAYSCALE, except you can specify the - * color. Use args, arg2 and - * arg3 in the form of - * red, green, - * blue and arg4 for the - * alpha channel. The range for each color is 0 to 255. - * - * - * - * - * IMG_FILTER_EDGEDETECT: Uses edge detection to - * highlight the edges in the image. - * - * - * - * - * IMG_FILTER_EMBOSS: Embosses the image. - * - * - * - * - * IMG_FILTER_GAUSSIAN_BLUR: Blurs the image using - * the Gaussian method. - * - * - * - * - * IMG_FILTER_SELECTIVE_BLUR: Blurs the image. - * - * - * - * - * IMG_FILTER_MEAN_REMOVAL: Uses mean removal to - * achieve a "sketchy" effect. - * - * - * - * - * IMG_FILTER_SMOOTH: Makes the image smoother. - * Use args to set the level of smoothness. - * - * - * - * - * IMG_FILTER_PIXELATE: Applies pixelation effect - * to the image, use args to set the block size - * and arg2 to set the pixelation effect mode. - * - * - * - * - * IMG_FILTER_SCATTER: Applies scatter effect - * to the image, use args and - * arg2 to define the effect strength and - * additionally arg3 to only apply the - * on select pixel colors. - * - * - * - * @param int $args - * - * - * IMG_FILTER_BRIGHTNESS: Brightness level. - * - * - * - * - * IMG_FILTER_CONTRAST: Contrast level. - * - * - * - * - * IMG_FILTER_COLORIZE: Value of red component. - * - * - * - * - * IMG_FILTER_SMOOTH: Smoothness level. - * - * - * - * - * IMG_FILTER_PIXELATE: Block size in pixels. - * - * - * - * - * IMG_FILTER_SCATTER: Effect substraction level. - * This must not be higher or equal to the addition level set with - * arg2. - * - * - * - * @throws ImageException - * - */ -function imagefilter($image, int $filter, int ...$args): void -{ - error_clear_last(); - if ($args !== []) { - $safeResult = \imagefilter($image, $filter, ...$args); - } else { - $safeResult = \imagefilter($image, $filter); - } - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Flips the image image using the given - * mode. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $mode Flip mode, this can be one of the IMG_FLIP_* constants: - * - * - * - * - * - * Constant - * Meaning - * - * - * - * - * IMG_FLIP_HORIZONTAL - * - * Flips the image horizontally. - * - * - * - * IMG_FLIP_VERTICAL - * - * Flips the image vertically. - * - * - * - * IMG_FLIP_BOTH - * - * Flips the image both horizontally and vertically. - * - * - * - * - * - * @throws ImageException - * - */ -function imageflip($image, int $mode): void -{ - error_clear_last(); - $safeResult = \imageflip($image, $mode); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * This function calculates and returns the bounding box in pixels - * for a FreeType text. - * - * @param float $size The font size in points. - * @param float $angle Angle in degrees in which string will be - * measured. - * @param string $font_filename The name of the TrueType font file (can be a URL). Depending on - * which version of the GD library that PHP is using, it may attempt to - * search for files that do not begin with a leading '/' by appending - * '.ttf' to the filename and searching along a library-defined font path. - * @param string $string The string to be measured. - * @param array $options - * Possible array indexes for options - * - * - * - * Key - * Type - * Meaning - * - * - * - * - * linespacing - * float - * Defines drawing linespacing - * - * - * - * - * @return array imageftbbox returns an array with 8 - * elements representing four points making the bounding box of the - * text: - * - * - * - * - * 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. - * - * On failure, FALSE is returned. - * @throws ImageException - * - */ -function imageftbbox(float $size, float $angle, string $font_filename, string $string, array $options = []): array -{ - error_clear_last(); - $safeResult = \imageftbbox($size, $angle, $font_filename, $string, $options); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param float $size The font size to use 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 index of the desired color for the text, see - * imagecolorexact. - * @param string $font_filename The path to the TrueType font you wish to use. - * - * Depending on which version of the GD library PHP is using, when - * font_filename 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. - * - * In many cases where a font resides in the same directory as the script using it - * the following trick will alleviate any include problems. - * - * - * ]]> - * - * @param string $text Text to be inserted into image. - * @param array $options - * Possible array indexes for options - * - * - * - * Key - * Type - * Meaning - * - * - * - * - * linespacing - * float - * Defines drawing linespacing - * - * - * - * - * @return array This function returns an array defining the four points of the box, starting in the lower left and moving counter-clockwise: - * - * - * - * - * 0 - * lower left x-coordinate - * - * - * 1 - * lower left y-coordinate - * - * - * 2 - * lower right x-coordinate - * - * - * 3 - * lower right y-coordinate - * - * - * 4 - * upper right x-coordinate - * - * - * 5 - * upper right y-coordinate - * - * - * 6 - * upper left x-coordinate - * - * - * 7 - * upper left y-coordinate - * - * - * - * - * - * On failure, FALSE is returned. - * @throws ImageException - * - */ -function imagefttext($image, float $size, float $angle, int $x, int $y, int $color, string $font_filename, string $text, array $options = []): array -{ - error_clear_last(); - $safeResult = \imagefttext($image, $size, $angle, $x, $y, $color, $font_filename, $text, $options); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Applies gamma correction to the given gd image - * given an input and an output gamma. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param float $input_gamma The input gamma. - * @param float $output_gamma The output gamma. - * @throws ImageException - * - */ -function imagegammacorrect($image, float $input_gamma, float $output_gamma): void -{ - error_clear_last(); - $safeResult = \imagegammacorrect($image, $input_gamma, $output_gamma); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Outputs a GD image to the given file. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. - * @throws ImageException - * - */ -function imagegd($image, $file = null): void -{ - error_clear_last(); - if ($file !== null) { - $safeResult = \imagegd($image, $file); - } else { - $safeResult = \imagegd($image); - } - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Outputs a GD2 image to the given file. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. - * @param int $chunk_size Chunk size. - * @param int $mode Either IMG_GD2_RAW or - * IMG_GD2_COMPRESSED. Default is - * IMG_GD2_RAW. - * @throws ImageException - * - */ -function imagegd2($image, $file = null, int $chunk_size = 128, int $mode = IMG_GD2_RAW): void -{ - error_clear_last(); - if ($mode !== IMG_GD2_RAW) { - $safeResult = \imagegd2($image, $file, $chunk_size, $mode); - } elseif ($chunk_size !== 128) { - $safeResult = \imagegd2($image, $file, $chunk_size); - } elseif ($file !== null) { - $safeResult = \imagegd2($image, $file); - } else { - $safeResult = \imagegd2($image); - } - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagegif creates the GIF - * file in file from the image image. The - * image argument is the return from the - * imagecreate or imagecreatefrom* - * function. - * - * The image format will be GIF87a unless the - * image has been made transparent with - * imagecolortransparent, in which case the - * image format will be GIF89a. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. - * @throws ImageException - * - */ -function imagegif($image, $file = null): void -{ - error_clear_last(); - if ($file !== null) { - $safeResult = \imagegif($image, $file); - } else { - $safeResult = \imagegif($image); - } - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Grabs a screenshot of the whole screen. - * - * @return resource Returns an image object on success, FALSE on failure. - * @throws ImageException - * - */ -function imagegrabscreen() -{ - error_clear_last(); - $safeResult = \imagegrabscreen(); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Grabs a window or its client area using a windows handle (HWND property in COM instance) - * - * @param int $handle The HWND window ID. - * @param bool $client_area Include the client area of the application window. - * @return \GdImage Returns an image object on success, FALSE on failure. - * @throws ImageException - * - */ -function imagegrabwindow(int $handle, bool $client_area = false): \GdImage -{ - error_clear_last(); - $safeResult = \imagegrabwindow($handle, $client_area); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * imagejpeg creates a JPEG file from - * the given image. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. - * @param int $quality quality is optional, and ranges from 0 (worst - * quality, smaller file) to 100 (best quality, biggest file). The - * default (-1) uses the default IJG quality value (about 75). - * @throws ImageException - * - */ -function imagejpeg($image, $file = null, int $quality = -1): void -{ - error_clear_last(); - if ($quality !== -1) { - $safeResult = \imagejpeg($image, $file, $quality); - } elseif ($file !== null) { - $safeResult = \imagejpeg($image, $file); - } else { - $safeResult = \imagejpeg($image); - } - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Set the alpha blending flag to use layering effects. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $effect One of the following constants: - * - * - * IMG_EFFECT_REPLACE - * - * - * Use pixel replacement (equivalent of passing TRUE to - * imagealphablending) - * - * - * - * - * IMG_EFFECT_ALPHABLEND - * - * - * Use normal pixel blending (equivalent of passing FALSE to - * imagealphablending) - * - * - * - * - * IMG_EFFECT_NORMAL - * - * - * Same as IMG_EFFECT_ALPHABLEND. - * - * - * - * - * IMG_EFFECT_OVERLAY - * - * - * Overlay has the effect that black background pixels will remain - * black, white background pixels will remain white, but grey - * background pixels will take the colour of the foreground pixel. - * - * - * - * - * IMG_EFFECT_MULTIPLY - * - * - * Overlays with a multiply effect. - * - * - * - * - * @throws ImageException - * - */ -function imagelayereffect($image, int $effect): void -{ - error_clear_last(); - $safeResult = \imagelayereffect($image, $effect); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Draws a line between the two given points. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $x1 x-coordinate for first point. - * @param int $y1 y-coordinate for first point. - * @param int $x2 x-coordinate for second point. - * @param int $y2 y-coordinate for second point. - * @param int $color The line color. A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imageline($image, int $x1, int $y1, int $x2, int $y2, int $color): void -{ - error_clear_last(); - $safeResult = \imageline($image, $x1, $y1, $x2, $y2, $color); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imageloadfont loads a user-defined bitmap and returns - * its identifier. - * - * @param string $filename The font file format is currently binary and architecture - * dependent. This means you should generate the font files on the - * same type of CPU as the machine you are running PHP on. - * - * - * Font file format - * - * - * - * byte position - * C data type - * description - * - * - * - * - * byte 0-3 - * int - * number of characters in the font - * - * - * byte 4-7 - * int - * - * value of first character in the font (often 32 for space) - * - * - * - * byte 8-11 - * int - * pixel width of each character - * - * - * byte 12-15 - * int - * pixel height of each character - * - * - * byte 16- - * char - * - * array with character data, one byte per pixel in each - * character, for a total of (nchars*width*height) bytes. - * - * - * - * - * - * @return int Returns an GdFont instance. - * @throws ImageException - * - */ -function imageloadfont(string $filename): int -{ - error_clear_last(); - $safeResult = \imageloadfont($filename); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Outputs or saves a PNG image from the given - * image. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. - * - * NULL is invalid if the quality and - * filters arguments are not used. - * @param int $quality Compression level: from 0 (no compression) to 9. - * The default (-1) uses the zlib compression default. - * For more information see the zlib manual. - * @param int $filters Allows reducing the PNG file size. It is a bitmask field which may be - * set to any combination of the PNG_FILTER_* - * constants. PNG_NO_FILTER or - * PNG_ALL_FILTERS may also be used to respectively - * disable or activate all filters. - * The default value (-1) disables filtering. - * @throws ImageException - * - */ -function imagepng($image, $file = null, int $quality = -1, int $filters = -1): void -{ - error_clear_last(); - if ($filters !== -1) { - $safeResult = \imagepng($image, $file, $quality, $filters); - } elseif ($quality !== -1) { - $safeResult = \imagepng($image, $file, $quality); - } elseif ($file !== null) { - $safeResult = \imagepng($image, $file); - } else { - $safeResult = \imagepng($image); - } - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagerectangle creates a rectangle starting at - * the specified coordinates. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $x1 Upper left x coordinate. - * @param int $y1 Upper left y coordinate - * 0, 0 is the top left corner of the image. - * @param int $x2 Bottom right x coordinate. - * @param int $y2 Bottom right y coordinate. - * @param int $color A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imagerectangle($image, int $x1, int $y1, int $x2, int $y2, int $color): void -{ - error_clear_last(); - $safeResult = \imagerectangle($image, $x1, $y1, $x2, $y2, $color); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imageresolution allows to set and get the resolution of - * an image in DPI (dots per inch). If the optional parameters are NULL, - * the current resolution is returned as an indexed array. If only - * resolution_x is not NULL, the horizontal and vertical resolution - * are set to this value. If none of the optional parameters are NULL, the horizontal - * and vertical resolution are set to these values, respectively. - * - * The resolution is only used as meta information when images are read from and - * written to formats supporting this kind of information (curently PNG and - * JPEG). It does not affect any drawing operations. The default resolution - * for new images is 96 DPI. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $resolution_x The horizontal resolution in DPI. - * @param int $resolution_y The vertical resolution in DPI. - * @return mixed When used as getter, - * it returns an indexed array of the horizontal and vertical resolution on - * success. - * When used as setter, it returns - * TRUE on success. - * @throws ImageException - * - */ -function imageresolution($image, ?int $resolution_x = null, ?int $resolution_y = null) -{ - error_clear_last(); - if ($resolution_y !== null) { - $safeResult = \imageresolution($image, $resolution_x, $resolution_y); - } elseif ($resolution_x !== null) { - $safeResult = \imageresolution($image, $resolution_x); - } else { - $safeResult = \imageresolution($image); - } - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Rotates the image image using the given - * angle in degrees. - * - * The center of rotation is the center of the image, and the rotated - * image may have different dimensions than the original image. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param float $angle Rotation angle, in degrees. The rotation angle is interpreted as the - * number of degrees to rotate the image anticlockwise. - * @param int $background_color Specifies the color of the uncovered zone after the rotation - * @return resource Returns an image object for the rotated image. - * @throws ImageException - * - */ -function imagerotate($image, float $angle, int $background_color) -{ - error_clear_last(); - $safeResult = \imagerotate($image, $angle, $background_color); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * imagesavealpha sets the flag which determines whether to retain - * full alpha channel information (as opposed to single-color transparency) - * when saving images. - * This is only supported for image formats which support full alpha channel information, - * i.e. PNG, WebP and AVIF. - * - * - * imagesavealpha is only meaningful for PNG - * images, since the full alpha channel is always saved for WebP - * and AVIF. It is not recommended to rely on this behavior, - * as it may change in the future. Thus, imagesavealpha - * should be called deliberately also for WebP and - * AVIF images. - * - * - * - * Alphablending has to be disabled (imagealphablending($im, false)) - * to retain the alpha-channel in the first place. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param bool $enable Whether to save the alpha channel or not. Defaults to FALSE. - * @throws ImageException - * - */ -function imagesavealpha($image, bool $enable): void -{ - error_clear_last(); - $safeResult = \imagesavealpha($image, $enable); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagescale scales an image using the given - * interpolation algorithm. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $width The width to scale the image to. - * @param int $height The height to scale the image to. If omitted or negative, the aspect - * ratio will be preserved. - * @param int $mode One of IMG_NEAREST_NEIGHBOUR, - * IMG_BILINEAR_FIXED, - * IMG_BICUBIC, - * IMG_BICUBIC_FIXED or anything else (will use two - * pass). - * - * - * IMG_WEIGHTED4 is not yet supported. - * - * - * @return resource Return the scaled image object on success. - * @throws ImageException - * - */ -function imagescale($image, int $width, int $height = -1, int $mode = IMG_BILINEAR_FIXED) -{ - error_clear_last(); - $safeResult = \imagescale($image, $width, $height, $mode); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * imagesetbrush sets the brush image to be - * used by all line drawing functions (such as imageline - * and imagepolygon) when drawing with the special - * colors IMG_COLOR_BRUSHED or - * IMG_COLOR_STYLEDBRUSHED. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param resource $brush An image object. - * @throws ImageException - * - */ -function imagesetbrush($image, $brush): void -{ - error_clear_last(); - $safeResult = \imagesetbrush($image, $brush); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagesetclip sets the current clipping rectangle, i.e. - * the area beyond which no pixels will be drawn. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $x1 The x-coordinate of the upper left corner. - * @param int $y1 The y-coordinate of the upper left corner. - * @param int $x2 The x-coordinate of the lower right corner. - * @param int $y2 The y-coordinate of the lower right corner. - * @throws ImageException - * - */ -function imagesetclip($image, int $x1, int $y1, int $x2, int $y2): void -{ - error_clear_last(); - $safeResult = \imagesetclip($image, $x1, $y1, $x2, $y2); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Sets the interpolation method, setting an interpolation method affects the rendering - * of various functions in GD, such as the imagerotate function. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $method The interpolation method, which can be one of the following: - * - * - * - * IMG_BELL: Bell filter. - * - * - * - * - * IMG_BESSEL: Bessel filter. - * - * - * - * - * IMG_BICUBIC: Bicubic interpolation. - * - * - * - * - * IMG_BICUBIC_FIXED: Fixed point implementation of the bicubic interpolation. - * - * - * - * - * IMG_BILINEAR_FIXED: Fixed point implementation of the bilinear interpolation (default (also on image creation)). - * - * - * - * - * IMG_BLACKMAN: Blackman window function. - * - * - * - * - * IMG_BOX: Box blur filter. - * - * - * - * - * IMG_BSPLINE: Spline interpolation. - * - * - * - * - * IMG_CATMULLROM: Cubic Hermite spline interpolation. - * - * - * - * - * IMG_GAUSSIAN: Gaussian function. - * - * - * - * - * IMG_GENERALIZED_CUBIC: Generalized cubic spline fractal interpolation. - * - * - * - * - * IMG_HERMITE: Hermite interpolation. - * - * - * - * - * IMG_HAMMING: Hamming filter. - * - * - * - * - * IMG_HANNING: Hanning filter. - * - * - * - * - * IMG_MITCHELL: Mitchell filter. - * - * - * - * - * IMG_POWER: Power interpolation. - * - * - * - * - * IMG_QUADRATIC: Inverse quadratic interpolation. - * - * - * - * - * IMG_SINC: Sinc function. - * - * - * - * - * IMG_NEAREST_NEIGHBOUR: Nearest neighbour interpolation. - * - * - * - * - * IMG_WEIGHTED4: Weighting filter. - * - * - * - * - * IMG_TRIANGLE: Triangle interpolation. - * - * - * - * @throws ImageException - * - */ -function imagesetinterpolation($image, int $method = IMG_BILINEAR_FIXED): void -{ - error_clear_last(); - $safeResult = \imagesetinterpolation($image, $method); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagesetpixel draws a pixel at the specified - * coordinate. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $x x-coordinate. - * @param int $y y-coordinate. - * @param int $color A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imagesetpixel($image, int $x, int $y, int $color): void -{ - error_clear_last(); - $safeResult = \imagesetpixel($image, $x, $y, $color); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagesetstyle sets the style to be used by all - * line drawing functions (such as imageline - * and imagepolygon) when drawing with the special - * color IMG_COLOR_STYLED or lines of images with color - * IMG_COLOR_STYLEDBRUSHED. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param array $style An array of pixel colors. You can use the - * IMG_COLOR_TRANSPARENT constant to add a - * transparent pixel. - * Note that style must not be an empty array. - * @throws ImageException - * - */ -function imagesetstyle($image, array $style): void -{ - error_clear_last(); - $safeResult = \imagesetstyle($image, $style); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagesetthickness sets the thickness of the lines - * drawn when drawing rectangles, polygons, arcs etc. to - * thickness pixels. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $thickness Thickness, in pixels. - * @throws ImageException - * - */ -function imagesetthickness($image, int $thickness): void -{ - error_clear_last(); - $safeResult = \imagesetthickness($image, $thickness); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagesettile sets the tile image to be - * used by all region filling functions (such as imagefill - * and imagefilledpolygon) when filling with the special - * color IMG_COLOR_TILED. - * - * A tile is an image used to fill an area with a repeated pattern. Any - * GD image can be used as a tile, and by setting the transparent color index of the tile - * image with imagecolortransparent, a tile allows certain parts - * of the underlying area to shine through can be created. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param resource $tile The image object to be used as a tile. - * @throws ImageException - * - */ -function imagesettile($image, $tile): void -{ - error_clear_last(); - $safeResult = \imagesettile($image, $tile); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Draws a string at the given coordinates. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $font Can be 1, 2, 3, 4, 5 for built-in - * fonts in latin2 encoding (where higher numbers corresponding to larger fonts) or GdFont instance, - * returned by imageloadfont. - * @param int $x x-coordinate of the upper left corner. - * @param int $y y-coordinate of the upper left corner. - * @param string $string The string to be written. - * @param int $color A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imagestring($image, int $font, int $x, int $y, string $string, int $color): void -{ - error_clear_last(); - $safeResult = \imagestring($image, $font, $x, $y, $string, $color); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Draws a string vertically at the given - * coordinates. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $font Can be 1, 2, 3, 4, 5 for built-in - * fonts in latin2 encoding (where higher numbers corresponding to larger fonts) or GdFont instance, - * returned by imageloadfont. - * @param int $x x-coordinate of the bottom left corner. - * @param int $y y-coordinate of the bottom left corner. - * @param string $string The string to be written. - * @param int $color A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imagestringup($image, int $font, int $x, int $y, string $string, int $color): void -{ - error_clear_last(); - $safeResult = \imagestringup($image, $font, $x, $y, $string, $color); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagetruecolortopalette converts a truecolor image - * to a palette image. The code for this function was originally drawn from - * the Independent JPEG Group library code, which is excellent. The code - * has been modified to preserve as much alpha channel information as - * possible in the resulting palette, in addition to preserving colors as - * well as possible. This does not work as well as might be hoped. It is - * usually best to simply produce a truecolor output image instead, which - * guarantees the highest output quality. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param bool $dither Indicates if the image should be dithered - if it is TRUE then - * dithering will be used which will result in a more speckled image but - * with better color approximation. - * @param int $num_colors Sets the maximum number of colors that should be retained in the palette. - * @throws ImageException - * - */ -function imagetruecolortopalette($image, bool $dither, int $num_colors): void -{ - error_clear_last(); - $safeResult = \imagetruecolortopalette($image, $dither, $num_colors); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * This function calculates and returns the bounding box in pixels - * for a TrueType text. - * - * @param float $size The font size in points. - * @param float $angle Angle in degrees in which string will be measured. - * @param string $font_filename 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 $string The string to be measured. - * @param array $options - * @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 ImageException - * - */ -function imagettfbbox(float $size, float $angle, string $font_filename, string $string, array $options = []): array -{ - error_clear_last(); - $safeResult = \imagettfbbox($size, $angle, $font_filename, $string, $options); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Writes the given text into the image using TrueType - * fonts. - * - * @param resource $image A GdImage object, 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 $font_filename 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. - * @param array $options - * @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. - * @throws ImageException - * - */ -function imagettftext($image, float $size, float $angle, int $x, int $y, int $color, string $font_filename, string $text, array $options = []): array -{ - error_clear_last(); - $safeResult = \imagettftext($image, $size, $angle, $x, $y, $color, $font_filename, $text, $options); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * imagewbmp outputs or save a WBMP - * version of the given image. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. - * @param int $foreground_color You can set the foreground color with this parameter by setting an - * identifier obtained from imagecolorallocate. - * The default foreground color is black. - * @throws ImageException - * - */ -function imagewbmp($image, $file = null, ?int $foreground_color = null): void -{ - error_clear_last(); - if ($foreground_color !== null) { - $safeResult = \imagewbmp($image, $file, $foreground_color); - } elseif ($file !== null) { - $safeResult = \imagewbmp($image, $file); - } else { - $safeResult = \imagewbmp($image); - } - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Outputs or saves a WebP version of the given image. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param string|resource|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. - * @param int $quality quality ranges from 0 (worst - * quality, smaller file) to 100 (best quality, biggest file). - * @throws ImageException - * - */ -function imagewebp($image, $file = null, int $quality = -1): void -{ - error_clear_last(); - if ($quality !== -1) { - $safeResult = \imagewebp($image, $file, $quality); - } elseif ($file !== null) { - $safeResult = \imagewebp($image, $file); - } else { - $safeResult = \imagewebp($image); - } - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Outputs or save an XBM version of the given - * image. - * - * @param resource $image A GdImage object, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param string|resource|null $filename The path to save the file to, given as string. If NULL, the raw image stream will be output 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_color 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 ImageException - * - */ -function imagexbm($image, $filename, ?int $foreground_color = null): void -{ - error_clear_last(); - if ($foreground_color !== null) { - $safeResult = \imagexbm($image, $filename, $foreground_color); - } else { - $safeResult = \imagexbm($image, $filename); - } - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Embeds binary IPTC data into a JPEG image. - * - * @param string $iptc_data The data to be written. - * @param string $filename 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 string|bool If spool is less than 2, the JPEG will be returned. Otherwise returns TRUE on success. - * @throws ImageException - * - */ -function iptcembed(string $iptc_data, string $filename, int $spool = 0) -{ - error_clear_last(); - $safeResult = \iptcembed($iptc_data, $filename, $spool); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Parses an IPTC block into its single tags. - * - * @param string $iptc_block 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 ImageException - * - */ -function iptcparse(string $iptc_block): array -{ - error_clear_last(); - $safeResult = \iptcparse($iptc_block); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * 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 ImageException - * - */ -function jpeg2wbmp(string $jpegname, string $wbmpname, int $dest_height, int $dest_width, int $threshold): void -{ - error_clear_last(); - $safeResult = \jpeg2wbmp($jpegname, $wbmpname, $dest_height, $dest_width, $threshold); - if ($safeResult === false) { - throw 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 ImageException - * - */ -function png2wbmp(string $pngname, string $wbmpname, int $dest_height, int $dest_width, int $threshold): void -{ - error_clear_last(); - $safeResult = \png2wbmp($pngname, $wbmpname, $dest_height, $dest_width, $threshold); - if ($safeResult === false) { - throw ImageException::createFromPhpError(); - } +if (strpos(PHP_VERSION, "8.5.") === 0) { + require_once __DIR__ . '/8.5/image.php'; } diff --git a/generated/imap.php b/generated/imap.php index f654cc34..9e253632 100644 --- a/generated/imap.php +++ b/generated/imap.php @@ -1,2092 +1,17 @@ - * - * - * @param array $controls Array of LDAP Controls to send with the request. - * @throws LdapException - * - */ -function ldap_add($ldap, string $dn, array $entry, ?array $controls = null): void -{ - error_clear_last(); - if ($controls !== null) { - $safeResult = \ldap_add($ldap, $dn, $entry, $controls); - } else { - $safeResult = \ldap_add($ldap, $dn, $entry); - } - if ($safeResult === false) { - throw LdapException::createFromPhpError(); - } -} - - -/** - * Binds to the LDAP directory with specified RDN and password. - * - * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. - * @param string|null $dn - * @param string|null $password - * @throws LdapException - * - */ -function ldap_bind($ldap, ?string $dn = null, ?string $password = null): void -{ - error_clear_last(); - if ($password !== null) { - $safeResult = \ldap_bind($ldap, $dn, $password); - } elseif ($dn !== null) { - $safeResult = \ldap_bind($ldap, $dn); - } else { - $safeResult = \ldap_bind($ldap); - } - if ($safeResult === false) { - throw LdapException::createFromPhpError(); - } -} - - -/** - * Retrieve the pagination information send by the server. - * - * @param resource $link An LDAP resource, returned by ldap_connect. - * @param resource $result - * @param string|null $cookie An opaque structure sent by the server. - * @param int|null $estimated The estimated number of entries to retrieve. - * @throws LdapException - * - */ -function ldap_control_paged_result_response($link, $result, ?string &$cookie = null, ?int &$estimated = null): void -{ - error_clear_last(); - $safeResult = \ldap_control_paged_result_response($link, $result, $cookie, $estimated); - if ($safeResult === false) { - throw LdapException::createFromPhpError(); - } -} - - -/** - * Enable LDAP pagination by sending the pagination control (page size, cookie...). - * - * @param resource $link An LDAP resource, 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 LdapException - * - */ -function ldap_control_paged_result($link, int $pagesize, bool $iscritical = false, string $cookie = ""): void -{ - error_clear_last(); - $safeResult = \ldap_control_paged_result($link, $pagesize, $iscritical, $cookie); - if ($safeResult === false) { - throw LdapException::createFromPhpError(); - } -} - - -/** - * Returns the number of entries stored in the result of previous search - * operations. - * - * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. - * @param resource $result An LDAP\Result instance, returned by ldap_list or ldap_search. - * @return int Returns number of entries in the result. - * @throws LdapException - * - */ -function ldap_count_entries($ldap, $result): int -{ - error_clear_last(); - $safeResult = \ldap_count_entries($ldap, $result); - if ($safeResult === false) { - throw LdapException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Deletes a particular entry in LDAP directory. - * - * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. - * @param string $dn The distinguished name of an LDAP entity. - * @param array $controls Array of LDAP Controls to send with the request. - * @throws LdapException - * - */ -function ldap_delete($ldap, string $dn, ?array $controls = null): void -{ - error_clear_last(); - if ($controls !== null) { - $safeResult = \ldap_delete($ldap, $dn, $controls); - } else { - $safeResult = \ldap_delete($ldap, $dn); - } - if ($safeResult === false) { - throw LdapException::createFromPhpError(); - } -} - - -/** - * Turns the specified dn, into a more user-friendly - * form, stripping off type names. - * - * @param string $dn The distinguished name of an LDAP entity. - * @return string Returns the user friendly name. - * @throws LdapException - * - */ -function ldap_dn2ufn(string $dn): string -{ - error_clear_last(); - $safeResult = \ldap_dn2ufn($dn); - if ($safeResult === false) { - throw LdapException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Performs a PASSWD extended operation. - * - * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. - * @param string $user dn of the user to change the password of. - * @param string $old_password The old password of this user. May be ommited depending of server configuration. - * @param string $new_password The new password for this user. May be omitted or empty to have a generated password. - * @param array $controls If provided, a password policy request control is send with the request and this is - * filled with an array of LDAP Controls - * returned with the request. - * @return string|bool Returns the generated password if new_password is empty or omitted. - * Otherwise returns TRUE on success. - * @throws LdapException - * - */ -function ldap_exop_passwd($ldap, string $user = "", string $old_password = "", string $new_password = "", ?array &$controls = null) -{ - error_clear_last(); - $safeResult = \ldap_exop_passwd($ldap, $user, $old_password, $new_password, $controls); - if ($safeResult === false) { - throw LdapException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Performs a WHOAMI extended operation and returns the data. - * - * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. - * @return string|bool The data returned by the server. - * @throws LdapException - * - */ -function ldap_exop_whoami($ldap) -{ - error_clear_last(); - $safeResult = \ldap_exop_whoami($ldap); - if ($safeResult === false) { - throw LdapException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Performs an extended operation on the specified ldap with - * request_oid the OID of the operation and - * request_data the data. - * - * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. - * @param string $request_oid 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 $request_data 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|null $controls Array of LDAP Controls to send with the request. - * @param string|null $response_data 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|null $response_oid Will be filled with the response OID if provided, usually equal to the request OID. - * @return resource|bool When used with response_data, returns TRUE on success. - * When used without response_data, returns a result identifier. - * @throws LdapException - * - */ -function ldap_exop($ldap, string $request_oid, ?string $request_data = null, ?array $controls = null, ?string &$response_data = null, ?string &$response_oid = null) -{ - error_clear_last(); - if ($response_oid !== null) { - $safeResult = \ldap_exop($ldap, $request_oid, $request_data, $controls, $response_data, $response_oid); - } elseif ($response_data !== null) { - $safeResult = \ldap_exop($ldap, $request_oid, $request_data, $controls, $response_data); - } elseif ($controls !== null) { - $safeResult = \ldap_exop($ldap, $request_oid, $request_data, $controls); - } elseif ($request_data !== null) { - $safeResult = \ldap_exop($ldap, $request_oid, $request_data); - } else { - $safeResult = \ldap_exop($ldap, $request_oid); - } - if ($safeResult === false) { - throw LdapException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * 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 LdapException - * - */ -function ldap_explode_dn(string $dn, int $with_attrib): array -{ - error_clear_last(); - $safeResult = \ldap_explode_dn($dn, $with_attrib); - if ($safeResult === false) { - throw LdapException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * 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 $ldap An LDAP\Connection instance, returned by ldap_connect. - * @param resource $entry An LDAP\ResultEntry instance. - * @return string Returns the first attribute in the entry on success and FALSE on - * error. - * @throws LdapException - * - */ -function ldap_first_attribute($ldap, $entry): string -{ - error_clear_last(); - $safeResult = \ldap_first_attribute($ldap, $entry); - if ($safeResult === false) { - throw LdapException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * 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 $ldap An LDAP\Connection instance, returned by ldap_connect. - * @param resource $result An LDAP\Result instance, returned by ldap_list or ldap_search. - * @return resource Returns an LDAP\ResultEntry instance. - * @throws LdapException - * - */ -function ldap_first_entry($ldap, $result) -{ - error_clear_last(); - $safeResult = \ldap_first_entry($ldap, $result); - if ($safeResult === false) { - throw LdapException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * 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 An LDAP\Result instance, returned by ldap_list or ldap_search. - * @throws LdapException - * - */ -function ldap_free_result($result): void -{ - error_clear_last(); - $safeResult = \ldap_free_result($result); - if ($safeResult === false) { - throw LdapException::createFromPhpError(); - } +if (strpos(PHP_VERSION, "8.1.") === 0) { + require_once __DIR__ . '/8.1/ldap.php'; } - - -/** - * Finds out the DN of an entry in the result. - * - * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. - * @param resource $entry An LDAP\ResultEntry instance. - * @return string Returns the DN of the result entry and FALSE on error. - * @throws LdapException - * - */ -function ldap_get_dn($ldap, $entry): string -{ - error_clear_last(); - $safeResult = \ldap_get_dn($ldap, $entry); - if ($safeResult === false) { - throw LdapException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Reads multiple entries from the given result, and then reading the - * attributes and multiple values. - * - * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. - * @param resource $result An LDAP\Result instance, returned by ldap_list or ldap_search. - * @return array Returns a complete result information in a multi-dimensional array on - * success. - * - * 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 LdapException - * - */ -function ldap_get_entries($ldap, $result): array -{ - error_clear_last(); - $safeResult = \ldap_get_entries($ldap, $result); - if ($safeResult === false) { - throw LdapException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Sets value to the value of the specified option. - * - * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. - * @param int $option The parameter option can be one of: - * - * - * - * - * Option - * Type - * since - * - * - * - * - * LDAP_OPT_DEREF - * int - * - * - * - * LDAP_OPT_SIZELIMIT - * int - * - * - * - * LDAP_OPT_TIMELIMIT - * int - * - * - * - * LDAP_OPT_NETWORK_TIMEOUT - * int - * - * - * - * LDAP_OPT_PROTOCOL_VERSION - * int - * - * - * - * LDAP_OPT_ERROR_NUMBER - * int - * - * - * - * LDAP_OPT_DIAGNOSTIC_MESSAGE - * string - * - * - * - * LDAP_OPT_REFERRALS - * int - * - * - * - * LDAP_OPT_RESTART - * int - * - * - * - * 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 - * int - * 7.1 - * - * - * LDAP_OPT_X_TLS_CRL_NONE - * int - * 7.1 - * - * - * LDAP_OPT_X_TLS_CRL_PEER - * int - * 7.1 - * - * - * LDAP_OPT_X_TLS_CRL_ALL - * int - * 7.1 - * - * - * LDAP_OPT_X_TLS_CRLFILE - * string - * 7.1 - * - * - * LDAP_OPT_X_TLS_DHFILE - * string - * 7.1 - * - * - * LDAP_OPT_X_TLS_KEYFILE - * string - * 7.1 - * - * - * LDAP_OPT_X_TLS_PACKAGE - * string - * 7.1 - * - * - * LDAP_OPT_X_TLS_PROTOCOL_MIN - * int - * 7.1 - * - * - * LDAP_OPT_X_TLS_RANDOM_FILE - * string - * 7.1 - * - * - * LDAP_OPT_X_TLS_REQUIRE_CERT - * int - * - * - * - * - * - * @param mixed $value This will be set to the option value. - * @throws LdapException - * - */ -function ldap_get_option($ldap, int $option, &$value = null): void -{ - error_clear_last(); - $safeResult = \ldap_get_option($ldap, $option, $value); - if ($safeResult === false) { - throw 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 $ldap An LDAP\Connection instance, returned by ldap_connect. - * @param resource $entry An LDAP\ResultEntry instance. - * @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 LdapException - * - */ -function ldap_get_values_len($ldap, $entry, string $attribute): array -{ - error_clear_last(); - $safeResult = \ldap_get_values_len($ldap, $entry, $attribute); - if ($safeResult === false) { - throw LdapException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Reads all the values of the attribute in the entry in the result. - * - * This call needs a entry, - * 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 $ldap An LDAP\Connection instance, returned by ldap_connect. - * @param resource $entry An LDAP\ResultEntry instance. - * @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 LdapException - * - */ -function ldap_get_values($ldap, $entry, string $attribute): array -{ - error_clear_last(); - $safeResult = \ldap_get_values($ldap, $entry, $attribute); - if ($safeResult === false) { - throw LdapException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Adds one or more attribute values to the specified dn. - * To add a whole new object see ldap_add function. - * - * @param resource $ldap An LDAP\Connection instance, 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 $controls Array of LDAP Controls to send with the request. - * @throws LdapException - * - */ -function ldap_mod_add($ldap, string $dn, array $entry, ?array $controls = null): void -{ - error_clear_last(); - if ($controls !== null) { - $safeResult = \ldap_mod_add($ldap, $dn, $entry, $controls); - } else { - $safeResult = \ldap_mod_add($ldap, $dn, $entry); - } - if ($safeResult === false) { - throw LdapException::createFromPhpError(); - } -} - - -/** - * Removes one or more attribute values from the specified dn. - * Object deletions are done by the - * ldap_delete function. - * - * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. - * @param string $dn The distinguished name of an LDAP entity. - * @param array $entry - * @param array $controls Array of LDAP Controls to send with the request. - * @throws LdapException - * - */ -function ldap_mod_del($ldap, string $dn, array $entry, ?array $controls = null): void -{ - error_clear_last(); - if ($controls !== null) { - $safeResult = \ldap_mod_del($ldap, $dn, $entry, $controls); - } else { - $safeResult = \ldap_mod_del($ldap, $dn, $entry); - } - if ($safeResult === false) { - throw LdapException::createFromPhpError(); - } -} - - -/** - * Replaces one or more attributes from the specified dn. - * It may also add or remove attributes. - * - * @param resource $ldap An LDAP\Connection instance, 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 $controls Array of LDAP Controls to send with the request. - * @throws LdapException - * - */ -function ldap_mod_replace($ldap, string $dn, array $entry, ?array $controls = null): void -{ - error_clear_last(); - if ($controls !== null) { - $safeResult = \ldap_mod_replace($ldap, $dn, $entry, $controls); - } else { - $safeResult = \ldap_mod_replace($ldap, $dn, $entry); - } - if ($safeResult === false) { - throw LdapException::createFromPhpError(); - } -} - - -/** - * Modifies an existing entry in the LDAP directory. Allows detailed - * specification of the modifications to perform. - * - * @param resource $ldap An LDAP resource, returned by ldap_connect. - * @param string $dn The distinguished name of an LDAP entity. - * @param array $modifications_info 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 $controls Each value specified through values is added (as - * an additional value) to the attribute named by - * attrib. - * @throws LdapException - * - */ -function ldap_modify_batch($ldap, string $dn, array $modifications_info, ?array $controls = null): void -{ - error_clear_last(); - if ($controls !== null) { - $safeResult = \ldap_modify_batch($ldap, $dn, $modifications_info, $controls); - } else { - $safeResult = \ldap_modify_batch($ldap, $dn, $modifications_info); - } - if ($safeResult === false) { - throw LdapException::createFromPhpError(); - } -} - - -/** - * Retrieves the attributes in an entry. The first call to - * ldap_next_attribute is made with the - * entry returned from - * ldap_first_attribute. - * - * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. - * @param resource $entry An LDAP\ResultEntry instance. - * @return string Returns the next attribute in an entry on success and FALSE on - * error. - * @throws LdapException - * - */ -function ldap_next_attribute($ldap, $entry): string -{ - error_clear_last(); - $safeResult = \ldap_next_attribute($ldap, $entry); - if ($safeResult === false) { - throw LdapException::createFromPhpError(); - } - return $safeResult; -} - - -/** - * Parse LDAP extended operation data from result object result - * - * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. - * @param resource $result An LDAP\Result instance, returned by ldap_list or ldap_search. - * @param string|null $response_data Will be filled by the response data. - * @param string|null $response_oid Will be filled by the response OID. - * @throws LdapException - * - */ -function ldap_parse_exop($ldap, $result, ?string &$response_data = null, ?string &$response_oid = null): void -{ - error_clear_last(); - $safeResult = \ldap_parse_exop($ldap, $result, $response_data, $response_oid); - if ($safeResult === false) { - throw LdapException::createFromPhpError(); - } -} - - -/** - * Parses an LDAP search result. - * - * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. - * @param resource $result An LDAP\Result instance, returned by ldap_list or ldap_search. - * @param int|null $error_code 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|null $matched_dn 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|null $error_message 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|null $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|null $controls An array of LDAP Controls which have been sent with the response. - * @throws LdapException - * - */ -function ldap_parse_result($ldap, $result, ?int &$error_code, ?string &$matched_dn = null, ?string &$error_message = null, ?array &$referrals = null, ?array &$controls = null): void -{ - error_clear_last(); - $safeResult = \ldap_parse_result($ldap, $result, $error_code, $matched_dn, $error_message, $referrals, $controls); - if ($safeResult === false) { - throw LdapException::createFromPhpError(); - } +if (strpos(PHP_VERSION, "8.2.") === 0) { + require_once __DIR__ . '/8.2/ldap.php'; } - - -/** - * The entry specified by dn is renamed/moved. - * - * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. - * @param string $dn The distinguished name of an LDAP entity. - * @param string $new_rdn The new RDN. - * @param string $new_parent The new parent/superior entry. - * @param bool $delete_old_rdn 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 $controls Array of LDAP Controls to send with the request. - * @throws LdapException - * - */ -function ldap_rename($ldap, string $dn, string $new_rdn, string $new_parent, bool $delete_old_rdn, ?array $controls = null): void -{ - error_clear_last(); - if ($controls !== null) { - $safeResult = \ldap_rename($ldap, $dn, $new_rdn, $new_parent, $delete_old_rdn, $controls); - } else { - $safeResult = \ldap_rename($ldap, $dn, $new_rdn, $new_parent, $delete_old_rdn); - } - if ($safeResult === false) { - throw LdapException::createFromPhpError(); - } +if (strpos(PHP_VERSION, "8.3.") === 0) { + require_once __DIR__ . '/8.3/ldap.php'; } - - -/** - * - * - * @param resource $ldap - * @param string $dn - * @param string $password - * @param string $mech - * @param string $realm - * @param string $authc_id - * @param string $authz_id - * @param string $props - * @throws LdapException - * - */ -function ldap_sasl_bind($ldap, ?string $dn = null, ?string $password = null, ?string $mech = null, ?string $realm = null, ?string $authc_id = null, ?string $authz_id = null, ?string $props = null): void -{ - error_clear_last(); - if ($props !== null) { - $safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm, $authc_id, $authz_id, $props); - } elseif ($authz_id !== null) { - $safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm, $authc_id, $authz_id); - } elseif ($authc_id !== null) { - $safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm, $authc_id); - } elseif ($realm !== null) { - $safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm); - } elseif ($mech !== null) { - $safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech); - } elseif ($password !== null) { - $safeResult = \ldap_sasl_bind($ldap, $dn, $password); - } elseif ($dn !== null) { - $safeResult = \ldap_sasl_bind($ldap, $dn); - } else { - $safeResult = \ldap_sasl_bind($ldap); - } - if ($safeResult === false) { - throw LdapException::createFromPhpError(); - } +if (strpos(PHP_VERSION, "8.4.") === 0) { + require_once __DIR__ . '/8.4/ldap.php'; } - - -/** - * Sets the value of the specified option to be value. - * - * @param resource|null $ldap Either an LDAP\Connection instance, returned by - * ldap_connect, to set the option for that connection, - * or NULL to set the option globally. - * @param int $option The parameter option can be one of: - * - * - * - * - * Option - * Type - * Available since - * - * - * - * - * LDAP_OPT_DEREF - * int - * - * - * - * LDAP_OPT_SIZELIMIT - * int - * - * - * - * LDAP_OPT_TIMELIMIT - * int - * - * - * - * LDAP_OPT_NETWORK_TIMEOUT - * int - * - * - * - * LDAP_OPT_PROTOCOL_VERSION - * int - * - * - * - * LDAP_OPT_ERROR_NUMBER - * int - * - * - * - * 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 - * int - * 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 - * int - * PHP 7.1.0 - * - * - * LDAP_OPT_X_TLS_RANDOM_FILE - * string - * PHP 7.1.0 - * - * - * LDAP_OPT_X_TLS_REQUIRE_CERT - * int - * 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 $value The new value for the specified option. - * @throws LdapException - * - */ -function ldap_set_option($ldap, int $option, $value): void -{ - error_clear_last(); - $safeResult = \ldap_set_option($ldap, $option, $value); - if ($safeResult === false) { - throw LdapException::createFromPhpError(); - } -} - - -/** - * Unbinds from the LDAP directory. - * - * @param resource $ldap An LDAP\Connection instance, returned by ldap_connect. - * @throws LdapException - * - */ -function ldap_unbind($ldap): void -{ - error_clear_last(); - $safeResult = \ldap_unbind($ldap); - if ($safeResult === false) { - throw LdapException::createFromPhpError(); - } +if (strpos(PHP_VERSION, "8.5.") === 0) { + require_once __DIR__ . '/8.5/ldap.php'; } diff --git a/generated/libxml.php b/generated/libxml.php index a2c9c99c..85d5f357 100644 --- a/generated/libxml.php +++ b/generated/libxml.php @@ -1,78 +1,17 @@ - * - * The above example will output: - * - * example: , this is a test - * example: , this is a test - * ]]> - * - * - * So, $out[0] contains an array of strings that matched the full pattern, - * and $out[1] contains an array of strings enclosed by tags. - * - * - * - * - * If the pattern contains named subpatterns, $matches - * additionally contains entries for keys with the subpattern name. - * - * - * 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 (in bytes) 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 an array of strings that matched the full pattern, - * and $out[1] contains an array of strings enclosed by tags. - * - * - * - * The above example will output: - * - * So, $out[0] contains an array of strings that matched the full pattern, - * and $out[1] contains an array of strings enclosed by tags. - * - * If the pattern contains named subpatterns, $matches - * additionally contains entries for keys with the subpattern name. - * - * 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 (in bytes) 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 an array of strings that matched the full pattern, - * and $out[1] contains an array of strings enclosed by tags. - * - * - * - * The above example will output: - * - * So, $out[0] contains an array of strings that matched the full pattern, - * and $out[1] contains an array of strings enclosed by tags. - * - * If the pattern contains named subpatterns, $matches - * additionally contains entries for keys with the subpattern name. - * - * 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|null Returns the number of full pattern matches (which might be zero). - * @throws PcreException - * - */ -function preg_match_all(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): ?int -{ - error_clear_last(); - $safeResult = \preg_match_all($pattern, $subject, $matches, $flags, $offset); - if ($safeResult === false) { - throw PcreException::createFromPhpError(); - } - return $safeResult; +if (strpos(PHP_VERSION, "8.2.") === 0) { + require_once __DIR__ . '/8.2/pcre.php'; } - - -/** - * 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 string[]|null $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 (in bytes) 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 (in bytes) 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 (in bytes) 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 PcreException - * - */ -function preg_match(string $pattern, string $subject, ?iterable &$matches = null, int $flags = 0, int $offset = 0): int -{ - error_clear_last(); - $safeResult = \preg_match($pattern, $subject, $matches, $flags, $offset); - if ($safeResult === false) { - throw PcreException::createFromPhpError(); - } - return $safeResult; +if (strpos(PHP_VERSION, "8.3.") === 0) { + require_once __DIR__ . '/8.3/pcre.php'; } - - -/** - * 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". - * @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 PcreException - * - */ -function preg_split(string $pattern, string $subject, ?int $limit = -1, int $flags = 0): array -{ - error_clear_last(); - $safeResult = \preg_split($pattern, $subject, $limit, $flags); - if ($safeResult === false) { - throw PcreException::createFromPhpError(); - } - return $safeResult; +if (strpos(PHP_VERSION, "8.4.") === 0) { + require_once __DIR__ . '/8.4/pcre.php'; +} +if (strpos(PHP_VERSION, "8.5.") === 0) { + require_once __DIR__ . '/8.5/pcre.php'; } diff --git a/generated/pgsql.php b/generated/pgsql.php index 0e2bfea1..f169ecd9 100644 --- a/generated/pgsql.php +++ b/generated/pgsql.php @@ -1,1398 +1,17 @@ - * - * - * @param bool $use_include_path Setting use_include_path to TRUE will result - * in PHP trying to open the file along the standard include path as per - * the include_path directive. - * This is used for local files, not URLs. - * @return array Returns an array with all the parsed meta tags. - * - * The value of the name property becomes the key, the value of the content - * property becomes the value of the returned array, so you can easily use - * standard array functions to traverse it or access single values. - * Special characters in the value of the name property are substituted with - * '_', the rest is converted to lower case. If two meta tags have the same - * name, only the last one is returned. - * - * Returns FALSE on failure. - * @throws UrlException - * - */ -function get_meta_tags(string $filename, bool $use_include_path = false): array -{ - error_clear_last(); - $safeResult = \get_meta_tags($filename, $use_include_path); - if ($safeResult === false) { - throw UrlException::createFromPhpError(); - } - return $safeResult; +if (strpos(PHP_VERSION, "8.3.") === 0) { + require_once __DIR__ . '/8.3/url.php'; } - - -/** - * This function parses a URL and returns an associative array containing any - * of the various components of the URL that are present. - * The values of the array elements are not URL decoded. - * - * This function is not meant to validate - * the given URL, it only breaks it up into the parts listed below. Partial and invalid - * URLs are also accepted, parse_url tries its best to - * parse them correctly. - * - * @param string $url The URL to parse. - * @param int $component Specify one of PHP_URL_SCHEME, - * PHP_URL_HOST, PHP_URL_PORT, - * PHP_URL_USER, PHP_URL_PASS, - * PHP_URL_PATH, PHP_URL_QUERY - * or PHP_URL_FRAGMENT to retrieve just a specific - * URL component as a string (except when - * PHP_URL_PORT is given, in which case the return - * value will be an int). - * @return array|int|string|null On seriously malformed URLs, parse_url. - * - * If the component parameter is omitted, an - * associative array is returned. At least one element will be - * present within the array. Potential keys within this array are: - * - * - * - * scheme - e.g. http - * - * - * - * - * host - * - * - * - * - * port - * - * - * - * - * user - * - * - * - * - * pass - * - * - * - * - * path - * - * - * - * - * query - after the question mark ? - * - * - * - * - * fragment - after the hashmark # - * - * - * - * - * If the component parameter is specified, - * parse_url returns a string (or an - * int, in the case of PHP_URL_PORT) - * instead of an array. If the requested component doesn't exist - * within the given URL, NULL will be returned. - * As of PHP 8.0.0, parse_url distinguishes absent and empty - * queries and fragments: - * - * - * - * - * - * - * - * Previously all cases resulted in query and fragment being NULL. - * - * Note that control characters (cf. ctype_cntrl) in the - * components are replaced with underscores (_). - * @throws UrlException - * - */ -function parse_url(string $url, int $component = -1) -{ - error_clear_last(); - $safeResult = \parse_url($url, $component); - if ($safeResult === false) { - throw UrlException::createFromPhpError(); - } - return $safeResult; +if (strpos(PHP_VERSION, "8.4.") === 0) { + require_once __DIR__ . '/8.4/url.php'; +} +if (strpos(PHP_VERSION, "8.5.") === 0) { + require_once __DIR__ . '/8.5/url.php'; } diff --git a/generated/var.php b/generated/var.php index 70f048df..e2d1e584 100644 --- a/generated/var.php +++ b/generated/var.php @@ -1,60 +1,17 @@