summaryrefslogtreecommitdiff
path: root/vendor
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-26 19:16:17 +0300
committerAndrew Dolgov <[email protected]>2021-02-26 19:16:17 +0300
commit3fd785654372d493c031d9b541ab33a881023a32 (patch)
tree0a76cb410217074378de3d7012b95754cd3c7e6f /vendor
parentbc4475b6698f5a74e475674aa7af43253c459892 (diff)
* switch to composer for qrcode and otp dependencies
* move most OTP-related stuff into userhelper * remove old phpqrcode and otphp libraries
Diffstat (limited to 'vendor')
-rw-r--r--vendor/OTPHP/Base32.php85
-rw-r--r--vendor/OTPHP/HOTP.php74
-rw-r--r--vendor/OTPHP/OTP.php120
-rw-r--r--vendor/OTPHP/OTPHP.php27
-rw-r--r--vendor/OTPHP/TOTP.php106
-rw-r--r--vendor/Psr/Log/AbstractLogger.php128
-rw-r--r--vendor/Psr/Log/InvalidArgumentException.php7
-rw-r--r--vendor/Psr/Log/LogLevel.php18
-rw-r--r--vendor/Psr/Log/LoggerAwareInterface.php18
-rw-r--r--vendor/Psr/Log/LoggerAwareTrait.php26
-rw-r--r--vendor/Psr/Log/LoggerInterface.php123
-rw-r--r--vendor/Psr/Log/LoggerTrait.php140
-rw-r--r--vendor/Psr/Log/NullLogger.php28
-rw-r--r--vendor/Psr/Log/Test/LoggerInterfaceTest.php140
-rw-r--r--vendor/autoload.php7
-rw-r--r--vendor/beberlei/assert/LICENSE11
-rw-r--r--vendor/beberlei/assert/composer.json63
-rw-r--r--vendor/beberlei/assert/lib/Assert/Assert.php96
-rw-r--r--vendor/beberlei/assert/lib/Assert/Assertion.php2825
-rw-r--r--vendor/beberlei/assert/lib/Assert/AssertionChain.php254
-rw-r--r--vendor/beberlei/assert/lib/Assert/AssertionFailedException.php35
-rw-r--r--vendor/beberlei/assert/lib/Assert/InvalidArgumentException.php76
-rw-r--r--vendor/beberlei/assert/lib/Assert/LazyAssertion.php230
-rw-r--r--vendor/beberlei/assert/lib/Assert/LazyAssertionException.php55
-rw-r--r--vendor/beberlei/assert/lib/Assert/functions.php80
-rw-r--r--vendor/beberlei/assert/phpstan-code.neon10
-rw-r--r--vendor/beberlei/assert/phpstan-tests.neon10
-rw-r--r--vendor/chillerlan/php-qrcode/.github/FUNDING.yml1
-rw-r--r--vendor/chillerlan/php-qrcode/.github/workflows/tests.yml55
-rw-r--r--vendor/chillerlan/php-qrcode/.gitignore5
-rw-r--r--vendor/chillerlan/php-qrcode/.scrutinizer.yml5
-rw-r--r--vendor/chillerlan/php-qrcode/.travis.yml19
-rw-r--r--vendor/chillerlan/php-qrcode/LICENSE (renamed from vendor/OTPHP/LICENCE)5
-rw-r--r--vendor/chillerlan/php-qrcode/README.md392
-rw-r--r--vendor/chillerlan/php-qrcode/composer.json51
-rw-r--r--vendor/chillerlan/php-qrcode/examples/MyCustomOutput.php36
-rw-r--r--vendor/chillerlan/php-qrcode/examples/QRImageWithLogo.php81
-rw-r--r--vendor/chillerlan/php-qrcode/examples/QRImageWithText.php104
-rw-r--r--vendor/chillerlan/php-qrcode/examples/custom_output.php38
-rw-r--r--vendor/chillerlan/php-qrcode/examples/example_image.pngbin0 -> 2279 bytes
-rw-r--r--vendor/chillerlan/php-qrcode/examples/example_svg.pngbin0 -> 15925 bytes
-rw-r--r--vendor/chillerlan/php-qrcode/examples/fpdf.php47
-rw-r--r--vendor/chillerlan/php-qrcode/examples/html.php102
-rw-r--r--vendor/chillerlan/php-qrcode/examples/image.php60
-rw-r--r--vendor/chillerlan/php-qrcode/examples/imageWithLogo.php44
-rw-r--r--vendor/chillerlan/php-qrcode/examples/imageWithText.php33
-rw-r--r--vendor/chillerlan/php-qrcode/examples/imagick.php59
-rw-r--r--vendor/chillerlan/php-qrcode/examples/octocat.pngbin0 -> 2468 bytes
-rw-r--r--vendor/chillerlan/php-qrcode/examples/svg.php77
-rw-r--r--vendor/chillerlan/php-qrcode/examples/text.php68
-rw-r--r--vendor/chillerlan/php-qrcode/phpdoc.xml15
-rw-r--r--vendor/chillerlan/php-qrcode/phpmd.xml34
-rw-r--r--vendor/chillerlan/php-qrcode/phpunit.xml23
-rw-r--r--vendor/chillerlan/php-qrcode/public/index.html163
-rw-r--r--vendor/chillerlan/php-qrcode/public/qrcode.php97
-rw-r--r--vendor/chillerlan/php-qrcode/src/Data/AlphaNum.php65
-rw-r--r--vendor/chillerlan/php-qrcode/src/Data/Byte.php47
-rw-r--r--vendor/chillerlan/php-qrcode/src/Data/Kanji.php70
-rw-r--r--vendor/chillerlan/php-qrcode/src/Data/MaskPatternTester.php203
-rw-r--r--vendor/chillerlan/php-qrcode/src/Data/Number.php82
-rw-r--r--vendor/chillerlan/php-qrcode/src/Data/QRCodeDataException.php17
-rw-r--r--vendor/chillerlan/php-qrcode/src/Data/QRDataAbstract.php351
-rw-r--r--vendor/chillerlan/php-qrcode/src/Data/QRDataInterface.php187
-rw-r--r--vendor/chillerlan/php-qrcode/src/Data/QRMatrix.php733
-rw-r--r--vendor/chillerlan/php-qrcode/src/Helpers/BitBuffer.php75
-rw-r--r--vendor/chillerlan/php-qrcode/src/Helpers/Polynomial.php184
-rw-r--r--vendor/chillerlan/php-qrcode/src/Output/QRCodeOutputException.php17
-rw-r--r--vendor/chillerlan/php-qrcode/src/Output/QRFpdf.php112
-rw-r--r--vendor/chillerlan/php-qrcode/src/Output/QRImage.php208
-rw-r--r--vendor/chillerlan/php-qrcode/src/Output/QRImagick.php123
-rw-r--r--vendor/chillerlan/php-qrcode/src/Output/QRMarkup.php151
-rw-r--r--vendor/chillerlan/php-qrcode/src/Output/QROutputAbstract.php130
-rw-r--r--vendor/chillerlan/php-qrcode/src/Output/QROutputInterface.php55
-rw-r--r--vendor/chillerlan/php-qrcode/src/Output/QRString.php76
-rw-r--r--vendor/chillerlan/php-qrcode/src/QRCode.php310
-rw-r--r--vendor/chillerlan/php-qrcode/src/QRCodeException.php15
-rw-r--r--vendor/chillerlan/php-qrcode/src/QROptions.php61
-rw-r--r--vendor/chillerlan/php-qrcode/src/QROptionsTrait.php408
-rw-r--r--vendor/chillerlan/php-qrcode/tests/Data/AlphaNumTest.php44
-rw-r--r--vendor/chillerlan/php-qrcode/tests/Data/ByteTest.php38
-rw-r--r--vendor/chillerlan/php-qrcode/tests/Data/DatainterfaceTestAbstract.php65
-rw-r--r--vendor/chillerlan/php-qrcode/tests/Data/KanjiTest.php50
-rw-r--r--vendor/chillerlan/php-qrcode/tests/Data/MaskPatternTesterTest.php29
-rw-r--r--vendor/chillerlan/php-qrcode/tests/Data/NumberTest.php44
-rw-r--r--vendor/chillerlan/php-qrcode/tests/Data/QRMatrixTest.php260
-rw-r--r--vendor/chillerlan/php-qrcode/tests/Helpers/BitBufferTest.php53
-rw-r--r--vendor/chillerlan/php-qrcode/tests/Helpers/PolynomialTest.php42
-rw-r--r--vendor/chillerlan/php-qrcode/tests/Output/QRFpdfTest.php83
-rw-r--r--vendor/chillerlan/php-qrcode/tests/Output/QRImageTest.php69
-rw-r--r--vendor/chillerlan/php-qrcode/tests/Output/QRImagickTest.php66
-rw-r--r--vendor/chillerlan/php-qrcode/tests/Output/QRMarkupTest.php79
-rw-r--r--vendor/chillerlan/php-qrcode/tests/Output/QROutputTestAbstract.php71
-rw-r--r--vendor/chillerlan/php-qrcode/tests/Output/QRStringTest.php56
-rw-r--r--vendor/chillerlan/php-qrcode/tests/QRCodeTest.php140
-rw-r--r--vendor/chillerlan/php-qrcode/tests/QROptionsTest.php80
-rw-r--r--vendor/chillerlan/php-qrcode/tests/QRTestAbstract.php72
-rw-r--r--vendor/chillerlan/php-settings-container/.gitignore4
-rw-r--r--vendor/chillerlan/php-settings-container/.scrutinizer.yml5
-rw-r--r--vendor/chillerlan/php-settings-container/.travis.yml18
-rw-r--r--vendor/chillerlan/php-settings-container/LICENSE21
-rw-r--r--vendor/chillerlan/php-settings-container/README.md153
-rw-r--r--vendor/chillerlan/php-settings-container/composer.json40
-rw-r--r--vendor/chillerlan/php-settings-container/examples/advanced.php46
-rw-r--r--vendor/chillerlan/php-settings-container/examples/simple.php30
-rw-r--r--vendor/chillerlan/php-settings-container/phpmd.xml35
-rw-r--r--vendor/chillerlan/php-settings-container/phpunit.xml22
-rw-r--r--vendor/chillerlan/php-settings-container/src/SettingsContainerAbstract.php172
-rw-r--r--vendor/chillerlan/php-settings-container/src/SettingsContainerInterface.php104
-rw-r--r--vendor/chillerlan/php-settings-container/tests/ContainerTest.php105
-rw-r--r--vendor/chillerlan/php-settings-container/tests/TestContainer.php29
-rw-r--r--vendor/chillerlan/php-settings-container/tests/TestOptionsTrait.php42
-rw-r--r--vendor/composer/ClassLoader.php479
-rw-r--r--vendor/composer/InstalledVersions.php337
-rw-r--r--vendor/composer/LICENSE21
-rw-r--r--vendor/composer/autoload_classmap.php10
-rw-r--r--vendor/composer/autoload_files.php99
-rw-r--r--vendor/composer/autoload_namespaces.php9
-rw-r--r--vendor/composer/autoload_psr4.php15
-rw-r--r--vendor/composer/autoload_real.php75
-rw-r--r--vendor/composer/autoload_static.php168
-rw-r--r--vendor/composer/installed.json500
-rw-r--r--vendor/composer/installed.php78
-rw-r--r--vendor/composer/platform_check.php26
-rw-r--r--vendor/paragonie/constant_time_encoding/.gitignore2
-rw-r--r--vendor/paragonie/constant_time_encoding/.travis.yml24
-rw-r--r--vendor/paragonie/constant_time_encoding/LICENSE.txt48
-rw-r--r--vendor/paragonie/constant_time_encoding/README.md84
-rw-r--r--vendor/paragonie/constant_time_encoding/composer.json51
-rw-r--r--vendor/paragonie/constant_time_encoding/phpunit.xml.dist13
-rw-r--r--vendor/paragonie/constant_time_encoding/psalm.xml9
-rw-r--r--vendor/paragonie/constant_time_encoding/src/Base32.php471
-rw-r--r--vendor/paragonie/constant_time_encoding/src/Base32Hex.php111
-rw-r--r--vendor/paragonie/constant_time_encoding/src/Base64.php271
-rw-r--r--vendor/paragonie/constant_time_encoding/src/Base64DotSlash.php88
-rw-r--r--vendor/paragonie/constant_time_encoding/src/Base64DotSlashOrdered.php82
-rw-r--r--vendor/paragonie/constant_time_encoding/src/Base64UrlSafe.php95
-rw-r--r--vendor/paragonie/constant_time_encoding/src/Binary.php85
-rw-r--r--vendor/paragonie/constant_time_encoding/src/EncoderInterface.php52
-rw-r--r--vendor/paragonie/constant_time_encoding/src/Encoding.php260
-rw-r--r--vendor/paragonie/constant_time_encoding/src/Hex.php159
-rw-r--r--vendor/paragonie/constant_time_encoding/src/RFC4648.php175
-rw-r--r--vendor/paragonie/constant_time_encoding/tests/Base32HexTest.php49
-rw-r--r--vendor/paragonie/constant_time_encoding/tests/Base32Test.php50
-rw-r--r--vendor/paragonie/constant_time_encoding/tests/Base64DotSlashOrderedTest.php34
-rw-r--r--vendor/paragonie/constant_time_encoding/tests/Base64DotSlashTest.php34
-rw-r--r--vendor/paragonie/constant_time_encoding/tests/Base64Test.php79
-rw-r--r--vendor/paragonie/constant_time_encoding/tests/Base64UrlSafeTest.php58
-rw-r--r--vendor/paragonie/constant_time_encoding/tests/EncodingTest.php307
-rw-r--r--vendor/paragonie/constant_time_encoding/tests/HexTest.php39
-rw-r--r--vendor/paragonie/constant_time_encoding/tests/RFC4648Test.php84
-rw-r--r--vendor/spomky-labs/otphp/.github/CONTRIBUTING.md25
-rw-r--r--vendor/spomky-labs/otphp/.github/ISSUE_TEMPLATE.md16
-rw-r--r--vendor/spomky-labs/otphp/.github/PULL_REQUEST_TEMPLATE.md21
-rw-r--r--vendor/spomky-labs/otphp/.github/stale.yml17
-rw-r--r--vendor/spomky-labs/otphp/.php_cs.dist61
-rw-r--r--vendor/spomky-labs/otphp/CODE_OF_CONDUCT.md46
-rw-r--r--vendor/spomky-labs/otphp/LICENSE20
-rw-r--r--vendor/spomky-labs/otphp/composer.json50
-rw-r--r--vendor/spomky-labs/otphp/phpstan.neon13
-rw-r--r--vendor/spomky-labs/otphp/src/Factory.php115
-rw-r--r--vendor/spomky-labs/otphp/src/FactoryInterface.php23
-rw-r--r--vendor/spomky-labs/otphp/src/HOTP.php103
-rw-r--r--vendor/spomky-labs/otphp/src/HOTPInterface.php29
-rw-r--r--vendor/spomky-labs/otphp/src/OTP.php114
-rw-r--r--vendor/spomky-labs/otphp/src/OTPInterface.php97
-rw-r--r--vendor/spomky-labs/otphp/src/ParameterTrait.php196
-rw-r--r--vendor/spomky-labs/otphp/src/TOTP.php159
-rw-r--r--vendor/spomky-labs/otphp/src/TOTPInterface.php36
-rw-r--r--vendor/thecodingmachine/safe/LICENSE21
-rw-r--r--vendor/thecodingmachine/safe/README.md178
-rw-r--r--vendor/thecodingmachine/safe/composer.json123
-rw-r--r--vendor/thecodingmachine/safe/deprecated/Exceptions/ApcException.php11
-rw-r--r--vendor/thecodingmachine/safe/deprecated/Exceptions/LibeventException.php11
-rw-r--r--vendor/thecodingmachine/safe/deprecated/Exceptions/MssqlException.php11
-rw-r--r--vendor/thecodingmachine/safe/deprecated/Exceptions/StatsException.php11
-rw-r--r--vendor/thecodingmachine/safe/deprecated/apc.php238
-rw-r--r--vendor/thecodingmachine/safe/deprecated/functionsList.php56
-rw-r--r--vendor/thecodingmachine/safe/deprecated/libevent.php496
-rw-r--r--vendor/thecodingmachine/safe/deprecated/mssql.php426
-rw-r--r--vendor/thecodingmachine/safe/deprecated/stats.php108
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/.gitkeep0
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/ApacheException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/ApcuException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/ArrayException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/Bzip2Exception.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/CalendarException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/ClassobjException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/ComException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/CubridException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/DatetimeException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/DirException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/EioException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/ErrorfuncException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/ExecException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/FileinfoException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/FilesystemException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/FilterException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/FpmException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/FtpException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/FunchandException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/GmpException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/GnupgException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/HashException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/IbaseException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/IbmDb2Exception.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/IconvException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/ImageException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/ImapException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/InfoException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/IngresiiException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/InotifyException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/LdapException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/LibxmlException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/LzfException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/MailparseException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/MbstringException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/MiscException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/MsqlException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/MysqlException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/MysqliException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/MysqlndMsException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/MysqlndQcException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/NetworkException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/Oci8Exception.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/OpcacheException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/OutcontrolException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/PasswordException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/PcntlException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/PdfException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/PgsqlException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/PosixException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/PsException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/PspellException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/ReadlineException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/RpminfoException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/RrdException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/SemException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/SessionException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/ShmopException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/SimplexmlException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/SocketsException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/SodiumException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/SolrException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/SplException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/SqlsrvException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/SsdeepException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/Ssh2Exception.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/StreamException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/StringsException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/SwooleException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/UodbcException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/UopzException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/UrlException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/VarException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/XdiffException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/XmlException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/XmlrpcException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/YamlException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/YazException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/ZipException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/Exceptions/ZlibException.php11
-rw-r--r--vendor/thecodingmachine/safe/generated/apache.php177
-rw-r--r--vendor/thecodingmachine/safe/generated/apcu.php112
-rw-r--r--vendor/thecodingmachine/safe/generated/array.php464
-rw-r--r--vendor/thecodingmachine/safe/generated/bzip2.php96
-rw-r--r--vendor/thecodingmachine/safe/generated/calendar.php27
-rw-r--r--vendor/thecodingmachine/safe/generated/classobj.php25
-rw-r--r--vendor/thecodingmachine/safe/generated/com.php127
-rw-r--r--vendor/thecodingmachine/safe/generated/cubrid.php395
-rw-r--r--vendor/thecodingmachine/safe/generated/curl.php3156
-rw-r--r--vendor/thecodingmachine/safe/generated/datetime.php631
-rw-r--r--vendor/thecodingmachine/safe/generated/dir.php157
-rw-r--r--vendor/thecodingmachine/safe/generated/eio.php2071
-rw-r--r--vendor/thecodingmachine/safe/generated/errorfunc.php82
-rw-r--r--vendor/thecodingmachine/safe/generated/exec.php159
-rw-r--r--vendor/thecodingmachine/safe/generated/fileinfo.php75
-rw-r--r--vendor/thecodingmachine/safe/generated/filesystem.php1488
-rw-r--r--vendor/thecodingmachine/safe/generated/filter.php93
-rw-r--r--vendor/thecodingmachine/safe/generated/fpm.php22
-rw-r--r--vendor/thecodingmachine/safe/generated/ftp.php496
-rw-r--r--vendor/thecodingmachine/safe/generated/funchand.php47
-rw-r--r--vendor/thecodingmachine/safe/generated/functionsList.php1070
-rw-r--r--vendor/thecodingmachine/safe/generated/gmp.php87
-rw-r--r--vendor/thecodingmachine/safe/generated/gnupg.php168
-rw-r--r--vendor/thecodingmachine/safe/generated/hash.php61
-rw-r--r--vendor/thecodingmachine/safe/generated/ibase.php633
-rw-r--r--vendor/thecodingmachine/safe/generated/ibmDb2.php1221
-rw-r--r--vendor/thecodingmachine/safe/generated/iconv.php96
-rw-r--r--vendor/thecodingmachine/safe/generated/image.php2704
-rw-r--r--vendor/thecodingmachine/safe/generated/imap.php1481
-rw-r--r--vendor/thecodingmachine/safe/generated/info.php511
-rw-r--r--vendor/thecodingmachine/safe/generated/ingres-ii.php720
-rw-r--r--vendor/thecodingmachine/safe/generated/inotify.php44
-rw-r--r--vendor/thecodingmachine/safe/generated/json.php73
-rw-r--r--vendor/thecodingmachine/safe/generated/ldap.php1603
-rw-r--r--vendor/thecodingmachine/safe/generated/libxml.php43
-rw-r--r--vendor/thecodingmachine/safe/generated/lzf.php44
-rw-r--r--vendor/thecodingmachine/safe/generated/mailparse.php127
-rw-r--r--vendor/thecodingmachine/safe/generated/mbstring.php526
-rw-r--r--vendor/thecodingmachine/safe/generated/misc.php464
-rw-r--r--vendor/thecodingmachine/safe/generated/msql.php443
-rw-r--r--vendor/thecodingmachine/safe/generated/mysql.php938
-rw-r--r--vendor/thecodingmachine/safe/generated/mysqli.php42
-rw-r--r--vendor/thecodingmachine/safe/generated/mysqlndMs.php119
-rw-r--r--vendor/thecodingmachine/safe/generated/mysqlndQc.php103
-rw-r--r--vendor/thecodingmachine/safe/generated/network.php639
-rw-r--r--vendor/thecodingmachine/safe/generated/oci8.php1721
-rw-r--r--vendor/thecodingmachine/safe/generated/opcache.php42
-rw-r--r--vendor/thecodingmachine/safe/generated/openssl.php1088
-rw-r--r--vendor/thecodingmachine/safe/generated/outcontrol.php100
-rw-r--r--vendor/thecodingmachine/safe/generated/password.php126
-rw-r--r--vendor/thecodingmachine/safe/generated/pcntl.php166
-rw-r--r--vendor/thecodingmachine/safe/generated/pcre.php659
-rw-r--r--vendor/thecodingmachine/safe/generated/pdf.php1553
-rw-r--r--vendor/thecodingmachine/safe/generated/pgsql.php1878
-rw-r--r--vendor/thecodingmachine/safe/generated/posix.php329
-rw-r--r--vendor/thecodingmachine/safe/generated/ps.php1812
-rw-r--r--vendor/thecodingmachine/safe/generated/pspell.php451
-rw-r--r--vendor/thecodingmachine/safe/generated/readline.php157
-rw-r--r--vendor/thecodingmachine/safe/generated/rpminfo.php21
-rw-r--r--vendor/thecodingmachine/safe/generated/rrd.php23
-rw-r--r--vendor/thecodingmachine/safe/generated/sem.php367
-rw-r--r--vendor/thecodingmachine/safe/generated/session.php153
-rw-r--r--vendor/thecodingmachine/safe/generated/shmop.php68
-rw-r--r--vendor/thecodingmachine/safe/generated/simplexml.php94
-rw-r--r--vendor/thecodingmachine/safe/generated/sockets.php813
-rw-r--r--vendor/thecodingmachine/safe/generated/sodium.php58
-rw-r--r--vendor/thecodingmachine/safe/generated/solr.php22
-rw-r--r--vendor/thecodingmachine/safe/generated/spl.php139
-rw-r--r--vendor/thecodingmachine/safe/generated/sqlsrv.php429
-rw-r--r--vendor/thecodingmachine/safe/generated/ssdeep.php70
-rw-r--r--vendor/thecodingmachine/safe/generated/ssh2.php641
-rw-r--r--vendor/thecodingmachine/safe/generated/stream.php609
-rw-r--r--vendor/thecodingmachine/safe/generated/strings.php846
-rw-r--r--vendor/thecodingmachine/safe/generated/swoole.php108
-rw-r--r--vendor/thecodingmachine/safe/generated/uodbc.php1009
-rw-r--r--vendor/thecodingmachine/safe/generated/uopz.php40
-rw-r--r--vendor/thecodingmachine/safe/generated/url.php144
-rw-r--r--vendor/thecodingmachine/safe/generated/var.php60
-rw-r--r--vendor/thecodingmachine/safe/generated/xdiff.php236
-rw-r--r--vendor/thecodingmachine/safe/generated/xml.php95
-rw-r--r--vendor/thecodingmachine/safe/generated/xmlrpc.php22
-rw-r--r--vendor/thecodingmachine/safe/generated/yaml.php97
-rw-r--r--vendor/thecodingmachine/safe/generated/yaz.php438
-rw-r--r--vendor/thecodingmachine/safe/generated/zip.php71
-rw-r--r--vendor/thecodingmachine/safe/generated/zlib.php611
-rw-r--r--vendor/thecodingmachine/safe/lib/DateTime.php81
-rw-r--r--vendor/thecodingmachine/safe/lib/DateTimeImmutable.php262
-rw-r--r--vendor/thecodingmachine/safe/lib/Exceptions/CurlException.php15
-rw-r--r--vendor/thecodingmachine/safe/lib/Exceptions/JsonException.php12
-rw-r--r--vendor/thecodingmachine/safe/lib/Exceptions/OpensslException.php12
-rw-r--r--vendor/thecodingmachine/safe/lib/Exceptions/PcreException.php21
-rw-r--r--vendor/thecodingmachine/safe/lib/Exceptions/SafeExceptionInterface.php9
-rw-r--r--vendor/thecodingmachine/safe/lib/special_cases.php241
-rw-r--r--vendor/thecodingmachine/safe/rector-migrate-0.7.php1081
355 files changed, 62513 insertions, 1042 deletions
diff --git a/vendor/OTPHP/Base32.php b/vendor/OTPHP/Base32.php
deleted file mode 100644
index f0dc2f16b..000000000
--- a/vendor/OTPHP/Base32.php
+++ /dev/null
@@ -1,85 +0,0 @@
-<?php
-
-namespace OTPHP;
-
-/**
- * Encode in Base32 based on RFC 4648.
- * Requires 20% more space than base64
- * Great for case-insensitive filesystems like Windows and URL's (except for = char which can be excluded using the pad option for urls)
- *
- * @package default
- * @author Bryan Ruiz
- **/
-class Base32 {
-
- private static $map = array(
- 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', // 7
- 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', // 15
- 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', // 23
- 'Y', 'Z', '2', '3', '4', '5', '6', '7', // 31
- '=' // padding char
- );
-
- private static $flippedMap = array(
- 'A'=>'0', 'B'=>'1', 'C'=>'2', 'D'=>'3', 'E'=>'4', 'F'=>'5', 'G'=>'6', 'H'=>'7',
- 'I'=>'8', 'J'=>'9', 'K'=>'10', 'L'=>'11', 'M'=>'12', 'N'=>'13', 'O'=>'14', 'P'=>'15',
- 'Q'=>'16', 'R'=>'17', 'S'=>'18', 'T'=>'19', 'U'=>'20', 'V'=>'21', 'W'=>'22', 'X'=>'23',
- 'Y'=>'24', 'Z'=>'25', '2'=>'26', '3'=>'27', '4'=>'28', '5'=>'29', '6'=>'30', '7'=>'31'
- );
-
- /**
- * Use padding false when encoding for urls
- *
- * @return base32 encoded string
- * @author Bryan Ruiz
- **/
- public static function encode($input, $padding = true) {
- if(empty($input)) return "";
- $input = str_split($input);
- $binaryString = "";
- for($i = 0; $i < count($input); $i++) {
- $binaryString .= str_pad(base_convert(ord($input[$i]), 10, 2), 8, '0', STR_PAD_LEFT);
- }
- $fiveBitBinaryArray = str_split($binaryString, 5);
- $base32 = "";
- $i=0;
- while($i < count($fiveBitBinaryArray)) {
- $base32 .= self::$map[base_convert(str_pad($fiveBitBinaryArray[$i], 5,'0'), 2, 10)];
- $i++;
- }
- if($padding && ($x = strlen($binaryString) % 40) != 0) {
- if($x == 8) $base32 .= str_repeat(self::$map[32], 6);
- else if($x == 16) $base32 .= str_repeat(self::$map[32], 4);
- else if($x == 24) $base32 .= str_repeat(self::$map[32], 3);
- else if($x == 32) $base32 .= self::$map[32];
- }
- return $base32;
- }
-
- public static function decode($input) {
- if(empty($input)) return;
- $paddingCharCount = substr_count($input, self::$map[32]);
- $allowedValues = array(6,4,3,1,0);
- if(!in_array($paddingCharCount, $allowedValues)) return false;
- for($i=0; $i<4; $i++){
- if($paddingCharCount == $allowedValues[$i] &&
- substr($input, -($allowedValues[$i])) != str_repeat(self::$map[32], $allowedValues[$i])) return false;
- }
- $input = str_replace('=','', $input);
- $input = str_split($input);
- $binaryString = "";
- for($i=0; $i < count($input); $i = $i+8) {
- $x = "";
- if(!in_array($input[$i], self::$map)) return false;
- for($j=0; $j < 8; $j++) {
- $x .= str_pad(base_convert(@self::$flippedMap[@$input[$i + $j]], 10, 2), 5, '0', STR_PAD_LEFT);
- }
- $eightBits = str_split($x, 8);
- for($z = 0; $z < count($eightBits); $z++) {
- $binaryString .= ( ($y = chr(base_convert($eightBits[$z], 2, 10))) || ord($y) == 48 ) ? $y:"";
- }
- }
- return $binaryString;
- }
-}
-
diff --git a/vendor/OTPHP/HOTP.php b/vendor/OTPHP/HOTP.php
deleted file mode 100644
index 7092fd9ff..000000000
--- a/vendor/OTPHP/HOTP.php
+++ /dev/null
@@ -1,74 +0,0 @@
-<?php
-/*
- * Copyright (c) 2011 Le Lag
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
-
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-namespace OTPHP {
- /**
- * HOTP - One time password generator
- *
- * The HOTP class allow for the generation
- * and verification of one-time password using
- * the HOTP specified algorithm.
- *
- * This class is meant to be compatible with
- * Google Authenticator
- *
- * This class was originally ported from the rotp
- * ruby library available at https://github.com/mdp/rotp
- */
- class HOTP extends OTP {
- /**
- * Get the password for a specific counter value
- * @param integer $count the counter which is used to
- * seed the hmac hash function.
- * @return integer the One Time Password
- */
- public function at($count) {
- return $this->generateOTP($count);
- }
-
-
- /**
- * Verify if a password is valid for a specific counter value
- *
- * @param integer $otp the one-time password
- * @param integer $counter the counter value
- * @return bool true if the counter is valid, false otherwise
- */
- public function verify($otp, $counter) {
- return ($otp == $this->at($counter));
- }
-
- /**
- * Returns the uri for a specific secret for hotp method.
- * Can be encoded as a image for simple configuration in
- * Google Authenticator.
- *
- * @param string $name the name of the account / profile
- * @param integer $initial_count the initial counter
- * @return string the uri for the hmac secret
- */
- public function provisioning_uri($name, $initial_count) {
- return "otpauth://hotp/".urlencode($name)."?secret={$this->secret}&counter=$initial_count";
- }
- }
-
-}
diff --git a/vendor/OTPHP/OTP.php b/vendor/OTPHP/OTP.php
deleted file mode 100644
index d1995ef99..000000000
--- a/vendor/OTPHP/OTP.php
+++ /dev/null
@@ -1,120 +0,0 @@
-<?php
-/*
- * Copyright (c) 2011 Le Lag
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
-
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-namespace OTPHP {
-/**
- * One Time Password Generator
- *
- * The OTP class allow the generation of one-time
- * password that is described in rfc 4xxx.
- *
- * This is class is meant to be compatible with
- * Google Authenticator.
- *
- * This class was originally ported from the rotp
- * ruby library available at https://github.com/mdp/rotp
- */
-class OTP {
- /**
- * The base32 encoded secret key
- * @var string
- */
- public $secret;
-
- /**
- * The algorithm used for the hmac hash function
- * @var string
- */
- public $digest;
-
- /**
- * The number of digits in the one-time password
- * @var integer
- */
- public $digits;
-
- /**
- * Constructor for the OTP class
- * @param string $secret the secret key
- * @param array $opt options array can contain the
- * following keys :
- * @param integer digits : the number of digits in the one time password
- * Currently Google Authenticator only support 6. Defaults to 6.
- * @param string digest : the algorithm used for the hmac hash function
- * Google Authenticator only support sha1. Defaults to sha1
- *
- * @return new OTP class.
- */
- public function __construct($secret, $opt = Array()) {
- $this->digits = isset($opt['digits']) ? $opt['digits'] : 6;
- $this->digest = isset($opt['digest']) ? $opt['digest'] : 'sha1';
- $this->secret = $secret;
- }
-
- /**
- * Generate a one-time password
- *
- * @param integer $input : number used to seed the hmac hash function.
- * This number is usually a counter (HOTP) or calculated based on the current
- * timestamp (see TOTP class).
- * @return integer the one-time password
- */
- public function generateOTP($input) {
- $hash = hash_hmac($this->digest, $this->intToBytestring($input), $this->byteSecret());
- foreach(str_split($hash, 2) as $hex) { // stupid PHP has bin2hex but no hex2bin WTF
- $hmac[] = hexdec($hex);
- }
- $offset = $hmac[19] & 0xf;
- $code = ($hmac[$offset+0] & 0x7F) << 24 |
- ($hmac[$offset + 1] & 0xFF) << 16 |
- ($hmac[$offset + 2] & 0xFF) << 8 |
- ($hmac[$offset + 3] & 0xFF);
- return $code % pow(10, $this->digits);
- }
-
- /**
- * Returns the binary value of the base32 encoded secret
- * @access private
- * This method should be private but was left public for
- * phpunit tests to work.
- * @return binary secret key
- */
- public function byteSecret() {
- return Base32::decode($this->secret);
- }
-
- /**
- * Turns an integer in a OATH bytestring
- * @param integer $int
- * @access private
- * @return string bytestring
- */
- public function intToBytestring($int) {
- $result = Array();
- while($int != 0) {
- $result[] = chr($int & 0xFF);
- $int >>= 8;
- }
- return str_pad(join(array_reverse($result)), 8, "\000", STR_PAD_LEFT);
- }
- }
-}
diff --git a/vendor/OTPHP/OTPHP.php b/vendor/OTPHP/OTPHP.php
deleted file mode 100644
index a6c6f8d66..000000000
--- a/vendor/OTPHP/OTPHP.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-/*
- * Copyright (c) 2011 Le Lag
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
-
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-require_once dirname(__FILE__).'/../vendor/libs.php';
-require_once dirname(__FILE__).'/otp.php';
-require_once dirname(__FILE__).'/hotp.php';
-require_once dirname(__FILE__).'/totp.php';
-
diff --git a/vendor/OTPHP/TOTP.php b/vendor/OTPHP/TOTP.php
deleted file mode 100644
index 10a1f42f3..000000000
--- a/vendor/OTPHP/TOTP.php
+++ /dev/null
@@ -1,106 +0,0 @@
-<?php
-/*
- * Copyright (c) 2011 Le Lag
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
-
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-namespace OTPHP {
- /**
- * TOTP - One time password generator
- *
- * The TOTP class allow for the generation
- * and verification of one-time password using
- * the TOTP specified algorithm.
- *
- * This class is meant to be compatible with
- * Google Authenticator
- *
- * This class was originally ported from the rotp
- * ruby library available at https://github.com/mdp/rotp
- */
- class TOTP extends OTP {
- /**
- * The interval in seconds for a one-time password timeframe
- * Defaults to 30
- * @var integer
- */
- public $interval;
-
- public function __construct($s, $opt = Array()) {
- $this->interval = isset($opt['interval']) ? $opt['interval'] : 30;
- parent::__construct($s, $opt);
- }
-
- /**
- * Get the password for a specific timestamp value
- *
- * @param integer $timestamp the timestamp which is timecoded and
- * used to seed the hmac hash function.
- * @return integer the One Time Password
- */
- public function at($timestamp) {
- return $this->generateOTP($this->timecode($timestamp));
- }
-
- /**
- * Get the password for the current timestamp value
- *
- * @return integer the current One Time Password
- */
- public function now() {
- return $this->generateOTP($this->timecode(time()));
- }
-
- /**
- * Verify if a password is valid for a specific counter value
- *
- * @param integer $otp the one-time password
- * @param integer $timestamp the timestamp for the a given time, defaults to current time.
- * @return bool true if the counter is valid, false otherwise
- */
- public function verify($otp, $timestamp = null) {
- if($timestamp === null)
- $timestamp = time();
- return ($otp == $this->at($timestamp));
- }
-
- /**
- * Returns the uri for a specific secret for totp method.
- * Can be encoded as a image for simple configuration in
- * Google Authenticator.
- *
- * @param string $name the name of the account / profile
- * @return string the uri for the hmac secret
- */
- public function provisioning_uri($name) {
- return "otpauth://totp/".urlencode($name)."?secret={$this->secret}";
- }
-
- /**
- * Transform a timestamp in a counter based on specified internal
- *
- * @param integer $timestamp
- * @return integer the timecode
- */
- protected function timecode($timestamp) {
- return (int)( (((int)$timestamp * 1000) / ($this->interval * 1000)));
- }
- }
-
-}
diff --git a/vendor/Psr/Log/AbstractLogger.php b/vendor/Psr/Log/AbstractLogger.php
deleted file mode 100644
index 90e721af2..000000000
--- a/vendor/Psr/Log/AbstractLogger.php
+++ /dev/null
@@ -1,128 +0,0 @@
-<?php
-
-namespace Psr\Log;
-
-/**
- * This is a simple Logger implementation that other Loggers can inherit from.
- *
- * It simply delegates all log-level-specific methods to the `log` method to
- * reduce boilerplate code that a simple Logger that does the same thing with
- * messages regardless of the error level has to implement.
- */
-abstract class AbstractLogger implements LoggerInterface
-{
- /**
- * System is unusable.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function emergency($message, array $context = array())
- {
- $this->log(LogLevel::EMERGENCY, $message, $context);
- }
-
- /**
- * Action must be taken immediately.
- *
- * Example: Entire website down, database unavailable, etc. This should
- * trigger the SMS alerts and wake you up.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function alert($message, array $context = array())
- {
- $this->log(LogLevel::ALERT, $message, $context);
- }
-
- /**
- * Critical conditions.
- *
- * Example: Application component unavailable, unexpected exception.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function critical($message, array $context = array())
- {
- $this->log(LogLevel::CRITICAL, $message, $context);
- }
-
- /**
- * Runtime errors that do not require immediate action but should typically
- * be logged and monitored.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function error($message, array $context = array())
- {
- $this->log(LogLevel::ERROR, $message, $context);
- }
-
- /**
- * Exceptional occurrences that are not errors.
- *
- * Example: Use of deprecated APIs, poor use of an API, undesirable things
- * that are not necessarily wrong.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function warning($message, array $context = array())
- {
- $this->log(LogLevel::WARNING, $message, $context);
- }
-
- /**
- * Normal but significant events.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function notice($message, array $context = array())
- {
- $this->log(LogLevel::NOTICE, $message, $context);
- }
-
- /**
- * Interesting events.
- *
- * Example: User logs in, SQL logs.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function info($message, array $context = array())
- {
- $this->log(LogLevel::INFO, $message, $context);
- }
-
- /**
- * Detailed debug information.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function debug($message, array $context = array())
- {
- $this->log(LogLevel::DEBUG, $message, $context);
- }
-}
diff --git a/vendor/Psr/Log/InvalidArgumentException.php b/vendor/Psr/Log/InvalidArgumentException.php
deleted file mode 100644
index 67f852d1d..000000000
--- a/vendor/Psr/Log/InvalidArgumentException.php
+++ /dev/null
@@ -1,7 +0,0 @@
-<?php
-
-namespace Psr\Log;
-
-class InvalidArgumentException extends \InvalidArgumentException
-{
-}
diff --git a/vendor/Psr/Log/LogLevel.php b/vendor/Psr/Log/LogLevel.php
deleted file mode 100644
index 9cebcace6..000000000
--- a/vendor/Psr/Log/LogLevel.php
+++ /dev/null
@@ -1,18 +0,0 @@
-<?php
-
-namespace Psr\Log;
-
-/**
- * Describes log levels.
- */
-class LogLevel
-{
- const EMERGENCY = 'emergency';
- const ALERT = 'alert';
- const CRITICAL = 'critical';
- const ERROR = 'error';
- const WARNING = 'warning';
- const NOTICE = 'notice';
- const INFO = 'info';
- const DEBUG = 'debug';
-}
diff --git a/vendor/Psr/Log/LoggerAwareInterface.php b/vendor/Psr/Log/LoggerAwareInterface.php
deleted file mode 100644
index 4d64f4786..000000000
--- a/vendor/Psr/Log/LoggerAwareInterface.php
+++ /dev/null
@@ -1,18 +0,0 @@
-<?php
-
-namespace Psr\Log;
-
-/**
- * Describes a logger-aware instance.
- */
-interface LoggerAwareInterface
-{
- /**
- * Sets a logger instance on the object.
- *
- * @param LoggerInterface $logger
- *
- * @return void
- */
- public function setLogger(LoggerInterface $logger);
-}
diff --git a/vendor/Psr/Log/LoggerAwareTrait.php b/vendor/Psr/Log/LoggerAwareTrait.php
deleted file mode 100644
index 639f79bda..000000000
--- a/vendor/Psr/Log/LoggerAwareTrait.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-
-namespace Psr\Log;
-
-/**
- * Basic Implementation of LoggerAwareInterface.
- */
-trait LoggerAwareTrait
-{
- /**
- * The logger instance.
- *
- * @var LoggerInterface
- */
- protected $logger;
-
- /**
- * Sets a logger.
- *
- * @param LoggerInterface $logger
- */
- public function setLogger(LoggerInterface $logger)
- {
- $this->logger = $logger;
- }
-}
diff --git a/vendor/Psr/Log/LoggerInterface.php b/vendor/Psr/Log/LoggerInterface.php
deleted file mode 100644
index 5ea72438b..000000000
--- a/vendor/Psr/Log/LoggerInterface.php
+++ /dev/null
@@ -1,123 +0,0 @@
-<?php
-
-namespace Psr\Log;
-
-/**
- * Describes a logger instance.
- *
- * The message MUST be a string or object implementing __toString().
- *
- * The message MAY contain placeholders in the form: {foo} where foo
- * will be replaced by the context data in key "foo".
- *
- * The context array can contain arbitrary data. The only assumption that
- * can be made by implementors is that if an Exception instance is given
- * to produce a stack trace, it MUST be in a key named "exception".
- *
- * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md
- * for the full interface specification.
- */
-interface LoggerInterface
-{
- /**
- * System is unusable.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function emergency($message, array $context = array());
-
- /**
- * Action must be taken immediately.
- *
- * Example: Entire website down, database unavailable, etc. This should
- * trigger the SMS alerts and wake you up.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function alert($message, array $context = array());
-
- /**
- * Critical conditions.
- *
- * Example: Application component unavailable, unexpected exception.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function critical($message, array $context = array());
-
- /**
- * Runtime errors that do not require immediate action but should typically
- * be logged and monitored.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function error($message, array $context = array());
-
- /**
- * Exceptional occurrences that are not errors.
- *
- * Example: Use of deprecated APIs, poor use of an API, undesirable things
- * that are not necessarily wrong.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function warning($message, array $context = array());
-
- /**
- * Normal but significant events.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function notice($message, array $context = array());
-
- /**
- * Interesting events.
- *
- * Example: User logs in, SQL logs.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function info($message, array $context = array());
-
- /**
- * Detailed debug information.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function debug($message, array $context = array());
-
- /**
- * Logs with an arbitrary level.
- *
- * @param mixed $level
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function log($level, $message, array $context = array());
-}
diff --git a/vendor/Psr/Log/LoggerTrait.php b/vendor/Psr/Log/LoggerTrait.php
deleted file mode 100644
index 867225df1..000000000
--- a/vendor/Psr/Log/LoggerTrait.php
+++ /dev/null
@@ -1,140 +0,0 @@
-<?php
-
-namespace Psr\Log;
-
-/**
- * This is a simple Logger trait that classes unable to extend AbstractLogger
- * (because they extend another class, etc) can include.
- *
- * It simply delegates all log-level-specific methods to the `log` method to
- * reduce boilerplate code that a simple Logger that does the same thing with
- * messages regardless of the error level has to implement.
- */
-trait LoggerTrait
-{
- /**
- * System is unusable.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function emergency($message, array $context = array())
- {
- $this->log(LogLevel::EMERGENCY, $message, $context);
- }
-
- /**
- * Action must be taken immediately.
- *
- * Example: Entire website down, database unavailable, etc. This should
- * trigger the SMS alerts and wake you up.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function alert($message, array $context = array())
- {
- $this->log(LogLevel::ALERT, $message, $context);
- }
-
- /**
- * Critical conditions.
- *
- * Example: Application component unavailable, unexpected exception.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function critical($message, array $context = array())
- {
- $this->log(LogLevel::CRITICAL, $message, $context);
- }
-
- /**
- * Runtime errors that do not require immediate action but should typically
- * be logged and monitored.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function error($message, array $context = array())
- {
- $this->log(LogLevel::ERROR, $message, $context);
- }
-
- /**
- * Exceptional occurrences that are not errors.
- *
- * Example: Use of deprecated APIs, poor use of an API, undesirable things
- * that are not necessarily wrong.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function warning($message, array $context = array())
- {
- $this->log(LogLevel::WARNING, $message, $context);
- }
-
- /**
- * Normal but significant events.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function notice($message, array $context = array())
- {
- $this->log(LogLevel::NOTICE, $message, $context);
- }
-
- /**
- * Interesting events.
- *
- * Example: User logs in, SQL logs.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function info($message, array $context = array())
- {
- $this->log(LogLevel::INFO, $message, $context);
- }
-
- /**
- * Detailed debug information.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function debug($message, array $context = array())
- {
- $this->log(LogLevel::DEBUG, $message, $context);
- }
-
- /**
- * Logs with an arbitrary level.
- *
- * @param mixed $level
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- abstract public function log($level, $message, array $context = array());
-}
diff --git a/vendor/Psr/Log/NullLogger.php b/vendor/Psr/Log/NullLogger.php
deleted file mode 100644
index d8cd682c8..000000000
--- a/vendor/Psr/Log/NullLogger.php
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-
-namespace Psr\Log;
-
-/**
- * This Logger can be used to avoid conditional log calls.
- *
- * Logging should always be optional, and if no logger is provided to your
- * library creating a NullLogger instance to have something to throw logs at
- * is a good way to avoid littering your code with `if ($this->logger) { }`
- * blocks.
- */
-class NullLogger extends AbstractLogger
-{
- /**
- * Logs with an arbitrary level.
- *
- * @param mixed $level
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function log($level, $message, array $context = array())
- {
- // noop
- }
-}
diff --git a/vendor/Psr/Log/Test/LoggerInterfaceTest.php b/vendor/Psr/Log/Test/LoggerInterfaceTest.php
deleted file mode 100644
index a0391a52b..000000000
--- a/vendor/Psr/Log/Test/LoggerInterfaceTest.php
+++ /dev/null
@@ -1,140 +0,0 @@
-<?php
-
-namespace Psr\Log\Test;
-
-use Psr\Log\LoggerInterface;
-use Psr\Log\LogLevel;
-
-/**
- * Provides a base test class for ensuring compliance with the LoggerInterface.
- *
- * Implementors can extend the class and implement abstract methods to run this
- * as part of their test suite.
- */
-abstract class LoggerInterfaceTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @return LoggerInterface
- */
- abstract public function getLogger();
-
- /**
- * This must return the log messages in order.
- *
- * The simple formatting of the messages is: "<LOG LEVEL> <MESSAGE>".
- *
- * Example ->error('Foo') would yield "error Foo".
- *
- * @return string[]
- */
- abstract public function getLogs();
-
- public function testImplements()
- {
- $this->assertInstanceOf('Psr\Log\LoggerInterface', $this->getLogger());
- }
-
- /**
- * @dataProvider provideLevelsAndMessages
- */
- public function testLogsAtAllLevels($level, $message)
- {
- $logger = $this->getLogger();
- $logger->{$level}($message, array('user' => 'Bob'));
- $logger->log($level, $message, array('user' => 'Bob'));
-
- $expected = array(
- $level.' message of level '.$level.' with context: Bob',
- $level.' message of level '.$level.' with context: Bob',
- );
- $this->assertEquals($expected, $this->getLogs());
- }
-
- public function provideLevelsAndMessages()
- {
- return array(
- LogLevel::EMERGENCY => array(LogLevel::EMERGENCY, 'message of level emergency with context: {user}'),
- LogLevel::ALERT => array(LogLevel::ALERT, 'message of level alert with context: {user}'),
- LogLevel::CRITICAL => array(LogLevel::CRITICAL, 'message of level critical with context: {user}'),
- LogLevel::ERROR => array(LogLevel::ERROR, 'message of level error with context: {user}'),
- LogLevel::WARNING => array(LogLevel::WARNING, 'message of level warning with context: {user}'),
- LogLevel::NOTICE => array(LogLevel::NOTICE, 'message of level notice with context: {user}'),
- LogLevel::INFO => array(LogLevel::INFO, 'message of level info with context: {user}'),
- LogLevel::DEBUG => array(LogLevel::DEBUG, 'message of level debug with context: {user}'),
- );
- }
-
- /**
- * @expectedException \Psr\Log\InvalidArgumentException
- */
- public function testThrowsOnInvalidLevel()
- {
- $logger = $this->getLogger();
- $logger->log('invalid level', 'Foo');
- }
-
- public function testContextReplacement()
- {
- $logger = $this->getLogger();
- $logger->info('{Message {nothing} {user} {foo.bar} a}', array('user' => 'Bob', 'foo.bar' => 'Bar'));
-
- $expected = array('info {Message {nothing} Bob Bar a}');
- $this->assertEquals($expected, $this->getLogs());
- }
-
- public function testObjectCastToString()
- {
- if (method_exists($this, 'createPartialMock')) {
- $dummy = $this->createPartialMock('Psr\Log\Test\DummyTest', array('__toString'));
- } else {
- $dummy = $this->getMock('Psr\Log\Test\DummyTest', array('__toString'));
- }
- $dummy->expects($this->once())
- ->method('__toString')
- ->will($this->returnValue('DUMMY'));
-
- $this->getLogger()->warning($dummy);
-
- $expected = array('warning DUMMY');
- $this->assertEquals($expected, $this->getLogs());
- }
-
- public function testContextCanContainAnything()
- {
- $context = array(
- 'bool' => true,
- 'null' => null,
- 'string' => 'Foo',
- 'int' => 0,
- 'float' => 0.5,
- 'nested' => array('with object' => new DummyTest),
- 'object' => new \DateTime,
- 'resource' => fopen('php://memory', 'r'),
- );
-
- $this->getLogger()->warning('Crazy context data', $context);
-
- $expected = array('warning Crazy context data');
- $this->assertEquals($expected, $this->getLogs());
- }
-
- public function testContextExceptionKeyCanBeExceptionOrOtherValues()
- {
- $logger = $this->getLogger();
- $logger->warning('Random message', array('exception' => 'oops'));
- $logger->critical('Uncaught Exception!', array('exception' => new \LogicException('Fail')));
-
- $expected = array(
- 'warning Random message',
- 'critical Uncaught Exception!'
- );
- $this->assertEquals($expected, $this->getLogs());
- }
-}
-
-class DummyTest
-{
- public function __toString()
- {
- }
-}
diff --git a/vendor/autoload.php b/vendor/autoload.php
new file mode 100644
index 000000000..e6e3ad736
--- /dev/null
+++ b/vendor/autoload.php
@@ -0,0 +1,7 @@
+<?php
+
+// autoload.php @generated by Composer
+
+require_once __DIR__ . '/composer/autoload_real.php';
+
+return ComposerAutoloaderInit19fc2ff1c0f9a92279c7979386bb2056::getLoader();
diff --git a/vendor/beberlei/assert/LICENSE b/vendor/beberlei/assert/LICENSE
new file mode 100644
index 000000000..43672e7e6
--- /dev/null
+++ b/vendor/beberlei/assert/LICENSE
@@ -0,0 +1,11 @@
+Copyright (c) 2011-2013, Benjamin Eberlei
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+- Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+- Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
diff --git a/vendor/beberlei/assert/composer.json b/vendor/beberlei/assert/composer.json
new file mode 100644
index 000000000..e11870470
--- /dev/null
+++ b/vendor/beberlei/assert/composer.json
@@ -0,0 +1,63 @@
+{
+ "name": "beberlei/assert",
+ "description": "Thin assertion library for input validation in business models.",
+ "authors": [
+ {
+ "name": "Benjamin Eberlei",
+ "email": "[email protected]",
+ "role": "Lead Developer"
+ },
+ {
+ "name": "Richard Quadling",
+ "email": "[email protected]",
+ "role": "Collaborator"
+ }
+ ],
+ "license": "BSD-2-Clause",
+ "keywords": [
+ "assert",
+ "assertion",
+ "validation"
+ ],
+ "autoload": {
+ "psr-4": {
+ "Assert\\": "lib/Assert"
+ },
+ "files": [
+ "lib/Assert/functions.php"
+ ]
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "Assert\\Tests\\": "tests/Assert/Tests"
+ },
+ "files": [
+ "tests/Assert/Tests/Fixtures/functions.php"
+ ]
+ },
+ "config": {
+ "sort-packages": true
+ },
+ "require": {
+ "php": "^7",
+ "ext-simplexml": "*",
+ "ext-mbstring": "*",
+ "ext-ctype": "*",
+ "ext-json": "*"
+ },
+ "require-dev": {
+ "friendsofphp/php-cs-fixer": "*",
+ "phpstan/phpstan-shim": "*",
+ "phpunit/phpunit": ">=6.0.0 <8"
+ },
+ "scripts": {
+ "assert:generate-docs": "php bin/generate_method_docs.php",
+ "assert:cs-lint": "php-cs-fixer fix --diff -vvv --dry-run",
+ "assert:cs-fix": "php-cs-fixer fix . -vvv || true",
+ "assert:sa-code": "vendor/bin/phpstan analyse --configuration=phpstan-code.neon --no-progress --ansi -l 7 bin lib",
+ "assert:sa-tests": "vendor/bin/phpstan analyse --configuration=phpstan-tests.neon --no-progress --ansi -l 7 tests"
+ },
+ "suggest": {
+ "ext-intl": "Needed to allow Assertion::count(), Assertion::isCountable(), Assertion::minCount(), and Assertion::maxCount() to operate on ResourceBundles"
+ }
+}
diff --git a/vendor/beberlei/assert/lib/Assert/Assert.php b/vendor/beberlei/assert/lib/Assert/Assert.php
new file mode 100644
index 000000000..6910258d6
--- /dev/null
+++ b/vendor/beberlei/assert/lib/Assert/Assert.php
@@ -0,0 +1,96 @@
+<?php
+
+/**
+ * Assert
+ *
+ * LICENSE
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this package in the file LICENSE.txt.
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to [email protected] so I can send you a copy immediately.
+ */
+
+namespace Assert;
+
+/**
+ * AssertionChain factory.
+ */
+abstract class Assert
+{
+ /** @var string */
+ protected static $lazyAssertionExceptionClass = LazyAssertionException::class;
+
+ /** @var string */
+ protected static $assertionClass = Assertion::class;
+
+ /**
+ * Start validation on a value, returns {@link AssertionChain}.
+ *
+ * The invocation of this method starts an assertion chain
+ * that is happening on the passed value.
+ *
+ * @param mixed $value
+ * @param string|callable|null $defaultMessage
+ * @param string|null $defaultPropertyPath
+ *
+ * @return AssertionChain
+ *
+ * @example
+ *
+ * Assert::that($value)->notEmpty()->integer();
+ * Assert::that($value)->nullOr()->string()->startsWith("Foo");
+ *
+ * The assertion chain can be stateful, that means be careful when you reuse
+ * it. You should never pass around the chain.
+ */
+ public static function that($value, $defaultMessage = null, string $defaultPropertyPath = null): AssertionChain
+ {
+ $assertionChain = new AssertionChain($value, $defaultMessage, $defaultPropertyPath);
+
+ return $assertionChain->setAssertionClassName(static::$assertionClass);
+ }
+
+ /**
+ * Start validation on a set of values, returns {@link AssertionChain}.
+ *
+ * @param mixed $values
+ * @param string|callable|null $defaultMessage
+ * @param string|null $defaultPropertyPath
+ *
+ * @return AssertionChain
+ */
+ public static function thatAll($values, $defaultMessage = null, string $defaultPropertyPath = null): AssertionChain
+ {
+ return static::that($values, $defaultMessage, $defaultPropertyPath)->all();
+ }
+
+ /**
+ * Start validation and allow NULL, returns {@link AssertionChain}.
+ *
+ * @param mixed $value
+ * @param string|callable|null $defaultMessage
+ * @param string|null $defaultPropertyPath
+ *
+ * @return AssertionChain
+ */
+ public static function thatNullOr($value, $defaultMessage = null, string $defaultPropertyPath = null): AssertionChain
+ {
+ return static::that($value, $defaultMessage, $defaultPropertyPath)->nullOr();
+ }
+
+ /**
+ * Create a lazy assertion object.
+ *
+ * @return LazyAssertion
+ */
+ public static function lazy(): LazyAssertion
+ {
+ $lazyAssertion = new LazyAssertion();
+
+ return $lazyAssertion
+ ->setAssertClass(\get_called_class())
+ ->setExceptionClass(static::$lazyAssertionExceptionClass);
+ }
+}
diff --git a/vendor/beberlei/assert/lib/Assert/Assertion.php b/vendor/beberlei/assert/lib/Assert/Assertion.php
new file mode 100644
index 000000000..a8b04e529
--- /dev/null
+++ b/vendor/beberlei/assert/lib/Assert/Assertion.php
@@ -0,0 +1,2825 @@
+<?php
+
+/**
+ * Assert
+ *
+ * LICENSE
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this package in the file LICENSE.txt.
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to [email protected] so I can send you a copy immediately.
+ */
+
+namespace Assert;
+
+use ArrayAccess;
+use BadMethodCallException;
+use Countable;
+use DateTime;
+use ReflectionClass;
+use ReflectionException;
+use ResourceBundle;
+use SimpleXMLElement;
+use Throwable;
+use Traversable;
+
+/**
+ * Assert library.
+ *
+ * @author Benjamin Eberlei <[email protected]>
+ *
+ * @method static bool allAlnum(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is alphanumeric for all values.
+ * @method static bool allBase64(string[] $value, string|callable $message = null, string $propertyPath = null) Assert that a constant is defined for all values.
+ * @method static bool allBetween(mixed[] $value, mixed $lowerLimit, mixed $upperLimit, string|callable $message = null, string $propertyPath = null) Assert that a value is greater or equal than a lower limit, and less than or equal to an upper limit for all values.
+ * @method static bool allBetweenExclusive(mixed[] $value, mixed $lowerLimit, mixed $upperLimit, string|callable $message = null, string $propertyPath = null) Assert that a value is greater than a lower limit, and less than an upper limit for all values.
+ * @method static bool allBetweenLength(mixed[] $value, int $minLength, int $maxLength, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string length is between min and max lengths for all values.
+ * @method static bool allBoolean(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is php boolean for all values.
+ * @method static bool allChoice(mixed[] $value, array $choices, string|callable $message = null, string $propertyPath = null) Assert that value is in array of choices for all values.
+ * @method static bool allChoicesNotEmpty(array[] $values, array $choices, string|callable $message = null, string $propertyPath = null) Determines if the values array has every choice as key and that this choice has content for all values.
+ * @method static bool allClassExists(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that the class exists for all values.
+ * @method static bool allContains(mixed[] $string, string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string contains a sequence of chars for all values.
+ * @method static bool allCount(array[]|Countable[]|ResourceBundle[]|SimpleXMLElement[] $countable, int $count, string|callable $message = null, string $propertyPath = null) Assert that the count of countable is equal to count for all values.
+ * @method static bool allDate(string[] $value, string $format, string|callable $message = null, string $propertyPath = null) Assert that date is valid and corresponds to the given format for all values.
+ * @method static bool allDefined(mixed[] $constant, string|callable $message = null, string $propertyPath = null) Assert that a constant is defined for all values.
+ * @method static bool allDigit(mixed[] $value, string|callable $message = null, string $propertyPath = null) Validates if an integer or integerish is a digit for all values.
+ * @method static bool allDirectory(string[] $value, string|callable $message = null, string $propertyPath = null) Assert that a directory exists for all values.
+ * @method static bool allE164(string[] $value, string|callable $message = null, string $propertyPath = null) Assert that the given string is a valid E164 Phone Number for all values.
+ * @method static bool allEmail(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is an email address (using input_filter/FILTER_VALIDATE_EMAIL) for all values.
+ * @method static bool allEndsWith(mixed[] $string, string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string ends with a sequence of chars for all values.
+ * @method static bool allEq(mixed[] $value, mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are equal (using ==) for all values.
+ * @method static bool allEqArraySubset(mixed[] $value, mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that the array contains the subset for all values.
+ * @method static bool allExtensionLoaded(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that extension is loaded for all values.
+ * @method static bool allExtensionVersion(string[] $extension, string $operator, mixed $version, string|callable $message = null, string $propertyPath = null) Assert that extension is loaded and a specific version is installed for all values.
+ * @method static bool allFalse(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that the value is boolean False for all values.
+ * @method static bool allFile(string[] $value, string|callable $message = null, string $propertyPath = null) Assert that a file exists for all values.
+ * @method static bool allFloat(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is a php float for all values.
+ * @method static bool allGreaterOrEqualThan(mixed[] $value, mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is greater or equal than given limit for all values.
+ * @method static bool allGreaterThan(mixed[] $value, mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is greater than given limit for all values.
+ * @method static bool allImplementsInterface(mixed[] $class, string $interfaceName, string|callable $message = null, string $propertyPath = null) Assert that the class implements the interface for all values.
+ * @method static bool allInArray(mixed[] $value, array $choices, string|callable $message = null, string $propertyPath = null) Assert that value is in array of choices. This is an alias of Assertion::choice() for all values.
+ * @method static bool allInteger(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is a php integer for all values.
+ * @method static bool allIntegerish(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is a php integer'ish for all values.
+ * @method static bool allInterfaceExists(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that the interface exists for all values.
+ * @method static bool allIp(string[] $value, int $flag = null, string|callable $message = null, string $propertyPath = null) Assert that value is an IPv4 or IPv6 address for all values.
+ * @method static bool allIpv4(string[] $value, int $flag = null, string|callable $message = null, string $propertyPath = null) Assert that value is an IPv4 address for all values.
+ * @method static bool allIpv6(string[] $value, int $flag = null, string|callable $message = null, string $propertyPath = null) Assert that value is an IPv6 address for all values.
+ * @method static bool allIsArray(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is an array for all values.
+ * @method static bool allIsArrayAccessible(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is an array or an array-accessible object for all values.
+ * @method static bool allIsCallable(mixed[] $value, string|callable $message = null, string $propertyPath = null) Determines that the provided value is callable for all values.
+ * @method static bool allIsCountable(array[]|Countable[]|ResourceBundle[]|SimpleXMLElement[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is countable for all values.
+ * @method static bool allIsInstanceOf(mixed[] $value, string $className, string|callable $message = null, string $propertyPath = null) Assert that value is instance of given class-name for all values.
+ * @method static bool allIsJsonString(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that the given string is a valid json string for all values.
+ * @method static bool allIsObject(mixed[] $value, string|callable $message = null, string $propertyPath = null) Determines that the provided value is an object for all values.
+ * @method static bool allIsResource(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is a resource for all values.
+ * @method static bool allIsTraversable(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is an array or a traversable object for all values.
+ * @method static bool allKeyExists(mixed[] $value, string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key exists in an array for all values.
+ * @method static bool allKeyIsset(mixed[] $value, string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key exists in an array/array-accessible object using isset() for all values.
+ * @method static bool allKeyNotExists(mixed[] $value, string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key does not exist in an array for all values.
+ * @method static bool allLength(mixed[] $value, int $length, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string has a given length for all values.
+ * @method static bool allLessOrEqualThan(mixed[] $value, mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is less or equal than given limit for all values.
+ * @method static bool allLessThan(mixed[] $value, mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is less than given limit for all values.
+ * @method static bool allMax(mixed[] $value, mixed $maxValue, string|callable $message = null, string $propertyPath = null) Assert that a number is smaller as a given limit for all values.
+ * @method static bool allMaxCount(array[]|Countable[]|ResourceBundle[]|SimpleXMLElement[] $countable, int $count, string|callable $message = null, string $propertyPath = null) Assert that the countable have at most $count elements for all values.
+ * @method static bool allMaxLength(mixed[] $value, int $maxLength, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string value is not longer than $maxLength chars for all values.
+ * @method static bool allMethodExists(string[] $value, mixed $object, string|callable $message = null, string $propertyPath = null) Determines that the named method is defined in the provided object for all values.
+ * @method static bool allMin(mixed[] $value, mixed $minValue, string|callable $message = null, string $propertyPath = null) Assert that a value is at least as big as a given limit for all values.
+ * @method static bool allMinCount(array[]|Countable[]|ResourceBundle[]|SimpleXMLElement[] $countable, int $count, string|callable $message = null, string $propertyPath = null) Assert that the countable have at least $count elements for all values.
+ * @method static bool allMinLength(mixed[] $value, int $minLength, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that a string is at least $minLength chars long for all values.
+ * @method static bool allNoContent(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is empty for all values.
+ * @method static bool allNotBlank(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is not blank for all values.
+ * @method static bool allNotContains(mixed[] $string, string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string does not contains a sequence of chars for all values.
+ * @method static bool allNotEmpty(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is not empty for all values.
+ * @method static bool allNotEmptyKey(mixed[] $value, string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key exists in an array/array-accessible object and its value is not empty for all values.
+ * @method static bool allNotEq(mixed[] $value1, mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are not equal (using ==) for all values.
+ * @method static bool allNotInArray(mixed[] $value, array $choices, string|callable $message = null, string $propertyPath = null) Assert that value is not in array of choices for all values.
+ * @method static bool allNotIsInstanceOf(mixed[] $value, string $className, string|callable $message = null, string $propertyPath = null) Assert that value is not instance of given class-name for all values.
+ * @method static bool allNotNull(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is not null for all values.
+ * @method static bool allNotRegex(mixed[] $value, string $pattern, string|callable $message = null, string $propertyPath = null) Assert that value does not match a regex for all values.
+ * @method static bool allNotSame(mixed[] $value1, mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are not the same (using ===) for all values.
+ * @method static bool allNull(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is null for all values.
+ * @method static bool allNumeric(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is numeric for all values.
+ * @method static bool allObjectOrClass(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that the value is an object, or a class that exists for all values.
+ * @method static bool allPhpVersion(string[] $operator, mixed $version, string|callable $message = null, string $propertyPath = null) Assert on PHP version for all values.
+ * @method static bool allPropertiesExist(mixed[] $value, array $properties, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the properties all exist for all values.
+ * @method static bool allPropertyExists(mixed[] $value, string $property, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the property exists for all values.
+ * @method static bool allRange(mixed[] $value, mixed $minValue, mixed $maxValue, string|callable $message = null, string $propertyPath = null) Assert that value is in range of numbers for all values.
+ * @method static bool allReadable(string[] $value, string|callable $message = null, string $propertyPath = null) Assert that the value is something readable for all values.
+ * @method static bool allRegex(mixed[] $value, string $pattern, string|callable $message = null, string $propertyPath = null) Assert that value matches a regex for all values.
+ * @method static bool allSame(mixed[] $value, mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are the same (using ===) for all values.
+ * @method static bool allSatisfy(mixed[] $value, callable $callback, string|callable $message = null, string $propertyPath = null) Assert that the provided value is valid according to a callback for all values.
+ * @method static bool allScalar(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is a PHP scalar for all values.
+ * @method static bool allStartsWith(mixed[] $string, string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string starts with a sequence of chars for all values.
+ * @method static bool allString(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is a string for all values.
+ * @method static bool allSubclassOf(mixed[] $value, string $className, string|callable $message = null, string $propertyPath = null) Assert that value is subclass of given class-name for all values.
+ * @method static bool allTrue(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that the value is boolean True for all values.
+ * @method static bool allUrl(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is an URL for all values.
+ * @method static bool allUuid(string[] $value, string|callable $message = null, string $propertyPath = null) Assert that the given string is a valid UUID for all values.
+ * @method static bool allVersion(string[] $version1, string $operator, string $version2, string|callable $message = null, string $propertyPath = null) Assert comparison of two versions for all values.
+ * @method static bool allWriteable(string[] $value, string|callable $message = null, string $propertyPath = null) Assert that the value is something writeable for all values.
+ * @method static bool nullOrAlnum(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is alphanumeric or that the value is null.
+ * @method static bool nullOrBase64(string|null $value, string|callable $message = null, string $propertyPath = null) Assert that a constant is defined or that the value is null.
+ * @method static bool nullOrBetween(mixed|null $value, mixed $lowerLimit, mixed $upperLimit, string|callable $message = null, string $propertyPath = null) Assert that a value is greater or equal than a lower limit, and less than or equal to an upper limit or that the value is null.
+ * @method static bool nullOrBetweenExclusive(mixed|null $value, mixed $lowerLimit, mixed $upperLimit, string|callable $message = null, string $propertyPath = null) Assert that a value is greater than a lower limit, and less than an upper limit or that the value is null.
+ * @method static bool nullOrBetweenLength(mixed|null $value, int $minLength, int $maxLength, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string length is between min and max lengths or that the value is null.
+ * @method static bool nullOrBoolean(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is php boolean or that the value is null.
+ * @method static bool nullOrChoice(mixed|null $value, array $choices, string|callable $message = null, string $propertyPath = null) Assert that value is in array of choices or that the value is null.
+ * @method static bool nullOrChoicesNotEmpty(array|null $values, array $choices, string|callable $message = null, string $propertyPath = null) Determines if the values array has every choice as key and that this choice has content or that the value is null.
+ * @method static bool nullOrClassExists(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that the class exists or that the value is null.
+ * @method static bool nullOrContains(mixed|null $string, string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string contains a sequence of chars or that the value is null.
+ * @method static bool nullOrCount(array|Countable|ResourceBundle|SimpleXMLElement|null $countable, int $count, string|callable $message = null, string $propertyPath = null) Assert that the count of countable is equal to count or that the value is null.
+ * @method static bool nullOrDate(string|null $value, string $format, string|callable $message = null, string $propertyPath = null) Assert that date is valid and corresponds to the given format or that the value is null.
+ * @method static bool nullOrDefined(mixed|null $constant, string|callable $message = null, string $propertyPath = null) Assert that a constant is defined or that the value is null.
+ * @method static bool nullOrDigit(mixed|null $value, string|callable $message = null, string $propertyPath = null) Validates if an integer or integerish is a digit or that the value is null.
+ * @method static bool nullOrDirectory(string|null $value, string|callable $message = null, string $propertyPath = null) Assert that a directory exists or that the value is null.
+ * @method static bool nullOrE164(string|null $value, string|callable $message = null, string $propertyPath = null) Assert that the given string is a valid E164 Phone Number or that the value is null.
+ * @method static bool nullOrEmail(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is an email address (using input_filter/FILTER_VALIDATE_EMAIL) or that the value is null.
+ * @method static bool nullOrEndsWith(mixed|null $string, string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string ends with a sequence of chars or that the value is null.
+ * @method static bool nullOrEq(mixed|null $value, mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are equal (using ==) or that the value is null.
+ * @method static bool nullOrEqArraySubset(mixed|null $value, mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that the array contains the subset or that the value is null.
+ * @method static bool nullOrExtensionLoaded(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that extension is loaded or that the value is null.
+ * @method static bool nullOrExtensionVersion(string|null $extension, string $operator, mixed $version, string|callable $message = null, string $propertyPath = null) Assert that extension is loaded and a specific version is installed or that the value is null.
+ * @method static bool nullOrFalse(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that the value is boolean False or that the value is null.
+ * @method static bool nullOrFile(string|null $value, string|callable $message = null, string $propertyPath = null) Assert that a file exists or that the value is null.
+ * @method static bool nullOrFloat(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is a php float or that the value is null.
+ * @method static bool nullOrGreaterOrEqualThan(mixed|null $value, mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is greater or equal than given limit or that the value is null.
+ * @method static bool nullOrGreaterThan(mixed|null $value, mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is greater than given limit or that the value is null.
+ * @method static bool nullOrImplementsInterface(mixed|null $class, string $interfaceName, string|callable $message = null, string $propertyPath = null) Assert that the class implements the interface or that the value is null.
+ * @method static bool nullOrInArray(mixed|null $value, array $choices, string|callable $message = null, string $propertyPath = null) Assert that value is in array of choices. This is an alias of Assertion::choice() or that the value is null.
+ * @method static bool nullOrInteger(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is a php integer or that the value is null.
+ * @method static bool nullOrIntegerish(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is a php integer'ish or that the value is null.
+ * @method static bool nullOrInterfaceExists(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that the interface exists or that the value is null.
+ * @method static bool nullOrIp(string|null $value, int $flag = null, string|callable $message = null, string $propertyPath = null) Assert that value is an IPv4 or IPv6 address or that the value is null.
+ * @method static bool nullOrIpv4(string|null $value, int $flag = null, string|callable $message = null, string $propertyPath = null) Assert that value is an IPv4 address or that the value is null.
+ * @method static bool nullOrIpv6(string|null $value, int $flag = null, string|callable $message = null, string $propertyPath = null) Assert that value is an IPv6 address or that the value is null.
+ * @method static bool nullOrIsArray(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is an array or that the value is null.
+ * @method static bool nullOrIsArrayAccessible(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is an array or an array-accessible object or that the value is null.
+ * @method static bool nullOrIsCallable(mixed|null $value, string|callable $message = null, string $propertyPath = null) Determines that the provided value is callable or that the value is null.
+ * @method static bool nullOrIsCountable(array|Countable|ResourceBundle|SimpleXMLElement|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is countable or that the value is null.
+ * @method static bool nullOrIsInstanceOf(mixed|null $value, string $className, string|callable $message = null, string $propertyPath = null) Assert that value is instance of given class-name or that the value is null.
+ * @method static bool nullOrIsJsonString(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that the given string is a valid json string or that the value is null.
+ * @method static bool nullOrIsObject(mixed|null $value, string|callable $message = null, string $propertyPath = null) Determines that the provided value is an object or that the value is null.
+ * @method static bool nullOrIsResource(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is a resource or that the value is null.
+ * @method static bool nullOrIsTraversable(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is an array or a traversable object or that the value is null.
+ * @method static bool nullOrKeyExists(mixed|null $value, string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key exists in an array or that the value is null.
+ * @method static bool nullOrKeyIsset(mixed|null $value, string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key exists in an array/array-accessible object using isset() or that the value is null.
+ * @method static bool nullOrKeyNotExists(mixed|null $value, string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key does not exist in an array or that the value is null.
+ * @method static bool nullOrLength(mixed|null $value, int $length, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string has a given length or that the value is null.
+ * @method static bool nullOrLessOrEqualThan(mixed|null $value, mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is less or equal than given limit or that the value is null.
+ * @method static bool nullOrLessThan(mixed|null $value, mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is less than given limit or that the value is null.
+ * @method static bool nullOrMax(mixed|null $value, mixed $maxValue, string|callable $message = null, string $propertyPath = null) Assert that a number is smaller as a given limit or that the value is null.
+ * @method static bool nullOrMaxCount(array|Countable|ResourceBundle|SimpleXMLElement|null $countable, int $count, string|callable $message = null, string $propertyPath = null) Assert that the countable have at most $count elements or that the value is null.
+ * @method static bool nullOrMaxLength(mixed|null $value, int $maxLength, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string value is not longer than $maxLength chars or that the value is null.
+ * @method static bool nullOrMethodExists(string|null $value, mixed $object, string|callable $message = null, string $propertyPath = null) Determines that the named method is defined in the provided object or that the value is null.
+ * @method static bool nullOrMin(mixed|null $value, mixed $minValue, string|callable $message = null, string $propertyPath = null) Assert that a value is at least as big as a given limit or that the value is null.
+ * @method static bool nullOrMinCount(array|Countable|ResourceBundle|SimpleXMLElement|null $countable, int $count, string|callable $message = null, string $propertyPath = null) Assert that the countable have at least $count elements or that the value is null.
+ * @method static bool nullOrMinLength(mixed|null $value, int $minLength, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that a string is at least $minLength chars long or that the value is null.
+ * @method static bool nullOrNoContent(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is empty or that the value is null.
+ * @method static bool nullOrNotBlank(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is not blank or that the value is null.
+ * @method static bool nullOrNotContains(mixed|null $string, string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string does not contains a sequence of chars or that the value is null.
+ * @method static bool nullOrNotEmpty(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is not empty or that the value is null.
+ * @method static bool nullOrNotEmptyKey(mixed|null $value, string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key exists in an array/array-accessible object and its value is not empty or that the value is null.
+ * @method static bool nullOrNotEq(mixed|null $value1, mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are not equal (using ==) or that the value is null.
+ * @method static bool nullOrNotInArray(mixed|null $value, array $choices, string|callable $message = null, string $propertyPath = null) Assert that value is not in array of choices or that the value is null.
+ * @method static bool nullOrNotIsInstanceOf(mixed|null $value, string $className, string|callable $message = null, string $propertyPath = null) Assert that value is not instance of given class-name or that the value is null.
+ * @method static bool nullOrNotNull(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is not null or that the value is null.
+ * @method static bool nullOrNotRegex(mixed|null $value, string $pattern, string|callable $message = null, string $propertyPath = null) Assert that value does not match a regex or that the value is null.
+ * @method static bool nullOrNotSame(mixed|null $value1, mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are not the same (using ===) or that the value is null.
+ * @method static bool nullOrNull(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is null or that the value is null.
+ * @method static bool nullOrNumeric(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is numeric or that the value is null.
+ * @method static bool nullOrObjectOrClass(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that the value is an object, or a class that exists or that the value is null.
+ * @method static bool nullOrPhpVersion(string|null $operator, mixed $version, string|callable $message = null, string $propertyPath = null) Assert on PHP version or that the value is null.
+ * @method static bool nullOrPropertiesExist(mixed|null $value, array $properties, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the properties all exist or that the value is null.
+ * @method static bool nullOrPropertyExists(mixed|null $value, string $property, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the property exists or that the value is null.
+ * @method static bool nullOrRange(mixed|null $value, mixed $minValue, mixed $maxValue, string|callable $message = null, string $propertyPath = null) Assert that value is in range of numbers or that the value is null.
+ * @method static bool nullOrReadable(string|null $value, string|callable $message = null, string $propertyPath = null) Assert that the value is something readable or that the value is null.
+ * @method static bool nullOrRegex(mixed|null $value, string $pattern, string|callable $message = null, string $propertyPath = null) Assert that value matches a regex or that the value is null.
+ * @method static bool nullOrSame(mixed|null $value, mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are the same (using ===) or that the value is null.
+ * @method static bool nullOrSatisfy(mixed|null $value, callable $callback, string|callable $message = null, string $propertyPath = null) Assert that the provided value is valid according to a callback or that the value is null.
+ * @method static bool nullOrScalar(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is a PHP scalar or that the value is null.
+ * @method static bool nullOrStartsWith(mixed|null $string, string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string starts with a sequence of chars or that the value is null.
+ * @method static bool nullOrString(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is a string or that the value is null.
+ * @method static bool nullOrSubclassOf(mixed|null $value, string $className, string|callable $message = null, string $propertyPath = null) Assert that value is subclass of given class-name or that the value is null.
+ * @method static bool nullOrTrue(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that the value is boolean True or that the value is null.
+ * @method static bool nullOrUrl(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is an URL or that the value is null.
+ * @method static bool nullOrUuid(string|null $value, string|callable $message = null, string $propertyPath = null) Assert that the given string is a valid UUID or that the value is null.
+ * @method static bool nullOrVersion(string|null $version1, string $operator, string $version2, string|callable $message = null, string $propertyPath = null) Assert comparison of two versions or that the value is null.
+ * @method static bool nullOrWriteable(string|null $value, string|callable $message = null, string $propertyPath = null) Assert that the value is something writeable or that the value is null.
+ */
+class Assertion
+{
+ const INVALID_FLOAT = 9;
+ const INVALID_INTEGER = 10;
+ const INVALID_DIGIT = 11;
+ const INVALID_INTEGERISH = 12;
+ const INVALID_BOOLEAN = 13;
+ const VALUE_EMPTY = 14;
+ const VALUE_NULL = 15;
+ const VALUE_NOT_NULL = 25;
+ const INVALID_STRING = 16;
+ const INVALID_REGEX = 17;
+ const INVALID_MIN_LENGTH = 18;
+ const INVALID_MAX_LENGTH = 19;
+ const INVALID_STRING_START = 20;
+ const INVALID_STRING_CONTAINS = 21;
+ const INVALID_CHOICE = 22;
+ const INVALID_NUMERIC = 23;
+ const INVALID_ARRAY = 24;
+ const INVALID_KEY_EXISTS = 26;
+ const INVALID_NOT_BLANK = 27;
+ const INVALID_INSTANCE_OF = 28;
+ const INVALID_SUBCLASS_OF = 29;
+ const INVALID_RANGE = 30;
+ const INVALID_ALNUM = 31;
+ const INVALID_TRUE = 32;
+ const INVALID_EQ = 33;
+ const INVALID_SAME = 34;
+ const INVALID_MIN = 35;
+ const INVALID_MAX = 36;
+ const INVALID_LENGTH = 37;
+ const INVALID_FALSE = 38;
+ const INVALID_STRING_END = 39;
+ const INVALID_UUID = 40;
+ const INVALID_COUNT = 41;
+ const INVALID_NOT_EQ = 42;
+ const INVALID_NOT_SAME = 43;
+ const INVALID_TRAVERSABLE = 44;
+ const INVALID_ARRAY_ACCESSIBLE = 45;
+ const INVALID_KEY_ISSET = 46;
+ const INVALID_VALUE_IN_ARRAY = 47;
+ const INVALID_E164 = 48;
+ const INVALID_BASE64 = 49;
+ const INVALID_NOT_REGEX = 50;
+ const INVALID_DIRECTORY = 101;
+ const INVALID_FILE = 102;
+ const INVALID_READABLE = 103;
+ const INVALID_WRITEABLE = 104;
+ const INVALID_CLASS = 105;
+ const INVALID_INTERFACE = 106;
+ const INVALID_FILE_NOT_EXISTS = 107;
+ const INVALID_EMAIL = 201;
+ const INTERFACE_NOT_IMPLEMENTED = 202;
+ const INVALID_URL = 203;
+ const INVALID_NOT_INSTANCE_OF = 204;
+ const VALUE_NOT_EMPTY = 205;
+ const INVALID_JSON_STRING = 206;
+ const INVALID_OBJECT = 207;
+ const INVALID_METHOD = 208;
+ const INVALID_SCALAR = 209;
+ const INVALID_LESS = 210;
+ const INVALID_LESS_OR_EQUAL = 211;
+ const INVALID_GREATER = 212;
+ const INVALID_GREATER_OR_EQUAL = 213;
+ const INVALID_DATE = 214;
+ const INVALID_CALLABLE = 215;
+ const INVALID_KEY_NOT_EXISTS = 216;
+ const INVALID_SATISFY = 217;
+ const INVALID_IP = 218;
+ const INVALID_BETWEEN = 219;
+ const INVALID_BETWEEN_EXCLUSIVE = 220;
+ const INVALID_EXTENSION = 222;
+ const INVALID_CONSTANT = 221;
+ const INVALID_VERSION = 223;
+ const INVALID_PROPERTY = 224;
+ const INVALID_RESOURCE = 225;
+ const INVALID_COUNTABLE = 226;
+ const INVALID_MIN_COUNT = 227;
+ const INVALID_MAX_COUNT = 228;
+ const INVALID_STRING_NOT_CONTAINS = 229;
+
+ /**
+ * Exception to throw when an assertion failed.
+ *
+ * @var string
+ */
+ protected static $exceptionClass = InvalidArgumentException::class;
+
+ /**
+ * Assert that two values are equal (using ==).
+ *
+ * @param mixed $value
+ * @param mixed $value2
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function eq($value, $value2, $message = null, string $propertyPath = null): bool
+ {
+ if ($value != $value2) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" does not equal expected value "%s".'),
+ static::stringify($value),
+ static::stringify($value2)
+ );
+
+ throw static::createException($value, $message, static::INVALID_EQ, $propertyPath, ['expected' => $value2]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that the array contains the subset.
+ *
+ * @param mixed $value
+ * @param mixed $value2
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function eqArraySubset($value, $value2, $message = null, string $propertyPath = null): bool
+ {
+ static::isArray($value, $message, $propertyPath);
+ static::isArray($value2, $message, $propertyPath);
+
+ $patched = \array_replace_recursive($value, $value2);
+ static::eq($patched, $value, $message, $propertyPath);
+
+ return true;
+ }
+
+ /**
+ * Assert that two values are the same (using ===).
+ *
+ * @param mixed $value
+ * @param mixed $value2
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function same($value, $value2, $message = null, string $propertyPath = null): bool
+ {
+ if ($value !== $value2) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" is not the same as expected value "%s".'),
+ static::stringify($value),
+ static::stringify($value2)
+ );
+
+ throw static::createException($value, $message, static::INVALID_SAME, $propertyPath, ['expected' => $value2]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that two values are not equal (using ==).
+ *
+ * @param mixed $value1
+ * @param mixed $value2
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function notEq($value1, $value2, $message = null, string $propertyPath = null): bool
+ {
+ if ($value1 == $value2) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" was not expected to be equal to value "%s".'),
+ static::stringify($value1),
+ static::stringify($value2)
+ );
+ throw static::createException($value1, $message, static::INVALID_NOT_EQ, $propertyPath, ['expected' => $value2]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that two values are not the same (using ===).
+ *
+ * @param mixed $value1
+ * @param mixed $value2
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function notSame($value1, $value2, $message = null, string $propertyPath = null): bool
+ {
+ if ($value1 === $value2) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" was not expected to be the same as value "%s".'),
+ static::stringify($value1),
+ static::stringify($value2)
+ );
+ throw static::createException($value1, $message, static::INVALID_NOT_SAME, $propertyPath, ['expected' => $value2]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that value is not in array of choices.
+ *
+ * @param mixed $value
+ * @param array $choices
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function notInArray($value, array $choices, $message = null, string $propertyPath = null): bool
+ {
+ if (true === \in_array($value, $choices)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" was not expected to be an element of the values: %s'),
+ static::stringify($value),
+ static::stringify($choices)
+ );
+ throw static::createException($value, $message, static::INVALID_VALUE_IN_ARRAY, $propertyPath, ['choices' => $choices]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that value is a php integer.
+ *
+ * @param mixed $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function integer($value, $message = null, string $propertyPath = null): bool
+ {
+ if (!\is_int($value)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" is not an integer.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_INTEGER, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that value is a php float.
+ *
+ * @param mixed $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function float($value, $message = null, string $propertyPath = null): bool
+ {
+ if (!\is_float($value)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" is not a float.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_FLOAT, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Validates if an integer or integerish is a digit.
+ *
+ * @param mixed $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function digit($value, $message = null, string $propertyPath = null): bool
+ {
+ if (!\ctype_digit((string)$value)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" is not a digit.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_DIGIT, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that value is a php integer'ish.
+ *
+ * @param mixed $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function integerish($value, $message = null, string $propertyPath = null): bool
+ {
+ if (
+ \is_resource($value) ||
+ \is_object($value) ||
+ \is_bool($value) ||
+ \is_null($value) ||
+ \is_array($value) ||
+ (\is_string($value) && '' == $value) ||
+ (
+ \strval(\intval($value)) !== \strval($value) &&
+ \strval(\intval($value)) !== \strval(\ltrim($value, '0')) &&
+ '' !== \strval(\intval($value)) &&
+ '' !== \strval(\ltrim($value, '0'))
+ )
+ ) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" is not an integer or a number castable to integer.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_INTEGERISH, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that value is php boolean.
+ *
+ * @param mixed $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function boolean($value, $message = null, string $propertyPath = null): bool
+ {
+ if (!\is_bool($value)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" is not a boolean.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_BOOLEAN, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that value is a PHP scalar.
+ *
+ * @param mixed $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function scalar($value, $message = null, string $propertyPath = null): bool
+ {
+ if (!\is_scalar($value)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" is not a scalar.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_SCALAR, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that value is not empty.
+ *
+ * @param mixed $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function notEmpty($value, $message = null, string $propertyPath = null): bool
+ {
+ if (empty($value)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" is empty, but non empty value was expected.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::VALUE_EMPTY, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that value is empty.
+ *
+ * @param mixed $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function noContent($value, $message = null, string $propertyPath = null): bool
+ {
+ if (!empty($value)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" is not empty, but empty value was expected.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::VALUE_NOT_EMPTY, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that value is null.
+ *
+ * @param mixed $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ */
+ public static function null($value, $message = null, string $propertyPath = null): bool
+ {
+ if (null !== $value) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" is not null, but null value was expected.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::VALUE_NOT_NULL, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that value is not null.
+ *
+ * @param mixed $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function notNull($value, $message = null, string $propertyPath = null): bool
+ {
+ if (null === $value) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" is null, but non null value was expected.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::VALUE_NULL, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that value is a string.
+ *
+ * @param mixed $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function string($value, $message = null, string $propertyPath = null)
+ {
+ if (!\is_string($value)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" expected to be string, type %s given.'),
+ static::stringify($value),
+ \gettype($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_STRING, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that value matches a regex.
+ *
+ * @param mixed $value
+ * @param string $pattern
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function regex($value, $pattern, $message = null, string $propertyPath = null): bool
+ {
+ static::string($value, $message, $propertyPath);
+
+ if (!\preg_match($pattern, $value)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" does not match expression.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_REGEX, $propertyPath, ['pattern' => $pattern]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that value does not match a regex.
+ *
+ * @param mixed $value
+ * @param string $pattern
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function notRegex($value, $pattern, $message = null, string $propertyPath = null): bool
+ {
+ static::string($value, $message, $propertyPath);
+
+ if (\preg_match($pattern, $value)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" matches expression.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_NOT_REGEX, $propertyPath, ['pattern' => $pattern]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that string has a given length.
+ *
+ * @param mixed $value
+ * @param int $length
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ * @param string $encoding
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function length($value, $length, $message = null, string $propertyPath = null, $encoding = 'utf8'): bool
+ {
+ static::string($value, $message, $propertyPath);
+
+ if (\mb_strlen($value, $encoding) !== $length) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" has to be %d exactly characters long, but length is %d.'),
+ static::stringify($value),
+ $length,
+ \mb_strlen($value, $encoding)
+ );
+
+ throw static::createException($value, $message, static::INVALID_LENGTH, $propertyPath, ['length' => $length, 'encoding' => $encoding]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that a string is at least $minLength chars long.
+ *
+ * @param mixed $value
+ * @param int $minLength
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ * @param string $encoding
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function minLength($value, $minLength, $message = null, string $propertyPath = null, $encoding = 'utf8'): bool
+ {
+ static::string($value, $message, $propertyPath);
+
+ if (\mb_strlen($value, $encoding) < $minLength) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" is too short, it should have at least %d characters, but only has %d characters.'),
+ static::stringify($value),
+ $minLength,
+ \mb_strlen($value, $encoding)
+ );
+
+ throw static::createException($value, $message, static::INVALID_MIN_LENGTH, $propertyPath, ['min_length' => $minLength, 'encoding' => $encoding]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that string value is not longer than $maxLength chars.
+ *
+ * @param mixed $value
+ * @param int $maxLength
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ * @param string $encoding
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function maxLength($value, $maxLength, $message = null, string $propertyPath = null, $encoding = 'utf8'): bool
+ {
+ static::string($value, $message, $propertyPath);
+
+ if (\mb_strlen($value, $encoding) > $maxLength) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" is too long, it should have no more than %d characters, but has %d characters.'),
+ static::stringify($value),
+ $maxLength,
+ \mb_strlen($value, $encoding)
+ );
+
+ throw static::createException($value, $message, static::INVALID_MAX_LENGTH, $propertyPath, ['max_length' => $maxLength, 'encoding' => $encoding]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that string length is between min and max lengths.
+ *
+ * @param mixed $value
+ * @param int $minLength
+ * @param int $maxLength
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ * @param string $encoding
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function betweenLength($value, $minLength, $maxLength, $message = null, string $propertyPath = null, $encoding = 'utf8'): bool
+ {
+ static::string($value, $message, $propertyPath);
+ static::minLength($value, $minLength, $message, $propertyPath, $encoding);
+ static::maxLength($value, $maxLength, $message, $propertyPath, $encoding);
+
+ return true;
+ }
+
+ /**
+ * Assert that string starts with a sequence of chars.
+ *
+ * @param mixed $string
+ * @param string $needle
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ * @param string $encoding
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function startsWith($string, $needle, $message = null, string $propertyPath = null, $encoding = 'utf8'): bool
+ {
+ static::string($string, $message, $propertyPath);
+
+ if (0 !== \mb_strpos($string, $needle, null, $encoding)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" does not start with "%s".'),
+ static::stringify($string),
+ static::stringify($needle)
+ );
+
+ throw static::createException($string, $message, static::INVALID_STRING_START, $propertyPath, ['needle' => $needle, 'encoding' => $encoding]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that string ends with a sequence of chars.
+ *
+ * @param mixed $string
+ * @param string $needle
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ * @param string $encoding
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function endsWith($string, $needle, $message = null, string $propertyPath = null, $encoding = 'utf8'): bool
+ {
+ static::string($string, $message, $propertyPath);
+
+ $stringPosition = \mb_strlen($string, $encoding) - \mb_strlen($needle, $encoding);
+
+ if (\mb_strripos($string, $needle, null, $encoding) !== $stringPosition) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" does not end with "%s".'),
+ static::stringify($string),
+ static::stringify($needle)
+ );
+
+ throw static::createException($string, $message, static::INVALID_STRING_END, $propertyPath, ['needle' => $needle, 'encoding' => $encoding]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that string contains a sequence of chars.
+ *
+ * @param mixed $string
+ * @param string $needle
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ * @param string $encoding
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function contains($string, $needle, $message = null, string $propertyPath = null, $encoding = 'utf8'): bool
+ {
+ static::string($string, $message, $propertyPath);
+
+ if (false === \mb_strpos($string, $needle, null, $encoding)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" does not contain "%s".'),
+ static::stringify($string),
+ static::stringify($needle)
+ );
+
+ throw static::createException($string, $message, static::INVALID_STRING_CONTAINS, $propertyPath, ['needle' => $needle, 'encoding' => $encoding]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that string does not contains a sequence of chars.
+ *
+ * @param mixed $string
+ * @param string $needle
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ * @param string $encoding
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function notContains($string, $needle, $message = null, string $propertyPath = null, $encoding = 'utf8'): bool
+ {
+ static::string($string, $message, $propertyPath);
+
+ if (false !== \mb_strpos($string, $needle, null, $encoding)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" contains "%s".'),
+ static::stringify($string),
+ static::stringify($needle)
+ );
+
+ throw static::createException($string, $message, static::INVALID_STRING_NOT_CONTAINS, $propertyPath, ['needle' => $needle, 'encoding' => $encoding]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that value is in array of choices.
+ *
+ * @param mixed $value
+ * @param array $choices
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function choice($value, array $choices, $message = null, string $propertyPath = null): bool
+ {
+ if (!\in_array($value, $choices, true)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" is not an element of the valid values: %s'),
+ static::stringify($value),
+ \implode(', ', \array_map([\get_called_class(), 'stringify'], $choices))
+ );
+
+ throw static::createException($value, $message, static::INVALID_CHOICE, $propertyPath, ['choices' => $choices]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that value is in array of choices.
+ *
+ * This is an alias of {@see choice()}.
+ *
+ * @param mixed $value
+ * @param array $choices
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function inArray($value, array $choices, $message = null, string $propertyPath = null): bool
+ {
+ return static::choice($value, $choices, $message, $propertyPath);
+ }
+
+ /**
+ * Assert that value is numeric.
+ *
+ * @param mixed $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function numeric($value, $message = null, string $propertyPath = null): bool
+ {
+ if (!\is_numeric($value)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" is not numeric.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_NUMERIC, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that value is a resource.
+ *
+ * @param mixed $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ */
+ public static function isResource($value, $message = null, string $propertyPath = null): bool
+ {
+ if (!\is_resource($value)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" is not a resource.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_RESOURCE, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that value is an array.
+ *
+ * @param mixed $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function isArray($value, $message = null, string $propertyPath = null): bool
+ {
+ if (!\is_array($value)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" is not an array.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_ARRAY, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that value is an array or a traversable object.
+ *
+ * @param mixed $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function isTraversable($value, $message = null, string $propertyPath = null): bool
+ {
+ if (!\is_array($value) && !$value instanceof Traversable) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" is not an array and does not implement Traversable.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_TRAVERSABLE, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that value is an array or an array-accessible object.
+ *
+ * @param mixed $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function isArrayAccessible($value, $message = null, string $propertyPath = null): bool
+ {
+ if (!\is_array($value) && !$value instanceof ArrayAccess) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" is not an array and does not implement ArrayAccess.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_ARRAY_ACCESSIBLE, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that value is countable.
+ *
+ * @param array|Countable|ResourceBundle|SimpleXMLElement $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function isCountable($value, $message = null, string $propertyPath = null): bool
+ {
+ if (\function_exists('is_countable')) {
+ $assert = \is_countable($value);
+ } else {
+ $assert = \is_array($value) || $value instanceof Countable || $value instanceof ResourceBundle || $value instanceof SimpleXMLElement;
+ }
+
+ if (!$assert) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" is not an array and does not implement Countable.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_COUNTABLE, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that key exists in an array.
+ *
+ * @param mixed $value
+ * @param string|int $key
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function keyExists($value, $key, $message = null, string $propertyPath = null): bool
+ {
+ static::isArray($value, $message, $propertyPath);
+
+ if (!\array_key_exists($key, $value)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Array does not contain an element with key "%s"'),
+ static::stringify($key)
+ );
+
+ throw static::createException($value, $message, static::INVALID_KEY_EXISTS, $propertyPath, ['key' => $key]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that key does not exist in an array.
+ *
+ * @param mixed $value
+ * @param string|int $key
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function keyNotExists($value, $key, $message = null, string $propertyPath = null): bool
+ {
+ static::isArray($value, $message, $propertyPath);
+
+ if (\array_key_exists($key, $value)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Array contains an element with key "%s"'),
+ static::stringify($key)
+ );
+
+ throw static::createException($value, $message, static::INVALID_KEY_NOT_EXISTS, $propertyPath, ['key' => $key]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that key exists in an array/array-accessible object using isset().
+ *
+ * @param mixed $value
+ * @param string|int $key
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function keyIsset($value, $key, $message = null, string $propertyPath = null): bool
+ {
+ static::isArrayAccessible($value, $message, $propertyPath);
+
+ if (!isset($value[$key])) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'The element with key "%s" was not found'),
+ static::stringify($key)
+ );
+
+ throw static::createException($value, $message, static::INVALID_KEY_ISSET, $propertyPath, ['key' => $key]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that key exists in an array/array-accessible object and its value is not empty.
+ *
+ * @param mixed $value
+ * @param string|int $key
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function notEmptyKey($value, $key, $message = null, string $propertyPath = null): bool
+ {
+ static::keyIsset($value, $key, $message, $propertyPath);
+ static::notEmpty($value[$key], $message, $propertyPath);
+
+ return true;
+ }
+
+ /**
+ * Assert that value is not blank.
+ *
+ * @param mixed $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function notBlank($value, $message = null, string $propertyPath = null): bool
+ {
+ if (false === $value || (empty($value) && '0' != $value) || (\is_string($value) && '' === \trim($value))) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" is blank, but was expected to contain a value.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_NOT_BLANK, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that value is instance of given class-name.
+ *
+ * @param mixed $value
+ * @param string $className
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function isInstanceOf($value, $className, $message = null, string $propertyPath = null): bool
+ {
+ if (!($value instanceof $className)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Class "%s" was expected to be instanceof of "%s" but is not.'),
+ static::stringify($value),
+ $className
+ );
+
+ throw static::createException($value, $message, static::INVALID_INSTANCE_OF, $propertyPath, ['class' => $className]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that value is not instance of given class-name.
+ *
+ * @param mixed $value
+ * @param string $className
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function notIsInstanceOf($value, $className, $message = null, string $propertyPath = null): bool
+ {
+ if ($value instanceof $className) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Class "%s" was not expected to be instanceof of "%s".'),
+ static::stringify($value),
+ $className
+ );
+
+ throw static::createException($value, $message, static::INVALID_NOT_INSTANCE_OF, $propertyPath, ['class' => $className]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that value is subclass of given class-name.
+ *
+ * @param mixed $value
+ * @param string $className
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function subclassOf($value, $className, $message = null, string $propertyPath = null): bool
+ {
+ if (!\is_subclass_of($value, $className)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Class "%s" was expected to be subclass of "%s".'),
+ static::stringify($value),
+ $className
+ );
+
+ throw static::createException($value, $message, static::INVALID_SUBCLASS_OF, $propertyPath, ['class' => $className]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that value is in range of numbers.
+ *
+ * @param mixed $value
+ * @param mixed $minValue
+ * @param mixed $maxValue
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function range($value, $minValue, $maxValue, $message = null, string $propertyPath = null): bool
+ {
+ static::numeric($value, $message, $propertyPath);
+
+ if ($value < $minValue || $value > $maxValue) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Number "%s" was expected to be at least "%d" and at most "%d".'),
+ static::stringify($value),
+ static::stringify($minValue),
+ static::stringify($maxValue)
+ );
+
+ throw static::createException($value, $message, static::INVALID_RANGE, $propertyPath, ['min' => $minValue, 'max' => $maxValue]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that a value is at least as big as a given limit.
+ *
+ * @param mixed $value
+ * @param mixed $minValue
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function min($value, $minValue, $message = null, string $propertyPath = null): bool
+ {
+ static::numeric($value, $message, $propertyPath);
+
+ if ($value < $minValue) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Number "%s" was expected to be at least "%s".'),
+ static::stringify($value),
+ static::stringify($minValue)
+ );
+
+ throw static::createException($value, $message, static::INVALID_MIN, $propertyPath, ['min' => $minValue]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that a number is smaller as a given limit.
+ *
+ * @param mixed $value
+ * @param mixed $maxValue
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function max($value, $maxValue, $message = null, string $propertyPath = null): bool
+ {
+ static::numeric($value, $message, $propertyPath);
+
+ if ($value > $maxValue) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Number "%s" was expected to be at most "%s".'),
+ static::stringify($value),
+ static::stringify($maxValue)
+ );
+
+ throw static::createException($value, $message, static::INVALID_MAX, $propertyPath, ['max' => $maxValue]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that a file exists.
+ *
+ * @param string $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function file($value, $message = null, string $propertyPath = null): bool
+ {
+ static::string($value, $message, $propertyPath);
+ static::notEmpty($value, $message, $propertyPath);
+
+ if (!\is_file($value)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'File "%s" was expected to exist.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_FILE, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that a directory exists.
+ *
+ * @param string $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function directory($value, $message = null, string $propertyPath = null): bool
+ {
+ static::string($value, $message, $propertyPath);
+
+ if (!\is_dir($value)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Path "%s" was expected to be a directory.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_DIRECTORY, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that the value is something readable.
+ *
+ * @param string $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function readable($value, $message = null, string $propertyPath = null): bool
+ {
+ static::string($value, $message, $propertyPath);
+
+ if (!\is_readable($value)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Path "%s" was expected to be readable.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_READABLE, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that the value is something writeable.
+ *
+ * @param string $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function writeable($value, $message = null, string $propertyPath = null): bool
+ {
+ static::string($value, $message, $propertyPath);
+
+ if (!\is_writable($value)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Path "%s" was expected to be writeable.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_WRITEABLE, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that value is an email address (using input_filter/FILTER_VALIDATE_EMAIL).
+ *
+ * @param mixed $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function email($value, $message = null, string $propertyPath = null): bool
+ {
+ static::string($value, $message, $propertyPath);
+
+ if (!\filter_var($value, FILTER_VALIDATE_EMAIL)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" was expected to be a valid e-mail address.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_EMAIL, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that value is an URL.
+ *
+ * This code snipped was taken from the Symfony project and modified to the special demands of this method.
+ *
+ * @param mixed $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ *
+ * @see https://github.com/symfony/Validator/blob/master/Constraints/UrlValidator.php
+ * @see https://github.com/symfony/Validator/blob/master/Constraints/Url.php
+ */
+ public static function url($value, $message = null, string $propertyPath = null): bool
+ {
+ static::string($value, $message, $propertyPath);
+
+ $protocols = ['http', 'https'];
+
+ $pattern = '~^
+ (%s):// # protocol
+ (([\.\pL\pN-]+:)?([\.\pL\pN-]+)@)? # basic auth
+ (
+ ([\pL\pN\pS\-\.])+(\.?([\pL\pN]|xn\-\-[\pL\pN-]+)+\.?) # a domain name
+ | # or
+ \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} # an IP address
+ | # or
+ \[
+ (?:(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){6})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:::(?:(?:(?:[0-9a-f]{1,4})):){5})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){4})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,1}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){3})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,2}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){2})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,3}(?:(?:[0-9a-f]{1,4})))?::(?:(?:[0-9a-f]{1,4})):)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,4}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,5}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,6}(?:(?:[0-9a-f]{1,4})))?::))))
+ \] # an IPv6 address
+ )
+ (:[0-9]+)? # a port (optional)
+ (?:/ (?:[\pL\pN\-._\~!$&\'()*+,;=:@]|%%[0-9A-Fa-f]{2})* )* # a path
+ (?:\? (?:[\pL\pN\-._\~!$&\'\[\]()*+,;=:@/?]|%%[0-9A-Fa-f]{2})* )? # a query (optional)
+ (?:\# (?:[\pL\pN\-._\~!$&\'()*+,;=:@/?]|%%[0-9A-Fa-f]{2})* )? # a fragment (optional)
+ $~ixu';
+
+ $pattern = \sprintf($pattern, \implode('|', $protocols));
+
+ if (!\preg_match($pattern, $value)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" was expected to be a valid URL starting with http or https'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_URL, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that value is alphanumeric.
+ *
+ * @param mixed $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function alnum($value, $message = null, string $propertyPath = null): bool
+ {
+ try {
+ static::regex($value, '(^([a-zA-Z]{1}[a-zA-Z0-9]*)$)', $message, $propertyPath);
+ } catch (Throwable $e) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" is not alphanumeric, starting with letters and containing only letters and numbers.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_ALNUM, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that the value is boolean True.
+ *
+ * @param mixed $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function true($value, $message = null, string $propertyPath = null): bool
+ {
+ if (true !== $value) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" is not TRUE.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_TRUE, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that the value is boolean False.
+ *
+ * @param mixed $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function false($value, $message = null, string $propertyPath = null): bool
+ {
+ if (false !== $value) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" is not FALSE.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_FALSE, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that the class exists.
+ *
+ * @param mixed $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function classExists($value, $message = null, string $propertyPath = null): bool
+ {
+ if (!\class_exists($value)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Class "%s" does not exist.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_CLASS, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that the interface exists.
+ *
+ * @param mixed $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function interfaceExists($value, $message = null, string $propertyPath = null): bool
+ {
+ if (!\interface_exists($value)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Interface "%s" does not exist.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_INTERFACE, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that the class implements the interface.
+ *
+ * @param mixed $class
+ * @param string $interfaceName
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function implementsInterface($class, $interfaceName, $message = null, string $propertyPath = null): bool
+ {
+ try {
+ $reflection = new ReflectionClass($class);
+ if (!$reflection->implementsInterface($interfaceName)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Class "%s" does not implement interface "%s".'),
+ static::stringify($class),
+ static::stringify($interfaceName)
+ );
+
+ throw static::createException($class, $message, static::INTERFACE_NOT_IMPLEMENTED, $propertyPath, ['interface' => $interfaceName]);
+ }
+ } catch (ReflectionException $e) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Class "%s" failed reflection.'),
+ static::stringify($class)
+ );
+ throw static::createException($class, $message, static::INTERFACE_NOT_IMPLEMENTED, $propertyPath, ['interface' => $interfaceName]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that the given string is a valid json string.
+ *
+ * NOTICE:
+ * Since this does a json_decode to determine its validity
+ * you probably should consider, when using the variable
+ * content afterwards, just to decode and check for yourself instead
+ * of using this assertion.
+ *
+ * @param mixed $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function isJsonString($value, $message = null, string $propertyPath = null): bool
+ {
+ if (null === \json_decode($value) && JSON_ERROR_NONE !== \json_last_error()) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" is not a valid JSON string.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_JSON_STRING, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that the given string is a valid UUID.
+ *
+ * Uses code from {@link https://github.com/ramsey/uuid} that is MIT licensed.
+ *
+ * @param string $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function uuid($value, $message = null, string $propertyPath = null): bool
+ {
+ $value = \str_replace(['urn:', 'uuid:', '{', '}'], '', $value);
+
+ if ('00000000-0000-0000-0000-000000000000' === $value) {
+ return true;
+ }
+
+ if (!\preg_match('/^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$/', $value)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" is not a valid UUID.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_UUID, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that the given string is a valid E164 Phone Number.
+ *
+ * @see https://en.wikipedia.org/wiki/E.164
+ *
+ * @param string $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function e164($value, $message = null, string $propertyPath = null): bool
+ {
+ if (!\preg_match('/^\+?[1-9]\d{1,14}$/', $value)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" is not a valid E164.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_E164, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that the count of countable is equal to count.
+ *
+ * @param array|Countable|ResourceBundle|SimpleXMLElement $countable
+ * @param int $count
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function count($countable, $count, $message = null, string $propertyPath = null): bool
+ {
+ if ($count !== \count($countable)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'List does not contain exactly %d elements (%d given).'),
+ static::stringify($count),
+ static::stringify(\count($countable))
+ );
+
+ throw static::createException($countable, $message, static::INVALID_COUNT, $propertyPath, ['count' => $count]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that the countable have at least $count elements.
+ *
+ * @param array|Countable|ResourceBundle|SimpleXMLElement $countable
+ * @param int $count
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function minCount($countable, $count, $message = null, string $propertyPath = null): bool
+ {
+ if ($count > \count($countable)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'List should have at least %d elements, but has %d elements.'),
+ static::stringify($count),
+ static::stringify(\count($countable))
+ );
+
+ throw static::createException($countable, $message, static::INVALID_MIN_COUNT, $propertyPath, ['count' => $count]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that the countable have at most $count elements.
+ *
+ * @param array|Countable|ResourceBundle|SimpleXMLElement $countable
+ * @param int $count
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function maxCount($countable, $count, $message = null, string $propertyPath = null): bool
+ {
+ if ($count < \count($countable)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'List should have at most %d elements, but has %d elements.'),
+ static::stringify($count),
+ static::stringify(\count($countable))
+ );
+
+ throw static::createException($countable, $message, static::INVALID_MAX_COUNT, $propertyPath, ['count' => $count]);
+ }
+
+ return true;
+ }
+
+ /**
+ * static call handler to implement:
+ * - "null or assertion" delegation
+ * - "all" delegation.
+ *
+ * @param string $method
+ * @param array $args
+ *
+ * @return bool|mixed
+ *
+ * @throws AssertionFailedException
+ */
+ public static function __callStatic($method, $args)
+ {
+ if (0 === \strpos($method, 'nullOr')) {
+ if (!\array_key_exists(0, $args)) {
+ throw new BadMethodCallException('Missing the first argument.');
+ }
+
+ if (null === $args[0]) {
+ return true;
+ }
+
+ $method = \substr($method, 6);
+
+ return \call_user_func_array([\get_called_class(), $method], $args);
+ }
+
+ if (0 === \strpos($method, 'all')) {
+ if (!\array_key_exists(0, $args)) {
+ throw new BadMethodCallException('Missing the first argument.');
+ }
+
+ static::isTraversable($args[0]);
+
+ $method = \substr($method, 3);
+ $values = \array_shift($args);
+ $calledClass = \get_called_class();
+
+ foreach ($values as $value) {
+ \call_user_func_array([$calledClass, $method], \array_merge([$value], $args));
+ }
+
+ return true;
+ }
+
+ throw new BadMethodCallException('No assertion Assertion#'.$method.' exists.');
+ }
+
+ /**
+ * Determines if the values array has every choice as key and that this choice has content.
+ *
+ * @param array $values
+ * @param array $choices
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function choicesNotEmpty(array $values, array $choices, $message = null, string $propertyPath = null): bool
+ {
+ static::notEmpty($values, $message, $propertyPath);
+
+ foreach ($choices as $choice) {
+ static::notEmptyKey($values, $choice, $message, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Determines that the named method is defined in the provided object.
+ *
+ * @param string $value
+ * @param mixed $object
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function methodExists($value, $object, $message = null, string $propertyPath = null): bool
+ {
+ static::isObject($object, $message, $propertyPath);
+
+ if (!\method_exists($object, $value)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Expected "%s" does not exist in provided object.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_METHOD, $propertyPath, ['object' => \get_class($object)]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Determines that the provided value is an object.
+ *
+ * @param mixed $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function isObject($value, $message = null, string $propertyPath = null): bool
+ {
+ if (!\is_object($value)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Provided "%s" is not a valid object.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_OBJECT, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Determines if the value is less than given limit.
+ *
+ * @param mixed $value
+ * @param mixed $limit
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function lessThan($value, $limit, $message = null, string $propertyPath = null): bool
+ {
+ if ($value >= $limit) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Provided "%s" is not less than "%s".'),
+ static::stringify($value),
+ static::stringify($limit)
+ );
+
+ throw static::createException($value, $message, static::INVALID_LESS, $propertyPath, ['limit' => $limit]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Determines if the value is less or equal than given limit.
+ *
+ * @param mixed $value
+ * @param mixed $limit
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function lessOrEqualThan($value, $limit, $message = null, string $propertyPath = null): bool
+ {
+ if ($value > $limit) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Provided "%s" is not less or equal than "%s".'),
+ static::stringify($value),
+ static::stringify($limit)
+ );
+
+ throw static::createException($value, $message, static::INVALID_LESS_OR_EQUAL, $propertyPath, ['limit' => $limit]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Determines if the value is greater than given limit.
+ *
+ * @param mixed $value
+ * @param mixed $limit
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function greaterThan($value, $limit, $message = null, string $propertyPath = null): bool
+ {
+ if ($value <= $limit) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Provided "%s" is not greater than "%s".'),
+ static::stringify($value),
+ static::stringify($limit)
+ );
+
+ throw static::createException($value, $message, static::INVALID_GREATER, $propertyPath, ['limit' => $limit]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Determines if the value is greater or equal than given limit.
+ *
+ * @param mixed $value
+ * @param mixed $limit
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function greaterOrEqualThan($value, $limit, $message = null, string $propertyPath = null): bool
+ {
+ if ($value < $limit) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Provided "%s" is not greater or equal than "%s".'),
+ static::stringify($value),
+ static::stringify($limit)
+ );
+
+ throw static::createException($value, $message, static::INVALID_GREATER_OR_EQUAL, $propertyPath, ['limit' => $limit]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that a value is greater or equal than a lower limit, and less than or equal to an upper limit.
+ *
+ * @param mixed $value
+ * @param mixed $lowerLimit
+ * @param mixed $upperLimit
+ * @param string|callable|null $message
+ * @param string $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function between($value, $lowerLimit, $upperLimit, $message = null, string $propertyPath = null): bool
+ {
+ if ($lowerLimit > $value || $value > $upperLimit) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Provided "%s" is neither greater than or equal to "%s" nor less than or equal to "%s".'),
+ static::stringify($value),
+ static::stringify($lowerLimit),
+ static::stringify($upperLimit)
+ );
+
+ throw static::createException($value, $message, static::INVALID_BETWEEN, $propertyPath, ['lower' => $lowerLimit, 'upper' => $upperLimit]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that a value is greater than a lower limit, and less than an upper limit.
+ *
+ * @param mixed $value
+ * @param mixed $lowerLimit
+ * @param mixed $upperLimit
+ * @param string|callable|null $message
+ * @param string $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function betweenExclusive($value, $lowerLimit, $upperLimit, $message = null, string $propertyPath = null): bool
+ {
+ if ($lowerLimit >= $value || $value >= $upperLimit) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Provided "%s" is neither greater than "%s" nor less than "%s".'),
+ static::stringify($value),
+ static::stringify($lowerLimit),
+ static::stringify($upperLimit)
+ );
+
+ throw static::createException($value, $message, static::INVALID_BETWEEN_EXCLUSIVE, $propertyPath, ['lower' => $lowerLimit, 'upper' => $upperLimit]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that extension is loaded.
+ *
+ * @param mixed $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function extensionLoaded($value, $message = null, string $propertyPath = null): bool
+ {
+ if (!\extension_loaded($value)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Extension "%s" is required.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_EXTENSION, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that date is valid and corresponds to the given format.
+ *
+ * @param string $value
+ * @param string $format supports all of the options date(), except for the following:
+ * N, w, W, t, L, o, B, a, A, g, h, I, O, P, Z, c, r
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ *
+ * @see http://php.net/manual/function.date.php#refsect1-function.date-parameters
+ */
+ public static function date($value, $format, $message = null, string $propertyPath = null): bool
+ {
+ static::string($value, $message, $propertyPath);
+ static::string($format, $message, $propertyPath);
+
+ $dateTime = DateTime::createFromFormat('!'.$format, $value);
+
+ if (false === $dateTime || $value !== $dateTime->format($format)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Date "%s" is invalid or does not match format "%s".'),
+ static::stringify($value),
+ static::stringify($format)
+ );
+
+ throw static::createException($value, $message, static::INVALID_DATE, $propertyPath, ['format' => $format]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that the value is an object, or a class that exists.
+ *
+ * @param mixed $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function objectOrClass($value, $message = null, string $propertyPath = null): bool
+ {
+ if (!\is_object($value)) {
+ static::classExists($value, $message, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that the value is an object or class, and that the property exists.
+ *
+ * @param mixed $value
+ * @param string $property
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function propertyExists($value, $property, $message = null, string $propertyPath = null): bool
+ {
+ static::objectOrClass($value);
+
+ if (!\property_exists($value, $property)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Class "%s" does not have property "%s".'),
+ static::stringify($value),
+ static::stringify($property)
+ );
+
+ throw static::createException($value, $message, static::INVALID_PROPERTY, $propertyPath, ['property' => $property]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that the value is an object or class, and that the properties all exist.
+ *
+ * @param mixed $value
+ * @param array $properties
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function propertiesExist($value, array $properties, $message = null, string $propertyPath = null): bool
+ {
+ static::objectOrClass($value);
+ static::allString($properties, $message, $propertyPath);
+
+ $invalidProperties = [];
+ foreach ($properties as $property) {
+ if (!\property_exists($value, $property)) {
+ $invalidProperties[] = $property;
+ }
+ }
+
+ if ($invalidProperties) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Class "%s" does not have these properties: %s.'),
+ static::stringify($value),
+ static::stringify(\implode(', ', $invalidProperties))
+ );
+
+ throw static::createException($value, $message, static::INVALID_PROPERTY, $propertyPath, ['properties' => $properties]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert comparison of two versions.
+ *
+ * @param string $version1
+ * @param string $operator
+ * @param string $version2
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function version($version1, $operator, $version2, $message = null, string $propertyPath = null): bool
+ {
+ static::notEmpty($operator, 'versionCompare operator is required and cannot be empty.');
+
+ if (true !== \version_compare($version1, $version2, $operator)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Version "%s" is not "%s" version "%s".'),
+ static::stringify($version1),
+ static::stringify($operator),
+ static::stringify($version2)
+ );
+
+ throw static::createException($version1, $message, static::INVALID_VERSION, $propertyPath, ['operator' => $operator, 'version' => $version2]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert on PHP version.
+ *
+ * @param string $operator
+ * @param mixed $version
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function phpVersion($operator, $version, $message = null, string $propertyPath = null): bool
+ {
+ static::defined('PHP_VERSION');
+
+ return static::version(PHP_VERSION, $operator, $version, $message, $propertyPath);
+ }
+
+ /**
+ * Assert that extension is loaded and a specific version is installed.
+ *
+ * @param string $extension
+ * @param string $operator
+ * @param mixed $version
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function extensionVersion($extension, $operator, $version, $message = null, string $propertyPath = null): bool
+ {
+ static::extensionLoaded($extension, $message, $propertyPath);
+
+ return static::version(\phpversion($extension), $operator, $version, $message, $propertyPath);
+ }
+
+ /**
+ * Determines that the provided value is callable.
+ *
+ * @param mixed $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function isCallable($value, $message = null, string $propertyPath = null): bool
+ {
+ if (!\is_callable($value)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Provided "%s" is not a callable.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_CALLABLE, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that the provided value is valid according to a callback.
+ *
+ * If the callback returns `false` the assertion will fail.
+ *
+ * @param mixed $value
+ * @param callable $callback
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function satisfy($value, $callback, $message = null, string $propertyPath = null): bool
+ {
+ static::isCallable($callback);
+
+ if (false === \call_user_func($callback, $value)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Provided "%s" is invalid according to custom rule.'),
+ static::stringify($value)
+ );
+
+ throw static::createException($value, $message, static::INVALID_SATISFY, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that value is an IPv4 or IPv6 address
+ * (using input_filter/FILTER_VALIDATE_IP).
+ *
+ * @param string $value
+ * @param int|null $flag
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ *
+ * @see http://php.net/manual/filter.filters.flags.php
+ */
+ public static function ip($value, $flag = null, $message = null, string $propertyPath = null): bool
+ {
+ static::string($value, $message, $propertyPath);
+ if (!\filter_var($value, FILTER_VALIDATE_IP, $flag)) {
+ $message = \sprintf(
+ static::generateMessage($message ?: 'Value "%s" was expected to be a valid IP address.'),
+ static::stringify($value)
+ );
+ throw static::createException($value, $message, static::INVALID_IP, $propertyPath, ['flag' => $flag]);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that value is an IPv4 address
+ * (using input_filter/FILTER_VALIDATE_IP).
+ *
+ * @param string $value
+ * @param int|null $flag
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ *
+ * @see http://php.net/manual/filter.filters.flags.php
+ */
+ public static function ipv4($value, $flag = null, $message = null, string $propertyPath = null): bool
+ {
+ static::ip($value, $flag | FILTER_FLAG_IPV4, static::generateMessage($message ?: 'Value "%s" was expected to be a valid IPv4 address.'), $propertyPath);
+
+ return true;
+ }
+
+ /**
+ * Assert that value is an IPv6 address
+ * (using input_filter/FILTER_VALIDATE_IP).
+ *
+ * @param string $value
+ * @param int|null $flag
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ *
+ * @see http://php.net/manual/filter.filters.flags.php
+ */
+ public static function ipv6($value, $flag = null, $message = null, string $propertyPath = null): bool
+ {
+ static::ip($value, $flag | FILTER_FLAG_IPV6, static::generateMessage($message ?: 'Value "%s" was expected to be a valid IPv6 address.'), $propertyPath);
+
+ return true;
+ }
+
+ /**
+ * Assert that a constant is defined.
+ *
+ * @param mixed $constant
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ */
+ public static function defined($constant, $message = null, string $propertyPath = null): bool
+ {
+ if (!\defined($constant)) {
+ $message = \sprintf(static::generateMessage($message ?: 'Value "%s" expected to be a defined constant.'), $constant);
+
+ throw static::createException($constant, $message, static::INVALID_CONSTANT, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that a constant is defined.
+ *
+ * @param string $value
+ * @param string|callable|null $message
+ * @param string|null $propertyPath
+ *
+ * @return bool
+ *
+ * @throws AssertionFailedException
+ */
+ public static function base64($value, $message = null, string $propertyPath = null): bool
+ {
+ if (false === \base64_decode($value, true)) {
+ $message = \sprintf(static::generateMessage($message ?: 'Value "%s" is not a valid base64 string.'), $value);
+
+ throw static::createException($value, $message, static::INVALID_BASE64, $propertyPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Helper method that handles building the assertion failure exceptions.
+ * They are returned from this method so that the stack trace still shows
+ * the assertions method.
+ *
+ * @param mixed $value
+ * @param string|callable|null $message
+ * @param int $code
+ * @param string|null $propertyPath
+ * @param array $constraints
+ *
+ * @return mixed
+ */
+ protected static function createException($value, $message, $code, $propertyPath = null, array $constraints = [])
+ {
+ $exceptionClass = static::$exceptionClass;
+
+ return new $exceptionClass($message, $code, $propertyPath, $value, $constraints);
+ }
+
+ /**
+ * Make a string version of a value.
+ *
+ * @param mixed $value
+ *
+ * @return string
+ */
+ protected static function stringify($value): string
+ {
+ $result = \gettype($value);
+
+ if (\is_bool($value)) {
+ $result = $value ? '<TRUE>' : '<FALSE>';
+ } elseif (\is_scalar($value)) {
+ $val = (string)$value;
+
+ if (\mb_strlen($val) > 100) {
+ $val = \mb_substr($val, 0, 97).'...';
+ }
+
+ $result = $val;
+ } elseif (\is_array($value)) {
+ $result = '<ARRAY>';
+ } elseif (\is_object($value)) {
+ $result = \get_class($value);
+ } elseif (\is_resource($value)) {
+ $result = \get_resource_type($value);
+ } elseif (null === $value) {
+ $result = '<NULL>';
+ }
+
+ return $result;
+ }
+
+ /**
+ * Generate the message.
+ *
+ * @param string|callable|null $message
+ *
+ * @return string
+ */
+ protected static function generateMessage($message): string
+ {
+ if (\is_callable($message)) {
+ $traces = \debug_backtrace(0);
+
+ $parameters = [];
+
+ try {
+ $reflection = new ReflectionClass($traces[1]['class']);
+ $method = $reflection->getMethod($traces[1]['function']);
+ foreach ($method->getParameters() as $index => $parameter) {
+ if ('message' !== $parameter->getName()) {
+ $parameters[$parameter->getName()] = \array_key_exists($index, $traces[1]['args'])
+ ? $traces[1]['args'][$index]
+ : $parameter->getDefaultValue();
+ }
+ }
+
+ $parameters['::assertion'] = \sprintf('%s%s%s', $traces[1]['class'], $traces[1]['type'], $traces[1]['function']);
+
+ $message = \call_user_func_array($message, [$parameters]);
+ } // @codeCoverageIgnoreStart
+ catch (Throwable $exception) {
+ $message = \sprintf('Unable to generate message : %s', $exception->getMessage());
+ } // @codeCoverageIgnoreEnd
+ }
+
+ return (string)$message;
+ }
+}
diff --git a/vendor/beberlei/assert/lib/Assert/AssertionChain.php b/vendor/beberlei/assert/lib/Assert/AssertionChain.php
new file mode 100644
index 000000000..dbb6e839b
--- /dev/null
+++ b/vendor/beberlei/assert/lib/Assert/AssertionChain.php
@@ -0,0 +1,254 @@
+<?php
+
+/**
+ * Assert
+ *
+ * LICENSE
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this package in the file LICENSE.txt.
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to [email protected] so I can send you a copy immediately.
+ */
+
+namespace Assert;
+
+use LogicException;
+use ReflectionClass;
+
+/**
+ * Chaining builder for assertions.
+ *
+ * @author Benjamin Eberlei <[email protected]>
+ *
+ * @method AssertionChain alnum(string|callable $message = null, string $propertyPath = null) Assert that value is alphanumeric.
+ * @method AssertionChain base64(string|callable $message = null, string $propertyPath = null) Assert that a constant is defined.
+ * @method AssertionChain between(mixed $lowerLimit, mixed $upperLimit, string|callable $message = null, string $propertyPath = null) Assert that a value is greater or equal than a lower limit, and less than or equal to an upper limit.
+ * @method AssertionChain betweenExclusive(mixed $lowerLimit, mixed $upperLimit, string|callable $message = null, string $propertyPath = null) Assert that a value is greater than a lower limit, and less than an upper limit.
+ * @method AssertionChain betweenLength(int $minLength, int $maxLength, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string length is between min and max lengths.
+ * @method AssertionChain boolean(string|callable $message = null, string $propertyPath = null) Assert that value is php boolean.
+ * @method AssertionChain choice(array $choices, string|callable $message = null, string $propertyPath = null) Assert that value is in array of choices.
+ * @method AssertionChain choicesNotEmpty(array $choices, string|callable $message = null, string $propertyPath = null) Determines if the values array has every choice as key and that this choice has content.
+ * @method AssertionChain classExists(string|callable $message = null, string $propertyPath = null) Assert that the class exists.
+ * @method AssertionChain contains(string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string contains a sequence of chars.
+ * @method AssertionChain count(int $count, string|callable $message = null, string $propertyPath = null) Assert that the count of countable is equal to count.
+ * @method AssertionChain date(string $format, string|callable $message = null, string $propertyPath = null) Assert that date is valid and corresponds to the given format.
+ * @method AssertionChain defined(string|callable $message = null, string $propertyPath = null) Assert that a constant is defined.
+ * @method AssertionChain digit(string|callable $message = null, string $propertyPath = null) Validates if an integer or integerish is a digit.
+ * @method AssertionChain directory(string|callable $message = null, string $propertyPath = null) Assert that a directory exists.
+ * @method AssertionChain e164(string|callable $message = null, string $propertyPath = null) Assert that the given string is a valid E164 Phone Number.
+ * @method AssertionChain email(string|callable $message = null, string $propertyPath = null) Assert that value is an email address (using input_filter/FILTER_VALIDATE_EMAIL).
+ * @method AssertionChain endsWith(string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string ends with a sequence of chars.
+ * @method AssertionChain eq(mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are equal (using ==).
+ * @method AssertionChain eqArraySubset(mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that the array contains the subset.
+ * @method AssertionChain extensionLoaded(string|callable $message = null, string $propertyPath = null) Assert that extension is loaded.
+ * @method AssertionChain extensionVersion(string $operator, mixed $version, string|callable $message = null, string $propertyPath = null) Assert that extension is loaded and a specific version is installed.
+ * @method AssertionChain false(string|callable $message = null, string $propertyPath = null) Assert that the value is boolean False.
+ * @method AssertionChain file(string|callable $message = null, string $propertyPath = null) Assert that a file exists.
+ * @method AssertionChain float(string|callable $message = null, string $propertyPath = null) Assert that value is a php float.
+ * @method AssertionChain greaterOrEqualThan(mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is greater or equal than given limit.
+ * @method AssertionChain greaterThan(mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is greater than given limit.
+ * @method AssertionChain implementsInterface(string $interfaceName, string|callable $message = null, string $propertyPath = null) Assert that the class implements the interface.
+ * @method AssertionChain inArray(array $choices, string|callable $message = null, string $propertyPath = null) Assert that value is in array of choices. This is an alias of Assertion::choice().
+ * @method AssertionChain integer(string|callable $message = null, string $propertyPath = null) Assert that value is a php integer.
+ * @method AssertionChain integerish(string|callable $message = null, string $propertyPath = null) Assert that value is a php integer'ish.
+ * @method AssertionChain interfaceExists(string|callable $message = null, string $propertyPath = null) Assert that the interface exists.
+ * @method AssertionChain ip(int $flag = null, string|callable $message = null, string $propertyPath = null) Assert that value is an IPv4 or IPv6 address.
+ * @method AssertionChain ipv4(int $flag = null, string|callable $message = null, string $propertyPath = null) Assert that value is an IPv4 address.
+ * @method AssertionChain ipv6(int $flag = null, string|callable $message = null, string $propertyPath = null) Assert that value is an IPv6 address.
+ * @method AssertionChain isArray(string|callable $message = null, string $propertyPath = null) Assert that value is an array.
+ * @method AssertionChain isArrayAccessible(string|callable $message = null, string $propertyPath = null) Assert that value is an array or an array-accessible object.
+ * @method AssertionChain isCallable(string|callable $message = null, string $propertyPath = null) Determines that the provided value is callable.
+ * @method AssertionChain isCountable(string|callable $message = null, string $propertyPath = null) Assert that value is countable.
+ * @method AssertionChain isInstanceOf(string $className, string|callable $message = null, string $propertyPath = null) Assert that value is instance of given class-name.
+ * @method AssertionChain isJsonString(string|callable $message = null, string $propertyPath = null) Assert that the given string is a valid json string.
+ * @method AssertionChain isObject(string|callable $message = null, string $propertyPath = null) Determines that the provided value is an object.
+ * @method AssertionChain isResource(string|callable $message = null, string $propertyPath = null) Assert that value is a resource.
+ * @method AssertionChain isTraversable(string|callable $message = null, string $propertyPath = null) Assert that value is an array or a traversable object.
+ * @method AssertionChain keyExists(string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key exists in an array.
+ * @method AssertionChain keyIsset(string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key exists in an array/array-accessible object using isset().
+ * @method AssertionChain keyNotExists(string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key does not exist in an array.
+ * @method AssertionChain length(int $length, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string has a given length.
+ * @method AssertionChain lessOrEqualThan(mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is less or equal than given limit.
+ * @method AssertionChain lessThan(mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is less than given limit.
+ * @method AssertionChain max(mixed $maxValue, string|callable $message = null, string $propertyPath = null) Assert that a number is smaller as a given limit.
+ * @method AssertionChain maxCount(int $count, string|callable $message = null, string $propertyPath = null) Assert that the countable have at most $count elements.
+ * @method AssertionChain maxLength(int $maxLength, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string value is not longer than $maxLength chars.
+ * @method AssertionChain methodExists(mixed $object, string|callable $message = null, string $propertyPath = null) Determines that the named method is defined in the provided object.
+ * @method AssertionChain min(mixed $minValue, string|callable $message = null, string $propertyPath = null) Assert that a value is at least as big as a given limit.
+ * @method AssertionChain minCount(int $count, string|callable $message = null, string $propertyPath = null) Assert that the countable have at least $count elements.
+ * @method AssertionChain minLength(int $minLength, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that a string is at least $minLength chars long.
+ * @method AssertionChain noContent(string|callable $message = null, string $propertyPath = null) Assert that value is empty.
+ * @method AssertionChain notBlank(string|callable $message = null, string $propertyPath = null) Assert that value is not blank.
+ * @method AssertionChain notContains(string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string does not contains a sequence of chars.
+ * @method AssertionChain notEmpty(string|callable $message = null, string $propertyPath = null) Assert that value is not empty.
+ * @method AssertionChain notEmptyKey(string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key exists in an array/array-accessible object and its value is not empty.
+ * @method AssertionChain notEq(mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are not equal (using ==).
+ * @method AssertionChain notInArray(array $choices, string|callable $message = null, string $propertyPath = null) Assert that value is not in array of choices.
+ * @method AssertionChain notIsInstanceOf(string $className, string|callable $message = null, string $propertyPath = null) Assert that value is not instance of given class-name.
+ * @method AssertionChain notNull(string|callable $message = null, string $propertyPath = null) Assert that value is not null.
+ * @method AssertionChain notRegex(string $pattern, string|callable $message = null, string $propertyPath = null) Assert that value does not match a regex.
+ * @method AssertionChain notSame(mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are not the same (using ===).
+ * @method AssertionChain null(string|callable $message = null, string $propertyPath = null) Assert that value is null.
+ * @method AssertionChain numeric(string|callable $message = null, string $propertyPath = null) Assert that value is numeric.
+ * @method AssertionChain objectOrClass(string|callable $message = null, string $propertyPath = null) Assert that the value is an object, or a class that exists.
+ * @method AssertionChain phpVersion(mixed $version, string|callable $message = null, string $propertyPath = null) Assert on PHP version.
+ * @method AssertionChain propertiesExist(array $properties, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the properties all exist.
+ * @method AssertionChain propertyExists(string $property, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the property exists.
+ * @method AssertionChain range(mixed $minValue, mixed $maxValue, string|callable $message = null, string $propertyPath = null) Assert that value is in range of numbers.
+ * @method AssertionChain readable(string|callable $message = null, string $propertyPath = null) Assert that the value is something readable.
+ * @method AssertionChain regex(string $pattern, string|callable $message = null, string $propertyPath = null) Assert that value matches a regex.
+ * @method AssertionChain same(mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are the same (using ===).
+ * @method AssertionChain satisfy(callable $callback, string|callable $message = null, string $propertyPath = null) Assert that the provided value is valid according to a callback.
+ * @method AssertionChain scalar(string|callable $message = null, string $propertyPath = null) Assert that value is a PHP scalar.
+ * @method AssertionChain startsWith(string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string starts with a sequence of chars.
+ * @method AssertionChain string(string|callable $message = null, string $propertyPath = null) Assert that value is a string.
+ * @method AssertionChain subclassOf(string $className, string|callable $message = null, string $propertyPath = null) Assert that value is subclass of given class-name.
+ * @method AssertionChain true(string|callable $message = null, string $propertyPath = null) Assert that the value is boolean True.
+ * @method AssertionChain url(string|callable $message = null, string $propertyPath = null) Assert that value is an URL.
+ * @method AssertionChain uuid(string|callable $message = null, string $propertyPath = null) Assert that the given string is a valid UUID.
+ * @method AssertionChain version(string $operator, string $version2, string|callable $message = null, string $propertyPath = null) Assert comparison of two versions.
+ * @method AssertionChain writeable(string|callable $message = null, string $propertyPath = null) Assert that the value is something writeable.
+ */
+class AssertionChain
+{
+ /**
+ * @var mixed
+ */
+ private $value;
+
+ /**
+ * @var string|callable|null
+ */
+ private $defaultMessage;
+
+ /**
+ * @var string|null
+ */
+ private $defaultPropertyPath;
+
+ /**
+ * Return each assertion as always valid.
+ *
+ * @var bool
+ */
+ private $alwaysValid = false;
+
+ /**
+ * Perform assertion on every element of array or traversable.
+ *
+ * @var bool
+ */
+ private $all = false;
+
+ /** @var string|Assertion Class to use for assertion calls */
+ private $assertionClassName = 'Assert\Assertion';
+
+ /**
+ * AssertionChain constructor.
+ *
+ * @param mixed $value
+ * @param string|callable|null $defaultMessage
+ * @param string|null $defaultPropertyPath
+ */
+ public function __construct($value, $defaultMessage = null, string $defaultPropertyPath = null)
+ {
+ $this->value = $value;
+ $this->defaultMessage = $defaultMessage;
+ $this->defaultPropertyPath = $defaultPropertyPath;
+ }
+
+ /**
+ * Call assertion on the current value in the chain.
+ *
+ * @param string $methodName
+ * @param array $args
+ *
+ * @return AssertionChain
+ */
+ public function __call($methodName, $args): AssertionChain
+ {
+ if (true === $this->alwaysValid) {
+ return $this;
+ }
+
+ if (!\method_exists($this->assertionClassName, $methodName)) {
+ throw new \RuntimeException("Assertion '".$methodName."' does not exist.");
+ }
+
+ $reflClass = new ReflectionClass($this->assertionClassName);
+ $method = $reflClass->getMethod($methodName);
+
+ \array_unshift($args, $this->value);
+ $params = $method->getParameters();
+
+ foreach ($params as $idx => $param) {
+ if (isset($args[$idx])) {
+ continue;
+ }
+
+ if ('message' == $param->getName()) {
+ $args[$idx] = $this->defaultMessage;
+ }
+
+ if ('propertyPath' == $param->getName()) {
+ $args[$idx] = $this->defaultPropertyPath;
+ }
+ }
+
+ if ($this->all) {
+ $methodName = 'all'.$methodName;
+ }
+
+ \call_user_func_array([$this->assertionClassName, $methodName], $args);
+
+ return $this;
+ }
+
+ /**
+ * Switch chain into validation mode for an array of values.
+ *
+ * @return AssertionChain
+ */
+ public function all(): AssertionChain
+ {
+ $this->all = true;
+
+ return $this;
+ }
+
+ /**
+ * Switch chain into mode allowing nulls, ignoring further assertions.
+ *
+ * @return AssertionChain
+ */
+ public function nullOr(): AssertionChain
+ {
+ if (null === $this->value) {
+ $this->alwaysValid = true;
+ }
+
+ return $this;
+ }
+
+ /**
+ * @param string $className
+ *
+ * @return $this
+ */
+ public function setAssertionClassName($className): AssertionChain
+ {
+ if (!\is_string($className)) {
+ throw new LogicException('Exception class name must be passed as a string');
+ }
+
+ if (Assertion::class !== $className && !\is_subclass_of($className, Assertion::class)) {
+ throw new LogicException($className.' is not (a subclass of) '.Assertion::class);
+ }
+
+ $this->assertionClassName = $className;
+
+ return $this;
+ }
+}
diff --git a/vendor/beberlei/assert/lib/Assert/AssertionFailedException.php b/vendor/beberlei/assert/lib/Assert/AssertionFailedException.php
new file mode 100644
index 000000000..c18483884
--- /dev/null
+++ b/vendor/beberlei/assert/lib/Assert/AssertionFailedException.php
@@ -0,0 +1,35 @@
+<?php
+
+/**
+ * Assert
+ *
+ * LICENSE
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this package in the file LICENSE.txt.
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to [email protected] so I can send you a copy immediately.
+ */
+
+namespace Assert;
+
+use Throwable;
+
+interface AssertionFailedException extends Throwable
+{
+ /**
+ * @return string|null
+ */
+ public function getPropertyPath();
+
+ /**
+ * @return mixed
+ */
+ public function getValue();
+
+ /**
+ * @return array
+ */
+ public function getConstraints(): array;
+}
diff --git a/vendor/beberlei/assert/lib/Assert/InvalidArgumentException.php b/vendor/beberlei/assert/lib/Assert/InvalidArgumentException.php
new file mode 100644
index 000000000..acd966544
--- /dev/null
+++ b/vendor/beberlei/assert/lib/Assert/InvalidArgumentException.php
@@ -0,0 +1,76 @@
+<?php
+
+/**
+ * Assert
+ *
+ * LICENSE
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this package in the file LICENSE.txt.
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to [email protected] so I can send you a copy immediately.
+ */
+
+namespace Assert;
+
+class InvalidArgumentException extends \InvalidArgumentException implements AssertionFailedException
+{
+ /**
+ * @var string|null
+ */
+ private $propertyPath;
+
+ /**
+ * @var mixed
+ */
+ private $value;
+
+ /**
+ * @var array
+ */
+ private $constraints;
+
+ public function __construct($message, $code, string $propertyPath = null, $value = null, array $constraints = [])
+ {
+ parent::__construct($message, $code);
+
+ $this->propertyPath = $propertyPath;
+ $this->value = $value;
+ $this->constraints = $constraints;
+ }
+
+ /**
+ * User controlled way to define a sub-property causing
+ * the failure of a currently asserted objects.
+ *
+ * Useful to transport information about the nature of the error
+ * back to higher layers.
+ *
+ * @return string|null
+ */
+ public function getPropertyPath()
+ {
+ return $this->propertyPath;
+ }
+
+ /**
+ * Get the value that caused the assertion to fail.
+ *
+ * @return mixed
+ */
+ public function getValue()
+ {
+ return $this->value;
+ }
+
+ /**
+ * Get the constraints that applied to the failed assertion.
+ *
+ * @return array
+ */
+ public function getConstraints(): array
+ {
+ return $this->constraints;
+ }
+}
diff --git a/vendor/beberlei/assert/lib/Assert/LazyAssertion.php b/vendor/beberlei/assert/lib/Assert/LazyAssertion.php
new file mode 100644
index 000000000..6ccd64236
--- /dev/null
+++ b/vendor/beberlei/assert/lib/Assert/LazyAssertion.php
@@ -0,0 +1,230 @@
+<?php
+
+/**
+ * Assert
+ *
+ * LICENSE
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this package in the file LICENSE.txt.
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to [email protected] so I can send you a copy immediately.
+ */
+
+namespace Assert;
+
+use LogicException;
+
+/**
+ * Chaining builder for lazy assertions.
+ *
+ * @author Benjamin Eberlei <[email protected]>
+ *
+ * @method LazyAssertion alnum(string|callable $message = null, string $propertyPath = null) Assert that value is alphanumeric.
+ * @method LazyAssertion base64(string|callable $message = null, string $propertyPath = null) Assert that a constant is defined.
+ * @method LazyAssertion between(mixed $lowerLimit, mixed $upperLimit, string|callable $message = null, string $propertyPath = null) Assert that a value is greater or equal than a lower limit, and less than or equal to an upper limit.
+ * @method LazyAssertion betweenExclusive(mixed $lowerLimit, mixed $upperLimit, string|callable $message = null, string $propertyPath = null) Assert that a value is greater than a lower limit, and less than an upper limit.
+ * @method LazyAssertion betweenLength(int $minLength, int $maxLength, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string length is between min and max lengths.
+ * @method LazyAssertion boolean(string|callable $message = null, string $propertyPath = null) Assert that value is php boolean.
+ * @method LazyAssertion choice(array $choices, string|callable $message = null, string $propertyPath = null) Assert that value is in array of choices.
+ * @method LazyAssertion choicesNotEmpty(array $choices, string|callable $message = null, string $propertyPath = null) Determines if the values array has every choice as key and that this choice has content.
+ * @method LazyAssertion classExists(string|callable $message = null, string $propertyPath = null) Assert that the class exists.
+ * @method LazyAssertion contains(string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string contains a sequence of chars.
+ * @method LazyAssertion count(int $count, string|callable $message = null, string $propertyPath = null) Assert that the count of countable is equal to count.
+ * @method LazyAssertion date(string $format, string|callable $message = null, string $propertyPath = null) Assert that date is valid and corresponds to the given format.
+ * @method LazyAssertion defined(string|callable $message = null, string $propertyPath = null) Assert that a constant is defined.
+ * @method LazyAssertion digit(string|callable $message = null, string $propertyPath = null) Validates if an integer or integerish is a digit.
+ * @method LazyAssertion directory(string|callable $message = null, string $propertyPath = null) Assert that a directory exists.
+ * @method LazyAssertion e164(string|callable $message = null, string $propertyPath = null) Assert that the given string is a valid E164 Phone Number.
+ * @method LazyAssertion email(string|callable $message = null, string $propertyPath = null) Assert that value is an email address (using input_filter/FILTER_VALIDATE_EMAIL).
+ * @method LazyAssertion endsWith(string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string ends with a sequence of chars.
+ * @method LazyAssertion eq(mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are equal (using ==).
+ * @method LazyAssertion eqArraySubset(mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that the array contains the subset.
+ * @method LazyAssertion extensionLoaded(string|callable $message = null, string $propertyPath = null) Assert that extension is loaded.
+ * @method LazyAssertion extensionVersion(string $operator, mixed $version, string|callable $message = null, string $propertyPath = null) Assert that extension is loaded and a specific version is installed.
+ * @method LazyAssertion false(string|callable $message = null, string $propertyPath = null) Assert that the value is boolean False.
+ * @method LazyAssertion file(string|callable $message = null, string $propertyPath = null) Assert that a file exists.
+ * @method LazyAssertion float(string|callable $message = null, string $propertyPath = null) Assert that value is a php float.
+ * @method LazyAssertion greaterOrEqualThan(mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is greater or equal than given limit.
+ * @method LazyAssertion greaterThan(mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is greater than given limit.
+ * @method LazyAssertion implementsInterface(string $interfaceName, string|callable $message = null, string $propertyPath = null) Assert that the class implements the interface.
+ * @method LazyAssertion inArray(array $choices, string|callable $message = null, string $propertyPath = null) Assert that value is in array of choices. This is an alias of Assertion::choice().
+ * @method LazyAssertion integer(string|callable $message = null, string $propertyPath = null) Assert that value is a php integer.
+ * @method LazyAssertion integerish(string|callable $message = null, string $propertyPath = null) Assert that value is a php integer'ish.
+ * @method LazyAssertion interfaceExists(string|callable $message = null, string $propertyPath = null) Assert that the interface exists.
+ * @method LazyAssertion ip(int $flag = null, string|callable $message = null, string $propertyPath = null) Assert that value is an IPv4 or IPv6 address.
+ * @method LazyAssertion ipv4(int $flag = null, string|callable $message = null, string $propertyPath = null) Assert that value is an IPv4 address.
+ * @method LazyAssertion ipv6(int $flag = null, string|callable $message = null, string $propertyPath = null) Assert that value is an IPv6 address.
+ * @method LazyAssertion isArray(string|callable $message = null, string $propertyPath = null) Assert that value is an array.
+ * @method LazyAssertion isArrayAccessible(string|callable $message = null, string $propertyPath = null) Assert that value is an array or an array-accessible object.
+ * @method LazyAssertion isCallable(string|callable $message = null, string $propertyPath = null) Determines that the provided value is callable.
+ * @method LazyAssertion isCountable(string|callable $message = null, string $propertyPath = null) Assert that value is countable.
+ * @method LazyAssertion isInstanceOf(string $className, string|callable $message = null, string $propertyPath = null) Assert that value is instance of given class-name.
+ * @method LazyAssertion isJsonString(string|callable $message = null, string $propertyPath = null) Assert that the given string is a valid json string.
+ * @method LazyAssertion isObject(string|callable $message = null, string $propertyPath = null) Determines that the provided value is an object.
+ * @method LazyAssertion isResource(string|callable $message = null, string $propertyPath = null) Assert that value is a resource.
+ * @method LazyAssertion isTraversable(string|callable $message = null, string $propertyPath = null) Assert that value is an array or a traversable object.
+ * @method LazyAssertion keyExists(string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key exists in an array.
+ * @method LazyAssertion keyIsset(string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key exists in an array/array-accessible object using isset().
+ * @method LazyAssertion keyNotExists(string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key does not exist in an array.
+ * @method LazyAssertion length(int $length, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string has a given length.
+ * @method LazyAssertion lessOrEqualThan(mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is less or equal than given limit.
+ * @method LazyAssertion lessThan(mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is less than given limit.
+ * @method LazyAssertion max(mixed $maxValue, string|callable $message = null, string $propertyPath = null) Assert that a number is smaller as a given limit.
+ * @method LazyAssertion maxCount(int $count, string|callable $message = null, string $propertyPath = null) Assert that the countable have at most $count elements.
+ * @method LazyAssertion maxLength(int $maxLength, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string value is not longer than $maxLength chars.
+ * @method LazyAssertion methodExists(mixed $object, string|callable $message = null, string $propertyPath = null) Determines that the named method is defined in the provided object.
+ * @method LazyAssertion min(mixed $minValue, string|callable $message = null, string $propertyPath = null) Assert that a value is at least as big as a given limit.
+ * @method LazyAssertion minCount(int $count, string|callable $message = null, string $propertyPath = null) Assert that the countable have at least $count elements.
+ * @method LazyAssertion minLength(int $minLength, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that a string is at least $minLength chars long.
+ * @method LazyAssertion noContent(string|callable $message = null, string $propertyPath = null) Assert that value is empty.
+ * @method LazyAssertion notBlank(string|callable $message = null, string $propertyPath = null) Assert that value is not blank.
+ * @method LazyAssertion notContains(string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string does not contains a sequence of chars.
+ * @method LazyAssertion notEmpty(string|callable $message = null, string $propertyPath = null) Assert that value is not empty.
+ * @method LazyAssertion notEmptyKey(string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key exists in an array/array-accessible object and its value is not empty.
+ * @method LazyAssertion notEq(mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are not equal (using ==).
+ * @method LazyAssertion notInArray(array $choices, string|callable $message = null, string $propertyPath = null) Assert that value is not in array of choices.
+ * @method LazyAssertion notIsInstanceOf(string $className, string|callable $message = null, string $propertyPath = null) Assert that value is not instance of given class-name.
+ * @method LazyAssertion notNull(string|callable $message = null, string $propertyPath = null) Assert that value is not null.
+ * @method LazyAssertion notRegex(string $pattern, string|callable $message = null, string $propertyPath = null) Assert that value does not match a regex.
+ * @method LazyAssertion notSame(mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are not the same (using ===).
+ * @method LazyAssertion null(string|callable $message = null, string $propertyPath = null) Assert that value is null.
+ * @method LazyAssertion numeric(string|callable $message = null, string $propertyPath = null) Assert that value is numeric.
+ * @method LazyAssertion objectOrClass(string|callable $message = null, string $propertyPath = null) Assert that the value is an object, or a class that exists.
+ * @method LazyAssertion phpVersion(mixed $version, string|callable $message = null, string $propertyPath = null) Assert on PHP version.
+ * @method LazyAssertion propertiesExist(array $properties, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the properties all exist.
+ * @method LazyAssertion propertyExists(string $property, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the property exists.
+ * @method LazyAssertion range(mixed $minValue, mixed $maxValue, string|callable $message = null, string $propertyPath = null) Assert that value is in range of numbers.
+ * @method LazyAssertion readable(string|callable $message = null, string $propertyPath = null) Assert that the value is something readable.
+ * @method LazyAssertion regex(string $pattern, string|callable $message = null, string $propertyPath = null) Assert that value matches a regex.
+ * @method LazyAssertion same(mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are the same (using ===).
+ * @method LazyAssertion satisfy(callable $callback, string|callable $message = null, string $propertyPath = null) Assert that the provided value is valid according to a callback.
+ * @method LazyAssertion scalar(string|callable $message = null, string $propertyPath = null) Assert that value is a PHP scalar.
+ * @method LazyAssertion startsWith(string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string starts with a sequence of chars.
+ * @method LazyAssertion string(string|callable $message = null, string $propertyPath = null) Assert that value is a string.
+ * @method LazyAssertion subclassOf(string $className, string|callable $message = null, string $propertyPath = null) Assert that value is subclass of given class-name.
+ * @method LazyAssertion true(string|callable $message = null, string $propertyPath = null) Assert that the value is boolean True.
+ * @method LazyAssertion url(string|callable $message = null, string $propertyPath = null) Assert that value is an URL.
+ * @method LazyAssertion uuid(string|callable $message = null, string $propertyPath = null) Assert that the given string is a valid UUID.
+ * @method LazyAssertion version(string $operator, string $version2, string|callable $message = null, string $propertyPath = null) Assert comparison of two versions.
+ * @method LazyAssertion writeable(string|callable $message = null, string $propertyPath = null) Assert that the value is something writeable.
+ * @method LazyAssertion all() Switch chain into validation mode for an array of values.
+ * @method LazyAssertion nullOr() Switch chain into mode allowing nulls, ignoring further assertions.
+ */
+class LazyAssertion
+{
+ private $currentChainFailed = false;
+ private $alwaysTryAll = false;
+ private $thisChainTryAll = false;
+ private $currentChain;
+ private $errors = [];
+
+ /** @var string The class to use as AssertionChain factory */
+ private $assertClass = Assert::class;
+
+ /** @var string|LazyAssertionException The class to use for exceptions */
+ private $exceptionClass = LazyAssertionException::class;
+
+ /**
+ * @param mixed $value
+ * @param string|null $propertyPath
+ * @param string|callable|null $defaultMessage
+ *
+ * @return static
+ */
+ public function that($value, string $propertyPath = null, $defaultMessage = null)
+ {
+ $this->currentChainFailed = false;
+ $this->thisChainTryAll = false;
+ $assertClass = $this->assertClass;
+ $this->currentChain = $assertClass::that($value, $defaultMessage, $propertyPath);
+
+ return $this;
+ }
+
+ /**
+ * @return static
+ */
+ public function tryAll()
+ {
+ if (!$this->currentChain) {
+ $this->alwaysTryAll = true;
+ }
+
+ $this->thisChainTryAll = true;
+
+ return $this;
+ }
+
+ /**
+ * @param string $method
+ * @param array $args
+ *
+ * @return static
+ */
+ public function __call($method, $args)
+ {
+ if (false === $this->alwaysTryAll
+ && false === $this->thisChainTryAll
+ && true === $this->currentChainFailed
+ ) {
+ return $this;
+ }
+
+ try {
+ \call_user_func_array([$this->currentChain, $method], $args);
+ } catch (AssertionFailedException $e) {
+ $this->errors[] = $e;
+ $this->currentChainFailed = true;
+ }
+
+ return $this;
+ }
+
+ /**
+ * @return bool
+ *
+ * @throws LazyAssertionException
+ */
+ public function verifyNow(): bool
+ {
+ if ($this->errors) {
+ throw \call_user_func([$this->exceptionClass, 'fromErrors'], $this->errors);
+ }
+
+ return true;
+ }
+
+ /**
+ * @param string $className
+ *
+ * @return static
+ */
+ public function setAssertClass(string $className)
+ {
+ if (Assert::class !== $className && !\is_subclass_of($className, Assert::class)) {
+ throw new LogicException($className.' is not (a subclass of) '.Assert::class);
+ }
+
+ $this->assertClass = $className;
+
+ return $this;
+ }
+
+ /**
+ * @param string $className
+ *
+ * @return static
+ */
+ public function setExceptionClass(string $className)
+ {
+ if (LazyAssertionException::class !== $className && !\is_subclass_of($className, LazyAssertionException::class)) {
+ throw new LogicException($className.' is not (a subclass of) '.LazyAssertionException::class);
+ }
+
+ $this->exceptionClass = $className;
+
+ return $this;
+ }
+}
diff --git a/vendor/beberlei/assert/lib/Assert/LazyAssertionException.php b/vendor/beberlei/assert/lib/Assert/LazyAssertionException.php
new file mode 100644
index 000000000..f76ecc699
--- /dev/null
+++ b/vendor/beberlei/assert/lib/Assert/LazyAssertionException.php
@@ -0,0 +1,55 @@
+<?php
+
+/**
+ * Assert
+ *
+ * LICENSE
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this package in the file LICENSE.txt.
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to [email protected] so I can send you a copy immediately.
+ */
+
+namespace Assert;
+
+class LazyAssertionException extends InvalidArgumentException
+{
+ /**
+ * @var InvalidArgumentException[]
+ */
+ private $errors = [];
+
+ /**
+ * @param InvalidArgumentException[] $errors
+ *
+ * @return self
+ */
+ public static function fromErrors(array $errors): self
+ {
+ $message = \sprintf('The following %d assertions failed:', \count($errors))."\n";
+
+ $i = 1;
+ foreach ($errors as $error) {
+ $message .= \sprintf("%d) %s: %s\n", $i++, $error->getPropertyPath(), $error->getMessage());
+ }
+
+ return new static($message, $errors);
+ }
+
+ public function __construct($message, array $errors)
+ {
+ parent::__construct($message, 0, null, null);
+
+ $this->errors = $errors;
+ }
+
+ /**
+ * @return InvalidArgumentException[]
+ */
+ public function getErrorExceptions(): array
+ {
+ return $this->errors;
+ }
+}
diff --git a/vendor/beberlei/assert/lib/Assert/functions.php b/vendor/beberlei/assert/lib/Assert/functions.php
new file mode 100644
index 000000000..e0ccbd7d9
--- /dev/null
+++ b/vendor/beberlei/assert/lib/Assert/functions.php
@@ -0,0 +1,80 @@
+<?php
+
+/**
+ * Assert
+ *
+ * LICENSE
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this package in the file LICENSE.txt.
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to [email protected] so I can send you a copy immediately.
+ */
+
+namespace Assert;
+
+/**
+ * Start validation on a value, returns {@link AssertionChain}.
+ *
+ * The invocation of this method starts an assertion chain
+ * that is happening on the passed value.
+ *
+ * @param mixed $value
+ * @param string|callable|null $defaultMessage
+ * @param string $defaultPropertyPath
+ *
+ * @return AssertionChain
+ *
+ * @example
+ *
+ * \Assert\that($value)->notEmpty()->integer();
+ * \Assert\that($value)->nullOr()->string()->startsWith("Foo");
+ *
+ * The assertion chain can be stateful, that means be careful when you reuse
+ * it. You should never pass around the chain.
+ */
+function that($value, $defaultMessage = null, string $defaultPropertyPath = null): AssertionChain
+{
+ return Assert::that($value, $defaultMessage, $defaultPropertyPath);
+}
+
+/**
+ * Start validation on a set of values, returns {@link AssertionChain}.
+ *
+ * @param mixed $values
+ * @param string|callable|null $defaultMessage
+ * @param string $defaultPropertyPath
+ *
+ * @return AssertionChain
+ */
+function thatAll($values, $defaultMessage = null, string $defaultPropertyPath = null): AssertionChain
+{
+ return Assert::thatAll($values, $defaultMessage, $defaultPropertyPath);
+}
+
+/**
+ * Start validation and allow NULL, returns {@link AssertionChain}.
+ *
+ * @param mixed $value
+ * @param string|callable|null $defaultMessage
+ * @param string $defaultPropertyPath
+ *
+ * @return AssertionChain
+ *
+ * @deprecated In favour of Assert::thatNullOr($value, $defaultMessage = null, $defaultPropertyPath = null)
+ */
+function thatNullOr($value, $defaultMessage = null, string $defaultPropertyPath = null): AssertionChain
+{
+ return Assert::thatNullOr($value, $defaultMessage, $defaultPropertyPath);
+}
+
+/**
+ * Create a lazy assertion object.
+ *
+ * @return LazyAssertion
+ */
+function lazy(): LazyAssertion
+{
+ return Assert::lazy();
+}
diff --git a/vendor/beberlei/assert/phpstan-code.neon b/vendor/beberlei/assert/phpstan-code.neon
new file mode 100644
index 000000000..49aa5723f
--- /dev/null
+++ b/vendor/beberlei/assert/phpstan-code.neon
@@ -0,0 +1,10 @@
+parameters:
+ autoload_files:
+ - bin/MethodDocGenerator.php
+ ignoreErrors:
+ # is_countable() is available only in PHP 7.3+
+ - '#Function is_countable not found#'
+
+ # Calling count() on ResourceBundle and SimpleXMLElement is valid from PHP 7.0+, but does not correctly advertise
+ # the fact, and so PHPStan has an issue with this. This will be fixed in PHP 7.4+
+ - '#Call to function count\(\) with argument type array|Countable|ResourceBundle|SimpleXMLElement will always result in number 1#'
diff --git a/vendor/beberlei/assert/phpstan-tests.neon b/vendor/beberlei/assert/phpstan-tests.neon
new file mode 100644
index 000000000..e9ab0bcf9
--- /dev/null
+++ b/vendor/beberlei/assert/phpstan-tests.neon
@@ -0,0 +1,10 @@
+parameters:
+ ignoreErrors:
+ # The following errors are ignored as they are testing for errors and exceptions that static analysis correctly identifies as problems.
+ - '#Call to an undefined method Assert\\AssertionChain::unknownAssertion\(\)#'
+ - '#Call to an undefined static method Assert\\Assertion::nullOrAssertionDoesNotExist\(\)#'
+ - '#Class Foo not found#'
+ - '#Parameter \#1 $value of static method Assert\\Assertion::isCountable\(\) expects array|Countable|ResourceBundle|SimpleXMLElement, string given#'
+ - '#Parameter \#2 \$operator of static method Assert\\Assertion::version\(\) expects string, null given#'
+ - '#Static method Assert\\Assertion::allTrue\(\) invoked with 0 parameters, 1-3 required#'
+ - '#Static method Assert\\Assertion::nullOrMax\(\) invoked with 0 parameters, 2-4 required#'
diff --git a/vendor/chillerlan/php-qrcode/.github/FUNDING.yml b/vendor/chillerlan/php-qrcode/.github/FUNDING.yml
new file mode 100644
index 000000000..fc89a6739
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/.github/FUNDING.yml
@@ -0,0 +1 @@
+ko_fi: codemasher
diff --git a/vendor/chillerlan/php-qrcode/.github/workflows/tests.yml b/vendor/chillerlan/php-qrcode/.github/workflows/tests.yml
new file mode 100644
index 000000000..5dd343abd
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/.github/workflows/tests.yml
@@ -0,0 +1,55 @@
+# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
+# https://github.com/localheinz/php-library-template/blob/master/.github/workflows/continuous-integration.yml
+# https://github.com/sebastianbergmann/phpunit/blob/master/.github/workflows/ci.yml
+
+on:
+ - pull_request
+ - push
+
+name: "Continuous Integration"
+
+jobs:
+
+ tests:
+ name: "Unit Tests"
+ runs-on: ubuntu-latest
+
+ strategy:
+ matrix:
+ php-binary:
+ - php7.2
+ - php7.3
+ - php7.4
+
+ steps:
+ - name: "Checkout"
+ uses: actions/[email protected]
+
+ - name: "Install dependencies with composer"
+ run: ${{ matrix.php-binary }} $(which composer) update --no-interaction --no-progress --no-suggest
+
+ - name: "Run unit tests with phpunit"
+ run: ${{ matrix.php-binary }} vendor/bin/phpunit --configuration=phpunit.xml --no-coverage
+
+
+ code-coverage:
+ name: "Code Coverage"
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: "Checkout"
+ uses: actions/[email protected]
+
+ - name: "Install locked dependencies with composer"
+ run: php7.4 $(which composer) install --no-interaction --no-progress --no-suggest
+
+ - name: "Dump Xdebug filter with phpunit/phpunit"
+ run: php7.4 vendor/bin/phpunit --configuration=phpunit.xml --dump-xdebug-filter=.build/phpunit/xdebug-filter.php
+
+ - name: "Collect code coverage with Xdebug and phpunit/phpunit"
+ run: php7.4 vendor/bin/phpunit --configuration=phpunit.xml --prepend=.build/phpunit/xdebug-filter.php
+
+ - name: "Send code coverage report to Codecov.io"
+ env:
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
+ run: bash <(curl -s https://codecov.io/bash)
diff --git a/vendor/chillerlan/php-qrcode/.gitignore b/vendor/chillerlan/php-qrcode/.gitignore
new file mode 100644
index 000000000..ecebb9964
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/.gitignore
@@ -0,0 +1,5 @@
+.build/*
+.idea/*
+vendor/*
+composer.lock
+*.phpunit.result.cache
diff --git a/vendor/chillerlan/php-qrcode/.scrutinizer.yml b/vendor/chillerlan/php-qrcode/.scrutinizer.yml
new file mode 100644
index 000000000..7fdd2a4dc
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/.scrutinizer.yml
@@ -0,0 +1,5 @@
+filter:
+ excluded_paths:
+ - examples/*
+ - tests/*
+ - vendor/*
diff --git a/vendor/chillerlan/php-qrcode/.travis.yml b/vendor/chillerlan/php-qrcode/.travis.yml
new file mode 100644
index 000000000..78b8d79e9
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/.travis.yml
@@ -0,0 +1,19 @@
+addons:
+ apt:
+ packages:
+ - imagemagick
+
+language: php
+
+matrix:
+ include:
+ - php: 7.2
+ - php: 7.3
+ - php: 7.4
+
+before_install:
+ - pecl channel-update pecl.php.net
+ - printf "\n" | pecl install imagick
+install: travis_retry composer install --no-interaction --prefer-source
+script: vendor/bin/phpunit --configuration phpunit.xml --coverage-clover clover.xml
+after_script: bash <(curl -s https://codecov.io/bash)
diff --git a/vendor/OTPHP/LICENCE b/vendor/chillerlan/php-qrcode/LICENSE
index d14cbc23c..dac852818 100644
--- a/vendor/OTPHP/LICENCE
+++ b/vendor/chillerlan/php-qrcode/LICENSE
@@ -1,4 +1,6 @@
-Copyright (c) 2011 Le Lag
+The MIT License (MIT)
+
+Copyright (c) 2015 Smiley <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -17,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-
diff --git a/vendor/chillerlan/php-qrcode/README.md b/vendor/chillerlan/php-qrcode/README.md
new file mode 100644
index 000000000..075b2a376
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/README.md
@@ -0,0 +1,392 @@
+# chillerlan/php-qrcode
+
+A PHP7.2+ QR Code library based on the [implementation](https://github.com/kazuhikoarase/qrcode-generator) by [Kazuhiko Arase](https://github.com/kazuhikoarase),
+namespaced, cleaned up, improved and other stuff.
+
+[![Packagist version][packagist-badge]][packagist]
+[![License][license-badge]][license]
+[![Travis CI][travis-badge]][travis]
+[![CodeCov][coverage-badge]][coverage]
+[![Scrunitizer CI][scrutinizer-badge]][scrutinizer]
+[![Packagist downloads][downloads-badge]][downloads]
+[![PayPal donate][donate-badge]][donate]
+
+[![Continuous Integration][gh-action-badge]][gh-action]
+
+[packagist-badge]: https://img.shields.io/packagist/v/chillerlan/php-qrcode.svg?style=flat-square
+[packagist]: https://packagist.org/packages/chillerlan/php-qrcode
+[license-badge]: https://img.shields.io/github/license/chillerlan/php-qrcode.svg?style=flat-square
+[license]: https://github.com/chillerlan/php-qrcode/blob/main/LICENSE
+[travis-badge]: https://img.shields.io/travis/chillerlan/php-qrcode.svg?style=flat-square
+[travis]: https://travis-ci.org/chillerlan/php-qrcode
+[coverage-badge]: https://img.shields.io/codecov/c/github/chillerlan/php-qrcode.svg?style=flat-square
+[coverage]: https://codecov.io/github/chillerlan/php-qrcode
+[scrutinizer-badge]: https://img.shields.io/scrutinizer/g/chillerlan/php-qrcode.svg?style=flat-square
+[scrutinizer]: https://scrutinizer-ci.com/g/chillerlan/php-qrcode
+[downloads-badge]: https://img.shields.io/packagist/dt/chillerlan/php-qrcode.svg?style=flat-square
+[downloads]: https://packagist.org/packages/chillerlan/php-qrcode/stats
+[donate-badge]: https://img.shields.io/badge/donate-paypal-ff33aa.svg?style=flat-square
+[donate]: https://www.paypal.com/donate?hosted_button_id=WLYUNAT9ZTJZ4
+[gh-action-badge]: https://github.com/chillerlan/php-qrcode/workflows/Continuous%20Integration/badge.svg
+[gh-action]: https://github.com/chillerlan/php-qrcode/actions
+
+## Documentation
+
+### Requirements
+- PHP 7.2+
+ - `ext-mbstring`
+ - optional:
+ - `ext-json`, `ext-gd`
+ - `ext-imagick` with [ImageMagick](https://imagemagick.org) installed
+ - [`setasign/fpdf`](https://github.com/setasign/fpdf) for the PDF output module
+
+### Installation
+**requires [composer](https://getcomposer.org)**
+
+via terminal: `composer require chillerlan/php-qrcode`
+
+*composer.json* (note: replace `dev-master` with a [version boundary](https://getcomposer.org/doc/articles/versions.md), e.g. `^3.2`)
+```json
+{
+ "require": {
+ "php": "^7.2",
+ "chillerlan/php-qrcode": "^3.4"
+ }
+}
+```
+
+### Usage
+We want to encode this URI for a mobile authenticator into a QRcode image:
+```php
+$data = 'otpauth://totp/test?secret=B3JX4VCVJDVNXNZ5&issuer=chillerlan.net';
+
+//quick and simple:
+echo '<img src="'.(new QRCode)->render($data).'" alt="QR Code" />';
+```
+
+<p align="center">
+ <img alt="QR codes are awesome!" src="https://raw.githubusercontent.com/chillerlan/php-qrcode/main/examples/example_image.png">
+ <img alt="QR codes are awesome!" src="https://raw.githubusercontent.com/chillerlan/php-qrcode/main/examples/example_svg.png">
+</p>
+
+Wait, what was that? Please again, slower!
+
+### Advanced usage
+
+Ok, step by step. First you'll need a `QRCode` instance, which can be optionally invoked with a `QROptions` (or a [`SettingsContainerInterface`](https://github.com/chillerlan/php-settings-container/blob/master/src/SettingsContainerInterface.php), respectively) object as the only parameter.
+
+```php
+$options = new QROptions([
+ 'version' => 5,
+ 'outputType' => QRCode::OUTPUT_MARKUP_SVG,
+ 'eccLevel' => QRCode::ECC_L,
+]);
+
+// invoke a fresh QRCode instance
+$qrcode = new QRCode($options);
+
+// and dump the output
+$qrcode->render($data);
+
+// ...with additional cache file
+$qrcode->render($data, '/path/to/file.svg');
+```
+
+In case you just want the raw QR code matrix, call `QRCode::getMatrix()` - this method is also called internally from `QRCode::render()`. See also [Custom output modules](#custom-qroutputinterface).
+
+```php
+$matrix = $qrcode->getMatrix($data);
+
+foreach($matrix->matrix() as $y => $row){
+ foreach($row as $x => $module){
+
+ // get a module's value
+ $value = $module;
+ $value = $matrix->get($x, $y);
+
+ // boolean check a module
+ if($matrix->check($x, $y)){ // if($module >> 8 > 0)
+ // do stuff, the module is dark
+ }
+ else{
+ // do other stuff, the module is light
+ }
+
+ }
+}
+```
+
+Have a look [in this folder](https://github.com/chillerlan/php-qrcode/tree/master/examples) for some more usage examples.
+
+#### Custom module values
+Previous versions of `QRCode` held only boolean matrix values that only allowed to determine whether a module was dark or not. Now you can distinguish between different parts of the matrix, namely the several required patterns from the QR Code specification, and use them in different ways.
+
+The dark value is the module (light) value shifted by 8 bits to the left: `$value = $M_TYPE << ($bool ? 8 : 0);`, where `$M_TYPE` is one of the `QRMatrix::M_*` constants.
+You can check the value for a type explicitly like...
+```php
+// for true (dark)
+$value >> 8 === $M_TYPE;
+
+//for false (light)
+$value === $M_TYPE;
+```
+...or you can perform a loose check, ignoring the module value
+```php
+// for true
+$value >> 8 > 0;
+
+// for false
+$value >> 8 === 0
+```
+
+See also `QRMatrix::set()`, `QRMatrix::check()` and [`QRMatrix` constants](#qrmatrix-constants).
+
+To map the values and properly render the modules for the given `QROutputInterface`, it's necessary to overwrite the default values:
+```php
+$options = new QROptions;
+
+// for HTML, SVG and ImageMagick
+$options->moduleValues = [
+ // finder
+ 1536 => '#A71111', // dark (true)
+ 6 => '#FFBFBF', // light (false)
+ // alignment
+ 2560 => '#A70364',
+ 10 => '#FFC9C9',
+ // timing
+ 3072 => '#98005D',
+ 12 => '#FFB8E9',
+ // format
+ 3584 => '#003804',
+ 14 => '#00FB12',
+ // version
+ 4096 => '#650098',
+ 16 => '#E0B8FF',
+ // data
+ 1024 => '#4A6000',
+ 4 => '#ECF9BE',
+ // darkmodule
+ 512 => '#080063',
+ // separator
+ 8 => '#AFBFBF',
+ // quietzone
+ 18 => '#FFFFFF',
+];
+
+// for the image output types
+$options->moduleValues = [
+ 512 => [0, 0, 0],
+ // ...
+];
+
+// for string/text output
+$options->moduleValues = [
+ 512 => '#',
+ // ...
+];
+```
+
+#### Custom `QROutputInterface`
+Instead of bloating your code you can simply create your own output interface by extending `QROutputAbstract`. Have a look at the [built-in output modules](https://github.com/chillerlan/php-qrcode/tree/master/src/Output).
+
+```php
+class MyCustomOutput extends QROutputAbstract{
+
+ // inherited from QROutputAbstract
+ protected $matrix; // QRMatrix
+ protected $moduleCount; // modules QRMatrix::size()
+ protected $options; // MyCustomOptions or QROptions
+ protected $scale; // scale factor from options
+ protected $length; // length of the matrix ($moduleCount * $scale)
+
+ // ...check/set default module values (abstract method, called by the constructor)
+ protected function setModuleValues():void{
+ // $this->moduleValues = ...
+ }
+
+ // QROutputInterface::dump()
+ public function dump(string $file = null):string{
+ $output = '';
+
+ for($row = 0; $row < $this->moduleCount; $row++){
+ for($col = 0; $col < $this->moduleCount; $col++){
+ $output .= (int)$this->matrix->check($col, $row);
+ }
+ }
+
+ return $output;
+ }
+
+}
+```
+
+In case you need additional settings for your output module, just extend `QROptions`...
+```
+class MyCustomOptions extends QROptions{
+ protected $myParam = 'defaultValue';
+
+ // ...
+}
+```
+...or use the [`SettingsContainerInterface`](https://github.com/chillerlan/php-settings-container/blob/master/src/SettingsContainerInterface.php), which is the more flexible approach.
+
+```php
+trait MyCustomOptionsTrait{
+ protected $myParam = 'defaultValue';
+
+ // ...
+}
+```
+set the options:
+```php
+$myOptions = [
+ 'version' => 5,
+ 'eccLevel' => QRCode::ECC_L,
+ 'outputType' => QRCode::OUTPUT_CUSTOM,
+ 'outputInterface' => MyCustomOutput::class,
+ // your custom settings
+ 'myParam' => 'whatever value',
+ ];
+
+// extends QROptions
+$myCustomOptions = new MyCustomOptions($myOptions);
+
+// using the SettingsContainerInterface
+$myCustomOptions = new class($myOptions) extends SettingsContainerAbstract{
+ use QROptionsTrait, MyCustomOptionsTrait;
+};
+
+```
+
+You can then call `QRCode` with the custom modules...
+```php
+(new QRCode($myCustomOptions))->render($data);
+```
+...or invoke the `QROutputInterface` manually.
+```php
+$qrOutputInterface = new MyCustomOutput($myCustomOptions, (new QRCode($myCustomOptions))->getMatrix($data));
+
+//dump the output, which is equivalent to QRCode::render()
+$qrOutputInterface->dump();
+```
+
+### API
+
+#### `QRCode` methods
+method | return | description
+------ | ------ | -----------
+`__construct(QROptions $options = null)` | - | see [`SettingsContainerInterface`](https://github.com/chillerlan/php-settings-container/blob/master/src/SettingsContainerInterface.php)
+`render(string $data, string $file = null)` | mixed, `QROutputInterface::dump()` | renders a QR Code for the given `$data` and `QROptions`, saves `$file` optional
+`getMatrix(string $data)` | `QRMatrix` | returns a `QRMatrix` object for the given `$data` and current `QROptions`
+`initDataInterface(string $data)` | `QRDataInterface` | returns a fresh `QRDataInterface` for the given `$data`
+`isNumber(string $string)` | bool | checks if a string qualifies for `Number`
+`isAlphaNum(string $string)` | bool | checks if a string qualifies for `AlphaNum`
+`isKanji(string $string)` | bool | checks if a string qualifies for `Kanji`
+
+#### `QRCode` constants
+name | description
+---- | -----------
+`VERSION_AUTO` | `QROptions::$version`
+`MASK_PATTERN_AUTO` | `QROptions::$maskPattern`
+`OUTPUT_MARKUP_SVG`, `OUTPUT_MARKUP_HTML` | `QROptions::$outputType` markup
+`OUTPUT_IMAGE_PNG`, `OUTPUT_IMAGE_JPG`, `OUTPUT_IMAGE_GIF` | `QROptions::$outputType` image
+`OUTPUT_STRING_JSON`, `OUTPUT_STRING_TEXT` | `QROptions::$outputType` string
+`OUTPUT_IMAGICK` | `QROptions::$outputType` ImageMagick
+`OUTPUT_FPDF` | `QROptions::$outputType` PDF, using [FPDF](https://github.com/setasign/fpdf)
+`OUTPUT_CUSTOM` | `QROptions::$outputType`, requires `QROptions::$outputInterface`
+`ECC_L`, `ECC_M`, `ECC_Q`, `ECC_H`, | ECC-Level: 7%, 15%, 25%, 30% in `QROptions::$eccLevel`
+`DATA_NUMBER`, `DATA_ALPHANUM`, `DATA_BYTE`, `DATA_KANJI` | `QRDataInterface::$datamode`
+
+#### `QROptions` properties
+property | type | default | allowed | description
+-------- | ---- | ------- | ------- | -----------
+`$version` | int | `QRCode::VERSION_AUTO` | 1...40 | the [QR Code version number](http://www.qrcode.com/en/about/version.html)
+`$versionMin` | int | 1 | 1...40 | Minimum QR version (if `$version = QRCode::VERSION_AUTO`)
+`$versionMax` | int | 40 | 1...40 | Maximum QR version (if `$version = QRCode::VERSION_AUTO`)
+`$eccLevel` | int | `QRCode::ECC_L` | `QRCode::ECC_X` | Error correct level, where X = L (7%), M (15%), Q (25%), H (30%)
+`$maskPattern` | int | `QRCode::MASK_PATTERN_AUTO` | 0...7 | Mask Pattern to use
+`$addQuietzone` | bool | `true` | - | Add a "quiet zone" (margin) according to the QR code spec
+`$quietzoneSize` | int | 4 | clamped to 0 ... `$matrixSize / 2` | Size of the quiet zone
+`$dataMode` | string | `null` | `Number`, `AlphaNum`, `Kanji`, `Byte` | allows overriding the data type detection
+`$outputType` | string | `QRCode::OUTPUT_IMAGE_PNG` | `QRCode::OUTPUT_*` | built-in output type
+`$outputInterface` | string | `null` | * | FQCN of the custom `QROutputInterface` if `QROptions::$outputType` is set to `QRCode::OUTPUT_CUSTOM`
+`$cachefile` | string | `null` | * | optional cache file path
+`$eol` | string | `PHP_EOL` | * | newline string (HTML, SVG, TEXT)
+`$scale` | int | 5 | * | size of a QR code pixel (SVG, IMAGE_*), HTML -> via CSS
+`$cssClass` | string | `null` | * | a common css class
+`$svgOpacity` | float | 1.0 | 0...1 |
+`$svgDefs` | string | * | * | anything between [`<defs>`](https://developer.mozilla.org/docs/Web/SVG/Element/defs)
+`$svgViewBoxSize` | int | `null` | * | a positive integer which defines width/height of the [viewBox attribute](https://css-tricks.com/scale-svg/#article-header-id-3)
+`$textDark` | string | '🔴' | * | string substitute for dark
+`$textLight` | string | '⭕' | * | string substitute for light
+`$markupDark` | string | '#000' | * | markup substitute for dark (CSS value)
+`$markupLight` | string | '#fff' | * | markup substitute for light (CSS value)
+`$imageBase64` | bool | `true` | - | whether to return the image data as base64 or raw like from `file_get_contents()`
+`$imageTransparent` | bool | `true` | - | toggle transparency (no jpeg support)
+`$imageTransparencyBG` | array | `[255, 255, 255]` | `[R, G, B]` | the RGB values for the transparent color, see [`imagecolortransparent()`](http://php.net/manual/function.imagecolortransparent.php)
+`$pngCompression` | int | -1 | -1 ... 9 | `imagepng()` compression level, -1 = auto
+`$jpegQuality` | int | 85 | 0 - 100 | `imagejpeg()` quality
+`$imagickFormat` | string | 'png' | * | ImageMagick output type, see `Imagick::setType()`
+`$imagickBG` | string | `null` | * | ImageMagick background color, see `ImagickPixel::__construct()`
+`$moduleValues` | array | `null` | * | Module values map, see [Custom output modules](#custom-qroutputinterface) and `QROutputInterface::DEFAULT_MODULE_VALUES`
+
+#### `QRMatrix` methods
+method | return | description
+------ | ------ | -----------
+`__construct(int $version, int $eclevel)` | - | -
+`matrix()` | array | the internal matrix representation as a 2 dimensional array
+`version()` | int | the current QR Code version
+`eccLevel()` | int | current ECC level
+`maskPattern()` | int | the used mask pattern
+`size()` | int | the absoulute size of the matrix, including quiet zone (if set). `$version * 4 + 17 + 2 * $quietzone`
+`get(int $x, int $y)` | int | returns the value of the module
+`set(int $x, int $y, bool $value, int $M_TYPE)` | `QRMatrix` | sets the `$M_TYPE` value for the module
+`check(int $x, int $y)` | bool | checks whether a module is true (dark) or false (light)
+`setLogoSpace(int $width, int $height, int $startX = null, int $startY = null)` | `QRMatrix` | creates a logo space in the matrix
+
+#### `QRMatrix` constants
+name | light (false) | dark (true) | description
+---- | ------------- | ----------- | -----------
+`M_NULL` | 0 | - | module not set (should never appear. if so, there's an error)
+`M_DARKMODULE` | - | 512 | once per matrix at `$xy = [8, 4 * $version + 9]`
+`M_DATA` | 4 | 1024 | the actual encoded data
+`M_FINDER` | 6 | 1536 | the 7x7 finder patterns
+`M_SEPARATOR` | 8 | - | separator lines around the finder patterns
+`M_ALIGNMENT` | 10 | 2560 | the 5x5 alignment patterns
+`M_TIMING` | 12 | 3072 | the timing pattern lines
+`M_FORMAT` | 14 | 3584 | format information pattern
+`M_VERSION` | 16 | 4096 | version information pattern
+`M_QUIETZONE` | 18 | - | margin around the QR Code
+`M_LOGO` | 20 | - | space for a logo image (not used yet)
+`M_TEST` | 255 | 65280 | test value
+
+
+### Notes
+The QR encoder, especially the subroutines for mask pattern testing, can cause high CPU load on increased matrix size.
+You can avoid a part of this load by choosing a fast output module, like `OUTPUT_IMAGE_*` and setting the mask pattern manually (which may result in unreadable QR Codes).
+Oh hey and don't forget to sanitize any user input!
+
+### Disclaimer!
+I don't take responsibility for molten CPUs, misled applications, failed log-ins etc.. Use at your own risk!
+
+#### Trademark Notice
+
+The word "QR Code" is registered trademark of *DENSO WAVE INCORPORATED*<br>
+http://www.denso-wave.com/qrcode/faqpatent-e.html
+
+### Framework Integration
+- Drupal [Google Authenticator Login `ga_login`](https://www.drupal.org/project/ga_login)
+- WordPress [`wp-two-factor-auth`](https://github.com/sjinks/wp-two-factor-auth)
+- WordPress [Simple 2FA `simple-2fa`](https://wordpress.org/plugins/simple-2fa/)
+- WoltLab Suite [two-step-verification](http://pluginstore.woltlab.com/file/3007-two-step-verification/)
+- [Cachet](https://github.com/CachetHQ/Cachet)
+- [Appwrite](https://github.com/appwrite/appwrite)
+- other uses: [dependents](https://github.com/chillerlan/php-qrcode/network/dependents) / [packages](https://github.com/chillerlan/php-qrcode/network/dependents?dependent_type=PACKAGE)
+
+
+Hi, please check out my other projects that are way cooler than qrcodes!
+
+- [php-oauth-core](https://github.com/chillerlan/php-oauth-core) - an OAuth 1/2 client library along with a bunch of [providers](https://github.com/chillerlan/php-oauth-providers)
+- [php-httpinterface](https://github.com/chillerlan/php-httpinterface) - a PSR-7/15/17/18 implemetation
+- [php-database](https://github.com/chillerlan/php-database) - a database client & querybuilder for MySQL, Postgres, SQLite, MSSQL, Firebird
+
diff --git a/vendor/chillerlan/php-qrcode/composer.json b/vendor/chillerlan/php-qrcode/composer.json
new file mode 100644
index 000000000..c2299a350
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/composer.json
@@ -0,0 +1,51 @@
+{
+ "name": "chillerlan/php-qrcode",
+ "description": "A QR code generator. PHP 7.2+",
+ "homepage": "https://github.com/chillerlan/php-qrcode",
+ "license": "MIT",
+ "minimum-stability": "stable",
+ "type": "library",
+ "keywords": [
+ "QR code", "qrcode", "qr", "qrcode-generator", "phpqrcode"
+ ],
+ "authors": [
+ {
+ "name": "Kazuhiko Arase",
+ "homepage": "https://github.com/kazuhikoarase"
+ },
+ {
+ "name": "Smiley",
+ "email": "[email protected]",
+ "homepage": "https://github.com/codemasher"
+ },
+ {
+ "name": "Contributors",
+ "homepage":"https://github.com/chillerlan/php-qrcode/graphs/contributors"
+ }
+ ],
+ "require": {
+ "php": "^7.2",
+ "ext-mbstring": "*",
+ "chillerlan/php-settings-container": "^1.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^8.5",
+ "setasign/fpdf": "^1.8.2"
+ },
+ "suggest": {
+ "chillerlan/php-authenticator": "Yet another Google authenticator! Also creates URIs for mobile apps.",
+ "setasign/fpdf": "Required to use the QR FPDF output."
+ },
+ "autoload": {
+ "psr-4": {
+ "chillerlan\\QRCode\\": "src/"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "chillerlan\\QRCodePublic\\": "public/",
+ "chillerlan\\QRCodeTest\\": "tests/",
+ "chillerlan\\QRCodeExamples\\": "examples/"
+ }
+ }
+}
diff --git a/vendor/chillerlan/php-qrcode/examples/MyCustomOutput.php b/vendor/chillerlan/php-qrcode/examples/MyCustomOutput.php
new file mode 100644
index 000000000..3c01f8646
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/examples/MyCustomOutput.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Class MyCustomOutput
+ *
+ * @filesource MyCustomOutput.php
+ * @created 24.12.2017
+ * @package chillerlan\QRCodeExamples
+ * @author Smiley <[email protected]>
+ * @copyright 2017 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCodeExamples;
+
+use chillerlan\QRCode\Output\QROutputAbstract;
+
+class MyCustomOutput extends QROutputAbstract{
+
+ protected function setModuleValues():void{
+ // TODO: Implement setModuleValues() method.
+ }
+
+ public function dump(string $file = null){
+
+ $output = '';
+
+ for($row = 0; $row < $this->moduleCount; $row++){
+ for($col = 0; $col < $this->moduleCount; $col++){
+ $output .= (int)$this->matrix->check($col, $row);
+ }
+ }
+
+ return $output;
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/examples/QRImageWithLogo.php b/vendor/chillerlan/php-qrcode/examples/QRImageWithLogo.php
new file mode 100644
index 000000000..f9d94ae34
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/examples/QRImageWithLogo.php
@@ -0,0 +1,81 @@
+<?php
+/**
+ * Class QRImageWithLogo
+ *
+ * @filesource QRImageWithLogo.php
+ * @created 18.11.2020
+ * @package chillerlan\QRCodeExamples
+ * @author smiley <[email protected]>
+ * @copyright 2020 smiley
+ * @license MIT
+ *
+ * @noinspection PhpComposerExtensionStubsInspection
+ */
+
+namespace chillerlan\QRCodeExamples;
+
+use chillerlan\QRCode\Output\{QRCodeOutputException, QRImage};
+
+use function imagecopyresampled, imagecreatefrompng, imagesx, imagesy, is_file, is_readable;
+
+/**
+ * @property \chillerlan\QRCodeExamples\LogoOptions $options
+ */
+class QRImageWithLogo extends QRImage{
+
+ /**
+ * @param string|null $file
+ * @param string|null $logo
+ *
+ * @return string
+ * @throws \chillerlan\QRCode\Output\QRCodeOutputException
+ */
+ public function dump(string $file = null, string $logo = null):string{
+ // set returnResource to true to skip further processing for now
+ $this->options->returnResource = true;
+
+ // of course you could accept other formats too (such as resource or Imagick)
+ // i'm not checking for the file type either for simplicity reasons (assuming PNG)
+ if(!is_file($logo) || !is_readable($logo)){
+ throw new QRCodeOutputException('invalid logo');
+ }
+
+ $this->matrix->setLogoSpace(
+ $this->options->logoWidth,
+ $this->options->logoHeight
+ // not utilizing the position here
+ );
+
+ // there's no need to save the result of dump() into $this->image here
+ parent::dump($file);
+
+ $im = imagecreatefrompng($logo);
+
+ // get logo image size
+ $w = imagesx($im);
+ $h = imagesy($im);
+
+ // set new logo size, leave a border of 1 module
+ $lw = ($this->options->logoWidth - 2) * $this->options->scale;
+ $lh = ($this->options->logoHeight - 2) * $this->options->scale;
+
+ // get the qrcode size
+ $ql = $this->matrix->size() * $this->options->scale;
+
+ // scale the logo and copy it over. done!
+ imagecopyresampled($this->image, $im, ($ql - $lw) / 2, ($ql - $lh) / 2, 0, 0, $lw, $lh, $w, $h);
+
+ $imageData = $this->dumpImage();
+
+ if($file !== null){
+ $this->saveToFile($imageData, $file);
+ }
+
+ if($this->options->imageBase64){
+ $imageData = 'data:image/'.$this->options->outputType.';base64,'.base64_encode($imageData);
+ }
+
+ return $imageData;
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/examples/QRImageWithText.php b/vendor/chillerlan/php-qrcode/examples/QRImageWithText.php
new file mode 100644
index 000000000..5ca572f30
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/examples/QRImageWithText.php
@@ -0,0 +1,104 @@
+<?php
+/**
+ * Class QRImageWithText
+ *
+ * example for additional text
+ *
+ * @link https://github.com/chillerlan/php-qrcode/issues/35
+ *
+ * @filesource QRImageWithText.php
+ * @created 22.06.2019
+ * @package chillerlan\QRCodeExamples
+ * @author smiley <[email protected]>
+ * @copyright 2019 smiley
+ * @license MIT
+ *
+ * @noinspection PhpComposerExtensionStubsInspection
+ */
+
+namespace chillerlan\QRCodeExamples;
+
+use chillerlan\QRCode\Output\QRImage;
+use function base64_encode, imagechar, imagecolorallocate, imagecolortransparent, imagecopymerge, imagecreatetruecolor,
+ imagedestroy, imagefilledrectangle, imagefontwidth, in_array, round, str_split, strlen;
+
+class QRImageWithText extends QRImage{
+
+ /**
+ * @param string|null $file
+ * @param string|null $text
+ *
+ * @return string
+ */
+ public function dump(string $file = null, string $text = null):string{
+ $this->image = imagecreatetruecolor($this->length, $this->length);
+ $background = imagecolorallocate($this->image, ...$this->options->imageTransparencyBG);
+
+ if((bool)$this->options->imageTransparent && in_array($this->options->outputType, $this::TRANSPARENCY_TYPES, true)){
+ imagecolortransparent($this->image, $background);
+ }
+
+ imagefilledrectangle($this->image, 0, 0, $this->length, $this->length, $background);
+
+ foreach($this->matrix->matrix() as $y => $row){
+ foreach($row as $x => $M_TYPE){
+ $this->setPixel($x, $y, $this->moduleValues[$M_TYPE]);
+ }
+ }
+
+ // render text output if a string is given
+ if($text !== null){
+ $this->addText($text);
+ }
+
+ $imageData = $this->dumpImage($file);
+
+ if((bool)$this->options->imageBase64){
+ $imageData = 'data:image/'.$this->options->outputType.';base64,'.base64_encode($imageData);
+ }
+
+ return $imageData;
+ }
+
+ /**
+ * @param string $text
+ */
+ protected function addText(string $text):void{
+ // save the qrcode image
+ $qrcode = $this->image;
+
+ // options things
+ $textSize = 3; // see imagefontheight() and imagefontwidth()
+ $textBG = [200, 200, 200];
+ $textColor = [50, 50, 50];
+
+ $bgWidth = $this->length;
+ $bgHeight = $bgWidth + 20; // 20px extra space
+
+ // create a new image with additional space
+ $this->image = imagecreatetruecolor($bgWidth, $bgHeight);
+ $background = imagecolorallocate($this->image, ...$textBG);
+
+ // allow transparency
+ if((bool)$this->options->imageTransparent && in_array($this->options->outputType, $this::TRANSPARENCY_TYPES, true)){
+ imagecolortransparent($this->image, $background);
+ }
+
+ // fill the background
+ imagefilledrectangle($this->image, 0, 0, $bgWidth, $bgHeight, $background);
+
+ // copy over the qrcode
+ imagecopymerge($this->image, $qrcode, 0, 0, 0, 0, $this->length, $this->length, 100);
+ imagedestroy($qrcode);
+
+ $fontColor = imagecolorallocate($this->image, ...$textColor);
+ $w = imagefontwidth($textSize);
+ $x = round(($bgWidth - strlen($text) * $w) / 2);
+
+ // loop through the string and draw the letters
+ foreach(str_split($text) as $i => $chr){
+ imagechar($this->image, $textSize, $i * $w + $x, $this->length, $chr, $fontColor);
+ }
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/examples/custom_output.php b/vendor/chillerlan/php-qrcode/examples/custom_output.php
new file mode 100644
index 000000000..71ea62682
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/examples/custom_output.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ *
+ * @filesource custom_output.php
+ * @created 24.12.2017
+ * @author Smiley <[email protected]>
+ * @copyright 2017 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCodeExamples;
+
+use chillerlan\QRCode\{QRCode, QROptions};
+
+require_once __DIR__.'/../vendor/autoload.php';
+
+$data = 'https://www.youtube.com/watch?v=DLzxrzFCyOs&t=43s';
+
+// invoke the QROutputInterface manually
+$options = new QROptions([
+ 'version' => 5,
+ 'eccLevel' => QRCode::ECC_L,
+]);
+
+$qrOutputInterface = new MyCustomOutput($options, (new QRCode($options))->getMatrix($data));
+
+var_dump($qrOutputInterface->dump());
+
+
+// or just
+$options = new QROptions([
+ 'version' => 5,
+ 'eccLevel' => QRCode::ECC_L,
+ 'outputType' => QRCode::OUTPUT_CUSTOM,
+ 'outputInterface' => MyCustomOutput::class,
+]);
+
+var_dump((new QRCode($options))->render($data));
diff --git a/vendor/chillerlan/php-qrcode/examples/example_image.png b/vendor/chillerlan/php-qrcode/examples/example_image.png
new file mode 100644
index 000000000..b4a80f2ab
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/examples/example_image.png
Binary files differ
diff --git a/vendor/chillerlan/php-qrcode/examples/example_svg.png b/vendor/chillerlan/php-qrcode/examples/example_svg.png
new file mode 100644
index 000000000..f1e7b32f7
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/examples/example_svg.png
Binary files differ
diff --git a/vendor/chillerlan/php-qrcode/examples/fpdf.php b/vendor/chillerlan/php-qrcode/examples/fpdf.php
new file mode 100644
index 000000000..9c690a7f7
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/examples/fpdf.php
@@ -0,0 +1,47 @@
+<?php
+
+namespace chillerlan\QRCodeExamples;
+
+use chillerlan\QRCode\{QRCode, QROptions};
+
+require_once __DIR__ . '/../vendor/autoload.php';
+
+$data = 'https://www.youtube.com/watch?v=DLzxrzFCyOs&t=43s';
+
+$options = new QROptions([
+ 'version' => 7,
+ 'outputType' => QRCode::OUTPUT_FPDF,
+ 'eccLevel' => QRCode::ECC_L,
+ 'scale' => 5,
+ 'imageBase64' => false,
+ 'moduleValues' => [
+ // finder
+ 1536 => [0, 63, 255], // dark (true)
+ 6 => [255, 255, 255], // light (false), white is the transparency color and is enabled by default
+ // alignment
+ 2560 => [255, 0, 255],
+ 10 => [255, 255, 255],
+ // timing
+ 3072 => [255, 0, 0],
+ 12 => [255, 255, 255],
+ // format
+ 3584 => [67, 191, 84],
+ 14 => [255, 255, 255],
+ // version
+ 4096 => [62, 174, 190],
+ 16 => [255, 255, 255],
+ // data
+ 1024 => [0, 0, 0],
+ 4 => [255, 255, 255],
+ // darkmodule
+ 512 => [0, 0, 0],
+ // separator
+ 8 => [255, 255, 255],
+ // quietzone
+ 18 => [255, 255, 255],
+ ],
+]);
+
+\header('Content-type: application/pdf');
+
+echo (new QRCode($options))->render($data);
diff --git a/vendor/chillerlan/php-qrcode/examples/html.php b/vendor/chillerlan/php-qrcode/examples/html.php
new file mode 100644
index 000000000..aa5305d24
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/examples/html.php
@@ -0,0 +1,102 @@
+<?php
+/**
+ *
+ * @filesource html.php
+ * @created 21.12.2017
+ * @author Smiley <[email protected]>
+ * @copyright 2017 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCodeExamples;
+
+use chillerlan\QRCode\{QRCode, QROptions};
+
+require_once '../vendor/autoload.php';
+
+header('Content-Type: text/html; charset=utf-8');
+
+?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8"/>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
+ <title>QRCode test</title>
+ <style>
+ body{
+ margin: 5em;
+ padding: 0;
+ }
+
+ div.qrcode{
+ margin: 0;
+ padding: 0;
+ }
+
+ /* rows */
+ div.qrcode > div {
+ margin: 0;
+ padding: 0;
+ height: 10px;
+ }
+
+ /* modules */
+ div.qrcode > div > span {
+ display: inline-block;
+ width: 10px;
+ height: 10px;
+ }
+
+ div.qrcode > div > span {
+ background-color: #ccc;
+ }
+ </style>
+</head>
+<body>
+ <div class="qrcode">
+<?php
+
+ $data = 'https://www.youtube.com/watch?v=DLzxrzFCyOs&t=43s';
+
+ $options = new QROptions([
+ 'version' => 5,
+ 'outputType' => QRCode::OUTPUT_MARKUP_HTML,
+ 'eccLevel' => QRCode::ECC_L,
+ 'moduleValues' => [
+ // finder
+ 1536 => '#A71111', // dark (true)
+ 6 => '#FFBFBF', // light (false)
+ // alignment
+ 2560 => '#A70364',
+ 10 => '#FFC9C9',
+ // timing
+ 3072 => '#98005D',
+ 12 => '#FFB8E9',
+ // format
+ 3584 => '#003804',
+ 14 => '#00FB12',
+ // version
+ 4096 => '#650098',
+ 16 => '#E0B8FF',
+ // data
+ 1024 => '#4A6000',
+ 4 => '#ECF9BE',
+ // darkmodule
+ 512 => '#080063',
+ // separator
+ 8 => '#AFBFBF',
+ // quietzone
+ 18 => '#FFFFFF',
+ ],
+ ]);
+
+ echo (new QRCode($options))->render($data);
+
+?>
+ </div>
+</body>
+</html>
+
+
+
diff --git a/vendor/chillerlan/php-qrcode/examples/image.php b/vendor/chillerlan/php-qrcode/examples/image.php
new file mode 100644
index 000000000..89ba2a9a8
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/examples/image.php
@@ -0,0 +1,60 @@
+<?php
+/**
+ *
+ * @filesource image.php
+ * @created 24.12.2017
+ * @author Smiley <[email protected]>
+ * @copyright 2017 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCodeExamples;
+
+use chillerlan\QRCode\{QRCode, QROptions};
+
+require_once __DIR__.'/../vendor/autoload.php';
+
+$data = 'https://www.youtube.com/watch?v=DLzxrzFCyOs&t=43s';
+
+$options = new QROptions([
+ 'version' => 7,
+ 'outputType' => QRCode::OUTPUT_IMAGE_PNG,
+ 'eccLevel' => QRCode::ECC_L,
+ 'scale' => 5,
+ 'imageBase64' => false,
+ 'moduleValues' => [
+ // finder
+ 1536 => [0, 63, 255], // dark (true)
+ 6 => [255, 255, 255], // light (false), white is the transparency color and is enabled by default
+ // alignment
+ 2560 => [255, 0, 255],
+ 10 => [255, 255, 255],
+ // timing
+ 3072 => [255, 0, 0],
+ 12 => [255, 255, 255],
+ // format
+ 3584 => [67, 191, 84],
+ 14 => [255, 255, 255],
+ // version
+ 4096 => [62, 174, 190],
+ 16 => [255, 255, 255],
+ // data
+ 1024 => [0, 0, 0],
+ 4 => [255, 255, 255],
+ // darkmodule
+ 512 => [0, 0, 0],
+ // separator
+ 8 => [255, 255, 255],
+ // quietzone
+ 18 => [255, 255, 255],
+ ],
+]);
+
+header('Content-type: image/png');
+
+echo (new QRCode($options))->render($data);
+
+
+
+
+
diff --git a/vendor/chillerlan/php-qrcode/examples/imageWithLogo.php b/vendor/chillerlan/php-qrcode/examples/imageWithLogo.php
new file mode 100644
index 000000000..987e10c11
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/examples/imageWithLogo.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ *
+ * @filesource imageWithLogo.php
+ * @created 18.11.2020
+ * @author smiley <[email protected]>
+ * @copyright 2020 smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCodeExamples;
+
+use chillerlan\QRCode\{QRCode, QROptions};
+
+require_once __DIR__.'/../vendor/autoload.php';
+
+$data = 'https://www.youtube.com/watch?v=DLzxrzFCyOs&t=43s';
+/**
+ * @property int $logoWidth
+ * @property int $logoHeight
+ *
+ * @noinspection PhpIllegalPsrClassPathInspection
+ */
+class LogoOptions extends QROptions{
+ protected $logoWidth;
+ protected $logoHeight;
+}
+
+$options = new LogoOptions;
+
+$options->version = 7;
+$options->eccLevel = QRCode::ECC_H;
+$options->imageBase64 = false;
+$options->logoWidth = 13;
+$options->logoHeight = 13;
+$options->scale = 5;
+$options->imageTransparent = false;
+
+header('Content-type: image/png');
+
+$qrOutputInterface = new QRImageWithLogo($options, (new QRCode($options))->getMatrix($data));
+
+// dump the output, with an additional logo
+echo $qrOutputInterface->dump(null, __DIR__.'/octocat.png');
diff --git a/vendor/chillerlan/php-qrcode/examples/imageWithText.php b/vendor/chillerlan/php-qrcode/examples/imageWithText.php
new file mode 100644
index 000000000..050781cba
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/examples/imageWithText.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * example for additional text
+ * @link https://github.com/chillerlan/php-qrcode/issues/35
+ *
+ * @filesource imageWithText.php
+ * @created 22.06.2019
+ * @author Smiley <[email protected]>
+ * @copyright 2019 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCodeExamples;
+
+use chillerlan\QRCode\{QRCode, QROptions};
+
+require_once __DIR__.'/../vendor/autoload.php';
+
+$data = 'https://www.youtube.com/watch?v=DLzxrzFCyOs&t=43s';
+
+$options = new QROptions([
+ 'version' => 7,
+ 'outputType' => QRCode::OUTPUT_IMAGE_PNG,
+ 'scale' => 3,
+ 'imageBase64' => false,
+]);
+
+header('Content-type: image/png');
+
+$qrOutputInterface = new QRImageWithText($options, (new QRCode($options))->getMatrix($data));
+
+// dump the output, with additional text
+echo $qrOutputInterface->dump(null, 'example text');
diff --git a/vendor/chillerlan/php-qrcode/examples/imagick.php b/vendor/chillerlan/php-qrcode/examples/imagick.php
new file mode 100644
index 000000000..6bec4d02e
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/examples/imagick.php
@@ -0,0 +1,59 @@
+<?php
+/**
+ *
+ * @filesource image.php
+ * @created 24.12.2017
+ * @author Smiley <[email protected]>
+ * @copyright 2017 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCodeExamples;
+
+use chillerlan\QRCode\{QRCode, QROptions};
+
+require_once __DIR__.'/../vendor/autoload.php';
+
+$data = 'https://www.youtube.com/watch?v=DLzxrzFCyOs&t=43s';
+
+$options = new QROptions([
+ 'version' => 7,
+ 'outputType' => QRCode::OUTPUT_IMAGICK,
+ 'eccLevel' => QRCode::ECC_L,
+ 'scale' => 5,
+ 'moduleValues' => [
+ // finder
+ 1536 => '#A71111', // dark (true)
+ 6 => '#FFBFBF', // light (false)
+ // alignment
+ 2560 => '#A70364',
+ 10 => '#FFC9C9',
+ // timing
+ 3072 => '#98005D',
+ 12 => '#FFB8E9',
+ // format
+ 3584 => '#003804',
+ 14 => '#00FB12',
+ // version
+ 4096 => '#650098',
+ 16 => '#E0B8FF',
+ // data
+ 1024 => '#4A6000',
+ 4 => '#ECF9BE',
+ // darkmodule
+ 512 => '#080063',
+ // separator
+ 8 => '#DDDDDD',
+ // quietzone
+ 18 => '#DDDDDD',
+ ],
+]);
+
+header('Content-type: image/png');
+
+echo (new QRCode($options))->render($data);
+
+
+
+
+
diff --git a/vendor/chillerlan/php-qrcode/examples/octocat.png b/vendor/chillerlan/php-qrcode/examples/octocat.png
new file mode 100644
index 000000000..f9050b935
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/examples/octocat.png
Binary files differ
diff --git a/vendor/chillerlan/php-qrcode/examples/svg.php b/vendor/chillerlan/php-qrcode/examples/svg.php
new file mode 100644
index 000000000..a7a159d70
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/examples/svg.php
@@ -0,0 +1,77 @@
+<?php
+/**
+ *
+ * @filesource svg.php
+ * @created 21.12.2017
+ * @author Smiley <[email protected]>
+ * @copyright 2017 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCodeExamples;
+
+use chillerlan\QRCode\{QRCode, QROptions};
+
+require_once __DIR__.'/../vendor/autoload.php';
+
+$data = 'https://www.youtube.com/watch?v=DLzxrzFCyOs&t=43s';
+$gzip = true;
+
+$options = new QROptions([
+ 'version' => 7,
+ 'outputType' => QRCode::OUTPUT_MARKUP_SVG,
+ 'eccLevel' => QRCode::ECC_L,
+ 'svgViewBoxSize' => 530,
+ 'addQuietzone' => true,
+ 'cssClass' => 'my-css-class',
+ 'svgOpacity' => 1.0,
+ 'svgDefs' => '
+ <linearGradient id="g2">
+ <stop offset="0%" stop-color="#39F" />
+ <stop offset="100%" stop-color="#F3F" />
+ </linearGradient>
+ <linearGradient id="g1">
+ <stop offset="0%" stop-color="#F3F" />
+ <stop offset="100%" stop-color="#39F" />
+ </linearGradient>
+ <style>rect{shape-rendering:crispEdges}</style>',
+ 'moduleValues' => [
+ // finder
+ 1536 => 'url(#g1)', // dark (true)
+ 6 => '#fff', // light (false)
+ // alignment
+ 2560 => 'url(#g1)',
+ 10 => '#fff',
+ // timing
+ 3072 => 'url(#g1)',
+ 12 => '#fff',
+ // format
+ 3584 => 'url(#g1)',
+ 14 => '#fff',
+ // version
+ 4096 => 'url(#g1)',
+ 16 => '#fff',
+ // data
+ 1024 => 'url(#g2)',
+ 4 => '#fff',
+ // darkmodule
+ 512 => 'url(#g1)',
+ // separator
+ 8 => '#fff',
+ // quietzone
+ 18 => '#fff',
+ ],
+]);
+
+$qrcode = (new QRCode($options))->render($data);
+
+header('Content-type: image/svg+xml');
+
+if($gzip === true){
+ header('Vary: Accept-Encoding');
+ header('Content-Encoding: gzip');
+ $qrcode = gzencode($qrcode ,9);
+}
+echo $qrcode;
+
+
diff --git a/vendor/chillerlan/php-qrcode/examples/text.php b/vendor/chillerlan/php-qrcode/examples/text.php
new file mode 100644
index 000000000..9bdf154f0
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/examples/text.php
@@ -0,0 +1,68 @@
+<?php
+/**
+ *
+ * @filesource text.php
+ * @created 21.12.2017
+ * @author Smiley <[email protected]>
+ * @copyright 2017 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCodeExamples;
+
+use chillerlan\QRCode\{QRCode, QROptions};
+
+require_once __DIR__.'/../vendor/autoload.php';
+
+$data = 'https://www.youtube.com/watch?v=DLzxrzFCyOs&t=43s';
+
+$options = new QROptions([
+ 'version' => 5,
+ 'outputType' => QRCode::OUTPUT_STRING_TEXT,
+ 'eccLevel' => QRCode::ECC_L,
+]);
+
+// <pre> to view it in a browser
+echo '<pre style="font-size: 75%; line-height: 1;">'.(new QRCode($options))->render($data).'</pre>';
+
+
+// custom values
+$options = new QROptions([
+ 'version' => 5,
+ 'outputType' => QRCode::OUTPUT_STRING_TEXT,
+ 'eccLevel' => QRCode::ECC_L,
+ 'moduleValues' => [
+ // finder
+ 1536 => 'A', // dark (true)
+ 6 => 'a', // light (false)
+ // alignment
+ 2560 => 'B',
+ 10 => 'b',
+ // timing
+ 3072 => 'C',
+ 12 => 'c',
+ // format
+ 3584 => 'D',
+ 14 => 'd',
+ // version
+ 4096 => 'E',
+ 16 => 'e',
+ // data
+ 1024 => 'F',
+ 4 => 'f',
+ // darkmodule
+ 512 => 'G',
+ // separator
+ 8 => 'h',
+ // quietzone
+ 18 => 'i',
+ ],
+]);
+
+// <pre> to view it in a browser
+echo '<pre style="font-size: 75%; line-height: 1;">'.(new QRCode($options))->render($data).'</pre>';
+
+
+
+
+
diff --git a/vendor/chillerlan/php-qrcode/phpdoc.xml b/vendor/chillerlan/php-qrcode/phpdoc.xml
new file mode 100644
index 000000000..d191e98ee
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/phpdoc.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<phpdoc>
+ <parser>
+ <target>public/docs</target>
+ </parser>
+ <transformer>
+ <target>public/docs</target>
+ </transformer>
+ <files>
+ <directory>src</directory>
+ </files>
+ <transformations>
+ <template name="responsive-twig"/>
+ </transformations>
+</phpdoc> \ No newline at end of file
diff --git a/vendor/chillerlan/php-qrcode/phpmd.xml b/vendor/chillerlan/php-qrcode/phpmd.xml
new file mode 100644
index 000000000..a70f7e3a1
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/phpmd.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<ruleset name="codemasher/php-qrcode PMD ruleset"
+ xmlns="http://pmd.sf.net/ruleset/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
+ xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
+ <description>codemasher/php-qrcode PMD ruleset</description>
+ <exclude-pattern>*/examples/*</exclude-pattern>
+ <exclude-pattern>*/tests/*</exclude-pattern>
+ <rule ref="rulesets/cleancode.xml">
+ <exclude name="BooleanArgumentFlag"/>
+ </rule>
+ <rule ref="rulesets/codesize.xml/CyclomaticComplexity">
+ <priority>1</priority>
+ <properties>
+ <property name="maximum" value="200" />
+ </properties>
+ </rule>
+ <rule ref="rulesets/controversial.xml">
+ <exclude name="CamelCaseMethodName"/>
+ <exclude name="CamelCasePropertyName"/>
+ <exclude name="CamelCaseParameterName"/>
+ <exclude name="CamelCaseVariableName"/>
+ </rule>
+ <rule ref="rulesets/design.xml">
+ </rule>
+ <rule ref="rulesets/naming.xml">
+ <exclude name="LongVariable"/>
+ <exclude name="ShortVariable"/>
+ </rule>
+ <rule ref="rulesets/unusedcode.xml">
+ <exclude name="UnusedFormalParameter"/>
+ </rule>
+</ruleset>
diff --git a/vendor/chillerlan/php-qrcode/phpunit.xml b/vendor/chillerlan/php-qrcode/phpunit.xml
new file mode 100644
index 000000000..3a9b678d2
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/phpunit.xml
@@ -0,0 +1,23 @@
+<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
+ bootstrap="vendor/autoload.php"
+ cacheResultFile=".build/phpunit.result.cache"
+ colors="true"
+ verbose="true"
+>
+ <filter>
+ <whitelist processUncoveredFilesFromWhitelist="true">
+ <directory suffix=".php">./src</directory>
+ </whitelist>
+ </filter>
+ <testsuites>
+ <testsuite name="php-qrcode test suite">
+ <directory suffix=".php">./tests/</directory>
+ </testsuite>
+ </testsuites>
+ <logging>
+ <log type="coverage-clover" target=".build/coverage/clover.xml"/>
+ <log type="coverage-xml" target=".build/coverage/coverage-xml"/>
+ <log type="junit" target=".build/logs/junit.xml"/>
+ </logging>
+</phpunit>
diff --git a/vendor/chillerlan/php-qrcode/public/index.html b/vendor/chillerlan/php-qrcode/public/index.html
new file mode 100644
index 000000000..d7bf6c891
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/public/index.html
@@ -0,0 +1,163 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head >
+ <meta charset="UTF-8" >
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <title >QR Code Generator</title >
+ <style >
+ body{ font-size: 20px; line-height: 1.4em; font-family: "Trebuchet MS", sans-serif; color: #000;}
+ input, textarea, select{font-family: Consolas, "Liberation Mono", Courier, monospace; font-size: 75%; line-height: 1.25em; border: 1px solid #aaa; }
+ input:focus, textarea:focus, select:focus{ border: 1px solid #ccc; }
+ label{ cursor: pointer; }
+ #qrcode-settings, div#qrcode-output{ text-align: center; }
+ div#qrcode-output > div {margin: 0;padding: 0;height: 3px;}
+ div#qrcode-output > div > span {display: inline-block;width: 3px;height: 3px;}
+ div#qrcode-output > div > span {background-color: lightgrey;}
+ </style >
+</head >
+<body >
+
+<form id="qrcode-settings" >
+
+ <label for="inputstring" >Input String</label ><br /><textarea name="inputstring" id="inputstring" cols="80" rows="3" autocomplete="off" spellcheck="false"></textarea ><br />
+
+ <label for="version" >Version</label >
+ <input id="version" name="version" class="options" type="number" min="1" max="40" value="5" placeholder="version" />
+
+ <label for="maskpattern" >Mask Pattern</label >
+ <input id="maskpattern" name="maskpattern" class="options" type="number" min="-1" max="7" value="-1" placeholder="mask pattern" />
+
+ <label for="ecc" >ECC</label >
+ <select class="options" id="ecc" name="ecc" >
+ <option value="L" selected="selected" >L - 7%</option >
+ <option value="M" >M - 15%</option >
+ <option value="Q" >Q - 25%</option >
+ <option value="H" >H - 30%</option >
+ </select >
+
+ <br />
+
+ <label for="quietzone" >Quiet Zone
+ <input id="quietzone" name="quietzone" class="options" type="checkbox" value="true" />
+ </label >
+
+ <label for="quietzonesize" >size</label >
+ <input id="quietzonesize" name="quietzonesize" class="options" type="number" min="0" max="100" value="4" placeholder="quiet zone" />
+
+ <br />
+
+ <label for="output_type" >Output</label >
+ <select class="options" id="output_type" name="output_type" >
+ <option value="html" >Markup - HTML</option >
+ <option value="svg" selected="selected" >Markup - SVG</option >
+ <option value="png">Image - png</option >
+ <option value="jpg" >Image - jpg</option >
+ <option value="gif" >Image - gif</option >
+ <option value="text" >String - text</option >
+ <option value="json" >String - json</option >
+ </select >
+
+ <label for="scale" >scale</label >
+ <input id="scale" name="scale" class="options" type="number" min="1" max="10" value="5" placeholder="scale" />
+
+ <div>Finder</div>
+ <label for="m_finder_light" >
+ <input type="text" id="m_finder_light" name="m_finder_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6" />
+ </label >
+ <label for="m_finder_dark" >
+ <input type="text" id="m_finder_dark" name="m_finder_dark" class="jscolor options" value="000000" autocomplete="off" spellcheck="false" minlength="6" maxlength="6" />
+ </label >
+
+ <div>Alignment</div>
+ <label for="m_alignment_light" >
+ <input type="text" id="m_alignment_light" name="m_alignment_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6" />
+ </label >
+ <label for="m_alignment_dark" >
+ <input type="text" id="m_alignment_dark" name="m_alignment_dark" class="jscolor options" value="000000" autocomplete="off" spellcheck="false" minlength="6" maxlength="6" />
+ </label >
+
+ <div>Timing</div>
+ <label for="m_timing_light" >
+ <input type="text" id="m_timing_light" name="m_timing_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6" />
+ </label >
+ <label for="m_timing_dark" >
+ <input type="text" id="m_timing_dark" name="m_timing_dark" class="jscolor options" value="000000" autocomplete="off" spellcheck="false" minlength="6" maxlength="6" />
+ </label >
+
+ <div>Format</div>
+ <label for="m_format_light" >
+ <input type="text" id="m_format_light" name="m_format_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6" />
+ </label >
+ <label for="m_format_dark" >
+ <input type="text" id="m_format_dark" name="m_format_dark" class="jscolor options" value="000000" autocomplete="off" spellcheck="false" minlength="6" maxlength="6" />
+ </label >
+
+ <div>Version</div>
+ <label for="m_version_light" >
+ <input type="text" id="m_version_light" name="m_version_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6" />
+ </label >
+ <label for="m_version_dark" >
+ <input type="text" id="m_version_dark" name="m_version_dark" class="jscolor options" value="000000" autocomplete="off" spellcheck="false" minlength="6" maxlength="6" />
+ </label >
+
+ <div>Data</div>
+ <label for="m_data_light" >
+ <input type="text" id="m_data_light" name="m_data_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6" />
+ </label >
+ <label for="m_data_dark" >
+ <input type="text" id="m_data_dark" name="m_data_dark" class="jscolor options" value="000000" autocomplete="off" spellcheck="false" minlength="6" maxlength="6" />
+ </label >
+
+ <div>Dark Module</div>
+ <label for="m_darkmodule_light" >
+ <input disabled="disabled" type="text" id="m_darkmodule_light" class="options" value="" autocomplete="off" spellcheck="false" />
+ </label >
+ <label for="m_darkmodule_dark" >
+ <input type="text" id="m_darkmodule_dark" name="m_darkmodule_dark" class="jscolor options" value="000000" autocomplete="off" spellcheck="false" minlength="6" maxlength="6" />
+ </label >
+
+ <div>Separator</div>
+ <label for="m_separator_light" >
+ <input type="text" id="m_separator_light" name="m_separator_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6" />
+ </label >
+ <label for="m_separator_dark" >
+ <input disabled="disabled" type="text" id="m_separator_dark" class="options" value="" autocomplete="off" spellcheck="false" />
+ </label >
+
+ <div>Quiet Zone</div>
+ <label for="m_quietzone_light" >
+ <input type="text" id="m_quietzone_light" name="m_quietzone_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6" />
+ </label >
+ <label for="m_quietzone_dark" >
+ <input disabled="disabled" type="text" id="m_quietzone_dark" class="options" value="" autocomplete="off" spellcheck="false" />
+ </label >
+
+ <br />
+ <button type="submit" >generate</button >
+</form >
+<div id="qrcode-output" ></div >
+
+<div><a href="https://play.google.com/store/apps/details?id=com.google.zxing.client.android" >ZXing Barcode Scanner</a ></div>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/prototype/1.7.3/prototype.js" ></script >
+<script src="https://cdnjs.cloudflare.com/ajax/libs/jscolor/2.0.4/jscolor.js" ></script >
+<script >
+ ((form, output, url) => {
+
+ $(form).observe('submit', ev => {
+ Event.stop(ev);
+
+ new Ajax.Request(url, {
+ method: 'post',
+ parameters: ev.target.serialize(true),
+ onUninitialized: $(output).update(),
+ onLoading: $(output).update('[portlandia_screaming.gif]'),
+ onFailure: response => $(output).update(response.responseJSON.error),
+ onSuccess: response => $(output).update(response.responseJSON.qrcode),
+ });
+
+ });
+ })('qrcode-settings', 'qrcode-output', './qrcode.php');
+</script >
+
+</body >
+</html > \ No newline at end of file
diff --git a/vendor/chillerlan/php-qrcode/public/qrcode.php b/vendor/chillerlan/php-qrcode/public/qrcode.php
new file mode 100644
index 000000000..1f8427c7e
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/public/qrcode.php
@@ -0,0 +1,97 @@
+<?php
+/**
+ * @filesource qrcode.php
+ * @created 18.11.2017
+ * @author Smiley <[email protected]>
+ * @copyright 2017 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCodePublic;
+
+use chillerlan\QRCode\QRCode;
+use chillerlan\QRCode\QROptions;
+
+require_once '../vendor/autoload.php';
+
+try{
+
+ $moduleValues = [
+ // finder
+ 1536 => $_POST['m_finder_dark'],
+ 6 => $_POST['m_finder_light'],
+ // alignment
+ 2560 => $_POST['m_alignment_dark'],
+ 10 => $_POST['m_alignment_light'],
+ // timing
+ 3072 => $_POST['m_timing_dark'],
+ 12 => $_POST['m_timing_light'],
+ // format
+ 3584 => $_POST['m_format_dark'],
+ 14 => $_POST['m_format_light'],
+ // version
+ 4096 => $_POST['m_version_dark'],
+ 16 => $_POST['m_version_light'],
+ // data
+ 1024 => $_POST['m_data_dark'],
+ 4 => $_POST['m_data_light'],
+ // darkmodule
+ 512 => $_POST['m_darkmodule_dark'],
+ // separator
+ 8 => $_POST['m_separator_light'],
+ // quietzone
+ 18 => $_POST['m_quietzone_light'],
+ ];
+
+ $moduleValues = array_map(function($v){
+ if(preg_match('/[a-f\d]{6}/i', $v) === 1){
+ return in_array($_POST['output_type'], ['png', 'jpg', 'gif'])
+ ? array_map('hexdec', str_split($v, 2))
+ : '#'.$v ;
+ }
+ return null;
+ }, $moduleValues);
+
+
+ $ecc = in_array($_POST['ecc'], ['L', 'M', 'Q', 'H'], true) ? $_POST['ecc'] : 'L';
+
+ $qro = new QROptions;
+
+ $qro->version = (int)$_POST['version'];
+ $qro->eccLevel = constant('chillerlan\\QRCode\\QRCode::ECC_'.$ecc);
+ $qro->maskPattern = (int)$_POST['maskpattern'];
+ $qro->addQuietzone = isset($_POST['quietzone']);
+ $qro->quietzoneSize = (int)$_POST['quietzonesize'];
+ $qro->moduleValues = $moduleValues;
+ $qro->outputType = $_POST['output_type'];
+ $qro->scale = (int)$_POST['scale'];
+ $qro->imageTransparent = false;
+
+ $qrcode = (new QRCode($qro))->render($_POST['inputstring']);
+
+ if(in_array($_POST['output_type'], ['png', 'jpg', 'gif'])){
+ $qrcode = '<img src="'.$qrcode.'" />';
+ }
+ elseif($_POST['output_type'] === 'text'){
+ $qrcode = '<pre style="font-size: 75%; line-height: 1;">'.$qrcode.'</pre>';
+ }
+ elseif($_POST['output_type'] === 'json'){
+ $qrcode = '<pre style="font-size: 75%; overflow-x: auto;">'.$qrcode.'</pre>';
+ }
+
+ send_response(['qrcode' => $qrcode]);
+}
+// Pokémon exception handler
+catch(\Exception $e){
+ header('HTTP/1.1 500 Internal Server Error');
+ send_response(['error' => $e->getMessage()]);
+}
+
+/**
+ * @param array $response
+ */
+function send_response(array $response){
+ header('Content-type: application/json;charset=utf-8;');
+ echo json_encode($response);
+ exit;
+}
diff --git a/vendor/chillerlan/php-qrcode/src/Data/AlphaNum.php b/vendor/chillerlan/php-qrcode/src/Data/AlphaNum.php
new file mode 100644
index 000000000..c6d34e76f
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/src/Data/AlphaNum.php
@@ -0,0 +1,65 @@
+<?php
+/**
+ * Class AlphaNum
+ *
+ * @filesource AlphaNum.php
+ * @created 25.11.2015
+ * @package chillerlan\QRCode\Data
+ * @author Smiley <[email protected]>
+ * @copyright 2015 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCode\Data;
+
+use chillerlan\QRCode\QRCode;
+
+use function array_search, ord, sprintf;
+
+/**
+ * Alphanumeric mode: 0 to 9, A to Z, space, $ % * + - . / :
+ */
+class AlphaNum extends QRDataAbstract{
+
+ /**
+ * @inheritdoc
+ */
+ protected $datamode = QRCode::DATA_ALPHANUM;
+
+ /**
+ * @inheritdoc
+ */
+ protected $lengthBits = [9, 11, 13];
+
+ /**
+ * @inheritdoc
+ */
+ protected function write(string $data):void{
+
+ for($i = 0; $i + 1 < $this->strlen; $i += 2){
+ $this->bitBuffer->put($this->getCharCode($data[$i]) * 45 + $this->getCharCode($data[$i + 1]), 11);
+ }
+
+ if($i < $this->strlen){
+ $this->bitBuffer->put($this->getCharCode($data[$i]), 6);
+ }
+
+ }
+
+ /**
+ * @param string $chr
+ *
+ * @return int
+ * @throws \chillerlan\QRCode\Data\QRCodeDataException
+ */
+ protected function getCharCode(string $chr):int{
+ $i = array_search($chr, $this::ALPHANUM_CHAR_MAP);
+
+ if($i !== false){
+ return $i;
+ }
+
+ throw new QRCodeDataException(sprintf('illegal char: "%s" [%d]', $chr, ord($chr)));
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/src/Data/Byte.php b/vendor/chillerlan/php-qrcode/src/Data/Byte.php
new file mode 100644
index 000000000..f1955645a
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/src/Data/Byte.php
@@ -0,0 +1,47 @@
+<?php
+/**
+ * Class Byte
+ *
+ * @filesource Byte.php
+ * @created 25.11.2015
+ * @package chillerlan\QRCode\Data
+ * @author Smiley <[email protected]>
+ * @copyright 2015 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCode\Data;
+
+use chillerlan\QRCode\QRCode;
+
+use function ord;
+
+/**
+ * Byte mode, ISO-8859-1 or UTF-8
+ */
+class Byte extends QRDataAbstract{
+
+ /**
+ * @inheritdoc
+ */
+ protected $datamode = QRCode::DATA_BYTE;
+
+ /**
+ * @inheritdoc
+ */
+ protected $lengthBits = [8, 16, 16];
+
+ /**
+ * @inheritdoc
+ */
+ protected function write(string $data):void{
+ $i = 0;
+
+ while($i < $this->strlen){
+ $this->bitBuffer->put(ord($data[$i]), 8);
+ $i++;
+ }
+
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/src/Data/Kanji.php b/vendor/chillerlan/php-qrcode/src/Data/Kanji.php
new file mode 100644
index 000000000..ce600d4ff
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/src/Data/Kanji.php
@@ -0,0 +1,70 @@
+<?php
+/**
+ * Class Kanji
+ *
+ * @filesource Kanji.php
+ * @created 25.11.2015
+ * @package chillerlan\QRCode\Data
+ * @author Smiley <[email protected]>
+ * @copyright 2015 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCode\Data;
+
+use chillerlan\QRCode\QRCode;
+
+use function mb_strlen, ord, sprintf, strlen;
+
+/**
+ * Kanji mode: double-byte characters from the Shift JIS character set
+ */
+class Kanji extends QRDataAbstract{
+
+ /**
+ * @inheritdoc
+ */
+ protected $datamode = QRCode::DATA_KANJI;
+
+ /**
+ * @inheritdoc
+ */
+ protected $lengthBits = [8, 10, 12];
+
+ /**
+ * @inheritdoc
+ */
+ protected function getLength(string $data):int{
+ return mb_strlen($data, 'SJIS');
+ }
+
+ /**
+ * @inheritdoc
+ */
+ protected function write(string $data):void{
+ $len = strlen($data);
+
+ for($i = 0; $i + 1 < $len; $i += 2){
+ $c = ((0xff & ord($data[$i])) << 8) | (0xff & ord($data[$i + 1]));
+
+ if(0x8140 <= $c && $c <= 0x9FFC){
+ $c -= 0x8140;
+ }
+ elseif(0xE040 <= $c && $c <= 0xEBBF){
+ $c -= 0xC140;
+ }
+ else{
+ throw new QRCodeDataException(sprintf('illegal char at %d [%d]', $i + 1, $c));
+ }
+
+ $this->bitBuffer->put((($c >> 8) & 0xff) * 0xC0 + ($c & 0xff), 13);
+
+ }
+
+ if($i < $len){
+ throw new QRCodeDataException(sprintf('illegal char at %d', $i + 1));
+ }
+
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/src/Data/MaskPatternTester.php b/vendor/chillerlan/php-qrcode/src/Data/MaskPatternTester.php
new file mode 100644
index 000000000..8dfd24180
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/src/Data/MaskPatternTester.php
@@ -0,0 +1,203 @@
+<?php
+/**
+ * Class MaskPatternTester
+ *
+ * @filesource MaskPatternTester.php
+ * @created 22.11.2017
+ * @package chillerlan\QRCode\Data
+ * @author Smiley <[email protected]>
+ * @copyright 2017 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCode\Data;
+
+use function abs, call_user_func_array;
+
+/**
+ * The sole purpose of this class is to receive a QRMatrix object and run the pattern tests on it.
+ *
+ * @link http://www.thonky.com/qr-code-tutorial/data-masking
+ */
+class MaskPatternTester{
+
+ /**
+ * @var \chillerlan\QRCode\Data\QRMatrix
+ */
+ protected $matrix;
+
+ /**
+ * @var int
+ */
+ protected $moduleCount;
+
+ /**
+ * Receives the matrix an sets the module count
+ *
+ * @see \chillerlan\QRCode\QROptions::$maskPattern
+ * @see \chillerlan\QRCode\Data\QRMatrix::$maskPattern
+ * @see \chillerlan\QRCode\QRCode::getBestMaskPattern()
+ *
+ * @param \chillerlan\QRCode\Data\QRMatrix $matrix
+ */
+ public function __construct(QRMatrix $matrix){
+ $this->matrix = $matrix;
+ $this->moduleCount = $this->matrix->size();
+ }
+
+ /**
+ * Returns the penalty for the given mask pattern
+ *
+ * @see \chillerlan\QRCode\QROptions::$maskPattern
+ * @see \chillerlan\QRCode\Data\QRMatrix::$maskPattern
+ * @see \chillerlan\QRCode\QRCode::getBestMaskPattern()
+ *
+ * @return int
+ */
+ public function testPattern():int{
+ $penalty = 0;
+
+ for($level = 1; $level <= 4; $level++){
+ $penalty += call_user_func_array([$this, 'testLevel'.$level], [$this->matrix->matrix(true)]);
+ }
+
+ return (int)$penalty;
+ }
+
+ /**
+ * Checks for each group of five or more same-colored modules in a row (or column)
+ *
+ * @return int
+ */
+ protected function testLevel1(array $m):int{
+ $penalty = 0;
+
+ foreach($m as $y => $row){
+ foreach($row as $x => $val){
+ $count = 0;
+
+ for($ry = -1; $ry <= 1; $ry++){
+
+ if($y + $ry < 0 || $this->moduleCount <= $y + $ry){
+ continue;
+ }
+
+ for($rx = -1; $rx <= 1; $rx++){
+
+ if(($ry === 0 && $rx === 0) || (($x + $rx) < 0 || $this->moduleCount <= ($x + $rx))){
+ continue;
+ }
+
+ if($m[$y + $ry][$x + $rx] === $val){
+ $count++;
+ }
+
+ }
+ }
+
+ if($count > 5){
+ $penalty += (3 + $count - 5);
+ }
+
+ }
+ }
+
+ return $penalty;
+ }
+
+ /**
+ * Checks for each 2x2 area of same-colored modules in the matrix
+ *
+ * @return int
+ */
+ protected function testLevel2(array $m):int{
+ $penalty = 0;
+
+ foreach($m as $y => $row){
+
+ if($y > ($this->moduleCount - 2)){
+ break;
+ }
+
+ foreach($row as $x => $val){
+
+ if($x > ($this->moduleCount - 2)){
+ break;
+ }
+
+ if(
+ $val === $m[$y][$x + 1]
+ && $val === $m[$y + 1][$x]
+ && $val === $m[$y + 1][$x + 1]
+ ){
+ $penalty++;
+ }
+ }
+ }
+
+ return 3 * $penalty;
+ }
+
+ /**
+ * Checks if there are patterns that look similar to the finder patterns (1:1:3:1:1 ratio)
+ *
+ * @return int
+ */
+ protected function testLevel3(array $m):int{
+ $penalties = 0;
+
+ foreach($m as $y => $row){
+ foreach($row as $x => $val){
+
+ if(
+ ($x + 6) < $this->moduleCount
+ && $val
+ && !$m[$y][$x + 1]
+ && $m[$y][$x + 2]
+ && $m[$y][$x + 3]
+ && $m[$y][$x + 4]
+ && !$m[$y][$x + 5]
+ && $m[$y][$x + 6]
+ ){
+ $penalties++;
+ }
+
+ if(
+ ($y + 6) < $this->moduleCount
+ && $val
+ && !$m[$y + 1][$x]
+ && $m[$y + 2][$x]
+ && $m[$y + 3][$x]
+ && $m[$y + 4][$x]
+ && !$m[$y + 5][$x]
+ && $m[$y + 6][$x]
+ ){
+ $penalties++;
+ }
+
+ }
+ }
+
+ return $penalties * 40;
+ }
+
+ /**
+ * Checks if more than half of the modules are dark or light, with a larger penalty for a larger difference
+ *
+ * @return float
+ */
+ protected function testLevel4(array $m):float{
+ $count = 0;
+
+ foreach($m as $y => $row){
+ foreach($row as $x => $val){
+ if($val){
+ $count++;
+ }
+ }
+ }
+
+ return (abs(100 * $count / $this->moduleCount / $this->moduleCount - 50) / 5) * 10;
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/src/Data/Number.php b/vendor/chillerlan/php-qrcode/src/Data/Number.php
new file mode 100644
index 000000000..3936d12c3
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/src/Data/Number.php
@@ -0,0 +1,82 @@
+<?php
+/**
+ * Class Number
+ *
+ * @filesource Number.php
+ * @created 26.11.2015
+ * @package QRCode
+ * @author Smiley <[email protected]>
+ * @copyright 2015 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCode\Data;
+
+use chillerlan\QRCode\QRCode;
+
+use function ord, sprintf, substr;
+
+/**
+ * Numeric mode: decimal digits 0 through 9
+ */
+class Number extends QRDataAbstract{
+
+ /**
+ * @inheritdoc
+ */
+ protected $datamode = QRCode::DATA_NUMBER;
+
+ /**
+ * @inheritdoc
+ */
+ protected $lengthBits = [10, 12, 14];
+
+ /**
+ * @inheritdoc
+ */
+ protected function write(string $data):void{
+ $i = 0;
+
+ while($i + 2 < $this->strlen){
+ $this->bitBuffer->put($this->parseInt(substr($data, $i, 3)), 10);
+ $i += 3;
+ }
+
+ if($i < $this->strlen){
+
+ if($this->strlen - $i === 1){
+ $this->bitBuffer->put($this->parseInt(substr($data, $i, $i + 1)), 4);
+ }
+ elseif($this->strlen - $i === 2){
+ $this->bitBuffer->put($this->parseInt(substr($data, $i, $i + 2)), 7);
+ }
+
+ }
+
+ }
+
+ /**
+ * @param string $string
+ *
+ * @return int
+ * @throws \chillerlan\QRCode\Data\QRCodeDataException
+ */
+ protected function parseInt(string $string):int{
+ $num = 0;
+
+ $len = strlen($string);
+ for($i = 0; $i < $len; $i++){
+ $c = ord($string[$i]);
+
+ if(!in_array($string[$i], $this::NUMBER_CHAR_MAP, true)){
+ throw new QRCodeDataException(sprintf('illegal char: "%s" [%d]', $string[$i], $c));
+ }
+
+ $c = $c - 48; // ord('0')
+ $num = $num * 10 + $c;
+ }
+
+ return $num;
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/src/Data/QRCodeDataException.php b/vendor/chillerlan/php-qrcode/src/Data/QRCodeDataException.php
new file mode 100644
index 000000000..862f57ba0
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/src/Data/QRCodeDataException.php
@@ -0,0 +1,17 @@
+<?php
+/**
+ * Class QRCodeDataException
+ *
+ * @filesource QRCodeDataException.php
+ * @created 09.12.2015
+ * @package chillerlan\QRCode\Data
+ * @author Smiley <[email protected]>
+ * @copyright 2015 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCode\Data;
+
+use chillerlan\QRCode\QRCodeException;
+
+class QRCodeDataException extends QRCodeException{}
diff --git a/vendor/chillerlan/php-qrcode/src/Data/QRDataAbstract.php b/vendor/chillerlan/php-qrcode/src/Data/QRDataAbstract.php
new file mode 100644
index 000000000..f52767e38
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/src/Data/QRDataAbstract.php
@@ -0,0 +1,351 @@
+<?php
+/**
+ * Class QRDataAbstract
+ *
+ * @filesource QRDataAbstract.php
+ * @created 25.11.2015
+ * @package chillerlan\QRCode\Data
+ * @author Smiley <[email protected]>
+ * @copyright 2015 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCode\Data;
+
+use chillerlan\QRCode\{QRCode, QRCodeException};
+use chillerlan\QRCode\Helpers\{BitBuffer, Polynomial};
+use chillerlan\Settings\SettingsContainerInterface;
+
+use function array_fill, array_merge, count, max, mb_convert_encoding, mb_detect_encoding, range, sprintf, strlen;
+
+/**
+ * Processes the binary data and maps it on a matrix which is then being returned
+ */
+abstract class QRDataAbstract implements QRDataInterface{
+
+ /**
+ * the string byte count
+ *
+ * @var int
+ */
+ protected $strlen;
+
+ /**
+ * the current data mode: Num, Alphanum, Kanji, Byte
+ *
+ * @var int
+ */
+ protected $datamode;
+
+ /**
+ * mode length bits for the version breakpoints 1-9, 10-26 and 27-40
+ *
+ * @var array
+ */
+ protected $lengthBits = [0, 0, 0];
+
+ /**
+ * current QR Code version
+ *
+ * @var int
+ */
+ protected $version;
+
+ /**
+ * the raw data that's being passed to QRMatrix::mapData()
+ *
+ * @var array
+ */
+ protected $matrixdata;
+
+ /**
+ * ECC temp data
+ *
+ * @var array
+ */
+ protected $ecdata;
+
+ /**
+ * ECC temp data
+ *
+ * @var array
+ */
+ protected $dcdata;
+
+ /**
+ * @var \chillerlan\QRCode\QROptions
+ */
+ protected $options;
+
+ /**
+ * @var \chillerlan\QRCode\Helpers\BitBuffer
+ */
+ protected $bitBuffer;
+
+ /**
+ * QRDataInterface constructor.
+ *
+ * @param \chillerlan\Settings\SettingsContainerInterface $options
+ * @param string|null $data
+ */
+ public function __construct(SettingsContainerInterface $options, string $data = null){
+ $this->options = $options;
+
+ if($data !== null){
+ $this->setData($data);
+ }
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function setData(string $data):QRDataInterface{
+
+ if($this->datamode === QRCode::DATA_KANJI){
+ $data = mb_convert_encoding($data, 'SJIS', mb_detect_encoding($data));
+ }
+
+ $this->strlen = $this->getLength($data);
+ $this->version = $this->options->version === QRCode::VERSION_AUTO
+ ? $this->getMinimumVersion()
+ : $this->options->version;
+
+ $this->matrixdata = $this
+ ->writeBitBuffer($data)
+ ->maskECC()
+ ;
+
+ return $this;
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function initMatrix(int $maskPattern, bool $test = null):QRMatrix{
+ return (new QRMatrix($this->version, $this->options->eccLevel))
+ ->setFinderPattern()
+ ->setSeparators()
+ ->setAlignmentPattern()
+ ->setTimingPattern()
+ ->setVersionNumber($test)
+ ->setFormatInfo($maskPattern, $test)
+ ->setDarkModule()
+ ->mapData($this->matrixdata, $maskPattern)
+ ;
+ }
+
+ /**
+ * returns the length bits for the version breakpoints 1-9, 10-26 and 27-40
+ *
+ * @return int
+ * @throws \chillerlan\QRCode\Data\QRCodeDataException
+ * @codeCoverageIgnore
+ */
+ protected function getLengthBits():int{
+
+ foreach([9, 26, 40] as $key => $breakpoint){
+ if($this->version <= $breakpoint){
+ return $this->lengthBits[$key];
+ }
+ }
+
+ throw new QRCodeDataException(sprintf('invalid version number: %d', $this->version));
+ }
+
+ /**
+ * returns the byte count of the $data string
+ *
+ * @param string $data
+ *
+ * @return int
+ */
+ protected function getLength(string $data):int{
+ return strlen($data);
+ }
+
+ /**
+ * returns the minimum version number for the given string
+ *
+ * @return int
+ * @throws \chillerlan\QRCode\Data\QRCodeDataException
+ */
+ protected function getMinimumVersion():int{
+ $maxlength = 0;
+
+ // guess the version number within the given range
+ foreach(range($this->options->versionMin, $this->options->versionMax) as $version){
+ $maxlength = $this::MAX_LENGTH[$version][QRCode::DATA_MODES[$this->datamode]][QRCode::ECC_MODES[$this->options->eccLevel]];
+
+ if($this->strlen <= $maxlength){
+ return $version;
+ }
+ }
+
+ throw new QRCodeDataException(sprintf('data exceeds %d characters', $maxlength));
+ }
+
+ /**
+ * writes the actual data string to the BitBuffer
+ *
+ * @see \chillerlan\QRCode\Data\QRDataAbstract::writeBitBuffer()
+ *
+ * @param string $data
+ *
+ * @return void
+ */
+ abstract protected function write(string $data):void;
+
+ /**
+ * creates a BitBuffer and writes the string data to it
+ *
+ * @param string $data
+ *
+ * @return \chillerlan\QRCode\Data\QRDataAbstract
+ * @throws \chillerlan\QRCode\QRCodeException
+ */
+ protected function writeBitBuffer(string $data):QRDataInterface{
+ $this->bitBuffer = new BitBuffer;
+
+ $MAX_BITS = $this::MAX_BITS[$this->version][QRCode::ECC_MODES[$this->options->eccLevel]];
+
+ $this->bitBuffer
+ ->clear()
+ ->put($this->datamode, 4)
+ ->put($this->strlen, $this->getLengthBits())
+ ;
+
+ $this->write($data);
+
+ // there was an error writing the BitBuffer data, which is... unlikely.
+ if($this->bitBuffer->length > $MAX_BITS){
+ throw new QRCodeException(sprintf('code length overflow. (%d > %d bit)', $this->bitBuffer->length, $MAX_BITS)); // @codeCoverageIgnore
+ }
+
+ // end code.
+ if($this->bitBuffer->length + 4 <= $MAX_BITS){
+ $this->bitBuffer->put(0, 4);
+ }
+
+ // padding
+ while($this->bitBuffer->length % 8 !== 0){
+ $this->bitBuffer->putBit(false);
+ }
+
+ // padding
+ while(true){
+
+ if($this->bitBuffer->length >= $MAX_BITS){
+ break;
+ }
+
+ $this->bitBuffer->put(0xEC, 8);
+
+ if($this->bitBuffer->length >= $MAX_BITS){
+ break;
+ }
+
+ $this->bitBuffer->put(0x11, 8);
+ }
+
+ return $this;
+ }
+
+ /**
+ * ECC masking
+ *
+ * @link http://www.thonky.com/qr-code-tutorial/error-correction-coding
+ *
+ * @return array
+ */
+ protected function maskECC():array{
+ [$l1, $l2, $b1, $b2] = $this::RSBLOCKS[$this->version][QRCode::ECC_MODES[$this->options->eccLevel]];
+
+ $rsBlocks = array_fill(0, $l1, [$b1, $b2]);
+ $rsCount = $l1 + $l2;
+ $this->ecdata = array_fill(0, $rsCount, null);
+ $this->dcdata = $this->ecdata;
+
+ if($l2 > 0){
+ $rsBlocks = array_merge($rsBlocks, array_fill(0, $l2, [$b1 + 1, $b2 + 1]));
+ }
+
+ $totalCodeCount = 0;
+ $maxDcCount = 0;
+ $maxEcCount = 0;
+ $offset = 0;
+
+ foreach($rsBlocks as $key => $block){
+ [$rsBlockTotal, $dcCount] = $block;
+
+ $ecCount = $rsBlockTotal - $dcCount;
+ $maxDcCount = max($maxDcCount, $dcCount);
+ $maxEcCount = max($maxEcCount, $ecCount);
+ $this->dcdata[$key] = array_fill(0, $dcCount, null);
+
+ foreach($this->dcdata[$key] as $a => $_z){
+ $this->dcdata[$key][$a] = 0xff & $this->bitBuffer->buffer[$a + $offset];
+ }
+
+ [$num, $add] = $this->poly($key, $ecCount);
+
+ foreach($this->ecdata[$key] as $c => $_z){
+ $modIndex = $c + $add;
+ $this->ecdata[$key][$c] = $modIndex >= 0 ? $num[$modIndex] : 0;
+ }
+
+ $offset += $dcCount;
+ $totalCodeCount += $rsBlockTotal;
+ }
+
+ $data = array_fill(0, $totalCodeCount, null);
+ $index = 0;
+
+ $mask = function($arr, $count) use (&$data, &$index, $rsCount){
+ for($x = 0; $x < $count; $x++){
+ for($y = 0; $y < $rsCount; $y++){
+ if($x < count($arr[$y])){
+ $data[$index] = $arr[$y][$x];
+ $index++;
+ }
+ }
+ }
+ };
+
+ $mask($this->dcdata, $maxDcCount);
+ $mask($this->ecdata, $maxEcCount);
+
+ return $data;
+ }
+
+ /**
+ * @param int $key
+ * @param int $count
+ *
+ * @return int[]
+ */
+ protected function poly(int $key, int $count):array{
+ $rsPoly = new Polynomial;
+ $modPoly = new Polynomial;
+
+ for($i = 0; $i < $count; $i++){
+ $modPoly->setNum([1, $modPoly->gexp($i)]);
+ $rsPoly->multiply($modPoly->getNum());
+ }
+
+ $rsPolyCount = count($rsPoly->getNum());
+
+ $modPoly
+ ->setNum($this->dcdata[$key], $rsPolyCount - 1)
+ ->mod($rsPoly->getNum())
+ ;
+
+ $this->ecdata[$key] = array_fill(0, $rsPolyCount - 1, null);
+ $num = $modPoly->getNum();
+
+ return [
+ $num,
+ count($num) - count($this->ecdata[$key]),
+ ];
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/src/Data/QRDataInterface.php b/vendor/chillerlan/php-qrcode/src/Data/QRDataInterface.php
new file mode 100644
index 000000000..653386222
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/src/Data/QRDataInterface.php
@@ -0,0 +1,187 @@
+<?php
+/**
+ * Interface QRDataInterface
+ *
+ * @filesource QRDataInterface.php
+ * @created 01.12.2015
+ * @package chillerlan\QRCode\Data
+ * @author Smiley <[email protected]>
+ * @copyright 2015 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCode\Data;
+
+/**
+ *
+ */
+interface QRDataInterface{
+
+ const NUMBER_CHAR_MAP = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
+
+ const ALPHANUM_CHAR_MAP = [
+ '0', '1', '2', '3', '4', '5', '6', '7',
+ '8', '9', 'A', 'B', 'C', 'D', 'E', 'F',
+ 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
+ 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
+ 'W', 'X', 'Y', 'Z', ' ', '$', '%', '*',
+ '+', '-', '.', '/', ':',
+ ];
+
+ /**
+ * @link http://www.qrcode.com/en/about/version.html
+ */
+ const MAX_LENGTH =[
+ // v => [NUMERIC => [L, M, Q, H ], ALPHANUM => [L, M, Q, H], BINARY => [L, M, Q, H ], KANJI => [L, M, Q, H ]] // modules
+ 1 => [[ 41, 34, 27, 17], [ 25, 20, 16, 10], [ 17, 14, 11, 7], [ 10, 8, 7, 4]], // 21
+ 2 => [[ 77, 63, 48, 34], [ 47, 38, 29, 20], [ 32, 26, 20, 14], [ 20, 16, 12, 8]], // 25
+ 3 => [[ 127, 101, 77, 58], [ 77, 61, 47, 35], [ 53, 42, 32, 24], [ 32, 26, 20, 15]], // 29
+ 4 => [[ 187, 149, 111, 82], [ 114, 90, 67, 50], [ 78, 62, 46, 34], [ 48, 38, 28, 21]], // 33
+ 5 => [[ 255, 202, 144, 106], [ 154, 122, 87, 64], [ 106, 84, 60, 44], [ 65, 52, 37, 27]], // 37
+ 6 => [[ 322, 255, 178, 139], [ 195, 154, 108, 84], [ 134, 106, 74, 58], [ 82, 65, 45, 36]], // 41
+ 7 => [[ 370, 293, 207, 154], [ 224, 178, 125, 93], [ 154, 122, 86, 64], [ 95, 75, 53, 39]], // 45
+ 8 => [[ 461, 365, 259, 202], [ 279, 221, 157, 122], [ 192, 152, 108, 84], [ 118, 93, 66, 52]], // 49
+ 9 => [[ 552, 432, 312, 235], [ 335, 262, 189, 143], [ 230, 180, 130, 98], [ 141, 111, 80, 60]], // 53
+ 10 => [[ 652, 513, 364, 288], [ 395, 311, 221, 174], [ 271, 213, 151, 119], [ 167, 131, 93, 74]], // 57
+ 11 => [[ 772, 604, 427, 331], [ 468, 366, 259, 200], [ 321, 251, 177, 137], [ 198, 155, 109, 85]], // 61
+ 12 => [[ 883, 691, 489, 374], [ 535, 419, 296, 227], [ 367, 287, 203, 155], [ 226, 177, 125, 96]], // 65
+ 13 => [[1022, 796, 580, 427], [ 619, 483, 352, 259], [ 425, 331, 241, 177], [ 262, 204, 149, 109]], // 69 NICE!
+ 14 => [[1101, 871, 621, 468], [ 667, 528, 376, 283], [ 458, 362, 258, 194], [ 282, 223, 159, 120]], // 73
+ 15 => [[1250, 991, 703, 530], [ 758, 600, 426, 321], [ 520, 412, 292, 220], [ 320, 254, 180, 136]], // 77
+ 16 => [[1408, 1082, 775, 602], [ 854, 656, 470, 365], [ 586, 450, 322, 250], [ 361, 277, 198, 154]], // 81
+ 17 => [[1548, 1212, 876, 674], [ 938, 734, 531, 408], [ 644, 504, 364, 280], [ 397, 310, 224, 173]], // 85
+ 18 => [[1725, 1346, 948, 746], [1046, 816, 574, 452], [ 718, 560, 394, 310], [ 442, 345, 243, 191]], // 89
+ 19 => [[1903, 1500, 1063, 813], [1153, 909, 644, 493], [ 792, 624, 442, 338], [ 488, 384, 272, 208]], // 93
+ 20 => [[2061, 1600, 1159, 919], [1249, 970, 702, 557], [ 858, 666, 482, 382], [ 528, 410, 297, 235]], // 97
+ 21 => [[2232, 1708, 1224, 969], [1352, 1035, 742, 587], [ 929, 711, 509, 403], [ 572, 438, 314, 248]], // 101
+ 22 => [[2409, 1872, 1358, 1056], [1460, 1134, 823, 640], [1003, 779, 565, 439], [ 618, 480, 348, 270]], // 105
+ 23 => [[2620, 2059, 1468, 1108], [1588, 1248, 890, 672], [1091, 857, 611, 461], [ 672, 528, 376, 284]], // 109
+ 24 => [[2812, 2188, 1588, 1228], [1704, 1326, 963, 744], [1171, 911, 661, 511], [ 721, 561, 407, 315]], // 113
+ 25 => [[3057, 2395, 1718, 1286], [1853, 1451, 1041, 779], [1273, 997, 715, 535], [ 784, 614, 440, 330]], // 117
+ 26 => [[3283, 2544, 1804, 1425], [1990, 1542, 1094, 864], [1367, 1059, 751, 593], [ 842, 652, 462, 365]], // 121
+ 27 => [[3517, 2701, 1933, 1501], [2132, 1637, 1172, 910], [1465, 1125, 805, 625], [ 902, 692, 496, 385]], // 125
+ 28 => [[3669, 2857, 2085, 1581], [2223, 1732, 1263, 958], [1528, 1190, 868, 658], [ 940, 732, 534, 405]], // 129
+ 29 => [[3909, 3035, 2181, 1677], [2369, 1839, 1322, 1016], [1628, 1264, 908, 698], [1002, 778, 559, 430]], // 133
+ 30 => [[4158, 3289, 2358, 1782], [2520, 1994, 1429, 1080], [1732, 1370, 982, 742], [1066, 843, 604, 457]], // 137
+ 31 => [[4417, 3486, 2473, 1897], [2677, 2113, 1499, 1150], [1840, 1452, 1030, 790], [1132, 894, 634, 486]], // 141
+ 32 => [[4686, 3693, 2670, 2022], [2840, 2238, 1618, 1226], [1952, 1538, 1112, 842], [1201, 947, 684, 518]], // 145
+ 33 => [[4965, 3909, 2805, 2157], [3009, 2369, 1700, 1307], [2068, 1628, 1168, 898], [1273, 1002, 719, 553]], // 149
+ 34 => [[5253, 4134, 2949, 2301], [3183, 2506, 1787, 1394], [2188, 1722, 1228, 958], [1347, 1060, 756, 590]], // 153
+ 35 => [[5529, 4343, 3081, 2361], [3351, 2632, 1867, 1431], [2303, 1809, 1283, 983], [1417, 1113, 790, 605]], // 157
+ 36 => [[5836, 4588, 3244, 2524], [3537, 2780, 1966, 1530], [2431, 1911, 1351, 1051], [1496, 1176, 832, 647]], // 161
+ 37 => [[6153, 4775, 3417, 2625], [3729, 2894, 2071, 1591], [2563, 1989, 1423, 1093], [1577, 1224, 876, 673]], // 165
+ 38 => [[6479, 5039, 3599, 2735], [3927, 3054, 2181, 1658], [2699, 2099, 1499, 1139], [1661, 1292, 923, 701]], // 169
+ 39 => [[6743, 5313, 3791, 2927], [4087, 3220, 2298, 1774], [2809, 2213, 1579, 1219], [1729, 1362, 972, 750]], // 173
+ 40 => [[7089, 5596, 3993, 3057], [4296, 3391, 2420, 1852], [2953, 2331, 1663, 1273], [1817, 1435, 1024, 784]], // 177
+ ];
+
+ const MAX_BITS = [
+ // version => [L, M, Q, H ]
+ 1 => [ 152, 128, 104, 72],
+ 2 => [ 272, 224, 176, 128],
+ 3 => [ 440, 352, 272, 208],
+ 4 => [ 640, 512, 384, 288],
+ 5 => [ 864, 688, 496, 368],
+ 6 => [ 1088, 864, 608, 480],
+ 7 => [ 1248, 992, 704, 528],
+ 8 => [ 1552, 1232, 880, 688],
+ 9 => [ 1856, 1456, 1056, 800],
+ 10 => [ 2192, 1728, 1232, 976],
+ 11 => [ 2592, 2032, 1440, 1120],
+ 12 => [ 2960, 2320, 1648, 1264],
+ 13 => [ 3424, 2672, 1952, 1440],
+ 14 => [ 3688, 2920, 2088, 1576],
+ 15 => [ 4184, 3320, 2360, 1784],
+ 16 => [ 4712, 3624, 2600, 2024],
+ 17 => [ 5176, 4056, 2936, 2264],
+ 18 => [ 5768, 4504, 3176, 2504],
+ 19 => [ 6360, 5016, 3560, 2728],
+ 20 => [ 6888, 5352, 3880, 3080],
+ 21 => [ 7456, 5712, 4096, 3248],
+ 22 => [ 8048, 6256, 4544, 3536],
+ 23 => [ 8752, 6880, 4912, 3712],
+ 24 => [ 9392, 7312, 5312, 4112],
+ 25 => [10208, 8000, 5744, 4304],
+ 26 => [10960, 8496, 6032, 4768],
+ 27 => [11744, 9024, 6464, 5024],
+ 28 => [12248, 9544, 6968, 5288],
+ 29 => [13048, 10136, 7288, 5608],
+ 30 => [13880, 10984, 7880, 5960],
+ 31 => [14744, 11640, 8264, 6344],
+ 32 => [15640, 12328, 8920, 6760],
+ 33 => [16568, 13048, 9368, 7208],
+ 34 => [17528, 13800, 9848, 7688],
+ 35 => [18448, 14496, 10288, 7888],
+ 36 => [19472, 15312, 10832, 8432],
+ 37 => [20528, 15936, 11408, 8768],
+ 38 => [21616, 16816, 12016, 9136],
+ 39 => [22496, 17728, 12656, 9776],
+ 40 => [23648, 18672, 13328, 10208],
+ ];
+
+ /**
+ * @link http://www.thonky.com/qr-code-tutorial/error-correction-table
+ */
+ const RSBLOCKS = [
+ 1 => [[ 1, 0, 26, 19], [ 1, 0, 26, 16], [ 1, 0, 26, 13], [ 1, 0, 26, 9]],
+ 2 => [[ 1, 0, 44, 34], [ 1, 0, 44, 28], [ 1, 0, 44, 22], [ 1, 0, 44, 16]],
+ 3 => [[ 1, 0, 70, 55], [ 1, 0, 70, 44], [ 2, 0, 35, 17], [ 2, 0, 35, 13]],
+ 4 => [[ 1, 0, 100, 80], [ 2, 0, 50, 32], [ 2, 0, 50, 24], [ 4, 0, 25, 9]],
+ 5 => [[ 1, 0, 134, 108], [ 2, 0, 67, 43], [ 2, 2, 33, 15], [ 2, 2, 33, 11]],
+ 6 => [[ 2, 0, 86, 68], [ 4, 0, 43, 27], [ 4, 0, 43, 19], [ 4, 0, 43, 15]],
+ 7 => [[ 2, 0, 98, 78], [ 4, 0, 49, 31], [ 2, 4, 32, 14], [ 4, 1, 39, 13]],
+ 8 => [[ 2, 0, 121, 97], [ 2, 2, 60, 38], [ 4, 2, 40, 18], [ 4, 2, 40, 14]],
+ 9 => [[ 2, 0, 146, 116], [ 3, 2, 58, 36], [ 4, 4, 36, 16], [ 4, 4, 36, 12]],
+ 10 => [[ 2, 2, 86, 68], [ 4, 1, 69, 43], [ 6, 2, 43, 19], [ 6, 2, 43, 15]],
+ 11 => [[ 4, 0, 101, 81], [ 1, 4, 80, 50], [ 4, 4, 50, 22], [ 3, 8, 36, 12]],
+ 12 => [[ 2, 2, 116, 92], [ 6, 2, 58, 36], [ 4, 6, 46, 20], [ 7, 4, 42, 14]],
+ 13 => [[ 4, 0, 133, 107], [ 8, 1, 59, 37], [ 8, 4, 44, 20], [12, 4, 33, 11]],
+ 14 => [[ 3, 1, 145, 115], [ 4, 5, 64, 40], [11, 5, 36, 16], [11, 5, 36, 12]],
+ 15 => [[ 5, 1, 109, 87], [ 5, 5, 65, 41], [ 5, 7, 54, 24], [11, 7, 36, 12]],
+ 16 => [[ 5, 1, 122, 98], [ 7, 3, 73, 45], [15, 2, 43, 19], [ 3, 13, 45, 15]],
+ 17 => [[ 1, 5, 135, 107], [10, 1, 74, 46], [ 1, 15, 50, 22], [ 2, 17, 42, 14]],
+ 18 => [[ 5, 1, 150, 120], [ 9, 4, 69, 43], [17, 1, 50, 22], [ 2, 19, 42, 14]],
+ 19 => [[ 3, 4, 141, 113], [ 3, 11, 70, 44], [17, 4, 47, 21], [ 9, 16, 39, 13]],
+ 20 => [[ 3, 5, 135, 107], [ 3, 13, 67, 41], [15, 5, 54, 24], [15, 10, 43, 15]],
+ 21 => [[ 4, 4, 144, 116], [17, 0, 68, 42], [17, 6, 50, 22], [19, 6, 46, 16]],
+ 22 => [[ 2, 7, 139, 111], [17, 0, 74, 46], [ 7, 16, 54, 24], [34, 0, 37, 13]],
+ 23 => [[ 4, 5, 151, 121], [ 4, 14, 75, 47], [11, 14, 54, 24], [16, 14, 45, 15]],
+ 24 => [[ 6, 4, 147, 117], [ 6, 14, 73, 45], [11, 16, 54, 24], [30, 2, 46, 16]],
+ 25 => [[ 8, 4, 132, 106], [ 8, 13, 75, 47], [ 7, 22, 54, 24], [22, 13, 45, 15]],
+ 26 => [[10, 2, 142, 114], [19, 4, 74, 46], [28, 6, 50, 22], [33, 4, 46, 16]],
+ 27 => [[ 8, 4, 152, 122], [22, 3, 73, 45], [ 8, 26, 53, 23], [12, 28, 45, 15]],
+ 28 => [[ 3, 10, 147, 117], [ 3, 23, 73, 45], [ 4, 31, 54, 24], [11, 31, 45, 15]],
+ 29 => [[ 7, 7, 146, 116], [21, 7, 73, 45], [ 1, 37, 53, 23], [19, 26, 45, 15]],
+ 30 => [[ 5, 10, 145, 115], [19, 10, 75, 47], [15, 25, 54, 24], [23, 25, 45, 15]],
+ 31 => [[13, 3, 145, 115], [ 2, 29, 74, 46], [42, 1, 54, 24], [23, 28, 45, 15]],
+ 32 => [[17, 0, 145, 115], [10, 23, 74, 46], [10, 35, 54, 24], [19, 35, 45, 15]],
+ 33 => [[17, 1, 145, 115], [14, 21, 74, 46], [29, 19, 54, 24], [11, 46, 45, 15]],
+ 34 => [[13, 6, 145, 115], [14, 23, 74, 46], [44, 7, 54, 24], [59, 1, 46, 16]],
+ 35 => [[12, 7, 151, 121], [12, 26, 75, 47], [39, 14, 54, 24], [22, 41, 45, 15]],
+ 36 => [[ 6, 14, 151, 121], [ 6, 34, 75, 47], [46, 10, 54, 24], [ 2, 64, 45, 15]],
+ 37 => [[17, 4, 152, 122], [29, 14, 74, 46], [49, 10, 54, 24], [24, 46, 45, 15]],
+ 38 => [[ 4, 18, 152, 122], [13, 32, 74, 46], [48, 14, 54, 24], [42, 32, 45, 15]],
+ 39 => [[20, 4, 147, 117], [40, 7, 75, 47], [43, 22, 54, 24], [10, 67, 45, 15]],
+ 40 => [[19, 6, 148, 118], [18, 31, 75, 47], [34, 34, 54, 24], [20, 61, 45, 15]],
+ ];
+
+ /**
+ * Sets the data string (internally called by the constructor)
+ *
+ * @param string $data
+ *
+ * @return \chillerlan\QRCode\Data\QRDataInterface
+ */
+ public function setData(string $data):QRDataInterface;
+
+ /**
+ * returns a fresh matrix object with the data written for the given $maskPattern
+ *
+ * @param int $maskPattern
+ * @param bool|null $test
+ *
+ * @return \chillerlan\QRCode\Data\QRMatrix
+ */
+ public function initMatrix(int $maskPattern, bool $test = null):QRMatrix;
+
+}
diff --git a/vendor/chillerlan/php-qrcode/src/Data/QRMatrix.php b/vendor/chillerlan/php-qrcode/src/Data/QRMatrix.php
new file mode 100644
index 000000000..a6d8b09e2
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/src/Data/QRMatrix.php
@@ -0,0 +1,733 @@
+<?php
+/**
+ * Class QRMatrix
+ *
+ * @filesource QRMatrix.php
+ * @created 15.11.2017
+ * @package chillerlan\QRCode\Data
+ * @author Smiley <[email protected]>
+ * @copyright 2017 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCode\Data;
+
+use chillerlan\QRCode\QRCode;
+use Closure;
+
+use function array_fill, array_key_exists, array_push, array_unshift, count, floor, in_array, max, min, range;
+
+/**
+ * @link http://www.thonky.com/qr-code-tutorial/format-version-information
+ */
+class QRMatrix{
+
+ public const M_NULL = 0x00;
+ public const M_DARKMODULE = 0x02;
+ public const M_DATA = 0x04;
+ public const M_FINDER = 0x06;
+ public const M_SEPARATOR = 0x08;
+ public const M_ALIGNMENT = 0x0a;
+ public const M_TIMING = 0x0c;
+ public const M_FORMAT = 0x0e;
+ public const M_VERSION = 0x10;
+ public const M_QUIETZONE = 0x12;
+ public const M_LOGO = 0x14;
+ public const M_FINDER_DOT = 0x16;
+
+ public const M_TEST = 0xff;
+
+ /**
+ * @link http://www.thonky.com/qr-code-tutorial/alignment-pattern-locations
+ *
+ * version -> pattern
+ */
+ protected const alignmentPattern = [
+ 1 => [],
+ 2 => [6, 18],
+ 3 => [6, 22],
+ 4 => [6, 26],
+ 5 => [6, 30],
+ 6 => [6, 34],
+ 7 => [6, 22, 38],
+ 8 => [6, 24, 42],
+ 9 => [6, 26, 46],
+ 10 => [6, 28, 50],
+ 11 => [6, 30, 54],
+ 12 => [6, 32, 58],
+ 13 => [6, 34, 62],
+ 14 => [6, 26, 46, 66],
+ 15 => [6, 26, 48, 70],
+ 16 => [6, 26, 50, 74],
+ 17 => [6, 30, 54, 78],
+ 18 => [6, 30, 56, 82],
+ 19 => [6, 30, 58, 86],
+ 20 => [6, 34, 62, 90],
+ 21 => [6, 28, 50, 72, 94],
+ 22 => [6, 26, 50, 74, 98],
+ 23 => [6, 30, 54, 78, 102],
+ 24 => [6, 28, 54, 80, 106],
+ 25 => [6, 32, 58, 84, 110],
+ 26 => [6, 30, 58, 86, 114],
+ 27 => [6, 34, 62, 90, 118],
+ 28 => [6, 26, 50, 74, 98, 122],
+ 29 => [6, 30, 54, 78, 102, 126],
+ 30 => [6, 26, 52, 78, 104, 130],
+ 31 => [6, 30, 56, 82, 108, 134],
+ 32 => [6, 34, 60, 86, 112, 138],
+ 33 => [6, 30, 58, 86, 114, 142],
+ 34 => [6, 34, 62, 90, 118, 146],
+ 35 => [6, 30, 54, 78, 102, 126, 150],
+ 36 => [6, 24, 50, 76, 102, 128, 154],
+ 37 => [6, 28, 54, 80, 106, 132, 158],
+ 38 => [6, 32, 58, 84, 110, 136, 162],
+ 39 => [6, 26, 54, 82, 110, 138, 166],
+ 40 => [6, 30, 58, 86, 114, 142, 170],
+ ];
+
+ /**
+ * @link http://www.thonky.com/qr-code-tutorial/format-version-tables
+ *
+ * no version pattern for QR Codes < 7
+ */
+ protected const versionPattern = [
+ 7 => 0b000111110010010100,
+ 8 => 0b001000010110111100,
+ 9 => 0b001001101010011001,
+ 10 => 0b001010010011010011,
+ 11 => 0b001011101111110110,
+ 12 => 0b001100011101100010,
+ 13 => 0b001101100001000111,
+ 14 => 0b001110011000001101,
+ 15 => 0b001111100100101000,
+ 16 => 0b010000101101111000,
+ 17 => 0b010001010001011101,
+ 18 => 0b010010101000010111,
+ 19 => 0b010011010100110010,
+ 20 => 0b010100100110100110,
+ 21 => 0b010101011010000011,
+ 22 => 0b010110100011001001,
+ 23 => 0b010111011111101100,
+ 24 => 0b011000111011000100,
+ 25 => 0b011001000111100001,
+ 26 => 0b011010111110101011,
+ 27 => 0b011011000010001110,
+ 28 => 0b011100110000011010,
+ 29 => 0b011101001100111111,
+ 30 => 0b011110110101110101,
+ 31 => 0b011111001001010000,
+ 32 => 0b100000100111010101,
+ 33 => 0b100001011011110000,
+ 34 => 0b100010100010111010,
+ 35 => 0b100011011110011111,
+ 36 => 0b100100101100001011,
+ 37 => 0b100101010000101110,
+ 38 => 0b100110101001100100,
+ 39 => 0b100111010101000001,
+ 40 => 0b101000110001101001,
+ ];
+
+ // ECC level -> mask pattern
+ protected const formatPattern = [
+ [ // L
+ 0b111011111000100,
+ 0b111001011110011,
+ 0b111110110101010,
+ 0b111100010011101,
+ 0b110011000101111,
+ 0b110001100011000,
+ 0b110110001000001,
+ 0b110100101110110,
+ ],
+ [ // M
+ 0b101010000010010,
+ 0b101000100100101,
+ 0b101111001111100,
+ 0b101101101001011,
+ 0b100010111111001,
+ 0b100000011001110,
+ 0b100111110010111,
+ 0b100101010100000,
+ ],
+ [ // Q
+ 0b011010101011111,
+ 0b011000001101000,
+ 0b011111100110001,
+ 0b011101000000110,
+ 0b010010010110100,
+ 0b010000110000011,
+ 0b010111011011010,
+ 0b010101111101101,
+ ],
+ [ // H
+ 0b001011010001001,
+ 0b001001110111110,
+ 0b001110011100111,
+ 0b001100111010000,
+ 0b000011101100010,
+ 0b000001001010101,
+ 0b000110100001100,
+ 0b000100000111011,
+ ],
+ ];
+
+ /**
+ * @var int
+ */
+ protected $version;
+
+ /**
+ * @var int
+ */
+ protected $eclevel;
+
+ /**
+ * @var int
+ */
+ protected $maskPattern = QRCode::MASK_PATTERN_AUTO;
+
+ /**
+ * @var int
+ */
+ protected $moduleCount;
+
+ /**
+ * @var mixed[]
+ */
+ protected $matrix;
+
+ /**
+ * QRMatrix constructor.
+ *
+ * @param int $version
+ * @param int $eclevel
+ *
+ * @throws \chillerlan\QRCode\Data\QRCodeDataException
+ */
+ public function __construct(int $version, int $eclevel){
+
+ if(!in_array($version, range(1, 40), true)){
+ throw new QRCodeDataException('invalid QR Code version');
+ }
+
+ if(!array_key_exists($eclevel, QRCode::ECC_MODES)){
+ throw new QRCodeDataException('invalid ecc level');
+ }
+
+ $this->version = $version;
+ $this->eclevel = $eclevel;
+ $this->moduleCount = $this->version * 4 + 17;
+ $this->matrix = array_fill(0, $this->moduleCount, array_fill(0, $this->moduleCount, $this::M_NULL));
+ }
+
+ /**
+ * Returns the data matrix, returns a pure boolean representation if $boolean is set to true
+ *
+ * @return int[][]|bool[][]
+ */
+ public function matrix(bool $boolean = false):array{
+
+ if(!$boolean){
+ return $this->matrix;
+ }
+
+ $matrix = [];
+
+ foreach($this->matrix as $y => $row){
+ $matrix[$y] = [];
+
+ foreach($row as $x => $val){
+ $matrix[$y][$x] = ($val >> 8) > 0;
+ }
+ }
+
+ return $matrix;
+ }
+
+ /**
+ * @return int
+ */
+ public function version():int{
+ return $this->version;
+ }
+
+ /**
+ * @return int
+ */
+ public function eccLevel():int{
+ return $this->eclevel;
+ }
+
+ /**
+ * @return int
+ */
+ public function maskPattern():int{
+ return $this->maskPattern;
+ }
+
+ /**
+ * Returns the absoulute size of the matrix, including quiet zone (after setting it).
+ *
+ * size = version * 4 + 17 [ + 2 * quietzone size]
+ *
+ * @return int
+ */
+ public function size():int{
+ return $this->moduleCount;
+ }
+
+ /**
+ * Returns the value of the module at position [$x, $y]
+ *
+ * @param int $x
+ * @param int $y
+ *
+ * @return int
+ */
+ public function get(int $x, int $y):int{
+ return $this->matrix[$y][$x];
+ }
+
+ /**
+ * Sets the $M_TYPE value for the module at position [$x, $y]
+ *
+ * true => $M_TYPE << 8
+ * false => $M_TYPE
+ *
+ * @param int $x
+ * @param int $y
+ * @param int $M_TYPE
+ * @param bool $value
+ *
+ * @return \chillerlan\QRCode\Data\QRMatrix
+ */
+ public function set(int $x, int $y, bool $value, int $M_TYPE):QRMatrix{
+ $this->matrix[$y][$x] = $M_TYPE << ($value ? 8 : 0);
+
+ return $this;
+ }
+
+ /**
+ * Checks whether a module is true (dark) or false (light)
+ *
+ * true => $value >> 8 === $M_TYPE
+ * $value >> 8 > 0
+ *
+ * false => $value === $M_TYPE
+ * $value >> 8 === 0
+ *
+ * @param int $x
+ * @param int $y
+ *
+ * @return bool
+ */
+ public function check(int $x, int $y):bool{
+ return $this->matrix[$y][$x] >> 8 > 0;
+ }
+
+
+ /**
+ * Sets the "dark module", that is always on the same position 1x1px away from the bottom left finder
+ *
+ * @return \chillerlan\QRCode\Data\QRMatrix
+ */
+ public function setDarkModule():QRMatrix{
+ $this->set(8, 4 * $this->version + 9, true, $this::M_DARKMODULE);
+
+ return $this;
+ }
+
+ /**
+ * Draws the 7x7 finder patterns in the corners top left/right and bottom left
+ *
+ * @return \chillerlan\QRCode\Data\QRMatrix
+ */
+ public function setFinderPattern():QRMatrix{
+
+ $pos = [
+ [0, 0], // top left
+ [$this->moduleCount - 7, 0], // bottom left
+ [0, $this->moduleCount - 7], // top right
+ ];
+
+ foreach($pos as $c){
+ for($y = 0; $y < 7; $y++){
+ for($x = 0; $x < 7; $x++){
+ // outer (dark) 7*7 square
+ if($x === 0 || $x === 6 || $y === 0 || $y === 6){
+ $this->set($c[0] + $y, $c[1] + $x, true, $this::M_FINDER);
+ }
+ // inner (light) 5*5 square
+ elseif($x === 1 || $x === 5 || $y === 1 || $y === 5){
+ $this->set($c[0] + $y, $c[1] + $x, false, $this::M_FINDER);
+ }
+ // 3*3 dot
+ else{
+ $this->set($c[0] + $y, $c[1] + $x, true, $this::M_FINDER_DOT);
+ }
+ }
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Draws the separator lines around the finder patterns
+ *
+ * @return \chillerlan\QRCode\Data\QRMatrix
+ */
+ public function setSeparators():QRMatrix{
+
+ $h = [
+ [7, 0],
+ [$this->moduleCount - 8, 0],
+ [7, $this->moduleCount - 8],
+ ];
+
+ $v = [
+ [7, 7],
+ [$this->moduleCount - 1, 7],
+ [7, $this->moduleCount - 8],
+ ];
+
+ for($c = 0; $c < 3; $c++){
+ for($i = 0; $i < 8; $i++){
+ $this->set($h[$c][0] , $h[$c][1] + $i, false, $this::M_SEPARATOR);
+ $this->set($v[$c][0] - $i, $v[$c][1] , false, $this::M_SEPARATOR);
+ }
+ }
+
+ return $this;
+ }
+
+
+ /**
+ * Draws the 5x5 alignment patterns
+ *
+ * @return \chillerlan\QRCode\Data\QRMatrix
+ */
+ public function setAlignmentPattern():QRMatrix{
+
+ foreach($this::alignmentPattern[$this->version] as $y){
+ foreach($this::alignmentPattern[$this->version] as $x){
+
+ // skip existing patterns
+ if($this->matrix[$y][$x] !== $this::M_NULL){
+ continue;
+ }
+
+ for($ry = -2; $ry <= 2; $ry++){
+ for($rx = -2; $rx <= 2; $rx++){
+ $v = ($ry === 0 && $rx === 0) || $ry === 2 || $ry === -2 || $rx === 2 || $rx === -2;
+
+ $this->set($x + $rx, $y + $ry, $v, $this::M_ALIGNMENT);
+ }
+ }
+
+ }
+ }
+
+ return $this;
+ }
+
+
+ /**
+ * Draws the timing pattern (h/v checkered line between the finder patterns)
+ *
+ * @return \chillerlan\QRCode\Data\QRMatrix
+ */
+ public function setTimingPattern():QRMatrix{
+
+ foreach(range(8, $this->moduleCount - 8 - 1) as $i){
+
+ if($this->matrix[6][$i] !== $this::M_NULL || $this->matrix[$i][6] !== $this::M_NULL){
+ continue;
+ }
+
+ $v = $i % 2 === 0;
+
+ $this->set($i, 6, $v, $this::M_TIMING); // h
+ $this->set(6, $i, $v, $this::M_TIMING); // v
+ }
+
+ return $this;
+ }
+
+ /**
+ * Draws the version information, 2x 3x6 pixel
+ *
+ * @param bool|null $test
+ *
+ * @return \chillerlan\QRCode\Data\QRMatrix
+ */
+ public function setVersionNumber(bool $test = null):QRMatrix{
+ $bits = $this::versionPattern[$this->version] ?? false;
+
+ if($bits !== false){
+
+ for($i = 0; $i < 18; $i++){
+ $a = (int)floor($i / 3);
+ $b = $i % 3 + $this->moduleCount - 8 - 3;
+ $v = !$test && (($bits >> $i) & 1) === 1;
+
+ $this->set($b, $a, $v, $this::M_VERSION); // ne
+ $this->set($a, $b, $v, $this::M_VERSION); // sw
+ }
+
+ }
+
+ return $this;
+ }
+
+ /**
+ * Draws the format info along the finder patterns
+ *
+ * @param int $maskPattern
+ * @param bool|null $test
+ *
+ * @return \chillerlan\QRCode\Data\QRMatrix
+ */
+ public function setFormatInfo(int $maskPattern, bool $test = null):QRMatrix{
+ $bits = $this::formatPattern[QRCode::ECC_MODES[$this->eclevel]][$maskPattern] ?? 0;
+
+ for($i = 0; $i < 15; $i++){
+ $v = !$test && (($bits >> $i) & 1) === 1;
+
+ if($i < 6){
+ $this->set(8, $i, $v, $this::M_FORMAT);
+ }
+ elseif($i < 8){
+ $this->set(8, $i + 1, $v, $this::M_FORMAT);
+ }
+ else{
+ $this->set(8, $this->moduleCount - 15 + $i, $v, $this::M_FORMAT);
+ }
+
+ if($i < 8){
+ $this->set($this->moduleCount - $i - 1, 8, $v, $this::M_FORMAT);
+ }
+ elseif($i < 9){
+ $this->set(15 - $i, 8, $v, $this::M_FORMAT);
+ }
+ else{
+ $this->set(15 - $i - 1, 8, $v, $this::M_FORMAT);
+ }
+
+ }
+
+ $this->set(8, $this->moduleCount - 8, !$test, $this::M_FORMAT);
+
+ return $this;
+ }
+
+ /**
+ * Draws the "quiet zone" of $size around the matrix
+ *
+ * @param int|null $size
+ *
+ * @return \chillerlan\QRCode\Data\QRMatrix
+ * @throws \chillerlan\QRCode\Data\QRCodeDataException
+ */
+ public function setQuietZone(int $size = null):QRMatrix{
+
+ if($this->matrix[$this->moduleCount - 1][$this->moduleCount - 1] === $this::M_NULL){
+ throw new QRCodeDataException('use only after writing data');
+ }
+
+ $size = $size !== null
+ ? max(0, min($size, floor($this->moduleCount / 2)))
+ : 4;
+
+ for($y = 0; $y < $this->moduleCount; $y++){
+ for($i = 0; $i < $size; $i++){
+ array_unshift($this->matrix[$y], $this::M_QUIETZONE);
+ array_push($this->matrix[$y], $this::M_QUIETZONE);
+ }
+ }
+
+ $this->moduleCount += ($size * 2);
+
+ $r = array_fill(0, $this->moduleCount, $this::M_QUIETZONE);
+
+ for($i = 0; $i < $size; $i++){
+ array_unshift($this->matrix, $r);
+ array_push($this->matrix, $r);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Clears a space of $width * $height in order to add a logo or text.
+ *
+ * Additionally, the logo space can be positioned within the QR Code - respecting the main functional patterns -
+ * using $startX and $startY. If either of these are null, the logo space will be centered in that direction.
+ * ECC level "H" (30%) is required.
+ *
+ * Please note that adding a logo space minimizes the error correction capacity of the QR Code and
+ * created images may become unreadable, especially when printed with a chance to receive damage.
+ * Please test thoroughly before using this feature in production.
+ *
+ * This method should be called from within an output module (after the matrix has been filled with data).
+ * Note that there is no restiction on how many times this method could be called on the same matrix instance.
+ *
+ * @link https://github.com/chillerlan/php-qrcode/issues/52
+ *
+ * @param int $width
+ * @param int $height
+ * @param int|null $startX
+ * @param int|null $startY
+ *
+ * @return \chillerlan\QRCode\Data\QRMatrix
+ * @throws \chillerlan\QRCode\Data\QRCodeDataException
+ */
+ public function setLogoSpace(int $width, int $height, int $startX = null, int $startY = null):QRMatrix{
+
+ // for logos we operate in ECC H (30%) only
+ if($this->eclevel !== 0b10){
+ throw new QRCodeDataException('ECC level "H" required to add logo space');
+ }
+
+ // we need uneven sizes, adjust if needed
+ if(($width % 2) === 0){
+ $width++;
+ }
+
+ if(($height % 2) === 0){
+ $height++;
+ }
+
+ // $this->moduleCount includes the quiet zone (if created), we need the QR size here
+ $length = $this->version * 4 + 17;
+
+ // throw if the logo space exceeds the maximum error correction capacity
+ if($width * $height > floor($length * $length * 0.2)){
+ throw new QRCodeDataException('logo space exceeds the maximum error correction capacity');
+ }
+
+ // quiet zone size
+ $qz = ($this->moduleCount - $length) / 2;
+ // skip quiet zone and the first 9 rows/columns (finder-, mode-, version- and timing patterns)
+ $start = $qz + 9;
+ // skip quiet zone
+ $end = $this->moduleCount - $qz;
+
+ // determine start coordinates
+ $startX = ($startX !== null ? $startX : ($length - $width) / 2) + $qz;
+ $startY = ($startY !== null ? $startY : ($length - $height) / 2) + $qz;
+
+ // clear the space
+ foreach($this->matrix as $y => $row){
+ foreach($row as $x => $val){
+ // out of bounds, skip
+ if($x < $start || $y < $start ||$x >= $end || $y >= $end){
+ continue;
+ }
+ // a match
+ if($x >= $startX && $x < ($startX + $width) && $y >= $startY && $y < ($startY + $height)){
+ $this->set($x, $y, false, $this::M_LOGO);
+ }
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Maps the binary $data array from QRDataInterface::maskECC() on the matrix, using $maskPattern
+ *
+ * @see \chillerlan\QRCode\Data\QRDataAbstract::maskECC()
+ *
+ * @param int[] $data
+ * @param int $maskPattern
+ *
+ * @return \chillerlan\QRCode\Data\QRMatrix
+ */
+ public function mapData(array $data, int $maskPattern):QRMatrix{
+ $this->maskPattern = $maskPattern;
+ $byteCount = count($data);
+ $size = $this->moduleCount - 1;
+ $mask = $this->getMask($this->maskPattern);
+
+ for($i = $size, $y = $size, $inc = -1, $byteIndex = 0, $bitIndex = 7; $i > 0; $i -= 2){
+
+ if($i === 6){
+ $i--;
+ }
+
+ while(true){
+ for($c = 0; $c < 2; $c++){
+ $x = $i - $c;
+
+ if($this->matrix[$y][$x] === $this::M_NULL){
+ $v = false;
+
+ if($byteIndex < $byteCount){
+ $v = (($data[$byteIndex] >> $bitIndex) & 1) === 1;
+ }
+
+ if($mask($x, $y) === 0){
+ $v = !$v;
+ }
+
+ $this->matrix[$y][$x] = $this::M_DATA << ($v ? 8 : 0);
+ $bitIndex--;
+
+ if($bitIndex === -1){
+ $byteIndex++;
+ $bitIndex = 7;
+ }
+
+ }
+ }
+
+ $y += $inc;
+
+ if($y < 0 || $this->moduleCount <= $y){
+ $y -= $inc;
+ $inc = -$inc;
+
+ break;
+ }
+
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * ISO/IEC 18004:2000 Section 8.8.1
+ *
+ * Note that some versions of the QR code standard have had errors in the section about mask patterns.
+ * The information below has been corrected. (https://www.thonky.com/qr-code-tutorial/mask-patterns)
+ *
+ * @see \chillerlan\QRCode\QRMatrix::mapData()
+ *
+ * @internal
+ *
+ * @param int $maskPattern
+ *
+ * @return \Closure
+ * @throws \chillerlan\QRCode\Data\QRCodeDataException
+ */
+ protected function getMask(int $maskPattern):Closure{
+
+ if((0b111 & $maskPattern) !== $maskPattern){
+ throw new QRCodeDataException('invalid mask pattern'); // @codeCoverageIgnore
+ }
+
+ return [
+ 0b000 => function($x, $y):int{ return ($x + $y) % 2; },
+ 0b001 => function($x, $y):int{ return $y % 2; },
+ 0b010 => function($x, $y):int{ return $x % 3; },
+ 0b011 => function($x, $y):int{ return ($x + $y) % 3; },
+ 0b100 => function($x, $y):int{ return ((int)($y / 2) + (int)($x / 3)) % 2; },
+ 0b101 => function($x, $y):int{ return (($x * $y) % 2) + (($x * $y) % 3); },
+ 0b110 => function($x, $y):int{ return ((($x * $y) % 2) + (($x * $y) % 3)) % 2; },
+ 0b111 => function($x, $y):int{ return ((($x * $y) % 3) + (($x + $y) % 2)) % 2; },
+ ][$maskPattern];
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/src/Helpers/BitBuffer.php b/vendor/chillerlan/php-qrcode/src/Helpers/BitBuffer.php
new file mode 100644
index 000000000..0b4ff6a77
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/src/Helpers/BitBuffer.php
@@ -0,0 +1,75 @@
+<?php
+/**
+ * Class BitBuffer
+ *
+ * @filesource BitBuffer.php
+ * @created 25.11.2015
+ * @package chillerlan\QRCode\Helpers
+ * @author Smiley <[email protected]>
+ * @copyright 2015 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCode\Helpers;
+
+use function count, floor;
+
+class BitBuffer{
+
+ /**
+ * @var int[]
+ */
+ public $buffer = [];
+
+ /**
+ * @var int
+ */
+ public $length = 0;
+
+ /**
+ * @return \chillerlan\QRCode\Helpers\BitBuffer
+ */
+ public function clear():BitBuffer{
+ $this->buffer = [];
+ $this->length = 0;
+
+ return $this;
+ }
+
+ /**
+ * @param int $num
+ * @param int $length
+ *
+ * @return \chillerlan\QRCode\Helpers\BitBuffer
+ */
+ public function put(int $num, int $length):BitBuffer{
+
+ for($i = 0; $i < $length; $i++){
+ $this->putBit((($num >> ($length - $i - 1)) & 1) === 1);
+ }
+
+ return $this;
+ }
+
+ /**
+ * @param bool $bit
+ *
+ * @return \chillerlan\QRCode\Helpers\BitBuffer
+ */
+ public function putBit(bool $bit):BitBuffer{
+ $bufIndex = floor($this->length / 8);
+
+ if(count($this->buffer) <= $bufIndex){
+ $this->buffer[] = 0;
+ }
+
+ if($bit === true){
+ $this->buffer[(int)$bufIndex] |= (0x80 >> ($this->length % 8));
+ }
+
+ $this->length++;
+
+ return $this;
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/src/Helpers/Polynomial.php b/vendor/chillerlan/php-qrcode/src/Helpers/Polynomial.php
new file mode 100644
index 000000000..abe11d0cc
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/src/Helpers/Polynomial.php
@@ -0,0 +1,184 @@
+<?php
+/**
+ * Class Polynomial
+ *
+ * @filesource Polynomial.php
+ * @created 25.11.2015
+ * @package chillerlan\QRCode\Helpers
+ * @author Smiley <[email protected]>
+ * @copyright 2015 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCode\Helpers;
+
+use chillerlan\QRCode\QRCodeException;
+
+use function array_fill, count, sprintf;
+
+/**
+ * @link http://www.thonky.com/qr-code-tutorial/error-correction-coding
+ */
+class Polynomial{
+
+ /**
+ * @link http://www.thonky.com/qr-code-tutorial/log-antilog-table
+ */
+ protected const table = [
+ [ 1, 0], [ 2, 0], [ 4, 1], [ 8, 25], [ 16, 2], [ 32, 50], [ 64, 26], [128, 198],
+ [ 29, 3], [ 58, 223], [116, 51], [232, 238], [205, 27], [135, 104], [ 19, 199], [ 38, 75],
+ [ 76, 4], [152, 100], [ 45, 224], [ 90, 14], [180, 52], [117, 141], [234, 239], [201, 129],
+ [143, 28], [ 3, 193], [ 6, 105], [ 12, 248], [ 24, 200], [ 48, 8], [ 96, 76], [192, 113],
+ [157, 5], [ 39, 138], [ 78, 101], [156, 47], [ 37, 225], [ 74, 36], [148, 15], [ 53, 33],
+ [106, 53], [212, 147], [181, 142], [119, 218], [238, 240], [193, 18], [159, 130], [ 35, 69],
+ [ 70, 29], [140, 181], [ 5, 194], [ 10, 125], [ 20, 106], [ 40, 39], [ 80, 249], [160, 185],
+ [ 93, 201], [186, 154], [105, 9], [210, 120], [185, 77], [111, 228], [222, 114], [161, 166],
+ [ 95, 6], [190, 191], [ 97, 139], [194, 98], [153, 102], [ 47, 221], [ 94, 48], [188, 253],
+ [101, 226], [202, 152], [137, 37], [ 15, 179], [ 30, 16], [ 60, 145], [120, 34], [240, 136],
+ [253, 54], [231, 208], [211, 148], [187, 206], [107, 143], [214, 150], [177, 219], [127, 189],
+ [254, 241], [225, 210], [223, 19], [163, 92], [ 91, 131], [182, 56], [113, 70], [226, 64],
+ [217, 30], [175, 66], [ 67, 182], [134, 163], [ 17, 195], [ 34, 72], [ 68, 126], [136, 110],
+ [ 13, 107], [ 26, 58], [ 52, 40], [104, 84], [208, 250], [189, 133], [103, 186], [206, 61],
+ [129, 202], [ 31, 94], [ 62, 155], [124, 159], [248, 10], [237, 21], [199, 121], [147, 43],
+ [ 59, 78], [118, 212], [236, 229], [197, 172], [151, 115], [ 51, 243], [102, 167], [204, 87],
+ [133, 7], [ 23, 112], [ 46, 192], [ 92, 247], [184, 140], [109, 128], [218, 99], [169, 13],
+ [ 79, 103], [158, 74], [ 33, 222], [ 66, 237], [132, 49], [ 21, 197], [ 42, 254], [ 84, 24],
+ [168, 227], [ 77, 165], [154, 153], [ 41, 119], [ 82, 38], [164, 184], [ 85, 180], [170, 124],
+ [ 73, 17], [146, 68], [ 57, 146], [114, 217], [228, 35], [213, 32], [183, 137], [115, 46],
+ [230, 55], [209, 63], [191, 209], [ 99, 91], [198, 149], [145, 188], [ 63, 207], [126, 205],
+ [252, 144], [229, 135], [215, 151], [179, 178], [123, 220], [246, 252], [241, 190], [255, 97],
+ [227, 242], [219, 86], [171, 211], [ 75, 171], [150, 20], [ 49, 42], [ 98, 93], [196, 158],
+ [149, 132], [ 55, 60], [110, 57], [220, 83], [165, 71], [ 87, 109], [174, 65], [ 65, 162],
+ [130, 31], [ 25, 45], [ 50, 67], [100, 216], [200, 183], [141, 123], [ 7, 164], [ 14, 118],
+ [ 28, 196], [ 56, 23], [112, 73], [224, 236], [221, 127], [167, 12], [ 83, 111], [166, 246],
+ [ 81, 108], [162, 161], [ 89, 59], [178, 82], [121, 41], [242, 157], [249, 85], [239, 170],
+ [195, 251], [155, 96], [ 43, 134], [ 86, 177], [172, 187], [ 69, 204], [138, 62], [ 9, 90],
+ [ 18, 203], [ 36, 89], [ 72, 95], [144, 176], [ 61, 156], [122, 169], [244, 160], [245, 81],
+ [247, 11], [243, 245], [251, 22], [235, 235], [203, 122], [139, 117], [ 11, 44], [ 22, 215],
+ [ 44, 79], [ 88, 174], [176, 213], [125, 233], [250, 230], [233, 231], [207, 173], [131, 232],
+ [ 27, 116], [ 54, 214], [108, 244], [216, 234], [173, 168], [ 71, 80], [142, 88], [ 1, 175],
+ ];
+
+ /**
+ * @var array
+ */
+ protected $num = [];
+
+ /**
+ * Polynomial constructor.
+ *
+ * @param array|null $num
+ * @param int|null $shift
+ */
+ public function __construct(array $num = null, int $shift = null){
+ $this->setNum($num ?? [1], $shift);
+ }
+
+ /**
+ * @return array
+ */
+ public function getNum():array{
+ return $this->num;
+ }
+
+ /**
+ * @param array $num
+ * @param int|null $shift
+ *
+ * @return \chillerlan\QRCode\Helpers\Polynomial
+ */
+ public function setNum(array $num, int $shift = null):Polynomial{
+ $offset = 0;
+ $numCount = count($num);
+
+ while($offset < $numCount && $num[$offset] === 0){
+ $offset++;
+ }
+
+ $this->num = array_fill(0, $numCount - $offset + ($shift ?? 0), 0);
+
+ for($i = 0; $i < $numCount - $offset; $i++){
+ $this->num[$i] = $num[$i + $offset];
+ }
+
+ return $this;
+ }
+
+ /**
+ * @param array $e
+ *
+ * @return \chillerlan\QRCode\Helpers\Polynomial
+ */
+ public function multiply(array $e):Polynomial{
+ $n = array_fill(0, count($this->num) + count($e) - 1, 0);
+
+ foreach($this->num as $i => $vi){
+ $vi = $this->glog($vi);
+
+ foreach($e as $j => $vj){
+ $n[$i + $j] ^= $this->gexp($vi + $this->glog($vj));
+ }
+
+ }
+
+ $this->setNum($n);
+
+ return $this;
+ }
+
+ /**
+ * @param array $e
+ *
+ * @return \chillerlan\QRCode\Helpers\Polynomial
+ */
+ public function mod(array $e):Polynomial{
+ $n = $this->num;
+
+ if(count($n) - count($e) < 0){
+ return $this;
+ }
+
+ $ratio = $this->glog($n[0]) - $this->glog($e[0]);
+
+ foreach($e as $i => $v){
+ $n[$i] ^= $this->gexp($this->glog($v) + $ratio);
+ }
+
+ $this->setNum($n)->mod($e);
+
+ return $this;
+ }
+
+ /**
+ * @param int $n
+ *
+ * @return int
+ * @throws \chillerlan\QRCode\QRCodeException
+ */
+ public function glog(int $n):int{
+
+ if($n < 1){
+ throw new QRCodeException(sprintf('log(%s)', $n));
+ }
+
+ return Polynomial::table[$n][1];
+ }
+
+ /**
+ * @param int $n
+ *
+ * @return int
+ */
+ public function gexp(int $n):int{
+
+ if($n < 0){
+ $n += 255;
+ }
+ elseif($n >= 256){
+ $n -= 255;
+ }
+
+ return Polynomial::table[$n][0];
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/src/Output/QRCodeOutputException.php b/vendor/chillerlan/php-qrcode/src/Output/QRCodeOutputException.php
new file mode 100644
index 000000000..639bdd111
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/src/Output/QRCodeOutputException.php
@@ -0,0 +1,17 @@
+<?php
+/**
+ * Class QRCodeOutputException
+ *
+ * @filesource QRCodeOutputException.php
+ * @created 09.12.2015
+ * @package chillerlan\QRCode\Output
+ * @author Smiley <[email protected]>
+ * @copyright 2015 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCode\Output;
+
+use chillerlan\QRCode\QRCodeException;
+
+class QRCodeOutputException extends QRCodeException{}
diff --git a/vendor/chillerlan/php-qrcode/src/Output/QRFpdf.php b/vendor/chillerlan/php-qrcode/src/Output/QRFpdf.php
new file mode 100644
index 000000000..a706685af
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/src/Output/QRFpdf.php
@@ -0,0 +1,112 @@
+<?php
+/**
+ * Class QRFpdf
+ *
+ * https://github.com/chillerlan/php-qrcode/pull/49
+ *
+ * @filesource QRFpdf.php
+ * @created 03.06.2020
+ * @package chillerlan\QRCode\Output
+ * @author Maximilian Kresse
+ *
+ * @license MIT
+ */
+
+namespace chillerlan\QRCode\Output;
+
+use chillerlan\QRCode\Data\QRMatrix;
+use chillerlan\QRCode\QRCodeException;
+use chillerlan\Settings\SettingsContainerInterface;
+use FPDF;
+
+use function array_values, class_exists, count, is_array;
+
+/**
+ * QRFpdf output module (requires fpdf)
+ *
+ * @see https://github.com/Setasign/FPDF
+ * @see http://www.fpdf.org/
+ */
+class QRFpdf extends QROutputAbstract{
+
+ public function __construct(SettingsContainerInterface $options, QRMatrix $matrix){
+
+ if(!class_exists(FPDF::class)){
+ // @codeCoverageIgnoreStart
+ throw new QRCodeException(
+ 'The QRFpdf output requires FPDF as dependency but the class "\FPDF" couldn\'t be found.'
+ );
+ // @codeCoverageIgnoreEnd
+ }
+
+ parent::__construct($options, $matrix);
+ }
+
+ /**
+ * @inheritDoc
+ */
+ protected function setModuleValues():void{
+
+ foreach($this::DEFAULT_MODULE_VALUES as $M_TYPE => $defaultValue){
+ $v = $this->options->moduleValues[$M_TYPE] ?? null;
+
+ if(!is_array($v) || count($v) < 3){
+ $this->moduleValues[$M_TYPE] = $defaultValue
+ ? [0, 0, 0]
+ : [255, 255, 255];
+ }
+ else{
+ $this->moduleValues[$M_TYPE] = array_values($v);
+ }
+
+ }
+
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @return string|\FPDF
+ */
+ public function dump(string $file = null){
+ $file = $file ?? $this->options->cachefile;
+
+ $fpdf = new FPDF('P', $this->options->fpdfMeasureUnit, [$this->length, $this->length]);
+ $fpdf->AddPage();
+
+ $prevColor = null;
+
+ foreach($this->matrix->matrix() as $y => $row){
+
+ foreach($row as $x => $M_TYPE){
+ /** @var int $M_TYPE */
+ $color = $this->moduleValues[$M_TYPE];
+
+ if($prevColor === null || $prevColor !== $color){
+ $fpdf->SetFillColor(...$color);
+ $prevColor = $color;
+ }
+
+ $fpdf->Rect($x * $this->scale, $y * $this->scale, 1 * $this->scale, 1 * $this->scale, 'F');
+ }
+
+ }
+
+ if($this->options->returnResource){
+ return $fpdf;
+ }
+
+ $pdfData = $fpdf->Output('S');
+
+ if($file !== null){
+ $this->saveToFile($pdfData, $file);
+ }
+
+ if($this->options->imageBase64){
+ $pdfData = sprintf('data:application/pdf;base64,%s', base64_encode($pdfData));
+ }
+
+ return $pdfData;
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/src/Output/QRImage.php b/vendor/chillerlan/php-qrcode/src/Output/QRImage.php
new file mode 100644
index 000000000..598948c94
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/src/Output/QRImage.php
@@ -0,0 +1,208 @@
+<?php
+/**
+ * Class QRImage
+ *
+ * @filesource QRImage.php
+ * @created 05.12.2015
+ * @package chillerlan\QRCode\Output
+ * @author Smiley <[email protected]>
+ * @copyright 2015 Smiley
+ * @license MIT
+ *
+ * @noinspection PhpComposerExtensionStubsInspection
+ */
+
+namespace chillerlan\QRCode\Output;
+
+use chillerlan\QRCode\Data\QRMatrix;
+use chillerlan\QRCode\{QRCode, QRCodeException};
+use chillerlan\Settings\SettingsContainerInterface;
+use Exception;
+
+use function array_values, base64_encode, call_user_func, count, imagecolorallocate, imagecolortransparent,
+ imagecreatetruecolor, imagedestroy, imagefilledrectangle, imagegif, imagejpeg, imagepng, in_array,
+ is_array, ob_end_clean, ob_get_contents, ob_start, range, sprintf;
+
+/**
+ * Converts the matrix into GD images, raw or base64 output
+ * requires ext-gd
+ * @link http://php.net/manual/book.image.php
+ */
+class QRImage extends QROutputAbstract{
+
+ protected const TRANSPARENCY_TYPES = [
+ QRCode::OUTPUT_IMAGE_PNG,
+ QRCode::OUTPUT_IMAGE_GIF,
+ ];
+
+ /**
+ * @var string
+ */
+ protected $defaultMode = QRCode::OUTPUT_IMAGE_PNG;
+
+ /**
+ * @see imagecreatetruecolor()
+ * @var resource
+ */
+ protected $image;
+
+ /**
+ * @inheritDoc
+ *
+ * @throws \chillerlan\QRCode\QRCodeException
+ */
+ public function __construct(SettingsContainerInterface $options, QRMatrix $matrix){
+
+ if(!extension_loaded('gd')){
+ throw new QRCodeException('ext-gd not loaded'); // @codeCoverageIgnore
+ }
+
+ parent::__construct($options, $matrix);
+ }
+
+ /**
+ * @inheritDoc
+ */
+ protected function setModuleValues():void{
+
+ foreach($this::DEFAULT_MODULE_VALUES as $M_TYPE => $defaultValue){
+ $v = $this->options->moduleValues[$M_TYPE] ?? null;
+
+ if(!is_array($v) || count($v) < 3){
+ $this->moduleValues[$M_TYPE] = $defaultValue
+ ? [0, 0, 0]
+ : [255, 255, 255];
+ }
+ else{
+ $this->moduleValues[$M_TYPE] = array_values($v);
+ }
+
+ }
+
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @return string|resource
+ */
+ public function dump(string $file = null){
+ $this->image = imagecreatetruecolor($this->length, $this->length);
+
+ // avoid: Indirect modification of overloaded property $imageTransparencyBG has no effect
+ // https://stackoverflow.com/a/10455217
+ $tbg = $this->options->imageTransparencyBG;
+ $background = imagecolorallocate($this->image, ...$tbg);
+
+ if((bool)$this->options->imageTransparent && in_array($this->options->outputType, $this::TRANSPARENCY_TYPES, true)){
+ imagecolortransparent($this->image, $background);
+ }
+
+ imagefilledrectangle($this->image, 0, 0, $this->length, $this->length, $background);
+
+ foreach($this->matrix->matrix() as $y => $row){
+ foreach($row as $x => $M_TYPE){
+ $this->setPixel($x, $y, $this->moduleValues[$M_TYPE]);
+ }
+ }
+
+ if($this->options->returnResource){
+ return $this->image;
+ }
+
+ $imageData = $this->dumpImage($file);
+
+ if($this->options->imageBase64){
+ $imageData = sprintf('data:image/%s;base64,%s', $this->options->outputType, base64_encode($imageData));
+ }
+
+ return $imageData;
+ }
+
+ /**
+ * @param int $x
+ * @param int $y
+ * @param array $rgb
+ *
+ * @return void
+ */
+ protected function setPixel(int $x, int $y, array $rgb):void{
+ imagefilledrectangle(
+ $this->image,
+ $x * $this->scale,
+ $y * $this->scale,
+ ($x + 1) * $this->scale,
+ ($y + 1) * $this->scale,
+ imagecolorallocate($this->image, ...$rgb)
+ );
+ }
+
+ /**
+ * @param string|null $file
+ *
+ * @return string
+
+ * @throws \chillerlan\QRCode\Output\QRCodeOutputException
+ */
+ protected function dumpImage(string $file = null):string{
+ $file = $file ?? $this->options->cachefile;
+
+ ob_start();
+
+ try{
+ call_user_func([$this, $this->outputMode ?? $this->defaultMode]);
+ }
+ // not going to cover edge cases
+ // @codeCoverageIgnoreStart
+ catch(Exception $e){
+ throw new QRCodeOutputException($e->getMessage());
+ }
+ // @codeCoverageIgnoreEnd
+
+ $imageData = ob_get_contents();
+ imagedestroy($this->image);
+
+ ob_end_clean();
+
+ if($file !== null){
+ $this->saveToFile($imageData, $file);
+ }
+
+ return $imageData;
+ }
+
+ /**
+ * @return void
+ */
+ protected function png():void{
+ imagepng(
+ $this->image,
+ null,
+ in_array($this->options->pngCompression, range(-1, 9), true)
+ ? $this->options->pngCompression
+ : -1
+ );
+ }
+
+ /**
+ * Jiff - like... JitHub!
+ * @return void
+ */
+ protected function gif():void{
+ imagegif($this->image);
+ }
+
+ /**
+ * @return void
+ */
+ protected function jpg():void{
+ imagejpeg(
+ $this->image,
+ null,
+ in_array($this->options->jpegQuality, range(0, 100), true)
+ ? $this->options->jpegQuality
+ : 85
+ );
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/src/Output/QRImagick.php b/vendor/chillerlan/php-qrcode/src/Output/QRImagick.php
new file mode 100644
index 000000000..03886cf3b
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/src/Output/QRImagick.php
@@ -0,0 +1,123 @@
+<?php
+/**
+ * Class QRImagick
+ *
+ * @filesource QRImagick.php
+ * @created 04.07.2018
+ * @package chillerlan\QRCode\Output
+ * @author smiley <[email protected]>
+ * @copyright 2018 smiley
+ * @license MIT
+ *
+ * @noinspection PhpComposerExtensionStubsInspection
+ */
+
+namespace chillerlan\QRCode\Output;
+
+use chillerlan\QRCode\Data\QRMatrix;
+use chillerlan\QRCode\QRCodeException;
+use chillerlan\Settings\SettingsContainerInterface;
+use Imagick, ImagickDraw, ImagickPixel;
+
+use function is_string;
+
+/**
+ * ImageMagick output module
+ * requires ext-imagick
+ * @link http://php.net/manual/book.imagick.php
+ * @link http://phpimagick.com
+ */
+class QRImagick extends QROutputAbstract{
+
+ /**
+ * @var \Imagick
+ */
+ protected $imagick;
+
+ /**
+ * @inheritDoc
+ * @throws \chillerlan\QRCode\QRCodeException
+ */
+ public function __construct(SettingsContainerInterface $options, QRMatrix $matrix){
+
+ if(!extension_loaded('imagick')){
+ throw new QRCodeException('ext-imagick not loaded'); // @codeCoverageIgnore
+ }
+
+ parent::__construct($options, $matrix);
+ }
+
+ /**
+ * @inheritDoc
+ */
+ protected function setModuleValues():void{
+
+ foreach($this::DEFAULT_MODULE_VALUES as $type => $defaultValue){
+ $v = $this->options->moduleValues[$type] ?? null;
+
+ if(!is_string($v)){
+ $this->moduleValues[$type] = $defaultValue
+ ? new ImagickPixel($this->options->markupDark)
+ : new ImagickPixel($this->options->markupLight);
+ }
+ else{
+ $this->moduleValues[$type] = new ImagickPixel($v);
+ }
+ }
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @return string|\Imagick
+ */
+ public function dump(string $file = null){
+ $file = $file ?? $this->options->cachefile;
+ $this->imagick = new Imagick;
+
+ $this->imagick->newImage(
+ $this->length,
+ $this->length,
+ new ImagickPixel($this->options->imagickBG ?? 'transparent'),
+ $this->options->imagickFormat
+ );
+
+ $this->drawImage();
+
+ if($this->options->returnResource){
+ return $this->imagick;
+ }
+
+ $imageData = $this->imagick->getImageBlob();
+
+ if($file !== null){
+ $this->saveToFile($imageData, $file);
+ }
+
+ return $imageData;
+ }
+
+ /**
+ * @return void
+ */
+ protected function drawImage():void{
+ $draw = new ImagickDraw;
+
+ foreach($this->matrix->matrix() as $y => $row){
+ foreach($row as $x => $M_TYPE){
+ $draw->setStrokeColor($this->moduleValues[$M_TYPE]);
+ $draw->setFillColor($this->moduleValues[$M_TYPE]);
+ $draw->rectangle(
+ $x * $this->scale,
+ $y * $this->scale,
+ ($x + 1) * $this->scale,
+ ($y + 1) * $this->scale
+ );
+
+ }
+ }
+
+ $this->imagick->drawImage($draw);
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/src/Output/QRMarkup.php b/vendor/chillerlan/php-qrcode/src/Output/QRMarkup.php
new file mode 100644
index 000000000..15559dae0
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/src/Output/QRMarkup.php
@@ -0,0 +1,151 @@
+<?php
+/**
+ * Class QRMarkup
+ *
+ * @filesource QRMarkup.php
+ * @created 17.12.2016
+ * @package chillerlan\QRCode\Output
+ * @author Smiley <[email protected]>
+ * @copyright 2016 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCode\Output;
+
+use chillerlan\QRCode\QRCode;
+
+use function is_string, sprintf, strip_tags, trim;
+
+/**
+ * Converts the matrix into markup types: HTML, SVG, ...
+ */
+class QRMarkup extends QROutputAbstract{
+
+ /**
+ * @var string
+ */
+ protected $defaultMode = QRCode::OUTPUT_MARKUP_SVG;
+
+ /**
+ * @see \sprintf()
+ *
+ * @var string
+ */
+ protected $svgHeader = '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" class="qr-svg %1$s" style="width: 100%%; height: auto;" viewBox="0 0 %2$d %2$d">';
+
+ /**
+ * @inheritDoc
+ */
+ protected function setModuleValues():void{
+
+ foreach($this::DEFAULT_MODULE_VALUES as $M_TYPE => $defaultValue){
+ $v = $this->options->moduleValues[$M_TYPE] ?? null;
+
+ if(!is_string($v)){
+ $this->moduleValues[$M_TYPE] = $defaultValue
+ ? $this->options->markupDark
+ : $this->options->markupLight;
+ }
+ else{
+ $this->moduleValues[$M_TYPE] = trim(strip_tags($v), '\'"');
+ }
+
+ }
+
+ }
+
+ /**
+ * @return string
+ */
+ protected function html():string{
+ $html = '<div class="'.$this->options->cssClass.'">'.$this->options->eol;
+
+ foreach($this->matrix->matrix() as $row){
+ $html .= '<div>';
+
+ foreach($row as $M_TYPE){
+ $html .= '<span style="background: '.$this->moduleValues[$M_TYPE].';"></span>';
+ }
+
+ $html .= '</div>'.$this->options->eol;
+ }
+
+ $html .= '</div>'.$this->options->eol;
+
+ if($this->options->cachefile){
+ return '<!DOCTYPE html><head><meta charset="UTF-8"></head><body>'.$this->options->eol.$html.'</body>';
+ }
+
+ return $html;
+ }
+
+ /**
+ * @link https://github.com/codemasher/php-qrcode/pull/5
+ *
+ * @return string
+ */
+ protected function svg():string{
+ $matrix = $this->matrix->matrix();
+
+ $svg = sprintf($this->svgHeader, $this->options->cssClass, $this->options->svgViewBoxSize ?? $this->moduleCount)
+ .$this->options->eol
+ .'<defs>'.$this->options->svgDefs.'</defs>'
+ .$this->options->eol;
+
+ foreach($this->moduleValues as $M_TYPE => $value){
+ $path = '';
+
+ foreach($matrix as $y => $row){
+ //we'll combine active blocks within a single row as a lightweight compression technique
+ $start = null;
+ $count = 0;
+
+ foreach($row as $x => $module){
+
+ if($module === $M_TYPE){
+ $count++;
+
+ if($start === null){
+ $start = $x;
+ }
+
+ if(isset($row[$x + 1])){
+ continue;
+ }
+ }
+
+ if($count > 0){
+ $len = $count;
+ $path .= sprintf('M%s %s h%s v1 h-%sZ ', $start, $y, $len, $len);
+
+ // reset count
+ $count = 0;
+ $start = null;
+ }
+
+ }
+
+ }
+
+ if(!empty($path)){
+ $svg .= sprintf('<path class="qr-%s %s" stroke="transparent" fill="%s" fill-opacity="%s" d="%s" />', $M_TYPE, $this->options->cssClass, $value, $this->options->svgOpacity, $path);
+ }
+
+ }
+
+ // close svg
+ $svg .= '</svg>'.$this->options->eol;
+
+ // if saving to file, append the correct headers
+ if($this->options->cachefile){
+ return '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">'.$this->options->eol.$svg;
+ }
+
+ if($this->options->imageBase64){
+ $svg = sprintf('data:image/svg+xml;base64,%s', base64_encode($svg));
+ }
+
+ return $svg;
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/src/Output/QROutputAbstract.php b/vendor/chillerlan/php-qrcode/src/Output/QROutputAbstract.php
new file mode 100644
index 000000000..4ec47de24
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/src/Output/QROutputAbstract.php
@@ -0,0 +1,130 @@
+<?php
+/**
+ * Class QROutputAbstract
+ *
+ * @filesource QROutputAbstract.php
+ * @created 09.12.2015
+ * @package chillerlan\QRCode\Output
+ * @author Smiley <[email protected]>
+ * @copyright 2015 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCode\Output;
+
+use chillerlan\QRCode\{Data\QRMatrix, QRCode};
+use chillerlan\Settings\SettingsContainerInterface;
+
+use function call_user_func, dirname, file_put_contents, get_called_class, in_array, is_writable, sprintf;
+
+/**
+ * common output abstract
+ */
+abstract class QROutputAbstract implements QROutputInterface{
+
+ /**
+ * @var int
+ */
+ protected $moduleCount;
+
+ /**
+ * @param \chillerlan\QRCode\Data\QRMatrix $matrix
+ */
+ protected $matrix;
+
+ /**
+ * @var \chillerlan\QRCode\QROptions
+ */
+ protected $options;
+
+ /**
+ * @var string
+ */
+ protected $outputMode;
+
+ /**
+ * @var string;
+ */
+ protected $defaultMode;
+
+ /**
+ * @var int
+ */
+ protected $scale;
+
+ /**
+ * @var int
+ */
+ protected $length;
+
+ /**
+ * @var array
+ */
+ protected $moduleValues;
+
+ /**
+ * QROutputAbstract constructor.
+ *
+ * @param \chillerlan\Settings\SettingsContainerInterface $options
+ * @param \chillerlan\QRCode\Data\QRMatrix $matrix
+ */
+ public function __construct(SettingsContainerInterface $options, QRMatrix $matrix){
+ $this->options = $options;
+ $this->matrix = $matrix;
+ $this->moduleCount = $this->matrix->size();
+ $this->scale = $this->options->scale;
+ $this->length = $this->moduleCount * $this->scale;
+
+ $class = get_called_class();
+
+ if(isset(QRCode::OUTPUT_MODES[$class]) && in_array($this->options->outputType, QRCode::OUTPUT_MODES[$class])){
+ $this->outputMode = $this->options->outputType;
+ }
+
+ $this->setModuleValues();
+ }
+
+ /**
+ * Sets the initial module values (clean-up & defaults)
+ *
+ * @return void
+ */
+ abstract protected function setModuleValues():void;
+
+ /**
+ * saves the qr data to a file
+ *
+ * @see file_put_contents()
+ * @see \chillerlan\QRCode\QROptions::cachefile
+ *
+ * @param string $data
+ * @param string $file
+ *
+ * @return bool
+ * @throws \chillerlan\QRCode\Output\QRCodeOutputException
+ */
+ protected function saveToFile(string $data, string $file):bool{
+
+ if(!is_writable(dirname($file))){
+ throw new QRCodeOutputException(sprintf('Could not write data to cache file: %s', $file));
+ }
+
+ return (bool)file_put_contents($file, $data);
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function dump(string $file = null){
+ // call the built-in output method
+ $data = call_user_func([$this, $this->outputMode ?? $this->defaultMode]);
+ $file = $file ?? $this->options->cachefile;
+
+ if($file !== null){
+ $this->saveToFile($data, $file);
+ }
+
+ return $data;
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/src/Output/QROutputInterface.php b/vendor/chillerlan/php-qrcode/src/Output/QROutputInterface.php
new file mode 100644
index 000000000..d9149b0f7
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/src/Output/QROutputInterface.php
@@ -0,0 +1,55 @@
+<?php
+/**
+ * Interface QROutputInterface,
+ *
+ * @filesource QROutputInterface.php
+ * @created 02.12.2015
+ * @package chillerlan\QRCode\Output
+ * @author Smiley <[email protected]>
+ * @copyright 2015 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCode\Output;
+
+use chillerlan\QRCode\Data\QRMatrix;
+
+/**
+ * Converts the data matrix into readable output
+ */
+interface QROutputInterface{
+
+ const DEFAULT_MODULE_VALUES = [
+ // light
+ QRMatrix::M_DATA => false, // 4
+ QRMatrix::M_FINDER => false, // 6
+ QRMatrix::M_SEPARATOR => false, // 8
+ QRMatrix::M_ALIGNMENT => false, // 10
+ QRMatrix::M_TIMING => false, // 12
+ QRMatrix::M_FORMAT => false, // 14
+ QRMatrix::M_VERSION => false, // 16
+ QRMatrix::M_QUIETZONE => false, // 18
+ QRMatrix::M_LOGO => false, // 20
+ QRMatrix::M_TEST => false, // 255
+ // dark
+ QRMatrix::M_DARKMODULE << 8 => true, // 512
+ QRMatrix::M_DATA << 8 => true, // 1024
+ QRMatrix::M_FINDER << 8 => true, // 1536
+ QRMatrix::M_ALIGNMENT << 8 => true, // 2560
+ QRMatrix::M_TIMING << 8 => true, // 3072
+ QRMatrix::M_FORMAT << 8 => true, // 3584
+ QRMatrix::M_VERSION << 8 => true, // 4096
+ QRMatrix::M_FINDER_DOT << 8 => true, // 5632
+ QRMatrix::M_TEST << 8 => true, // 65280
+ ];
+
+ /**
+ * generates the output, optionally dumps it to a file, and returns it
+ *
+ * @param string|null $file
+ *
+ * @return mixed
+ */
+ public function dump(string $file = null);
+
+}
diff --git a/vendor/chillerlan/php-qrcode/src/Output/QRString.php b/vendor/chillerlan/php-qrcode/src/Output/QRString.php
new file mode 100644
index 000000000..ba8d83675
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/src/Output/QRString.php
@@ -0,0 +1,76 @@
+<?php
+/**
+ * Class QRString
+ *
+ * @filesource QRString.php
+ * @created 05.12.2015
+ * @package chillerlan\QRCode\Output
+ * @author Smiley <[email protected]>
+ * @copyright 2015 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCode\Output;
+
+use chillerlan\QRCode\QRCode;
+
+use function implode, is_string, json_encode;
+
+/**
+ * Converts the matrix data into string types
+ */
+class QRString extends QROutputAbstract{
+
+ /**
+ * @var string
+ */
+ protected $defaultMode = QRCode::OUTPUT_STRING_TEXT;
+
+ /**
+ * @inheritDoc
+ */
+ protected function setModuleValues():void{
+
+ foreach($this::DEFAULT_MODULE_VALUES as $M_TYPE => $defaultValue){
+ $v = $this->options->moduleValues[$M_TYPE] ?? null;
+
+ if(!is_string($v)){
+ $this->moduleValues[$M_TYPE] = $defaultValue
+ ? $this->options->textDark
+ : $this->options->textLight;
+ }
+ else{
+ $this->moduleValues[$M_TYPE] = $v;
+ }
+
+ }
+
+ }
+
+ /**
+ * @return string
+ */
+ protected function text():string{
+ $str = [];
+
+ foreach($this->matrix->matrix() as $row){
+ $r = [];
+
+ foreach($row as $M_TYPE){
+ $r[] = $this->moduleValues[$M_TYPE];
+ }
+
+ $str[] = implode('', $r);
+ }
+
+ return implode($this->options->eol, $str);
+ }
+
+ /**
+ * @return string
+ */
+ protected function json():string{
+ return json_encode($this->matrix->matrix());
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/src/QRCode.php b/vendor/chillerlan/php-qrcode/src/QRCode.php
new file mode 100644
index 000000000..91f7aa0eb
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/src/QRCode.php
@@ -0,0 +1,310 @@
+<?php
+/**
+ * Class QRCode
+ *
+ * @filesource QRCode.php
+ * @created 26.11.2015
+ * @package chillerlan\QRCode
+ * @author Smiley <[email protected]>
+ * @copyright 2015 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCode;
+
+use chillerlan\QRCode\Data\{
+ MaskPatternTester, QRCodeDataException, QRDataInterface, QRMatrix
+};
+use chillerlan\QRCode\Output\{
+ QRCodeOutputException, QRFpdf, QRImage, QRImagick, QRMarkup, QROutputInterface, QRString
+};
+use chillerlan\Settings\SettingsContainerInterface;
+
+use function array_search, call_user_func_array, class_exists, in_array, min, ord, strlen;
+
+/**
+ * Turns a text string into a Model 2 QR Code
+ *
+ * @link https://github.com/kazuhikoarase/qrcode-generator/tree/master/php
+ * @link http://www.qrcode.com/en/codes/model12.html
+ * @link http://www.thonky.com/qr-code-tutorial/
+ */
+class QRCode{
+
+ /**
+ * API constants
+ */
+ public const OUTPUT_MARKUP_HTML = 'html';
+ public const OUTPUT_MARKUP_SVG = 'svg';
+ public const OUTPUT_IMAGE_PNG = 'png';
+ public const OUTPUT_IMAGE_JPG = 'jpg';
+ public const OUTPUT_IMAGE_GIF = 'gif';
+ public const OUTPUT_STRING_JSON = 'json';
+ public const OUTPUT_STRING_TEXT = 'text';
+ public const OUTPUT_IMAGICK = 'imagick';
+ public const OUTPUT_FPDF = 'fpdf';
+ public const OUTPUT_CUSTOM = 'custom';
+
+ public const VERSION_AUTO = -1;
+ public const MASK_PATTERN_AUTO = -1;
+
+ public const ECC_L = 0b01; // 7%.
+ public const ECC_M = 0b00; // 15%.
+ public const ECC_Q = 0b11; // 25%.
+ public const ECC_H = 0b10; // 30%.
+
+ public const DATA_NUMBER = 0b0001;
+ public const DATA_ALPHANUM = 0b0010;
+ public const DATA_BYTE = 0b0100;
+ public const DATA_KANJI = 0b1000;
+
+ public const ECC_MODES = [
+ self::ECC_L => 0,
+ self::ECC_M => 1,
+ self::ECC_Q => 2,
+ self::ECC_H => 3,
+ ];
+
+ public const DATA_MODES = [
+ self::DATA_NUMBER => 0,
+ self::DATA_ALPHANUM => 1,
+ self::DATA_BYTE => 2,
+ self::DATA_KANJI => 3,
+ ];
+
+ public const OUTPUT_MODES = [
+ QRMarkup::class => [
+ self::OUTPUT_MARKUP_SVG,
+ self::OUTPUT_MARKUP_HTML,
+ ],
+ QRImage::class => [
+ self::OUTPUT_IMAGE_PNG,
+ self::OUTPUT_IMAGE_GIF,
+ self::OUTPUT_IMAGE_JPG,
+ ],
+ QRString::class => [
+ self::OUTPUT_STRING_JSON,
+ self::OUTPUT_STRING_TEXT,
+ ],
+ QRImagick::class => [
+ self::OUTPUT_IMAGICK,
+ ],
+ QRFpdf::class => [
+ self::OUTPUT_FPDF
+ ]
+ ];
+
+ /**
+ * @var \chillerlan\QRCode\QROptions|\chillerlan\Settings\SettingsContainerInterface
+ */
+ protected $options;
+
+ /**
+ * @var \chillerlan\QRCode\Data\QRDataInterface
+ */
+ protected $dataInterface;
+
+ /**
+ * QRCode constructor.
+ *
+ * @param \chillerlan\Settings\SettingsContainerInterface|null $options
+ */
+ public function __construct(SettingsContainerInterface $options = null){
+ $this->options = $options ?? new QROptions;
+ }
+
+ /**
+ * Renders a QR Code for the given $data and QROptions
+ *
+ * @param string $data
+ * @param string|null $file
+ *
+ * @return mixed
+ */
+ public function render(string $data, string $file = null){
+ return $this->initOutputInterface($data)->dump($file);
+ }
+
+ /**
+ * Returns a QRMatrix object for the given $data and current QROptions
+ *
+ * @param string $data
+ *
+ * @return \chillerlan\QRCode\Data\QRMatrix
+ * @throws \chillerlan\QRCode\Data\QRCodeDataException
+ */
+ public function getMatrix(string $data):QRMatrix{
+
+ if(empty($data)){
+ throw new QRCodeDataException('QRCode::getMatrix() No data given.');
+ }
+
+ $this->dataInterface = $this->initDataInterface($data);
+
+ $maskPattern = $this->options->maskPattern === $this::MASK_PATTERN_AUTO
+ ? $this->getBestMaskPattern()
+ : $this->options->maskPattern;
+
+ $matrix = $this->dataInterface->initMatrix($maskPattern);
+
+ if((bool)$this->options->addQuietzone){
+ $matrix->setQuietZone($this->options->quietzoneSize);
+ }
+
+ return $matrix;
+ }
+
+ /**
+ * shoves a QRMatrix through the MaskPatternTester to find the lowest penalty mask pattern
+ *
+ * @see \chillerlan\QRCode\Data\MaskPatternTester
+ *
+ * @return int
+ */
+ protected function getBestMaskPattern():int{
+ $penalties = [];
+
+ for($pattern = 0; $pattern < 8; $pattern++){
+ $tester = new MaskPatternTester($this->dataInterface->initMatrix($pattern, true));
+
+ $penalties[$pattern] = $tester->testPattern();
+ }
+
+ return array_search(min($penalties), $penalties, true);
+ }
+
+ /**
+ * returns a fresh QRDataInterface for the given $data
+ *
+ * @param string $data
+ *
+ * @return \chillerlan\QRCode\Data\QRDataInterface
+ * @throws \chillerlan\QRCode\Data\QRCodeDataException
+ */
+ public function initDataInterface(string $data):QRDataInterface{
+ $dataModes = ['Number', 'AlphaNum', 'Kanji', 'Byte'];
+ $dataNamespace = __NAMESPACE__.'\\Data\\';
+
+ // allow forcing the data mode
+ // see https://github.com/chillerlan/php-qrcode/issues/39
+ if(in_array($this->options->dataMode, $dataModes, true)){
+ $dataInterface = $dataNamespace.$this->options->dataMode;
+
+ return new $dataInterface($this->options, $data);
+ }
+
+ foreach($dataModes as $mode){
+ $dataInterface = $dataNamespace.$mode;
+
+ if(call_user_func_array([$this, 'is'.$mode], [$data]) && class_exists($dataInterface)){
+ return new $dataInterface($this->options, $data);
+ }
+
+ }
+
+ throw new QRCodeDataException('invalid data type'); // @codeCoverageIgnore
+ }
+
+ /**
+ * returns a fresh (built-in) QROutputInterface
+ *
+ * @param string $data
+ *
+ * @return \chillerlan\QRCode\Output\QROutputInterface
+ * @throws \chillerlan\QRCode\Output\QRCodeOutputException
+ */
+ protected function initOutputInterface(string $data):QROutputInterface{
+
+ if($this->options->outputType === $this::OUTPUT_CUSTOM && class_exists($this->options->outputInterface)){
+ return new $this->options->outputInterface($this->options, $this->getMatrix($data));
+ }
+
+ foreach($this::OUTPUT_MODES as $outputInterface => $modes){
+
+ if(in_array($this->options->outputType, $modes, true) && class_exists($outputInterface)){
+ return new $outputInterface($this->options, $this->getMatrix($data));
+ }
+
+ }
+
+ throw new QRCodeOutputException('invalid output type');
+ }
+
+ /**
+ * checks if a string qualifies as numeric
+ *
+ * @param string $string
+ *
+ * @return bool
+ */
+ public function isNumber(string $string):bool{
+ return $this->checkString($string, QRDataInterface::NUMBER_CHAR_MAP);
+ }
+
+ /**
+ * checks if a string qualifies as alphanumeric
+ *
+ * @param string $string
+ *
+ * @return bool
+ */
+ public function isAlphaNum(string $string):bool{
+ return $this->checkString($string, QRDataInterface::ALPHANUM_CHAR_MAP);
+ }
+
+ /**
+ * checks is a given $string matches the characters of a given $charmap, returns false on the first invalid occurence.
+ *
+ * @param string $string
+ * @param array $charmap
+ *
+ * @return bool
+ */
+ protected function checkString(string $string, array $charmap):bool{
+ $len = strlen($string);
+
+ for($i = 0; $i < $len; $i++){
+ if(!in_array($string[$i], $charmap, true)){
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * checks if a string qualifies as Kanji
+ *
+ * @param string $string
+ *
+ * @return bool
+ */
+ public function isKanji(string $string):bool{
+ $i = 0;
+ $len = strlen($string);
+
+ while($i + 1 < $len){
+ $c = ((0xff & ord($string[$i])) << 8) | (0xff & ord($string[$i + 1]));
+
+ if(!($c >= 0x8140 && $c <= 0x9FFC) && !($c >= 0xE040 && $c <= 0xEBBF)){
+ return false;
+ }
+
+ $i += 2;
+ }
+
+ return $i >= $len;
+ }
+
+ /**
+ * a dummy
+ *
+ * @param $data
+ *
+ * @return bool
+ */
+ protected function isByte(string $data):bool{
+ return !empty($data);
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/src/QRCodeException.php b/vendor/chillerlan/php-qrcode/src/QRCodeException.php
new file mode 100644
index 000000000..68af380ff
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/src/QRCodeException.php
@@ -0,0 +1,15 @@
+<?php
+/**
+ * Class QRCodeException
+ *
+ * @filesource QRCodeException.php
+ * @created 27.11.2015
+ * @package chillerlan\QRCode
+ * @author Smiley <[email protected]>
+ * @copyright 2015 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCode;
+
+class QRCodeException extends \Exception{}
diff --git a/vendor/chillerlan/php-qrcode/src/QROptions.php b/vendor/chillerlan/php-qrcode/src/QROptions.php
new file mode 100644
index 000000000..778ae0407
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/src/QROptions.php
@@ -0,0 +1,61 @@
+<?php
+/**
+ * Class QROptions
+ *
+ * @filesource QROptions.php
+ * @created 08.12.2015
+ * @package chillerlan\QRCode
+ * @author Smiley <[email protected]>
+ * @copyright 2015 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCode;
+
+use chillerlan\Settings\SettingsContainerAbstract;
+
+/**
+ * @property int $version
+ * @property int $versionMin
+ * @property int $versionMax
+ * @property int $eccLevel
+ * @property int $maskPattern
+ * @property bool $addQuietzone
+ * @property bool $quietzoneSize
+ *
+ * @property string $dataMode
+ * @property string $outputType
+ * @property string $outputInterface
+ * @property string $cachefile
+ *
+ * @property string $eol
+ * @property int $scale
+ *
+ * @property string $cssClass
+ * @property string $svgOpacity
+ * @property string $svgDefs
+ * @property int $svgViewBoxSize
+ *
+ * @property string $textDark
+ * @property string $textLight
+ *
+ * @property string $markupDark
+ * @property string $markupLight
+ *
+ * @property bool $returnResource
+ * @property bool $imageBase64
+ * @property bool $imageTransparent
+ * @property array $imageTransparencyBG
+ * @property int $pngCompression
+ * @property int $jpegQuality
+ *
+ * @property string $imagickFormat
+ * @property string $imagickBG
+ *
+ * @property string $fpdfMeasureUnit
+ *
+ * @property array $moduleValues
+ */
+class QROptions extends SettingsContainerAbstract{
+ use QROptionsTrait;
+}
diff --git a/vendor/chillerlan/php-qrcode/src/QROptionsTrait.php b/vendor/chillerlan/php-qrcode/src/QROptionsTrait.php
new file mode 100644
index 000000000..45d4cb415
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/src/QROptionsTrait.php
@@ -0,0 +1,408 @@
+<?php
+/**
+ * Trait QROptionsTrait
+ *
+ * @filesource QROptionsTrait.php
+ * @created 10.03.2018
+ * @package chillerlan\QRCode
+ * @author smiley <[email protected]>
+ * @copyright 2018 smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCode;
+
+use function array_values, count, in_array, is_array, is_numeric, max, min, sprintf, strtolower;
+
+trait QROptionsTrait{
+
+ /**
+ * QR Code version number
+ *
+ * [1 ... 40] or QRCode::VERSION_AUTO
+ *
+ * @var int
+ */
+ protected $version = QRCode::VERSION_AUTO;
+
+ /**
+ * Minimum QR version (if $version = QRCode::VERSION_AUTO)
+ *
+ * @var int
+ */
+ protected $versionMin = 1;
+
+ /**
+ * Maximum QR version
+ *
+ * @var int
+ */
+ protected $versionMax = 40;
+
+ /**
+ * Error correct level
+ *
+ * QRCode::ECC_X where X is
+ * L => 7%
+ * M => 15%
+ * Q => 25%
+ * H => 30%
+ *
+ * @var int
+ */
+ protected $eccLevel = QRCode::ECC_L;
+
+ /**
+ * Mask Pattern to use
+ *
+ * [0...7] or QRCode::MASK_PATTERN_AUTO
+ *
+ * @var int
+ */
+ protected $maskPattern = QRCode::MASK_PATTERN_AUTO;
+
+ /**
+ * Add a "quiet zone" (margin) according to the QR code spec
+ *
+ * @var bool
+ */
+ protected $addQuietzone = true;
+
+ /**
+ * Size of the quiet zone
+ *
+ * internally clamped to [0 ... $moduleCount / 2], defaults to 4 modules
+ *
+ * @var int
+ */
+ protected $quietzoneSize = 4;
+
+ /**
+ * Use this to circumvent the data mode detection and force the usage of the given mode.
+ * valid modes are: Number, AlphaNum, Kanji, Byte
+ *
+ * @see https://github.com/chillerlan/php-qrcode/issues/39
+ *
+ * @var string|null
+ */
+ protected $dataMode = null;
+
+ /**
+ * QRCode::OUTPUT_MARKUP_XXXX where XXXX = HTML, SVG
+ * QRCode::OUTPUT_IMAGE_XXX where XXX = PNG, GIF, JPG
+ * QRCode::OUTPUT_STRING_XXXX where XXXX = TEXT, JSON
+ * QRCode::OUTPUT_CUSTOM
+ *
+ * @var string
+ */
+ protected $outputType = QRCode::OUTPUT_IMAGE_PNG;
+
+ /**
+ * the FQCN of the custom QROutputInterface if $outputType is set to QRCode::OUTPUT_CUSTOM
+ *
+ * @var string|null
+ */
+ protected $outputInterface = null;
+
+ /**
+ * /path/to/cache.file
+ *
+ * @var string|null
+ */
+ protected $cachefile = null;
+
+ /**
+ * newline string [HTML, SVG, TEXT]
+ *
+ * @var string
+ */
+ protected $eol = PHP_EOL;
+
+ /**
+ * size of a QR code pixel [SVG, IMAGE_*]
+ * HTML -> via CSS
+ *
+ * @var int
+ */
+ protected $scale = 5;
+
+ /**
+ * a common css class
+ *
+ * @var string
+ */
+ protected $cssClass = '';
+
+ /**
+ * SVG opacity
+ *
+ * @var float
+ */
+ protected $svgOpacity = 1.0;
+
+ /**
+ * anything between <defs>
+ *
+ * @see https://developer.mozilla.org/docs/Web/SVG/Element/defs
+ *
+ * @var string
+ */
+ protected $svgDefs = '<style>rect{shape-rendering:crispEdges}</style>';
+
+ /**
+ * SVG viewBox size. a single integer number which defines width/height of the viewBox attribute.
+ *
+ * viewBox="0 0 x x"
+ *
+ * @see https://css-tricks.com/scale-svg/#article-header-id-3
+ *
+ * @var int|null
+ */
+ protected $svgViewBoxSize = null;
+
+ /**
+ * string substitute for dark
+ *
+ * @var string
+ */
+ protected $textDark = '🔴';
+
+ /**
+ * string substitute for light
+ *
+ * @var string
+ */
+ protected $textLight = '⭕';
+
+ /**
+ * markup substitute for dark (CSS value)
+ *
+ * @var string
+ */
+ protected $markupDark = '#000';
+
+ /**
+ * markup substitute for light (CSS value)
+ *
+ * @var string
+ */
+ protected $markupLight = '#fff';
+
+ /**
+ * Return the image resource instead of a render if applicable.
+ * This option overrides other output options, such as $cachefile and $imageBase64.
+ *
+ * Supported by the following modules:
+ *
+ * - QRImage: resource
+ * - QRImagick: Imagick
+ * - QRFpdf: FPDF
+ *
+ * @see \chillerlan\QRCode\Output\QROutputInterface::dump()
+ *
+ * @var bool
+ */
+ protected $returnResource = false;
+
+ /**
+ * toggle base64 or raw image data
+ *
+ * @var bool
+ */
+ protected $imageBase64 = true;
+
+ /**
+ * toggle transparency, not supported by jpg
+ *
+ * @var bool
+ */
+ protected $imageTransparent = true;
+
+ /**
+ * @see imagecolortransparent()
+ *
+ * @var array [R, G, B]
+ */
+ protected $imageTransparencyBG = [255, 255, 255];
+
+ /**
+ * @see imagepng()
+ *
+ * @var int
+ */
+ protected $pngCompression = -1;
+
+ /**
+ * @see imagejpeg()
+ *
+ * @var int
+ */
+ protected $jpegQuality = 85;
+
+ /**
+ * Imagick output format
+ *
+ * @see Imagick::setType()
+ *
+ * @var string
+ */
+ protected $imagickFormat = 'png';
+
+ /**
+ * Imagick background color (defaults to "transparent")
+ *
+ * @see \ImagickPixel::__construct()
+ *
+ * @var string|null
+ */
+ protected $imagickBG = null;
+
+ /**
+ * Measurement unit for FPDF output: pt, mm, cm, in (defaults to "pt")
+ *
+ * @see \FPDF::__construct()
+ */
+ protected $fpdfMeasureUnit = 'pt';
+
+ /**
+ * Module values map
+ *
+ * HTML, IMAGICK: #ABCDEF, cssname, rgb(), rgba()...
+ * IMAGE: [63, 127, 255] // R, G, B
+ *
+ * @var array|null
+ */
+ protected $moduleValues = null;
+
+ /**
+ * clamp min/max version number
+ *
+ * @param int $versionMin
+ * @param int $versionMax
+ *
+ * @return void
+ */
+ protected function setMinMaxVersion(int $versionMin, int $versionMax):void{
+ $min = max(1, min(40, $versionMin));
+ $max = max(1, min(40, $versionMax));
+
+ $this->versionMin = min($min, $max);
+ $this->versionMax = max($min, $max);
+ }
+
+ /**
+ * sets the minimum version number
+ *
+ * @param int $version
+ *
+ * @return void
+ */
+ protected function set_versionMin(int $version):void{
+ $this->setMinMaxVersion($version, $this->versionMax);
+ }
+
+ /**
+ * sets the maximum version number
+ *
+ * @param int $version
+ *
+ * @return void
+ */
+ protected function set_versionMax(int $version):void{
+ $this->setMinMaxVersion($this->versionMin, $version);
+ }
+
+ /**
+ * sets the error correction level
+ *
+ * @param int $eccLevel
+ *
+ * @return void
+ * @throws \chillerlan\QRCode\QRCodeException
+ */
+ protected function set_eccLevel(int $eccLevel):void{
+
+ if(!isset(QRCode::ECC_MODES[$eccLevel])){
+ throw new QRCodeException(sprintf('Invalid error correct level: %s', $eccLevel));
+ }
+
+ $this->eccLevel = $eccLevel;
+ }
+
+ /**
+ * sets/clamps the mask pattern
+ *
+ * @param int $maskPattern
+ *
+ * @return void
+ */
+ protected function set_maskPattern(int $maskPattern):void{
+
+ if($maskPattern !== QRCode::MASK_PATTERN_AUTO){
+ $this->maskPattern = max(0, min(7, $maskPattern));
+ }
+
+ }
+
+ /**
+ * sets the transparency background color
+ *
+ * @param mixed $imageTransparencyBG
+ *
+ * @return void
+ * @throws \chillerlan\QRCode\QRCodeException
+ */
+ protected function set_imageTransparencyBG($imageTransparencyBG):void{
+
+ // invalid value - set to white as default
+ if(!is_array($imageTransparencyBG) || count($imageTransparencyBG) < 3){
+ $this->imageTransparencyBG = [255, 255, 255];
+
+ return;
+ }
+
+ foreach($imageTransparencyBG as $k => $v){
+
+ if(!is_numeric($v)){
+ throw new QRCodeException('Invalid RGB value.');
+ }
+
+ // clamp the values
+ $this->imageTransparencyBG[$k] = max(0, min(255, (int)$v));
+ }
+
+ // use the array values to not run into errors with the spread operator (...$arr)
+ $this->imageTransparencyBG = array_values($this->imageTransparencyBG);
+ }
+
+ /**
+ * sets/clamps the version number
+ *
+ * @param int $version
+ *
+ * @return void
+ */
+ protected function set_version(int $version):void{
+
+ if($version !== QRCode::VERSION_AUTO){
+ $this->version = max(1, min(40, $version));
+ }
+
+ }
+
+ /**
+ * sets the FPDF measurement unit
+ *
+ * @codeCoverageIgnore
+ */
+ protected function set_fpdfMeasureUnit(string $unit):void{
+ $unit = strtolower($unit);
+
+ if(in_array($unit, ['cm', 'in', 'mm', 'pt'], true)){
+ $this->fpdfMeasureUnit = $unit;
+ }
+
+ // @todo throw or ignore silently?
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/tests/Data/AlphaNumTest.php b/vendor/chillerlan/php-qrcode/tests/Data/AlphaNumTest.php
new file mode 100644
index 000000000..c29b1f639
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/tests/Data/AlphaNumTest.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * Class AlphaNumTest
+ *
+ * @filesource AlphaNumTest.php
+ * @created 24.11.2017
+ * @package chillerlan\QRCodeTest\Data
+ * @author Smiley <[email protected]>
+ * @copyright 2017 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCodeTest\Data;
+
+use chillerlan\QRCode\Data\{AlphaNum, QRCodeDataException};
+
+class AlphaNumTest extends DatainterfaceTestAbstract{
+
+ protected $FQCN = AlphaNum::class;
+ protected $testdata = '0 $%*+-./:';
+ protected $expected = [
+ 32, 80, 36, 212, 252, 15, 175, 251,
+ 176, 236, 17, 236, 17, 236, 17, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 112, 43, 9, 248, 200, 194, 75, 25,
+ 205, 173, 154, 68, 191, 16, 128,
+ 92, 112, 20, 198, 27
+ ];
+
+ public function testGetCharCodeException(){
+ $this->expectException(QRCodeDataException::class);
+ $this->expectExceptionMessage('illegal char: "#" [35]');
+
+ $this->dataInterface->setData('#');
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/tests/Data/ByteTest.php b/vendor/chillerlan/php-qrcode/tests/Data/ByteTest.php
new file mode 100644
index 000000000..cbfe1fab2
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/tests/Data/ByteTest.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Class ByteTest
+ *
+ * @filesource ByteTest.php
+ * @created 24.11.2017
+ * @package chillerlan\QRCodeTest\Data
+ * @author Smiley <[email protected]>
+ * @copyright 2017 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCodeTest\Data;
+
+use chillerlan\QRCode\Data\Byte;
+
+class ByteTest extends DatainterfaceTestAbstract{
+
+ protected $FQCN = Byte::class;
+ protected $testdata = '[¯\_(ツ)_/¯]';
+ protected $expected = [
+ 64, 245, 188, 42, 245, 197, 242, 142,
+ 56, 56, 66, 149, 242, 252, 42, 245,
+ 208, 236, 17, 236, 17, 236, 17, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 79, 89, 226, 48, 209, 89, 151, 1,
+ 12, 73, 42, 163, 11, 34, 255, 205,
+ 21, 47, 250, 101
+ ];
+
+
+}
diff --git a/vendor/chillerlan/php-qrcode/tests/Data/DatainterfaceTestAbstract.php b/vendor/chillerlan/php-qrcode/tests/Data/DatainterfaceTestAbstract.php
new file mode 100644
index 000000000..19d74617a
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/tests/Data/DatainterfaceTestAbstract.php
@@ -0,0 +1,65 @@
+<?php
+/**
+ * Class DatainterfaceTestAbstract
+ *
+ * @filesource DatainterfaceTestAbstract.php
+ * @created 24.11.2017
+ * @package chillerlan\QRCodeTest\Data
+ * @author Smiley <[email protected]>
+ * @copyright 2017 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCodeTest\Data;
+
+use chillerlan\QRCode\QROptions;
+use chillerlan\QRCode\Data\{QRCodeDataException, QRDataInterface, QRMatrix};
+use chillerlan\QRCodeTest\QRTestAbstract;
+
+abstract class DatainterfaceTestAbstract extends QRTestAbstract{
+
+ /**
+ * @var \chillerlan\QRCode\Data\QRDataAbstract
+ */
+ protected $dataInterface;
+
+ protected $testdata;
+ protected $expected;
+
+ protected function setUp():void{
+ parent::setUp();
+
+ $this->dataInterface = $this->reflection->newInstanceArgs([new QROptions(['version' => 4])]);
+ }
+
+ public function testInstance(){
+ $this->dataInterface = $this->reflection->newInstanceArgs([new QROptions, $this->testdata]);
+
+ $this->assertInstanceOf(QRDataInterface::class, $this->dataInterface);
+ }
+
+ public function testSetData(){
+ $this->dataInterface->setData($this->testdata);
+
+ $this->assertSame($this->expected, $this->getProperty('matrixdata')->getValue($this->dataInterface));
+ }
+
+ public function testInitMatrix(){
+ $m = $this->dataInterface->setData($this->testdata)->initMatrix(0);
+
+ $this->assertInstanceOf(QRMatrix::class, $m);
+ }
+
+ public function testGetMinimumVersion(){
+ $this->assertSame(1, $this->getMethod('getMinimumVersion')->invoke($this->dataInterface));
+ }
+
+ public function testGetMinimumVersionException(){
+ $this->expectException(QRCodeDataException::class);
+ $this->expectExceptionMessage('data exceeds');
+
+ $this->getProperty('strlen')->setValue($this->dataInterface, 13370);
+ $this->getMethod('getMinimumVersion')->invoke($this->dataInterface);
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/tests/Data/KanjiTest.php b/vendor/chillerlan/php-qrcode/tests/Data/KanjiTest.php
new file mode 100644
index 000000000..108b8fed7
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/tests/Data/KanjiTest.php
@@ -0,0 +1,50 @@
+<?php
+/**
+ * Class KanjiTest
+ *
+ * @filesource KanjiTest.php
+ * @created 24.11.2017
+ * @package chillerlan\QRCodeTest\Data
+ * @author Smiley <[email protected]>
+ * @copyright 2017 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCodeTest\Data;
+
+use chillerlan\QRCode\Data\{Kanji, QRCodeDataException};
+
+class KanjiTest extends DatainterfaceTestAbstract{
+
+ protected $FQCN = Kanji::class;
+ protected $testdata = '茗荷茗荷茗荷茗荷茗荷';
+ protected $expected = [
+ 128, 173, 85, 26, 95, 85, 70, 151,
+ 213, 81, 165, 245, 84, 105, 125, 85,
+ 26, 92, 0, 236, 17, 236, 17, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 195, 11, 221, 91, 141, 220, 163, 46,
+ 165, 37, 163, 176, 79, 0, 64, 68,
+ 96, 113, 54, 191
+ ];
+
+ public function testIllegalCharException1(){
+ $this->expectException(QRCodeDataException::class);
+ $this->expectExceptionMessage('illegal char at 1 [16191]');
+
+ $this->dataInterface->setData('ÃÃ');
+ }
+
+ public function testIllegalCharException2(){
+ $this->expectException(QRCodeDataException::class);
+ $this->expectExceptionMessage('illegal char at 1');
+
+ $this->dataInterface->setData('Ã');
+ }
+}
diff --git a/vendor/chillerlan/php-qrcode/tests/Data/MaskPatternTesterTest.php b/vendor/chillerlan/php-qrcode/tests/Data/MaskPatternTesterTest.php
new file mode 100644
index 000000000..ae4af9f29
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/tests/Data/MaskPatternTesterTest.php
@@ -0,0 +1,29 @@
+<?php
+/**
+ * Class MaskPatternTesterTest
+ *
+ * @filesource MaskPatternTesterTest.php
+ * @created 24.11.2017
+ * @package chillerlan\QRCodeTest\Data
+ * @author Smiley <[email protected]>
+ * @copyright 2017 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCodeTest\Data;
+
+use chillerlan\QRCode\{QROptions, Data\Byte, Data\MaskPatternTester};
+use chillerlan\QRCodeTest\QRTestAbstract;
+
+class MaskPatternTesterTest extends QRTestAbstract{
+
+ protected $FQCN = MaskPatternTester::class;
+
+ // coverage
+ public function testMaskpattern(){
+ $matrix = (new Byte(new QROptions(['version' => 10]), 'test'))->initMatrix(3, true);
+
+ $this->assertSame(4243, (new MaskPatternTester($matrix))->testPattern());
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/tests/Data/NumberTest.php b/vendor/chillerlan/php-qrcode/tests/Data/NumberTest.php
new file mode 100644
index 000000000..983346a34
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/tests/Data/NumberTest.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * Class NumberTest
+ *
+ * @filesource NumberTest.php
+ * @created 24.11.2017
+ * @package chillerlan\QRCodeTest\Data
+ * @author Smiley <[email protected]>
+ * @copyright 2017 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCodeTest\Data;
+
+use chillerlan\QRCode\Data\{Number, QRCodeDataException};
+
+class NumberTest extends DatainterfaceTestAbstract{
+
+ protected $FQCN = Number::class;
+ protected $testdata = '0123456789';
+ protected $expected = [
+ 16, 40, 12, 86, 106, 105, 0, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 17, 236, 17, 236, 17, 236, 17, 236,
+ 201, 141, 102, 116, 238, 162, 239, 230,
+ 222, 37, 79, 192, 42, 109, 188, 72,
+ 89, 63, 168, 151
+ ];
+
+ public function testGetCharCodeException(){
+ $this->expectException(QRCodeDataException::class);
+ $this->expectExceptionMessage('illegal char: "#" [35]');
+
+ $this->dataInterface->setData('#');
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/tests/Data/QRMatrixTest.php b/vendor/chillerlan/php-qrcode/tests/Data/QRMatrixTest.php
new file mode 100644
index 000000000..531c82eb2
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/tests/Data/QRMatrixTest.php
@@ -0,0 +1,260 @@
+<?php
+/**
+ * Class QRMatrixTest
+ *
+ * @filesource QRMatrixTest.php
+ * @created 17.11.2017
+ * @package chillerlan\QRCodeTest\Data
+ * @author Smiley <[email protected]>
+ * @copyright 2017 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCodeTest\Data;
+
+use chillerlan\QRCode\QRCode;
+use chillerlan\QRCode\QROptions;
+use chillerlan\QRCode\Data\{QRCodeDataException, QRMatrix};
+use chillerlan\QRCodeTest\QRTestAbstract;
+use ReflectionClass;
+
+class QRMatrixTest extends QRTestAbstract{
+
+ protected $FQCN = QRMatrix::class;
+
+ protected $version = 7;
+
+ /**
+ * @var \chillerlan\QRCode\Data\QRMatrix
+ */
+ protected $matrix;
+
+ protected function setUp():void{
+ parent::setUp();
+
+ $this->matrix = $this->reflection->newInstanceArgs([$this->version, QRCode::ECC_L]);
+ }
+
+ public function testInvalidVersionException(){
+ $this->expectException(QRCodeDataException::class);
+ $this->expectExceptionMessage('invalid QR Code version');
+
+ $this->reflection->newInstanceArgs([42, 0]);
+ }
+
+ public function testInvalidEccException(){
+ $this->expectException(QRCodeDataException::class);
+ $this->expectExceptionMessage('invalid ecc level');
+
+ $this->reflection->newInstanceArgs([1, 42]);
+ }
+
+ public function testInstance(){
+ $this->assertInstanceOf($this->FQCN, $this->matrix);
+ }
+
+ public function testSize(){
+ $this->assertCount($this->matrix->size(), $this->matrix->matrix());
+ }
+
+ public function testVersion(){
+ $this->assertSame($this->version, $this->matrix->version());
+ }
+
+ public function testECC(){
+ $this->assertSame(QRCode::ECC_L, $this->matrix->eccLevel());
+ }
+
+ public function testMaskPattern(){
+ $this->assertSame(-1, $this->matrix->maskPattern());
+ }
+
+ public function testGetSetCheck(){
+ $this->matrix->set(10, 10, true, QRMatrix::M_TEST);
+ $this->assertSame(65280, $this->matrix->get(10, 10));
+ $this->assertTrue($this->matrix->check(10, 10));
+
+ $this->matrix->set(20, 20, false, QRMatrix::M_TEST);
+ $this->assertSame(255, $this->matrix->get(20, 20));
+ $this->assertFalse($this->matrix->check(20, 20));
+ }
+
+ public function testSetDarkModule(){
+ $this->matrix->setDarkModule();
+
+ $this->assertSame(QRMatrix::M_DARKMODULE << 8, $this->matrix->get(8, $this->matrix->size() - 8));
+ }
+
+ public function testSetFinderPattern(){
+ $this->matrix->setFinderPattern();
+
+ $this->assertSame(QRMatrix::M_FINDER << 8, $this->matrix->get(0, 0));
+ $this->assertSame(QRMatrix::M_FINDER << 8, $this->matrix->get(0, $this->matrix->size() - 1));
+ $this->assertSame(QRMatrix::M_FINDER << 8, $this->matrix->get($this->matrix->size() - 1, 0));
+ }
+
+ public function testSetSeparators(){
+ $this->matrix->setSeparators();
+
+ $this->assertSame(QRMatrix::M_SEPARATOR, $this->matrix->get(7, 0));
+ $this->assertSame(QRMatrix::M_SEPARATOR, $this->matrix->get(0, 7));
+ $this->assertSame(QRMatrix::M_SEPARATOR, $this->matrix->get(0, $this->matrix->size() - 8));
+ $this->assertSame(QRMatrix::M_SEPARATOR, $this->matrix->get($this->matrix->size() - 8, 0));
+ }
+
+ public function testSetAlignmentPattern(){
+ $this->matrix
+ ->setFinderPattern()
+ ->setAlignmentPattern()
+ ;
+
+ $alignmentPattern = (new ReflectionClass(QRMatrix::class))->getConstant('alignmentPattern')[$this->version];
+
+ foreach($alignmentPattern as $py){
+ foreach($alignmentPattern as $px){
+
+ if($this->matrix->get($px, $py) === QRMatrix::M_FINDER << 8){
+ $this->assertSame(QRMatrix::M_FINDER << 8, $this->matrix->get($px, $py), 'skipped finder pattern');
+ continue;
+ }
+
+ $this->assertSame(QRMatrix::M_ALIGNMENT << 8, $this->matrix->get($px, $py));
+ }
+ }
+
+ }
+
+ public function testSetTimingPattern(){
+ $this->matrix
+ ->setAlignmentPattern()
+ ->setTimingPattern()
+ ;
+
+ $size = $this->matrix->size();
+
+ for($i = 7; $i < $size - 7; $i++){
+ if($i % 2 === 0){
+ $p1 = $this->matrix->get(6, $i);
+
+ if($p1 === QRMatrix::M_ALIGNMENT << 8){
+ $this->assertSame(QRMatrix::M_ALIGNMENT << 8, $p1, 'skipped alignment pattern');
+ continue;
+ }
+
+ $this->assertSame(QRMatrix::M_TIMING << 8, $p1);
+ $this->assertSame(QRMatrix::M_TIMING << 8, $this->matrix->get($i, 6));
+ }
+ }
+ }
+
+ public function testSetVersionNumber(){
+ $this->matrix->setVersionNumber(true);
+
+ $this->assertSame(QRMatrix::M_VERSION, $this->matrix->get($this->matrix->size() - 9, 0));
+ $this->assertSame(QRMatrix::M_VERSION, $this->matrix->get($this->matrix->size() - 11, 5));
+ $this->assertSame(QRMatrix::M_VERSION, $this->matrix->get(0, $this->matrix->size() - 9));
+ $this->assertSame(QRMatrix::M_VERSION, $this->matrix->get(5, $this->matrix->size() - 11));
+ }
+
+ public function testSetFormatInfo(){
+ $this->matrix->setFormatInfo(0, true);
+
+ $this->assertSame(QRMatrix::M_FORMAT, $this->matrix->get(8, 0));
+ $this->assertSame(QRMatrix::M_FORMAT, $this->matrix->get(0, 8));
+ $this->assertSame(QRMatrix::M_FORMAT, $this->matrix->get($this->matrix->size() - 1, 8));
+ $this->assertSame(QRMatrix::M_FORMAT, $this->matrix->get($this->matrix->size() - 8, 8));
+ }
+
+ public function testSetQuietZone(){
+ $size = $this->matrix->size();
+ $q = 5;
+
+ $this->matrix->set(0, 0, true, QRMatrix::M_TEST);
+ $this->matrix->set($size - 1, $size - 1, true, QRMatrix::M_TEST);
+
+ $this->matrix->setQuietZone($q);
+
+ $this->assertCount($size + 2 * $q, $this->matrix->matrix());
+ $this->assertCount($size + 2 * $q, $this->matrix->matrix()[$size - 1]);
+
+ $size = $this->matrix->size();
+ $this->assertSame(QRMatrix::M_QUIETZONE, $this->matrix->get(0, 0));
+ $this->assertSame(QRMatrix::M_QUIETZONE, $this->matrix->get($size - 1, $size - 1));
+
+ $this->assertSame(QRMatrix::M_TEST << 8, $this->matrix->get($q, $q));
+ $this->assertSame(QRMatrix::M_TEST << 8, $this->matrix->get($size - 1 - $q, $size - 1 - $q));
+ }
+
+ public function testSetQuietZoneException(){
+ $this->expectException(QRCodeDataException::class);
+ $this->expectExceptionMessage('use only after writing data');
+
+ $this->matrix->setQuietZone();
+ }
+
+ public function testSetLogoSpaceOrientation():void{
+ $o = new QROptions;
+ $o->version = 10;
+ $o->eccLevel = QRCode::ECC_H;
+ $o->addQuietzone = false;
+
+ $matrix = (new QRCode($o))->getMatrix('testdata');
+ // also testing size adjustment to uneven numbers
+ $matrix->setLogoSpace(20, 14);
+
+ // NW corner
+ $this::assertNotSame(QRMatrix::M_LOGO, $matrix->get(17, 20));
+ $this::assertSame(QRMatrix::M_LOGO, $matrix->get(18, 21));
+
+ // SE corner
+ $this::assertSame(QRMatrix::M_LOGO, $matrix->get(38, 35));
+ $this::assertNotSame(QRMatrix::M_LOGO, $matrix->get(39, 36));
+ }
+
+ public function testSetLogoSpacePosition():void{
+ $o = new QROptions;
+ $o->version = 10;
+ $o->eccLevel = QRCode::ECC_H;
+ $o->addQuietzone = true;
+ $o->quietzoneSize = 10;
+
+ $m = (new QRCode($o))->getMatrix('testdata');
+
+ // logo space should not overwrite quiet zone & function patterns
+ $m->setLogoSpace(21, 21, -10, -10);
+ $this::assertSame(QRMatrix::M_QUIETZONE, $m->get(9, 9));
+ $this::assertSame(QRMatrix::M_FINDER << 8, $m->get(10, 10));
+ $this::assertSame(QRMatrix::M_FINDER << 8, $m->get(16, 16));
+ $this::assertSame(QRMatrix::M_SEPARATOR, $m->get(17, 17));
+ $this::assertSame(QRMatrix::M_FORMAT << 8, $m->get(18, 18));
+ $this::assertSame(QRMatrix::M_LOGO, $m->get(19, 19));
+ $this::assertSame(QRMatrix::M_LOGO, $m->get(20, 20));
+ $this::assertNotSame(QRMatrix::M_LOGO, $m->get(21, 21));
+
+ // i just realized that setLogoSpace() could be called multiple times
+ // on the same instance and i'm not going to do anything about it :P
+ $m->setLogoSpace(21, 21, 45, 45);
+ $this::assertNotSame(QRMatrix::M_LOGO, $m->get(54, 54));
+ $this::assertSame(QRMatrix::M_LOGO, $m->get(55, 55));
+ $this::assertSame(QRMatrix::M_QUIETZONE, $m->get(67, 67));
+ }
+
+ public function testSetLogoSpaceInvalidEccException():void{
+ $this->expectException(QRCodeDataException::class);
+ $this->expectExceptionMessage('ECC level "H" required to add logo space');
+
+ (new QRCode)->getMatrix('testdata')->setLogoSpace(50, 50);
+ }
+
+ public function testSetLogoSpaceMaxSizeException():void{
+ $this->expectException(QRCodeDataException::class);
+ $this->expectExceptionMessage('logo space exceeds the maximum error correction capacity');
+
+ $o = new QROptions;
+ $o->version = 5;
+ $o->eccLevel = QRCode::ECC_H;
+
+ (new QRCode($o))->getMatrix('testdata')->setLogoSpace(50, 50);
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/tests/Helpers/BitBufferTest.php b/vendor/chillerlan/php-qrcode/tests/Helpers/BitBufferTest.php
new file mode 100644
index 000000000..25d1c3504
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/tests/Helpers/BitBufferTest.php
@@ -0,0 +1,53 @@
+<?php
+/**
+ * Class BitBufferTest
+ *
+ * @filesource BitBufferTest.php
+ * @created 08.02.2016
+ * @package chillerlan\QRCodeTest\Helpers
+ * @author Smiley <[email protected]>
+ * @copyright 2015 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCodeTest\Helpers;
+
+use chillerlan\QRCode\{QRCode, Helpers\BitBuffer};
+use chillerlan\QRCodeTest\QRTestAbstract;
+
+class BitBufferTest extends QRTestAbstract{
+
+ /**
+ * @var \chillerlan\QRCode\Helpers\BitBuffer
+ */
+ protected $bitBuffer;
+
+ protected function setUp():void{
+ $this->bitBuffer = new BitBuffer;
+ }
+
+ public function bitProvider(){
+ return [
+ 'number' => [QRCode::DATA_NUMBER, 16],
+ 'alphanum' => [QRCode::DATA_ALPHANUM, 32],
+ 'byte' => [QRCode::DATA_BYTE, 64],
+ 'kanji' => [QRCode::DATA_KANJI, 128],
+ ];
+ }
+
+ /**
+ * @dataProvider bitProvider
+ */
+ public function testPut($data, $value){
+ $this->bitBuffer->put($data, 4);
+ $this->assertSame($value, $this->bitBuffer->buffer[0]);
+ $this->assertSame(4, $this->bitBuffer->length);
+ }
+
+ public function testClear(){
+ $this->bitBuffer->clear();
+ $this->assertSame([], $this->bitBuffer->buffer);
+ $this->assertSame(0, $this->bitBuffer->length);
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/tests/Helpers/PolynomialTest.php b/vendor/chillerlan/php-qrcode/tests/Helpers/PolynomialTest.php
new file mode 100644
index 000000000..7f6da303c
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/tests/Helpers/PolynomialTest.php
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Class PolynomialTest
+ *
+ * @filesource PolynomialTest.php
+ * @created 09.02.2016
+ * @package chillerlan\QRCodeTest\Helpers
+ * @author Smiley <[email protected]>
+ * @copyright 2015 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCodeTest\Helpers;
+
+use chillerlan\QRCode\Helpers\Polynomial;
+use chillerlan\QRCode\QRCodeException;
+use chillerlan\QRCodeTest\QRTestAbstract;
+
+class PolynomialTest extends QRTestAbstract{
+
+ /**
+ * @var \chillerlan\QRCode\Helpers\Polynomial
+ */
+ protected $polynomial;
+
+ protected function setUp():void{
+ $this->polynomial = new Polynomial;
+ }
+
+ public function testGexp(){
+ $this->assertSame(142, $this->polynomial->gexp(-1));
+ $this->assertSame(133, $this->polynomial->gexp(128));
+ $this->assertSame(2, $this->polynomial->gexp(256));
+ }
+
+ public function testGlogException(){
+ $this->expectException(QRCodeException::class);
+ $this->expectExceptionMessage('log(0)');
+
+ $this->polynomial->glog(0);
+ }
+}
diff --git a/vendor/chillerlan/php-qrcode/tests/Output/QRFpdfTest.php b/vendor/chillerlan/php-qrcode/tests/Output/QRFpdfTest.php
new file mode 100644
index 000000000..1b49182d2
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/tests/Output/QRFpdfTest.php
@@ -0,0 +1,83 @@
+<?php
+/**
+ * Class QRFpdfTest
+ *
+ * @filesource QRFpdfTest.php
+ * @created 03.06.2020
+ * @package chillerlan\QRCodeTest\Output
+ * @author smiley <[email protected]>
+ * @copyright 2020 smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCodeTest\Output;
+
+use FPDF;
+use chillerlan\QRCode\Output\{QRFpdf, QROutputInterface};
+use chillerlan\QRCode\{QRCode, QROptions};
+
+use function class_exists, substr;
+
+/**
+ * Tests the QRFpdf output module
+ */
+class QRFpdfTest extends QROutputTestAbstract{
+
+ protected $FQCN = QRFpdf::class;
+
+ /**
+ * @inheritDoc
+ * @internal
+ */
+ public function setUp():void{
+
+ if(!class_exists(FPDF::class)){
+ $this->markTestSkipped('FPDF not available');
+ return;
+ }
+
+ parent::setUp();
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function testSetModuleValues():void{
+
+ $this->options->moduleValues = [
+ // data
+ 1024 => [0, 0, 0],
+ 4 => [255, 255, 255],
+ ];
+
+ $this->outputInterface->dump();
+
+ $this::assertTrue(true); // tricking the code coverage
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function testRenderImage():void{
+ $type = QRCode::OUTPUT_FPDF;
+
+ $this->options->outputType = $type;
+ $this->options->imageBase64 = false;
+ $this->outputInterface->dump($this::cachefile.$type);
+
+ // substr() to avoid CreationDate
+ $expected = substr(file_get_contents($this::cachefile.$type), 0, 2000);
+ $actual = substr($this->outputInterface->dump(), 0, 2000);
+
+ $this::assertSame($expected, $actual);
+ }
+
+ public function testOutputGetResource():void{
+ $this->options->returnResource = true;
+
+ $this->setOutputInterface();
+
+ $this::assertInstanceOf(FPDF::class, $this->outputInterface->dump());
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/tests/Output/QRImageTest.php b/vendor/chillerlan/php-qrcode/tests/Output/QRImageTest.php
new file mode 100644
index 000000000..34ecf4f91
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/tests/Output/QRImageTest.php
@@ -0,0 +1,69 @@
+<?php
+/**
+ * Class QRImageTest
+ *
+ * @filesource QRImageTest.php
+ * @created 24.12.2017
+ * @package chillerlan\QRCodeTest\Output
+ * @author Smiley <[email protected]>
+ * @copyright 2017 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCodeTest\Output;
+
+use chillerlan\QRCode\{QRCode, Output\QRImage};
+
+class QRImageTest extends QROutputTestAbstract{
+
+ protected $FQCN = QRImage::class;
+
+ public function types(){
+ return [
+ 'png' => [QRCode::OUTPUT_IMAGE_PNG],
+ 'gif' => [QRCode::OUTPUT_IMAGE_GIF],
+ 'jpg' => [QRCode::OUTPUT_IMAGE_JPG],
+ ];
+ }
+
+ /**
+ * @dataProvider types
+ * @param $type
+ */
+ public function testImageOutput($type){
+ $this->options->outputType = $type;
+ $this->options->imageBase64 = false;
+
+ $this->setOutputInterface();
+ $this->outputInterface->dump($this::cachefile.$type);
+ $img = $this->outputInterface->dump();
+
+ if($type === QRCode::OUTPUT_IMAGE_JPG){ // jpeg encoding may cause different results
+ $this->markAsRisky();
+ }
+
+ $this->assertSame($img, file_get_contents($this::cachefile.$type));
+ }
+
+ public function testSetModuleValues(){
+
+ $this->options->moduleValues = [
+ // data
+ 1024 => [0, 0, 0],
+ 4 => [255, 255, 255],
+ ];
+
+ $this->setOutputInterface()->dump();
+
+ $this->assertTrue(true); // tricking the code coverage
+ }
+
+ public function testOutputGetResource():void{
+ $this->options->returnResource = true;
+
+ $this->setOutputInterface();
+
+ $this::assertIsResource($this->outputInterface->dump());
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/tests/Output/QRImagickTest.php b/vendor/chillerlan/php-qrcode/tests/Output/QRImagickTest.php
new file mode 100644
index 000000000..c927cc64e
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/tests/Output/QRImagickTest.php
@@ -0,0 +1,66 @@
+<?php
+/**
+ * Class QRImagickTest
+ *
+ * @filesource QRImagickTest.php
+ * @created 04.07.2018
+ * @package chillerlan\QRCodeTest\Output
+ * @author smiley <[email protected]>
+ * @copyright 2018 smiley
+ * @license MIT
+ *
+ * @noinspection PhpComposerExtensionStubsInspection
+ */
+
+namespace chillerlan\QRCodeTest\Output;
+
+use Imagick;
+use chillerlan\QRCode\{QRCode, Output\QRImagick};
+
+class QRImagickTest extends QROutputTestAbstract{
+
+ protected $FQCN = QRImagick::class;
+
+ public function setUp():void{
+
+ if(!extension_loaded('imagick')){
+ $this->markTestSkipped('ext-imagick not loaded');
+ return;
+ }
+
+ parent::setUp();
+ }
+
+ public function testImageOutput(){
+ $type = QRCode::OUTPUT_IMAGICK;
+
+ $this->options->outputType = $type;
+ $this->setOutputInterface();
+ $this->outputInterface->dump($this::cachefile.$type);
+ $img = $this->outputInterface->dump();
+
+ $this->assertSame($img, file_get_contents($this::cachefile.$type));
+ }
+
+ public function testSetModuleValues(){
+
+ $this->options->moduleValues = [
+ // data
+ 1024 => '#4A6000',
+ 4 => '#ECF9BE',
+ ];
+
+ $this->setOutputInterface()->dump();
+
+ $this->assertTrue(true); // tricking the code coverage
+ }
+
+ public function testOutputGetResource():void{
+ $this->options->returnResource = true;
+
+ $this->setOutputInterface();
+
+ $this::assertInstanceOf(Imagick::class, $this->outputInterface->dump());
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/tests/Output/QRMarkupTest.php b/vendor/chillerlan/php-qrcode/tests/Output/QRMarkupTest.php
new file mode 100644
index 000000000..24fdc3ce6
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/tests/Output/QRMarkupTest.php
@@ -0,0 +1,79 @@
+<?php
+/**
+ * Class QRMarkupTest
+ *
+ * @filesource QRMarkupTest.php
+ * @created 24.12.2017
+ * @package chillerlan\QRCodeTest\Output
+ * @author Smiley <[email protected]>
+ * @copyright 2017 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCodeTest\Output;
+
+use chillerlan\QRCode\{QRCode, Output\QRMarkup};
+
+class QRMarkupTest extends QROutputTestAbstract{
+
+ protected $FQCN = QRMarkup::class;
+
+ public function types(){
+ return [
+ 'html' => [QRCode::OUTPUT_MARKUP_HTML],
+ 'svg' => [QRCode::OUTPUT_MARKUP_SVG],
+ ];
+ }
+
+ /**
+ * @dataProvider types
+ * @param $type
+ */
+ public function testMarkupOutputFile($type){
+ $this->options->outputType = $type;
+ $this->options->cachefile = $this::cachefile.$type;
+ $this->setOutputInterface();
+ $data = $this->outputInterface->dump();
+
+ $this->assertSame($data, file_get_contents($this->options->cachefile));
+ }
+
+ /**
+ * @dataProvider types
+ * @param $type
+ */
+ public function testMarkupOutput($type){
+ $this->options->imageBase64 = false;
+ $this->options->outputType = $type;
+ $this->setOutputInterface();
+
+ $expected = explode($this->options->eol, file_get_contents($this::cachefile.$type));
+ // cut off the doctype & head
+ array_shift($expected);
+
+ if($type === QRCode::OUTPUT_MARKUP_HTML){
+ // cut off the </body> tag
+ array_pop($expected);
+ }
+
+ $expected = implode($this->options->eol, $expected);
+
+ $this->assertSame(trim($expected), trim($this->outputInterface->dump()));
+ }
+
+ public function testSetModuleValues(){
+
+ $this->options->imageBase64 = false;
+ $this->options->moduleValues = [
+ // data
+ 1024 => '#4A6000',
+ 4 => '#ECF9BE',
+ ];
+
+ $this->setOutputInterface();
+ $data = $this->outputInterface->dump();
+ $this->assertStringContainsString('#4A6000', $data);
+ $this->assertStringContainsString('#ECF9BE', $data);
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/tests/Output/QROutputTestAbstract.php b/vendor/chillerlan/php-qrcode/tests/Output/QROutputTestAbstract.php
new file mode 100644
index 000000000..6cd95d080
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/tests/Output/QROutputTestAbstract.php
@@ -0,0 +1,71 @@
+<?php
+/**
+ * Class QROutputTestAbstract
+ *
+ * @filesource QROutputTestAbstract.php
+ * @created 24.12.2017
+ * @package chillerlan\QRCodeTest\Output
+ * @author Smiley <[email protected]>
+ * @copyright 2017 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCodeTest\Output;
+
+use chillerlan\QRCode\QROptions;
+use chillerlan\QRCode\Data\Byte;
+use chillerlan\QRCode\Output\{QRCodeOutputException, QROutputInterface};
+use chillerlan\QRCodeTest\QRTestAbstract;
+
+use function dirname, file_exists, mkdir;
+
+abstract class QROutputTestAbstract extends QRTestAbstract{
+
+ const cachefile = __DIR__.'/../../.build/output_test/test.';
+
+ /**
+ * @var \chillerlan\QRCode\Output\QROutputInterface
+ */
+ protected $outputInterface;
+
+ /**
+ * @var \chillerlan\QRCode\QROptions
+ */
+ protected $options;
+
+ /**
+ * @var \chillerlan\QRCode\Data\QRMatrix
+ */
+ protected $matrix;
+
+ protected function setUp():void{
+ parent::setUp();
+
+ $buildDir = dirname($this::cachefile);
+ if(!file_exists($buildDir)){
+ mkdir($buildDir, 0777, true);
+ }
+
+ $this->options = new QROptions;
+ $this->setOutputInterface();
+ }
+
+ protected function setOutputInterface(){
+ $this->outputInterface = $this->reflection->newInstanceArgs([$this->options, (new Byte($this->options, 'testdata'))->initMatrix(0)]);
+ return $this->outputInterface;
+ }
+
+ public function testInstance(){
+ $this->assertInstanceOf(QROutputInterface::class, $this->outputInterface);
+ }
+
+ public function testSaveException(){
+ $this->expectException(QRCodeOutputException::class);
+ $this->expectExceptionMessage('Could not write data to cache file: /foo');
+
+ $this->options->cachefile = '/foo';
+ $this->setOutputInterface();
+ $this->outputInterface->dump();
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/tests/Output/QRStringTest.php b/vendor/chillerlan/php-qrcode/tests/Output/QRStringTest.php
new file mode 100644
index 000000000..5dbd34010
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/tests/Output/QRStringTest.php
@@ -0,0 +1,56 @@
+<?php
+/**
+ * Class QRStringTest
+ *
+ * @filesource QRStringTest.php
+ * @created 24.12.2017
+ * @package chillerlan\QRCodeTest\Output
+ * @author Smiley <[email protected]>
+ * @copyright 2017 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCodeTest\Output;
+
+use chillerlan\QRCode\{QRCode, Output\QRString};
+
+class QRStringTest extends QROutputTestAbstract{
+
+ protected $FQCN = QRString::class;
+
+ public function types(){
+ return [
+ 'json' => [QRCode::OUTPUT_STRING_JSON],
+ 'text' => [QRCode::OUTPUT_STRING_TEXT],
+ ];
+ }
+
+ /**
+ * @dataProvider types
+ * @param $type
+ */
+ public function testStringOutput($type){
+ $this->options->outputType = $type;
+ $this->options->cachefile = $this::cachefile.$type;
+ $this->setOutputInterface();
+ $data = $this->outputInterface->dump();
+
+ $this->assertSame($data, file_get_contents($this->options->cachefile));
+ }
+
+ public function testSetModuleValues(){
+
+ $this->options->moduleValues = [
+ // data
+ 1024 => 'A',
+ 4 => 'B',
+ ];
+
+ $this->setOutputInterface();
+ $data = $this->outputInterface->dump();
+
+ $this->assertStringContainsString('A', $data);
+ $this->assertStringContainsString('B', $data);
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/tests/QRCodeTest.php b/vendor/chillerlan/php-qrcode/tests/QRCodeTest.php
new file mode 100644
index 000000000..8613c961f
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/tests/QRCodeTest.php
@@ -0,0 +1,140 @@
+<?php
+/**
+ * Class QRCodeTest
+ *
+ * @filesource QRCodeTest.php
+ * @created 17.11.2017
+ * @package chillerlan\QRCodeTest
+ * @author Smiley <[email protected]>
+ * @copyright 2017 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCodeTest;
+
+use chillerlan\QRCode\{QROptions, QRCode};
+use chillerlan\QRCode\Data\{AlphaNum, Byte, Number, QRCodeDataException};
+use chillerlan\QRCode\Output\QRCodeOutputException;
+use chillerlan\QRCodeExamples\MyCustomOutput;
+
+use function random_bytes;
+
+class QRCodeTest extends QRTestAbstract{
+
+ protected $FQCN = QRCode::class;
+
+ /**
+ * @var \chillerlan\QRCode\QRCode
+ */
+ protected $qrcode;
+
+ protected function setUp():void{
+ parent::setUp();
+
+ $this->qrcode = $this->reflection->newInstance();
+ }
+
+ public function testIsNumber(){
+ $this->assertTrue($this->qrcode->isNumber('0123456789'));
+ $this->assertFalse($this->qrcode->isNumber('ABC'));
+ }
+
+ public function testIsAlphaNum(){
+ $this->assertTrue($this->qrcode->isAlphaNum('ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 $%*+-./:'));
+ $this->assertFalse($this->qrcode->isAlphaNum('abc'));
+ }
+
+ public function testIsKanji(){
+ $this->assertTrue($this->qrcode->isKanji('茗荷'));
+ $this->assertFalse($this->qrcode->isKanji('Ã'));
+ }
+
+ // coverage
+
+ public function typeDataProvider(){
+ return [
+ 'png' => [QRCode::OUTPUT_IMAGE_PNG, 'data:image/png;base64,'],
+ 'gif' => [QRCode::OUTPUT_IMAGE_GIF, 'data:image/gif;base64,'],
+ 'jpg' => [QRCode::OUTPUT_IMAGE_JPG, 'data:image/jpg;base64,'],
+ 'svg' => [QRCode::OUTPUT_MARKUP_SVG, 'data:image/svg+xml;base64,'],
+ 'html' => [QRCode::OUTPUT_MARKUP_HTML, '<div><span style="background:'],
+ 'text' => [QRCode::OUTPUT_STRING_TEXT, '⭕⭕⭕⭕⭕⭕⭕⭕⭕⭕⭕⭕⭕⭕⭕⭕⭕⭕⭕⭕⭕⭕⭕⭕⭕⭕⭕⭕⭕'.PHP_EOL],
+ 'json' => [QRCode::OUTPUT_STRING_JSON, '[[18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18],'],
+ ];
+ }
+
+ /**
+ * @dataProvider typeDataProvider
+ * @param $type
+ */
+ public function testRenderImage($type, $expected){
+ $this->qrcode = $this->reflection->newInstanceArgs([new QROptions(['outputType' => $type])]);
+
+ $this->assertStringContainsString($expected, $this->qrcode->render('test'));
+ }
+
+ public function testInitDataInterfaceException(){
+ $this->expectException(QRCodeOutputException::class);
+ $this->expectExceptionMessage('invalid output type');
+
+ (new QRCode(new QROptions(['outputType' => 'foo'])))->render('test');
+ }
+
+ public function testGetMatrixException(){
+ $this->expectException(QRCodeDataException::class);
+ $this->expectExceptionMessage('QRCode::getMatrix() No data given.');
+
+ $this->qrcode->getMatrix('');
+ }
+
+ public function testTrim() {
+ $m1 = $this->qrcode->getMatrix('hello');
+ $m2 = $this->qrcode->getMatrix('hello '); // added space
+
+ $this->assertNotEquals($m1, $m2);
+ }
+
+ public function testImageTransparencyBGDefault(){
+ $this->qrcode = $this->reflection->newInstanceArgs([new QROptions(['imageTransparencyBG' => 'foo'])]);
+
+ $this->assertSame([255,255,255], $this->getProperty('options')->getValue($this->qrcode)->imageTransparencyBG);
+ }
+
+ public function testCustomOutput(){
+
+ $options = new QROptions([
+ 'version' => 5,
+ 'eccLevel' => QRCode::ECC_L,
+ 'outputType' => QRCode::OUTPUT_CUSTOM,
+ 'outputInterface' => MyCustomOutput::class,
+ ]);
+
+ $expected = '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011111110111010000101111010000011111110000000010000010111000001101011000001010000010000000010111010101101011000001101011010111010000000010111010110100111110010100111010111010000000010111010000001101011000001101010111010000000010000010100111110010100111110010000010000000011111110101010101010101010101011111110000000000000000010010100111110010100000000000000000011001110000101111010000101111001011110000000000000000111010000101111010000111100010000000001011010100111110010100111110011001010000000010000101111101011000001101011110011110000000000011010100011000001101011000101110100000000011001100001001101011000001101010011010000000010110111110000001101011000001100110100000000010000100100010100111110010100001100100000000011111110111101111010000101111010100110000000011010000111010000101111010000111100100000000010101111111111110010100111110011001000000000010110001110101011000001101011110011010000000001001111100011000001101011000101110010000000011000100110001101011000001101010011100000000001000011001000001101011000001100110000000000011101001011010100111110010100001100000000000010111010001101111010000101111010100110000000011100000001010000101111010000111100000000000000001110110111110010100111110011001000000000000011001011101011000001101011110011100000000011111110101011000001101011001111110110000000000000000110001101011000001101000111100000000011111110001000001101011000011010110000000000010000010101010100111110010101000100100000000010111010111101111010000101111111100110000000010111010011010000101111010001101100010000000010111010000111110010100111100101101100000000010000010101101011000001101001100111100000000011111110101011000001101011000110010110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000';
+
+ $this->assertSame($expected, $this->reflection->newInstanceArgs([$options])->render('test'));
+ }
+
+ public function testDataModeOverride(){
+ $this->qrcode = $this->reflection->newInstance();
+
+ $this->assertInstanceOf(Number::class, $this->qrcode->initDataInterface('123'));
+ $this->assertInstanceOf(AlphaNum::class, $this->qrcode->initDataInterface('ABC123'));
+ $this->assertInstanceOf(Byte::class, $this->qrcode->initDataInterface(random_bytes(32)));
+
+ $this->qrcode = $this->reflection->newInstanceArgs([new QROptions(['dataMode' => 'Byte'])]);
+
+ $this->assertInstanceOf(Byte::class, $this->qrcode->initDataInterface('123'));
+ $this->assertInstanceOf(Byte::class, $this->qrcode->initDataInterface('ABC123'));
+ $this->assertInstanceOf(Byte::class, $this->qrcode->initDataInterface(random_bytes(32)));
+ }
+
+ public function testDataModeOverrideError(){
+ $this->expectException(QRCodeDataException::class);
+ $this->expectExceptionMessage('illegal char:');
+
+ $this->qrcode = $this->reflection->newInstanceArgs([new QROptions(['dataMode' => 'AlphaNum'])]);
+
+ $this->qrcode->initDataInterface(random_bytes(32));
+ }
+
+}
diff --git a/vendor/chillerlan/php-qrcode/tests/QROptionsTest.php b/vendor/chillerlan/php-qrcode/tests/QROptionsTest.php
new file mode 100644
index 000000000..41bf69ced
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/tests/QROptionsTest.php
@@ -0,0 +1,80 @@
+<?php
+/**
+ * Class QROptionsTest
+ *
+ * @filesource QROptionsTest.php
+ * @created 08.11.2018
+ * @package chillerlan\QRCodeTest
+ * @author smiley <[email protected]>
+ * @copyright 2018 smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCodeTest;
+
+use chillerlan\QRCode\{QRCode, QRCodeException, QROptions};
+use PHPUnit\Framework\TestCase;
+
+class QROptionsTest extends TestCase{
+
+ /**
+ * @var \chillerlan\QRCode\QROptions
+ */
+ protected $options;
+
+ public function testVersionClamp(){
+ $this->assertSame(40, (new QROptions(['version' => 42]))->version);
+ $this->assertSame(1, (new QROptions(['version' => -42]))->version);
+ $this->assertSame(21, (new QROptions(['version' => 21]))->version);
+ $this->assertSame(QRCode::VERSION_AUTO, (new QROptions)->version); // QRCode::VERSION_AUTO = -1, default
+ }
+
+ public function testVersionMinMaxClamp(){
+ // normal clamp
+ $o = new QROptions(['versionMin' => 5, 'versionMax' => 10]);
+ $this->assertSame(5, $o->versionMin);
+ $this->assertSame(10, $o->versionMax);
+
+ // exceeding values
+ $o = new QROptions(['versionMin' => -42, 'versionMax' => 42]);
+ $this->assertSame(1, $o->versionMin);
+ $this->assertSame(40, $o->versionMax);
+
+ // min > max
+ $o = new QROptions(['versionMin' => 10, 'versionMax' => 5]);
+ $this->assertSame(5, $o->versionMin);
+ $this->assertSame(10, $o->versionMax);
+
+ $o = new QROptions(['versionMin' => 42, 'versionMax' => -42]);
+ $this->assertSame(1, $o->versionMin);
+ $this->assertSame(40, $o->versionMax);
+ }
+
+ public function testMaskPatternClamp(){
+ $this->assertSame(7, (new QROptions(['maskPattern' => 42]))->maskPattern);
+ $this->assertSame(0, (new QROptions(['maskPattern' => -42]))->maskPattern);
+ $this->assertSame(QRCode::MASK_PATTERN_AUTO, (new QROptions)->maskPattern); // QRCode::MASK_PATTERN_AUTO = -1, default
+ }
+
+ public function testInvalidEccLevelException(){
+ $this->expectException(QRCodeException::class);
+ $this->expectExceptionMessage('Invalid error correct level: 42');
+
+ new QROptions(['eccLevel' => 42]);
+ }
+
+ public function testClampRGBValues(){
+ $o = new QROptions(['imageTransparencyBG' => [-1, 0, 999]]);
+
+ $this->assertSame(0, $o->imageTransparencyBG[0]);
+ $this->assertSame(0, $o->imageTransparencyBG[1]);
+ $this->assertSame(255, $o->imageTransparencyBG[2]);
+ }
+
+ public function testInvalidRGBValueException(){
+ $this->expectException(QRCodeException::class);
+ $this->expectExceptionMessage('Invalid RGB value.');
+
+ new QROptions(['imageTransparencyBG' => ['r', 'g', 'b']]);
+ }
+}
diff --git a/vendor/chillerlan/php-qrcode/tests/QRTestAbstract.php b/vendor/chillerlan/php-qrcode/tests/QRTestAbstract.php
new file mode 100644
index 000000000..7b9eb8049
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/tests/QRTestAbstract.php
@@ -0,0 +1,72 @@
+<?php
+/**
+ * Class QRTestAbstract
+ *
+ * @filesource QRTestAbstract.php
+ * @created 17.11.2017
+ * @package chillerlan\QRCodeTest
+ * @author Smiley <[email protected]>
+ * @copyright 2017 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\QRCodeTest;
+
+use PHPUnit\Framework\TestCase;
+use ReflectionClass, ReflectionMethod, ReflectionProperty;
+
+abstract class QRTestAbstract extends TestCase{
+
+ /**
+ * @var \ReflectionClass
+ */
+ protected $reflection;
+
+ /**
+ * @var string
+ */
+ protected $FQCN;
+
+ protected function setUp():void{
+ $this->reflection = new ReflectionClass($this->FQCN);
+ }
+
+ /**
+ * @param string $method
+ *
+ * @return \ReflectionMethod
+ */
+ protected function getMethod(string $method):ReflectionMethod {
+ $method = $this->reflection->getMethod($method);
+ $method->setAccessible(true);
+
+ return $method;
+ }
+
+ /**
+ * @param string $property
+ *
+ * @return \ReflectionProperty
+ */
+ protected function getProperty(string $property):ReflectionProperty{
+ $property = $this->reflection->getProperty($property);
+ $property->setAccessible(true);
+
+ return $property;
+ }
+
+ /**
+ * @param $object
+ * @param string $property
+ * @param $value
+ *
+ * @return void
+ */
+ protected function setProperty($object, string $property, $value){
+ $property = $this->getProperty($property);
+ $property->setAccessible(true);
+ $property->setValue($object, $value);
+ }
+
+
+}
diff --git a/vendor/chillerlan/php-settings-container/.gitignore b/vendor/chillerlan/php-settings-container/.gitignore
new file mode 100644
index 000000000..e313cba45
--- /dev/null
+++ b/vendor/chillerlan/php-settings-container/.gitignore
@@ -0,0 +1,4 @@
+.idea
+.vendor
+composer.lock
+*.phpunit.result.cache
diff --git a/vendor/chillerlan/php-settings-container/.scrutinizer.yml b/vendor/chillerlan/php-settings-container/.scrutinizer.yml
new file mode 100644
index 000000000..7fdd2a4dc
--- /dev/null
+++ b/vendor/chillerlan/php-settings-container/.scrutinizer.yml
@@ -0,0 +1,5 @@
+filter:
+ excluded_paths:
+ - examples/*
+ - tests/*
+ - vendor/*
diff --git a/vendor/chillerlan/php-settings-container/.travis.yml b/vendor/chillerlan/php-settings-container/.travis.yml
new file mode 100644
index 000000000..208cdeb6a
--- /dev/null
+++ b/vendor/chillerlan/php-settings-container/.travis.yml
@@ -0,0 +1,18 @@
+language: php
+
+matrix:
+ include:
+ - php: 7.2
+ - php: 7.3
+ - php: 7.4snapshot
+ - php: nightly
+ allow_failures:
+ - php: 7.4snapshot
+ - php: nightly
+
+
+before_script: travis_retry composer install --no-interaction --prefer-source
+
+script: vendor/bin/phpunit --configuration phpunit.xml --coverage-clover clover.xml
+
+after_script: bash <(curl -s https://codecov.io/bash)
diff --git a/vendor/chillerlan/php-settings-container/LICENSE b/vendor/chillerlan/php-settings-container/LICENSE
new file mode 100644
index 000000000..25d371fc3
--- /dev/null
+++ b/vendor/chillerlan/php-settings-container/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2018 Smiley <[email protected]>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/vendor/chillerlan/php-settings-container/README.md b/vendor/chillerlan/php-settings-container/README.md
new file mode 100644
index 000000000..7d0ccf09d
--- /dev/null
+++ b/vendor/chillerlan/php-settings-container/README.md
@@ -0,0 +1,153 @@
+# chillerlan/php-settings-container
+
+A container class for immutable settings objects. Not a DI container. PHP 7.2+
+- [`SettingsContainerInterface`](https://github.com/chillerlan/php-settings-container/blob/master/src/SettingsContainerInterface.php) provides immutable properties with magic getter & setter and some fancy
+
+[![version][packagist-badge]][packagist]
+[![license][license-badge]][license]
+[![Travis][travis-badge]][travis]
+[![Coverage][coverage-badge]][coverage]
+[![Scrunitizer][scrutinizer-badge]][scrutinizer]
+[![Packagist downloads][downloads-badge]][downloads]
+[![PayPal donate][donate-badge]][donate]
+
+[packagist-badge]: https://img.shields.io/packagist/v/chillerlan/php-settings-container.svg?style=flat-square
+[packagist]: https://packagist.org/packages/chillerlan/php-settings-container
+[license-badge]: https://img.shields.io/github/license/chillerlan/php-settings-container.svg?style=flat-square
+[license]: https://github.com/chillerlan/php-settings-container/blob/master/LICENSE
+[travis-badge]: https://img.shields.io/travis/chillerlan/php-settings-container.svg?style=flat-square
+[travis]: https://travis-ci.org/chillerlan/php-settings-container
+[coverage-badge]: https://img.shields.io/codecov/c/github/chillerlan/php-settings-container.svg?style=flat-square
+[coverage]: https://codecov.io/github/chillerlan/php-settings-container
+[scrutinizer-badge]: https://img.shields.io/scrutinizer/g/chillerlan/php-settings-container.svg?style=flat-square
+[scrutinizer]: https://scrutinizer-ci.com/g/chillerlan/php-settings-container
+[downloads-badge]: https://img.shields.io/packagist/dt/chillerlan/php-settings-container.svg?style=flat-square
+[downloads]: https://packagist.org/packages/chillerlan/php-settings-container/stats
+[donate-badge]: https://img.shields.io/badge/donate-paypal-ff33aa.svg?style=flat-square
+[donate]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WLYUNAT9ZTJZ4
+
+## Documentation
+
+### Installation
+**requires [composer](https://getcomposer.org)**
+
+*composer.json* (note: replace `dev-master` with a version boundary)
+```json
+{
+ "require": {
+ "php": "^7.2",
+ "chillerlan/php-settings-container": "^1.0"
+ }
+}
+```
+
+### Manual installation
+Download the desired version of the package from [master](https://github.com/chillerlan/php-settings-container/archive/master.zip) or
+[release](https://github.com/chillerlan/php-settings-container/releases) and extract the contents to your project folder. After that:
+- run `composer install` to install the required dependencies and generate `/vendor/autoload.php`.
+- if you use a custom autoloader, point the namespace `chillerlan\Settings` to the folder `src` of the package
+
+Profit!
+
+## Usage
+
+The `SettingsContainerInterface` (wrapped in`SettingsContainerAbstract` ) provides plug-in functionality for immutable object variables and adds some fancy, like loading/saving JSON, arrays etc.
+It takes iterable as the only constructor argument and calls a method with the trait's name on invocation (`MyTrait::MyTrait()`) for each used trait.
+
+### Simple usage
+```php
+class MyContainer extends SettingsContainerAbstract{
+ protected $foo;
+ protected $bar;
+}
+```
+
+```php
+// use it just like a \stdClass
+$container = new MyContainer;
+$container->foo = 'what';
+$container->bar = 'foo';
+
+// which is equivalent to
+$container = new MyContainer(['bar' => 'foo', 'foo' => 'what']);
+// ...or try
+$container->fromJSON('{"foo": "what", "bar": "foo"}');
+
+
+// fetch all properties as array
+$container->toArray(); // -> ['foo' => 'what', 'bar' => 'foo']
+// or JSON
+$container->toJSON(); // -> {"foo": "what", "bar": "foo"}
+
+//non-existing properties will be ignored:
+$container->nope = 'what';
+
+var_dump($container->nope); // -> null
+```
+
+### Advanced usage
+```php
+trait SomeOptions{
+ protected $foo;
+ protected $what;
+
+ // this method will be called in SettingsContainerAbstract::construct()
+ // after the properties have been set
+ protected function SomeOptions(){
+ // just some constructor stuff...
+ $this->foo = strtoupper($this->foo);
+ }
+
+ // this method will be called from __set() when property $what is set
+ protected function set_what(string $value){
+ $this->what = md5($value);
+ }
+}
+
+trait MoreOptions{
+ protected $bar = 'whatever'; // provide default values
+}
+```
+
+```php
+$commonOptions = [
+ // SomeOptions
+ 'foo' => 'whatever',
+ // MoreOptions
+ 'bar' => 'nothing',
+];
+
+// now plug the several library options together to a single object
+$container = new class ($commonOptions) extends SettingsContainerAbstract{
+ use SomeOptions, MoreOptions;
+};
+
+var_dump($container->foo); // -> WHATEVER (constructor ran strtoupper on the value)
+var_dump($container->bar); // -> nothing
+
+$container->what = 'some value';
+var_dump($container->what); // -> md5 hash of "some value"
+```
+
+### API
+
+#### [`SettingsContainerAbstract`](https://github.com/chillerlan/php-settings-container/blob/master/src/SettingsContainerAbstract.php)
+
+method | return | info
+-------- | ---- | -----------
+`__construct(iterable $properties = null)` | - | calls `construct()` internally after the properties have been set
+(protected) `construct()` | void | calls a method with trait name as replacement constructor for each used trait
+`__get(string $property)` | mixed | calls `$this->{'get_'.$property}()` if such a method exists
+`__set(string $property, $value)` | void | calls `$this->{'set_'.$property}($value)` if such a method exists
+`__isset(string $property)` | bool |
+`__unset(string $property)` | void |
+`__toString()` | string | a JSON string
+`toArray()` | array |
+`fromIterable(iterable $properties)` | `SettingsContainerInterface` |
+`toJSON(int $jsonOptions = null)` | string | accepts [JSON options constants](http://php.net/manual/json.constants.php)
+`fromJSON(string $json)` | `SettingsContainerInterface` |
+`jsonSerialize()` | mixed | implements the [`JsonSerializable`](https://www.php.net/manual/en/jsonserializable.jsonserialize.php) interface
+
+## Disclaimer
+This might be either an utterly genius or completely stupid idea - you decide. However, i like it and it works.
+Also, this is not a dependency injection container. Stop using DI containers FFS.
diff --git a/vendor/chillerlan/php-settings-container/composer.json b/vendor/chillerlan/php-settings-container/composer.json
new file mode 100644
index 000000000..4dc758665
--- /dev/null
+++ b/vendor/chillerlan/php-settings-container/composer.json
@@ -0,0 +1,40 @@
+{
+ "name": "chillerlan/php-settings-container",
+ "description": "A container class for immutable settings objects. Not a DI container. PHP 7.2+",
+ "homepage": "https://github.com/chillerlan/php-settings-container",
+ "license": "MIT",
+ "type": "library",
+ "minimum-stability": "stable",
+ "keywords": [
+ "php7", "helper", "container", "settings"
+ ],
+ "authors": [
+ {
+ "name": "Smiley",
+ "email": "[email protected]",
+ "homepage": "https://github.com/codemasher"
+ }
+ ],
+ "support": {
+ "issues": "https://github.com/chillerlan/php-settings-container/issues",
+ "source": "https://github.com/chillerlan/php-settings-container"
+ },
+ "require": {
+ "php": "^7.2",
+ "ext-json": "*"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^8.3"
+ },
+ "autoload": {
+ "psr-4": {
+ "chillerlan\\Settings\\": "src/"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "chillerlan\\SettingsTest\\": "tests/",
+ "chillerlan\\SettingsExamples\\": "examples/"
+ }
+ }
+}
diff --git a/vendor/chillerlan/php-settings-container/examples/advanced.php b/vendor/chillerlan/php-settings-container/examples/advanced.php
new file mode 100644
index 000000000..1030b0a29
--- /dev/null
+++ b/vendor/chillerlan/php-settings-container/examples/advanced.php
@@ -0,0 +1,46 @@
+<?php
+/**
+ * @filesource advanced.php
+ * @created 28.08.2018
+ * @author smiley <[email protected]>
+ * @copyright 2018 smiley
+ * @license MIT
+ */
+
+namespace chillerlan\SettingsExamples;
+
+use chillerlan\Settings\SettingsContainerAbstract;
+
+require_once __DIR__.'/../vendor/autoload.php';
+
+// from library #1
+trait SomeOptions{
+ protected $foo;
+
+ // this method will be called in SettingsContainerAbstract::__construct() after the properties have been set
+ protected function SomeOptions(){
+ // just some constructor stuff...
+ $this->foo = strtoupper($this->foo);
+ }
+}
+
+// from library #2
+trait MoreOptions{
+ protected $bar = 'whatever'; // provide default values
+}
+
+$commonOptions = [
+ // SomeOptions
+ 'foo' => 'whatever',
+ // MoreOptions
+ 'bar' => 'nothing',
+];
+
+// now plug the several library options together to a single object
+/** @var \chillerlan\Settings\SettingsContainerInterface $container */
+$container = new class ($commonOptions) extends SettingsContainerAbstract{
+ use SomeOptions, MoreOptions; // ...
+};
+
+var_dump($container->foo); // -> WHATEVER (constructor ran strtoupper on the value)
+var_dump($container->bar); // -> nothing
diff --git a/vendor/chillerlan/php-settings-container/examples/simple.php b/vendor/chillerlan/php-settings-container/examples/simple.php
new file mode 100644
index 000000000..d8d81095b
--- /dev/null
+++ b/vendor/chillerlan/php-settings-container/examples/simple.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * @filesource simple.php
+ * @created 28.08.2018
+ * @author smiley <[email protected]>
+ * @copyright 2018 smiley
+ * @license MIT
+ */
+
+namespace chillerlan\SettingsExamples;
+
+use chillerlan\Settings\SettingsContainerAbstract;
+
+require_once __DIR__.'/../vendor/autoload.php';
+
+class MyContainer extends SettingsContainerAbstract{
+ protected $foo;
+ protected $bar;
+}
+
+/** @var \chillerlan\Settings\SettingsContainerInterface $container */
+$container = new MyContainer(['foo' => 'what']);
+$container->bar = 'foo';
+
+var_dump($container->toJSON()); // -> {"foo":"what","bar":"foo"}
+
+// non-existing properties will be ignored:
+$container->nope = 'what';
+
+var_dump($container->nope); // -> NULL
diff --git a/vendor/chillerlan/php-settings-container/phpmd.xml b/vendor/chillerlan/php-settings-container/phpmd.xml
new file mode 100644
index 000000000..3ba7e11b7
--- /dev/null
+++ b/vendor/chillerlan/php-settings-container/phpmd.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<ruleset name="codemasher/php-settings-container PMD ruleset"
+ xmlns="http://pmd.sf.net/ruleset/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
+ xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
+ <description>codemasher/php-settings-container PMD ruleset</description>
+ <exclude-pattern>*/examples/*</exclude-pattern>
+ <exclude-pattern>*/tests/*</exclude-pattern>
+ <exclude-pattern>*/vendor/*</exclude-pattern>
+ <rule ref="rulesets/cleancode.xml">
+ <exclude name="BooleanArgumentFlag"/>
+ </rule>
+ <rule ref="rulesets/codesize.xml/CyclomaticComplexity">
+ <priority>1</priority>
+ <properties>
+ <property name="maximum" value="150" />
+ </properties>
+ </rule>
+ <rule ref="rulesets/controversial.xml">
+ <exclude name="CamelCaseMethodName"/>
+ <exclude name="CamelCasePropertyName"/>
+ <exclude name="CamelCaseParameterName"/>
+ <exclude name="CamelCaseVariableName"/>
+ </rule>
+ <rule ref="rulesets/design.xml">
+ </rule>
+ <rule ref="rulesets/naming.xml">
+ <exclude name="LongVariable"/>
+ <exclude name="ShortVariable"/>
+ </rule>
+ <rule ref="rulesets/unusedcode.xml">
+ <exclude name="UnusedFormalParameter"/>
+ </rule>
+</ruleset>
diff --git a/vendor/chillerlan/php-settings-container/phpunit.xml b/vendor/chillerlan/php-settings-container/phpunit.xml
new file mode 100644
index 000000000..bb05d1289
--- /dev/null
+++ b/vendor/chillerlan/php-settings-container/phpunit.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit backupGlobals="false"
+ backupStaticAttributes="false"
+ bootstrap="vendor/autoload.php"
+ colors="true"
+ convertErrorsToExceptions="true"
+ convertNoticesToExceptions="true"
+ convertWarningsToExceptions="true"
+ processIsolation="false"
+ stopOnFailure="false"
+>
+ <filter>
+ <whitelist processUncoveredFilesFromWhitelist="true">
+ <directory suffix=".php">./src</directory>
+ </whitelist>
+ </filter>
+ <testsuites>
+ <testsuite name="php-settings-container test suite">
+ <directory suffix=".php">./tests/</directory>
+ </testsuite>
+ </testsuites>
+</phpunit>
diff --git a/vendor/chillerlan/php-settings-container/src/SettingsContainerAbstract.php b/vendor/chillerlan/php-settings-container/src/SettingsContainerAbstract.php
new file mode 100644
index 000000000..1ccc1a0e2
--- /dev/null
+++ b/vendor/chillerlan/php-settings-container/src/SettingsContainerAbstract.php
@@ -0,0 +1,172 @@
+<?php
+/**
+ * Class SettingsContainerAbstract
+ *
+ * @filesource SettingsContainerAbstract.php
+ * @created 28.08.2018
+ * @package chillerlan\Settings
+ * @author Smiley <[email protected]>
+ * @copyright 2018 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\Settings;
+
+use Exception, ReflectionClass, ReflectionProperty;
+
+use function call_user_func, call_user_func_array, get_object_vars, json_decode, json_encode, method_exists, property_exists;
+
+abstract class SettingsContainerAbstract implements SettingsContainerInterface{
+
+ /**
+ * SettingsContainerAbstract constructor.
+ *
+ * @param iterable|null $properties
+ */
+ public function __construct(iterable $properties = null){
+
+ if(!empty($properties)){
+ $this->fromIterable($properties);
+ }
+
+ $this->construct();
+ }
+
+ /**
+ * calls a method with trait name as replacement constructor for each used trait
+ * (remember pre-php5 classname constructors? yeah, basically this.)
+ *
+ * @return void
+ */
+ protected function construct():void{
+ $traits = (new ReflectionClass($this))->getTraits();
+
+ foreach($traits as $trait){
+ $method = $trait->getShortName();
+
+ if(method_exists($this, $method)){
+ call_user_func([$this, $method]);
+ }
+ }
+
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function __get(string $property){
+
+ if(property_exists($this, $property) && !$this->isPrivate($property)){
+
+ if(method_exists($this, 'get_'.$property)){
+ return call_user_func([$this, 'get_'.$property]);
+ }
+
+ return $this->{$property};
+ }
+
+ return null;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function __set(string $property, $value):void{
+
+ if(!property_exists($this, $property) || $this->isPrivate($property)){
+ return;
+ }
+
+ if(method_exists($this, 'set_'.$property)){
+ call_user_func_array([$this, 'set_'.$property], [$value]);
+
+ return;
+ }
+
+ $this->{$property} = $value;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function __isset(string $property):bool{
+ return isset($this->{$property}) && !$this->isPrivate($property);
+ }
+
+ /**
+ * @internal Checks if a property is private
+ *
+ * @param string $property
+ *
+ * @return bool
+ */
+ protected function isPrivate(string $property):bool{
+ return (new ReflectionProperty($this, $property))->isPrivate();
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function __unset(string $property):void{
+
+ if($this->__isset($property)){
+ unset($this->{$property});
+ }
+
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function __toString():string{
+ return $this->toJSON();
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function toArray():array{
+ return get_object_vars($this);
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function fromIterable(iterable $properties):SettingsContainerInterface{
+
+ foreach($properties as $key => $value){
+ $this->__set($key, $value);
+ }
+
+ return $this;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function toJSON(int $jsonOptions = null):string{
+ return json_encode($this, $jsonOptions ?? 0);
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function fromJSON(string $json):SettingsContainerInterface{
+
+ $data = json_decode($json, true); // as of PHP 7.3: JSON_THROW_ON_ERROR
+
+ if($data === false || $data === null){
+ throw new Exception('error while decoding JSON');
+ }
+
+ return $this->fromIterable($data);
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function jsonSerialize(){
+ return $this->toArray();
+ }
+
+}
diff --git a/vendor/chillerlan/php-settings-container/src/SettingsContainerInterface.php b/vendor/chillerlan/php-settings-container/src/SettingsContainerInterface.php
new file mode 100644
index 000000000..59cef6232
--- /dev/null
+++ b/vendor/chillerlan/php-settings-container/src/SettingsContainerInterface.php
@@ -0,0 +1,104 @@
+<?php
+/**
+ * Interface SettingsContainerInterface
+ *
+ * @filesource SettingsContainerInterface.php
+ * @created 28.08.2018
+ * @package chillerlan\Settings
+ * @author Smiley <[email protected]>
+ * @copyright 2018 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\Settings;
+
+use JsonSerializable;
+
+/**
+ * a generic container with magic getter and setter
+ */
+interface SettingsContainerInterface extends JsonSerializable{
+
+ /**
+ * Retrieve the value of $property
+ *
+ * @param string $property
+ *
+ * @return mixed
+ */
+ public function __get(string $property);
+
+ /**
+ * Set $property to $value while avoiding private and non-existing properties
+ *
+ * @param string $property
+ * @param mixed $value
+ *
+ * @return void
+ */
+ public function __set(string $property, $value):void;
+
+ /**
+ * Checks if $property is set (aka. not null), excluding private properties
+ *
+ * @param string $property
+ *
+ * @return bool
+ */
+ public function __isset(string $property):bool;
+
+ /**
+ * Unsets $property while avoiding private and non-existing properties
+ *
+ * @param string $property
+ *
+ * @return void
+ */
+ public function __unset(string $property):void;
+
+ /**
+ * @see SettingsContainerInterface::toJSON()
+ *
+ * @return string
+ */
+ public function __toString():string;
+
+ /**
+ * Returns an array representation of the settings object
+ *
+ * @return array
+ */
+ public function toArray():array;
+
+ /**
+ * Sets properties from a given iterable
+ *
+ * @param iterable $properties
+ *
+ * @return \chillerlan\Settings\SettingsContainerInterface
+ */
+ public function fromIterable(iterable $properties):SettingsContainerInterface;
+
+ /**
+ * Returns a JSON representation of the settings object
+ * @see \json_encode()
+ *
+ * @param int|null $jsonOptions
+ *
+ * @return string
+ */
+ public function toJSON(int $jsonOptions = null):string;
+
+ /**
+ * Sets properties from a given JSON string
+ *
+ * @param string $json
+ *
+ * @return \chillerlan\Settings\SettingsContainerInterface
+ *
+ * @throws \Exception
+ * @throws \JsonException
+ */
+ public function fromJSON(string $json):SettingsContainerInterface;
+
+}
diff --git a/vendor/chillerlan/php-settings-container/tests/ContainerTest.php b/vendor/chillerlan/php-settings-container/tests/ContainerTest.php
new file mode 100644
index 000000000..ddae538f3
--- /dev/null
+++ b/vendor/chillerlan/php-settings-container/tests/ContainerTest.php
@@ -0,0 +1,105 @@
+<?php
+/**
+ * Class ContainerTraitTest
+ *
+ * @filesource ContainerTraitTest.php
+ * @created 28.08.2018
+ * @package chillerlan\SettingsTest
+ * @author Smiley <[email protected]>
+ * @copyright 2018 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\SettingsTest;
+
+use PHPUnit\Framework\TestCase;
+use Exception, TypeError;
+
+class ContainerTraitTest extends TestCase{
+
+ public function testConstruct(){
+ $container = new TestContainer([
+ 'test1' => 'test1',
+ 'test2' => 'test2',
+ 'test3' => 'test3',
+ 'test4' => 'test4',
+ ]);
+
+ $this->assertSame('test1', $container->test1);
+ $this->assertSame('test2', $container->test2);
+ $this->assertNull($container->test3);
+ $this->assertSame('test4', $container->test4);
+
+ $this->assertSame('success', $container->testConstruct);
+ }
+
+ public function testGet(){
+ $container = new TestContainer;
+
+ $this->assertSame('foo', $container->test1);
+ $this->assertNull($container->test2);
+ $this->assertNull($container->test3);
+ $this->assertNull($container->test4);
+ $this->assertNull($container->foo);
+
+ // isset test
+ $this->assertTrue(isset($container->test1));
+ $this->assertFalse(isset($container->test2));
+ $this->assertFalse(isset($container->test3));
+ $this->assertFalse(isset($container->test4));
+ $this->assertFalse(isset($container->foo));
+
+ // custom getter
+ $container->test6 = 'foo';
+ $this->assertSame(sha1('foo'), $container->test6);
+ // nullable/isset test
+ $container->test6 = null;
+ $this->assertFalse(isset($container->test6));
+ $this->assertSame('null', $container->test6);
+ }
+
+ public function testSet(){
+ $container = new TestContainer;
+ $container->test1 = 'bar';
+ $container->test2 = 'what';
+ $container->test3 = 'nope';
+
+ $this->assertSame('bar', $container->test1);
+ $this->assertSame('what', $container->test2);
+ $this->assertNull($container->test3);
+
+ // unset
+ unset($container->test1);
+ $this->assertFalse(isset($container->test1));
+
+ // custom setter
+ $container->test5 = 'bar';
+ $this->assertSame('bar_test5', $container->test5);
+ }
+
+ public function testToArray(){
+ $container = new TestContainer(['test1' => 'no', 'test2' => true, 'testConstruct' => 'success']);
+
+ $this->assertSame(['test1' => 'no', 'test2' => true, 'testConstruct' => 'success', 'test4' => null, 'test5' => null, 'test6' => null], $container->toArray());
+ }
+
+ public function testToJSON(){
+ $container = (new TestContainer)->fromJSON('{"test1":"no","test2":true,"testConstruct":"success"}');
+
+ $expected = '{"test1":"no","test2":true,"testConstruct":"success","test4":null,"test5":null,"test6":null}';
+
+ $this->assertSame($expected, $container->toJSON());
+ $this->assertSame($expected, (string)$container);
+ }
+
+ public function testFromJsonException(){
+ $this->expectException(Exception::class);
+ (new TestContainer)->fromJSON('-');
+
+ }
+ public function testFromJsonTypeError(){
+ $this->expectException(TypeError::class);
+ (new TestContainer)->fromJSON('2');
+ }
+
+}
diff --git a/vendor/chillerlan/php-settings-container/tests/TestContainer.php b/vendor/chillerlan/php-settings-container/tests/TestContainer.php
new file mode 100644
index 000000000..a35f75277
--- /dev/null
+++ b/vendor/chillerlan/php-settings-container/tests/TestContainer.php
@@ -0,0 +1,29 @@
+<?php
+/**
+ * Class TestContainer
+ *
+ * @filesource TestContainer.php
+ * @created 28.08.2018
+ * @package chillerlan\SettingsTest
+ * @author Smiley <[email protected]>
+ * @copyright 2018 Smiley
+ * @license MIT
+ */
+
+namespace chillerlan\SettingsTest;
+
+use chillerlan\Settings\SettingsContainerAbstract;
+
+/**
+ * @property $test1
+ * @property $test2
+ * @property $test3
+ * @property $test4
+ * @property $test5
+ * @property $test6
+ */
+class TestContainer extends SettingsContainerAbstract{
+ use TestOptionsTrait;
+
+ private $test3 = 'what';
+}
diff --git a/vendor/chillerlan/php-settings-container/tests/TestOptionsTrait.php b/vendor/chillerlan/php-settings-container/tests/TestOptionsTrait.php
new file mode 100644
index 000000000..261f533ac
--- /dev/null
+++ b/vendor/chillerlan/php-settings-container/tests/TestOptionsTrait.php
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Trait TestOptionsTrait
+ *
+ * @filesource TestOptionsTrait.php
+ * @created 28.08.2018
+ * @package chillerlan\SettingsTest
+ * @author smiley <[email protected]>
+ * @copyright 2018 smiley
+ * @license MIT
+ */
+
+namespace chillerlan\SettingsTest;
+
+trait TestOptionsTrait{
+
+ protected $test1 = 'foo';
+
+ protected $test2;
+
+ protected $testConstruct;
+
+ protected $test4;
+
+ protected $test5;
+
+ protected $test6;
+
+ protected function TestOptionsTrait(){
+ $this->testConstruct = 'success';
+ }
+
+ protected function set_test5($value){
+ $this->test5 = $value.'_test5';
+ }
+
+ protected function get_test6(){
+ return $this->test6 === null
+ ? 'null'
+ : sha1($this->test6);
+ }
+}
diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php
new file mode 100644
index 000000000..247294d66
--- /dev/null
+++ b/vendor/composer/ClassLoader.php
@@ -0,0 +1,479 @@
+<?php
+
+/*
+ * This file is part of Composer.
+ *
+ * (c) Nils Adermann <[email protected]>
+ * Jordi Boggiano <[email protected]>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer\Autoload;
+
+/**
+ * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
+ *
+ * $loader = new \Composer\Autoload\ClassLoader();
+ *
+ * // register classes with namespaces
+ * $loader->add('Symfony\Component', __DIR__.'/component');
+ * $loader->add('Symfony', __DIR__.'/framework');
+ *
+ * // activate the autoloader
+ * $loader->register();
+ *
+ * // to enable searching the include path (eg. for PEAR packages)
+ * $loader->setUseIncludePath(true);
+ *
+ * In this example, if you try to use a class in the Symfony\Component
+ * namespace or one of its children (Symfony\Component\Console for instance),
+ * the autoloader will first look for the class under the component/
+ * directory, and it will then fallback to the framework/ directory if not
+ * found before giving up.
+ *
+ * This class is loosely based on the Symfony UniversalClassLoader.
+ *
+ * @author Fabien Potencier <[email protected]>
+ * @author Jordi Boggiano <[email protected]>
+ * @see https://www.php-fig.org/psr/psr-0/
+ * @see https://www.php-fig.org/psr/psr-4/
+ */
+class ClassLoader
+{
+ private $vendorDir;
+
+ // PSR-4
+ private $prefixLengthsPsr4 = array();
+ private $prefixDirsPsr4 = array();
+ private $fallbackDirsPsr4 = array();
+
+ // PSR-0
+ private $prefixesPsr0 = array();
+ private $fallbackDirsPsr0 = array();
+
+ private $useIncludePath = false;
+ private $classMap = array();
+ private $classMapAuthoritative = false;
+ private $missingClasses = array();
+ private $apcuPrefix;
+
+ private static $registeredLoaders = array();
+
+ public function __construct($vendorDir = null)
+ {
+ $this->vendorDir = $vendorDir;
+ }
+
+ public function getPrefixes()
+ {
+ if (!empty($this->prefixesPsr0)) {
+ return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
+ }
+
+ return array();
+ }
+
+ public function getPrefixesPsr4()
+ {
+ return $this->prefixDirsPsr4;
+ }
+
+ public function getFallbackDirs()
+ {
+ return $this->fallbackDirsPsr0;
+ }
+
+ public function getFallbackDirsPsr4()
+ {
+ return $this->fallbackDirsPsr4;
+ }
+
+ public function getClassMap()
+ {
+ return $this->classMap;
+ }
+
+ /**
+ * @param array $classMap Class to filename map
+ */
+ public function addClassMap(array $classMap)
+ {
+ if ($this->classMap) {
+ $this->classMap = array_merge($this->classMap, $classMap);
+ } else {
+ $this->classMap = $classMap;
+ }
+ }
+
+ /**
+ * Registers a set of PSR-0 directories for a given prefix, either
+ * appending or prepending to the ones previously set for this prefix.
+ *
+ * @param string $prefix The prefix
+ * @param array|string $paths The PSR-0 root directories
+ * @param bool $prepend Whether to prepend the directories
+ */
+ public function add($prefix, $paths, $prepend = false)
+ {
+ if (!$prefix) {
+ if ($prepend) {
+ $this->fallbackDirsPsr0 = array_merge(
+ (array) $paths,
+ $this->fallbackDirsPsr0
+ );
+ } else {
+ $this->fallbackDirsPsr0 = array_merge(
+ $this->fallbackDirsPsr0,
+ (array) $paths
+ );
+ }
+
+ return;
+ }
+
+ $first = $prefix[0];
+ if (!isset($this->prefixesPsr0[$first][$prefix])) {
+ $this->prefixesPsr0[$first][$prefix] = (array) $paths;
+
+ return;
+ }
+ if ($prepend) {
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
+ (array) $paths,
+ $this->prefixesPsr0[$first][$prefix]
+ );
+ } else {
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
+ $this->prefixesPsr0[$first][$prefix],
+ (array) $paths
+ );
+ }
+ }
+
+ /**
+ * Registers a set of PSR-4 directories for a given namespace, either
+ * appending or prepending to the ones previously set for this namespace.
+ *
+ * @param string $prefix The prefix/namespace, with trailing '\\'
+ * @param array|string $paths The PSR-4 base directories
+ * @param bool $prepend Whether to prepend the directories
+ *
+ * @throws \InvalidArgumentException
+ */
+ public function addPsr4($prefix, $paths, $prepend = false)
+ {
+ if (!$prefix) {
+ // Register directories for the root namespace.
+ if ($prepend) {
+ $this->fallbackDirsPsr4 = array_merge(
+ (array) $paths,
+ $this->fallbackDirsPsr4
+ );
+ } else {
+ $this->fallbackDirsPsr4 = array_merge(
+ $this->fallbackDirsPsr4,
+ (array) $paths
+ );
+ }
+ } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
+ // Register directories for a new namespace.
+ $length = strlen($prefix);
+ if ('\\' !== $prefix[$length - 1]) {
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
+ }
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
+ } elseif ($prepend) {
+ // Prepend directories for an already registered namespace.
+ $this->prefixDirsPsr4[$prefix] = array_merge(
+ (array) $paths,
+ $this->prefixDirsPsr4[$prefix]
+ );
+ } else {
+ // Append directories for an already registered namespace.
+ $this->prefixDirsPsr4[$prefix] = array_merge(
+ $this->prefixDirsPsr4[$prefix],
+ (array) $paths
+ );
+ }
+ }
+
+ /**
+ * Registers a set of PSR-0 directories for a given prefix,
+ * replacing any others previously set for this prefix.
+ *
+ * @param string $prefix The prefix
+ * @param array|string $paths The PSR-0 base directories
+ */
+ public function set($prefix, $paths)
+ {
+ if (!$prefix) {
+ $this->fallbackDirsPsr0 = (array) $paths;
+ } else {
+ $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
+ }
+ }
+
+ /**
+ * Registers a set of PSR-4 directories for a given namespace,
+ * replacing any others previously set for this namespace.
+ *
+ * @param string $prefix The prefix/namespace, with trailing '\\'
+ * @param array|string $paths The PSR-4 base directories
+ *
+ * @throws \InvalidArgumentException
+ */
+ public function setPsr4($prefix, $paths)
+ {
+ if (!$prefix) {
+ $this->fallbackDirsPsr4 = (array) $paths;
+ } else {
+ $length = strlen($prefix);
+ if ('\\' !== $prefix[$length - 1]) {
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
+ }
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
+ }
+ }
+
+ /**
+ * Turns on searching the include path for class files.
+ *
+ * @param bool $useIncludePath
+ */
+ public function setUseIncludePath($useIncludePath)
+ {
+ $this->useIncludePath = $useIncludePath;
+ }
+
+ /**
+ * Can be used to check if the autoloader uses the include path to check
+ * for classes.
+ *
+ * @return bool
+ */
+ public function getUseIncludePath()
+ {
+ return $this->useIncludePath;
+ }
+
+ /**
+ * Turns off searching the prefix and fallback directories for classes
+ * that have not been registered with the class map.
+ *
+ * @param bool $classMapAuthoritative
+ */
+ public function setClassMapAuthoritative($classMapAuthoritative)
+ {
+ $this->classMapAuthoritative = $classMapAuthoritative;
+ }
+
+ /**
+ * Should class lookup fail if not found in the current class map?
+ *
+ * @return bool
+ */
+ public function isClassMapAuthoritative()
+ {
+ return $this->classMapAuthoritative;
+ }
+
+ /**
+ * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
+ *
+ * @param string|null $apcuPrefix
+ */
+ public function setApcuPrefix($apcuPrefix)
+ {
+ $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
+ }
+
+ /**
+ * The APCu prefix in use, or null if APCu caching is not enabled.
+ *
+ * @return string|null
+ */
+ public function getApcuPrefix()
+ {
+ return $this->apcuPrefix;
+ }
+
+ /**
+ * Registers this instance as an autoloader.
+ *
+ * @param bool $prepend Whether to prepend the autoloader or not
+ */
+ public function register($prepend = false)
+ {
+ spl_autoload_register(array($this, 'loadClass'), true, $prepend);
+
+ if (null === $this->vendorDir) {
+ return;
+ }
+
+ if ($prepend) {
+ self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
+ } else {
+ unset(self::$registeredLoaders[$this->vendorDir]);
+ self::$registeredLoaders[$this->vendorDir] = $this;
+ }
+ }
+
+ /**
+ * Unregisters this instance as an autoloader.
+ */
+ public function unregister()
+ {
+ spl_autoload_unregister(array($this, 'loadClass'));
+
+ if (null !== $this->vendorDir) {
+ unset(self::$registeredLoaders[$this->vendorDir]);
+ }
+ }
+
+ /**
+ * Loads the given class or interface.
+ *
+ * @param string $class The name of the class
+ * @return bool|null True if loaded, null otherwise
+ */
+ public function loadClass($class)
+ {
+ if ($file = $this->findFile($class)) {
+ includeFile($file);
+
+ return true;
+ }
+ }
+
+ /**
+ * Finds the path to the file where the class is defined.
+ *
+ * @param string $class The name of the class
+ *
+ * @return string|false The path if found, false otherwise
+ */
+ public function findFile($class)
+ {
+ // class map lookup
+ if (isset($this->classMap[$class])) {
+ return $this->classMap[$class];
+ }
+ if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
+ return false;
+ }
+ if (null !== $this->apcuPrefix) {
+ $file = apcu_fetch($this->apcuPrefix.$class, $hit);
+ if ($hit) {
+ return $file;
+ }
+ }
+
+ $file = $this->findFileWithExtension($class, '.php');
+
+ // Search for Hack files if we are running on HHVM
+ if (false === $file && defined('HHVM_VERSION')) {
+ $file = $this->findFileWithExtension($class, '.hh');
+ }
+
+ if (null !== $this->apcuPrefix) {
+ apcu_add($this->apcuPrefix.$class, $file);
+ }
+
+ if (false === $file) {
+ // Remember that this class does not exist.
+ $this->missingClasses[$class] = true;
+ }
+
+ return $file;
+ }
+
+ /**
+ * Returns the currently registered loaders indexed by their corresponding vendor directories.
+ *
+ * @return self[]
+ */
+ public static function getRegisteredLoaders()
+ {
+ return self::$registeredLoaders;
+ }
+
+ private function findFileWithExtension($class, $ext)
+ {
+ // PSR-4 lookup
+ $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
+
+ $first = $class[0];
+ if (isset($this->prefixLengthsPsr4[$first])) {
+ $subPath = $class;
+ while (false !== $lastPos = strrpos($subPath, '\\')) {
+ $subPath = substr($subPath, 0, $lastPos);
+ $search = $subPath . '\\';
+ if (isset($this->prefixDirsPsr4[$search])) {
+ $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
+ foreach ($this->prefixDirsPsr4[$search] as $dir) {
+ if (file_exists($file = $dir . $pathEnd)) {
+ return $file;
+ }
+ }
+ }
+ }
+ }
+
+ // PSR-4 fallback dirs
+ foreach ($this->fallbackDirsPsr4 as $dir) {
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
+ return $file;
+ }
+ }
+
+ // PSR-0 lookup
+ if (false !== $pos = strrpos($class, '\\')) {
+ // namespaced class name
+ $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
+ . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
+ } else {
+ // PEAR-like class name
+ $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
+ }
+
+ if (isset($this->prefixesPsr0[$first])) {
+ foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
+ if (0 === strpos($class, $prefix)) {
+ foreach ($dirs as $dir) {
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
+ return $file;
+ }
+ }
+ }
+ }
+ }
+
+ // PSR-0 fallback dirs
+ foreach ($this->fallbackDirsPsr0 as $dir) {
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
+ return $file;
+ }
+ }
+
+ // PSR-0 include paths.
+ if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
+ return $file;
+ }
+
+ return false;
+ }
+}
+
+/**
+ * Scope isolated include.
+ *
+ * Prevents access to $this/self from included files.
+ */
+function includeFile($file)
+{
+ include $file;
+}
diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php
new file mode 100644
index 000000000..e23c30693
--- /dev/null
+++ b/vendor/composer/InstalledVersions.php
@@ -0,0 +1,337 @@
+<?php
+
+
+
+
+
+
+
+
+
+
+
+namespace Composer;
+
+use Composer\Autoload\ClassLoader;
+use Composer\Semver\VersionParser;
+
+
+
+
+
+
+class InstalledVersions
+{
+private static $installed = array (
+ 'root' =>
+ array (
+ 'pretty_version' => 'dev-master',
+ 'version' => 'dev-master',
+ 'aliases' =>
+ array (
+ ),
+ 'reference' => 'bc4475b6698f5a74e475674aa7af43253c459892',
+ 'name' => '__root__',
+ ),
+ 'versions' =>
+ array (
+ '__root__' =>
+ array (
+ 'pretty_version' => 'dev-master',
+ 'version' => 'dev-master',
+ 'aliases' =>
+ array (
+ ),
+ 'reference' => 'bc4475b6698f5a74e475674aa7af43253c459892',
+ ),
+ 'beberlei/assert' =>
+ array (
+ 'pretty_version' => 'v3.2.7',
+ 'version' => '3.2.7.0',
+ 'aliases' =>
+ array (
+ ),
+ 'reference' => 'd63a6943fc4fd1a2aedb65994e3548715105abcf',
+ ),
+ 'chillerlan/php-qrcode' =>
+ array (
+ 'pretty_version' => '3.4.0',
+ 'version' => '3.4.0.0',
+ 'aliases' =>
+ array (
+ ),
+ 'reference' => 'd8bf297e6843a53aeaa8f3285ce04fc349d133d6',
+ ),
+ 'chillerlan/php-settings-container' =>
+ array (
+ 'pretty_version' => '1.2.1',
+ 'version' => '1.2.1.0',
+ 'aliases' =>
+ array (
+ ),
+ 'reference' => 'b9b0431dffd74102ee92348a63b4c33fc8ba639b',
+ ),
+ 'paragonie/constant_time_encoding' =>
+ array (
+ 'pretty_version' => 'v2.4.0',
+ 'version' => '2.4.0.0',
+ 'aliases' =>
+ array (
+ ),
+ 'reference' => 'f34c2b11eb9d2c9318e13540a1dbc2a3afbd939c',
+ ),
+ 'spomky-labs/otphp' =>
+ array (
+ 'pretty_version' => 'v10.0.1',
+ 'version' => '10.0.1.0',
+ 'aliases' =>
+ array (
+ ),
+ 'reference' => 'f44cce5a9db4b8da410215d992110482c931232f',
+ ),
+ 'thecodingmachine/safe' =>
+ array (
+ 'pretty_version' => 'v1.3.3',
+ 'version' => '1.3.3.0',
+ 'aliases' =>
+ array (
+ ),
+ 'reference' => 'a8ab0876305a4cdaef31b2350fcb9811b5608dbc',
+ ),
+ ),
+);
+private static $canGetVendors;
+private static $installedByVendor = array();
+
+
+
+
+
+
+
+public static function getInstalledPackages()
+{
+$packages = array();
+foreach (self::getInstalled() as $installed) {
+$packages[] = array_keys($installed['versions']);
+}
+
+
+if (1 === \count($packages)) {
+return $packages[0];
+}
+
+return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
+}
+
+
+
+
+
+
+
+
+
+public static function isInstalled($packageName)
+{
+foreach (self::getInstalled() as $installed) {
+if (isset($installed['versions'][$packageName])) {
+return true;
+}
+}
+
+return false;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+public static function satisfies(VersionParser $parser, $packageName, $constraint)
+{
+$constraint = $parser->parseConstraints($constraint);
+$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
+
+return $provided->matches($constraint);
+}
+
+
+
+
+
+
+
+
+
+
+public static function getVersionRanges($packageName)
+{
+foreach (self::getInstalled() as $installed) {
+if (!isset($installed['versions'][$packageName])) {
+continue;
+}
+
+$ranges = array();
+if (isset($installed['versions'][$packageName]['pretty_version'])) {
+$ranges[] = $installed['versions'][$packageName]['pretty_version'];
+}
+if (array_key_exists('aliases', $installed['versions'][$packageName])) {
+$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
+}
+if (array_key_exists('replaced', $installed['versions'][$packageName])) {
+$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
+}
+if (array_key_exists('provided', $installed['versions'][$packageName])) {
+$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
+}
+
+return implode(' || ', $ranges);
+}
+
+throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+}
+
+
+
+
+
+public static function getVersion($packageName)
+{
+foreach (self::getInstalled() as $installed) {
+if (!isset($installed['versions'][$packageName])) {
+continue;
+}
+
+if (!isset($installed['versions'][$packageName]['version'])) {
+return null;
+}
+
+return $installed['versions'][$packageName]['version'];
+}
+
+throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+}
+
+
+
+
+
+public static function getPrettyVersion($packageName)
+{
+foreach (self::getInstalled() as $installed) {
+if (!isset($installed['versions'][$packageName])) {
+continue;
+}
+
+if (!isset($installed['versions'][$packageName]['pretty_version'])) {
+return null;
+}
+
+return $installed['versions'][$packageName]['pretty_version'];
+}
+
+throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+}
+
+
+
+
+
+public static function getReference($packageName)
+{
+foreach (self::getInstalled() as $installed) {
+if (!isset($installed['versions'][$packageName])) {
+continue;
+}
+
+if (!isset($installed['versions'][$packageName]['reference'])) {
+return null;
+}
+
+return $installed['versions'][$packageName]['reference'];
+}
+
+throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+}
+
+
+
+
+
+public static function getRootPackage()
+{
+$installed = self::getInstalled();
+
+return $installed[0]['root'];
+}
+
+
+
+
+
+
+
+public static function getRawData()
+{
+return self::$installed;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+public static function reload($data)
+{
+self::$installed = $data;
+self::$installedByVendor = array();
+}
+
+
+
+
+private static function getInstalled()
+{
+if (null === self::$canGetVendors) {
+self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
+}
+
+$installed = array();
+
+if (self::$canGetVendors) {
+foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
+if (isset(self::$installedByVendor[$vendorDir])) {
+$installed[] = self::$installedByVendor[$vendorDir];
+} elseif (is_file($vendorDir.'/composer/installed.php')) {
+$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
+}
+}
+}
+
+$installed[] = self::$installed;
+
+return $installed;
+}
+}
diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE
new file mode 100644
index 000000000..f27399a04
--- /dev/null
+++ b/vendor/composer/LICENSE
@@ -0,0 +1,21 @@
+
+Copyright (c) Nils Adermann, Jordi Boggiano
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php
new file mode 100644
index 000000000..b26f1b13b
--- /dev/null
+++ b/vendor/composer/autoload_classmap.php
@@ -0,0 +1,10 @@
+<?php
+
+// autoload_classmap.php @generated by Composer
+
+$vendorDir = dirname(dirname(__FILE__));
+$baseDir = dirname($vendorDir);
+
+return array(
+ 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
+);
diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php
new file mode 100644
index 000000000..a2686669c
--- /dev/null
+++ b/vendor/composer/autoload_files.php
@@ -0,0 +1,99 @@
+<?php
+
+// autoload_files.php @generated by Composer
+
+$vendorDir = dirname(dirname(__FILE__));
+$baseDir = dirname($vendorDir);
+
+return array(
+ 'a4ecaeafb8cfb009ad0e052c90355e98' => $vendorDir . '/beberlei/assert/lib/Assert/functions.php',
+ '51fcf4e06c07cc00c920b44bcd900e7a' => $vendorDir . '/thecodingmachine/safe/deprecated/apc.php',
+ '47f619d9197b36cf5ab70738d7743fe2' => $vendorDir . '/thecodingmachine/safe/deprecated/libevent.php',
+ 'ea6bb8a12ef9b68f6ada99058e530760' => $vendorDir . '/thecodingmachine/safe/deprecated/mssql.php',
+ '9a29089eb3ce41a446744c68a00f118c' => $vendorDir . '/thecodingmachine/safe/deprecated/stats.php',
+ '72243e5536b63e298acb6476f01f1aff' => $vendorDir . '/thecodingmachine/safe/lib/special_cases.php',
+ '3f648889e687f31c52f949ba8a9d0873' => $vendorDir . '/thecodingmachine/safe/generated/apache.php',
+ 'eeb4581d958421a4244aaa4167c6a575' => $vendorDir . '/thecodingmachine/safe/generated/apcu.php',
+ '04cb0b3c1dac5b5ddb23c14e3d66dbe9' => $vendorDir . '/thecodingmachine/safe/generated/array.php',
+ '450b332a74a9a21e043c5e953485a791' => $vendorDir . '/thecodingmachine/safe/generated/bzip2.php',
+ '6e9b7954ecfd7cbb9ca239319d1acdb6' => $vendorDir . '/thecodingmachine/safe/generated/calendar.php',
+ '2c6d7e8bd2de9a272a9d4d43b0a4304a' => $vendorDir . '/thecodingmachine/safe/generated/classobj.php',
+ '0b8231c1ad0865447c988a4c16b4001f' => $vendorDir . '/thecodingmachine/safe/generated/com.php',
+ '7643a71fe1c3256058c8fee234cb86e5' => $vendorDir . '/thecodingmachine/safe/generated/cubrid.php',
+ '68e1365710575942efc1d55000032cee' => $vendorDir . '/thecodingmachine/safe/generated/curl.php',
+ '02fd26bca803106c5b942a7197c3ad8b' => $vendorDir . '/thecodingmachine/safe/generated/datetime.php',
+ 'f4817dcbd956cd221b1c31f6fbd5749c' => $vendorDir . '/thecodingmachine/safe/generated/dir.php',
+ '51c3f2d10ca61a70dbcea0e38d8e902d' => $vendorDir . '/thecodingmachine/safe/generated/eio.php',
+ '1d34f34327ca3e81535963016e3be2c3' => $vendorDir . '/thecodingmachine/safe/generated/errorfunc.php',
+ '4fd0ba2d3717b0424d474bebfdafa2b4' => $vendorDir . '/thecodingmachine/safe/generated/exec.php',
+ '98f4dae054bc7fb19c13be14935cbdd3' => $vendorDir . '/thecodingmachine/safe/generated/fileinfo.php',
+ '5530ae063ba88323eaf0a07904efdf85' => $vendorDir . '/thecodingmachine/safe/generated/filesystem.php',
+ '633f4f134975d70e97bddad83348e91a' => $vendorDir . '/thecodingmachine/safe/generated/filter.php',
+ 'fbd163fc68c5faf73d5ed4002ffd836d' => $vendorDir . '/thecodingmachine/safe/generated/fpm.php',
+ '21b511999d61411fab0692ff8795bbed' => $vendorDir . '/thecodingmachine/safe/generated/ftp.php',
+ '85fbd73fc92365cd90526b0ea03cae3a' => $vendorDir . '/thecodingmachine/safe/generated/funchand.php',
+ '51df9c146e0b7dcbdf358d8abd24dbdc' => $vendorDir . '/thecodingmachine/safe/generated/gmp.php',
+ '93bb7fe678d7dcfb1322f8e3475a48b0' => $vendorDir . '/thecodingmachine/safe/generated/gnupg.php',
+ 'c171ba99cf316379ff66468392bf4950' => $vendorDir . '/thecodingmachine/safe/generated/hash.php',
+ '5ab4aad4c28e468209fbfcceb2e5e6a5' => $vendorDir . '/thecodingmachine/safe/generated/ibase.php',
+ '4d57409c5e8e576b0c64c08d9d731cfb' => $vendorDir . '/thecodingmachine/safe/generated/ibmDb2.php',
+ 'eeb246d5403972a9d62106e4a4883496' => $vendorDir . '/thecodingmachine/safe/generated/iconv.php',
+ 'c28a05f498c01b810a714f7214b7a8da' => $vendorDir . '/thecodingmachine/safe/generated/image.php',
+ '8063cd92acdf00fd978b5599eb7cc142' => $vendorDir . '/thecodingmachine/safe/generated/imap.php',
+ '8bd26dbe768e9c9599edad7b198e5446' => $vendorDir . '/thecodingmachine/safe/generated/info.php',
+ '0c577fe603b029d4b65c84376b15dbd5' => $vendorDir . '/thecodingmachine/safe/generated/ingres-ii.php',
+ 'd4362910bde43c0f956b52527effd7d4' => $vendorDir . '/thecodingmachine/safe/generated/inotify.php',
+ '696ba49197d9b55f0428a12bb5a818e1' => $vendorDir . '/thecodingmachine/safe/generated/json.php',
+ '9818aaa99c8647c63f8ef62b7a368160' => $vendorDir . '/thecodingmachine/safe/generated/ldap.php',
+ 'bcf523ff2a195eb08e0fbb668ed784d0' => $vendorDir . '/thecodingmachine/safe/generated/libxml.php',
+ '68be68a9a8b95bb56cab6109ff03bc88' => $vendorDir . '/thecodingmachine/safe/generated/lzf.php',
+ 'bdca804bb0904ea9f53f328dfc0bb8a5' => $vendorDir . '/thecodingmachine/safe/generated/mailparse.php',
+ 'b0a3fcac3eaf55445796d6af26b89366' => $vendorDir . '/thecodingmachine/safe/generated/mbstring.php',
+ '98de16b8db03eb0cb4d318b4402215a6' => $vendorDir . '/thecodingmachine/safe/generated/misc.php',
+ 'c112440003b56e243b192c11fa9d836e' => $vendorDir . '/thecodingmachine/safe/generated/msql.php',
+ '7cefd81607cd21b8b3a15656eb6465f5' => $vendorDir . '/thecodingmachine/safe/generated/mysql.php',
+ 'aaf438b080089c6d0686679cd34aa72e' => $vendorDir . '/thecodingmachine/safe/generated/mysqli.php',
+ 'df0ef890e9afbf95f3924feb1c7a89f3' => $vendorDir . '/thecodingmachine/safe/generated/mysqlndMs.php',
+ 'db595fee5972867e45c5327010d78735' => $vendorDir . '/thecodingmachine/safe/generated/mysqlndQc.php',
+ 'cbac956836b72483dcff1ac39d5c0a0f' => $vendorDir . '/thecodingmachine/safe/generated/network.php',
+ '6c8f89dfbdc117d7871f572269363f25' => $vendorDir . '/thecodingmachine/safe/generated/oci8.php',
+ '169a669966a45c06bf55ed029122729b' => $vendorDir . '/thecodingmachine/safe/generated/opcache.php',
+ 'def61bf4fecd4d4bca7354919cd69302' => $vendorDir . '/thecodingmachine/safe/generated/openssl.php',
+ '26bb010649a6d32d4120181458aa6ef2' => $vendorDir . '/thecodingmachine/safe/generated/outcontrol.php',
+ '1212c201fe43c7492a085b2c71505e0f' => $vendorDir . '/thecodingmachine/safe/generated/password.php',
+ '002ebcb842e2c0d5b7f67fe64cc93158' => $vendorDir . '/thecodingmachine/safe/generated/pcntl.php',
+ '86df38612982dade72c7085ce7eca81f' => $vendorDir . '/thecodingmachine/safe/generated/pcre.php',
+ '1cacc3e65f82a473fbd5507c7ce4385d' => $vendorDir . '/thecodingmachine/safe/generated/pdf.php',
+ '1fc22f445c69ea8706e82fce301c0831' => $vendorDir . '/thecodingmachine/safe/generated/pgsql.php',
+ 'c70b42561584f7144bff38cd63c4eef3' => $vendorDir . '/thecodingmachine/safe/generated/posix.php',
+ '9923214639c32ca5173db03a177d3b63' => $vendorDir . '/thecodingmachine/safe/generated/ps.php',
+ '7e9c3f8eae2b5bf42205c4f1295cb7a7' => $vendorDir . '/thecodingmachine/safe/generated/pspell.php',
+ '91aa91f6245c349c2e2e88bd0025f199' => $vendorDir . '/thecodingmachine/safe/generated/readline.php',
+ 'd43773cacb9e5e8e897aa255e32007d1' => $vendorDir . '/thecodingmachine/safe/generated/rpminfo.php',
+ 'f053a3849e9e8383762b34b91db0320b' => $vendorDir . '/thecodingmachine/safe/generated/rrd.php',
+ '775b964f72f827a1bf87c65ab5b10800' => $vendorDir . '/thecodingmachine/safe/generated/sem.php',
+ '816428bd69c29ab5e1ed622af5dca0cd' => $vendorDir . '/thecodingmachine/safe/generated/session.php',
+ '5093e233bedbefaef0df262bfbab0a5c' => $vendorDir . '/thecodingmachine/safe/generated/shmop.php',
+ '01352920b0151f17e671266e44b52536' => $vendorDir . '/thecodingmachine/safe/generated/simplexml.php',
+ 'b080617b1d949683c2e37f8f01dc0e15' => $vendorDir . '/thecodingmachine/safe/generated/sockets.php',
+ '2708aa182ddcfe6ce27c96acaaa40f69' => $vendorDir . '/thecodingmachine/safe/generated/sodium.php',
+ 'f1b96cb260a5baeea9a7285cda82a1ec' => $vendorDir . '/thecodingmachine/safe/generated/solr.php',
+ '3fd8853757d0fe3557c179efb807afeb' => $vendorDir . '/thecodingmachine/safe/generated/spl.php',
+ '9312ce96a51c846913fcda5f186d58dd' => $vendorDir . '/thecodingmachine/safe/generated/sqlsrv.php',
+ 'd3eb383ad0b8b962b29dc4afd29d6715' => $vendorDir . '/thecodingmachine/safe/generated/ssdeep.php',
+ '42a09bc448f441a0b9f9367ea975c0bf' => $vendorDir . '/thecodingmachine/safe/generated/ssh2.php',
+ 'ef711077d356d1b33ca0b10b67b0be8f' => $vendorDir . '/thecodingmachine/safe/generated/stream.php',
+ '764b09f6df081cbb2807b97c6ace3866' => $vendorDir . '/thecodingmachine/safe/generated/strings.php',
+ 'ef241678769fee4a44aaa288f3b78aa1' => $vendorDir . '/thecodingmachine/safe/generated/swoole.php',
+ '0efc8f6778cba932b9e2a89e28de2452' => $vendorDir . '/thecodingmachine/safe/generated/uodbc.php',
+ 'd383d32907b98af53ee9208c62204fd0' => $vendorDir . '/thecodingmachine/safe/generated/uopz.php',
+ '2fd2e4060f7fe772660f002ce38f0b71' => $vendorDir . '/thecodingmachine/safe/generated/url.php',
+ '782249e03deebeaf57b9991ff5493aa0' => $vendorDir . '/thecodingmachine/safe/generated/var.php',
+ '344440cd1cd7200fdb4f12af0d3c587f' => $vendorDir . '/thecodingmachine/safe/generated/xdiff.php',
+ '3599f369219c658a5fb6c4fe66832f62' => $vendorDir . '/thecodingmachine/safe/generated/xml.php',
+ '7fcd313da9fae337051b091b3492c21b' => $vendorDir . '/thecodingmachine/safe/generated/xmlrpc.php',
+ 'd668c74cfa92d893b582356733d9a80e' => $vendorDir . '/thecodingmachine/safe/generated/yaml.php',
+ '4af1dca6db8c527c6eed27bff85ff0e5' => $vendorDir . '/thecodingmachine/safe/generated/yaz.php',
+ 'fe43ca06499ac37bc2dedd823af71eb5' => $vendorDir . '/thecodingmachine/safe/generated/zip.php',
+ '356736db98a6834f0a886b8d509b0ecd' => $vendorDir . '/thecodingmachine/safe/generated/zlib.php',
+);
diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php
new file mode 100644
index 000000000..b7fc0125d
--- /dev/null
+++ b/vendor/composer/autoload_namespaces.php
@@ -0,0 +1,9 @@
+<?php
+
+// autoload_namespaces.php @generated by Composer
+
+$vendorDir = dirname(dirname(__FILE__));
+$baseDir = dirname($vendorDir);
+
+return array(
+);
diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php
new file mode 100644
index 000000000..b739220a2
--- /dev/null
+++ b/vendor/composer/autoload_psr4.php
@@ -0,0 +1,15 @@
+<?php
+
+// autoload_psr4.php @generated by Composer
+
+$vendorDir = dirname(dirname(__FILE__));
+$baseDir = dirname($vendorDir);
+
+return array(
+ 'chillerlan\\Settings\\' => array($vendorDir . '/chillerlan/php-settings-container/src'),
+ 'chillerlan\\QRCode\\' => array($vendorDir . '/chillerlan/php-qrcode/src'),
+ 'Safe\\' => array($vendorDir . '/thecodingmachine/safe/lib', $vendorDir . '/thecodingmachine/safe/deprecated', $vendorDir . '/thecodingmachine/safe/generated'),
+ 'ParagonIE\\ConstantTime\\' => array($vendorDir . '/paragonie/constant_time_encoding/src'),
+ 'OTPHP\\' => array($vendorDir . '/spomky-labs/otphp/src'),
+ 'Assert\\' => array($vendorDir . '/beberlei/assert/lib/Assert'),
+);
diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php
new file mode 100644
index 000000000..34b3b7ad0
--- /dev/null
+++ b/vendor/composer/autoload_real.php
@@ -0,0 +1,75 @@
+<?php
+
+// autoload_real.php @generated by Composer
+
+class ComposerAutoloaderInit19fc2ff1c0f9a92279c7979386bb2056
+{
+ private static $loader;
+
+ public static function loadClassLoader($class)
+ {
+ if ('Composer\Autoload\ClassLoader' === $class) {
+ require __DIR__ . '/ClassLoader.php';
+ }
+ }
+
+ /**
+ * @return \Composer\Autoload\ClassLoader
+ */
+ public static function getLoader()
+ {
+ if (null !== self::$loader) {
+ return self::$loader;
+ }
+
+ require __DIR__ . '/platform_check.php';
+
+ spl_autoload_register(array('ComposerAutoloaderInit19fc2ff1c0f9a92279c7979386bb2056', 'loadClassLoader'), true, true);
+ self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
+ spl_autoload_unregister(array('ComposerAutoloaderInit19fc2ff1c0f9a92279c7979386bb2056', 'loadClassLoader'));
+
+ $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
+ if ($useStaticLoader) {
+ require __DIR__ . '/autoload_static.php';
+
+ call_user_func(\Composer\Autoload\ComposerStaticInit19fc2ff1c0f9a92279c7979386bb2056::getInitializer($loader));
+ } else {
+ $map = require __DIR__ . '/autoload_namespaces.php';
+ foreach ($map as $namespace => $path) {
+ $loader->set($namespace, $path);
+ }
+
+ $map = require __DIR__ . '/autoload_psr4.php';
+ foreach ($map as $namespace => $path) {
+ $loader->setPsr4($namespace, $path);
+ }
+
+ $classMap = require __DIR__ . '/autoload_classmap.php';
+ if ($classMap) {
+ $loader->addClassMap($classMap);
+ }
+ }
+
+ $loader->register(true);
+
+ if ($useStaticLoader) {
+ $includeFiles = Composer\Autoload\ComposerStaticInit19fc2ff1c0f9a92279c7979386bb2056::$files;
+ } else {
+ $includeFiles = require __DIR__ . '/autoload_files.php';
+ }
+ foreach ($includeFiles as $fileIdentifier => $file) {
+ composerRequire19fc2ff1c0f9a92279c7979386bb2056($fileIdentifier, $file);
+ }
+
+ return $loader;
+ }
+}
+
+function composerRequire19fc2ff1c0f9a92279c7979386bb2056($fileIdentifier, $file)
+{
+ if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
+ require $file;
+
+ $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
+ }
+}
diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php
new file mode 100644
index 000000000..ac3554d3f
--- /dev/null
+++ b/vendor/composer/autoload_static.php
@@ -0,0 +1,168 @@
+<?php
+
+// autoload_static.php @generated by Composer
+
+namespace Composer\Autoload;
+
+class ComposerStaticInit19fc2ff1c0f9a92279c7979386bb2056
+{
+ public static $files = array (
+ 'a4ecaeafb8cfb009ad0e052c90355e98' => __DIR__ . '/..' . '/beberlei/assert/lib/Assert/functions.php',
+ '51fcf4e06c07cc00c920b44bcd900e7a' => __DIR__ . '/..' . '/thecodingmachine/safe/deprecated/apc.php',
+ '47f619d9197b36cf5ab70738d7743fe2' => __DIR__ . '/..' . '/thecodingmachine/safe/deprecated/libevent.php',
+ 'ea6bb8a12ef9b68f6ada99058e530760' => __DIR__ . '/..' . '/thecodingmachine/safe/deprecated/mssql.php',
+ '9a29089eb3ce41a446744c68a00f118c' => __DIR__ . '/..' . '/thecodingmachine/safe/deprecated/stats.php',
+ '72243e5536b63e298acb6476f01f1aff' => __DIR__ . '/..' . '/thecodingmachine/safe/lib/special_cases.php',
+ '3f648889e687f31c52f949ba8a9d0873' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/apache.php',
+ 'eeb4581d958421a4244aaa4167c6a575' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/apcu.php',
+ '04cb0b3c1dac5b5ddb23c14e3d66dbe9' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/array.php',
+ '450b332a74a9a21e043c5e953485a791' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/bzip2.php',
+ '6e9b7954ecfd7cbb9ca239319d1acdb6' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/calendar.php',
+ '2c6d7e8bd2de9a272a9d4d43b0a4304a' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/classobj.php',
+ '0b8231c1ad0865447c988a4c16b4001f' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/com.php',
+ '7643a71fe1c3256058c8fee234cb86e5' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/cubrid.php',
+ '68e1365710575942efc1d55000032cee' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/curl.php',
+ '02fd26bca803106c5b942a7197c3ad8b' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/datetime.php',
+ 'f4817dcbd956cd221b1c31f6fbd5749c' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/dir.php',
+ '51c3f2d10ca61a70dbcea0e38d8e902d' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/eio.php',
+ '1d34f34327ca3e81535963016e3be2c3' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/errorfunc.php',
+ '4fd0ba2d3717b0424d474bebfdafa2b4' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/exec.php',
+ '98f4dae054bc7fb19c13be14935cbdd3' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/fileinfo.php',
+ '5530ae063ba88323eaf0a07904efdf85' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/filesystem.php',
+ '633f4f134975d70e97bddad83348e91a' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/filter.php',
+ 'fbd163fc68c5faf73d5ed4002ffd836d' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/fpm.php',
+ '21b511999d61411fab0692ff8795bbed' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/ftp.php',
+ '85fbd73fc92365cd90526b0ea03cae3a' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/funchand.php',
+ '51df9c146e0b7dcbdf358d8abd24dbdc' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/gmp.php',
+ '93bb7fe678d7dcfb1322f8e3475a48b0' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/gnupg.php',
+ 'c171ba99cf316379ff66468392bf4950' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/hash.php',
+ '5ab4aad4c28e468209fbfcceb2e5e6a5' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/ibase.php',
+ '4d57409c5e8e576b0c64c08d9d731cfb' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/ibmDb2.php',
+ 'eeb246d5403972a9d62106e4a4883496' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/iconv.php',
+ 'c28a05f498c01b810a714f7214b7a8da' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/image.php',
+ '8063cd92acdf00fd978b5599eb7cc142' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/imap.php',
+ '8bd26dbe768e9c9599edad7b198e5446' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/info.php',
+ '0c577fe603b029d4b65c84376b15dbd5' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/ingres-ii.php',
+ 'd4362910bde43c0f956b52527effd7d4' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/inotify.php',
+ '696ba49197d9b55f0428a12bb5a818e1' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/json.php',
+ '9818aaa99c8647c63f8ef62b7a368160' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/ldap.php',
+ 'bcf523ff2a195eb08e0fbb668ed784d0' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/libxml.php',
+ '68be68a9a8b95bb56cab6109ff03bc88' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/lzf.php',
+ 'bdca804bb0904ea9f53f328dfc0bb8a5' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/mailparse.php',
+ 'b0a3fcac3eaf55445796d6af26b89366' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/mbstring.php',
+ '98de16b8db03eb0cb4d318b4402215a6' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/misc.php',
+ 'c112440003b56e243b192c11fa9d836e' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/msql.php',
+ '7cefd81607cd21b8b3a15656eb6465f5' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/mysql.php',
+ 'aaf438b080089c6d0686679cd34aa72e' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/mysqli.php',
+ 'df0ef890e9afbf95f3924feb1c7a89f3' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/mysqlndMs.php',
+ 'db595fee5972867e45c5327010d78735' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/mysqlndQc.php',
+ 'cbac956836b72483dcff1ac39d5c0a0f' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/network.php',
+ '6c8f89dfbdc117d7871f572269363f25' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/oci8.php',
+ '169a669966a45c06bf55ed029122729b' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/opcache.php',
+ 'def61bf4fecd4d4bca7354919cd69302' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/openssl.php',
+ '26bb010649a6d32d4120181458aa6ef2' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/outcontrol.php',
+ '1212c201fe43c7492a085b2c71505e0f' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/password.php',
+ '002ebcb842e2c0d5b7f67fe64cc93158' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/pcntl.php',
+ '86df38612982dade72c7085ce7eca81f' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/pcre.php',
+ '1cacc3e65f82a473fbd5507c7ce4385d' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/pdf.php',
+ '1fc22f445c69ea8706e82fce301c0831' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/pgsql.php',
+ 'c70b42561584f7144bff38cd63c4eef3' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/posix.php',
+ '9923214639c32ca5173db03a177d3b63' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/ps.php',
+ '7e9c3f8eae2b5bf42205c4f1295cb7a7' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/pspell.php',
+ '91aa91f6245c349c2e2e88bd0025f199' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/readline.php',
+ 'd43773cacb9e5e8e897aa255e32007d1' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/rpminfo.php',
+ 'f053a3849e9e8383762b34b91db0320b' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/rrd.php',
+ '775b964f72f827a1bf87c65ab5b10800' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/sem.php',
+ '816428bd69c29ab5e1ed622af5dca0cd' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/session.php',
+ '5093e233bedbefaef0df262bfbab0a5c' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/shmop.php',
+ '01352920b0151f17e671266e44b52536' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/simplexml.php',
+ 'b080617b1d949683c2e37f8f01dc0e15' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/sockets.php',
+ '2708aa182ddcfe6ce27c96acaaa40f69' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/sodium.php',
+ 'f1b96cb260a5baeea9a7285cda82a1ec' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/solr.php',
+ '3fd8853757d0fe3557c179efb807afeb' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/spl.php',
+ '9312ce96a51c846913fcda5f186d58dd' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/sqlsrv.php',
+ 'd3eb383ad0b8b962b29dc4afd29d6715' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/ssdeep.php',
+ '42a09bc448f441a0b9f9367ea975c0bf' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/ssh2.php',
+ 'ef711077d356d1b33ca0b10b67b0be8f' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/stream.php',
+ '764b09f6df081cbb2807b97c6ace3866' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/strings.php',
+ 'ef241678769fee4a44aaa288f3b78aa1' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/swoole.php',
+ '0efc8f6778cba932b9e2a89e28de2452' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/uodbc.php',
+ 'd383d32907b98af53ee9208c62204fd0' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/uopz.php',
+ '2fd2e4060f7fe772660f002ce38f0b71' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/url.php',
+ '782249e03deebeaf57b9991ff5493aa0' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/var.php',
+ '344440cd1cd7200fdb4f12af0d3c587f' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/xdiff.php',
+ '3599f369219c658a5fb6c4fe66832f62' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/xml.php',
+ '7fcd313da9fae337051b091b3492c21b' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/xmlrpc.php',
+ 'd668c74cfa92d893b582356733d9a80e' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/yaml.php',
+ '4af1dca6db8c527c6eed27bff85ff0e5' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/yaz.php',
+ 'fe43ca06499ac37bc2dedd823af71eb5' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/zip.php',
+ '356736db98a6834f0a886b8d509b0ecd' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/zlib.php',
+ );
+
+ public static $prefixLengthsPsr4 = array (
+ 'c' =>
+ array (
+ 'chillerlan\\Settings\\' => 20,
+ 'chillerlan\\QRCode\\' => 18,
+ ),
+ 'S' =>
+ array (
+ 'Safe\\' => 5,
+ ),
+ 'P' =>
+ array (
+ 'ParagonIE\\ConstantTime\\' => 23,
+ ),
+ 'O' =>
+ array (
+ 'OTPHP\\' => 6,
+ ),
+ 'A' =>
+ array (
+ 'Assert\\' => 7,
+ ),
+ );
+
+ public static $prefixDirsPsr4 = array (
+ 'chillerlan\\Settings\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/chillerlan/php-settings-container/src',
+ ),
+ 'chillerlan\\QRCode\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/chillerlan/php-qrcode/src',
+ ),
+ 'Safe\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/thecodingmachine/safe/lib',
+ 1 => __DIR__ . '/..' . '/thecodingmachine/safe/deprecated',
+ 2 => __DIR__ . '/..' . '/thecodingmachine/safe/generated',
+ ),
+ 'ParagonIE\\ConstantTime\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/paragonie/constant_time_encoding/src',
+ ),
+ 'OTPHP\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/spomky-labs/otphp/src',
+ ),
+ 'Assert\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/beberlei/assert/lib/Assert',
+ ),
+ );
+
+ public static $classMap = array (
+ 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
+ );
+
+ public static function getInitializer(ClassLoader $loader)
+ {
+ return \Closure::bind(function () use ($loader) {
+ $loader->prefixLengthsPsr4 = ComposerStaticInit19fc2ff1c0f9a92279c7979386bb2056::$prefixLengthsPsr4;
+ $loader->prefixDirsPsr4 = ComposerStaticInit19fc2ff1c0f9a92279c7979386bb2056::$prefixDirsPsr4;
+ $loader->classMap = ComposerStaticInit19fc2ff1c0f9a92279c7979386bb2056::$classMap;
+
+ }, null, ClassLoader::class);
+ }
+}
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
new file mode 100644
index 000000000..086e5d4a4
--- /dev/null
+++ b/vendor/composer/installed.json
@@ -0,0 +1,500 @@
+{
+ "packages": [
+ {
+ "name": "beberlei/assert",
+ "version": "v3.2.7",
+ "version_normalized": "3.2.7.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/beberlei/assert.git",
+ "reference": "d63a6943fc4fd1a2aedb65994e3548715105abcf"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/beberlei/assert/zipball/d63a6943fc4fd1a2aedb65994e3548715105abcf",
+ "reference": "d63a6943fc4fd1a2aedb65994e3548715105abcf",
+ "shasum": ""
+ },
+ "require": {
+ "ext-ctype": "*",
+ "ext-json": "*",
+ "ext-mbstring": "*",
+ "ext-simplexml": "*",
+ "php": "^7"
+ },
+ "require-dev": {
+ "friendsofphp/php-cs-fixer": "*",
+ "phpstan/phpstan-shim": "*",
+ "phpunit/phpunit": ">=6.0.0 <8"
+ },
+ "suggest": {
+ "ext-intl": "Needed to allow Assertion::count(), Assertion::isCountable(), Assertion::minCount(), and Assertion::maxCount() to operate on ResourceBundles"
+ },
+ "time": "2019-12-19T17:51:41+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Assert\\": "lib/Assert"
+ },
+ "files": [
+ "lib/Assert/functions.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-2-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Benjamin Eberlei",
+ "email": "[email protected]",
+ "role": "Lead Developer"
+ },
+ {
+ "name": "Richard Quadling",
+ "email": "[email protected]",
+ "role": "Collaborator"
+ }
+ ],
+ "description": "Thin assertion library for input validation in business models.",
+ "keywords": [
+ "assert",
+ "assertion",
+ "validation"
+ ],
+ "support": {
+ "issues": "https://github.com/beberlei/assert/issues",
+ "source": "https://github.com/beberlei/assert/tree/v3"
+ },
+ "install-path": "../beberlei/assert"
+ },
+ {
+ "name": "chillerlan/php-qrcode",
+ "version": "3.4.0",
+ "version_normalized": "3.4.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/chillerlan/php-qrcode.git",
+ "reference": "d8bf297e6843a53aeaa8f3285ce04fc349d133d6"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/chillerlan/php-qrcode/zipball/d8bf297e6843a53aeaa8f3285ce04fc349d133d6",
+ "reference": "d8bf297e6843a53aeaa8f3285ce04fc349d133d6",
+ "shasum": ""
+ },
+ "require": {
+ "chillerlan/php-settings-container": "^1.2",
+ "ext-mbstring": "*",
+ "php": "^7.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^8.5",
+ "setasign/fpdf": "^1.8.2"
+ },
+ "suggest": {
+ "chillerlan/php-authenticator": "Yet another Google authenticator! Also creates URIs for mobile apps.",
+ "setasign/fpdf": "Required to use the QR FPDF output."
+ },
+ "time": "2020-11-18T20:51:41+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "chillerlan\\QRCode\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Kazuhiko Arase",
+ "homepage": "https://github.com/kazuhikoarase"
+ },
+ {
+ "name": "Smiley",
+ "email": "[email protected]",
+ "homepage": "https://github.com/codemasher"
+ },
+ {
+ "name": "Contributors",
+ "homepage": "https://github.com/chillerlan/php-qrcode/graphs/contributors"
+ }
+ ],
+ "description": "A QR code generator. PHP 7.2+",
+ "homepage": "https://github.com/chillerlan/php-qrcode",
+ "keywords": [
+ "phpqrcode",
+ "qr",
+ "qr code",
+ "qrcode",
+ "qrcode-generator"
+ ],
+ "support": {
+ "issues": "https://github.com/chillerlan/php-qrcode/issues",
+ "source": "https://github.com/chillerlan/php-qrcode/tree/3.4.0"
+ },
+ "funding": [
+ {
+ "url": "https://www.paypal.com/donate?hosted_button_id=WLYUNAT9ZTJZ4",
+ "type": "custom"
+ },
+ {
+ "url": "https://ko-fi.com/codemasher",
+ "type": "ko_fi"
+ }
+ ],
+ "install-path": "../chillerlan/php-qrcode"
+ },
+ {
+ "name": "chillerlan/php-settings-container",
+ "version": "1.2.1",
+ "version_normalized": "1.2.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/chillerlan/php-settings-container.git",
+ "reference": "b9b0431dffd74102ee92348a63b4c33fc8ba639b"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/chillerlan/php-settings-container/zipball/b9b0431dffd74102ee92348a63b4c33fc8ba639b",
+ "reference": "b9b0431dffd74102ee92348a63b4c33fc8ba639b",
+ "shasum": ""
+ },
+ "require": {
+ "ext-json": "*",
+ "php": "^7.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^8.3"
+ },
+ "time": "2019-09-10T00:09:44+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "chillerlan\\Settings\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Smiley",
+ "email": "[email protected]",
+ "homepage": "https://github.com/codemasher"
+ }
+ ],
+ "description": "A container class for immutable settings objects. Not a DI container. PHP 7.2+",
+ "homepage": "https://github.com/chillerlan/php-settings-container",
+ "keywords": [
+ "PHP7",
+ "Settings",
+ "container",
+ "helper"
+ ],
+ "support": {
+ "issues": "https://github.com/chillerlan/php-settings-container/issues",
+ "source": "https://github.com/chillerlan/php-settings-container"
+ },
+ "install-path": "../chillerlan/php-settings-container"
+ },
+ {
+ "name": "paragonie/constant_time_encoding",
+ "version": "v2.4.0",
+ "version_normalized": "2.4.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/paragonie/constant_time_encoding.git",
+ "reference": "f34c2b11eb9d2c9318e13540a1dbc2a3afbd939c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/f34c2b11eb9d2c9318e13540a1dbc2a3afbd939c",
+ "reference": "f34c2b11eb9d2c9318e13540a1dbc2a3afbd939c",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7|^8"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^6|^7|^8|^9",
+ "vimeo/psalm": "^1|^2|^3|^4"
+ },
+ "time": "2020-12-06T15:14:20+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "ParagonIE\\ConstantTime\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Paragon Initiative Enterprises",
+ "email": "[email protected]",
+ "homepage": "https://paragonie.com",
+ "role": "Maintainer"
+ },
+ {
+ "name": "Steve 'Sc00bz' Thomas",
+ "email": "[email protected]",
+ "homepage": "https://www.tobtu.com",
+ "role": "Original Developer"
+ }
+ ],
+ "description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)",
+ "keywords": [
+ "base16",
+ "base32",
+ "base32_decode",
+ "base32_encode",
+ "base64",
+ "base64_decode",
+ "base64_encode",
+ "bin2hex",
+ "encoding",
+ "hex",
+ "hex2bin",
+ "rfc4648"
+ ],
+ "support": {
+ "email": "[email protected]",
+ "issues": "https://github.com/paragonie/constant_time_encoding/issues",
+ "source": "https://github.com/paragonie/constant_time_encoding"
+ },
+ "install-path": "../paragonie/constant_time_encoding"
+ },
+ {
+ "name": "spomky-labs/otphp",
+ "version": "v10.0.1",
+ "version_normalized": "10.0.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/Spomky-Labs/otphp.git",
+ "reference": "f44cce5a9db4b8da410215d992110482c931232f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/Spomky-Labs/otphp/zipball/f44cce5a9db4b8da410215d992110482c931232f",
+ "reference": "f44cce5a9db4b8da410215d992110482c931232f",
+ "shasum": ""
+ },
+ "require": {
+ "beberlei/assert": "^3.0",
+ "ext-mbstring": "*",
+ "paragonie/constant_time_encoding": "^2.0",
+ "php": "^7.2|^8.0",
+ "thecodingmachine/safe": "^0.1.14|^1.0"
+ },
+ "require-dev": {
+ "php-coveralls/php-coveralls": "^2.0",
+ "phpstan/phpstan": "^0.12",
+ "phpstan/phpstan-beberlei-assert": "^0.12",
+ "phpstan/phpstan-deprecation-rules": "^0.12",
+ "phpstan/phpstan-phpunit": "^0.12",
+ "phpstan/phpstan-strict-rules": "^0.12",
+ "phpunit/phpunit": "^8.0",
+ "thecodingmachine/phpstan-safe-rule": "^1.0"
+ },
+ "time": "2020-01-28T09:24:19+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "v10.0": "10.0.x-dev",
+ "v9.0": "9.0.x-dev",
+ "v8.3": "8.3.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "OTPHP\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Florent Morselli",
+ "homepage": "https://github.com/Spomky"
+ },
+ {
+ "name": "All contributors",
+ "homepage": "https://github.com/Spomky-Labs/otphp/contributors"
+ }
+ ],
+ "description": "A PHP library for generating one time passwords according to RFC 4226 (HOTP Algorithm) and the RFC 6238 (TOTP Algorithm) and compatible with Google Authenticator",
+ "homepage": "https://github.com/Spomky-Labs/otphp",
+ "keywords": [
+ "FreeOTP",
+ "RFC 4226",
+ "RFC 6238",
+ "google authenticator",
+ "hotp",
+ "otp",
+ "totp"
+ ],
+ "support": {
+ "issues": "https://github.com/Spomky-Labs/otphp/issues",
+ "source": "https://github.com/Spomky-Labs/otphp/tree/v10.0.1"
+ },
+ "install-path": "../spomky-labs/otphp"
+ },
+ {
+ "name": "thecodingmachine/safe",
+ "version": "v1.3.3",
+ "version_normalized": "1.3.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/thecodingmachine/safe.git",
+ "reference": "a8ab0876305a4cdaef31b2350fcb9811b5608dbc"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/a8ab0876305a4cdaef31b2350fcb9811b5608dbc",
+ "reference": "a8ab0876305a4cdaef31b2350fcb9811b5608dbc",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2"
+ },
+ "require-dev": {
+ "phpstan/phpstan": "^0.12",
+ "squizlabs/php_codesniffer": "^3.2",
+ "thecodingmachine/phpstan-strict-rules": "^0.12"
+ },
+ "time": "2020-10-28T17:51:34+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "0.1-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Safe\\": [
+ "lib/",
+ "deprecated/",
+ "generated/"
+ ]
+ },
+ "files": [
+ "deprecated/apc.php",
+ "deprecated/libevent.php",
+ "deprecated/mssql.php",
+ "deprecated/stats.php",
+ "lib/special_cases.php",
+ "generated/apache.php",
+ "generated/apcu.php",
+ "generated/array.php",
+ "generated/bzip2.php",
+ "generated/calendar.php",
+ "generated/classobj.php",
+ "generated/com.php",
+ "generated/cubrid.php",
+ "generated/curl.php",
+ "generated/datetime.php",
+ "generated/dir.php",
+ "generated/eio.php",
+ "generated/errorfunc.php",
+ "generated/exec.php",
+ "generated/fileinfo.php",
+ "generated/filesystem.php",
+ "generated/filter.php",
+ "generated/fpm.php",
+ "generated/ftp.php",
+ "generated/funchand.php",
+ "generated/gmp.php",
+ "generated/gnupg.php",
+ "generated/hash.php",
+ "generated/ibase.php",
+ "generated/ibmDb2.php",
+ "generated/iconv.php",
+ "generated/image.php",
+ "generated/imap.php",
+ "generated/info.php",
+ "generated/ingres-ii.php",
+ "generated/inotify.php",
+ "generated/json.php",
+ "generated/ldap.php",
+ "generated/libxml.php",
+ "generated/lzf.php",
+ "generated/mailparse.php",
+ "generated/mbstring.php",
+ "generated/misc.php",
+ "generated/msql.php",
+ "generated/mysql.php",
+ "generated/mysqli.php",
+ "generated/mysqlndMs.php",
+ "generated/mysqlndQc.php",
+ "generated/network.php",
+ "generated/oci8.php",
+ "generated/opcache.php",
+ "generated/openssl.php",
+ "generated/outcontrol.php",
+ "generated/password.php",
+ "generated/pcntl.php",
+ "generated/pcre.php",
+ "generated/pdf.php",
+ "generated/pgsql.php",
+ "generated/posix.php",
+ "generated/ps.php",
+ "generated/pspell.php",
+ "generated/readline.php",
+ "generated/rpminfo.php",
+ "generated/rrd.php",
+ "generated/sem.php",
+ "generated/session.php",
+ "generated/shmop.php",
+ "generated/simplexml.php",
+ "generated/sockets.php",
+ "generated/sodium.php",
+ "generated/solr.php",
+ "generated/spl.php",
+ "generated/sqlsrv.php",
+ "generated/ssdeep.php",
+ "generated/ssh2.php",
+ "generated/stream.php",
+ "generated/strings.php",
+ "generated/swoole.php",
+ "generated/uodbc.php",
+ "generated/uopz.php",
+ "generated/url.php",
+ "generated/var.php",
+ "generated/xdiff.php",
+ "generated/xml.php",
+ "generated/xmlrpc.php",
+ "generated/yaml.php",
+ "generated/yaz.php",
+ "generated/zip.php",
+ "generated/zlib.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "PHP core functions that throw exceptions instead of returning FALSE on error",
+ "support": {
+ "issues": "https://github.com/thecodingmachine/safe/issues",
+ "source": "https://github.com/thecodingmachine/safe/tree/v1.3.3"
+ },
+ "install-path": "../thecodingmachine/safe"
+ }
+ ],
+ "dev": true,
+ "dev-package-names": []
+}
diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php
new file mode 100644
index 000000000..ceaa850e9
--- /dev/null
+++ b/vendor/composer/installed.php
@@ -0,0 +1,78 @@
+<?php return array (
+ 'root' =>
+ array (
+ 'pretty_version' => 'dev-master',
+ 'version' => 'dev-master',
+ 'aliases' =>
+ array (
+ ),
+ 'reference' => 'bc4475b6698f5a74e475674aa7af43253c459892',
+ 'name' => '__root__',
+ ),
+ 'versions' =>
+ array (
+ '__root__' =>
+ array (
+ 'pretty_version' => 'dev-master',
+ 'version' => 'dev-master',
+ 'aliases' =>
+ array (
+ ),
+ 'reference' => 'bc4475b6698f5a74e475674aa7af43253c459892',
+ ),
+ 'beberlei/assert' =>
+ array (
+ 'pretty_version' => 'v3.2.7',
+ 'version' => '3.2.7.0',
+ 'aliases' =>
+ array (
+ ),
+ 'reference' => 'd63a6943fc4fd1a2aedb65994e3548715105abcf',
+ ),
+ 'chillerlan/php-qrcode' =>
+ array (
+ 'pretty_version' => '3.4.0',
+ 'version' => '3.4.0.0',
+ 'aliases' =>
+ array (
+ ),
+ 'reference' => 'd8bf297e6843a53aeaa8f3285ce04fc349d133d6',
+ ),
+ 'chillerlan/php-settings-container' =>
+ array (
+ 'pretty_version' => '1.2.1',
+ 'version' => '1.2.1.0',
+ 'aliases' =>
+ array (
+ ),
+ 'reference' => 'b9b0431dffd74102ee92348a63b4c33fc8ba639b',
+ ),
+ 'paragonie/constant_time_encoding' =>
+ array (
+ 'pretty_version' => 'v2.4.0',
+ 'version' => '2.4.0.0',
+ 'aliases' =>
+ array (
+ ),
+ 'reference' => 'f34c2b11eb9d2c9318e13540a1dbc2a3afbd939c',
+ ),
+ 'spomky-labs/otphp' =>
+ array (
+ 'pretty_version' => 'v10.0.1',
+ 'version' => '10.0.1.0',
+ 'aliases' =>
+ array (
+ ),
+ 'reference' => 'f44cce5a9db4b8da410215d992110482c931232f',
+ ),
+ 'thecodingmachine/safe' =>
+ array (
+ 'pretty_version' => 'v1.3.3',
+ 'version' => '1.3.3.0',
+ 'aliases' =>
+ array (
+ ),
+ 'reference' => 'a8ab0876305a4cdaef31b2350fcb9811b5608dbc',
+ ),
+ ),
+);
diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php
new file mode 100644
index 000000000..589e9e770
--- /dev/null
+++ b/vendor/composer/platform_check.php
@@ -0,0 +1,26 @@
+<?php
+
+// platform_check.php @generated by Composer
+
+$issues = array();
+
+if (!(PHP_VERSION_ID >= 70200)) {
+ $issues[] = 'Your Composer dependencies require a PHP version ">= 7.2.0". You are running ' . PHP_VERSION . '.';
+}
+
+if ($issues) {
+ if (!headers_sent()) {
+ header('HTTP/1.1 500 Internal Server Error');
+ }
+ if (!ini_get('display_errors')) {
+ if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
+ fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
+ } elseif (!headers_sent()) {
+ echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
+ }
+ }
+ trigger_error(
+ 'Composer detected issues in your platform: ' . implode(' ', $issues),
+ E_USER_ERROR
+ );
+}
diff --git a/vendor/paragonie/constant_time_encoding/.gitignore b/vendor/paragonie/constant_time_encoding/.gitignore
new file mode 100644
index 000000000..e0caea8fc
--- /dev/null
+++ b/vendor/paragonie/constant_time_encoding/.gitignore
@@ -0,0 +1,2 @@
+.idea/
+vendor/ \ No newline at end of file
diff --git a/vendor/paragonie/constant_time_encoding/.travis.yml b/vendor/paragonie/constant_time_encoding/.travis.yml
new file mode 100644
index 000000000..117c114a1
--- /dev/null
+++ b/vendor/paragonie/constant_time_encoding/.travis.yml
@@ -0,0 +1,24 @@
+language: php
+sudo: false
+
+matrix:
+ fast_finish: true
+ include:
+ - php: "7.1"
+ - php: "7.2"
+ - php: "7.3"
+ - php: "7.4"
+ - php: "8.0"
+ - php: "nightly"
+ allow_failures:
+ - php: "nightly"
+ - php: "7.4"
+ - php: "8.0"
+
+install:
+ - composer self-update
+ - composer update
+
+script:
+ - vendor/bin/phpunit
+ - vendor/bin/psalm
diff --git a/vendor/paragonie/constant_time_encoding/LICENSE.txt b/vendor/paragonie/constant_time_encoding/LICENSE.txt
new file mode 100644
index 000000000..f424f5ecc
--- /dev/null
+++ b/vendor/paragonie/constant_time_encoding/LICENSE.txt
@@ -0,0 +1,48 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 - 2020 Paragon Initiative Enterprises
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+------------------------------------------------------------------------------
+This library was based on the work of Steve "Sc00bz" Thomas.
+------------------------------------------------------------------------------
+
+The MIT License (MIT)
+
+Copyright (c) 2014 Steve Thomas
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/vendor/paragonie/constant_time_encoding/README.md b/vendor/paragonie/constant_time_encoding/README.md
new file mode 100644
index 000000000..d7db2a2d0
--- /dev/null
+++ b/vendor/paragonie/constant_time_encoding/README.md
@@ -0,0 +1,84 @@
+# Constant-Time Encoding
+
+[![Build Status](https://travis-ci.org/paragonie/constant_time_encoding.svg?branch=master)](https://travis-ci.org/paragonie/constant_time_encoding)
+[![Latest Stable Version](https://poser.pugx.org/paragonie/constant_time_encoding/v/stable)](https://packagist.org/packages/paragonie/constant_time_encoding)
+[![Latest Unstable Version](https://poser.pugx.org/paragonie/constant_time_encoding/v/unstable)](https://packagist.org/packages/paragonie/constant_time_encoding)
+[![License](https://poser.pugx.org/paragonie/constant_time_encoding/license)](https://packagist.org/packages/paragonie/constant_time_encoding)
+[![Downloads](https://img.shields.io/packagist/dt/paragonie/constant_time_encoding.svg)](https://packagist.org/packages/paragonie/constant_time_encoding)
+
+Based on the [constant-time base64 implementation made by Steve "Sc00bz" Thomas](https://github.com/Sc00bz/ConstTimeEncoding),
+this library aims to offer character encoding functions that do not leak
+information about what you are encoding/decoding via processor cache
+misses. Further reading on [cache-timing attacks](http://blog.ircmaxell.com/2014/11/its-all-about-time.html).
+
+Our fork offers the following enchancements:
+
+* `mbstring.func_overload` resistance
+* Unit tests
+* Composer- and Packagist-ready
+* Base16 encoding
+* Base32 encoding
+* Uses `pack()` and `unpack()` instead of `chr()` and `ord()`
+
+## PHP Version Requirements
+
+Version 2 of this library should work on **PHP 7** or newer. For PHP 5
+support, see [the v1.x branch](https://github.com/paragonie/constant_time_encoding/tree/v1.x).
+
+If you are adding this as a dependency to a project intended to work on both PHP 5 and PHP 7, please set the required version to `^1|^2` instead of just `^1` or `^2`.
+
+## How to Install
+
+```sh
+composer require paragonie/constant_time_encoding
+```
+
+## How to Use
+
+```php
+use \ParagonIE\ConstantTime\Encoding;
+
+// possibly (if applicable):
+// require 'vendor/autoload.php';
+
+$data = random_bytes(32);
+echo Encoding::base64Encode($data), "\n";
+echo Encoding::base32EncodeUpper($data), "\n";
+echo Encoding::base32Encode($data), "\n";
+echo Encoding::hexEncode($data), "\n";
+echo Encoding::hexEncodeUpper($data), "\n";
+```
+
+Example output:
+
+```
+1VilPkeVqirlPifk5scbzcTTbMT2clp+Zkyv9VFFasE=
+2VMKKPSHSWVCVZJ6E7SONRY3ZXCNG3GE6ZZFU7TGJSX7KUKFNLAQ====
+2vmkkpshswvcvzj6e7sonry3zxcng3ge6zzfu7tgjsx7kukfnlaq====
+d558a53e4795aa2ae53e27e4e6c71bcdc4d36cc4f6725a7e664caff551456ac1
+D558A53E4795AA2AE53E27E4E6C71BDCC4D36CC4F6725A7E664CAFF551456AC1
+```
+
+If you only need a particular variant, you can just reference the
+required class like so:
+
+```php
+use \ParagonIE\ConstantTime\Base64;
+use \ParagonIE\ConstantTime\Base32;
+
+$data = random_bytes(32);
+echo Base64::encode($data), "\n";
+echo Base32::encode($data), "\n";
+```
+
+Example output:
+
+```
+1VilPkeVqirlPifk5scbzcTTbMT2clp+Zkyv9VFFasE=
+2vmkkpshswvcvzj6e7sonry3zxcng3ge6zzfu7tgjsx7kukfnlaq====
+```
+
+## Support Contracts
+
+If your company uses this library in their products or services, you may be
+interested in [purchasing a support contract from Paragon Initiative Enterprises](https://paragonie.com/enterprise).
diff --git a/vendor/paragonie/constant_time_encoding/composer.json b/vendor/paragonie/constant_time_encoding/composer.json
new file mode 100644
index 000000000..583fe366f
--- /dev/null
+++ b/vendor/paragonie/constant_time_encoding/composer.json
@@ -0,0 +1,51 @@
+{
+ "name": "paragonie/constant_time_encoding",
+ "description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)",
+ "keywords": [
+ "base64",
+ "encoding",
+ "rfc4648",
+ "base32",
+ "base16",
+ "hex",
+ "bin2hex",
+ "hex2bin",
+ "base64_encode",
+ "base64_decode",
+ "base32_encode",
+ "base32_decode"
+ ],
+ "license": "MIT",
+ "type": "library",
+ "authors": [
+ {
+ "name": "Paragon Initiative Enterprises",
+ "email": "[email protected]",
+ "homepage": "https://paragonie.com",
+ "role": "Maintainer"
+ },
+ {
+ "name": "Steve 'Sc00bz' Thomas",
+ "email": "[email protected]",
+ "homepage": "https://www.tobtu.com",
+ "role": "Original Developer"
+ }
+ ],
+ "support": {
+ "issues": "https://github.com/paragonie/constant_time_encoding/issues",
+ "email": "[email protected]",
+ "source": "https://github.com/paragonie/constant_time_encoding"
+ },
+ "require": {
+ "php": "^7|^8"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^6|^7|^8|^9",
+ "vimeo/psalm": "^1|^2|^3|^4"
+ },
+ "autoload": {
+ "psr-4": {
+ "ParagonIE\\ConstantTime\\": "src/"
+ }
+ }
+}
diff --git a/vendor/paragonie/constant_time_encoding/phpunit.xml.dist b/vendor/paragonie/constant_time_encoding/phpunit.xml.dist
new file mode 100644
index 000000000..4d090343e
--- /dev/null
+++ b/vendor/paragonie/constant_time_encoding/phpunit.xml.dist
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="true" backupStaticAttributes="false" bootstrap="vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnError="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
+ <coverage processUncoveredFiles="true">
+ <include>
+ <directory suffix=".php">./src</directory>
+ </include>
+ </coverage>
+ <testsuites>
+ <testsuite name="Constant Time Encoding Test Suite">
+ <directory suffix="Test.php">./tests</directory>
+ </testsuite>
+ </testsuites>
+</phpunit>
diff --git a/vendor/paragonie/constant_time_encoding/psalm.xml b/vendor/paragonie/constant_time_encoding/psalm.xml
new file mode 100644
index 000000000..0a17264b0
--- /dev/null
+++ b/vendor/paragonie/constant_time_encoding/psalm.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<psalm
+ useDocblockTypes="true"
+ totallyTyped="true"
+>
+ <projectFiles>
+ <directory name="src" />
+ </projectFiles>
+</psalm>
diff --git a/vendor/paragonie/constant_time_encoding/src/Base32.php b/vendor/paragonie/constant_time_encoding/src/Base32.php
new file mode 100644
index 000000000..7784bafbf
--- /dev/null
+++ b/vendor/paragonie/constant_time_encoding/src/Base32.php
@@ -0,0 +1,471 @@
+<?php
+declare(strict_types=1);
+namespace ParagonIE\ConstantTime;
+
+/**
+ * Copyright (c) 2016 - 2018 Paragon Initiative Enterprises.
+ * Copyright (c) 2014 Steve "Sc00bz" Thomas (steve at tobtu dot com)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/**
+ * Class Base32
+ * [A-Z][2-7]
+ *
+ * @package ParagonIE\ConstantTime
+ */
+abstract class Base32 implements EncoderInterface
+{
+ /**
+ * Decode a Base32-encoded string into raw binary
+ *
+ * @param string $encodedString
+ * @param bool $strictPadding
+ * @return string
+ */
+ public static function decode(string $encodedString, bool $strictPadding = false): string
+ {
+ return static::doDecode($encodedString, false, $strictPadding);
+ }
+
+ /**
+ * Decode an uppercase Base32-encoded string into raw binary
+ *
+ * @param string $src
+ * @param bool $strictPadding
+ * @return string
+ */
+ public static function decodeUpper(string $src, bool $strictPadding = false): string
+ {
+ return static::doDecode($src, true, $strictPadding);
+ }
+
+ /**
+ * Encode into Base32 (RFC 4648)
+ *
+ * @param string $src
+ * @return string
+ * @throws \TypeError
+ */
+ public static function encode(string $src): string
+ {
+ return static::doEncode($src, false, true);
+ }
+ /**
+ * Encode into Base32 (RFC 4648)
+ *
+ * @param string $src
+ * @return string
+ * @throws \TypeError
+ */
+ public static function encodeUnpadded(string $src): string
+ {
+ return static::doEncode($src, false, false);
+ }
+
+ /**
+ * Encode into uppercase Base32 (RFC 4648)
+ *
+ * @param string $src
+ * @return string
+ * @throws \TypeError
+ */
+ public static function encodeUpper(string $src): string
+ {
+ return static::doEncode($src, true, true);
+ }
+
+ /**
+ * Encode into uppercase Base32 (RFC 4648)
+ *
+ * @param string $src
+ * @return string
+ * @throws \TypeError
+ */
+ public static function encodeUpperUnpadded(string $src): string
+ {
+ return static::doEncode($src, true, false);
+ }
+
+ /**
+ * Uses bitwise operators instead of table-lookups to turn 5-bit integers
+ * into 8-bit integers.
+ *
+ * @param int $src
+ * @return int
+ */
+ protected static function decode5Bits(int $src): int
+ {
+ $ret = -1;
+
+ // if ($src > 96 && $src < 123) $ret += $src - 97 + 1; // -64
+ $ret += (((0x60 - $src) & ($src - 0x7b)) >> 8) & ($src - 96);
+
+ // if ($src > 0x31 && $src < 0x38) $ret += $src - 24 + 1; // -23
+ $ret += (((0x31 - $src) & ($src - 0x38)) >> 8) & ($src - 23);
+
+ return $ret;
+ }
+
+ /**
+ * Uses bitwise operators instead of table-lookups to turn 5-bit integers
+ * into 8-bit integers.
+ *
+ * Uppercase variant.
+ *
+ * @param int $src
+ * @return int
+ */
+ protected static function decode5BitsUpper(int $src): int
+ {
+ $ret = -1;
+
+ // if ($src > 64 && $src < 91) $ret += $src - 65 + 1; // -64
+ $ret += (((0x40 - $src) & ($src - 0x5b)) >> 8) & ($src - 64);
+
+ // if ($src > 0x31 && $src < 0x38) $ret += $src - 24 + 1; // -23
+ $ret += (((0x31 - $src) & ($src - 0x38)) >> 8) & ($src - 23);
+
+ return $ret;
+ }
+
+ /**
+ * Uses bitwise operators instead of table-lookups to turn 8-bit integers
+ * into 5-bit integers.
+ *
+ * @param int $src
+ * @return string
+ */
+ protected static function encode5Bits(int $src): string
+ {
+ $diff = 0x61;
+
+ // if ($src > 25) $ret -= 72;
+ $diff -= ((25 - $src) >> 8) & 73;
+
+ return \pack('C', $src + $diff);
+ }
+
+ /**
+ * Uses bitwise operators instead of table-lookups to turn 8-bit integers
+ * into 5-bit integers.
+ *
+ * Uppercase variant.
+ *
+ * @param int $src
+ * @return string
+ */
+ protected static function encode5BitsUpper(int $src): string
+ {
+ $diff = 0x41;
+
+ // if ($src > 25) $ret -= 40;
+ $diff -= ((25 - $src) >> 8) & 41;
+
+ return \pack('C', $src + $diff);
+ }
+
+
+ /**
+ * Base32 decoding
+ *
+ * @param string $src
+ * @param bool $upper
+ * @param bool $strictPadding
+ * @return string
+ * @throws \TypeError
+ * @psalm-suppress RedundantCondition
+ */
+ protected static function doDecode(string $src, bool $upper = false, bool $strictPadding = false): string
+ {
+ // We do this to reduce code duplication:
+ $method = $upper
+ ? 'decode5BitsUpper'
+ : 'decode5Bits';
+
+ // Remove padding
+ $srcLen = Binary::safeStrlen($src);
+ if ($srcLen === 0) {
+ return '';
+ }
+ if ($strictPadding) {
+ if (($srcLen & 7) === 0) {
+ for ($j = 0; $j < 7; ++$j) {
+ if ($src[$srcLen - 1] === '=') {
+ $srcLen--;
+ } else {
+ break;
+ }
+ }
+ }
+ if (($srcLen & 7) === 1) {
+ throw new \RangeException(
+ 'Incorrect padding'
+ );
+ }
+ } else {
+ $src = \rtrim($src, '=');
+ $srcLen = Binary::safeStrlen($src);
+ }
+
+ $err = 0;
+ $dest = '';
+ // Main loop (no padding):
+ for ($i = 0; $i + 8 <= $srcLen; $i += 8) {
+ /** @var array<int, int> $chunk */
+ $chunk = \unpack('C*', Binary::safeSubstr($src, $i, 8));
+ /** @var int $c0 */
+ $c0 = static::$method($chunk[1]);
+ /** @var int $c1 */
+ $c1 = static::$method($chunk[2]);
+ /** @var int $c2 */
+ $c2 = static::$method($chunk[3]);
+ /** @var int $c3 */
+ $c3 = static::$method($chunk[4]);
+ /** @var int $c4 */
+ $c4 = static::$method($chunk[5]);
+ /** @var int $c5 */
+ $c5 = static::$method($chunk[6]);
+ /** @var int $c6 */
+ $c6 = static::$method($chunk[7]);
+ /** @var int $c7 */
+ $c7 = static::$method($chunk[8]);
+
+ $dest .= \pack(
+ 'CCCCC',
+ (($c0 << 3) | ($c1 >> 2) ) & 0xff,
+ (($c1 << 6) | ($c2 << 1) | ($c3 >> 4)) & 0xff,
+ (($c3 << 4) | ($c4 >> 1) ) & 0xff,
+ (($c4 << 7) | ($c5 << 2) | ($c6 >> 3)) & 0xff,
+ (($c6 << 5) | ($c7 ) ) & 0xff
+ );
+ $err |= ($c0 | $c1 | $c2 | $c3 | $c4 | $c5 | $c6 | $c7) >> 8;
+ }
+ // The last chunk, which may have padding:
+ if ($i < $srcLen) {
+ /** @var array<int, int> $chunk */
+ $chunk = \unpack('C*', Binary::safeSubstr($src, $i, $srcLen - $i));
+ /** @var int $c0 */
+ $c0 = static::$method($chunk[1]);
+
+ if ($i + 6 < $srcLen) {
+ /** @var int $c1 */
+ $c1 = static::$method($chunk[2]);
+ /** @var int $c2 */
+ $c2 = static::$method($chunk[3]);
+ /** @var int $c3 */
+ $c3 = static::$method($chunk[4]);
+ /** @var int $c4 */
+ $c4 = static::$method($chunk[5]);
+ /** @var int $c5 */
+ $c5 = static::$method($chunk[6]);
+ /** @var int $c6 */
+ $c6 = static::$method($chunk[7]);
+
+ $dest .= \pack(
+ 'CCCC',
+ (($c0 << 3) | ($c1 >> 2) ) & 0xff,
+ (($c1 << 6) | ($c2 << 1) | ($c3 >> 4)) & 0xff,
+ (($c3 << 4) | ($c4 >> 1) ) & 0xff,
+ (($c4 << 7) | ($c5 << 2) | ($c6 >> 3)) & 0xff
+ );
+ $err |= ($c0 | $c1 | $c2 | $c3 | $c4 | $c5 | $c6) >> 8;
+ } elseif ($i + 5 < $srcLen) {
+ /** @var int $c1 */
+ $c1 = static::$method($chunk[2]);
+ /** @var int $c2 */
+ $c2 = static::$method($chunk[3]);
+ /** @var int $c3 */
+ $c3 = static::$method($chunk[4]);
+ /** @var int $c4 */
+ $c4 = static::$method($chunk[5]);
+ /** @var int $c5 */
+ $c5 = static::$method($chunk[6]);
+
+ $dest .= \pack(
+ 'CCCC',
+ (($c0 << 3) | ($c1 >> 2) ) & 0xff,
+ (($c1 << 6) | ($c2 << 1) | ($c3 >> 4)) & 0xff,
+ (($c3 << 4) | ($c4 >> 1) ) & 0xff,
+ (($c4 << 7) | ($c5 << 2) ) & 0xff
+ );
+ $err |= ($c0 | $c1 | $c2 | $c3 | $c4 | $c5) >> 8;
+ } elseif ($i + 4 < $srcLen) {
+ /** @var int $c1 */
+ $c1 = static::$method($chunk[2]);
+ /** @var int $c2 */
+ $c2 = static::$method($chunk[3]);
+ /** @var int $c3 */
+ $c3 = static::$method($chunk[4]);
+ /** @var int $c4 */
+ $c4 = static::$method($chunk[5]);
+
+ $dest .= \pack(
+ 'CCC',
+ (($c0 << 3) | ($c1 >> 2) ) & 0xff,
+ (($c1 << 6) | ($c2 << 1) | ($c3 >> 4)) & 0xff,
+ (($c3 << 4) | ($c4 >> 1) ) & 0xff
+ );
+ $err |= ($c0 | $c1 | $c2 | $c3 | $c4) >> 8;
+ } elseif ($i + 3 < $srcLen) {
+ /** @var int $c1 */
+ $c1 = static::$method($chunk[2]);
+ /** @var int $c2 */
+ $c2 = static::$method($chunk[3]);
+ /** @var int $c3 */
+ $c3 = static::$method($chunk[4]);
+
+ $dest .= \pack(
+ 'CC',
+ (($c0 << 3) | ($c1 >> 2) ) & 0xff,
+ (($c1 << 6) | ($c2 << 1) | ($c3 >> 4)) & 0xff
+ );
+ $err |= ($c0 | $c1 | $c2 | $c3) >> 8;
+ } elseif ($i + 2 < $srcLen) {
+ /** @var int $c1 */
+ $c1 = static::$method($chunk[2]);
+ /** @var int $c2 */
+ $c2 = static::$method($chunk[3]);
+
+ $dest .= \pack(
+ 'CC',
+ (($c0 << 3) | ($c1 >> 2) ) & 0xff,
+ (($c1 << 6) | ($c2 << 1) ) & 0xff
+ );
+ $err |= ($c0 | $c1 | $c2) >> 8;
+ } elseif ($i + 1 < $srcLen) {
+ /** @var int $c1 */
+ $c1 = static::$method($chunk[2]);
+
+ $dest .= \pack(
+ 'C',
+ (($c0 << 3) | ($c1 >> 2) ) & 0xff
+ );
+ $err |= ($c0 | $c1) >> 8;
+ } else {
+ $dest .= \pack(
+ 'C',
+ (($c0 << 3) ) & 0xff
+ );
+ $err |= ($c0) >> 8;
+ }
+ }
+ /** @var bool $check */
+ $check = ($err === 0);
+ if (!$check) {
+ throw new \RangeException(
+ 'Base32::doDecode() only expects characters in the correct base32 alphabet'
+ );
+ }
+ return $dest;
+ }
+
+ /**
+ * Base32 Encoding
+ *
+ * @param string $src
+ * @param bool $upper
+ * @param bool $pad
+ * @return string
+ * @throws \TypeError
+ */
+ protected static function doEncode(string $src, bool $upper = false, $pad = true): string
+ {
+ // We do this to reduce code duplication:
+ $method = $upper
+ ? 'encode5BitsUpper'
+ : 'encode5Bits';
+
+ $dest = '';
+ $srcLen = Binary::safeStrlen($src);
+
+ // Main loop (no padding):
+ for ($i = 0; $i + 5 <= $srcLen; $i += 5) {
+ /** @var array<int, int> $chunk */
+ $chunk = \unpack('C*', Binary::safeSubstr($src, $i, 5));
+ $b0 = $chunk[1];
+ $b1 = $chunk[2];
+ $b2 = $chunk[3];
+ $b3 = $chunk[4];
+ $b4 = $chunk[5];
+ $dest .=
+ static::$method( ($b0 >> 3) & 31) .
+ static::$method((($b0 << 2) | ($b1 >> 6)) & 31) .
+ static::$method((($b1 >> 1) ) & 31) .
+ static::$method((($b1 << 4) | ($b2 >> 4)) & 31) .
+ static::$method((($b2 << 1) | ($b3 >> 7)) & 31) .
+ static::$method((($b3 >> 2) ) & 31) .
+ static::$method((($b3 << 3) | ($b4 >> 5)) & 31) .
+ static::$method( $b4 & 31);
+ }
+ // The last chunk, which may have padding:
+ if ($i < $srcLen) {
+ /** @var array<int, int> $chunk */
+ $chunk = \unpack('C*', Binary::safeSubstr($src, $i, $srcLen - $i));
+ $b0 = $chunk[1];
+ if ($i + 3 < $srcLen) {
+ $b1 = $chunk[2];
+ $b2 = $chunk[3];
+ $b3 = $chunk[4];
+ $dest .=
+ static::$method( ($b0 >> 3) & 31) .
+ static::$method((($b0 << 2) | ($b1 >> 6)) & 31) .
+ static::$method((($b1 >> 1) ) & 31) .
+ static::$method((($b1 << 4) | ($b2 >> 4)) & 31) .
+ static::$method((($b2 << 1) | ($b3 >> 7)) & 31) .
+ static::$method((($b3 >> 2) ) & 31) .
+ static::$method((($b3 << 3) ) & 31);
+ if ($pad) {
+ $dest .= '=';
+ }
+ } elseif ($i + 2 < $srcLen) {
+ $b1 = $chunk[2];
+ $b2 = $chunk[3];
+ $dest .=
+ static::$method( ($b0 >> 3) & 31) .
+ static::$method((($b0 << 2) | ($b1 >> 6)) & 31) .
+ static::$method((($b1 >> 1) ) & 31) .
+ static::$method((($b1 << 4) | ($b2 >> 4)) & 31) .
+ static::$method((($b2 << 1) ) & 31);
+ if ($pad) {
+ $dest .= '===';
+ }
+ } elseif ($i + 1 < $srcLen) {
+ $b1 = $chunk[2];
+ $dest .=
+ static::$method( ($b0 >> 3) & 31) .
+ static::$method((($b0 << 2) | ($b1 >> 6)) & 31) .
+ static::$method((($b1 >> 1) ) & 31) .
+ static::$method((($b1 << 4) ) & 31);
+ if ($pad) {
+ $dest .= '====';
+ }
+ } else {
+ $dest .=
+ static::$method( ($b0 >> 3) & 31) .
+ static::$method( ($b0 << 2) & 31);
+ if ($pad) {
+ $dest .= '======';
+ }
+ }
+ }
+ return $dest;
+ }
+}
diff --git a/vendor/paragonie/constant_time_encoding/src/Base32Hex.php b/vendor/paragonie/constant_time_encoding/src/Base32Hex.php
new file mode 100644
index 000000000..68fdad52c
--- /dev/null
+++ b/vendor/paragonie/constant_time_encoding/src/Base32Hex.php
@@ -0,0 +1,111 @@
+<?php
+declare(strict_types=1);
+namespace ParagonIE\ConstantTime;
+
+/**
+ * Copyright (c) 2016 - 2018 Paragon Initiative Enterprises.
+ * Copyright (c) 2014 Steve "Sc00bz" Thomas (steve at tobtu dot com)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/**
+ * Class Base32Hex
+ * [0-9][A-V]
+ *
+ * @package ParagonIE\ConstantTime
+ */
+abstract class Base32Hex extends Base32
+{
+ /**
+ * Uses bitwise operators instead of table-lookups to turn 5-bit integers
+ * into 8-bit integers.
+ *
+ * @param int $src
+ * @return int
+ */
+ protected static function decode5Bits(int $src): int
+ {
+ $ret = -1;
+
+ // if ($src > 0x30 && $src < 0x3a) ret += $src - 0x2e + 1; // -47
+ $ret += (((0x2f - $src) & ($src - 0x3a)) >> 8) & ($src - 47);
+
+ // if ($src > 0x60 && $src < 0x77) ret += $src - 0x61 + 10 + 1; // -86
+ $ret += (((0x60 - $src) & ($src - 0x77)) >> 8) & ($src - 86);
+
+ return $ret;
+ }
+
+ /**
+ * Uses bitwise operators instead of table-lookups to turn 5-bit integers
+ * into 8-bit integers.
+ *
+ * @param int $src
+ * @return int
+ */
+ protected static function decode5BitsUpper(int $src): int
+ {
+ $ret = -1;
+
+ // if ($src > 0x30 && $src < 0x3a) ret += $src - 0x2e + 1; // -47
+ $ret += (((0x2f - $src) & ($src - 0x3a)) >> 8) & ($src - 47);
+
+ // if ($src > 0x40 && $src < 0x57) ret += $src - 0x41 + 10 + 1; // -54
+ $ret += (((0x40 - $src) & ($src - 0x57)) >> 8) & ($src - 54);
+
+ return $ret;
+ }
+
+ /**
+ * Uses bitwise operators instead of table-lookups to turn 8-bit integers
+ * into 5-bit integers.
+ *
+ * @param int $src
+ * @return string
+ */
+ protected static function encode5Bits(int $src): string
+ {
+ $src += 0x30;
+
+ // if ($src > 0x39) $src += 0x61 - 0x3a; // 39
+ $src += ((0x39 - $src) >> 8) & 39;
+
+ return \pack('C', $src);
+ }
+
+ /**
+ * Uses bitwise operators instead of table-lookups to turn 8-bit integers
+ * into 5-bit integers.
+ *
+ * Uppercase variant.
+ *
+ * @param int $src
+ * @return string
+ */
+ protected static function encode5BitsUpper(int $src): string
+ {
+ $src += 0x30;
+
+ // if ($src > 0x39) $src += 0x41 - 0x3a; // 7
+ $src += ((0x39 - $src) >> 8) & 7;
+
+ return \pack('C', $src);
+ }
+} \ No newline at end of file
diff --git a/vendor/paragonie/constant_time_encoding/src/Base64.php b/vendor/paragonie/constant_time_encoding/src/Base64.php
new file mode 100644
index 000000000..4739e4895
--- /dev/null
+++ b/vendor/paragonie/constant_time_encoding/src/Base64.php
@@ -0,0 +1,271 @@
+<?php
+declare(strict_types=1);
+namespace ParagonIE\ConstantTime;
+
+/**
+ * Copyright (c) 2016 - 2018 Paragon Initiative Enterprises.
+ * Copyright (c) 2014 Steve "Sc00bz" Thomas (steve at tobtu dot com)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/**
+ * Class Base64
+ * [A-Z][a-z][0-9]+/
+ *
+ * @package ParagonIE\ConstantTime
+ */
+abstract class Base64 implements EncoderInterface
+{
+ /**
+ * Encode into Base64
+ *
+ * Base64 character set "[A-Z][a-z][0-9]+/"
+ *
+ * @param string $src
+ * @return string
+ * @throws \TypeError
+ */
+ public static function encode(string $src): string
+ {
+ return static::doEncode($src, true);
+ }
+
+ /**
+ * Encode into Base64, no = padding
+ *
+ * Base64 character set "[A-Z][a-z][0-9]+/"
+ *
+ * @param string $src
+ * @return string
+ * @throws \TypeError
+ */
+ public static function encodeUnpadded(string $src): string
+ {
+ return static::doEncode($src, false);
+ }
+
+ /**
+ * @param string $src
+ * @param bool $pad Include = padding?
+ * @return string
+ * @throws \TypeError
+ */
+ protected static function doEncode(string $src, bool $pad = true): string
+ {
+ $dest = '';
+ $srcLen = Binary::safeStrlen($src);
+ // Main loop (no padding):
+ for ($i = 0; $i + 3 <= $srcLen; $i += 3) {
+ /** @var array<int, int> $chunk */
+ $chunk = \unpack('C*', Binary::safeSubstr($src, $i, 3));
+ $b0 = $chunk[1];
+ $b1 = $chunk[2];
+ $b2 = $chunk[3];
+
+ $dest .=
+ static::encode6Bits( $b0 >> 2 ) .
+ static::encode6Bits((($b0 << 4) | ($b1 >> 4)) & 63) .
+ static::encode6Bits((($b1 << 2) | ($b2 >> 6)) & 63) .
+ static::encode6Bits( $b2 & 63);
+ }
+ // The last chunk, which may have padding:
+ if ($i < $srcLen) {
+ /** @var array<int, int> $chunk */
+ $chunk = \unpack('C*', Binary::safeSubstr($src, $i, $srcLen - $i));
+ $b0 = $chunk[1];
+ if ($i + 1 < $srcLen) {
+ $b1 = $chunk[2];
+ $dest .=
+ static::encode6Bits($b0 >> 2) .
+ static::encode6Bits((($b0 << 4) | ($b1 >> 4)) & 63) .
+ static::encode6Bits(($b1 << 2) & 63);
+ if ($pad) {
+ $dest .= '=';
+ }
+ } else {
+ $dest .=
+ static::encode6Bits( $b0 >> 2) .
+ static::encode6Bits(($b0 << 4) & 63);
+ if ($pad) {
+ $dest .= '==';
+ }
+ }
+ }
+ return $dest;
+ }
+
+ /**
+ * decode from base64 into binary
+ *
+ * Base64 character set "./[A-Z][a-z][0-9]"
+ *
+ * @param string $encodedString
+ * @param bool $strictPadding
+ * @return string
+ * @throws \RangeException
+ * @throws \TypeError
+ * @psalm-suppress RedundantCondition
+ */
+ public static function decode(string $encodedString, bool $strictPadding = false): string
+ {
+ // Remove padding
+ $srcLen = Binary::safeStrlen($encodedString);
+ if ($srcLen === 0) {
+ return '';
+ }
+
+ if ($strictPadding) {
+ if (($srcLen & 3) === 0) {
+ if ($encodedString[$srcLen - 1] === '=') {
+ $srcLen--;
+ if ($encodedString[$srcLen - 1] === '=') {
+ $srcLen--;
+ }
+ }
+ }
+ if (($srcLen & 3) === 1) {
+ throw new \RangeException(
+ 'Incorrect padding'
+ );
+ }
+ if ($encodedString[$srcLen - 1] === '=') {
+ throw new \RangeException(
+ 'Incorrect padding'
+ );
+ }
+ } else {
+ $encodedString = \rtrim($encodedString, '=');
+ $srcLen = Binary::safeStrlen($encodedString);
+ }
+
+ $err = 0;
+ $dest = '';
+ // Main loop (no padding):
+ for ($i = 0; $i + 4 <= $srcLen; $i += 4) {
+ /** @var array<int, int> $chunk */
+ $chunk = \unpack('C*', Binary::safeSubstr($encodedString, $i, 4));
+ $c0 = static::decode6Bits($chunk[1]);
+ $c1 = static::decode6Bits($chunk[2]);
+ $c2 = static::decode6Bits($chunk[3]);
+ $c3 = static::decode6Bits($chunk[4]);
+
+ $dest .= \pack(
+ 'CCC',
+ ((($c0 << 2) | ($c1 >> 4)) & 0xff),
+ ((($c1 << 4) | ($c2 >> 2)) & 0xff),
+ ((($c2 << 6) | $c3 ) & 0xff)
+ );
+ $err |= ($c0 | $c1 | $c2 | $c3) >> 8;
+ }
+ // The last chunk, which may have padding:
+ if ($i < $srcLen) {
+ /** @var array<int, int> $chunk */
+ $chunk = \unpack('C*', Binary::safeSubstr($encodedString, $i, $srcLen - $i));
+ $c0 = static::decode6Bits($chunk[1]);
+
+ if ($i + 2 < $srcLen) {
+ $c1 = static::decode6Bits($chunk[2]);
+ $c2 = static::decode6Bits($chunk[3]);
+ $dest .= \pack(
+ 'CC',
+ ((($c0 << 2) | ($c1 >> 4)) & 0xff),
+ ((($c1 << 4) | ($c2 >> 2)) & 0xff)
+ );
+ $err |= ($c0 | $c1 | $c2) >> 8;
+ } elseif ($i + 1 < $srcLen) {
+ $c1 = static::decode6Bits($chunk[2]);
+ $dest .= \pack(
+ 'C',
+ ((($c0 << 2) | ($c1 >> 4)) & 0xff)
+ );
+ $err |= ($c0 | $c1) >> 8;
+ } elseif ($i < $srcLen && $strictPadding) {
+ $err |= 1;
+ }
+ }
+ /** @var bool $check */
+ $check = ($err === 0);
+ if (!$check) {
+ throw new \RangeException(
+ 'Base64::decode() only expects characters in the correct base64 alphabet'
+ );
+ }
+ return $dest;
+ }
+
+ /**
+ * Uses bitwise operators instead of table-lookups to turn 6-bit integers
+ * into 8-bit integers.
+ *
+ * Base64 character set:
+ * [A-Z] [a-z] [0-9] + /
+ * 0x41-0x5a, 0x61-0x7a, 0x30-0x39, 0x2b, 0x2f
+ *
+ * @param int $src
+ * @return int
+ */
+ protected static function decode6Bits(int $src): int
+ {
+ $ret = -1;
+
+ // if ($src > 0x40 && $src < 0x5b) $ret += $src - 0x41 + 1; // -64
+ $ret += (((0x40 - $src) & ($src - 0x5b)) >> 8) & ($src - 64);
+
+ // if ($src > 0x60 && $src < 0x7b) $ret += $src - 0x61 + 26 + 1; // -70
+ $ret += (((0x60 - $src) & ($src - 0x7b)) >> 8) & ($src - 70);
+
+ // if ($src > 0x2f && $src < 0x3a) $ret += $src - 0x30 + 52 + 1; // 5
+ $ret += (((0x2f - $src) & ($src - 0x3a)) >> 8) & ($src + 5);
+
+ // if ($src == 0x2b) $ret += 62 + 1;
+ $ret += (((0x2a - $src) & ($src - 0x2c)) >> 8) & 63;
+
+ // if ($src == 0x2f) ret += 63 + 1;
+ $ret += (((0x2e - $src) & ($src - 0x30)) >> 8) & 64;
+
+ return $ret;
+ }
+
+ /**
+ * Uses bitwise operators instead of table-lookups to turn 8-bit integers
+ * into 6-bit integers.
+ *
+ * @param int $src
+ * @return string
+ */
+ protected static function encode6Bits(int $src): string
+ {
+ $diff = 0x41;
+
+ // if ($src > 25) $diff += 0x61 - 0x41 - 26; // 6
+ $diff += ((25 - $src) >> 8) & 6;
+
+ // if ($src > 51) $diff += 0x30 - 0x61 - 26; // -75
+ $diff -= ((51 - $src) >> 8) & 75;
+
+ // if ($src > 61) $diff += 0x2b - 0x30 - 10; // -15
+ $diff -= ((61 - $src) >> 8) & 15;
+
+ // if ($src > 62) $diff += 0x2f - 0x2b - 1; // 3
+ $diff += ((62 - $src) >> 8) & 3;
+
+ return \pack('C', $src + $diff);
+ }
+}
diff --git a/vendor/paragonie/constant_time_encoding/src/Base64DotSlash.php b/vendor/paragonie/constant_time_encoding/src/Base64DotSlash.php
new file mode 100644
index 000000000..8ad2e2bf1
--- /dev/null
+++ b/vendor/paragonie/constant_time_encoding/src/Base64DotSlash.php
@@ -0,0 +1,88 @@
+<?php
+declare(strict_types=1);
+namespace ParagonIE\ConstantTime;
+
+/**
+ * Copyright (c) 2016 - 2018 Paragon Initiative Enterprises.
+ * Copyright (c) 2014 Steve "Sc00bz" Thomas (steve at tobtu dot com)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/**
+ * Class Base64DotSlash
+ * ./[A-Z][a-z][0-9]
+ *
+ * @package ParagonIE\ConstantTime
+ */
+abstract class Base64DotSlash extends Base64
+{
+ /**
+ * Uses bitwise operators instead of table-lookups to turn 6-bit integers
+ * into 8-bit integers.
+ *
+ * Base64 character set:
+ * ./ [A-Z] [a-z] [0-9]
+ * 0x2e-0x2f, 0x41-0x5a, 0x61-0x7a, 0x30-0x39
+ *
+ * @param int $src
+ * @return int
+ */
+ protected static function decode6Bits(int $src): int
+ {
+ $ret = -1;
+
+ // if ($src > 0x2d && $src < 0x30) ret += $src - 0x2e + 1; // -45
+ $ret += (((0x2d - $src) & ($src - 0x30)) >> 8) & ($src - 45);
+
+ // if ($src > 0x40 && $src < 0x5b) ret += $src - 0x41 + 2 + 1; // -62
+ $ret += (((0x40 - $src) & ($src - 0x5b)) >> 8) & ($src - 62);
+
+ // if ($src > 0x60 && $src < 0x7b) ret += $src - 0x61 + 28 + 1; // -68
+ $ret += (((0x60 - $src) & ($src - 0x7b)) >> 8) & ($src - 68);
+
+ // if ($src > 0x2f && $src < 0x3a) ret += $src - 0x30 + 54 + 1; // 7
+ $ret += (((0x2f - $src) & ($src - 0x3a)) >> 8) & ($src + 7);
+
+ return $ret;
+ }
+
+ /**
+ * Uses bitwise operators instead of table-lookups to turn 8-bit integers
+ * into 6-bit integers.
+ *
+ * @param int $src
+ * @return string
+ */
+ protected static function encode6Bits(int $src): string
+ {
+ $src += 0x2e;
+
+ // if ($src > 0x2f) $src += 0x41 - 0x30; // 17
+ $src += ((0x2f - $src) >> 8) & 17;
+
+ // if ($src > 0x5a) $src += 0x61 - 0x5b; // 6
+ $src += ((0x5a - $src) >> 8) & 6;
+
+ // if ($src > 0x7a) $src += 0x30 - 0x7b; // -75
+ $src -= ((0x7a - $src) >> 8) & 75;
+
+ return \pack('C', $src);
+ }
+}
diff --git a/vendor/paragonie/constant_time_encoding/src/Base64DotSlashOrdered.php b/vendor/paragonie/constant_time_encoding/src/Base64DotSlashOrdered.php
new file mode 100644
index 000000000..dd1459e85
--- /dev/null
+++ b/vendor/paragonie/constant_time_encoding/src/Base64DotSlashOrdered.php
@@ -0,0 +1,82 @@
+<?php
+declare(strict_types=1);
+namespace ParagonIE\ConstantTime;
+
+/**
+ * Copyright (c) 2016 - 2018 Paragon Initiative Enterprises.
+ * Copyright (c) 2014 Steve "Sc00bz" Thomas (steve at tobtu dot com)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/**
+ * Class Base64DotSlashOrdered
+ * ./[0-9][A-Z][a-z]
+ *
+ * @package ParagonIE\ConstantTime
+ */
+abstract class Base64DotSlashOrdered extends Base64
+{
+ /**
+ * Uses bitwise operators instead of table-lookups to turn 6-bit integers
+ * into 8-bit integers.
+ *
+ * Base64 character set:
+ * [.-9] [A-Z] [a-z]
+ * 0x2e-0x39, 0x41-0x5a, 0x61-0x7a
+ *
+ * @param int $src
+ * @return int
+ */
+ protected static function decode6Bits(int $src): int
+ {
+ $ret = -1;
+
+ // if ($src > 0x2d && $src < 0x3a) ret += $src - 0x2e + 1; // -45
+ $ret += (((0x2d - $src) & ($src - 0x3a)) >> 8) & ($src - 45);
+
+ // if ($src > 0x40 && $src < 0x5b) ret += $src - 0x41 + 12 + 1; // -52
+ $ret += (((0x40 - $src) & ($src - 0x5b)) >> 8) & ($src - 52);
+
+ // if ($src > 0x60 && $src < 0x7b) ret += $src - 0x61 + 38 + 1; // -58
+ $ret += (((0x60 - $src) & ($src - 0x7b)) >> 8) & ($src - 58);
+
+ return $ret;
+ }
+
+ /**
+ * Uses bitwise operators instead of table-lookups to turn 8-bit integers
+ * into 6-bit integers.
+ *
+ * @param int $src
+ * @return string
+ */
+ protected static function encode6Bits(int $src): string
+ {
+ $src += 0x2e;
+
+ // if ($src > 0x39) $src += 0x41 - 0x3a; // 7
+ $src += ((0x39 - $src) >> 8) & 7;
+
+ // if ($src > 0x5a) $src += 0x61 - 0x5b; // 6
+ $src += ((0x5a - $src) >> 8) & 6;
+
+ return \pack('C', $src);
+ }
+}
diff --git a/vendor/paragonie/constant_time_encoding/src/Base64UrlSafe.php b/vendor/paragonie/constant_time_encoding/src/Base64UrlSafe.php
new file mode 100644
index 000000000..1a4107527
--- /dev/null
+++ b/vendor/paragonie/constant_time_encoding/src/Base64UrlSafe.php
@@ -0,0 +1,95 @@
+<?php
+declare(strict_types=1);
+namespace ParagonIE\ConstantTime;
+
+/**
+ * Copyright (c) 2016 - 2018 Paragon Initiative Enterprises.
+ * Copyright (c) 2014 Steve "Sc00bz" Thomas (steve at tobtu dot com)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/**
+ * Class Base64UrlSafe
+ * [A-Z][a-z][0-9]\-_
+ *
+ * @package ParagonIE\ConstantTime
+ */
+abstract class Base64UrlSafe extends Base64
+{
+
+ /**
+ * Uses bitwise operators instead of table-lookups to turn 6-bit integers
+ * into 8-bit integers.
+ *
+ * Base64 character set:
+ * [A-Z] [a-z] [0-9] - _
+ * 0x41-0x5a, 0x61-0x7a, 0x30-0x39, 0x2d, 0x5f
+ *
+ * @param int $src
+ * @return int
+ */
+ protected static function decode6Bits(int $src): int
+ {
+ $ret = -1;
+
+ // if ($src > 0x40 && $src < 0x5b) $ret += $src - 0x41 + 1; // -64
+ $ret += (((0x40 - $src) & ($src - 0x5b)) >> 8) & ($src - 64);
+
+ // if ($src > 0x60 && $src < 0x7b) $ret += $src - 0x61 + 26 + 1; // -70
+ $ret += (((0x60 - $src) & ($src - 0x7b)) >> 8) & ($src - 70);
+
+ // if ($src > 0x2f && $src < 0x3a) $ret += $src - 0x30 + 52 + 1; // 5
+ $ret += (((0x2f - $src) & ($src - 0x3a)) >> 8) & ($src + 5);
+
+ // if ($src == 0x2c) $ret += 62 + 1;
+ $ret += (((0x2c - $src) & ($src - 0x2e)) >> 8) & 63;
+
+ // if ($src == 0x5f) ret += 63 + 1;
+ $ret += (((0x5e - $src) & ($src - 0x60)) >> 8) & 64;
+
+ return $ret;
+ }
+
+ /**
+ * Uses bitwise operators instead of table-lookups to turn 8-bit integers
+ * into 6-bit integers.
+ *
+ * @param int $src
+ * @return string
+ */
+ protected static function encode6Bits(int $src): string
+ {
+ $diff = 0x41;
+
+ // if ($src > 25) $diff += 0x61 - 0x41 - 26; // 6
+ $diff += ((25 - $src) >> 8) & 6;
+
+ // if ($src > 51) $diff += 0x30 - 0x61 - 26; // -75
+ $diff -= ((51 - $src) >> 8) & 75;
+
+ // if ($src > 61) $diff += 0x2d - 0x30 - 10; // -13
+ $diff -= ((61 - $src) >> 8) & 13;
+
+ // if ($src > 62) $diff += 0x5f - 0x2b - 1; // 3
+ $diff += ((62 - $src) >> 8) & 49;
+
+ return \pack('C', $src + $diff);
+ }
+}
diff --git a/vendor/paragonie/constant_time_encoding/src/Binary.php b/vendor/paragonie/constant_time_encoding/src/Binary.php
new file mode 100644
index 000000000..38dbc4e66
--- /dev/null
+++ b/vendor/paragonie/constant_time_encoding/src/Binary.php
@@ -0,0 +1,85 @@
+<?php
+declare(strict_types=1);
+namespace ParagonIE\ConstantTime;
+
+/**
+ * Copyright (c) 2016 - 2018 Paragon Initiative Enterprises.
+ * Copyright (c) 2014 Steve "Sc00bz" Thomas (steve at tobtu dot com)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/**
+ * Class Binary
+ *
+ * Binary string operators that don't choke on
+ * mbstring.func_overload
+ *
+ * @package ParagonIE\ConstantTime
+ */
+abstract class Binary
+{
+ /**
+ * Safe string length
+ *
+ * @ref mbstring.func_overload
+ *
+ * @param string $str
+ * @return int
+ */
+ public static function safeStrlen(string $str): int
+ {
+ if (\function_exists('mb_strlen')) {
+ return (int) \mb_strlen($str, '8bit');
+ } else {
+ return \strlen($str);
+ }
+ }
+
+ /**
+ * Safe substring
+ *
+ * @ref mbstring.func_overload
+ *
+ * @staticvar boolean $exists
+ * @param string $str
+ * @param int $start
+ * @param int $length
+ * @return string
+ * @throws \TypeError
+ */
+ public static function safeSubstr(
+ string $str,
+ int $start = 0,
+ $length = null
+ ): string {
+ if ($length === 0) {
+ return '';
+ }
+ if (\function_exists('mb_substr')) {
+ return \mb_substr($str, $start, $length, '8bit');
+ }
+ // Unlike mb_substr(), substr() doesn't accept NULL for length
+ if ($length !== null) {
+ return \substr($str, $start, $length);
+ } else {
+ return \substr($str, $start);
+ }
+ }
+}
diff --git a/vendor/paragonie/constant_time_encoding/src/EncoderInterface.php b/vendor/paragonie/constant_time_encoding/src/EncoderInterface.php
new file mode 100644
index 000000000..7aeee55a8
--- /dev/null
+++ b/vendor/paragonie/constant_time_encoding/src/EncoderInterface.php
@@ -0,0 +1,52 @@
+<?php
+declare(strict_types=1);
+namespace ParagonIE\ConstantTime;
+
+/**
+ * Copyright (c) 2016 - 2018 Paragon Initiative Enterprises.
+ * Copyright (c) 2014 Steve "Sc00bz" Thomas (steve at tobtu dot com)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/**
+ * Interface EncoderInterface
+ * @package ParagonIE\ConstantTime
+ */
+interface EncoderInterface
+{
+ /**
+ * Convert a binary string into a hexadecimal string without cache-timing
+ * leaks
+ *
+ * @param string $binString (raw binary)
+ * @return string
+ */
+ public static function encode(string $binString): string;
+
+ /**
+ * Convert a binary string into a hexadecimal string without cache-timing
+ * leaks
+ *
+ * @param string $encodedString
+ * @param bool $strictPadding Error on invalid padding
+ * @return string (raw binary)
+ */
+ public static function decode(string $encodedString, bool $strictPadding = false): string;
+}
diff --git a/vendor/paragonie/constant_time_encoding/src/Encoding.php b/vendor/paragonie/constant_time_encoding/src/Encoding.php
new file mode 100644
index 000000000..896a66841
--- /dev/null
+++ b/vendor/paragonie/constant_time_encoding/src/Encoding.php
@@ -0,0 +1,260 @@
+<?php
+declare(strict_types=1);
+namespace ParagonIE\ConstantTime;
+
+/**
+ * Copyright (c) 2016 - 2018 Paragon Initiative Enterprises.
+ * Copyright (c) 2014 Steve "Sc00bz" Thomas (steve at tobtu dot com)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/**
+ * Class Encoding
+ * @package ParagonIE\ConstantTime
+ */
+abstract class Encoding
+{
+ /**
+ * RFC 4648 Base32 encoding
+ *
+ * @param string $str
+ * @return string
+ * @throws \TypeError
+ */
+ public static function base32Encode(string $str): string
+ {
+ return Base32::encode($str);
+ }
+
+ /**
+ * RFC 4648 Base32 encoding
+ *
+ * @param string $str
+ * @return string
+ * @throws \TypeError
+ */
+ public static function base32EncodeUpper(string $str): string
+ {
+ return Base32::encodeUpper($str);
+ }
+
+ /**
+ * RFC 4648 Base32 decoding
+ *
+ * @param string $str
+ * @return string
+ * @throws \TypeError
+ */
+ public static function base32Decode(string $str): string
+ {
+ return Base32::decode($str);
+ }
+
+ /**
+ * RFC 4648 Base32 decoding
+ *
+ * @param string $str
+ * @return string
+ * @throws \TypeError
+ */
+ public static function base32DecodeUpper(string $str): string
+ {
+ return Base32::decodeUpper($str);
+ }
+
+ /**
+ * RFC 4648 Base32 encoding
+ *
+ * @param string $str
+ * @return string
+ * @throws \TypeError
+ */
+ public static function base32HexEncode(string $str): string
+ {
+ return Base32Hex::encode($str);
+ }
+
+ /**
+ * RFC 4648 Base32Hex encoding
+ *
+ * @param string $str
+ * @return string
+ * @throws \TypeError
+ */
+ public static function base32HexEncodeUpper(string $str): string
+ {
+ return Base32Hex::encodeUpper($str);
+ }
+
+ /**
+ * RFC 4648 Base32Hex decoding
+ *
+ * @param string $str
+ * @return string
+ * @throws \TypeError
+ */
+ public static function base32HexDecode(string $str): string
+ {
+ return Base32Hex::decode($str);
+ }
+
+ /**
+ * RFC 4648 Base32Hex decoding
+ *
+ * @param string $str
+ * @return string
+ * @throws \TypeError
+ */
+ public static function base32HexDecodeUpper(string $str): string
+ {
+ return Base32Hex::decodeUpper($str);
+ }
+
+ /**
+ * RFC 4648 Base64 encoding
+ *
+ * @param string $str
+ * @return string
+ * @throws \TypeError
+ */
+ public static function base64Encode(string $str): string
+ {
+ return Base64::encode($str);
+ }
+
+ /**
+ * RFC 4648 Base64 decoding
+ *
+ * @param string $str
+ * @return string
+ * @throws \TypeError
+ */
+ public static function base64Decode(string $str): string
+ {
+ return Base64::decode($str);
+ }
+
+ /**
+ * Encode into Base64
+ *
+ * Base64 character set "./[A-Z][a-z][0-9]"
+ * @param string $str
+ * @return string
+ * @throws \TypeError
+ */
+ public static function base64EncodeDotSlash(string $str): string
+ {
+ return Base64DotSlash::encode($str);
+ }
+
+ /**
+ * Decode from base64 to raw binary
+ *
+ * Base64 character set "./[A-Z][a-z][0-9]"
+ *
+ * @param string $str
+ * @return string
+ * @throws \RangeException
+ * @throws \TypeError
+ */
+ public static function base64DecodeDotSlash(string $str): string
+ {
+ return Base64DotSlash::decode($str);
+ }
+
+ /**
+ * Encode into Base64
+ *
+ * Base64 character set "[.-9][A-Z][a-z]" or "./[0-9][A-Z][a-z]"
+ * @param string $str
+ * @return string
+ * @throws \TypeError
+ */
+ public static function base64EncodeDotSlashOrdered(string $str): string
+ {
+ return Base64DotSlashOrdered::encode($str);
+ }
+
+ /**
+ * Decode from base64 to raw binary
+ *
+ * Base64 character set "[.-9][A-Z][a-z]" or "./[0-9][A-Z][a-z]"
+ *
+ * @param string $str
+ * @return string
+ * @throws \RangeException
+ * @throws \TypeError
+ */
+ public static function base64DecodeDotSlashOrdered(string $str): string
+ {
+ return Base64DotSlashOrdered::decode($str);
+ }
+
+ /**
+ * Convert a binary string into a hexadecimal string without cache-timing
+ * leaks
+ *
+ * @param string $bin_string (raw binary)
+ * @return string
+ * @throws \TypeError
+ */
+ public static function hexEncode(string $bin_string): string
+ {
+ return Hex::encode($bin_string);
+ }
+
+ /**
+ * Convert a hexadecimal string into a binary string without cache-timing
+ * leaks
+ *
+ * @param string $hex_string
+ * @return string (raw binary)
+ * @throws \RangeException
+ */
+ public static function hexDecode(string $hex_string): string
+ {
+ return Hex::decode($hex_string);
+ }
+
+ /**
+ * Convert a binary string into a hexadecimal string without cache-timing
+ * leaks
+ *
+ * @param string $bin_string (raw binary)
+ * @return string
+ * @throws \TypeError
+ */
+ public static function hexEncodeUpper(string $bin_string): string
+ {
+ return Hex::encodeUpper($bin_string);
+ }
+
+ /**
+ * Convert a binary string into a hexadecimal string without cache-timing
+ * leaks
+ *
+ * @param string $bin_string (raw binary)
+ * @return string
+ */
+ public static function hexDecodeUpper(string $bin_string): string
+ {
+ return Hex::decode($bin_string);
+ }
+}
diff --git a/vendor/paragonie/constant_time_encoding/src/Hex.php b/vendor/paragonie/constant_time_encoding/src/Hex.php
new file mode 100644
index 000000000..b1b05a098
--- /dev/null
+++ b/vendor/paragonie/constant_time_encoding/src/Hex.php
@@ -0,0 +1,159 @@
+<?php
+declare(strict_types=1);
+namespace ParagonIE\ConstantTime;
+
+/**
+ * Copyright (c) 2016 - 2018 Paragon Initiative Enterprises.
+ * Copyright (c) 2014 Steve "Sc00bz" Thomas (steve at tobtu dot com)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/**
+ * Class Hex
+ * @package ParagonIE\ConstantTime
+ */
+abstract class Hex implements EncoderInterface
+{
+ /**
+ * Convert a binary string into a hexadecimal string without cache-timing
+ * leaks
+ *
+ * @param string $binString (raw binary)
+ * @return string
+ * @throws \TypeError
+ */
+ public static function encode(string $binString): string
+ {
+ /** @var string $hex */
+ $hex = '';
+ $len = Binary::safeStrlen($binString);
+ for ($i = 0; $i < $len; ++$i) {
+ /** @var array<int, int> $chunk */
+ $chunk = \unpack('C', Binary::safeSubstr($binString, $i, 1));
+ /** @var int $c */
+ $c = $chunk[1] & 0xf;
+ /** @var int $b */
+ $b = $chunk[1] >> 4;
+
+ $hex .= pack(
+ 'CC',
+ (87 + $b + ((($b - 10) >> 8) & ~38)),
+ (87 + $c + ((($c - 10) >> 8) & ~38))
+ );
+ }
+ return $hex;
+ }
+
+ /**
+ * Convert a binary string into a hexadecimal string without cache-timing
+ * leaks, returning uppercase letters (as per RFC 4648)
+ *
+ * @param string $binString (raw binary)
+ * @return string
+ * @throws \TypeError
+ */
+ public static function encodeUpper(string $binString): string
+ {
+ /** @var string $hex */
+ $hex = '';
+ /** @var int $len */
+ $len = Binary::safeStrlen($binString);
+
+ for ($i = 0; $i < $len; ++$i) {
+ /** @var array<int, int> $chunk */
+ $chunk = \unpack('C', Binary::safeSubstr($binString, $i, 2));
+ /** @var int $c */
+ $c = $chunk[1] & 0xf;
+ /** @var int $b */
+ $b = $chunk[1] >> 4;
+
+ $hex .= pack(
+ 'CC',
+ (55 + $b + ((($b - 10) >> 8) & ~6)),
+ (55 + $c + ((($c - 10) >> 8) & ~6))
+ );
+ }
+ return $hex;
+ }
+
+ /**
+ * Convert a hexadecimal string into a binary string without cache-timing
+ * leaks
+ *
+ * @param string $encodedString
+ * @param bool $strictPadding
+ * @return string (raw binary)
+ * @throws \RangeException
+ */
+ public static function decode(string $encodedString, bool $strictPadding = false): string
+ {
+ /** @var int $hex_pos */
+ $hex_pos = 0;
+ /** @var string $bin */
+ $bin = '';
+ /** @var int $c_acc */
+ $c_acc = 0;
+ /** @var int $hex_len */
+ $hex_len = Binary::safeStrlen($encodedString);
+ /** @var int $state */
+ $state = 0;
+ if (($hex_len & 1) !== 0) {
+ if ($strictPadding) {
+ throw new \RangeException(
+ 'Expected an even number of hexadecimal characters'
+ );
+ } else {
+ $encodedString = '0' . $encodedString;
+ ++$hex_len;
+ }
+ }
+
+ /** @var array<int, int> $chunk */
+ $chunk = \unpack('C*', $encodedString);
+ while ($hex_pos < $hex_len) {
+ ++$hex_pos;
+ /** @var int $c */
+ $c = $chunk[$hex_pos];
+ /** @var int $c_num */
+ $c_num = $c ^ 48;
+ /** @var int $c_num0 */
+ $c_num0 = ($c_num - 10) >> 8;
+ /** @var int $c_alpha */
+ $c_alpha = ($c & ~32) - 55;
+ /** @var int $c_alpha0 */
+ $c_alpha0 = (($c_alpha - 10) ^ ($c_alpha - 16)) >> 8;
+
+ if (($c_num0 | $c_alpha0) === 0) {
+ throw new \RangeException(
+ 'Expected hexadecimal character'
+ );
+ }
+ /** @var int $c_val */
+ $c_val = ($c_num0 & $c_num) | ($c_alpha & $c_alpha0);
+ if ($state === 0) {
+ $c_acc = $c_val * 16;
+ } else {
+ $bin .= \pack('C', $c_acc | $c_val);
+ }
+ $state ^= 1;
+ }
+ return $bin;
+ }
+}
diff --git a/vendor/paragonie/constant_time_encoding/src/RFC4648.php b/vendor/paragonie/constant_time_encoding/src/RFC4648.php
new file mode 100644
index 000000000..492cad00e
--- /dev/null
+++ b/vendor/paragonie/constant_time_encoding/src/RFC4648.php
@@ -0,0 +1,175 @@
+<?php
+declare(strict_types=1);
+namespace ParagonIE\ConstantTime;
+
+/**
+ * Copyright (c) 2016 - 2018 Paragon Initiative Enterprises.
+ * Copyright (c) 2014 Steve "Sc00bz" Thomas (steve at tobtu dot com)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/**
+ * Class RFC4648
+ *
+ * This class conforms strictly to the RFC
+ *
+ * @package ParagonIE\ConstantTime
+ */
+abstract class RFC4648
+{
+ /**
+ * RFC 4648 Base64 encoding
+ *
+ * "foo" -> "Zm9v"
+ *
+ * @param string $str
+ * @return string
+ * @throws \TypeError
+ */
+ public static function base64Encode(string $str): string
+ {
+ return Base64::encode($str);
+ }
+
+ /**
+ * RFC 4648 Base64 decoding
+ *
+ * "Zm9v" -> "foo"
+ *
+ * @param string $str
+ * @return string
+ * @throws \TypeError
+ */
+ public static function base64Decode(string $str): string
+ {
+ return Base64::decode($str, true);
+ }
+
+ /**
+ * RFC 4648 Base64 (URL Safe) encoding
+ *
+ * "foo" -> "Zm9v"
+ *
+ * @param string $str
+ * @return string
+ * @throws \TypeError
+ */
+ public static function base64UrlSafeEncode(string $str): string
+ {
+ return Base64UrlSafe::encode($str);
+ }
+
+ /**
+ * RFC 4648 Base64 (URL Safe) decoding
+ *
+ * "Zm9v" -> "foo"
+ *
+ * @param string $str
+ * @return string
+ * @throws \TypeError
+ */
+ public static function base64UrlSafeDecode(string $str): string
+ {
+ return Base64UrlSafe::decode($str, true);
+ }
+
+ /**
+ * RFC 4648 Base32 encoding
+ *
+ * "foo" -> "MZXW6==="
+ *
+ * @param string $str
+ * @return string
+ * @throws \TypeError
+ */
+ public static function base32Encode(string $str): string
+ {
+ return Base32::encodeUpper($str);
+ }
+
+ /**
+ * RFC 4648 Base32 encoding
+ *
+ * "MZXW6===" -> "foo"
+ *
+ * @param string $str
+ * @return string
+ * @throws \TypeError
+ */
+ public static function base32Decode(string $str): string
+ {
+ return Base32::decodeUpper($str, true);
+ }
+
+ /**
+ * RFC 4648 Base32-Hex encoding
+ *
+ * "foo" -> "CPNMU==="
+ *
+ * @param string $str
+ * @return string
+ * @throws \TypeError
+ */
+ public static function base32HexEncode(string $str): string
+ {
+ return Base32::encodeUpper($str);
+ }
+
+ /**
+ * RFC 4648 Base32-Hex decoding
+ *
+ * "CPNMU===" -> "foo"
+ *
+ * @param string $str
+ * @return string
+ * @throws \TypeError
+ */
+ public static function base32HexDecode(string $str): string
+ {
+ return Base32::decodeUpper($str, true);
+ }
+
+ /**
+ * RFC 4648 Base16 decoding
+ *
+ * "foo" -> "666F6F"
+ *
+ * @param string $str
+ * @return string
+ * @throws \TypeError
+ */
+ public static function base16Encode(string $str): string
+ {
+ return Hex::encodeUpper($str);
+ }
+
+ /**
+ * RFC 4648 Base16 decoding
+ *
+ * "666F6F" -> "foo"
+ *
+ * @param string $str
+ * @return string
+ */
+ public static function base16Decode(string $str): string
+ {
+ return Hex::decode($str, true);
+ }
+} \ No newline at end of file
diff --git a/vendor/paragonie/constant_time_encoding/tests/Base32HexTest.php b/vendor/paragonie/constant_time_encoding/tests/Base32HexTest.php
new file mode 100644
index 000000000..ed19f336f
--- /dev/null
+++ b/vendor/paragonie/constant_time_encoding/tests/Base32HexTest.php
@@ -0,0 +1,49 @@
+<?php
+use \ParagonIE\ConstantTime\Base32Hex;
+
+class Base32HexTest extends PHPUnit\Framework\TestCase
+{
+ /**
+ * @covers Base32Hex::encode()
+ * @covers Base32Hex::decode()
+ * @covers Base32Hex::encodeUpper()
+ * @covers Base32Hex::decodeUpper()
+ */
+ public function testRandom()
+ {
+ for ($i = 1; $i < 32; ++$i) {
+ for ($j = 0; $j < 50; ++$j) {
+ $random = \random_bytes($i);
+
+ $enc = Base32Hex::encode($random);
+ $this->assertSame(
+ $random,
+ Base32Hex::decode($enc)
+ );
+ $unpadded = \rtrim($enc, '=');
+ $this->assertSame(
+ $unpadded,
+ Base32Hex::encodeUnpadded($random)
+ );
+ $this->assertSame(
+ $random,
+ Base32Hex::decode($unpadded)
+ );
+
+ $enc = Base32Hex::encodeUpper($random);
+ $this->assertSame(
+ $random,
+ Base32Hex::decodeUpper($enc)
+ ); $unpadded = \rtrim($enc, '=');
+ $this->assertSame(
+ $unpadded,
+ Base32Hex::encodeUpperUnpadded($random)
+ );
+ $this->assertSame(
+ $random,
+ Base32Hex::decodeUpper($unpadded)
+ );
+ }
+ }
+ }
+}
diff --git a/vendor/paragonie/constant_time_encoding/tests/Base32Test.php b/vendor/paragonie/constant_time_encoding/tests/Base32Test.php
new file mode 100644
index 000000000..65e8e7c56
--- /dev/null
+++ b/vendor/paragonie/constant_time_encoding/tests/Base32Test.php
@@ -0,0 +1,50 @@
+<?php
+use \ParagonIE\ConstantTime\Base32;
+
+class Base32Test extends PHPUnit\Framework\TestCase
+{
+ /**
+ * @covers Base32::encode()
+ * @covers Base32::decode()
+ * @covers Base32::encodeUpper()
+ * @covers Base32::decodeUpper()
+ */
+ public function testRandom()
+ {
+ for ($i = 1; $i < 32; ++$i) {
+ for ($j = 0; $j < 50; ++$j) {
+ $random = \random_bytes($i);
+
+ $enc = Base32::encode($random);
+ $this->assertSame(
+ $random,
+ Base32::decode($enc)
+ );
+ $unpadded = \rtrim($enc, '=');
+ $this->assertSame(
+ $unpadded,
+ Base32::encodeUnpadded($random)
+ );
+ $this->assertSame(
+ $random,
+ Base32::decode($unpadded)
+ );
+
+ $enc = Base32::encodeUpper($random);
+ $this->assertSame(
+ $random,
+ Base32::decodeUpper($enc)
+ );
+ $unpadded = \rtrim($enc, '=');
+ $this->assertSame(
+ $unpadded,
+ Base32::encodeUpperUnpadded($random)
+ );
+ $this->assertSame(
+ $random,
+ Base32::decodeUpper($unpadded)
+ );
+ }
+ }
+ }
+}
diff --git a/vendor/paragonie/constant_time_encoding/tests/Base64DotSlashOrderedTest.php b/vendor/paragonie/constant_time_encoding/tests/Base64DotSlashOrderedTest.php
new file mode 100644
index 000000000..f7dc828b1
--- /dev/null
+++ b/vendor/paragonie/constant_time_encoding/tests/Base64DotSlashOrderedTest.php
@@ -0,0 +1,34 @@
+<?php
+use \ParagonIE\ConstantTime\Base64DotSlashOrdered;
+
+class Base64DotSlashOrderedTest extends PHPUnit\Framework\TestCase
+{
+ /**
+ * @covers Base64DotSlashOrdered::encode()
+ * @covers Base64DotSlashOrdered::decode()
+ */
+ public function testRandom()
+ {
+ for ($i = 1; $i < 32; ++$i) {
+ for ($j = 0; $j < 50; ++$j) {
+ $random = \random_bytes($i);
+
+ $enc = Base64DotSlashOrdered::encode($random);
+ $this->assertSame(
+ $random,
+ Base64DotSlashOrdered::decode($enc)
+ );
+
+ $unpadded = \rtrim($enc, '=');
+ $this->assertSame(
+ $random,
+ Base64DotSlashOrdered::decode($unpadded)
+ );
+ $this->assertSame(
+ $random,
+ Base64DotSlashOrdered::decode($unpadded)
+ );
+ }
+ }
+ }
+}
diff --git a/vendor/paragonie/constant_time_encoding/tests/Base64DotSlashTest.php b/vendor/paragonie/constant_time_encoding/tests/Base64DotSlashTest.php
new file mode 100644
index 000000000..257a3d549
--- /dev/null
+++ b/vendor/paragonie/constant_time_encoding/tests/Base64DotSlashTest.php
@@ -0,0 +1,34 @@
+<?php
+use \ParagonIE\ConstantTime\Base64DotSlash;
+
+class Base64DotSlashTest extends PHPUnit\Framework\TestCase
+{
+ /**
+ * @covers Base64DotSlash::encode()
+ * @covers Base64DotSlash::decode()
+ */
+ public function testRandom()
+ {
+ for ($i = 1; $i < 32; ++$i) {
+ for ($j = 0; $j < 50; ++$j) {
+ $random = \random_bytes($i);
+
+ $enc = Base64DotSlash::encode($random);
+ $this->assertSame(
+ $random,
+ Base64DotSlash::decode($enc)
+ );
+
+ $unpadded = \rtrim($enc, '=');
+ $this->assertSame(
+ $random,
+ Base64DotSlash::decode($unpadded)
+ );
+ $this->assertSame(
+ $random,
+ Base64DotSlash::decode($unpadded)
+ );
+ }
+ }
+ }
+}
diff --git a/vendor/paragonie/constant_time_encoding/tests/Base64Test.php b/vendor/paragonie/constant_time_encoding/tests/Base64Test.php
new file mode 100644
index 000000000..16ab47da0
--- /dev/null
+++ b/vendor/paragonie/constant_time_encoding/tests/Base64Test.php
@@ -0,0 +1,79 @@
+<?php
+use \ParagonIE\ConstantTime\Base64;
+
+class Base64Test extends PHPUnit\Framework\TestCase
+{
+ /**
+ * @covers Base64::encode()
+ * @covers Base64::decode()
+ */
+ public function testRandom()
+ {
+ for ($i = 1; $i < 32; ++$i) {
+ for ($j = 0; $j < 50; ++$j) {
+ $random = \random_bytes($i);
+
+ $enc = Base64::encode($random);
+ $this->assertSame(
+ $random,
+ Base64::decode($enc)
+ );
+ $this->assertSame(
+ \base64_encode($random),
+ $enc
+ );
+
+ $unpadded = \rtrim($enc, '=');
+ $this->assertSame(
+ $random,
+ Base64::decode($unpadded)
+ );
+ $this->assertSame(
+ $random,
+ Base64::decode($unpadded)
+ );
+ }
+ }
+ $str = 'MIIFzzCCBLegAwIBAgIDAfdlMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAlBM' .
+ 'MSgwJgYDVQQKDB9LcmFqb3dhIEl6YmEgUm96bGljemVuaW93YSBTLkEuMSQwIgYDVQQ' .
+ 'DDBtDT1BFIFNaQUZJUiAtIEt3YWxpZmlrb3dhbnkxFDASBgNVBAUTC05yIHdwaXN1Oi' .
+ 'A2MB4XDTExMTEwOTA2MDAwMFoXDTEzMTEwOTA2MDAwMFowgdkxCzAJBgNVBAYTAlBMM' .
+ 'RwwGgYDVQQKDBNVcnrEhWQgTWlhc3RhIEdkeW5pMRswGQYDVQQFExJQRVNFTDogNjEw' .
+ 'NjA2MDMxMTgxGTAXBgNVBAMMEEplcnp5IFByemV3b3Jza2kxTzBNBgNVBBAwRgwiQWw' .
+ 'uIE1hcnN6YcWCa2EgUGnFgnN1ZHNraWVnbyA1Mi81NAwNODEtMzgyIEdkeW5pYQwGUG' .
+ '9sc2thDAlwb21vcnNraWUxDjAMBgNVBCoMBUplcnp5MRMwEQYDVQQEDApQcnpld29yc' .
+ '2tpMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCMm5vjGqHPthJCMqKpqssSISRo' .
+ 's0PYDTcEQzyyurfX67EJWKtZj6HNwuDMEGJ02iBNZfjUl7r8dIi28bSKhNlsfycXZKY' .
+ 'RcIjp0+r5RqtR2auo9GQ6veKb61DEAGIqaR+uLLcJVTHCu0w9oXLGbRlGth5eNoj03C' .
+ 'xXVAH2IfhbNwIDAQABo4IChzCCAoMwDAYDVR0TAQH/BAIwADCCAUgGA1UdIAEB/wSCA' .
+ 'TwwggE4MIIBNAYJKoRoAYb3IwEBMIIBJTCB3QYIKwYBBQUHAgIwgdAMgc1EZWtsYXJh' .
+ 'Y2phIHRhIGplc3Qgb8Wbd2lhZGN6ZW5pZW0gd3lkYXdjeSwgxbxlIHRlbiBjZXJ0eWZ' .
+ 'pa2F0IHpvc3RhxYIgd3lkYW55IGpha28gY2VydHlmaWthdCBrd2FsaWZpa293YW55IH' .
+ 'pnb2RuaWUgeiB3eW1hZ2FuaWFtaSB1c3Rhd3kgbyBwb2RwaXNpZSBlbGVrdHJvbmlje' .
+ 'm55bSBvcmF6IHRvd2FyenlzesSFY3ltaSBqZWogcm96cG9yesSFZHplbmlhbWkuMEMG' .
+ 'CCsGAQUFBwIBFjdodHRwOi8vd3d3Lmtpci5jb20ucGwvY2VydHlmaWthY2phX2tsdWN' .
+ '6eS9wb2xpdHlrYS5odG1sMAkGA1UdCQQCMAAwIQYDVR0RBBowGIEWai5wcnpld29yc2' .
+ 'tpQGdkeW5pYS5wbDAOBgNVHQ8BAf8EBAMCBkAwgZ4GA1UdIwSBljCBk4AU3TGldJXip' .
+ 'N4oGS3ZYmnBDMFs8gKhd6R1MHMxCzAJBgNVBAYTAlBMMSgwJgYDVQQKDB9LcmFqb3dh' .
+ 'IEl6YmEgUm96bGljemVuaW93YSBTLkEuMSQwIgYDVQQDDBtDT1BFIFNaQUZJUiAtIEt' .
+ '3YWxpZmlrb3dhbnkxFDASBgNVBAUTC05yIHdwaXN1OiA2ggJb9jBIBgNVHR8EQTA/MD' .
+ '2gO6A5hjdodHRwOi8vd3d3Lmtpci5jb20ucGwvY2VydHlmaWthY2phX2tsdWN6eS9DU' .
+ 'kxfT1pLMzIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQBYPIqnAreyeql7/opJjcar/qWZ' .
+ 'y9ruhB2q0lZFsJOhwgMnbQXzp/4vv93YJqcHGAXdHP6EO8FQX47mjo2ZKQmi+cIHJHL' .
+ 'ONdX/3Im+M17V0iNAh7Z1lOSfTRT+iiwe/F8phcEaD5q2RmvYusR7zXZq/cLL0If0hX' .
+ 'oPZ/EHQxjN8pxzxiUx6bJAgturnIMEfRNesxwghdr1dkUjOhGLf3kHVzgM6j3VAM7oF' .
+ 'mMUb5y5s96Bzl10DodWitjOEH0vvnIcsppSxH1C1dCAi0o9f/1y2XuLNhBNHMAyTqpY' .
+ 'PX8Yvav1c+Z50OMaSXHAnTa20zv8UtiHbaAhwlifCelUMj93S';
+
+ try {
+ Base64::decode($str, true);
+ $this->fail('Strict padding not enforced');
+ } catch (\Exception $ex) {
+
+ $this->assertSame(
+ Base64::decode($str),
+ \base64_decode($str)
+ );
+ }
+ }
+}
diff --git a/vendor/paragonie/constant_time_encoding/tests/Base64UrlSafeTest.php b/vendor/paragonie/constant_time_encoding/tests/Base64UrlSafeTest.php
new file mode 100644
index 000000000..136ed611c
--- /dev/null
+++ b/vendor/paragonie/constant_time_encoding/tests/Base64UrlSafeTest.php
@@ -0,0 +1,58 @@
+<?php
+
+use ParagonIE\ConstantTime\Base64UrlSafe;
+use ParagonIE\ConstantTime\Binary;
+
+/**
+ * Class Base64UrlSafeTest
+ */
+class Base64UrlSafeTest extends PHPUnit\Framework\TestCase
+{
+ /**
+ * @covers Base64UrlSafe::encode()
+ * @covers Base64UrlSafe::decode()
+ *
+ * @throws Exception
+ * @throws TypeError
+ */
+ public function testRandom()
+ {
+ for ($i = 1; $i < 32; ++$i) {
+ for ($j = 0; $j < 50; ++$j) {
+ $random = \random_bytes($i);
+
+ $enc = Base64UrlSafe::encode($random);
+ $this->assertSame(
+ $random,
+ Base64UrlSafe::decode($enc)
+ );
+ $this->assertSame(
+ \strtr(\base64_encode($random), '+/', '-_'),
+ $enc
+ );
+
+ $unpadded = \rtrim($enc, '=');
+ $this->assertSame(
+ $unpadded,
+ Base64UrlSafe::encodeUnpadded($random)
+ );
+ $this->assertSame(
+ $random,
+ Base64UrlSafe::decode($unpadded)
+ );
+ }
+ }
+
+ $random = \random_bytes(1 << 20);
+ $enc = Base64UrlSafe::encode($random);
+ $this->assertTrue(Binary::safeStrlen($enc) > 65536);
+ $this->assertSame(
+ $random,
+ Base64UrlSafe::decode($enc)
+ );
+ $this->assertSame(
+ \strtr(\base64_encode($random), '+/', '-_'),
+ $enc
+ );
+ }
+}
diff --git a/vendor/paragonie/constant_time_encoding/tests/EncodingTest.php b/vendor/paragonie/constant_time_encoding/tests/EncodingTest.php
new file mode 100644
index 000000000..6f774d8c0
--- /dev/null
+++ b/vendor/paragonie/constant_time_encoding/tests/EncodingTest.php
@@ -0,0 +1,307 @@
+<?php
+use \ParagonIE\ConstantTime\Base32;
+use \ParagonIE\ConstantTime\Base32Hex;
+use \ParagonIE\ConstantTime\Base64;
+use \ParagonIE\ConstantTime\Base64DotSlash;
+use \ParagonIE\ConstantTime\Base64DotSlashOrdered;
+use \ParagonIE\ConstantTime\Base64UrlSafe;
+use \ParagonIE\ConstantTime\Encoding;
+use \ParagonIE\ConstantTime\Hex;
+
+class EncodingTest extends PHPUnit\Framework\TestCase
+{
+ public function testBase32Encode()
+ {
+ $this->assertSame(
+ Encoding::base32Encode("\x00"),
+ 'aa======'
+ );
+ $this->assertSame(
+ Encoding::base32Encode("\x00\x00"),
+ 'aaaa===='
+ );
+ $this->assertSame(
+ Encoding::base32Encode("\x00\x00\x00"),
+ 'aaaaa==='
+ );
+ $this->assertSame(
+ Encoding::base32Encode("\x00\x00\x00\x00"),
+ 'aaaaaaa='
+ );
+ $this->assertSame(
+ Encoding::base32Encode("\x00\x00\x00\x00\x00"),
+ 'aaaaaaaa'
+ );
+ $this->assertSame(
+ Encoding::base32Encode("\x00\x00\x0F\xFF\xFF"),
+ 'aaaa7777'
+ );
+ $this->assertSame(
+ Encoding::base32Encode("\xFF\xFF\xF0\x00\x00"),
+ '7777aaaa'
+ );
+
+ $this->assertSame(
+ Encoding::base32Encode("\xce\x73\x9c\xe7\x39"),
+ 'zzzzzzzz'
+ );
+ $this->assertSame(
+ Encoding::base32Encode("\xd6\xb5\xad\x6b\x5a"),
+ '22222222'
+ );
+ $this->assertSame(
+ Base32::encodeUpper("\x00"),
+ 'AA======'
+ );
+ $this->assertSame(
+ Base32::encodeUpper("\x00\x00"),
+ 'AAAA===='
+ );
+ $this->assertSame(
+ Base32::encodeUpper("\x00\x00\x00"),
+ 'AAAAA==='
+ );
+ $this->assertSame(
+ Base32::encodeUpper("\x00\x00\x00\x00"),
+ 'AAAAAAA='
+ );
+ $this->assertSame(
+ Base32::encodeUpper("\x00\x00\x00\x00\x00"),
+ 'AAAAAAAA'
+ );
+ $this->assertSame(
+ Base32::encodeUpper("\x00\x00\x0F\xFF\xFF"),
+ 'AAAA7777'
+ );
+ $this->assertSame(
+ Base32::encodeUpper("\xFF\xFF\xF0\x00\x00"),
+ '7777AAAA'
+ );
+
+ $this->assertSame(
+ Base32::encodeUpper("\xce\x73\x9c\xe7\x39"),
+ 'ZZZZZZZZ'
+ );
+ $this->assertSame(
+ Base32::encodeUpper("\xd6\xb5\xad\x6b\x5a"),
+ '22222222'
+ );
+ }
+
+ public function testBase32Hex()
+ {
+ $this->assertSame(
+ Base32Hex::encode("\x00"),
+ '00======'
+ );
+ $this->assertSame(
+ Base32Hex::encode("\x00\x00"),
+ '0000===='
+ );
+ $this->assertSame(
+ Base32Hex::encode("\x00\x00\x00"),
+ '00000==='
+ );
+ $this->assertSame(
+ Base32Hex::encode("\x00\x00\x00\x00"),
+ '0000000='
+ );
+ $this->assertSame(
+ Base32Hex::encode("\x00\x00\x00\x00\x00"),
+ '00000000'
+ );
+ $this->assertSame(
+ Base32Hex::encode("\x00\x00\x0F\xFF\xFF"),
+ '0000vvvv'
+ );
+ $this->assertSame(
+ Base32Hex::encode("\xFF\xFF\xF0\x00\x00"),
+ 'vvvv0000'
+ );
+
+
+ }
+
+ /**
+ * Based on test vectors from RFC 4648
+ */
+ public function testBase32Decode()
+ {
+ $this->assertSame(
+ "\x00\x00\x00\x00\x00\x00",
+ Encoding::base32Decode('aaaaaaaaaa======')
+ );
+ $this->assertSame(
+ "\x00\x00\x00\x00\x00\x00\x00",
+ Encoding::base32Decode('aaaaaaaaaaaa====')
+ );
+ $this->assertSame(
+ "\x00\x00\x00\x00\x00\x00\x00\x00",
+ Encoding::base32Decode('aaaaaaaaaaaaa===')
+ );
+ $this->assertSame(
+ "\x00\x00\x00\x00\x00\x00\x00\x00\x00",
+ Encoding::base32Decode('aaaaaaaaaaaaaaa=')
+ );
+ $this->assertSame(
+ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
+ Encoding::base32Decode('aaaaaaaaaaaaaaaa')
+ );
+ $this->assertSame(
+ "\x00",
+ Encoding::base32Decode('aa======')
+ );
+ $this->assertSame(
+ "\x00\x00",
+ Encoding::base32Decode('aaaa====')
+ );
+ $this->assertSame(
+ "\x00\x00\x00",
+ Encoding::base32Decode('aaaaa===')
+ );
+ $this->assertSame(
+ "\x00\x00\x00\x00",
+ Encoding::base32Decode('aaaaaaa=')
+ );
+ $this->assertSame(
+ "\x00\x00\x00\x00\x00",
+ Encoding::base32Decode('aaaaaaaa')
+ );
+ $this->assertSame(
+ "\x00\x00\x0F\xFF\xFF",
+ Encoding::base32Decode('aaaa7777')
+ );
+ $this->assertSame(
+ "\xFF\xFF\xF0\x00\x00",
+ Encoding::base32Decode('7777aaaa')
+ );
+ $this->assertSame(
+ "\xce\x73\x9c\xe7\x39",
+ Encoding::base32Decode('zzzzzzzz')
+ );
+ $this->assertSame(
+ "\xd6\xb5\xad\x6b\x5a",
+ Encoding::base32Decode('22222222')
+ );
+ $this->assertSame(
+ 'foobar',
+ Encoding::base32Decode('mzxw6ytboi======')
+ );
+
+ $rand = random_bytes(9);
+ $enc = Encoding::base32Encode($rand);
+
+ $this->assertSame(
+ Encoding::base32Encode($rand),
+ Encoding::base32Encode(Encoding::base32Decode($enc))
+ );
+ $this->assertSame(
+ $rand,
+ Encoding::base32Decode($enc)
+ );
+ }
+
+ /**
+ * @covers Encoding::hexDecode()
+ * @covers Encoding::hexEncode()
+ * @covers Encoding::base32Decode()
+ * @covers Encoding::base32Encode()
+ * @covers Encoding::base64Decode()
+ * @covers Encoding::base64Encode()
+ * @covers Encoding::base64DotSlashDecode()
+ * @covers Encoding::base64DotSlashEncode()
+ * @covers Encoding::base64DotSlashOrderedDecode()
+ * @covers Encoding::base64DotSlashOrderedEncode()
+ */
+ public function testBasicEncoding()
+ {
+ // Re-run the test at least 3 times for each length
+ for ($j = 0; $j < 3; ++$j) {
+ for ($i = 1; $i < 84; ++$i) {
+ $rand = random_bytes($i);
+ $enc = Encoding::hexEncode($rand);
+ $this->assertSame(
+ \bin2hex($rand),
+ $enc,
+ "Hex Encoding - Length: " . $i
+ );
+ $this->assertSame(
+ $rand,
+ Encoding::hexDecode($enc),
+ "Hex Encoding - Length: " . $i
+ );
+
+ // Uppercase variant:
+ $enc = Hex::encodeUpper($rand);
+ $this->assertSame(
+ \strtoupper(\bin2hex($rand)),
+ $enc,
+ "Hex Encoding - Length: " . $i
+ );
+ $this->assertSame(
+ $rand,
+ Hex::decode($enc),
+ "HexUpper Encoding - Length: " . $i
+ );
+
+ $enc = Encoding::base32Encode($rand);
+ $this->assertSame(
+ $rand,
+ Encoding::base32Decode($enc),
+ "Base32 Encoding - Length: " . $i
+ );
+
+ $enc = Encoding::base32EncodeUpper($rand);
+ $this->assertSame(
+ $rand,
+ Encoding::base32DecodeUpper($enc),
+ "Base32Upper Encoding - Length: " . $i
+ );
+
+ $enc = Encoding::base32HexEncode($rand);
+ $this->assertSame(
+ bin2hex($rand),
+ bin2hex(Encoding::base32HexDecode($enc)),
+ "Base32Hex Encoding - Length: " . $i
+ );
+
+ $enc = Encoding::base32HexEncodeUpper($rand);
+ $this->assertSame(
+ bin2hex($rand),
+ bin2hex(Encoding::base32HexDecodeUpper($enc)),
+ "Base32HexUpper Encoding - Length: " . $i
+ );
+
+ $enc = Encoding::base64Encode($rand);
+ $this->assertSame(
+ $rand,
+ Encoding::base64Decode($enc),
+ "Base64 Encoding - Length: " . $i
+ );
+
+ $enc = Encoding::base64EncodeDotSlash($rand);
+ $this->assertSame(
+ $rand,
+ Encoding::base64DecodeDotSlash($enc),
+ "Base64 DotSlash Encoding - Length: " . $i
+ );
+ $enc = Encoding::base64EncodeDotSlashOrdered($rand);
+ $this->assertSame(
+ $rand,
+ Encoding::base64DecodeDotSlashOrdered($enc),
+ "Base64 Ordered DotSlash Encoding - Length: " . $i
+ );
+
+ $enc = Base64UrlSafe::encode($rand);
+ $this->assertSame(
+ \strtr(\base64_encode($rand), '+/', '-_'),
+ $enc
+ );
+ $this->assertSame(
+ $rand,
+ Base64UrlSafe::decode($enc)
+ );
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/vendor/paragonie/constant_time_encoding/tests/HexTest.php b/vendor/paragonie/constant_time_encoding/tests/HexTest.php
new file mode 100644
index 000000000..5c31f6d15
--- /dev/null
+++ b/vendor/paragonie/constant_time_encoding/tests/HexTest.php
@@ -0,0 +1,39 @@
+<?php
+use \ParagonIE\ConstantTime\Hex;
+
+class HexTest extends PHPUnit\Framework\TestCase
+{
+ /**
+ * @covers Hex::encode()
+ * @covers Hex::decode()
+ * @covers Hex::encodeUpper()
+ */
+ public function testRandom()
+ {
+ for ($i = 1; $i < 32; ++$i) {
+ for ($j = 0; $j < 50; ++$j) {
+ $random = \random_bytes($i);
+
+ $enc = Hex::encode($random);
+ $this->assertSame(
+ $random,
+ Hex::decode($enc)
+ );
+ $this->assertSame(
+ \bin2hex($random),
+ $enc
+ );
+
+ $enc = Hex::encodeUpper($random);
+ $this->assertSame(
+ $random,
+ Hex::decode($enc)
+ );
+ $this->assertSame(
+ \strtoupper(\bin2hex($random)),
+ $enc
+ );
+ }
+ }
+ }
+}
diff --git a/vendor/paragonie/constant_time_encoding/tests/RFC4648Test.php b/vendor/paragonie/constant_time_encoding/tests/RFC4648Test.php
new file mode 100644
index 000000000..a6653de88
--- /dev/null
+++ b/vendor/paragonie/constant_time_encoding/tests/RFC4648Test.php
@@ -0,0 +1,84 @@
+<?php
+use \ParagonIE\ConstantTime\Base32;
+use \ParagonIE\ConstantTime\Base32Hex;
+use \ParagonIE\ConstantTime\Base64;
+use \ParagonIE\ConstantTime\Base64DotSlash;
+use \ParagonIE\ConstantTime\Base64DotSlashOrdered;
+use \ParagonIE\ConstantTime\Encoding;
+use \ParagonIE\ConstantTime\Hex;
+
+/**
+ * Class RFC4648Test
+ *
+ * @ref https://tools.ietf.org/html/rfc4648#section-10
+ */
+class RFC4648Test extends PHPUnit\Framework\TestCase
+{
+ public function testVectorBase64()
+ {
+ $this->assertSame(Base64::encode(''), '');
+ $this->assertSame(Base64::encode('f'), 'Zg==');
+ $this->assertSame(Base64::encode('fo'), 'Zm8=');
+ $this->assertSame(Base64::encode('foo'), 'Zm9v');
+ $this->assertSame(Base64::encode('foob'), 'Zm9vYg==');
+ $this->assertSame(Base64::encode('fooba'), 'Zm9vYmE=');
+ $this->assertSame(Base64::encode('foobar'), 'Zm9vYmFy');
+ }
+
+ public function testVectorBase32()
+ {
+ $this->assertSame(Base32::encode(''), '');
+ $this->assertSame(Base32::encode('f'), 'my======');
+ $this->assertSame(Base32::encode('fo'), 'mzxq====');
+ $this->assertSame(Base32::encode('foo'), 'mzxw6===');
+ $this->assertSame(Base32::encode('foob'), 'mzxw6yq=');
+ $this->assertSame(Base32::encode('fooba'), 'mzxw6ytb');
+ $this->assertSame(Base32::encode('foobar'), 'mzxw6ytboi======');
+
+ $this->assertSame(Base32::encodeUpper(''), '');
+ $this->assertSame(Base32::encodeUpper('f'), 'MY======');
+ $this->assertSame(Base32::encodeUpper('fo'), 'MZXQ====');
+ $this->assertSame(Base32::encodeUpper('foo'), 'MZXW6===');
+ $this->assertSame(Base32::encodeUpper('foob'), 'MZXW6YQ=');
+ $this->assertSame(Base32::encodeUpper('fooba'), 'MZXW6YTB');
+ $this->assertSame(Base32::encodeUpper('foobar'), 'MZXW6YTBOI======');
+ }
+
+ public function testVectorBase32Hex()
+ {
+ $this->assertSame(Base32Hex::encode(''), '');
+ $this->assertSame(Base32Hex::encode('f'), 'co======');
+ $this->assertSame(Base32Hex::encode('fo'), 'cpng====');
+ $this->assertSame(Base32Hex::encode('foo'), 'cpnmu===');
+ $this->assertSame(Base32Hex::encode('foob'), 'cpnmuog=');
+ $this->assertSame(Base32Hex::encode('fooba'), 'cpnmuoj1');
+ $this->assertSame(Base32Hex::encode('foobar'), 'cpnmuoj1e8======');
+
+ $this->assertSame(Base32Hex::encodeUpper(''), '');
+ $this->assertSame(Base32Hex::encodeUpper('f'), 'CO======');
+ $this->assertSame(Base32Hex::encodeUpper('fo'), 'CPNG====');
+ $this->assertSame(Base32Hex::encodeUpper('foo'), 'CPNMU===');
+ $this->assertSame(Base32Hex::encodeUpper('foob'), 'CPNMUOG=');
+ $this->assertSame(Base32Hex::encodeUpper('fooba'), 'CPNMUOJ1');
+ $this->assertSame(Base32Hex::encodeUpper('foobar'), 'CPNMUOJ1E8======');
+ }
+
+ public function testVectorBase16()
+ {
+ $this->assertSame(Hex::encode(''), '');
+ $this->assertSame(Hex::encode('f'), '66');
+ $this->assertSame(Hex::encode('fo'), '666f');
+ $this->assertSame(Hex::encode('foo'), '666f6f');
+ $this->assertSame(Hex::encode('foob'), '666f6f62');
+ $this->assertSame(Hex::encode('fooba'), '666f6f6261');
+ $this->assertSame(Hex::encode('foobar'), '666f6f626172');
+
+ $this->assertSame(Hex::encodeUpper(''), '');
+ $this->assertSame(Hex::encodeUpper('f'), '66');
+ $this->assertSame(Hex::encodeUpper('fo'), '666F');
+ $this->assertSame(Hex::encodeUpper('foo'), '666F6F');
+ $this->assertSame(Hex::encodeUpper('foob'), '666F6F62');
+ $this->assertSame(Hex::encodeUpper('fooba'), '666F6F6261');
+ $this->assertSame(Hex::encodeUpper('foobar'), '666F6F626172');
+ }
+}
diff --git a/vendor/spomky-labs/otphp/.github/CONTRIBUTING.md b/vendor/spomky-labs/otphp/.github/CONTRIBUTING.md
new file mode 100644
index 000000000..871735ad1
--- /dev/null
+++ b/vendor/spomky-labs/otphp/.github/CONTRIBUTING.md
@@ -0,0 +1,25 @@
+# Contributing
+
+First of all, **thank you** for contributing.
+
+Bugs or feature requests can be posted online on the GitHub issues section of the project.
+
+Few rules to ease code reviews and merges:
+
+- You MUST follow the [PSR-1](http://www.php-fig.org/psr/psr-1/), [PSR-2](http://www.php-fig.org/psr/psr-2/) and [PSR-4](http://www.php-fig.org/psr/psr-4/) coding standards.
+- You MUST run the test suite.
+- You MUST write (or update) unit tests when bugs are fixed or features are added.
+- You SHOULD write documentation.
+
+We use [Git-Flow](http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/) to automate our git branching workflow.
+
+To contribute use [Pull Requests](https://help.github.com/articles/using-pull-requests), please, write commit messages that make sense, and rebase your branch before submitting your PR.
+
+May be asked to squash your commits too. This is used to "clean" your Pull Request before merging it, avoiding commits such as fix tests, fix 2, fix 3, etc.
+
+Run test suite
+------------
+
+* install composer: `curl -s http://getcomposer.org/installer | php`
+* install dependencies: `php composer.phar install`
+* run tests: `vendor/bin/phpunit`
diff --git a/vendor/spomky-labs/otphp/.github/ISSUE_TEMPLATE.md b/vendor/spomky-labs/otphp/.github/ISSUE_TEMPLATE.md
new file mode 100644
index 000000000..2ceb8da6a
--- /dev/null
+++ b/vendor/spomky-labs/otphp/.github/ISSUE_TEMPLATE.md
@@ -0,0 +1,16 @@
+| Q | A
+| -------------------- | -----
+| Bug report? | yes/no
+| Feature request? | yes/no
+| BC Break report? | yes/no
+| RFC? / Specification | yes/no
+| Library version | x.y(.z)
+
+<!--
+Fill in this template according to your issue.
+Otherwise, replace this comment by the description of your issue.
+
+Please consider the following requirements
+* You MUST never send security issues here. If you think that your issue is a security one then contact Spomky in private at https://gitter.im/Spomky/
+* You should not post many lines of source code or console logs. Small inputs (approx 5 lines) are acceptable otherwize you should use a third party service (e.g. Pastebin, Chop...).
+-->
diff --git a/vendor/spomky-labs/otphp/.github/PULL_REQUEST_TEMPLATE.md b/vendor/spomky-labs/otphp/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 000000000..acd0be9fc
--- /dev/null
+++ b/vendor/spomky-labs/otphp/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,21 @@
+| Q | A
+| ------------- | ---
+| Branch? | master
+| Bug fix? | yes/no
+| New feature? | yes/no
+| BC breaks? | yes/no
+| Deprecations? | yes/no
+| Tests pass? | yes/no
+| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
+| License | MIT
+| Tests added | <!--highly recommended for new features-->
+| Doc PR | <!--highly recommended for new features-->
+
+<!--
+Fill in this template according to the PR you're about to submit.
+Replace this comment by a description of what your PR is solving.
+
+Please consider the following requirement:
+* Modification of existing tests should be avoided unless deemed necessary.
+* You MUST never open a PR related to a security issue. Contact Spomky in private at https://gitter.im/Spomky/
+-->
diff --git a/vendor/spomky-labs/otphp/.github/stale.yml b/vendor/spomky-labs/otphp/.github/stale.yml
new file mode 100644
index 000000000..dc90e5a1c
--- /dev/null
+++ b/vendor/spomky-labs/otphp/.github/stale.yml
@@ -0,0 +1,17 @@
+# Number of days of inactivity before an issue becomes stale
+daysUntilStale: 60
+# Number of days of inactivity before a stale issue is closed
+daysUntilClose: 7
+# Issues with these labels will never be considered stale
+exemptLabels:
+ - pinned
+ - security
+# Label to use when marking an issue as stale
+staleLabel: wontfix
+# Comment to post when marking an issue as stale. Set to `false` to disable
+markComment: >
+ This issue has been automatically marked as stale because it has not had
+ recent activity. It will be closed if no further activity occurs. Thank you
+ for your contributions.
+# Comment to post when closing a stale issue. Set to `false` to disable
+closeComment: false
diff --git a/vendor/spomky-labs/otphp/.php_cs.dist b/vendor/spomky-labs/otphp/.php_cs.dist
new file mode 100644
index 000000000..7410dff65
--- /dev/null
+++ b/vendor/spomky-labs/otphp/.php_cs.dist
@@ -0,0 +1,61 @@
+<?php
+
+$header = 'The MIT License (MIT)
+
+Copyright (c) 2014-2019 Spomky-Labs
+
+This software may be modified and distributed under the terms
+of the MIT license. See the LICENSE file for details.';
+
+$finder = PhpCsFixer\Finder::create()
+ ->in(__DIR__.'/src')
+ ->in(__DIR__.'/tests')
+;
+
+return PhpCsFixer\Config::create()
+ ->setRules([
+ '@PSR1' => true,
+ '@PSR2' => true,
+ '@Symfony' => true,
+ '@DoctrineAnnotation' => true,
+ '@PHP70Migration' => true,
+ '@PHP71Migration' => true,
+ 'strict_param' => true,
+ 'strict_comparison' => true,
+ 'array_syntax' => ['syntax' => 'short'],
+ 'array_indentation' => true,
+ 'ordered_imports' => true,
+ 'protected_to_private' => true,
+ 'declare_strict_types' => true,
+ 'native_function_invocation' => [
+ 'include' => ['@compiler_optimized'],
+ 'scope' => 'namespaced',
+ ],
+ 'mb_str_functions' => true,
+ 'method_chaining_indentation' => true,
+ 'linebreak_after_opening_tag' => true,
+ 'combine_consecutive_issets' => true,
+ 'combine_consecutive_unsets' => true,
+ 'compact_nullable_typehint' => true,
+ 'no_superfluous_phpdoc_tags' => true,
+ 'no_superfluous_elseif' => true,
+ 'phpdoc_trim_consecutive_blank_line_separation' => true,
+ 'phpdoc_order' => true,
+ 'pow_to_exponentiation' => true,
+ 'simplified_null_return' => true,
+ 'header_comment' => [
+ 'header' => $header,
+ ],
+ 'align_multiline_comment' => [
+ 'comment_type' => 'all_multiline',
+ ],
+ 'php_unit_test_annotation' => [
+ 'case' => 'snake',
+ 'style' => 'annotation',
+ ],
+ 'php_unit_test_case_static_method_calls' => true,
+ ])
+ ->setRiskyAllowed(true)
+ ->setUsingCache(true)
+ ->setFinder($finder)
+ ;
diff --git a/vendor/spomky-labs/otphp/CODE_OF_CONDUCT.md b/vendor/spomky-labs/otphp/CODE_OF_CONDUCT.md
new file mode 100644
index 000000000..4ec12c72b
--- /dev/null
+++ b/vendor/spomky-labs/otphp/CODE_OF_CONDUCT.md
@@ -0,0 +1,46 @@
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
+
+## Our Standards
+
+Examples of behavior that contributes to creating a positive environment include:
+
+* Using welcoming and inclusive language
+* Being respectful of differing viewpoints and experiences
+* Gracefully accepting constructive criticism
+* Focusing on what is best for the community
+* Showing empathy towards other community members
+
+Examples of unacceptable behavior by participants include:
+
+* The use of sexualized language or imagery and unwelcome sexual attention or advances
+* Trolling, insulting/derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or electronic address, without explicit permission
+* Other conduct which could reasonably be considered inappropriate in a professional setting
+
+## Our Responsibilities
+
+Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
+
+Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
+
+## Scope
+
+This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
+
+Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
+
+[homepage]: http://contributor-covenant.org
+[version]: http://contributor-covenant.org/version/1/4/
diff --git a/vendor/spomky-labs/otphp/LICENSE b/vendor/spomky-labs/otphp/LICENSE
new file mode 100644
index 000000000..e6a673e34
--- /dev/null
+++ b/vendor/spomky-labs/otphp/LICENSE
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright (c) 2014-2016 Florent Morselli
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/vendor/spomky-labs/otphp/composer.json b/vendor/spomky-labs/otphp/composer.json
new file mode 100644
index 000000000..8979e8f06
--- /dev/null
+++ b/vendor/spomky-labs/otphp/composer.json
@@ -0,0 +1,50 @@
+{
+ "name": "spomky-labs/otphp",
+ "type": "library",
+ "description": "A PHP library for generating one time passwords according to RFC 4226 (HOTP Algorithm) and the RFC 6238 (TOTP Algorithm) and compatible with Google Authenticator",
+ "license": "MIT",
+ "keywords": ["otp", "hotp", "totp", "RFC 4226", "RFC 6238", "Google Authenticator", "FreeOTP"],
+ "homepage": "https://github.com/Spomky-Labs/otphp",
+ "authors": [
+ {
+ "name": "Florent Morselli",
+ "homepage": "https://github.com/Spomky"
+ },
+ {
+ "name": "All contributors",
+ "homepage": "https://github.com/Spomky-Labs/otphp/contributors"
+ }
+ ],
+ "require": {
+ "php": "^7.2|^8.0",
+ "ext-mbstring": "*",
+ "paragonie/constant_time_encoding": "^2.0",
+ "beberlei/assert": "^3.0",
+ "thecodingmachine/safe": "^0.1.14|^1.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^8.0",
+ "php-coveralls/php-coveralls": "^2.0",
+ "phpstan/phpstan": "^0.12",
+ "phpstan/phpstan-beberlei-assert": "^0.12",
+ "phpstan/phpstan-deprecation-rules": "^0.12",
+ "phpstan/phpstan-phpunit": "^0.12",
+ "phpstan/phpstan-strict-rules": "^0.12",
+ "thecodingmachine/phpstan-safe-rule": "^1.0"
+ },
+ "suggest": {
+ },
+ "autoload": {
+ "psr-4": { "OTPHP\\": "src/" }
+ },
+ "autoload-dev": {
+ "psr-4": { "OTPHP\\Test\\": "tests/" }
+ },
+ "extra": {
+ "branch-alias": {
+ "v10.0": "10.0.x-dev",
+ "v9.0": "9.0.x-dev",
+ "v8.3": "8.3.x-dev"
+ }
+ }
+}
diff --git a/vendor/spomky-labs/otphp/phpstan.neon b/vendor/spomky-labs/otphp/phpstan.neon
new file mode 100644
index 000000000..c9be89623
--- /dev/null
+++ b/vendor/spomky-labs/otphp/phpstan.neon
@@ -0,0 +1,13 @@
+parameters:
+ level: 7
+ paths:
+ - src
+ - tests
+ ignoreErrors:
+ - '#Variable property access on \$this\(OTPHP\\OTP\)\.#'
+includes:
+ - vendor/phpstan/phpstan-strict-rules/rules.neon
+ - vendor/phpstan/phpstan-phpunit/extension.neon
+ - vendor/phpstan/phpstan-deprecation-rules/rules.neon
+ - vendor/thecodingmachine/phpstan-safe-rule/phpstan-safe-rule.neon
+ - vendor/phpstan/phpstan-beberlei-assert/extension.neon
diff --git a/vendor/spomky-labs/otphp/src/Factory.php b/vendor/spomky-labs/otphp/src/Factory.php
new file mode 100644
index 000000000..70df63945
--- /dev/null
+++ b/vendor/spomky-labs/otphp/src/Factory.php
@@ -0,0 +1,115 @@
+<?php
+
+declare(strict_types=1);
+
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2019 Spomky-Labs
+ *
+ * This software may be modified and distributed under the terms
+ * of the MIT license. See the LICENSE file for details.
+ */
+
+namespace OTPHP;
+
+use Assert\Assertion;
+use InvalidArgumentException;
+use function Safe\parse_url;
+use function Safe\sprintf;
+use Throwable;
+
+/**
+ * This class is used to load OTP object from a provisioning Uri.
+ */
+final class Factory implements FactoryInterface
+{
+ public static function loadFromProvisioningUri(string $uri): OTPInterface
+ {
+ try {
+ $parsed_url = parse_url($uri);
+ } catch (Throwable $throwable) {
+ throw new InvalidArgumentException('Not a valid OTP provisioning URI', $throwable->getCode(), $throwable);
+ }
+ Assertion::isArray($parsed_url, 'Not a valid OTP provisioning URI');
+ self::checkData($parsed_url);
+
+ $otp = self::createOTP($parsed_url);
+
+ self::populateOTP($otp, $parsed_url);
+
+ return $otp;
+ }
+
+ /**
+ * @param array<string, mixed> $data
+ */
+ private static function populateParameters(OTPInterface &$otp, array $data): void
+ {
+ foreach ($data['query'] as $key => $value) {
+ $otp->setParameter($key, $value);
+ }
+ }
+
+ /**
+ * @param array<string, mixed> $data
+ */
+ private static function populateOTP(OTPInterface &$otp, array $data): void
+ {
+ self::populateParameters($otp, $data);
+ $result = explode(':', rawurldecode(mb_substr($data['path'], 1)));
+
+ if (2 > \count($result)) {
+ $otp->setIssuerIncludedAsParameter(false);
+
+ return;
+ }
+
+ if (null !== $otp->getIssuer()) {
+ Assertion::eq($result[0], $otp->getIssuer(), 'Invalid OTP: invalid issuer in parameter');
+ $otp->setIssuerIncludedAsParameter(true);
+ }
+ $otp->setIssuer($result[0]);
+ }
+
+ /**
+ * @param array<string, mixed> $data
+ */
+ private static function checkData(array &$data): void
+ {
+ foreach (['scheme', 'host', 'path', 'query'] as $key) {
+ Assertion::keyExists($data, $key, 'Not a valid OTP provisioning URI');
+ }
+ Assertion::eq('otpauth', $data['scheme'], 'Not a valid OTP provisioning URI');
+ parse_str($data['query'], $data['query']);
+ Assertion::keyExists($data['query'], 'secret', 'Not a valid OTP provisioning URI');
+ }
+
+ /**
+ * @param array<string, mixed> $parsed_url
+ */
+ private static function createOTP(array $parsed_url): OTPInterface
+ {
+ switch ($parsed_url['host']) {
+ case 'totp':
+ $totp = TOTP::create($parsed_url['query']['secret']);
+ $totp->setLabel(self::getLabel($parsed_url['path']));
+
+ return $totp;
+ case 'hotp':
+ $hotp = HOTP::create($parsed_url['query']['secret']);
+ $hotp->setLabel(self::getLabel($parsed_url['path']));
+
+ return $hotp;
+ default:
+ throw new InvalidArgumentException(sprintf('Unsupported "%s" OTP type', $parsed_url['host']));
+ }
+ }
+
+ private static function getLabel(string $data): string
+ {
+ $result = explode(':', rawurldecode(mb_substr($data, 1)));
+
+ return 2 === \count($result) ? $result[1] : $result[0];
+ }
+}
diff --git a/vendor/spomky-labs/otphp/src/FactoryInterface.php b/vendor/spomky-labs/otphp/src/FactoryInterface.php
new file mode 100644
index 000000000..00acc2d04
--- /dev/null
+++ b/vendor/spomky-labs/otphp/src/FactoryInterface.php
@@ -0,0 +1,23 @@
+<?php
+
+declare(strict_types=1);
+
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2019 Spomky-Labs
+ *
+ * This software may be modified and distributed under the terms
+ * of the MIT license. See the LICENSE file for details.
+ */
+
+namespace OTPHP;
+
+interface FactoryInterface
+{
+ /**
+ * This method is the unique public method of the class.
+ * It can load a provisioning Uri and convert it into an OTP object.
+ */
+ public static function loadFromProvisioningUri(string $uri): OTPInterface;
+}
diff --git a/vendor/spomky-labs/otphp/src/HOTP.php b/vendor/spomky-labs/otphp/src/HOTP.php
new file mode 100644
index 000000000..a2f4a2395
--- /dev/null
+++ b/vendor/spomky-labs/otphp/src/HOTP.php
@@ -0,0 +1,103 @@
+<?php
+
+declare(strict_types=1);
+
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2019 Spomky-Labs
+ *
+ * This software may be modified and distributed under the terms
+ * of the MIT license. See the LICENSE file for details.
+ */
+
+namespace OTPHP;
+
+use Assert\Assertion;
+
+final class HOTP extends OTP implements HOTPInterface
+{
+ protected function __construct(?string $secret, int $counter, string $digest, int $digits)
+ {
+ parent::__construct($secret, $digest, $digits);
+ $this->setCounter($counter);
+ }
+
+ public static function create(?string $secret = null, int $counter = 0, string $digest = 'sha1', int $digits = 6): HOTPInterface
+ {
+ return new self($secret, $counter, $digest, $digits);
+ }
+
+ protected function setCounter(int $counter): void
+ {
+ $this->setParameter('counter', $counter);
+ }
+
+ public function getCounter(): int
+ {
+ return $this->getParameter('counter');
+ }
+
+ private function updateCounter(int $counter): void
+ {
+ $this->setCounter($counter);
+ }
+
+ public function getProvisioningUri(): string
+ {
+ return $this->generateURI('hotp', ['counter' => $this->getCounter()]);
+ }
+
+ /**
+ * If the counter is not provided, the OTP is verified at the actual counter.
+ */
+ public function verify(string $otp, ?int $counter = null, ?int $window = null): bool
+ {
+ Assertion::greaterOrEqualThan($counter, 0, 'The counter must be at least 0.');
+
+ if (null === $counter) {
+ $counter = $this->getCounter();
+ } elseif ($counter < $this->getCounter()) {
+ return false;
+ }
+
+ return $this->verifyOtpWithWindow($otp, $counter, $window);
+ }
+
+ private function getWindow(?int $window): int
+ {
+ return abs($window ?? 0);
+ }
+
+ private function verifyOtpWithWindow(string $otp, int $counter, ?int $window): bool
+ {
+ $window = $this->getWindow($window);
+
+ for ($i = $counter; $i <= $counter + $window; ++$i) {
+ if ($this->compareOTP($this->at($i), $otp)) {
+ $this->updateCounter($i + 1);
+
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * @return array<string, mixed>
+ */
+ protected function getParameterMap(): array
+ {
+ $v = array_merge(
+ parent::getParameterMap(),
+ ['counter' => function ($value): int {
+ Assertion::greaterOrEqualThan((int) $value, 0, 'Counter must be at least 0.');
+
+ return (int) $value;
+ }]
+ );
+
+ return $v;
+ }
+}
diff --git a/vendor/spomky-labs/otphp/src/HOTPInterface.php b/vendor/spomky-labs/otphp/src/HOTPInterface.php
new file mode 100644
index 000000000..336ce1055
--- /dev/null
+++ b/vendor/spomky-labs/otphp/src/HOTPInterface.php
@@ -0,0 +1,29 @@
+<?php
+
+declare(strict_types=1);
+
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2019 Spomky-Labs
+ *
+ * This software may be modified and distributed under the terms
+ * of the MIT license. See the LICENSE file for details.
+ */
+
+namespace OTPHP;
+
+interface HOTPInterface extends OTPInterface
+{
+ /**
+ * The initial counter (a positive integer).
+ */
+ public function getCounter(): int;
+
+ /**
+ * Create a new TOTP object.
+ *
+ * If the secret is null, a random 64 bytes secret will be generated.
+ */
+ public static function create(?string $secret = null, int $counter = 0, string $digest = 'sha1', int $digits = 6): self;
+}
diff --git a/vendor/spomky-labs/otphp/src/OTP.php b/vendor/spomky-labs/otphp/src/OTP.php
new file mode 100644
index 000000000..932bcf97e
--- /dev/null
+++ b/vendor/spomky-labs/otphp/src/OTP.php
@@ -0,0 +1,114 @@
+<?php
+
+declare(strict_types=1);
+
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2019 Spomky-Labs
+ *
+ * This software may be modified and distributed under the terms
+ * of the MIT license. See the LICENSE file for details.
+ */
+
+namespace OTPHP;
+
+use Assert\Assertion;
+use ParagonIE\ConstantTime\Base32;
+use RuntimeException;
+use function Safe\ksort;
+use function Safe\sprintf;
+
+abstract class OTP implements OTPInterface
+{
+ use ParameterTrait;
+
+ protected function __construct(?string $secret, string $digest, int $digits)
+ {
+ $this->setSecret($secret);
+ $this->setDigest($digest);
+ $this->setDigits($digits);
+ }
+
+ public function getQrCodeUri(string $uri, string $placeholder): string
+ {
+ $provisioning_uri = urlencode($this->getProvisioningUri());
+
+ return str_replace($placeholder, $provisioning_uri, $uri);
+ }
+
+ /**
+ * The OTP at the specified input.
+ */
+ protected function generateOTP(int $input): string
+ {
+ $hash = hash_hmac($this->getDigest(), $this->intToByteString($input), $this->getDecodedSecret(), true);
+
+ $hmac = array_values(unpack('C*', $hash));
+
+ $offset = ($hmac[\count($hmac) - 1] & 0xF);
+ $code = ($hmac[$offset + 0] & 0x7F) << 24 | ($hmac[$offset + 1] & 0xFF) << 16 | ($hmac[$offset + 2] & 0xFF) << 8 | ($hmac[$offset + 3] & 0xFF);
+ $otp = $code % (10 ** $this->getDigits());
+
+ return str_pad((string) $otp, $this->getDigits(), '0', STR_PAD_LEFT);
+ }
+
+ public function at(int $timestamp): string
+ {
+ return $this->generateOTP($timestamp);
+ }
+
+ /**
+ * @param array<string, mixed> $options
+ */
+ protected function filterOptions(array &$options): void
+ {
+ foreach (['algorithm' => 'sha1', 'period' => 30, 'digits' => 6] as $key => $default) {
+ if (isset($options[$key]) && $default === $options[$key]) {
+ unset($options[$key]);
+ }
+ }
+
+ ksort($options);
+ }
+
+ /**
+ * @param array<string, mixed> $options
+ */
+ protected function generateURI(string $type, array $options): string
+ {
+ $label = $this->getLabel();
+ Assertion::string($label, 'The label is not set.');
+ Assertion::false($this->hasColon($label), 'Label must not contain a colon.');
+ $options = array_merge($options, $this->getParameters());
+ $this->filterOptions($options);
+ $params = str_replace(['+', '%7E'], ['%20', '~'], http_build_query($options));
+
+ return sprintf('otpauth://%s/%s?%s', $type, rawurlencode((null !== $this->getIssuer() ? $this->getIssuer().':' : '').$label), $params);
+ }
+
+ private function getDecodedSecret(): string
+ {
+ try {
+ return Base32::decodeUpper($this->getSecret());
+ } catch (\Exception $e) {
+ throw new RuntimeException('Unable to decode the secret. Is it correctly base32 encoded?');
+ }
+ }
+
+ private function intToByteString(int $int): string
+ {
+ $result = [];
+ while (0 !== $int) {
+ $result[] = \chr($int & 0xFF);
+ $int >>= 8;
+ }
+
+ return str_pad(implode(array_reverse($result)), 8, "\000", STR_PAD_LEFT);
+ }
+
+ protected function compareOTP(string $safe, string $user): bool
+ {
+ return hash_equals($safe, $user);
+ }
+}
diff --git a/vendor/spomky-labs/otphp/src/OTPInterface.php b/vendor/spomky-labs/otphp/src/OTPInterface.php
new file mode 100644
index 000000000..66e163d5d
--- /dev/null
+++ b/vendor/spomky-labs/otphp/src/OTPInterface.php
@@ -0,0 +1,97 @@
+<?php
+
+declare(strict_types=1);
+
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2019 Spomky-Labs
+ *
+ * This software may be modified and distributed under the terms
+ * of the MIT license. See the LICENSE file for details.
+ */
+
+namespace OTPHP;
+
+interface OTPInterface
+{
+ /**
+ * @return string Return the OTP at the specified timestamp
+ */
+ public function at(int $timestamp): string;
+
+ /**
+ * Verify that the OTP is valid with the specified input.
+ * If no input is provided, the input is set to a default value or false is returned.
+ */
+ public function verify(string $otp, ?int $input = null, ?int $window = null): bool;
+
+ /**
+ * @return string The secret of the OTP
+ */
+ public function getSecret(): string;
+
+ /**
+ * @param string $label The label of the OTP
+ */
+ public function setLabel(string $label): void;
+
+ /**
+ * @return string|null The label of the OTP
+ */
+ public function getLabel(): ?string;
+
+ /**
+ * @return string|null The issuer
+ */
+ public function getIssuer(): ?string;
+
+ public function setIssuer(string $issuer): void;
+
+ /**
+ * @return bool If true, the issuer will be added as a parameter in the provisioning URI
+ */
+ public function isIssuerIncludedAsParameter(): bool;
+
+ public function setIssuerIncludedAsParameter(bool $issuer_included_as_parameter): void;
+
+ /**
+ * @return int Number of digits in the OTP
+ */
+ public function getDigits(): int;
+
+ /**
+ * @return string Digest algorithm used to calculate the OTP. Possible values are 'md5', 'sha1', 'sha256' and 'sha512'
+ */
+ public function getDigest(): string;
+
+ /**
+ * @return mixed|null
+ */
+ public function getParameter(string $parameter);
+
+ public function hasParameter(string $parameter): bool;
+
+ /**
+ * @return array<string, mixed>
+ */
+ public function getParameters(): array;
+
+ /**
+ * @param mixed|null $value
+ */
+ public function setParameter(string $parameter, $value): void;
+
+ /**
+ * Get the provisioning URI.
+ */
+ public function getProvisioningUri(): string;
+
+ /**
+ * Get the provisioning URI.
+ *
+ * @param string $uri The Uri of the QRCode generator with all parameters. This Uri MUST contain a placeholder that will be replaced by the method.
+ * @param string $placeholder the placeholder to be replaced in the QR Code generator URI
+ */
+ public function getQrCodeUri(string $uri, string $placeholder): string;
+}
diff --git a/vendor/spomky-labs/otphp/src/ParameterTrait.php b/vendor/spomky-labs/otphp/src/ParameterTrait.php
new file mode 100644
index 000000000..69fa774db
--- /dev/null
+++ b/vendor/spomky-labs/otphp/src/ParameterTrait.php
@@ -0,0 +1,196 @@
+<?php
+
+declare(strict_types=1);
+
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2019 Spomky-Labs
+ *
+ * This software may be modified and distributed under the terms
+ * of the MIT license. See the LICENSE file for details.
+ */
+
+namespace OTPHP;
+
+use Assert\Assertion;
+use InvalidArgumentException;
+use ParagonIE\ConstantTime\Base32;
+use function Safe\sprintf;
+
+trait ParameterTrait
+{
+ /**
+ * @var array<string, mixed>
+ */
+ private $parameters = [];
+
+ /**
+ * @var string|null
+ */
+ private $issuer;
+
+ /**
+ * @var string|null
+ */
+ private $label;
+
+ /**
+ * @var bool
+ */
+ private $issuer_included_as_parameter = true;
+
+ /**
+ * @return array<string, mixed>
+ */
+ public function getParameters(): array
+ {
+ $parameters = $this->parameters;
+
+ if (null !== $this->getIssuer() && true === $this->isIssuerIncludedAsParameter()) {
+ $parameters['issuer'] = $this->getIssuer();
+ }
+
+ return $parameters;
+ }
+
+ public function getSecret(): string
+ {
+ return $this->getParameter('secret');
+ }
+
+ private function setSecret(?string $secret): void
+ {
+ $this->setParameter('secret', $secret);
+ }
+
+ public function getLabel(): ?string
+ {
+ return $this->label;
+ }
+
+ public function setLabel(string $label): void
+ {
+ $this->setParameter('label', $label);
+ }
+
+ public function getIssuer(): ?string
+ {
+ return $this->issuer;
+ }
+
+ public function setIssuer(string $issuer): void
+ {
+ $this->setParameter('issuer', $issuer);
+ }
+
+ public function isIssuerIncludedAsParameter(): bool
+ {
+ return $this->issuer_included_as_parameter;
+ }
+
+ public function setIssuerIncludedAsParameter(bool $issuer_included_as_parameter): void
+ {
+ $this->issuer_included_as_parameter = $issuer_included_as_parameter;
+ }
+
+ public function getDigits(): int
+ {
+ return $this->getParameter('digits');
+ }
+
+ private function setDigits(int $digits): void
+ {
+ $this->setParameter('digits', $digits);
+ }
+
+ public function getDigest(): string
+ {
+ return $this->getParameter('algorithm');
+ }
+
+ private function setDigest(string $digest): void
+ {
+ $this->setParameter('algorithm', $digest);
+ }
+
+ public function hasParameter(string $parameter): bool
+ {
+ return \array_key_exists($parameter, $this->parameters);
+ }
+
+ public function getParameter(string $parameter)
+ {
+ if ($this->hasParameter($parameter)) {
+ return $this->getParameters()[$parameter];
+ }
+
+ throw new InvalidArgumentException(sprintf('Parameter "%s" does not exist', $parameter));
+ }
+
+ public function setParameter(string $parameter, $value): void
+ {
+ $map = $this->getParameterMap();
+
+ if (true === \array_key_exists($parameter, $map)) {
+ $callback = $map[$parameter];
+ $value = $callback($value);
+ }
+
+ if (property_exists($this, $parameter)) {
+ $this->$parameter = $value;
+ } else {
+ $this->parameters[$parameter] = $value;
+ }
+ }
+
+ /**
+ * @return array<string, mixed>
+ */
+ protected function getParameterMap(): array
+ {
+ return [
+ 'label' => function ($value) {
+ Assertion::false($this->hasColon($value), 'Label must not contain a colon.');
+
+ return $value;
+ },
+ 'secret' => function ($value): string {
+ if (null === $value) {
+ $value = Base32::encodeUpper(random_bytes(64));
+ }
+ $value = trim(mb_strtoupper($value), '=');
+
+ return $value;
+ },
+ 'algorithm' => function ($value): string {
+ $value = mb_strtolower($value);
+ Assertion::inArray($value, hash_algos(), sprintf('The "%s" digest is not supported.', $value));
+
+ return $value;
+ },
+ 'digits' => function ($value): int {
+ Assertion::greaterThan($value, 0, 'Digits must be at least 1.');
+
+ return (int) $value;
+ },
+ 'issuer' => function ($value) {
+ Assertion::false($this->hasColon($value), 'Issuer must not contain a colon.');
+
+ return $value;
+ },
+ ];
+ }
+
+ private function hasColon(string $value): bool
+ {
+ $colons = [':', '%3A', '%3a'];
+ foreach ($colons as $colon) {
+ if (false !== mb_strpos($value, $colon)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/vendor/spomky-labs/otphp/src/TOTP.php b/vendor/spomky-labs/otphp/src/TOTP.php
new file mode 100644
index 000000000..588b37f17
--- /dev/null
+++ b/vendor/spomky-labs/otphp/src/TOTP.php
@@ -0,0 +1,159 @@
+<?php
+
+declare(strict_types=1);
+
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2019 Spomky-Labs
+ *
+ * This software may be modified and distributed under the terms
+ * of the MIT license. See the LICENSE file for details.
+ */
+
+namespace OTPHP;
+
+use Assert\Assertion;
+use function Safe\ksort;
+
+final class TOTP extends OTP implements TOTPInterface
+{
+ protected function __construct(?string $secret, int $period, string $digest, int $digits, int $epoch = 0)
+ {
+ parent::__construct($secret, $digest, $digits);
+ $this->setPeriod($period);
+ $this->setEpoch($epoch);
+ }
+
+ public static function create(?string $secret = null, int $period = 30, string $digest = 'sha1', int $digits = 6, int $epoch = 0): TOTPInterface
+ {
+ return new self($secret, $period, $digest, $digits, $epoch);
+ }
+
+ protected function setPeriod(int $period): void
+ {
+ $this->setParameter('period', $period);
+ }
+
+ public function getPeriod(): int
+ {
+ return $this->getParameter('period');
+ }
+
+ private function setEpoch(int $epoch): void
+ {
+ $this->setParameter('epoch', $epoch);
+ }
+
+ public function getEpoch(): int
+ {
+ return $this->getParameter('epoch');
+ }
+
+ public function at(int $timestamp): string
+ {
+ return $this->generateOTP($this->timecode($timestamp));
+ }
+
+ public function now(): string
+ {
+ return $this->at(time());
+ }
+
+ /**
+ * If no timestamp is provided, the OTP is verified at the actual timestamp.
+ */
+ public function verify(string $otp, ?int $timestamp = null, ?int $window = null): bool
+ {
+ $timestamp = $this->getTimestamp($timestamp);
+
+ if (null === $window) {
+ return $this->compareOTP($this->at($timestamp), $otp);
+ }
+
+ return $this->verifyOtpWithWindow($otp, $timestamp, $window);
+ }
+
+ private function verifyOtpWithWindow(string $otp, int $timestamp, int $window): bool
+ {
+ $window = abs($window);
+
+ for ($i = 0; $i <= $window; ++$i) {
+ $next = $i * $this->getPeriod() + $timestamp;
+ $previous = -$i * $this->getPeriod() + $timestamp;
+ $valid = $this->compareOTP($this->at($next), $otp) ||
+ $this->compareOTP($this->at($previous), $otp);
+
+ if ($valid) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private function getTimestamp(?int $timestamp): int
+ {
+ $timestamp = $timestamp ?? time();
+ Assertion::greaterOrEqualThan($timestamp, 0, 'Timestamp must be at least 0.');
+
+ return $timestamp;
+ }
+
+ public function getProvisioningUri(): string
+ {
+ $params = [];
+ if (30 !== $this->getPeriod()) {
+ $params['period'] = $this->getPeriod();
+ }
+
+ if (0 !== $this->getEpoch()) {
+ $params['epoch'] = $this->getEpoch();
+ }
+
+ return $this->generateURI('totp', $params);
+ }
+
+ private function timecode(int $timestamp): int
+ {
+ return (int) floor(($timestamp - $this->getEpoch()) / $this->getPeriod());
+ }
+
+ /**
+ * @return array<string, mixed>
+ */
+ protected function getParameterMap(): array
+ {
+ $v = array_merge(
+ parent::getParameterMap(),
+ [
+ 'period' => function ($value): int {
+ Assertion::greaterThan((int) $value, 0, 'Period must be at least 1.');
+
+ return (int) $value;
+ },
+ 'epoch' => function ($value): int {
+ Assertion::greaterOrEqualThan((int) $value, 0, 'Epoch must be greater than or equal to 0.');
+
+ return (int) $value;
+ },
+ ]
+ );
+
+ return $v;
+ }
+
+ /**
+ * @param array<string, mixed> $options
+ */
+ protected function filterOptions(array &$options): void
+ {
+ parent::filterOptions($options);
+
+ if (isset($options['epoch']) && 0 === $options['epoch']) {
+ unset($options['epoch']);
+ }
+
+ ksort($options);
+ }
+}
diff --git a/vendor/spomky-labs/otphp/src/TOTPInterface.php b/vendor/spomky-labs/otphp/src/TOTPInterface.php
new file mode 100644
index 000000000..a19fe7c0b
--- /dev/null
+++ b/vendor/spomky-labs/otphp/src/TOTPInterface.php
@@ -0,0 +1,36 @@
+<?php
+
+declare(strict_types=1);
+
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2019 Spomky-Labs
+ *
+ * This software may be modified and distributed under the terms
+ * of the MIT license. See the LICENSE file for details.
+ */
+
+namespace OTPHP;
+
+interface TOTPInterface extends OTPInterface
+{
+ /**
+ * Create a new TOTP object.
+ *
+ * If the secret is null, a random 64 bytes secret will be generated.
+ */
+ public static function create(?string $secret = null, int $period = 30, string $digest = 'sha1', int $digits = 6): self;
+
+ /**
+ * Return the TOTP at the current time.
+ */
+ public function now(): string;
+
+ /**
+ * Get the period of time for OTP generation (a non-null positive integer, in second).
+ */
+ public function getPeriod(): int;
+
+ public function getEpoch(): int;
+}
diff --git a/vendor/thecodingmachine/safe/LICENSE b/vendor/thecodingmachine/safe/LICENSE
new file mode 100644
index 000000000..4188a9bbd
--- /dev/null
+++ b/vendor/thecodingmachine/safe/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2018 TheCodingMachine
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE. \ No newline at end of file
diff --git a/vendor/thecodingmachine/safe/README.md b/vendor/thecodingmachine/safe/README.md
new file mode 100644
index 000000000..3c2ee624f
--- /dev/null
+++ b/vendor/thecodingmachine/safe/README.md
@@ -0,0 +1,178 @@
+[![Latest Stable Version](https://poser.pugx.org/thecodingmachine/safe/v/stable.svg)](https://packagist.org/packages/thecodingmachine/safe)
+[![Total Downloads](https://poser.pugx.org/thecodingmachine/safe/downloads.svg)](https://packagist.org/packages/thecodingmachine/safe)
+[![Latest Unstable Version](https://poser.pugx.org/thecodingmachine/safe/v/unstable.svg)](https://packagist.org/packages/thecodingmachine/safe)
+[![License](https://poser.pugx.org/thecodingmachine/safe/license.svg)](https://packagist.org/packages/thecodingmachine/safe)
+[![Build Status](https://travis-ci.org/thecodingmachine/safe.svg?branch=master)](https://travis-ci.org/thecodingmachine/safe)
+[![Continuous Integration](https://github.com/thecodingmachine/safe/workflows/Continuous%20Integration/badge.svg)](https://github.com/thecodingmachine/safe/actions)
+[![codecov](https://codecov.io/gh/thecodingmachine/safe/branch/master/graph/badge.svg)](https://codecov.io/gh/thecodingmachine/safe)
+
+Safe PHP
+========
+
+**Work in progress**
+
+A set of core PHP functions rewritten to throw exceptions instead of returning `false` when an error is encountered.
+
+## The problem
+
+Most PHP core functions were written before exception handling was added to the language. Therefore, most PHP functions
+do not throw exceptions. Instead, they return `false` in case of error.
+
+But most of us are too lazy to check explicitly for every single return of every core PHP function.
+
+```php
+// This code is incorrect. Twice.
+// "file_get_contents" can return false if the file does not exists
+// "json_decode" can return false if the file content is not valid JSON
+$content = file_get_contents('foobar.json');
+$foobar = json_decode($content);
+```
+
+The correct version of this code would be:
+
+```php
+$content = file_get_contents('foobar.json');
+if ($content === false) {
+ throw new FileLoadingException('Could not load file foobar.json');
+}
+$foobar = json_decode($content);
+if (json_last_error() !== JSON_ERROR_NONE) {
+ throw new FileLoadingException('foobar.json does not contain valid JSON: '.json_last_error_msg());
+}
+```
+
+Obviously, while this snippet is correct, it is less easy to read.
+
+## The solution
+
+Enter *thecodingmachine/safe* aka Safe-PHP.
+
+Safe-PHP redeclares all core PHP functions. The new PHP functions act exactly as the old ones, except they
+throw exceptions properly when an error is encountered. The "safe" functions have the same name as the core PHP
+functions, except they are in the `Safe` namespace.
+
+```php
+use function Safe\file_get_contents;
+use function Safe\json_decode;
+
+// This code is both safe and simple!
+$content = file_get_contents('foobar.json');
+$foobar = json_decode($content);
+```
+
+All PHP functions that can return `false` on error are part of Safe.
+In addition, Safe also provide 2 'Safe' classes: `Safe\DateTime` and `Safe\DateTimeImmutable` whose methods will throw exceptions instead of returning false.
+
+## PHPStan integration
+
+> Yeah... but I must explicitly think about importing the "safe" variant of the function, for each and every file of my application.
+> I'm sure I will forget some "use function" statements!
+
+Fear not! thecodingmachine/safe comes with a PHPStan rule.
+
+Never heard of [PHPStan](https://github.com/phpstan/phpstan) before?
+Check it out, it's an amazing code analyzer for PHP.
+
+Simply install the Safe rule in your PHPStan setup (explained in the "Installation" section) and PHPStan will let you know each time you are using an "unsafe" function.
+
+The code below will trigger this warning:
+
+```php
+$content = file_get_contents('foobar.json');
+```
+
+> Function file_get_contents is unsafe to use. It can return FALSE instead of throwing an exception. Please add 'use function Safe\\file_get_contents;' at the beginning of the file to use the variant provided by the 'thecodingmachine/safe' library.
+
+## Installation
+
+Use composer to install Safe-PHP:
+
+```bash
+$ composer require thecodingmachine/safe
+```
+
+*Highly recommended*: install PHPStan and PHPStan extension:
+
+```bash
+$ composer require --dev thecodingmachine/phpstan-safe-rule
+```
+
+Now, edit your `phpstan.neon` file and add these rules:
+
+```yml
+includes:
+ - vendor/thecodingmachine/phpstan-safe-rule/phpstan-safe-rule.neon
+```
+
+## Automated refactoring
+
+You have a large legacy codebase and want to use "Safe-PHP" functions throughout your project? PHPStan will help you
+find these functions but changing the namespace of the functions one function at a time might be a tedious task.
+
+Fortunately, Safe comes bundled with a "Rector" configuration file. [Rector](https://github.com/rectorphp/rector) is a command-line
+tool that performs instant refactoring of your application.
+
+Run
+
+```bash
+$ composer require --dev rector/rector:^0.7
+```
+
+to install `rector/rector`.
+
+Run
+
+```bash
+vendor/bin/rector process src/ --config vendor/thecodingmachine/safe/rector-migrate-0.7.php
+```
+
+to run `rector/rector`.
+
+*Note:* do not forget to replace "src/" with the path to your source directory.
+
+**Important:** the refactoring only performs a "dumb" replacement of functions. It will not modify the way
+"false" return values are handled. So if your code was already performing error handling, you will have to deal
+with it manually.
+
+Especially, you should look for error handling that was already performed, like:
+
+```php
+if (!mkdir($dirPath)) {
+ // Do something on error
+}
+```
+
+This code will be refactored by Rector to:
+
+```php
+if (!\Safe\mkdir($dirPath)) {
+ // Do something on error
+}
+```
+
+You should then (manually) refactor it to:
+
+```php
+try {
+ \Safe\mkdir($dirPath));
+} catch (\Safe\FilesystemException $e) {
+ // Do something on error
+}
+```
+
+## Performance impact
+
+Safe is loading 1000+ functions from ~85 files on each request. Yet, the performance impact of this loading is quite low.
+
+In case you worry, using Safe will "cost" you ~700µs on each request. The [performance section](performance/README.md)
+contains more information regarding the way we tested the performance impact of Safe.
+
+## Learn more
+
+Read [the release article on TheCodingMachine's blog](https://thecodingmachine.io/introducing-safe-php) if you want to
+learn more about what triggered the development of Safe-PHP.
+
+## Contributing
+
+The files that contain all the functions are auto-generated from the PHP doc.
+Read the [CONTRIBUTING.md](CONTRIBUTING.md) file to learn how to regenerate these files and to contribute to this library.
diff --git a/vendor/thecodingmachine/safe/composer.json b/vendor/thecodingmachine/safe/composer.json
new file mode 100644
index 000000000..2cd03fcc8
--- /dev/null
+++ b/vendor/thecodingmachine/safe/composer.json
@@ -0,0 +1,123 @@
+{
+ "name": "thecodingmachine/safe",
+ "description": "PHP core functions that throw exceptions instead of returning FALSE on error",
+ "license": "MIT",
+ "autoload": {
+ "psr-4": {
+ "Safe\\": [
+ "lib/",
+ "deprecated/",
+ "generated/"
+ ]
+ },
+ "files": [
+ "deprecated/apc.php",
+ "deprecated/libevent.php",
+ "deprecated/mssql.php",
+ "deprecated/stats.php",
+ "lib/special_cases.php",
+ "generated/apache.php",
+ "generated/apcu.php",
+ "generated/array.php",
+ "generated/bzip2.php",
+ "generated/calendar.php",
+ "generated/classobj.php",
+ "generated/com.php",
+ "generated/cubrid.php",
+ "generated/curl.php",
+ "generated/datetime.php",
+ "generated/dir.php",
+ "generated/eio.php",
+ "generated/errorfunc.php",
+ "generated/exec.php",
+ "generated/fileinfo.php",
+ "generated/filesystem.php",
+ "generated/filter.php",
+ "generated/fpm.php",
+ "generated/ftp.php",
+ "generated/funchand.php",
+ "generated/gmp.php",
+ "generated/gnupg.php",
+ "generated/hash.php",
+ "generated/ibase.php",
+ "generated/ibmDb2.php",
+ "generated/iconv.php",
+ "generated/image.php",
+ "generated/imap.php",
+ "generated/info.php",
+ "generated/ingres-ii.php",
+ "generated/inotify.php",
+ "generated/json.php",
+ "generated/ldap.php",
+ "generated/libxml.php",
+ "generated/lzf.php",
+ "generated/mailparse.php",
+ "generated/mbstring.php",
+ "generated/misc.php",
+ "generated/msql.php",
+ "generated/mysql.php",
+ "generated/mysqli.php",
+ "generated/mysqlndMs.php",
+ "generated/mysqlndQc.php",
+ "generated/network.php",
+ "generated/oci8.php",
+ "generated/opcache.php",
+ "generated/openssl.php",
+ "generated/outcontrol.php",
+ "generated/password.php",
+ "generated/pcntl.php",
+ "generated/pcre.php",
+ "generated/pdf.php",
+ "generated/pgsql.php",
+ "generated/posix.php",
+ "generated/ps.php",
+ "generated/pspell.php",
+ "generated/readline.php",
+ "generated/rpminfo.php",
+ "generated/rrd.php",
+ "generated/sem.php",
+ "generated/session.php",
+ "generated/shmop.php",
+ "generated/simplexml.php",
+ "generated/sockets.php",
+ "generated/sodium.php",
+ "generated/solr.php",
+ "generated/spl.php",
+ "generated/sqlsrv.php",
+ "generated/ssdeep.php",
+ "generated/ssh2.php",
+ "generated/stream.php",
+ "generated/strings.php",
+ "generated/swoole.php",
+ "generated/uodbc.php",
+ "generated/uopz.php",
+ "generated/url.php",
+ "generated/var.php",
+ "generated/xdiff.php",
+ "generated/xml.php",
+ "generated/xmlrpc.php",
+ "generated/yaml.php",
+ "generated/yaz.php",
+ "generated/zip.php",
+ "generated/zlib.php"
+ ]
+ },
+ "require": {
+ "php": ">=7.2"
+ },
+ "require-dev": {
+ "phpstan/phpstan": "^0.12",
+ "thecodingmachine/phpstan-strict-rules": "^0.12",
+ "squizlabs/php_codesniffer": "^3.2"
+ },
+ "scripts": {
+ "phpstan": "phpstan analyse lib -c phpstan.neon --level=max --no-progress -vvv",
+ "cs-fix": "phpcbf",
+ "cs-check": "phpcs"
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "0.1-dev"
+ }
+ }
+} \ No newline at end of file
diff --git a/vendor/thecodingmachine/safe/deprecated/Exceptions/ApcException.php b/vendor/thecodingmachine/safe/deprecated/Exceptions/ApcException.php
new file mode 100644
index 000000000..f344490d8
--- /dev/null
+++ b/vendor/thecodingmachine/safe/deprecated/Exceptions/ApcException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class ApcException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/deprecated/Exceptions/LibeventException.php b/vendor/thecodingmachine/safe/deprecated/Exceptions/LibeventException.php
new file mode 100644
index 000000000..e1df31b77
--- /dev/null
+++ b/vendor/thecodingmachine/safe/deprecated/Exceptions/LibeventException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class LibeventException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/deprecated/Exceptions/MssqlException.php b/vendor/thecodingmachine/safe/deprecated/Exceptions/MssqlException.php
new file mode 100644
index 000000000..814bd4e0b
--- /dev/null
+++ b/vendor/thecodingmachine/safe/deprecated/Exceptions/MssqlException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class MssqlException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/deprecated/Exceptions/StatsException.php b/vendor/thecodingmachine/safe/deprecated/Exceptions/StatsException.php
new file mode 100644
index 000000000..f8a7f45c2
--- /dev/null
+++ b/vendor/thecodingmachine/safe/deprecated/Exceptions/StatsException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class StatsException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/deprecated/apc.php b/vendor/thecodingmachine/safe/deprecated/apc.php
new file mode 100644
index 000000000..7930432c6
--- /dev/null
+++ b/vendor/thecodingmachine/safe/deprecated/apc.php
@@ -0,0 +1,238 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\ApcException;
+
+/**
+ * Retrieves cached information and meta-data from APC's data store.
+ *
+ * @param string $cache_type If cache_type is "user",
+ * information about the user cache will be returned.
+ *
+ * If cache_type is "filehits",
+ * information about which files have been served from the bytecode cache
+ * for the current request will be returned. This feature must be enabled at
+ * compile time using --enable-filehits.
+ *
+ * If an invalid or no cache_type is specified, information about
+ * the system cache (cached files) will be returned.
+ * @param bool $limited If limited is TRUE, the
+ * return value will exclude the individual list of cache entries. This
+ * is useful when trying to optimize calls for statistics gathering.
+ * @return array Array of cached data (and meta-data)
+ * @throws ApcException
+ *
+ */
+function apc_cache_info(string $cache_type = '', bool $limited = false): array
+{
+ error_clear_last();
+ $result = \apc_cache_info($cache_type, $limited);
+ if ($result === false) {
+ throw ApcException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * apc_cas updates an already existing integer value if the
+ * old parameter matches the currently stored value
+ * with the value of the new parameter.
+ *
+ * @param string $key The key of the value being updated.
+ * @param int $old The old value (the value currently stored).
+ * @param int $new The new value to update to.
+ * @throws ApcException
+ *
+ */
+function apc_cas(string $key, int $old, int $new): void
+{
+ error_clear_last();
+ $result = \apc_cas($key, $old, $new);
+ if ($result === false) {
+ throw ApcException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Stores a file in the bytecode cache, bypassing all filters.
+ *
+ * @param string $filename Full or relative path to a PHP file that will be compiled and stored in
+ * the bytecode cache.
+ * @param bool $atomic
+ * @return mixed Returns TRUE on success.
+ * @throws ApcException
+ *
+ */
+function apc_compile_file(string $filename, bool $atomic = true)
+{
+ error_clear_last();
+ $result = \apc_compile_file($filename, $atomic);
+ if ($result === false) {
+ throw ApcException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Decreases a stored integer value.
+ *
+ * @param string $key The key of the value being decreased.
+ * @param int $step The step, or value to decrease.
+ * @param bool|null $success Optionally pass the success or fail boolean value to
+ * this referenced variable.
+ * @return int Returns the current value of key's value on success
+ * @throws ApcException
+ *
+ */
+function apc_dec(string $key, int $step = 1, ?bool &$success = null): int
+{
+ error_clear_last();
+ $result = \apc_dec($key, $step, $success);
+ if ($result === false) {
+ throw ApcException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * define is notoriously slow. Since the main benefit of
+ * APC is to increase the performance of scripts/applications, this mechanism
+ * is provided to streamline the process of mass constant definition. However,
+ * this function does not perform as well as anticipated.
+ *
+ * For a better-performing solution, try the
+ * hidef extension from PECL.
+ *
+ * @param string $key The key serves as the name of the constant set
+ * being stored. This key is used to retrieve the
+ * stored constants in apc_load_constants.
+ * @param array $constants An associative array of constant_name =&gt; value
+ * pairs. The constant_name must follow the normal
+ * constant naming rules.
+ * value must evaluate to a scalar value.
+ * @param bool $case_sensitive The default behaviour for constants is to be declared case-sensitive;
+ * i.e. CONSTANT and Constant
+ * represent different values. If this parameter evaluates to FALSE the
+ * constants will be declared as case-insensitive symbols.
+ * @throws ApcException
+ *
+ */
+function apc_define_constants(string $key, array $constants, bool $case_sensitive = true): void
+{
+ error_clear_last();
+ $result = \apc_define_constants($key, $constants, $case_sensitive);
+ if ($result === false) {
+ throw ApcException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Deletes the given files from the opcode cache.
+ *
+ * @param mixed $keys The files to be deleted. Accepts a string,
+ * array of strings, or an APCIterator
+ * object.
+ * @return mixed Returns TRUE on success.
+ * Or if keys is an array, then
+ * an empty array is returned on success, or an array of failed files
+ * is returned.
+ * @throws ApcException
+ *
+ */
+function apc_delete_file($keys)
+{
+ error_clear_last();
+ $result = \apc_delete_file($keys);
+ if ($result === false) {
+ throw ApcException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Removes a stored variable from the cache.
+ *
+ * @param string|string[]|\APCIterator $key The key used to store the value (with
+ * apc_store).
+ * @throws ApcException
+ *
+ */
+function apc_delete($key): void
+{
+ error_clear_last();
+ $result = \apc_delete($key);
+ if ($result === false) {
+ throw ApcException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Increases a stored number.
+ *
+ * @param string $key The key of the value being increased.
+ * @param int $step The step, or value to increase.
+ * @param bool|null $success Optionally pass the success or fail boolean value to
+ * this referenced variable.
+ * @return int Returns the current value of key's value on success
+ * @throws ApcException
+ *
+ */
+function apc_inc(string $key, int $step = 1, ?bool &$success = null): int
+{
+ error_clear_last();
+ $result = \apc_inc($key, $step, $success);
+ if ($result === false) {
+ throw ApcException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Loads a set of constants from the cache.
+ *
+ * @param string $key The name of the constant set (that was stored with
+ * apc_define_constants) to be retrieved.
+ * @param bool $case_sensitive The default behaviour for constants is to be declared case-sensitive;
+ * i.e. CONSTANT and Constant
+ * represent different values. If this parameter evaluates to FALSE the
+ * constants will be declared as case-insensitive symbols.
+ * @throws ApcException
+ *
+ */
+function apc_load_constants(string $key, bool $case_sensitive = true): void
+{
+ error_clear_last();
+ $result = \apc_load_constants($key, $case_sensitive);
+ if ($result === false) {
+ throw ApcException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Retrieves APC's Shared Memory Allocation information.
+ *
+ * @param bool $limited When set to FALSE (default) apc_sma_info will
+ * return a detailed information about each segment.
+ * @return array Array of Shared Memory Allocation data; FALSE on failure.
+ * @throws ApcException
+ *
+ */
+function apc_sma_info(bool $limited = false): array
+{
+ error_clear_last();
+ $result = \apc_sma_info($limited);
+ if ($result === false) {
+ throw ApcException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/deprecated/functionsList.php b/vendor/thecodingmachine/safe/deprecated/functionsList.php
new file mode 100644
index 000000000..e430cd3b9
--- /dev/null
+++ b/vendor/thecodingmachine/safe/deprecated/functionsList.php
@@ -0,0 +1,56 @@
+<?php
+
+return [
+ 'apc_cache_info',
+ 'apc_cas',
+ 'apc_compile_file',
+ 'apc_dec',
+ 'apc_define_constants',
+ 'apc_delete',
+ 'apc_delete_file',
+ 'apc_inc',
+ 'apc_load_constants',
+ 'apc_sma_info',
+ 'event_add',
+ 'event_base_loopbreak',
+ 'event_base_loopexit',
+ 'event_base_new',
+ 'event_base_priority_init',
+ 'event_base_reinit',
+ 'event_base_set',
+ 'event_buffer_base_set',
+ 'event_buffer_disable',
+ 'event_buffer_enable',
+ 'event_buffer_new',
+ 'event_buffer_priority_set',
+ 'event_buffer_set_callback',
+ 'event_buffer_write',
+ 'event_del',
+ 'event_new',
+ 'event_priority_set',
+ 'event_set',
+ 'event_timer_set',
+ 'imagepsencodefont',
+ 'imagepsextendfont',
+ 'imagepsfreefont',
+ 'imagepsslantfont',
+ 'mssql_bind',
+ 'mssql_close',
+ 'mssql_connect',
+ 'mssql_data_seek',
+ 'mssql_field_length',
+ 'mssql_field_name',
+ 'mssql_field_seek',
+ 'mssql_field_type',
+ 'mssql_free_result',
+ 'mssql_free_statement',
+ 'mssql_init',
+ 'mssql_pconnect',
+ 'mssql_query',
+ 'mssql_select_db',
+ 'stats_covariance',
+ 'stats_standard_deviation',
+ 'stats_stat_correlation',
+ 'stats_stat_innerproduct',
+ 'stats_variance',
+];
diff --git a/vendor/thecodingmachine/safe/deprecated/libevent.php b/vendor/thecodingmachine/safe/deprecated/libevent.php
new file mode 100644
index 000000000..574f0a67b
--- /dev/null
+++ b/vendor/thecodingmachine/safe/deprecated/libevent.php
@@ -0,0 +1,496 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\LibeventException;
+
+/**
+ * event_add schedules the execution of the event
+ * when the event specified in event_set occurs or in at least the time
+ * specified by the timeout argument. If
+ * timeout was not specified, not timeout is set. The
+ * event must be already initalized by event_set
+ * and event_base_set functions. If the
+ * event already has a timeout set, it is replaced by
+ * the new one.
+ *
+ * @param resource $event Valid event resource.
+ * @param int $timeout Optional timeout (in microseconds).
+ * @throws LibeventException
+ *
+ */
+function event_add($event, int $timeout = -1): void
+{
+ error_clear_last();
+ $result = \event_add($event, $timeout);
+ if ($result === false) {
+ throw LibeventException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Abort the active event loop immediately. The behaviour is similar to
+ * break statement.
+ *
+ * @param resource $event_base Valid event base resource.
+ * @throws LibeventException
+ *
+ */
+function event_base_loopbreak($event_base): void
+{
+ error_clear_last();
+ $result = \event_base_loopbreak($event_base);
+ if ($result === false) {
+ throw LibeventException::createFromPhpError();
+ }
+}
+
+
+/**
+ * The next event loop iteration after the given timer expires will complete
+ * normally, then exit without blocking for events again.
+ *
+ * @param resource $event_base Valid event base resource.
+ * @param int $timeout Optional timeout parameter (in microseconds).
+ * @throws LibeventException
+ *
+ */
+function event_base_loopexit($event_base, int $timeout = -1): void
+{
+ error_clear_last();
+ $result = \event_base_loopexit($event_base, $timeout);
+ if ($result === false) {
+ throw LibeventException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Returns new event base, which can be used later in event_base_set,
+ * event_base_loop and other functions.
+ *
+ * @return resource event_base_new returns valid event base resource on
+ * success.
+ * @throws LibeventException
+ *
+ */
+function event_base_new()
+{
+ error_clear_last();
+ $result = \event_base_new();
+ if ($result === false) {
+ throw LibeventException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Sets the number of different event priority levels.
+ *
+ * By default all events are scheduled with the same priority
+ * (npriorities/2).
+ * Using event_base_priority_init you can change the number
+ * of event priority levels and then set a desired priority for each event.
+ *
+ * @param resource $event_base Valid event base resource.
+ * @param int $npriorities The number of event priority levels.
+ * @throws LibeventException
+ *
+ */
+function event_base_priority_init($event_base, int $npriorities): void
+{
+ error_clear_last();
+ $result = \event_base_priority_init($event_base, $npriorities);
+ if ($result === false) {
+ throw LibeventException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Some event mechanisms do not survive across fork. The
+ * event_base needs to be reinitialized with this
+ * function.
+ *
+ * @param resource $event_base Valid event base resource that needs to be re-initialized.
+ * @throws LibeventException
+ *
+ */
+function event_base_reinit($event_base): void
+{
+ error_clear_last();
+ $result = \event_base_reinit($event_base);
+ if ($result === false) {
+ throw LibeventException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Associates the event_base with the
+ * event.
+ *
+ * @param resource $event Valid event resource.
+ * @param resource $event_base Valid event base resource.
+ * @throws LibeventException
+ *
+ */
+function event_base_set($event, $event_base): void
+{
+ error_clear_last();
+ $result = \event_base_set($event, $event_base);
+ if ($result === false) {
+ throw LibeventException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Assign the specified bevent to the
+ * event_base.
+ *
+ * @param resource $bevent Valid buffered event resource.
+ * @param resource $event_base Valid event base resource.
+ * @throws LibeventException
+ *
+ */
+function event_buffer_base_set($bevent, $event_base): void
+{
+ error_clear_last();
+ $result = \event_buffer_base_set($bevent, $event_base);
+ if ($result === false) {
+ throw LibeventException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Disables the specified buffered event.
+ *
+ * @param resource $bevent Valid buffered event resource.
+ * @param int $events Any combination of EV_READ and
+ * EV_WRITE.
+ * @throws LibeventException
+ *
+ */
+function event_buffer_disable($bevent, int $events): void
+{
+ error_clear_last();
+ $result = \event_buffer_disable($bevent, $events);
+ if ($result === false) {
+ throw LibeventException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Enables the specified buffered event.
+ *
+ * @param resource $bevent Valid buffered event resource.
+ * @param int $events Any combination of EV_READ and
+ * EV_WRITE.
+ * @throws LibeventException
+ *
+ */
+function event_buffer_enable($bevent, int $events): void
+{
+ error_clear_last();
+ $result = \event_buffer_enable($bevent, $events);
+ if ($result === false) {
+ throw LibeventException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Libevent provides an abstraction layer on top of the regular event API.
+ * Using buffered event you don't need to deal with the I/O manually, instead
+ * it provides input and output buffers that get filled and drained
+ * automatically.
+ *
+ * @param resource $stream Valid PHP stream resource. Must be castable to file descriptor.
+ * @param mixed $readcb Callback to invoke where there is data to read, or NULL if
+ * no callback is desired.
+ * @param mixed $writecb Callback to invoke where the descriptor is ready for writing,
+ * or NULL if no callback is desired.
+ * @param mixed $errorcb Callback to invoke where there is an error on the descriptor, cannot be
+ * NULL.
+ * @param mixed $arg An argument that will be passed to each of the callbacks (optional).
+ * @return resource event_buffer_new returns new buffered event resource
+ * on success.
+ * @throws LibeventException
+ *
+ */
+function event_buffer_new($stream, $readcb, $writecb, $errorcb, $arg = null)
+{
+ error_clear_last();
+ if ($arg !== null) {
+ $result = \event_buffer_new($stream, $readcb, $writecb, $errorcb, $arg);
+ } else {
+ $result = \event_buffer_new($stream, $readcb, $writecb, $errorcb);
+ }
+ if ($result === false) {
+ throw LibeventException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Assign a priority to the bevent.
+ *
+ * @param resource $bevent Valid buffered event resource.
+ * @param int $priority Priority level. Cannot be less than zero and cannot exceed maximum
+ * priority level of the event base (see event_base_priority_init).
+ * @throws LibeventException
+ *
+ */
+function event_buffer_priority_set($bevent, int $priority): void
+{
+ error_clear_last();
+ $result = \event_buffer_priority_set($bevent, $priority);
+ if ($result === false) {
+ throw LibeventException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets or changes existing callbacks for the buffered event.
+ *
+ * @param resource $event Valid buffered event resource.
+ * @param mixed $readcb Callback to invoke where there is data to read, or NULL if
+ * no callback is desired.
+ * @param mixed $writecb Callback to invoke where the descriptor is ready for writing,
+ * or NULL if no callback is desired.
+ * @param mixed $errorcb Callback to invoke where there is an error on the descriptor, cannot be
+ * NULL.
+ * @param mixed $arg An argument that will be passed to each of the callbacks (optional).
+ * @throws LibeventException
+ *
+ */
+function event_buffer_set_callback($event, $readcb, $writecb, $errorcb, $arg = null): void
+{
+ error_clear_last();
+ if ($arg !== null) {
+ $result = \event_buffer_set_callback($event, $readcb, $writecb, $errorcb, $arg);
+ } else {
+ $result = \event_buffer_set_callback($event, $readcb, $writecb, $errorcb);
+ }
+ if ($result === false) {
+ throw LibeventException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Writes data to the specified buffered event. The data is appended to the
+ * output buffer and written to the descriptor when it becomes available for
+ * writing.
+ *
+ * @param resource $bevent Valid buffered event resource.
+ * @param string $data The data to be written.
+ * @param int $data_size Optional size parameter. event_buffer_write writes
+ * all the data by default.
+ * @throws LibeventException
+ *
+ */
+function event_buffer_write($bevent, string $data, int $data_size = -1): void
+{
+ error_clear_last();
+ $result = \event_buffer_write($bevent, $data, $data_size);
+ if ($result === false) {
+ throw LibeventException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Cancels the event.
+ *
+ * @param resource $event Valid event resource.
+ * @throws LibeventException
+ *
+ */
+function event_del($event): void
+{
+ error_clear_last();
+ $result = \event_del($event);
+ if ($result === false) {
+ throw LibeventException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Creates and returns a new event resource.
+ *
+ * @return resource event_new returns a new event resource on success.
+ * @throws LibeventException
+ *
+ */
+function event_new()
+{
+ error_clear_last();
+ $result = \event_new();
+ if ($result === false) {
+ throw LibeventException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Assign a priority to the event.
+ *
+ * @param resource $event Valid event resource.
+ * @param int $priority Priority level. Cannot be less than zero and cannot exceed maximum
+ * priority level of the event base (see
+ * event_base_priority_init).
+ * @throws LibeventException
+ *
+ */
+function event_priority_set($event, int $priority): void
+{
+ error_clear_last();
+ $result = \event_priority_set($event, $priority);
+ if ($result === false) {
+ throw LibeventException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Prepares the event to be used in event_add. The event
+ * is prepared to call the function specified by the callback
+ * on the events specified in parameter events, which
+ * is a set of the following flags: EV_TIMEOUT,
+ * EV_SIGNAL, EV_READ,
+ * EV_WRITE and EV_PERSIST.
+ *
+ * If EV_SIGNAL bit is set in parameter events,
+ * the fd is interpreted as signal number.
+ *
+ * After initializing the event, use event_base_set to
+ * associate the event with its event base.
+ *
+ * In case of matching event, these three arguments are passed to the
+ * callback function:
+ *
+ *
+ * fd
+ *
+ *
+ * Signal number or resource indicating the stream.
+ *
+ *
+ *
+ *
+ * events
+ *
+ *
+ * A flag indicating the event. Consists of the following flags:
+ * EV_TIMEOUT, EV_SIGNAL,
+ * EV_READ, EV_WRITE
+ * and EV_PERSIST.
+ *
+ *
+ *
+ *
+ * arg
+ *
+ *
+ * Optional parameter, previously passed to event_set
+ * as arg.
+ *
+ *
+ *
+ *
+ *
+ * @param resource $event Valid event resource.
+ * @param mixed $fd Valid PHP stream resource. The stream must be castable to file
+ * descriptor, so you most likely won't be able to use any of filtered
+ * streams.
+ * @param int $events A set of flags indicating the desired event, can be
+ * EV_READ and/or EV_WRITE.
+ * The additional flag EV_PERSIST makes the event
+ * to persist until event_del is called, otherwise
+ * the callback is invoked only once.
+ * @param mixed $callback Callback function to be called when the matching event occurs.
+ * @param mixed $arg Optional callback parameter.
+ * @throws LibeventException
+ *
+ */
+function event_set($event, $fd, int $events, $callback, $arg = null): void
+{
+ error_clear_last();
+ if ($arg !== null) {
+ $result = \event_set($event, $fd, $events, $callback, $arg);
+ } else {
+ $result = \event_set($event, $fd, $events, $callback);
+ }
+ if ($result === false) {
+ throw LibeventException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Prepares the timer event to be used in event_add. The
+ * event is prepared to call the function specified by the
+ * callback when the event timeout elapses.
+ *
+ * After initializing the event, use event_base_set to
+ * associate the event with its event base.
+ *
+ * In case of matching event, these three arguments are passed to the
+ * callback function:
+ *
+ *
+ * fd
+ *
+ *
+ * Signal number or resource indicating the stream.
+ *
+ *
+ *
+ *
+ * events
+ *
+ *
+ * A flag indicating the event. This will always be
+ * EV_TIMEOUT for timer events.
+ *
+ *
+ *
+ *
+ * arg
+ *
+ *
+ * Optional parameter, previously passed to
+ * event_timer_set as arg.
+ *
+ *
+ *
+ *
+ *
+ * @param resource $event Valid event resource.
+ * @param callable $callback Callback function to be called when the matching event occurs.
+ * @param mixed $arg Optional callback parameter.
+ * @throws LibeventException
+ *
+ */
+function event_timer_set($event, callable $callback, $arg = null): void
+{
+ error_clear_last();
+ if ($arg !== null) {
+ $result = \event_timer_set($event, $callback, $arg);
+ } else {
+ $result = \event_timer_set($event, $callback);
+ }
+ if ($result === false) {
+ throw LibeventException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/deprecated/mssql.php b/vendor/thecodingmachine/safe/deprecated/mssql.php
new file mode 100644
index 000000000..234ef56b1
--- /dev/null
+++ b/vendor/thecodingmachine/safe/deprecated/mssql.php
@@ -0,0 +1,426 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\MssqlException;
+
+/**
+ * Binds a parameter to a stored procedure or a remote stored procedure.
+ *
+ * @param resource $stmt Statement resource, obtained with mssql_init.
+ * @param string $param_name The parameter name, as a string.
+ *
+ * You have to include the @ character, like in the
+ * T-SQL syntax. See the explanation included in
+ * mssql_execute.
+ * @param mixed $var The PHP variable you'll bind the MSSQL parameter to. It is passed by
+ * reference, to retrieve OUTPUT and RETVAL values after
+ * the procedure execution.
+ * @param int $type One of: SQLTEXT,
+ * SQLVARCHAR, SQLCHAR,
+ * SQLINT1, SQLINT2,
+ * SQLINT4, SQLBIT,
+ * SQLFLT4, SQLFLT8,
+ * SQLFLTN.
+ * @param bool $is_output Whether the value is an OUTPUT parameter or not. If it's an OUTPUT
+ * parameter and you don't mention it, it will be treated as a normal
+ * input parameter and no error will be thrown.
+ * @param bool $is_null Whether the parameter is NULL or not. Passing the NULL value as
+ * var will not do the job.
+ * @param int $maxlen Used with char/varchar values. You have to indicate the length of the
+ * data so if the parameter is a varchar(50), the type must be
+ * SQLVARCHAR and this value 50.
+ * @throws MssqlException
+ *
+ */
+function mssql_bind($stmt, string $param_name, &$var, int $type, bool $is_output = false, bool $is_null = false, int $maxlen = -1): void
+{
+ error_clear_last();
+ $result = \mssql_bind($stmt, $param_name, $var, $type, $is_output, $is_null, $maxlen);
+ if ($result === false) {
+ throw MssqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Closes the link to a MS SQL Server database that's associated with the
+ * specified link identifier. If the link identifier isn't specified, the
+ * last opened link is assumed.
+ *
+ * Note that this isn't usually necessary, as non-persistent open
+ * links are automatically closed at the end of the script's
+ * execution.
+ *
+ * @param resource $link_identifier A MS SQL link identifier, returned by
+ * mssql_connect.
+ *
+ * This function will not close persistent links generated by
+ * mssql_pconnect.
+ * @throws MssqlException
+ *
+ */
+function mssql_close($link_identifier = null): void
+{
+ error_clear_last();
+ if ($link_identifier !== null) {
+ $result = \mssql_close($link_identifier);
+ } else {
+ $result = \mssql_close();
+ }
+ if ($result === false) {
+ throw MssqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * mssql_connect establishes a connection to a
+ * MS SQL server.
+ *
+ * The link to the server will be closed as soon as the execution of
+ * the script ends, unless it's closed earlier by explicitly calling
+ * mssql_close.
+ *
+ * @param string $servername The MS SQL server. It can also include a port number, e.g.
+ * hostname:port (Linux), or
+ * hostname,port (Windows).
+ * @param string $username The username.
+ * @param string $password The password.
+ * @param bool $new_link If a second call is made to mssql_connect with the
+ * same arguments, no new link will be established, but instead, the link
+ * identifier of the already opened link will be returned. This parameter
+ * modifies this behavior and makes mssql_connect
+ * always open a new link, even if mssql_connect was
+ * called before with the same parameters.
+ * @return resource Returns a MS SQL link identifier on success.
+ * @throws MssqlException
+ *
+ */
+function mssql_connect(string $servername = null, string $username = null, string $password = null, bool $new_link = false)
+{
+ error_clear_last();
+ if ($new_link !== false) {
+ $result = \mssql_connect($servername, $username, $password, $new_link);
+ } elseif ($password !== null) {
+ $result = \mssql_connect($servername, $username, $password);
+ } elseif ($username !== null) {
+ $result = \mssql_connect($servername, $username);
+ } elseif ($servername !== null) {
+ $result = \mssql_connect($servername);
+ } else {
+ $result = \mssql_connect();
+ }
+ if ($result === false) {
+ throw MssqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * mssql_data_seek moves the internal row
+ * pointer of the MS SQL result associated with the specified result
+ * identifier to point to the specified row number, first row being
+ * number 0. The next call to mssql_fetch_row
+ * would return that row.
+ *
+ * @param resource $result_identifier The result resource that is being evaluated.
+ * @param int $row_number The desired row number of the new result pointer.
+ * @throws MssqlException
+ *
+ */
+function mssql_data_seek($result_identifier, int $row_number): void
+{
+ error_clear_last();
+ $result = \mssql_data_seek($result_identifier, $row_number);
+ if ($result === false) {
+ throw MssqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Returns the length of field no. offset in
+ * result.
+ *
+ * @param resource $result The result resource that is being evaluated. This result comes from a
+ * call to mssql_query.
+ * @param int $offset The field offset, starts at 0. If omitted, the current field is used.
+ * @return int The length of the specified field index on success.
+ * @throws MssqlException
+ *
+ */
+function mssql_field_length($result, int $offset = -1): int
+{
+ error_clear_last();
+ $result = \mssql_field_length($result, $offset);
+ if ($result === false) {
+ throw MssqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Returns the name of field no. offset in
+ * result.
+ *
+ * @param resource $result The result resource that is being evaluated. This result comes from a
+ * call to mssql_query.
+ * @param int $offset The field offset, starts at 0. If omitted, the current field is used.
+ * @return string The name of the specified field index on success.
+ * @throws MssqlException
+ *
+ */
+function mssql_field_name($result, int $offset = -1): string
+{
+ error_clear_last();
+ $result = \mssql_field_name($result, $offset);
+ if ($result === false) {
+ throw MssqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Seeks to the specified field offset. If the next call to
+ * mssql_fetch_field won't include a field
+ * offset, this field would be returned.
+ *
+ * @param resource $result The result resource that is being evaluated. This result comes from a
+ * call to mssql_query.
+ * @param int $field_offset The field offset, starts at 0.
+ * @throws MssqlException
+ *
+ */
+function mssql_field_seek($result, int $field_offset): void
+{
+ error_clear_last();
+ $result = \mssql_field_seek($result, $field_offset);
+ if ($result === false) {
+ throw MssqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Returns the type of field no. offset in
+ * result.
+ *
+ * @param resource $result The result resource that is being evaluated. This result comes from a
+ * call to mssql_query.
+ * @param int $offset The field offset, starts at 0. If omitted, the current field is used.
+ * @return string The type of the specified field index on success.
+ * @throws MssqlException
+ *
+ */
+function mssql_field_type($result, int $offset = -1): string
+{
+ error_clear_last();
+ $result = \mssql_field_type($result, $offset);
+ if ($result === false) {
+ throw MssqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * mssql_free_result only needs to be called
+ * if you are worried about using too much memory while your script
+ * is running. All result memory will automatically be freed when
+ * the script ends. You may call mssql_free_result
+ * with the result identifier as an argument and the associated
+ * result memory will be freed.
+ *
+ * @param resource $result The result resource that is being freed. This result comes from a
+ * call to mssql_query.
+ * @throws MssqlException
+ *
+ */
+function mssql_free_result($result): void
+{
+ error_clear_last();
+ $result = \mssql_free_result($result);
+ if ($result === false) {
+ throw MssqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * mssql_free_statement only needs to be called
+ * if you are worried about using too much memory while your script
+ * is running. All statement memory will automatically be freed when
+ * the script ends. You may call mssql_free_statement
+ * with the statement identifier as an argument and the associated
+ * statement memory will be freed.
+ *
+ * @param resource $stmt Statement resource, obtained with mssql_init.
+ * @throws MssqlException
+ *
+ */
+function mssql_free_statement($stmt): void
+{
+ error_clear_last();
+ $result = \mssql_free_statement($stmt);
+ if ($result === false) {
+ throw MssqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Initializes a stored procedure or a remote stored procedure.
+ *
+ * @param string $sp_name Stored procedure name, like ownew.sp_name or
+ * otherdb.owner.sp_name.
+ * @param resource $link_identifier A MS SQL link identifier, returned by
+ * mssql_connect.
+ * @return resource Returns a resource identifier "statement", used in subsequent calls to
+ * mssql_bind and mssql_executes.
+ * @throws MssqlException
+ *
+ */
+function mssql_init(string $sp_name, $link_identifier = null)
+{
+ error_clear_last();
+ if ($link_identifier !== null) {
+ $result = \mssql_init($sp_name, $link_identifier);
+ } else {
+ $result = \mssql_init($sp_name);
+ }
+ if ($result === false) {
+ throw MssqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * mssql_pconnect acts very much like
+ * mssql_connect with two major differences.
+ *
+ * First, when connecting, the function would first try to find a
+ * (persistent) link that's already open with the same host,
+ * username and password. If one is found, an identifier for it
+ * will be returned instead of opening a new connection.
+ *
+ * Second, the connection to the SQL server will not be closed when
+ * the execution of the script ends. Instead, the link will remain
+ * open for future use (mssql_close will not
+ * close links established by mssql_pconnect).
+ *
+ * This type of links is therefore called 'persistent'.
+ *
+ * @param string $servername The MS SQL server. It can also include a port number. e.g.
+ * hostname:port.
+ * @param string $username The username.
+ * @param string $password The password.
+ * @param bool $new_link If a second call is made to mssql_pconnect with
+ * the same arguments, no new link will be established, but instead, the
+ * link identifier of the already opened link will be returned. This
+ * parameter modifies this behavior and makes
+ * mssql_pconnect always open a new link, even if
+ * mssql_pconnect was called before with the same
+ * parameters.
+ * @return resource Returns a positive MS SQL persistent link identifier on success.
+ * @throws MssqlException
+ *
+ */
+function mssql_pconnect(string $servername = null, string $username = null, string $password = null, bool $new_link = false)
+{
+ error_clear_last();
+ if ($new_link !== false) {
+ $result = \mssql_pconnect($servername, $username, $password, $new_link);
+ } elseif ($password !== null) {
+ $result = \mssql_pconnect($servername, $username, $password);
+ } elseif ($username !== null) {
+ $result = \mssql_pconnect($servername, $username);
+ } elseif ($servername !== null) {
+ $result = \mssql_pconnect($servername);
+ } else {
+ $result = \mssql_pconnect();
+ }
+ if ($result === false) {
+ throw MssqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * mssql_query sends a query to the currently active
+ * database on the server that's associated with the specified link
+ * identifier.
+ *
+ * @param string $query An SQL query.
+ * @param resource $link_identifier A MS SQL link identifier, returned by
+ * mssql_connect or
+ * mssql_pconnect.
+ *
+ * If the link identifier isn't specified, the last opened link is
+ * assumed. If no link is open, the function tries to establish a link
+ * as if mssql_connect was called, and use it.
+ * @param int $batch_size The number of records to batch in the buffer.
+ * @return mixed Returns a MS SQL result resource on success, TRUE if no rows were
+ * returned.
+ * @throws MssqlException
+ *
+ */
+function mssql_query(string $query, $link_identifier = null, int $batch_size = 0)
+{
+ error_clear_last();
+ if ($batch_size !== 0) {
+ $result = \mssql_query($query, $link_identifier, $batch_size);
+ } elseif ($link_identifier !== null) {
+ $result = \mssql_query($query, $link_identifier);
+ } else {
+ $result = \mssql_query($query);
+ }
+ if ($result === false) {
+ throw MssqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * mssql_select_db sets the current active
+ * database on the server that's associated with the specified link
+ * identifier.
+ *
+ * Every subsequent call to mssql_query will be
+ * made on the active database.
+ *
+ * @param string $database_name The database name.
+ *
+ * To escape the name of a database that contains spaces, hyphens ("-"),
+ * or any other exceptional characters, the database name must be
+ * enclosed in brackets, as is shown in the example, below. This
+ * technique must also be applied when selecting a database name that is
+ * also a reserved word (such as primary).
+ * @param resource $link_identifier A MS SQL link identifier, returned by
+ * mssql_connect or
+ * mssql_pconnect.
+ *
+ * If no link identifier is specified, the last opened link is assumed.
+ * If no link is open, the function will try to establish a link as if
+ * mssql_connect was called, and use it.
+ * @throws MssqlException
+ *
+ */
+function mssql_select_db(string $database_name, $link_identifier = null): void
+{
+ error_clear_last();
+ if ($link_identifier !== null) {
+ $result = \mssql_select_db($database_name, $link_identifier);
+ } else {
+ $result = \mssql_select_db($database_name);
+ }
+ if ($result === false) {
+ throw MssqlException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/deprecated/stats.php b/vendor/thecodingmachine/safe/deprecated/stats.php
new file mode 100644
index 000000000..aca984859
--- /dev/null
+++ b/vendor/thecodingmachine/safe/deprecated/stats.php
@@ -0,0 +1,108 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\StatsException;
+
+/**
+ * Returns the covariance of a and b.
+ *
+ * @param array $a The first array
+ * @param array $b The second array
+ * @return float Returns the covariance of a and b.
+ * @throws StatsException
+ *
+ */
+function stats_covariance(array $a, array $b): float
+{
+ error_clear_last();
+ $result = \stats_covariance($a, $b);
+ if ($result === false) {
+ throw StatsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Returns the standard deviation of the values in a.
+ *
+ * @param array $a The array of data to find the standard deviation for. Note that all
+ * values of the array will be cast to float.
+ * @param bool $sample Indicates if a represents a sample of the
+ * population; defaults to FALSE.
+ * @return float Returns the standard deviation on success; FALSE on failure.
+ * @throws StatsException
+ *
+ */
+function stats_standard_deviation(array $a, bool $sample = false): float
+{
+ error_clear_last();
+ $result = \stats_standard_deviation($a, $sample);
+ if ($result === false) {
+ throw StatsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Returns the Pearson correlation coefficient between arr1 and arr2.
+ *
+ * @param array $arr1 The first array
+ * @param array $arr2 The second array
+ * @return float Returns the Pearson correlation coefficient between arr1 and arr2.
+ * @throws StatsException
+ *
+ */
+function stats_stat_correlation(array $arr1, array $arr2): float
+{
+ error_clear_last();
+ $result = \stats_stat_correlation($arr1, $arr2);
+ if ($result === false) {
+ throw StatsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Returns the inner product of arr1 and arr2.
+ *
+ * @param array $arr1 The first array
+ * @param array $arr2 The second array
+ * @return float Returns the inner product of arr1 and arr2.
+ * @throws StatsException
+ *
+ */
+function stats_stat_innerproduct(array $arr1, array $arr2): float
+{
+ error_clear_last();
+ $result = \stats_stat_innerproduct($arr1, $arr2);
+ if ($result === false) {
+ throw StatsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Returns the variance of the values in a.
+ *
+ * @param array $a The array of data to find the standard deviation for. Note that all
+ * values of the array will be cast to float.
+ * @param bool $sample Indicates if a represents a sample of the
+ * population; defaults to FALSE.
+ * @return float Returns the variance on success; FALSE on failure.
+ * @throws StatsException
+ *
+ */
+function stats_variance(array $a, bool $sample = false): float
+{
+ error_clear_last();
+ $result = \stats_variance($a, $sample);
+ if ($result === false) {
+ throw StatsException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/.gitkeep b/vendor/thecodingmachine/safe/generated/Exceptions/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/.gitkeep
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/ApacheException.php b/vendor/thecodingmachine/safe/generated/Exceptions/ApacheException.php
new file mode 100644
index 000000000..5d69236fa
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/ApacheException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class ApacheException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/ApcuException.php b/vendor/thecodingmachine/safe/generated/Exceptions/ApcuException.php
new file mode 100644
index 000000000..a9fc893e5
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/ApcuException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class ApcuException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/ArrayException.php b/vendor/thecodingmachine/safe/generated/Exceptions/ArrayException.php
new file mode 100644
index 000000000..154800c32
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/ArrayException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class ArrayException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/Bzip2Exception.php b/vendor/thecodingmachine/safe/generated/Exceptions/Bzip2Exception.php
new file mode 100644
index 000000000..dd4ab83f3
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/Bzip2Exception.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class Bzip2Exception extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/CalendarException.php b/vendor/thecodingmachine/safe/generated/Exceptions/CalendarException.php
new file mode 100644
index 000000000..66ba58842
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/CalendarException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class CalendarException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/ClassobjException.php b/vendor/thecodingmachine/safe/generated/Exceptions/ClassobjException.php
new file mode 100644
index 000000000..1c377b516
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/ClassobjException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class ClassobjException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/ComException.php b/vendor/thecodingmachine/safe/generated/Exceptions/ComException.php
new file mode 100644
index 000000000..154213436
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/ComException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class ComException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/CubridException.php b/vendor/thecodingmachine/safe/generated/Exceptions/CubridException.php
new file mode 100644
index 000000000..853c8d258
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/CubridException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class CubridException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/DatetimeException.php b/vendor/thecodingmachine/safe/generated/Exceptions/DatetimeException.php
new file mode 100644
index 000000000..63d5f9388
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/DatetimeException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class DatetimeException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/DirException.php b/vendor/thecodingmachine/safe/generated/Exceptions/DirException.php
new file mode 100644
index 000000000..100308e60
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/DirException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class DirException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/EioException.php b/vendor/thecodingmachine/safe/generated/Exceptions/EioException.php
new file mode 100644
index 000000000..f4e121ab7
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/EioException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class EioException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/ErrorfuncException.php b/vendor/thecodingmachine/safe/generated/Exceptions/ErrorfuncException.php
new file mode 100644
index 000000000..bf412400d
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/ErrorfuncException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class ErrorfuncException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/ExecException.php b/vendor/thecodingmachine/safe/generated/Exceptions/ExecException.php
new file mode 100644
index 000000000..f7c503c8c
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/ExecException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class ExecException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/FileinfoException.php b/vendor/thecodingmachine/safe/generated/Exceptions/FileinfoException.php
new file mode 100644
index 000000000..b9e3abbee
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/FileinfoException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class FileinfoException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/FilesystemException.php b/vendor/thecodingmachine/safe/generated/Exceptions/FilesystemException.php
new file mode 100644
index 000000000..3c1c70e30
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/FilesystemException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class FilesystemException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/FilterException.php b/vendor/thecodingmachine/safe/generated/Exceptions/FilterException.php
new file mode 100644
index 000000000..a2c1b5c88
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/FilterException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class FilterException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/FpmException.php b/vendor/thecodingmachine/safe/generated/Exceptions/FpmException.php
new file mode 100644
index 000000000..0017b4c2c
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/FpmException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class FpmException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/FtpException.php b/vendor/thecodingmachine/safe/generated/Exceptions/FtpException.php
new file mode 100644
index 000000000..0e2b7dded
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/FtpException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class FtpException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/FunchandException.php b/vendor/thecodingmachine/safe/generated/Exceptions/FunchandException.php
new file mode 100644
index 000000000..1ee4a2113
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/FunchandException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class FunchandException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/GmpException.php b/vendor/thecodingmachine/safe/generated/Exceptions/GmpException.php
new file mode 100644
index 000000000..a13c11a6e
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/GmpException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class GmpException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/GnupgException.php b/vendor/thecodingmachine/safe/generated/Exceptions/GnupgException.php
new file mode 100644
index 000000000..cf3a1e74a
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/GnupgException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class GnupgException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/HashException.php b/vendor/thecodingmachine/safe/generated/Exceptions/HashException.php
new file mode 100644
index 000000000..1dc09763d
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/HashException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class HashException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/IbaseException.php b/vendor/thecodingmachine/safe/generated/Exceptions/IbaseException.php
new file mode 100644
index 000000000..0346ec3c2
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/IbaseException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class IbaseException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/IbmDb2Exception.php b/vendor/thecodingmachine/safe/generated/Exceptions/IbmDb2Exception.php
new file mode 100644
index 000000000..4843f8521
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/IbmDb2Exception.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class IbmDb2Exception extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/IconvException.php b/vendor/thecodingmachine/safe/generated/Exceptions/IconvException.php
new file mode 100644
index 000000000..0dd163709
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/IconvException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class IconvException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/ImageException.php b/vendor/thecodingmachine/safe/generated/Exceptions/ImageException.php
new file mode 100644
index 000000000..c49880346
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/ImageException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class ImageException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/ImapException.php b/vendor/thecodingmachine/safe/generated/Exceptions/ImapException.php
new file mode 100644
index 000000000..6b6bbc7fe
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/ImapException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class ImapException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/InfoException.php b/vendor/thecodingmachine/safe/generated/Exceptions/InfoException.php
new file mode 100644
index 000000000..5221e1fd8
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/InfoException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class InfoException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/IngresiiException.php b/vendor/thecodingmachine/safe/generated/Exceptions/IngresiiException.php
new file mode 100644
index 000000000..ca40822e9
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/IngresiiException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class IngresiiException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/InotifyException.php b/vendor/thecodingmachine/safe/generated/Exceptions/InotifyException.php
new file mode 100644
index 000000000..64048dca9
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/InotifyException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class InotifyException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/LdapException.php b/vendor/thecodingmachine/safe/generated/Exceptions/LdapException.php
new file mode 100644
index 000000000..5c142cb08
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/LdapException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class LdapException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/LibxmlException.php b/vendor/thecodingmachine/safe/generated/Exceptions/LibxmlException.php
new file mode 100644
index 000000000..b2772da0a
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/LibxmlException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class LibxmlException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/LzfException.php b/vendor/thecodingmachine/safe/generated/Exceptions/LzfException.php
new file mode 100644
index 000000000..82352faa7
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/LzfException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class LzfException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/MailparseException.php b/vendor/thecodingmachine/safe/generated/Exceptions/MailparseException.php
new file mode 100644
index 000000000..1f3d73708
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/MailparseException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class MailparseException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/MbstringException.php b/vendor/thecodingmachine/safe/generated/Exceptions/MbstringException.php
new file mode 100644
index 000000000..2f7913a3e
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/MbstringException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class MbstringException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/MiscException.php b/vendor/thecodingmachine/safe/generated/Exceptions/MiscException.php
new file mode 100644
index 000000000..2fd1475dc
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/MiscException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class MiscException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/MsqlException.php b/vendor/thecodingmachine/safe/generated/Exceptions/MsqlException.php
new file mode 100644
index 000000000..c67314ea8
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/MsqlException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class MsqlException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/MysqlException.php b/vendor/thecodingmachine/safe/generated/Exceptions/MysqlException.php
new file mode 100644
index 000000000..bd6904383
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/MysqlException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class MysqlException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/MysqliException.php b/vendor/thecodingmachine/safe/generated/Exceptions/MysqliException.php
new file mode 100644
index 000000000..4cadf6ca1
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/MysqliException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class MysqliException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/MysqlndMsException.php b/vendor/thecodingmachine/safe/generated/Exceptions/MysqlndMsException.php
new file mode 100644
index 000000000..5e9b55944
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/MysqlndMsException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class MysqlndMsException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/MysqlndQcException.php b/vendor/thecodingmachine/safe/generated/Exceptions/MysqlndQcException.php
new file mode 100644
index 000000000..4db9f4911
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/MysqlndQcException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class MysqlndQcException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/NetworkException.php b/vendor/thecodingmachine/safe/generated/Exceptions/NetworkException.php
new file mode 100644
index 000000000..e740ca19c
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/NetworkException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class NetworkException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/Oci8Exception.php b/vendor/thecodingmachine/safe/generated/Exceptions/Oci8Exception.php
new file mode 100644
index 000000000..b1d93b21a
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/Oci8Exception.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class Oci8Exception extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/OpcacheException.php b/vendor/thecodingmachine/safe/generated/Exceptions/OpcacheException.php
new file mode 100644
index 000000000..03309e77d
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/OpcacheException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class OpcacheException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/OutcontrolException.php b/vendor/thecodingmachine/safe/generated/Exceptions/OutcontrolException.php
new file mode 100644
index 000000000..ffc91f7bc
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/OutcontrolException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class OutcontrolException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/PasswordException.php b/vendor/thecodingmachine/safe/generated/Exceptions/PasswordException.php
new file mode 100644
index 000000000..f0edba123
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/PasswordException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class PasswordException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/PcntlException.php b/vendor/thecodingmachine/safe/generated/Exceptions/PcntlException.php
new file mode 100644
index 000000000..00d51f131
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/PcntlException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class PcntlException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/PdfException.php b/vendor/thecodingmachine/safe/generated/Exceptions/PdfException.php
new file mode 100644
index 000000000..bcf36b3ce
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/PdfException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class PdfException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/PgsqlException.php b/vendor/thecodingmachine/safe/generated/Exceptions/PgsqlException.php
new file mode 100644
index 000000000..5d264c2f0
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/PgsqlException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class PgsqlException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/PosixException.php b/vendor/thecodingmachine/safe/generated/Exceptions/PosixException.php
new file mode 100644
index 000000000..3eec244c6
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/PosixException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class PosixException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/PsException.php b/vendor/thecodingmachine/safe/generated/Exceptions/PsException.php
new file mode 100644
index 000000000..7571ebf57
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/PsException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class PsException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/PspellException.php b/vendor/thecodingmachine/safe/generated/Exceptions/PspellException.php
new file mode 100644
index 000000000..7645cc910
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/PspellException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class PspellException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/ReadlineException.php b/vendor/thecodingmachine/safe/generated/Exceptions/ReadlineException.php
new file mode 100644
index 000000000..b6bb37082
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/ReadlineException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class ReadlineException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/RpminfoException.php b/vendor/thecodingmachine/safe/generated/Exceptions/RpminfoException.php
new file mode 100644
index 000000000..7596451d3
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/RpminfoException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class RpminfoException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/RrdException.php b/vendor/thecodingmachine/safe/generated/Exceptions/RrdException.php
new file mode 100644
index 000000000..45793e804
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/RrdException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class RrdException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/SemException.php b/vendor/thecodingmachine/safe/generated/Exceptions/SemException.php
new file mode 100644
index 000000000..dd97ea5fa
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/SemException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class SemException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/SessionException.php b/vendor/thecodingmachine/safe/generated/Exceptions/SessionException.php
new file mode 100644
index 000000000..9c1be7975
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/SessionException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class SessionException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/ShmopException.php b/vendor/thecodingmachine/safe/generated/Exceptions/ShmopException.php
new file mode 100644
index 000000000..0673848a7
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/ShmopException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class ShmopException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/SimplexmlException.php b/vendor/thecodingmachine/safe/generated/Exceptions/SimplexmlException.php
new file mode 100644
index 000000000..67804e133
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/SimplexmlException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class SimplexmlException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/SocketsException.php b/vendor/thecodingmachine/safe/generated/Exceptions/SocketsException.php
new file mode 100644
index 000000000..172f5d78f
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/SocketsException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class SocketsException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/SodiumException.php b/vendor/thecodingmachine/safe/generated/Exceptions/SodiumException.php
new file mode 100644
index 000000000..f33ec049e
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/SodiumException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class SodiumException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/SolrException.php b/vendor/thecodingmachine/safe/generated/Exceptions/SolrException.php
new file mode 100644
index 000000000..2431870f7
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/SolrException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class SolrException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/SplException.php b/vendor/thecodingmachine/safe/generated/Exceptions/SplException.php
new file mode 100644
index 000000000..cae8dbc25
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/SplException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class SplException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/SqlsrvException.php b/vendor/thecodingmachine/safe/generated/Exceptions/SqlsrvException.php
new file mode 100644
index 000000000..6015cd263
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/SqlsrvException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class SqlsrvException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/SsdeepException.php b/vendor/thecodingmachine/safe/generated/Exceptions/SsdeepException.php
new file mode 100644
index 000000000..209017945
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/SsdeepException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class SsdeepException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/Ssh2Exception.php b/vendor/thecodingmachine/safe/generated/Exceptions/Ssh2Exception.php
new file mode 100644
index 000000000..72ca90fd7
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/Ssh2Exception.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class Ssh2Exception extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/StreamException.php b/vendor/thecodingmachine/safe/generated/Exceptions/StreamException.php
new file mode 100644
index 000000000..24624749f
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/StreamException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class StreamException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/StringsException.php b/vendor/thecodingmachine/safe/generated/Exceptions/StringsException.php
new file mode 100644
index 000000000..9e7b356da
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/StringsException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class StringsException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/SwooleException.php b/vendor/thecodingmachine/safe/generated/Exceptions/SwooleException.php
new file mode 100644
index 000000000..088c0de87
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/SwooleException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class SwooleException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/UodbcException.php b/vendor/thecodingmachine/safe/generated/Exceptions/UodbcException.php
new file mode 100644
index 000000000..92f94a52f
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/UodbcException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class UodbcException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/UopzException.php b/vendor/thecodingmachine/safe/generated/Exceptions/UopzException.php
new file mode 100644
index 000000000..16e1ab5d7
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/UopzException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class UopzException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/UrlException.php b/vendor/thecodingmachine/safe/generated/Exceptions/UrlException.php
new file mode 100644
index 000000000..770125017
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/UrlException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class UrlException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/VarException.php b/vendor/thecodingmachine/safe/generated/Exceptions/VarException.php
new file mode 100644
index 000000000..b2427c9fc
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/VarException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class VarException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/XdiffException.php b/vendor/thecodingmachine/safe/generated/Exceptions/XdiffException.php
new file mode 100644
index 000000000..c6adcd574
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/XdiffException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class XdiffException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/XmlException.php b/vendor/thecodingmachine/safe/generated/Exceptions/XmlException.php
new file mode 100644
index 000000000..ebca08f36
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/XmlException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class XmlException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/XmlrpcException.php b/vendor/thecodingmachine/safe/generated/Exceptions/XmlrpcException.php
new file mode 100644
index 000000000..70e12d67a
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/XmlrpcException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class XmlrpcException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/YamlException.php b/vendor/thecodingmachine/safe/generated/Exceptions/YamlException.php
new file mode 100644
index 000000000..f1c2e60a3
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/YamlException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class YamlException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/YazException.php b/vendor/thecodingmachine/safe/generated/Exceptions/YazException.php
new file mode 100644
index 000000000..22a174f5c
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/YazException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class YazException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/ZipException.php b/vendor/thecodingmachine/safe/generated/Exceptions/ZipException.php
new file mode 100644
index 000000000..fb6ba54f5
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/ZipException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class ZipException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/Exceptions/ZlibException.php b/vendor/thecodingmachine/safe/generated/Exceptions/ZlibException.php
new file mode 100644
index 000000000..35f81b019
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/Exceptions/ZlibException.php
@@ -0,0 +1,11 @@
+<?php
+namespace Safe\Exceptions;
+
+class ZlibException extends \ErrorException implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $error = error_get_last();
+ return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/apache.php b/vendor/thecodingmachine/safe/generated/apache.php
new file mode 100644
index 000000000..e71c32d7b
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/apache.php
@@ -0,0 +1,177 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\ApacheException;
+
+/**
+ * Fetch the Apache version.
+ *
+ * @return string Returns the Apache version on success.
+ * @throws ApacheException
+ *
+ */
+function apache_get_version(): string
+{
+ error_clear_last();
+ $result = \apache_get_version();
+ if ($result === false) {
+ throw ApacheException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Retrieve an Apache environment variable specified by
+ * variable.
+ *
+ * This function requires Apache 2 otherwise it's undefined.
+ *
+ * @param string $variable The Apache environment variable
+ * @param bool $walk_to_top Whether to get the top-level variable available to all Apache layers.
+ * @return string The value of the Apache environment variable on success
+ * @throws ApacheException
+ *
+ */
+function apache_getenv(string $variable, bool $walk_to_top = false): string
+{
+ error_clear_last();
+ $result = \apache_getenv($variable, $walk_to_top);
+ if ($result === false) {
+ throw ApacheException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Fetches all HTTP request headers from the current request. Works in the
+ * Apache, FastCGI, CLI, FPM and NSAPI server module
+ * in Netscape/iPlanet/SunONE webservers.
+ *
+ * @return array An associative array of all the HTTP headers in the current request.
+ * @throws ApacheException
+ *
+ */
+function apache_request_headers(): array
+{
+ error_clear_last();
+ $result = \apache_request_headers();
+ if ($result === false) {
+ throw ApacheException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * apache_reset_timeout resets the Apache write timer,
+ * which defaults to 300 seconds. With set_time_limit(0);
+ * ignore_user_abort(true) and periodic
+ * apache_reset_timeout calls, Apache can theoretically
+ * run forever.
+ *
+ * This function requires Apache 1.
+ *
+ * @throws ApacheException
+ *
+ */
+function apache_reset_timeout(): void
+{
+ error_clear_last();
+ $result = \apache_reset_timeout();
+ if ($result === false) {
+ throw ApacheException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Fetch all HTTP response headers. Works in the
+ * Apache, FastCGI, CLI, FPM and NSAPI server module
+ * in Netscape/iPlanet/SunONE webservers.
+ *
+ * @return array An array of all Apache response headers on success.
+ * @throws ApacheException
+ *
+ */
+function apache_response_headers(): array
+{
+ error_clear_last();
+ $result = \apache_response_headers();
+ if ($result === false) {
+ throw ApacheException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * apache_setenv sets the value of the Apache
+ * environment variable specified by
+ * variable.
+ *
+ * @param string $variable The environment variable that's being set.
+ * @param string $value The new variable value.
+ * @param bool $walk_to_top Whether to set the top-level variable available to all Apache layers.
+ * @throws ApacheException
+ *
+ */
+function apache_setenv(string $variable, string $value, bool $walk_to_top = false): void
+{
+ error_clear_last();
+ $result = \apache_setenv($variable, $value, $walk_to_top);
+ if ($result === false) {
+ throw ApacheException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Fetches all HTTP headers from the current request.
+ *
+ * This function is an alias for apache_request_headers.
+ * Please read the apache_request_headers
+ * documentation for more information on how this function works.
+ *
+ * @return array An associative array of all the HTTP headers in the current request.
+ * @throws ApacheException
+ *
+ */
+function getallheaders(): array
+{
+ error_clear_last();
+ $result = \getallheaders();
+ if ($result === false) {
+ throw ApacheException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * virtual is an Apache-specific function which
+ * is similar to &lt;!--#include virtual...--&gt; in
+ * mod_include.
+ * It performs an Apache sub-request. It is useful for including
+ * CGI scripts or .shtml files, or anything else that you would
+ * parse through Apache. Note that for a CGI script, the script
+ * must generate valid CGI headers. At the minimum that means it
+ * must generate a Content-Type header.
+ *
+ * To run the sub-request, all buffers are terminated and flushed to the
+ * browser, pending headers are sent too.
+ *
+ * @param string $filename The file that the virtual command will be performed on.
+ * @throws ApacheException
+ *
+ */
+function virtual(string $filename): void
+{
+ error_clear_last();
+ $result = \virtual($filename);
+ if ($result === false) {
+ throw ApacheException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/apcu.php b/vendor/thecodingmachine/safe/generated/apcu.php
new file mode 100644
index 000000000..733b24360
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/apcu.php
@@ -0,0 +1,112 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\ApcuException;
+
+/**
+ * Retrieves cached information and meta-data from APC's data store.
+ *
+ * @param bool $limited If limited is TRUE, the
+ * return value will exclude the individual list of cache entries. This
+ * is useful when trying to optimize calls for statistics gathering.
+ * @return array Array of cached data (and meta-data)
+ * @throws ApcuException
+ *
+ */
+function apcu_cache_info(bool $limited = false): array
+{
+ error_clear_last();
+ $result = \apcu_cache_info($limited);
+ if ($result === false) {
+ throw ApcuException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * apcu_cas updates an already existing integer value if the
+ * old parameter matches the currently stored value
+ * with the value of the new parameter.
+ *
+ * @param string $key The key of the value being updated.
+ * @param int $old The old value (the value currently stored).
+ * @param int $new The new value to update to.
+ * @throws ApcuException
+ *
+ */
+function apcu_cas(string $key, int $old, int $new): void
+{
+ error_clear_last();
+ $result = \apcu_cas($key, $old, $new);
+ if ($result === false) {
+ throw ApcuException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Decreases a stored integer value.
+ *
+ * @param string $key The key of the value being decreased.
+ * @param int $step The step, or value to decrease.
+ * @param bool|null $success Optionally pass the success or fail boolean value to
+ * this referenced variable.
+ * @param int $ttl TTL to use if the operation inserts a new value (rather than decrementing an existing one).
+ * @return int Returns the current value of key's value on success
+ * @throws ApcuException
+ *
+ */
+function apcu_dec(string $key, int $step = 1, ?bool &$success = null, int $ttl = 0): int
+{
+ error_clear_last();
+ $result = \apcu_dec($key, $step, $success, $ttl);
+ if ($result === false) {
+ throw ApcuException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Increases a stored number.
+ *
+ * @param string $key The key of the value being increased.
+ * @param int $step The step, or value to increase.
+ * @param bool|null $success Optionally pass the success or fail boolean value to
+ * this referenced variable.
+ * @param int $ttl TTL to use if the operation inserts a new value (rather than incrementing an existing one).
+ * @return int Returns the current value of key's value on success
+ * @throws ApcuException
+ *
+ */
+function apcu_inc(string $key, int $step = 1, ?bool &$success = null, int $ttl = 0): int
+{
+ error_clear_last();
+ $result = \apcu_inc($key, $step, $success, $ttl);
+ if ($result === false) {
+ throw ApcuException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Retrieves APCu Shared Memory Allocation information.
+ *
+ * @param bool $limited When set to FALSE (default) apcu_sma_info will
+ * return a detailed information about each segment.
+ * @return array Array of Shared Memory Allocation data; FALSE on failure.
+ * @throws ApcuException
+ *
+ */
+function apcu_sma_info(bool $limited = false): array
+{
+ error_clear_last();
+ $result = \apcu_sma_info($limited);
+ if ($result === false) {
+ throw ApcuException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/array.php b/vendor/thecodingmachine/safe/generated/array.php
new file mode 100644
index 000000000..80c90ff81
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/array.php
@@ -0,0 +1,464 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\ArrayException;
+
+/**
+ * Creates an array by using the values from the
+ * keys array as keys and the values from the
+ * values array as the corresponding values.
+ *
+ * @param array $keys Array of keys to be used. Illegal values for key will be
+ * converted to string.
+ * @param array $values Array of values to be used
+ * @return array Returns the combined array, FALSE if the number of elements
+ * for each array isn't equal.
+ * @throws ArrayException
+ *
+ */
+function array_combine(array $keys, array $values): array
+{
+ error_clear_last();
+ $result = \array_combine($keys, $values);
+ if ($result === false) {
+ throw ArrayException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * array_flip returns an array in flip
+ * order, i.e. keys from array become values and values
+ * from array become keys.
+ *
+ * Note that the values of array need to be valid
+ * keys, i.e. they need to be either integer or
+ * string. A warning will be emitted if a value has the wrong
+ * type, and the key/value pair in question will not be included
+ * in the result.
+ *
+ * If a value has several occurrences, the latest key will be
+ * used as its value, and all others will be lost.
+ *
+ * @param array $array An array of key/value pairs to be flipped.
+ * @return array Returns the flipped array on success.
+ * @throws ArrayException
+ *
+ */
+function array_flip(array $array): array
+{
+ error_clear_last();
+ $result = \array_flip($array);
+ if ($result === null) {
+ throw ArrayException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * array_replace_recursive replaces the values of
+ * array1 with the same values from all the following
+ * arrays. If a key from the first array exists in the second array, its value
+ * will be replaced by the value from the second array. If the key exists in the
+ * second array, and not the first, it will be created in the first array.
+ * If a key only exists in the first array, it will be left as is.
+ * If several arrays are passed for replacement, they will be processed
+ * in order, the later array overwriting the previous values.
+ *
+ * array_replace_recursive is recursive : it will recurse into
+ * arrays and apply the same process to the inner value.
+ *
+ * When the value in the first array is scalar, it will be replaced
+ * by the value in the second array, may it be scalar or array.
+ * When the value in the first array and the second array
+ * are both arrays, array_replace_recursive will replace
+ * their respective value recursively.
+ *
+ * @param array $array1 The array in which elements are replaced.
+ * @param array $params Optional. Arrays from which elements will be extracted.
+ * @return array Returns an array.
+ * @throws ArrayException
+ *
+ */
+function array_replace_recursive(array $array1, array ...$params): array
+{
+ error_clear_last();
+ if ($params !== []) {
+ $result = \array_replace_recursive($array1, ...$params);
+ } else {
+ $result = \array_replace_recursive($array1);
+ }
+ if ($result === null) {
+ throw ArrayException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * array_replace replaces the values of
+ * array1 with values having the same keys in each of the following
+ * arrays. If a key from the first array exists in the second array, its value
+ * will be replaced by the value from the second array. If the key exists in the
+ * second array, and not the first, it will be created in the first array.
+ * If a key only exists in the first array, it will be left as is.
+ * If several arrays are passed for replacement, they will be processed
+ * in order, the later arrays overwriting the previous values.
+ *
+ * array_replace is not recursive : it will replace
+ * values in the first array by whatever type is in the second array.
+ *
+ * @param array $array1 The array in which elements are replaced.
+ * @param array $params Arrays from which elements will be extracted.
+ * Values from later arrays overwrite the previous values.
+ * @return array Returns an array.
+ * @throws ArrayException
+ *
+ */
+function array_replace(array $array1, array ...$params): array
+{
+ error_clear_last();
+ if ($params !== []) {
+ $result = \array_replace($array1, ...$params);
+ } else {
+ $result = \array_replace($array1);
+ }
+ if ($result === null) {
+ throw ArrayException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Applies the user-defined callback function to each
+ * element of the array. This function will recurse
+ * into deeper arrays.
+ *
+ * @param array $array The input array.
+ * @param callable $callback Typically, callback takes on two parameters.
+ * The array parameter's value being the first, and
+ * the key/index second.
+ *
+ * If callback needs to be working with the
+ * actual values of the array, specify the first parameter of
+ * callback as a
+ * reference. Then,
+ * any changes made to those elements will be made in the
+ * original array itself.
+ * @param mixed $userdata If the optional userdata parameter is supplied,
+ * it will be passed as the third parameter to the
+ * callback.
+ * @throws ArrayException
+ *
+ */
+function array_walk_recursive(array &$array, callable $callback, $userdata = null): void
+{
+ error_clear_last();
+ $result = \array_walk_recursive($array, $callback, $userdata);
+ if ($result === false) {
+ throw ArrayException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function sorts an array such that array indices maintain their
+ * correlation with the array elements they are associated with.
+ *
+ * This is used mainly when sorting associative arrays where the actual
+ * element order is significant.
+ *
+ * @param array $array The input array.
+ * @param int $sort_flags You may modify the behavior of the sort using the optional parameter
+ * sort_flags, for details see
+ * sort.
+ * @throws ArrayException
+ *
+ */
+function arsort(array &$array, int $sort_flags = SORT_REGULAR): void
+{
+ error_clear_last();
+ $result = \arsort($array, $sort_flags);
+ if ($result === false) {
+ throw ArrayException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function sorts an array such that array indices maintain
+ * their correlation with the array elements they are associated
+ * with. This is used mainly when sorting associative arrays where
+ * the actual element order is significant.
+ *
+ * @param array $array The input array.
+ * @param int $sort_flags You may modify the behavior of the sort using the optional
+ * parameter sort_flags, for details
+ * see sort.
+ * @throws ArrayException
+ *
+ */
+function asort(array &$array, int $sort_flags = SORT_REGULAR): void
+{
+ error_clear_last();
+ $result = \asort($array, $sort_flags);
+ if ($result === false) {
+ throw ArrayException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sorts an array by key in reverse order, maintaining key to data
+ * correlations. This is useful mainly for associative arrays.
+ *
+ * @param array $array The input array.
+ * @param int $sort_flags You may modify the behavior of the sort using the optional parameter
+ * sort_flags, for details see
+ * sort.
+ * @throws ArrayException
+ *
+ */
+function krsort(array &$array, int $sort_flags = SORT_REGULAR): void
+{
+ error_clear_last();
+ $result = \krsort($array, $sort_flags);
+ if ($result === false) {
+ throw ArrayException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sorts an array by key, maintaining key to data correlations. This is
+ * useful mainly for associative arrays.
+ *
+ * @param array $array The input array.
+ * @param int $sort_flags You may modify the behavior of the sort using the optional
+ * parameter sort_flags, for details
+ * see sort.
+ * @throws ArrayException
+ *
+ */
+function ksort(array &$array, int $sort_flags = SORT_REGULAR): void
+{
+ error_clear_last();
+ $result = \ksort($array, $sort_flags);
+ if ($result === false) {
+ throw ArrayException::createFromPhpError();
+ }
+}
+
+
+/**
+ * natcasesort is a case insensitive version of
+ * natsort.
+ *
+ * This function implements a sort algorithm that orders
+ * alphanumeric strings in the way a human being would while maintaining
+ * key/value associations. This is described as a "natural ordering".
+ *
+ * @param array $array The input array.
+ * @throws ArrayException
+ *
+ */
+function natcasesort(array &$array): void
+{
+ error_clear_last();
+ $result = \natcasesort($array);
+ if ($result === false) {
+ throw ArrayException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function implements a sort algorithm that orders alphanumeric strings
+ * in the way a human being would while maintaining key/value associations.
+ * This is described as a "natural ordering". An example of the difference
+ * between this algorithm and the regular computer string sorting algorithms
+ * (used in sort) can be seen in the example below.
+ *
+ * @param array $array The input array.
+ * @throws ArrayException
+ *
+ */
+function natsort(array &$array): void
+{
+ error_clear_last();
+ $result = \natsort($array);
+ if ($result === false) {
+ throw ArrayException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function sorts an array in reverse order (highest to lowest).
+ *
+ * @param array $array The input array.
+ * @param int $sort_flags You may modify the behavior of the sort using the optional
+ * parameter sort_flags, for details see
+ * sort.
+ * @throws ArrayException
+ *
+ */
+function rsort(array &$array, int $sort_flags = SORT_REGULAR): void
+{
+ error_clear_last();
+ $result = \rsort($array, $sort_flags);
+ if ($result === false) {
+ throw ArrayException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function shuffles (randomizes the order of the elements in) an array.
+ * It uses a pseudo random number generator that is not suitable for
+ * cryptographic purposes.
+ *
+ * @param array $array The array.
+ * @throws ArrayException
+ *
+ */
+function shuffle(array &$array): void
+{
+ error_clear_last();
+ $result = \shuffle($array);
+ if ($result === false) {
+ throw ArrayException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function sorts an array. Elements will be arranged from
+ * lowest to highest when this function has completed.
+ *
+ * @param array $array The input array.
+ * @param int $sort_flags The optional second parameter sort_flags
+ * may be used to modify the sorting behavior using these values:
+ *
+ * Sorting type flags:
+ *
+ *
+ * SORT_REGULAR - compare items normally;
+ * the details are described in the comparison operators section
+ *
+ *
+ * SORT_NUMERIC - compare items numerically
+ *
+ *
+ * SORT_STRING - compare items as strings
+ *
+ *
+ *
+ * SORT_LOCALE_STRING - compare items as
+ * strings, based on the current locale. It uses the locale,
+ * which can be changed using setlocale
+ *
+ *
+ *
+ *
+ * SORT_NATURAL - compare items as strings
+ * using "natural ordering" like natsort
+ *
+ *
+ *
+ *
+ * SORT_FLAG_CASE - can be combined
+ * (bitwise OR) with
+ * SORT_STRING or
+ * SORT_NATURAL to sort strings case-insensitively
+ *
+ *
+ *
+ * @throws ArrayException
+ *
+ */
+function sort(array &$array, int $sort_flags = SORT_REGULAR): void
+{
+ error_clear_last();
+ $result = \sort($array, $sort_flags);
+ if ($result === false) {
+ throw ArrayException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function sorts an array such that array indices maintain their
+ * correlation with the array elements they are associated with, using a
+ * user-defined comparison function.
+ *
+ * This is used mainly when sorting associative arrays where the actual
+ * element order is significant.
+ *
+ * @param array $array The input array.
+ * @param callable $value_compare_func See usort and uksort for
+ * examples of user-defined comparison functions.
+ * @throws ArrayException
+ *
+ */
+function uasort(array &$array, callable $value_compare_func): void
+{
+ error_clear_last();
+ $result = \uasort($array, $value_compare_func);
+ if ($result === false) {
+ throw ArrayException::createFromPhpError();
+ }
+}
+
+
+/**
+ * uksort will sort the keys of an array using a
+ * user-supplied comparison function. If the array you wish to sort
+ * needs to be sorted by some non-trivial criteria, you should use
+ * this function.
+ *
+ * @param array $array The input array.
+ * @param callable $key_compare_func The comparison function must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
+ * Note that before PHP 7.0.0 this integer had to be in the range from -2147483648 to 2147483647.
+ * @throws ArrayException
+ *
+ */
+function uksort(array &$array, callable $key_compare_func): void
+{
+ error_clear_last();
+ $result = \uksort($array, $key_compare_func);
+ if ($result === false) {
+ throw ArrayException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function will sort an array by its values using a user-supplied
+ * comparison function. If the array you wish to sort needs to be sorted by
+ * some non-trivial criteria, you should use this function.
+ *
+ * @param array $array The input array.
+ * @param callable $value_compare_func The comparison function must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
+ * Note that before PHP 7.0.0 this integer had to be in the range from -2147483648 to 2147483647.
+ *
+ * Returning non-integer values from the comparison
+ * function, such as float, will result in an internal cast to
+ * integer of the callback's return value. So values such as
+ * 0.99 and 0.1 will both be cast to an integer value of 0, which will
+ * compare such values as equal.
+ * @throws ArrayException
+ *
+ */
+function usort(array &$array, callable $value_compare_func): void
+{
+ error_clear_last();
+ $result = \usort($array, $value_compare_func);
+ if ($result === false) {
+ throw ArrayException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/bzip2.php b/vendor/thecodingmachine/safe/generated/bzip2.php
new file mode 100644
index 000000000..77302aa00
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/bzip2.php
@@ -0,0 +1,96 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\Bzip2Exception;
+
+/**
+ * Closes the given bzip2 file pointer.
+ *
+ * @param resource $bz The file pointer. It must be valid and must point to a file
+ * successfully opened by bzopen.
+ * @throws Bzip2Exception
+ *
+ */
+function bzclose($bz): void
+{
+ error_clear_last();
+ $result = \bzclose($bz);
+ if ($result === false) {
+ throw Bzip2Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Forces a write of all buffered bzip2 data for the file pointer
+ * bz.
+ *
+ * @param resource $bz The file pointer. It must be valid and must point to a file
+ * successfully opened by bzopen.
+ * @throws Bzip2Exception
+ *
+ */
+function bzflush($bz): void
+{
+ error_clear_last();
+ $result = \bzflush($bz);
+ if ($result === false) {
+ throw Bzip2Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * bzread reads from the given bzip2 file pointer.
+ *
+ * Reading stops when length (uncompressed) bytes have
+ * been read or EOF is reached, whichever comes first.
+ *
+ * @param resource $bz The file pointer. It must be valid and must point to a file
+ * successfully opened by bzopen.
+ * @param int $length If not specified, bzread will read 1024
+ * (uncompressed) bytes at a time. A maximum of 8192
+ * uncompressed bytes will be read at a time.
+ * @return string Returns the uncompressed data.
+ * @throws Bzip2Exception
+ *
+ */
+function bzread($bz, int $length = 1024): string
+{
+ error_clear_last();
+ $result = \bzread($bz, $length);
+ if ($result === false) {
+ throw Bzip2Exception::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * bzwrite writes a string into the given bzip2 file
+ * stream.
+ *
+ * @param resource $bz The file pointer. It must be valid and must point to a file
+ * successfully opened by bzopen.
+ * @param string $data The written data.
+ * @param int $length If supplied, writing will stop after length
+ * (uncompressed) bytes have been written or the end of
+ * data is reached, whichever comes first.
+ * @return int Returns the number of bytes written.
+ * @throws Bzip2Exception
+ *
+ */
+function bzwrite($bz, string $data, int $length = null): int
+{
+ error_clear_last();
+ if ($length !== null) {
+ $result = \bzwrite($bz, $data, $length);
+ } else {
+ $result = \bzwrite($bz, $data);
+ }
+ if ($result === false) {
+ throw Bzip2Exception::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/calendar.php b/vendor/thecodingmachine/safe/generated/calendar.php
new file mode 100644
index 000000000..aae699923
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/calendar.php
@@ -0,0 +1,27 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\CalendarException;
+
+/**
+ * This function will return a Unix timestamp corresponding to the
+ * Julian Day given in jday or FALSE if
+ * jday is outside of the allowed range. The time returned is
+ * UTC.
+ *
+ * @param int $jday A julian day number between 2440588 and 106751993607888
+ * on 64bit systems, or between 2440588 and 2465443 on 32bit systems.
+ * @return int The unix timestamp for the start (midnight, not noon) of the given Julian day.
+ * @throws CalendarException
+ *
+ */
+function jdtounix(int $jday): int
+{
+ error_clear_last();
+ $result = \jdtounix($jday);
+ if ($result === false) {
+ throw CalendarException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/classobj.php b/vendor/thecodingmachine/safe/generated/classobj.php
new file mode 100644
index 000000000..98147ac26
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/classobj.php
@@ -0,0 +1,25 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\ClassobjException;
+
+/**
+ * Creates an alias named alias
+ * based on the user defined class original.
+ * The aliased class is exactly the same as the original class.
+ *
+ * @param string $original The original class.
+ * @param string $alias The alias name for the class.
+ * @param bool $autoload Whether to autoload if the original class is not found.
+ * @throws ClassobjException
+ *
+ */
+function class_alias(string $original, string $alias, bool $autoload = true): void
+{
+ error_clear_last();
+ $result = \class_alias($original, $alias, $autoload);
+ if ($result === false) {
+ throw ClassobjException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/com.php b/vendor/thecodingmachine/safe/generated/com.php
new file mode 100644
index 000000000..53643f9d7
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/com.php
@@ -0,0 +1,127 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\ComException;
+
+/**
+ * Instructs COM to sink events generated by
+ * comobject into the PHP object
+ * sinkobject.
+ *
+ * Be careful how you use this feature; if you are doing something similar
+ * to the example below, then it doesn't really make sense to run it in a
+ * web server context.
+ *
+ * @param object $comobject
+ * @param object $sinkobject sinkobject should be an instance of a class with
+ * methods named after those of the desired dispinterface; you may use
+ * com_print_typeinfo to help generate a template class
+ * for this purpose.
+ * @param mixed $sinkinterface PHP will attempt to use the default dispinterface type specified by
+ * the typelibrary associated with comobject, but
+ * you may override this choice by setting
+ * sinkinterface to the name of the dispinterface
+ * that you want to use.
+ * @throws ComException
+ *
+ */
+function com_event_sink(object $comobject, object $sinkobject, $sinkinterface = null): void
+{
+ error_clear_last();
+ if ($sinkinterface !== null) {
+ $result = \com_event_sink($comobject, $sinkobject, $sinkinterface);
+ } else {
+ $result = \com_event_sink($comobject, $sinkobject);
+ }
+ if ($result === false) {
+ throw ComException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Loads a type-library and registers its constants in the engine, as though
+ * they were defined using define.
+ *
+ * Note that it is much more efficient to use the configuration setting to pre-load and
+ * register the constants, although not so flexible.
+ *
+ * If you have turned on , then
+ * PHP will attempt to automatically register the constants associated with a
+ * COM object when you instantiate it. This depends on the interfaces
+ * provided by the COM object itself, and may not always be possible.
+ *
+ * @param string $typelib_name typelib_name can be one of the following:
+ *
+ *
+ *
+ * The filename of a .tlb file or the executable module
+ * that contains the type library.
+ *
+ *
+ *
+ *
+ * The type library GUID, followed by its version number, for example
+ * {00000200-0000-0010-8000-00AA006D2EA4},2,0.
+ *
+ *
+ *
+ *
+ * The type library name, e.g. Microsoft OLE DB ActiveX Data
+ * Objects 1.0 Library.
+ *
+ *
+ *
+ * PHP will attempt to resolve the type library in this order, as the
+ * process gets more and more expensive as you progress down the list;
+ * searching for the type library by name is handled by physically
+ * enumerating the registry until we find a match.
+ *
+ * The filename of a .tlb file or the executable module
+ * that contains the type library.
+ *
+ * The type library GUID, followed by its version number, for example
+ * {00000200-0000-0010-8000-00AA006D2EA4},2,0.
+ *
+ * The type library name, e.g. Microsoft OLE DB ActiveX Data
+ * Objects 1.0 Library.
+ * @param bool $case_sensitive The case_sensitive behaves inversely to
+ * the parameter $case_insensitive in the define
+ * function.
+ * @throws ComException
+ *
+ */
+function com_load_typelib(string $typelib_name, bool $case_sensitive = true): void
+{
+ error_clear_last();
+ $result = \com_load_typelib($typelib_name, $case_sensitive);
+ if ($result === false) {
+ throw ComException::createFromPhpError();
+ }
+}
+
+
+/**
+ * The purpose of this function is to help generate a skeleton class for use
+ * as an event sink. You may also use it to generate a dump of any COM
+ * object, provided that it supports enough of the introspection interfaces,
+ * and that you know the name of the interface you want to display.
+ *
+ * @param object $comobject comobject should be either an instance of a COM
+ * object, or be the name of a typelibrary (which will be resolved according
+ * to the rules set out in com_load_typelib).
+ * @param string $dispinterface The name of an IDispatch descendant interface that you want to display.
+ * @param bool $wantsink If set to TRUE, the corresponding sink interface will be displayed
+ * instead.
+ * @throws ComException
+ *
+ */
+function com_print_typeinfo(object $comobject, string $dispinterface = null, bool $wantsink = false): void
+{
+ error_clear_last();
+ $result = \com_print_typeinfo($comobject, $dispinterface, $wantsink);
+ if ($result === false) {
+ throw ComException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/cubrid.php b/vendor/thecodingmachine/safe/generated/cubrid.php
new file mode 100644
index 000000000..f19f2d56e
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/cubrid.php
@@ -0,0 +1,395 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\CubridException;
+
+/**
+ * This function frees the memory occupied by the result data. It returns
+ * TRUE on success. Note that it can only frees the
+ * client fetch buffer now, and if you want free all memory, use function
+ * cubrid_close_request.
+ *
+ * @param resource $req_identifier This is the request identifier.
+ * @throws CubridException
+ *
+ */
+function cubrid_free_result($req_identifier): void
+{
+ error_clear_last();
+ $result = \cubrid_free_result($req_identifier);
+ if ($result === false) {
+ throw CubridException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function returns the current CUBRID connection charset and is similar
+ * to the CUBRID MySQL compatible function
+ * cubrid_client_encoding.
+ *
+ * @param resource $conn_identifier The CUBRID connection.
+ * @return string A string that represents the CUBRID connection charset; on success.
+ *
+ * FALSE on failure.
+ * @throws CubridException
+ *
+ */
+function cubrid_get_charset($conn_identifier): string
+{
+ error_clear_last();
+ $result = \cubrid_get_charset($conn_identifier);
+ if ($result === false) {
+ throw CubridException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * This function returns a string that represents the client library version.
+ *
+ * @return string A string that represents the client library version; on success.
+ *
+ * FALSE on failure.
+ * @throws CubridException
+ *
+ */
+function cubrid_get_client_info(): string
+{
+ error_clear_last();
+ $result = \cubrid_get_client_info();
+ if ($result === false) {
+ throw CubridException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * This function returns the CUBRID database parameters or it returns FALSE on
+ * failure. It returns an associative array with the values for the following
+ * parameters:
+ *
+ *
+ * PARAM_ISOLATION_LEVEL
+ * PARAM_LOCK_TIMEOUT
+ * PARAM_MAX_STRING_LENGTH
+ * PARAM_AUTO_COMMIT
+ *
+ *
+ *
+ * Database parameters
+ *
+ *
+ *
+ * Parameter
+ * Description
+ *
+ *
+ *
+ *
+ * PARAM_ISOLATION_LEVEL
+ * The transaction isolation level.
+ *
+ *
+ * LOCK_TIMEOUT
+ * CUBRID provides the lock timeout feature, which sets the waiting
+ * time (in seconds) for the lock until the transaction lock setting is
+ * allowed. The default value of the lock_timeout_in_secs parameter is
+ * -1, which means the application client will wait indefinitely until
+ * the transaction lock is allowed.
+ *
+ *
+ *
+ * PARAM_AUTO_COMMIT
+ * In CUBRID PHP, auto-commit mode is disabled by default for
+ * transaction management. It can be set by using
+ * cubrid_set_autocommit.
+ *
+ *
+ *
+ *
+ *
+ *
+ * The following table shows the isolation levels from 1 to 6. It consists of
+ * table schema (row) and isolation level:
+ *
+ * Levels of Isolation Supported by CUBRID
+ *
+ *
+ *
+ * Name
+ * Description
+ *
+ *
+ *
+ *
+ * SERIALIZABLE (6)
+ * In this isolation level, problems concerning concurrency (e.g.
+ * dirty read, non-repeatable read, phantom read, etc.) do not
+ * occur.
+ *
+ *
+ * REPEATABLE READ CLASS with REPEATABLE READ INSTANCES (5)
+ * Another transaction T2 cannot update the schema of table A while
+ * transaction T1 is viewing table A.
+ * Transaction T1 may experience phantom read for the record R that was
+ * inserted by another transaction T2 when it is repeatedly retrieving a
+ * specific record.
+ *
+ *
+ * REPEATABLE READ CLASS with READ COMMITTED INSTANCES (or CURSOR STABILITY) (4)
+ * Another transaction T2 cannot update the schema of table A while
+ * transaction T1 is viewing table A.
+ * Transaction T1 may experience R read (non-repeatable read) that was
+ * updated and committed by another transaction T2 when it is repeatedly
+ * retrieving the record R.
+ *
+ *
+ * REPEATABLE READ CLASS with READ UNCOMMITTED INSTANCES (3)
+ * Default isolation level. Another transaction T2 cannot update
+ * the schema of table A while transaction T1 is viewing table A.
+ * Transaction T1 may experience R' read (dirty read) for the record that
+ * was updated but not committed by another transaction T2.
+ *
+ *
+ * READ COMMITTED CLASS with READ COMMITTED INSTANCES (2)
+ * Transaction T1 may experience A' read (non-repeatable read) for
+ * the table that was updated and committed by another transaction T2
+ * while it is viewing table A repeatedly. Transaction T1 may experience
+ * R' read (non-repeatable read) for the record that was updated and
+ * committed by another transaction T2 while it is retrieving the record
+ * R repeatedly.
+ *
+ *
+ * READ COMMITTED CLASS with READ UNCOMMITTED INSTANCES (1)
+ * Transaction T1 may experience A' read (non-repeatable read) for
+ * the table that was updated and committed by another transaction T2
+ * while it is repeatedly viewing table A. Transaction T1 may experience
+ * R' read (dirty read) for the record that was updated but not committed
+ * by another transaction T2.
+ *
+ *
+ *
+ *
+ *
+ * @param resource $conn_identifier The CUBRID connection. If the connection identifier is not specified,
+ * the last link opened by cubrid_connect is assumed.
+ * @return array An associative array with CUBRID database parameters; on success.
+ *
+ * FALSE on failure.
+ * @throws CubridException
+ *
+ */
+function cubrid_get_db_parameter($conn_identifier): array
+{
+ error_clear_last();
+ $result = \cubrid_get_db_parameter($conn_identifier);
+ if ($result === false) {
+ throw CubridException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * This function returns a string that represents the CUBRID server version.
+ *
+ * @param resource $conn_identifier The CUBRID connection.
+ * @return string A string that represents the CUBRID server version; on success.
+ *
+ * FALSE on failure.
+ * @throws CubridException
+ *
+ */
+function cubrid_get_server_info($conn_identifier): string
+{
+ error_clear_last();
+ $result = \cubrid_get_server_info($conn_identifier);
+ if ($result === false) {
+ throw CubridException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * The cubrid_insert_id function retrieves the ID
+ * generated for the AUTO_INCREMENT column which is updated by the previous
+ * INSERT query. It returns 0 if the previous query does not generate new
+ * rows.
+ *
+ * @param resource $conn_identifier The connection identifier previously obtained by a call to
+ * cubrid_connect.
+ * @return string A string representing the ID generated for an AUTO_INCREMENT column by the
+ * previous query, on success.
+ *
+ * 0, if the previous query does not generate new rows.
+ *
+ * FALSE on failure.
+ * @throws CubridException
+ *
+ */
+function cubrid_insert_id($conn_identifier = null): string
+{
+ error_clear_last();
+ if ($conn_identifier !== null) {
+ $result = \cubrid_insert_id($conn_identifier);
+ } else {
+ $result = \cubrid_insert_id();
+ }
+ if ($result === false) {
+ throw CubridException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * The cubrid_lob2_new function is used to create a lob object (both BLOB and CLOB).
+ * This function should be used before you bind a lob object.
+ *
+ * @param resource $conn_identifier Connection identifier. If the connection identifier is not specified,
+ * the last connection opened by cubrid_connect or
+ * cubrid_connect_with_url is assumed.
+ * @param string $type It may be "BLOB" or "CLOB", it won't be case-sensitive. The default value is "BLOB".
+ * @return resource Lob identifier when it is successful.
+ *
+ * FALSE on failure.
+ * @throws CubridException
+ *
+ */
+function cubrid_lob2_new($conn_identifier = null, string $type = "BLOB")
+{
+ error_clear_last();
+ if ($type !== "BLOB") {
+ $result = \cubrid_lob2_new($conn_identifier, $type);
+ } elseif ($conn_identifier !== null) {
+ $result = \cubrid_lob2_new($conn_identifier);
+ } else {
+ $result = \cubrid_lob2_new();
+ }
+ if ($result === false) {
+ throw CubridException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * The cubrid_lob2_size function is used to get the size of a lob object.
+ *
+ * @param resource $lob_identifier Lob identifier as a result of cubrid_lob2_new or get from the result set.
+ * @return int It will return the size of the LOB object when it processes successfully.
+ *
+ * FALSE on failure.
+ * @throws CubridException
+ *
+ */
+function cubrid_lob2_size($lob_identifier): int
+{
+ error_clear_last();
+ $result = \cubrid_lob2_size($lob_identifier);
+ if ($result === false) {
+ throw CubridException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * The cubrid_lob2_size64 function is used to get the
+ * size of a lob object. If the size of a lob object is larger than an
+ * integer data can be stored, you can use this function and it will return
+ * the size as a string.
+ *
+ * @param resource $lob_identifier Lob identifier as a result of cubrid_lob2_new or get from the result set.
+ * @return string It will return the size of the LOB object as a string when it processes successfully.
+ *
+ * FALSE on failure.
+ * @throws CubridException
+ *
+ */
+function cubrid_lob2_size64($lob_identifier): string
+{
+ error_clear_last();
+ $result = \cubrid_lob2_size64($lob_identifier);
+ if ($result === false) {
+ throw CubridException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * The cubrid_lob2_tell function is used to tell the cursor position of the LOB object.
+ *
+ * @param resource $lob_identifier Lob identifier as a result of cubrid_lob2_new or get from the result set.
+ * @return int It will return the cursor position on the LOB object when it processes successfully.
+ *
+ * FALSE on failure.
+ * @throws CubridException
+ *
+ */
+function cubrid_lob2_tell($lob_identifier): int
+{
+ error_clear_last();
+ $result = \cubrid_lob2_tell($lob_identifier);
+ if ($result === false) {
+ throw CubridException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * The cubrid_lob2_tell64 function is used to tell the
+ * cursor position of the LOB object. If the size of a lob object is larger
+ * than an integer data can be stored, you can use this function and it will
+ * return the position information as a string.
+ *
+ * @param resource $lob_identifier Lob identifier as a result of cubrid_lob2_new or get from the result set.
+ * @return string It will return the cursor position on the LOB object as a string when it processes successfully.
+ *
+ * FALSE on failure.
+ * @throws CubridException
+ *
+ */
+function cubrid_lob2_tell64($lob_identifier): string
+{
+ error_clear_last();
+ $result = \cubrid_lob2_tell64($lob_identifier);
+ if ($result === false) {
+ throw CubridException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * The cubrid_set_db_parameter function is used to set
+ * the CUBRID database parameters. It can set the following CUBRID database
+ * parameters:
+ *
+ *
+ * PARAM_ISOLATION_LEVEL
+ * PARAM_LOCK_TIMEOUT
+ *
+ *
+ * @param resource $conn_identifier The CUBRID connection. If the connection identifier is not specified,
+ * the last link opened by cubrid_connect is assumed.
+ * @param int $param_type Database parameter type.
+ * @param int $param_value Isolation level value (1-6) or lock timeout (in seconds) value.
+ * @throws CubridException
+ *
+ */
+function cubrid_set_db_parameter($conn_identifier, int $param_type, int $param_value): void
+{
+ error_clear_last();
+ $result = \cubrid_set_db_parameter($conn_identifier, $param_type, $param_value);
+ if ($result === false) {
+ throw CubridException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/curl.php b/vendor/thecodingmachine/safe/generated/curl.php
new file mode 100644
index 000000000..53f925536
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/curl.php
@@ -0,0 +1,3156 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\CurlException;
+
+/**
+ * This function URL encodes the given string according to RFC 3986.
+ *
+ * @param resource $ch A cURL handle returned by
+ * curl_init.
+ * @param string $str The string to be encoded.
+ * @return string Returns escaped string.
+ * @throws CurlException
+ *
+ */
+function curl_escape($ch, string $str): string
+{
+ error_clear_last();
+ $result = \curl_escape($ch, $str);
+ if ($result === false) {
+ throw CurlException::createFromCurlResource($ch);
+ }
+ return $result;
+}
+
+
+/**
+ * Execute the given cURL session.
+ *
+ * This function should be called after initializing a cURL session and all
+ * the options for the session are set.
+ *
+ * @param resource $ch A cURL handle returned by
+ * curl_init.
+ * @return bool|string Returns TRUE on success. However, if the CURLOPT_RETURNTRANSFER
+ * option is set, it will return
+ * the result on success, FALSE on failure.
+ * @throws CurlException
+ *
+ */
+function curl_exec($ch)
+{
+ error_clear_last();
+ $result = \curl_exec($ch);
+ if ($result === false) {
+ throw CurlException::createFromCurlResource($ch);
+ }
+ return $result;
+}
+
+
+/**
+ * Gets information about the last transfer.
+ *
+ * @param resource $ch A cURL handle returned by
+ * curl_init.
+ * @param int $opt This may be one of the following constants:
+ *
+ *
+ *
+ * CURLINFO_EFFECTIVE_URL - Last effective URL
+ *
+ *
+ *
+ *
+ * CURLINFO_HTTP_CODE - The last response code.
+ * As of PHP 5.5.0 and cURL 7.10.8, this is a legacy alias of
+ * CURLINFO_RESPONSE_CODE
+ *
+ *
+ *
+ *
+ * CURLINFO_FILETIME - Remote time of the retrieved document, with the CURLOPT_FILETIME enabled; if -1 is returned the time of the document is unknown
+ *
+ *
+ *
+ *
+ * CURLINFO_TOTAL_TIME - Total transaction time in seconds for last transfer
+ *
+ *
+ *
+ *
+ * CURLINFO_NAMELOOKUP_TIME - Time in seconds until name resolving was complete
+ *
+ *
+ *
+ *
+ * CURLINFO_CONNECT_TIME - Time in seconds it took to establish the connection
+ *
+ *
+ *
+ *
+ * CURLINFO_PRETRANSFER_TIME - Time in seconds from start until just before file transfer begins
+ *
+ *
+ *
+ *
+ * CURLINFO_STARTTRANSFER_TIME - Time in seconds until the first byte is about to be transferred
+ *
+ *
+ *
+ *
+ * CURLINFO_REDIRECT_COUNT - Number of redirects, with the CURLOPT_FOLLOWLOCATION option enabled
+ *
+ *
+ *
+ *
+ * CURLINFO_REDIRECT_TIME - Time in seconds of all redirection steps before final transaction was started, with the CURLOPT_FOLLOWLOCATION option enabled
+ *
+ *
+ *
+ *
+ * CURLINFO_REDIRECT_URL - With the CURLOPT_FOLLOWLOCATION option disabled: redirect URL found in the last transaction, that should be requested manually next. With the CURLOPT_FOLLOWLOCATION option enabled: this is empty. The redirect URL in this case is available in CURLINFO_EFFECTIVE_URL
+ *
+ *
+ *
+ *
+ * CURLINFO_PRIMARY_IP - IP address of the most recent connection
+ *
+ *
+ *
+ *
+ * CURLINFO_PRIMARY_PORT - Destination port of the most recent connection
+ *
+ *
+ *
+ *
+ * CURLINFO_LOCAL_IP - Local (source) IP address of the most recent connection
+ *
+ *
+ *
+ *
+ * CURLINFO_LOCAL_PORT - Local (source) port of the most recent connection
+ *
+ *
+ *
+ *
+ * CURLINFO_SIZE_UPLOAD - Total number of bytes uploaded
+ *
+ *
+ *
+ *
+ * CURLINFO_SIZE_DOWNLOAD - Total number of bytes downloaded
+ *
+ *
+ *
+ *
+ * CURLINFO_SPEED_DOWNLOAD - Average download speed
+ *
+ *
+ *
+ *
+ * CURLINFO_SPEED_UPLOAD - Average upload speed
+ *
+ *
+ *
+ *
+ * CURLINFO_HEADER_SIZE - Total size of all headers received
+ *
+ *
+ *
+ *
+ * CURLINFO_HEADER_OUT - The request string sent. For this to
+ * work, add the CURLINFO_HEADER_OUT option to the handle by calling
+ * curl_setopt
+ *
+ *
+ *
+ *
+ * CURLINFO_REQUEST_SIZE - Total size of issued requests, currently only for HTTP requests
+ *
+ *
+ *
+ *
+ * CURLINFO_SSL_VERIFYRESULT - Result of SSL certification verification requested by setting CURLOPT_SSL_VERIFYPEER
+ *
+ *
+ *
+ *
+ * CURLINFO_CONTENT_LENGTH_DOWNLOAD - Content length of download, read from Content-Length: field
+ *
+ *
+ *
+ *
+ * CURLINFO_CONTENT_LENGTH_UPLOAD - Specified size of upload
+ *
+ *
+ *
+ *
+ * CURLINFO_CONTENT_TYPE - Content-Type: of the requested document. NULL indicates server did not send valid Content-Type: header
+ *
+ *
+ *
+ *
+ * CURLINFO_PRIVATE - Private data associated with this cURL handle, previously set with the CURLOPT_PRIVATE option of curl_setopt
+ *
+ *
+ *
+ *
+ * CURLINFO_RESPONSE_CODE - The last response code
+ *
+ *
+ *
+ *
+ * CURLINFO_HTTP_CONNECTCODE - The CONNECT response code
+ *
+ *
+ *
+ *
+ * CURLINFO_HTTPAUTH_AVAIL - Bitmask indicating the authentication method(s) available according to the previous response
+ *
+ *
+ *
+ *
+ * CURLINFO_PROXYAUTH_AVAIL - Bitmask indicating the proxy authentication method(s) available according to the previous response
+ *
+ *
+ *
+ *
+ * CURLINFO_OS_ERRNO - Errno from a connect failure. The number is OS and system specific.
+ *
+ *
+ *
+ *
+ * CURLINFO_NUM_CONNECTS - Number of connections curl had to create to achieve the previous transfer
+ *
+ *
+ *
+ *
+ * CURLINFO_SSL_ENGINES - OpenSSL crypto-engines supported
+ *
+ *
+ *
+ *
+ * CURLINFO_COOKIELIST - All known cookies
+ *
+ *
+ *
+ *
+ * CURLINFO_FTP_ENTRY_PATH - Entry path in FTP server
+ *
+ *
+ *
+ *
+ * CURLINFO_APPCONNECT_TIME - Time in seconds it took from the start until the SSL/SSH connect/handshake to the remote host was completed
+ *
+ *
+ *
+ *
+ * CURLINFO_CERTINFO - TLS certificate chain
+ *
+ *
+ *
+ *
+ * CURLINFO_CONDITION_UNMET - Info on unmet time conditional
+ *
+ *
+ *
+ *
+ * CURLINFO_RTSP_CLIENT_CSEQ - Next RTSP client CSeq
+ *
+ *
+ *
+ *
+ * CURLINFO_RTSP_CSEQ_RECV - Recently received CSeq
+ *
+ *
+ *
+ *
+ * CURLINFO_RTSP_SERVER_CSEQ - Next RTSP server CSeq
+ *
+ *
+ *
+ *
+ * CURLINFO_RTSP_SESSION_ID - RTSP session ID
+ *
+ *
+ *
+ *
+ * CURLINFO_CONTENT_LENGTH_DOWNLOAD_T - The content-length of the download. This is the value read from the Content-Type: field. -1 if the size isn't known
+ *
+ *
+ *
+ *
+ * CURLINFO_CONTENT_LENGTH_UPLOAD_T - The specified size of the upload. -1 if the size isn't known
+ *
+ *
+ *
+ *
+ * CURLINFO_HTTP_VERSION - The version used in the last HTTP connection. The return value will be one of the defined CURL_HTTP_VERSION_* constants or 0 if the version can't be determined
+ *
+ *
+ *
+ *
+ * CURLINFO_PROTOCOL - The protocol used in the last HTTP connection. The returned value will be exactly one of the CURLPROTO_* values
+ *
+ *
+ *
+ *
+ * CURLINFO_PROXY_SSL_VERIFYRESULT - The result of the certificate verification that was requested (using the CURLOPT_PROXY_SSL_VERIFYPEER option). Only used for HTTPS proxies
+ *
+ *
+ *
+ *
+ * CURLINFO_SCHEME - The URL scheme used for the most recent connection
+ *
+ *
+ *
+ *
+ * CURLINFO_SIZE_DOWNLOAD_T - Total number of bytes that were downloaded. The number is only for the latest transfer and will be reset again for each new transfer
+ *
+ *
+ *
+ *
+ * CURLINFO_SIZE_UPLOAD_T - Total number of bytes that were uploaded
+ *
+ *
+ *
+ *
+ * CURLINFO_SPEED_DOWNLOAD_T - The average download speed in bytes/second that curl measured for the complete download
+ *
+ *
+ *
+ *
+ * CURLINFO_SPEED_UPLOAD_T - The average upload speed in bytes/second that curl measured for the complete upload
+ *
+ *
+ *
+ *
+ * CURLINFO_APPCONNECT_TIME_T - Time, in microseconds, it took from the start until the SSL/SSH connect/handshake to the remote host was completed
+ *
+ *
+ *
+ *
+ * CURLINFO_CONNECT_TIME_T - Total time taken, in microseconds, from the start until the connection to the remote host (or proxy) was completed
+ *
+ *
+ *
+ *
+ * CURLINFO_FILETIME_T - Remote time of the retrieved document (as Unix timestamp), an alternative to CURLINFO_FILETIME to allow systems with 32 bit long variables to extract dates outside of the 32bit timestamp range
+ *
+ *
+ *
+ *
+ * CURLINFO_NAMELOOKUP_TIME_T - Time in microseconds from the start until the name resolving was completed
+ *
+ *
+ *
+ *
+ * CURLINFO_PRETRANSFER_TIME_T - Time taken from the start until the file transfer is just about to begin, in microseconds
+ *
+ *
+ *
+ *
+ * CURLINFO_REDIRECT_TIME_T - Total time, in microseconds, it took for all redirection steps include name lookup, connect, pretransfer and transfer before final transaction was started
+ *
+ *
+ *
+ *
+ * CURLINFO_STARTTRANSFER_TIME_T - Time, in microseconds, it took from the start until the first byte is received
+ *
+ *
+ *
+ *
+ * CURLINFO_TOTAL_TIME_T - Total time in microseconds for the previous transfer, including name resolving, TCP connect etc.
+ *
+ *
+ *
+ * @return mixed If opt is given, returns its value.
+ * Otherwise, returns an associative array with the following elements
+ * (which correspond to opt):
+ *
+ *
+ *
+ * "url"
+ *
+ *
+ *
+ *
+ * "content_type"
+ *
+ *
+ *
+ *
+ * "http_code"
+ *
+ *
+ *
+ *
+ * "header_size"
+ *
+ *
+ *
+ *
+ * "request_size"
+ *
+ *
+ *
+ *
+ * "filetime"
+ *
+ *
+ *
+ *
+ * "ssl_verify_result"
+ *
+ *
+ *
+ *
+ * "redirect_count"
+ *
+ *
+ *
+ *
+ * "total_time"
+ *
+ *
+ *
+ *
+ * "namelookup_time"
+ *
+ *
+ *
+ *
+ * "connect_time"
+ *
+ *
+ *
+ *
+ * "pretransfer_time"
+ *
+ *
+ *
+ *
+ * "size_upload"
+ *
+ *
+ *
+ *
+ * "size_download"
+ *
+ *
+ *
+ *
+ * "speed_download"
+ *
+ *
+ *
+ *
+ * "speed_upload"
+ *
+ *
+ *
+ *
+ * "download_content_length"
+ *
+ *
+ *
+ *
+ * "upload_content_length"
+ *
+ *
+ *
+ *
+ * "starttransfer_time"
+ *
+ *
+ *
+ *
+ * "redirect_time"
+ *
+ *
+ *
+ *
+ * "certinfo"
+ *
+ *
+ *
+ *
+ * "primary_ip"
+ *
+ *
+ *
+ *
+ * "primary_port"
+ *
+ *
+ *
+ *
+ * "local_ip"
+ *
+ *
+ *
+ *
+ * "local_port"
+ *
+ *
+ *
+ *
+ * "redirect_url"
+ *
+ *
+ *
+ *
+ * "request_header" (This is only set if the CURLINFO_HEADER_OUT
+ * is set by a previous call to curl_setopt)
+ *
+ *
+ *
+ * Note that private data is not included in the associative array and must be retrieved individually with the CURLINFO_PRIVATE option.
+ * @throws CurlException
+ *
+ */
+function curl_getinfo($ch, int $opt = null)
+{
+ error_clear_last();
+ if ($opt !== null) {
+ $result = \curl_getinfo($ch, $opt);
+ } else {
+ $result = \curl_getinfo($ch);
+ }
+ if ($result === false) {
+ throw CurlException::createFromCurlResource($ch);
+ }
+ return $result;
+}
+
+
+/**
+ * Initializes a new session and return a cURL handle for use with the
+ * curl_setopt, curl_exec,
+ * and curl_close functions.
+ *
+ * @param string $url If provided, the CURLOPT_URL option will be set
+ * to its value. You can manually set this using the
+ * curl_setopt function.
+ *
+ * The file protocol is disabled by cURL if
+ * open_basedir is set.
+ * @return resource Returns a cURL handle on success, FALSE on errors.
+ * @throws CurlException
+ *
+ */
+function curl_init(string $url = null)
+{
+ error_clear_last();
+ $result = \curl_init($url);
+ if ($result === false) {
+ throw CurlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Return an integer containing the last multi curl error number.
+ *
+ * @param resource $mh A cURL multi handle returned by
+ * curl_multi_init.
+ * @return int Return an integer containing the last multi curl error number.
+ * @throws CurlException
+ *
+ */
+function curl_multi_errno($mh): int
+{
+ error_clear_last();
+ $result = \curl_multi_errno($mh);
+ if ($result === false) {
+ throw CurlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Ask the multi handle if there are any messages or information from the individual transfers.
+ * Messages may include information such as an error code from the transfer or just the fact
+ * that a transfer is completed.
+ *
+ * Repeated calls to this function will return a new result each time, until a FALSE is returned
+ * as a signal that there is no more to get at this point. The integer pointed to with
+ * msgs_in_queue will contain the number of remaining messages after this
+ * function was called.
+ *
+ * @param resource $mh A cURL multi handle returned by
+ * curl_multi_init.
+ * @param int|null $msgs_in_queue Number of messages that are still in the queue
+ * @return array On success, returns an associative array for the message, FALSE on failure.
+ *
+ *
+ * Contents of the returned array
+ *
+ *
+ *
+ * Key:
+ * Value:
+ *
+ *
+ *
+ *
+ * msg
+ * The CURLMSG_DONE constant. Other return values
+ * are currently not available.
+ *
+ *
+ * result
+ * One of the CURLE_* constants. If everything is
+ * OK, the CURLE_OK will be the result.
+ *
+ *
+ * handle
+ * Resource of type curl indicates the handle which it concerns.
+ *
+ *
+ *
+ *
+ * @throws CurlException
+ *
+ */
+function curl_multi_info_read($mh, ?int &$msgs_in_queue = null): array
+{
+ error_clear_last();
+ $result = \curl_multi_info_read($mh, $msgs_in_queue);
+ if ($result === false) {
+ throw CurlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Allows the processing of multiple cURL handles asynchronously.
+ *
+ * @return resource Returns a cURL multi handle resource on success, FALSE on failure.
+ * @throws CurlException
+ *
+ */
+function curl_multi_init()
+{
+ error_clear_last();
+ $result = \curl_multi_init();
+ if ($result === false) {
+ throw CurlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Sets an option on the given cURL session handle.
+ *
+ * @param resource $ch A cURL handle returned by
+ * curl_init.
+ * @param int $option The CURLOPT_XXX option to set.
+ * @param mixed $value The value to be set on option.
+ *
+ * value should be a bool for the
+ * following values of the option parameter:
+ *
+ *
+ *
+ *
+ * Option
+ * Set value to
+ * Notes
+ *
+ *
+ *
+ *
+ * CURLOPT_AUTOREFERER
+ *
+ * TRUE to automatically set the Referer: field in
+ * requests where it follows a Location: redirect.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_BINARYTRANSFER
+ *
+ * TRUE to return the raw output when
+ * CURLOPT_RETURNTRANSFER is used.
+ *
+ *
+ * From PHP 5.1.3, this option has no effect: the raw output will
+ * always be returned when
+ * CURLOPT_RETURNTRANSFER is used.
+ *
+ *
+ *
+ * CURLOPT_COOKIESESSION
+ *
+ * TRUE to mark this as a new cookie "session". It will force libcurl
+ * to ignore all cookies it is about to load that are "session cookies"
+ * from the previous session. By default, libcurl always stores and
+ * loads all cookies, independent if they are session cookies or not.
+ * Session cookies are cookies without expiry date and they are meant
+ * to be alive and existing for this "session" only.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_CERTINFO
+ *
+ * TRUE to output SSL certification information to STDERR
+ * on secure transfers.
+ *
+ *
+ * Added in cURL 7.19.1.
+ * Available since PHP 5.3.2.
+ * Requires CURLOPT_VERBOSE to be on to have an effect.
+ *
+ *
+ *
+ * CURLOPT_CONNECT_ONLY
+ *
+ * TRUE tells the library to perform all the required proxy authentication
+ * and connection setup, but no data transfer. This option is implemented for
+ * HTTP, SMTP and POP3.
+ *
+ *
+ * Added in 7.15.2.
+ * Available since PHP 5.5.0.
+ *
+ *
+ *
+ * CURLOPT_CRLF
+ *
+ * TRUE to convert Unix newlines to CRLF newlines
+ * on transfers.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_DISALLOW_USERNAME_IN_URL
+ *
+ * TRUE to not allow URLs that include a username. Usernames are allowed by default (0).
+ *
+ *
+ * Added in cURL 7.61.0. Available since PHP 7.3.0.
+ *
+ *
+ *
+ * CURLOPT_DNS_SHUFFLE_ADDRESSES
+ *
+ * TRUE to shuffle the order of all returned addresses so that they will be used
+ * in a random order, when a name is resolved and more than one IP address is returned.
+ * This may cause IPv4 to be used before IPv6 or vice versa.
+ *
+ *
+ * Added in cURL 7.60.0. Available since PHP 7.3.0.
+ *
+ *
+ *
+ * CURLOPT_HAPROXYPROTOCOL
+ *
+ * TRUE to send an HAProxy PROXY protocol v1 header at the start of the connection.
+ * The default action is not to send this header.
+ *
+ *
+ * Added in cURL 7.60.0. Available since PHP 7.3.0.
+ *
+ *
+ *
+ * CURLOPT_SSH_COMPRESSION
+ *
+ * TRUE to enable built-in SSH compression. This is a request, not an order;
+ * the server may or may not do it.
+ *
+ *
+ * Added in cURL 7.56.0. Available since PHP 7.3.0.
+ *
+ *
+ *
+ * CURLOPT_DNS_USE_GLOBAL_CACHE
+ *
+ * TRUE to use a global DNS cache. This option is not thread-safe.
+ * It is conditionally enabled by default if PHP is built for non-threaded use
+ * (CLI, FCGI, Apache2-Prefork, etc.).
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_FAILONERROR
+ *
+ * TRUE to fail verbosely if the HTTP code returned
+ * is greater than or equal to 400. The default behavior is to return
+ * the page normally, ignoring the code.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_SSL_FALSESTART
+ *
+ * TRUE to enable TLS false start.
+ *
+ *
+ * Added in cURL 7.42.0. Available since PHP 7.0.7.
+ *
+ *
+ *
+ * CURLOPT_FILETIME
+ *
+ * TRUE to attempt to retrieve the modification
+ * date of the remote document. This value can be retrieved using
+ * the CURLINFO_FILETIME option with
+ * curl_getinfo.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_FOLLOWLOCATION
+ *
+ * TRUE to follow any
+ * "Location: " header that the server sends as
+ * part of the HTTP header (note this is recursive, PHP will follow as
+ * many "Location: " headers that it is sent,
+ * unless CURLOPT_MAXREDIRS is set).
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_FORBID_REUSE
+ *
+ * TRUE to force the connection to explicitly
+ * close when it has finished processing, and not be pooled for reuse.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_FRESH_CONNECT
+ *
+ * TRUE to force the use of a new connection
+ * instead of a cached one.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_FTP_USE_EPRT
+ *
+ * TRUE to use EPRT (and LPRT) when doing active
+ * FTP downloads. Use FALSE to disable EPRT and LPRT and use PORT
+ * only.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_FTP_USE_EPSV
+ *
+ * TRUE to first try an EPSV command for FTP
+ * transfers before reverting back to PASV. Set to FALSE
+ * to disable EPSV.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_FTP_CREATE_MISSING_DIRS
+ *
+ * TRUE to create missing directories when an FTP operation
+ * encounters a path that currently doesn't exist.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_FTPAPPEND
+ *
+ * TRUE to append to the remote file instead of
+ * overwriting it.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_TCP_NODELAY
+ *
+ * TRUE to disable TCP's Nagle algorithm, which tries to minimize
+ * the number of small packets on the network.
+ *
+ *
+ * Available since PHP 5.2.1 for versions compiled with libcurl 7.11.2 or
+ * greater.
+ *
+ *
+ *
+ * CURLOPT_FTPASCII
+ *
+ * An alias of
+ * CURLOPT_TRANSFERTEXT. Use that instead.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_FTPLISTONLY
+ *
+ * TRUE to only list the names of an FTP
+ * directory.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_HEADER
+ *
+ * TRUE to include the header in the output.
+ *
+ *
+ *
+ *
+ *
+ * CURLINFO_HEADER_OUT
+ *
+ * TRUE to track the handle's request string.
+ *
+ *
+ * Available since PHP 5.1.3. The CURLINFO_
+ * prefix is intentional.
+ *
+ *
+ *
+ * CURLOPT_HTTP09_ALLOWED
+ *
+ * Whether to allow HTTP/0.9 responses. Defaults to FALSE as of libcurl 7.66.0;
+ * formerly it defaulted to TRUE.
+ *
+ *
+ * Available since PHP 7.3.15 and 7.4.3, respectively, if built against libcurl &gt;= 7.64.0
+ *
+ *
+ *
+ * CURLOPT_HTTPGET
+ *
+ * TRUE to reset the HTTP request method to GET.
+ * Since GET is the default, this is only necessary if the request
+ * method has been changed.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_HTTPPROXYTUNNEL
+ *
+ * TRUE to tunnel through a given HTTP proxy.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_HTTP_CONTENT_DECODING
+ *
+ * FALSE to get the raw HTTP response body.
+ *
+ *
+ * Available as of PHP 5.5.0 if built against libcurl &gt;= 7.16.2.
+ *
+ *
+ *
+ * CURLOPT_KEEP_SENDING_ON_ERROR
+ *
+ * TRUE to keep sending the request body if the HTTP code returned is
+ * equal to or larger than 300. The default action would be to stop sending
+ * and close the stream or connection. Suitable for manual NTLM authentication.
+ * Most applications do not need this option.
+ *
+ *
+ * Available as of PHP 7.3.0 if built against libcurl &gt;= 7.51.0.
+ *
+ *
+ *
+ * CURLOPT_MUTE
+ *
+ * TRUE to be completely silent with regards to
+ * the cURL functions.
+ *
+ *
+ * Removed in cURL 7.15.5 (You can use CURLOPT_RETURNTRANSFER instead)
+ *
+ *
+ *
+ * CURLOPT_NETRC
+ *
+ * TRUE to scan the ~/.netrc
+ * file to find a username and password for the remote site that
+ * a connection is being established with.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_NOBODY
+ *
+ * TRUE to exclude the body from the output.
+ * Request method is then set to HEAD. Changing this to FALSE does
+ * not change it to GET.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_NOPROGRESS
+ *
+ * TRUE to disable the progress meter for cURL transfers.
+ *
+ *
+ * PHP automatically sets this option to TRUE, this should only be
+ * changed for debugging purposes.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_NOSIGNAL
+ *
+ * TRUE to ignore any cURL function that causes a
+ * signal to be sent to the PHP process. This is turned on by default
+ * in multi-threaded SAPIs so timeout options can still be used.
+ *
+ *
+ * Added in cURL 7.10.
+ *
+ *
+ *
+ * CURLOPT_PATH_AS_IS
+ *
+ * TRUE to not handle dot dot sequences.
+ *
+ *
+ * Added in cURL 7.42.0. Available since PHP 7.0.7.
+ *
+ *
+ *
+ * CURLOPT_PIPEWAIT
+ *
+ * TRUE to wait for pipelining/multiplexing.
+ *
+ *
+ * Added in cURL 7.43.0. Available since PHP 7.0.7.
+ *
+ *
+ *
+ * CURLOPT_POST
+ *
+ * TRUE to do a regular HTTP POST. This POST is the
+ * normal application/x-www-form-urlencoded kind,
+ * most commonly used by HTML forms.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_PUT
+ *
+ * TRUE to HTTP PUT a file. The file to PUT must
+ * be set with CURLOPT_INFILE and
+ * CURLOPT_INFILESIZE.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_RETURNTRANSFER
+ *
+ * TRUE to return the transfer as a string of the
+ * return value of curl_exec instead of outputting
+ * it directly.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_SAFE_UPLOAD
+ *
+ * TRUE to disable support for the @ prefix for
+ * uploading files in CURLOPT_POSTFIELDS, which
+ * means that values starting with @ can be safely
+ * passed as fields. CURLFile may be used for
+ * uploads instead.
+ *
+ *
+ * Added in PHP 5.5.0 with FALSE as the default value. PHP 5.6.0
+ * changes the default value to TRUE. PHP 7 removes this option;
+ * the CURLFile interface must be used to upload files.
+ *
+ *
+ *
+ * CURLOPT_SASL_IR
+ *
+ * TRUE to enable sending the initial response in the first packet.
+ *
+ *
+ * Added in cURL 7.31.10. Available since PHP 7.0.7.
+ *
+ *
+ *
+ * CURLOPT_SSL_ENABLE_ALPN
+ *
+ * FALSE to disable ALPN in the SSL handshake (if the SSL backend
+ * libcurl is built to use supports it), which can be used to
+ * negotiate http2.
+ *
+ *
+ * Added in cURL 7.36.0. Available since PHP 7.0.7.
+ *
+ *
+ *
+ * CURLOPT_SSL_ENABLE_NPN
+ *
+ * FALSE to disable NPN in the SSL handshake (if the SSL backend
+ * libcurl is built to use supports it), which can be used to
+ * negotiate http2.
+ *
+ *
+ * Added in cURL 7.36.0. Available since PHP 7.0.7.
+ *
+ *
+ *
+ * CURLOPT_SSL_VERIFYPEER
+ *
+ * FALSE to stop cURL from verifying the peer's
+ * certificate. Alternate certificates to verify against can be
+ * specified with the CURLOPT_CAINFO option
+ * or a certificate directory can be specified with the
+ * CURLOPT_CAPATH option.
+ *
+ *
+ * TRUE by default as of cURL 7.10. Default bundle installed as of
+ * cURL 7.10.
+ *
+ *
+ *
+ * CURLOPT_SSL_VERIFYSTATUS
+ *
+ * TRUE to verify the certificate's status.
+ *
+ *
+ * Added in cURL 7.41.0. Available since PHP 7.0.7.
+ *
+ *
+ *
+ * CURLOPT_PROXY_SSL_VERIFYPEER
+ *
+ * FALSE to stop cURL from verifying the peer's certificate.
+ * Alternate certificates to verify against can be
+ * specified with the CURLOPT_CAINFO option
+ * or a certificate directory can be specified with the
+ * CURLOPT_CAPATH option.
+ * When set to false, the peer certificate verification succeeds regardless.
+ *
+ *
+ * TRUE by default. Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
+ *
+ *
+ *
+ * CURLOPT_SUPPRESS_CONNECT_HEADERS
+ *
+ * TRUE to suppress proxy CONNECT response headers from the user callback functions
+ * CURLOPT_HEADERFUNCTION and CURLOPT_WRITEFUNCTION,
+ * when CURLOPT_HTTPPROXYTUNNEL is used and a CONNECT request is made.
+ *
+ *
+ * Added in cURL 7.54.0. Available since PHP 7.3.0.
+ *
+ *
+ *
+ * CURLOPT_TCP_FASTOPEN
+ *
+ * TRUE to enable TCP Fast Open.
+ *
+ *
+ * Added in cURL 7.49.0. Available since PHP 7.0.7.
+ *
+ *
+ *
+ * CURLOPT_TFTP_NO_OPTIONS
+ *
+ * TRUE to not send TFTP options requests.
+ *
+ *
+ * Added in cURL 7.48.0. Available since PHP 7.0.7.
+ *
+ *
+ *
+ * CURLOPT_TRANSFERTEXT
+ *
+ * TRUE to use ASCII mode for FTP transfers.
+ * For LDAP, it retrieves data in plain text instead of HTML. On
+ * Windows systems, it will not set STDOUT to binary
+ * mode.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_UNRESTRICTED_AUTH
+ *
+ * TRUE to keep sending the username and password
+ * when following locations (using
+ * CURLOPT_FOLLOWLOCATION), even when the
+ * hostname has changed.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_UPLOAD
+ *
+ * TRUE to prepare for an upload.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_VERBOSE
+ *
+ * TRUE to output verbose information. Writes
+ * output to STDERR, or the file specified using
+ * CURLOPT_STDERR.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * TRUE to disable the progress meter for cURL transfers.
+ *
+ *
+ * PHP automatically sets this option to TRUE, this should only be
+ * changed for debugging purposes.
+ *
+ *
+ *
+ * PHP automatically sets this option to TRUE, this should only be
+ * changed for debugging purposes.
+ *
+ * value should be an integer for the
+ * following values of the option parameter:
+ *
+ *
+ *
+ *
+ * Option
+ * Set value to
+ * Notes
+ *
+ *
+ *
+ *
+ * CURLOPT_BUFFERSIZE
+ *
+ * The size of the buffer to use for each read. There is no guarantee
+ * this request will be fulfilled, however.
+ *
+ *
+ * Added in cURL 7.10.
+ *
+ *
+ *
+ * CURLOPT_CLOSEPOLICY
+ *
+ * One of the CURLCLOSEPOLICY_* values.
+ *
+ *
+ * This option is deprecated, as it was never implemented in cURL and
+ * never had any effect.
+ *
+ *
+ *
+ *
+ * Removed in PHP 5.6.0.
+ *
+ *
+ *
+ * CURLOPT_CONNECTTIMEOUT
+ *
+ * The number of seconds to wait while trying to connect. Use 0 to
+ * wait indefinitely.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_CONNECTTIMEOUT_MS
+ *
+ * The number of milliseconds to wait while trying to connect. Use 0 to
+ * wait indefinitely.
+ *
+ * If libcurl is built to use the standard system name resolver, that
+ * portion of the connect will still use full-second resolution for
+ * timeouts with a minimum timeout allowed of one second.
+ *
+ *
+ * Added in cURL 7.16.2. Available since PHP 5.2.3.
+ *
+ *
+ *
+ * CURLOPT_DNS_CACHE_TIMEOUT
+ *
+ * The number of seconds to keep DNS entries in memory. This
+ * option is set to 120 (2 minutes) by default.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_EXPECT_100_TIMEOUT_MS
+ *
+ * The timeout for Expect: 100-continue responses in milliseconds.
+ * Defaults to 1000 milliseconds.
+ *
+ *
+ * Added in cURL 7.36.0. Available since PHP 7.0.7.
+ *
+ *
+ *
+ * CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS
+ *
+ * Head start for ipv6 for the happy eyeballs algorithm. Happy eyeballs attempts
+ * to connect to both IPv4 and IPv6 addresses for dual-stack hosts,
+ * preferring IPv6 first for timeout milliseconds.
+ * Defaults to CURL_HET_DEFAULT, which is currently 200 milliseconds.
+ *
+ *
+ * Added in cURL 7.59.0. Available since PHP 7.3.0.
+ *
+ *
+ *
+ * CURLOPT_FTPSSLAUTH
+ *
+ * The FTP authentication method (when is activated):
+ * CURLFTPAUTH_SSL (try SSL first),
+ * CURLFTPAUTH_TLS (try TLS first), or
+ * CURLFTPAUTH_DEFAULT (let cURL decide).
+ *
+ *
+ * Added in cURL 7.12.2.
+ *
+ *
+ *
+ * CURLOPT_HEADEROPT
+ *
+ * How to deal with headers. One of the following constants:
+ *
+ * CURLHEADER_UNIFIED: the headers specified in
+ * CURLOPT_HTTPHEADER will be used in requests
+ * both to servers and proxies. With this option enabled,
+ * CURLOPT_PROXYHEADER will not have any effect.
+ *
+ *
+ * CURLHEADER_SEPARATE: makes
+ * CURLOPT_HTTPHEADER headers only get sent to
+ * a server and not to a proxy. Proxy headers must be set with
+ * CURLOPT_PROXYHEADER to get used. Note that if
+ * a non-CONNECT request is sent to a proxy, libcurl will send both
+ * server headers and proxy headers. When doing CONNECT, libcurl will
+ * send CURLOPT_PROXYHEADER headers only to the
+ * proxy and then CURLOPT_HTTPHEADER headers
+ * only to the server.
+ *
+ *
+ * Defaults to CURLHEADER_SEPARATE as of cURL
+ * 7.42.1, and CURLHEADER_UNIFIED before.
+ *
+ *
+ *
+ * Added in cURL 7.37.0. Available since PHP 7.0.7.
+ *
+ *
+ *
+ * CURLOPT_HTTP_VERSION
+ *
+ * CURL_HTTP_VERSION_NONE (default, lets CURL
+ * decide which version to use),
+ * CURL_HTTP_VERSION_1_0 (forces HTTP/1.0),
+ * CURL_HTTP_VERSION_1_1 (forces HTTP/1.1),
+ * CURL_HTTP_VERSION_2_0 (attempts HTTP 2),
+ * CURL_HTTP_VERSION_2 (alias of CURL_HTTP_VERSION_2_0),
+ * CURL_HTTP_VERSION_2TLS (attempts HTTP 2 over TLS (HTTPS) only) or
+ * CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE (issues non-TLS HTTP requests using HTTP/2 without HTTP/1.1 Upgrade).
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_HTTPAUTH
+ *
+ *
+ * The HTTP authentication method(s) to use. The options are:
+ * CURLAUTH_BASIC,
+ * CURLAUTH_DIGEST,
+ * CURLAUTH_GSSNEGOTIATE,
+ * CURLAUTH_NTLM,
+ * CURLAUTH_ANY, and
+ * CURLAUTH_ANYSAFE.
+ *
+ *
+ * The bitwise | (or) operator can be used to combine
+ * more than one method. If this is done, cURL will poll the server to see
+ * what methods it supports and pick the best one.
+ *
+ *
+ * CURLAUTH_ANY is an alias for
+ * CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM.
+ *
+ *
+ * CURLAUTH_ANYSAFE is an alias for
+ * CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM.
+ *
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_INFILESIZE
+ *
+ * The expected size, in bytes, of the file when uploading a file to
+ * a remote site. Note that using this option will not stop libcurl
+ * from sending more data, as exactly what is sent depends on
+ * CURLOPT_READFUNCTION.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_LOW_SPEED_LIMIT
+ *
+ * The transfer speed, in bytes per second, that the transfer should be
+ * below during the count of CURLOPT_LOW_SPEED_TIME
+ * seconds before PHP considers the transfer too slow and aborts.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_LOW_SPEED_TIME
+ *
+ * The number of seconds the transfer speed should be below
+ * CURLOPT_LOW_SPEED_LIMIT before PHP considers
+ * the transfer too slow and aborts.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_MAXCONNECTS
+ *
+ * The maximum amount of persistent connections that are allowed.
+ * When the limit is reached,
+ * CURLOPT_CLOSEPOLICY is used to determine
+ * which connection to close.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_MAXREDIRS
+ *
+ * The maximum amount of HTTP redirections to follow. Use this option
+ * alongside CURLOPT_FOLLOWLOCATION.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_PORT
+ *
+ * An alternative port number to connect to.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_POSTREDIR
+ *
+ * A bitmask of 1 (301 Moved Permanently), 2 (302 Found)
+ * and 4 (303 See Other) if the HTTP POST method should be maintained
+ * when CURLOPT_FOLLOWLOCATION is set and a
+ * specific type of redirect occurs.
+ *
+ *
+ * Added in cURL 7.19.1. Available since PHP 5.3.2.
+ *
+ *
+ *
+ * CURLOPT_PROTOCOLS
+ *
+ *
+ * Bitmask of CURLPROTO_* values. If used, this bitmask
+ * limits what protocols libcurl may use in the transfer. This allows you to have
+ * a libcurl built to support a wide range of protocols but still limit specific
+ * transfers to only be allowed to use a subset of them. By default libcurl will
+ * accept all protocols it supports.
+ * See also CURLOPT_REDIR_PROTOCOLS.
+ *
+ *
+ * Valid protocol options are:
+ * CURLPROTO_HTTP,
+ * CURLPROTO_HTTPS,
+ * CURLPROTO_FTP,
+ * CURLPROTO_FTPS,
+ * CURLPROTO_SCP,
+ * CURLPROTO_SFTP,
+ * CURLPROTO_TELNET,
+ * CURLPROTO_LDAP,
+ * CURLPROTO_LDAPS,
+ * CURLPROTO_DICT,
+ * CURLPROTO_FILE,
+ * CURLPROTO_TFTP,
+ * CURLPROTO_ALL
+ *
+ *
+ *
+ * Added in cURL 7.19.4.
+ *
+ *
+ *
+ * CURLOPT_PROXYAUTH
+ *
+ * The HTTP authentication method(s) to use for the proxy connection.
+ * Use the same bitmasks as described in
+ * CURLOPT_HTTPAUTH. For proxy authentication,
+ * only CURLAUTH_BASIC and
+ * CURLAUTH_NTLM are currently supported.
+ *
+ *
+ * Added in cURL 7.10.7.
+ *
+ *
+ *
+ * CURLOPT_PROXYPORT
+ *
+ * The port number of the proxy to connect to. This port number can
+ * also be set in CURLOPT_PROXY.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_PROXYTYPE
+ *
+ * Either CURLPROXY_HTTP (default),
+ * CURLPROXY_SOCKS4,
+ * CURLPROXY_SOCKS5,
+ * CURLPROXY_SOCKS4A or
+ * CURLPROXY_SOCKS5_HOSTNAME.
+ *
+ *
+ * Added in cURL 7.10.
+ *
+ *
+ *
+ * CURLOPT_REDIR_PROTOCOLS
+ *
+ * Bitmask of CURLPROTO_* values. If used, this bitmask
+ * limits what protocols libcurl may use in a transfer that it follows to in
+ * a redirect when CURLOPT_FOLLOWLOCATION is enabled.
+ * This allows you to limit specific transfers to only be allowed to use a subset
+ * of protocols in redirections. By default libcurl will allow all protocols
+ * except for FILE and SCP. This is a difference compared to pre-7.19.4 versions
+ * which unconditionally would follow to all protocols supported.
+ * See also CURLOPT_PROTOCOLS for protocol constant values.
+ *
+ *
+ * Added in cURL 7.19.4.
+ *
+ *
+ *
+ * CURLOPT_RESUME_FROM
+ *
+ * The offset, in bytes, to resume a transfer from.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_SOCKS5_AUTH
+ *
+ *
+ * The SOCKS5 authentication method(s) to use. The options are:
+ * CURLAUTH_BASIC,
+ * CURLAUTH_GSSAPI,
+ * CURLAUTH_NONE.
+ *
+ *
+ * The bitwise | (or) operator can be used to combine
+ * more than one method. If this is done, cURL will poll the server to see
+ * what methods it supports and pick the best one.
+ *
+ *
+ * CURLAUTH_BASIC allows username/password authentication.
+ *
+ *
+ * CURLAUTH_GSSAPI allows GSS-API authentication.
+ *
+ *
+ * CURLAUTH_NONE allows no authentication.
+ *
+ *
+ * Defaults to CURLAUTH_BASIC|CURLAUTH_GSSAPI.
+ * Set the actual username and password with the CURLOPT_PROXYUSERPWD option.
+ *
+ *
+ *
+ * Available as of 7.3.0 and curl &gt;= 7.55.0.
+ *
+ *
+ *
+ * CURLOPT_SSL_OPTIONS
+ *
+ * Set SSL behavior options, which is a bitmask of any of the following constants:
+ *
+ * CURLSSLOPT_ALLOW_BEAST: do not attempt to use
+ * any workarounds for a security flaw in the SSL3 and TLS1.0 protocols.
+ *
+ *
+ * CURLSSLOPT_NO_REVOKE: disable certificate
+ * revocation checks for those SSL backends where such behavior is
+ * present.
+ *
+ *
+ *
+ * Added in cURL 7.25.0. Available since PHP 7.0.7.
+ *
+ *
+ *
+ * CURLOPT_SSL_VERIFYHOST
+ *
+ * 1 to check the existence of a common name in the
+ * SSL peer certificate. 2 to check the existence of
+ * a common name and also verify that it matches the hostname
+ * provided. 0 to not check the names. In production environments the value of this option
+ * should be kept at 2 (default value).
+ *
+ *
+ * Support for value 1 removed in cURL 7.28.1.
+ *
+ *
+ *
+ * CURLOPT_SSLVERSION
+ *
+ * One of CURL_SSLVERSION_DEFAULT (0),
+ * CURL_SSLVERSION_TLSv1 (1),
+ * CURL_SSLVERSION_SSLv2 (2),
+ * CURL_SSLVERSION_SSLv3 (3),
+ * CURL_SSLVERSION_TLSv1_0 (4),
+ * CURL_SSLVERSION_TLSv1_1 (5) or
+ * CURL_SSLVERSION_TLSv1_2 (6).
+ * The maximum TLS version can be set by using one of the CURL_SSLVERSION_MAX_*
+ * constants. It is also possible to OR one of the CURL_SSLVERSION_*
+ * constants with one of the CURL_SSLVERSION_MAX_* constants.
+ * CURL_SSLVERSION_MAX_DEFAULT (the maximum version supported by the library),
+ * CURL_SSLVERSION_MAX_TLSv1_0,
+ * CURL_SSLVERSION_MAX_TLSv1_1,
+ * CURL_SSLVERSION_MAX_TLSv1_2, or
+ * CURL_SSLVERSION_MAX_TLSv1_3.
+ *
+ *
+ * Your best bet is to not set this and let it use the default.
+ * Setting it to 2 or 3 is very dangerous given the known
+ * vulnerabilities in SSLv2 and SSLv3.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_PROXY_SSL_OPTIONS
+ *
+ * Set proxy SSL behavior options, which is a bitmask of any of the following constants:
+ *
+ * CURLSSLOPT_ALLOW_BEAST: do not attempt to use
+ * any workarounds for a security flaw in the SSL3 and TLS1.0 protocols.
+ *
+ *
+ * CURLSSLOPT_NO_REVOKE: disable certificate
+ * revocation checks for those SSL backends where such behavior is
+ * present. (curl &gt;= 7.44.0)
+ *
+ *
+ * CURLSSLOPT_NO_PARTIALCHAIN: do not accept "partial"
+ * certificate chains, which it otherwise does by default. (curl &gt;= 7.68.0)
+ *
+ *
+ *
+ * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
+ *
+ *
+ *
+ * CURLOPT_PROXY_SSL_VERIFYHOST
+ *
+ * Set to 2 to verify in the HTTPS proxy's certificate name fields against the proxy name.
+ * When set to 0 the connection succeeds regardless of the names used in the certificate.
+ * Use that ability with caution!
+ * 1 treated as a debug option in curl 7.28.0 and earlier.
+ * From curl 7.28.1 to 7.65.3 CURLE_BAD_FUNCTION_ARGUMENT is returned.
+ * From curl 7.66.0 onwards 1 and 2 is treated as the same value.
+ * In production environments the value of this option should be kept at 2 (default value).
+ *
+ *
+ * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
+ *
+ *
+ *
+ * CURLOPT_PROXY_SSLVERSION
+ *
+ * One of CURL_SSLVERSION_DEFAULT,
+ * CURL_SSLVERSION_TLSv1,
+ * CURL_SSLVERSION_TLSv1_0,
+ * CURL_SSLVERSION_TLSv1_1,
+ * CURL_SSLVERSION_TLSv1_2,
+ * CURL_SSLVERSION_TLSv1_3,
+ * CURL_SSLVERSION_MAX_DEFAULT,
+ * CURL_SSLVERSION_MAX_TLSv1_0,
+ * CURL_SSLVERSION_MAX_TLSv1_1,
+ * CURL_SSLVERSION_MAX_TLSv1_2,
+ * CURL_SSLVERSION_MAX_TLSv1_3 or
+ * CURL_SSLVERSION_SSLv3.
+ *
+ *
+ * Your best bet is to not set this and let it use the default CURL_SSLVERSION_DEFAULT
+ * which will attempt to figure out the remote SSL protocol version.
+ *
+ *
+ *
+ *
+ * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
+ *
+ *
+ *
+ * CURLOPT_STREAM_WEIGHT
+ *
+ * Set the numerical stream weight (a number between 1 and 256).
+ *
+ *
+ * Added in cURL 7.46.0. Available since PHP 7.0.7.
+ *
+ *
+ *
+ * CURLOPT_TCP_KEEPALIVE
+ *
+ * If set to 1, TCP keepalive probes will be sent. The delay and
+ * frequency of these probes can be controlled by the CURLOPT_TCP_KEEPIDLE
+ * and CURLOPT_TCP_KEEPINTVL options, provided the operating system
+ * supports them. If set to 0 (default) keepalive probes are disabled.
+ *
+ *
+ * Added in cURL 7.25.0. Available since PHP 5.5.0.
+ *
+ *
+ *
+ * CURLOPT_TCP_KEEPIDLE
+ *
+ * Sets the delay, in seconds, that the operating system will wait while the connection is
+ * idle before sending keepalive probes, if CURLOPT_TCP_KEEPALIVE is
+ * enabled. Not all operating systems support this option.
+ * The default is 60.
+ *
+ *
+ * Added in cURL 7.25.0. Available since PHP 5.5.0.
+ *
+ *
+ *
+ * CURLOPT_TCP_KEEPINTVL
+ *
+ * Sets the interval, in seconds, that the operating system will wait between sending
+ * keepalive probes, if CURLOPT_TCP_KEEPALIVE is enabled.
+ * Not all operating systems support this option.
+ * The default is 60.
+ *
+ *
+ * Added in cURL 7.25.0. Available since PHP 5.5.0.
+ *
+ *
+ *
+ * CURLOPT_TIMECONDITION
+ *
+ * How CURLOPT_TIMEVALUE is treated.
+ * Use CURL_TIMECOND_IFMODSINCE to return the
+ * page only if it has been modified since the time specified in
+ * CURLOPT_TIMEVALUE. If it hasn't been modified,
+ * a "304 Not Modified" header will be returned
+ * assuming CURLOPT_HEADER is TRUE.
+ * Use CURL_TIMECOND_IFUNMODSINCE for the reverse
+ * effect. CURL_TIMECOND_IFMODSINCE is the
+ * default.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_TIMEOUT
+ *
+ * The maximum number of seconds to allow cURL functions to execute.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_TIMEOUT_MS
+ *
+ * The maximum number of milliseconds to allow cURL functions to
+ * execute.
+ *
+ * If libcurl is built to use the standard system name resolver, that
+ * portion of the connect will still use full-second resolution for
+ * timeouts with a minimum timeout allowed of one second.
+ *
+ *
+ * Added in cURL 7.16.2. Available since PHP 5.2.3.
+ *
+ *
+ *
+ * CURLOPT_TIMEVALUE
+ *
+ * The time in seconds since January 1st, 1970. The time will be used
+ * by CURLOPT_TIMECONDITION. By default,
+ * CURL_TIMECOND_IFMODSINCE is used.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_TIMEVALUE_LARGE
+ *
+ * The time in seconds since January 1st, 1970. The time will be used
+ * by CURLOPT_TIMECONDITION. Defaults to zero.
+ * The difference between this option and CURLOPT_TIMEVALUE
+ * is the type of the argument. On systems where 'long' is only 32 bit wide,
+ * this option has to be used to set dates beyond the year 2038.
+ *
+ *
+ * Added in cURL 7.59.0. Available since PHP 7.3.0.
+ *
+ *
+ *
+ * CURLOPT_MAX_RECV_SPEED_LARGE
+ *
+ * If a download exceeds this speed (counted in bytes per second) on
+ * cumulative average during the transfer, the transfer will pause to
+ * keep the average rate less than or equal to the parameter value.
+ * Defaults to unlimited speed.
+ *
+ *
+ * Added in cURL 7.15.5. Available since PHP 5.4.0.
+ *
+ *
+ *
+ * CURLOPT_MAX_SEND_SPEED_LARGE
+ *
+ * If an upload exceeds this speed (counted in bytes per second) on
+ * cumulative average during the transfer, the transfer will pause to
+ * keep the average rate less than or equal to the parameter value.
+ * Defaults to unlimited speed.
+ *
+ *
+ * Added in cURL 7.15.5. Available since PHP 5.4.0.
+ *
+ *
+ *
+ * CURLOPT_SSH_AUTH_TYPES
+ *
+ * A bitmask consisting of one or more of
+ * CURLSSH_AUTH_PUBLICKEY,
+ * CURLSSH_AUTH_PASSWORD,
+ * CURLSSH_AUTH_HOST,
+ * CURLSSH_AUTH_KEYBOARD. Set to
+ * CURLSSH_AUTH_ANY to let libcurl pick one.
+ *
+ *
+ * Added in cURL 7.16.1.
+ *
+ *
+ *
+ * CURLOPT_IPRESOLVE
+ *
+ * Allows an application to select what kind of IP addresses to use when
+ * resolving host names. This is only interesting when using host names that
+ * resolve addresses using more than one version of IP, possible values are
+ * CURL_IPRESOLVE_WHATEVER,
+ * CURL_IPRESOLVE_V4,
+ * CURL_IPRESOLVE_V6, by default
+ * CURL_IPRESOLVE_WHATEVER.
+ *
+ *
+ * Added in cURL 7.10.8.
+ *
+ *
+ *
+ * CURLOPT_FTP_FILEMETHOD
+ *
+ * Tell curl which method to use to reach a file on a FTP(S) server. Possible values are
+ * CURLFTPMETHOD_MULTICWD,
+ * CURLFTPMETHOD_NOCWD and
+ * CURLFTPMETHOD_SINGLECWD.
+ *
+ *
+ * Added in cURL 7.15.1. Available since PHP 5.3.0.
+ *
+ *
+ *
+ *
+ *
+ *
+ * This option is deprecated, as it was never implemented in cURL and
+ * never had any effect.
+ *
+ * The HTTP authentication method(s) to use. The options are:
+ * CURLAUTH_BASIC,
+ * CURLAUTH_DIGEST,
+ * CURLAUTH_GSSNEGOTIATE,
+ * CURLAUTH_NTLM,
+ * CURLAUTH_ANY, and
+ * CURLAUTH_ANYSAFE.
+ *
+ * The bitwise | (or) operator can be used to combine
+ * more than one method. If this is done, cURL will poll the server to see
+ * what methods it supports and pick the best one.
+ *
+ * CURLAUTH_ANY is an alias for
+ * CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM.
+ *
+ * CURLAUTH_ANYSAFE is an alias for
+ * CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM.
+ *
+ * Bitmask of CURLPROTO_* values. If used, this bitmask
+ * limits what protocols libcurl may use in the transfer. This allows you to have
+ * a libcurl built to support a wide range of protocols but still limit specific
+ * transfers to only be allowed to use a subset of them. By default libcurl will
+ * accept all protocols it supports.
+ * See also CURLOPT_REDIR_PROTOCOLS.
+ *
+ * Valid protocol options are:
+ * CURLPROTO_HTTP,
+ * CURLPROTO_HTTPS,
+ * CURLPROTO_FTP,
+ * CURLPROTO_FTPS,
+ * CURLPROTO_SCP,
+ * CURLPROTO_SFTP,
+ * CURLPROTO_TELNET,
+ * CURLPROTO_LDAP,
+ * CURLPROTO_LDAPS,
+ * CURLPROTO_DICT,
+ * CURLPROTO_FILE,
+ * CURLPROTO_TFTP,
+ * CURLPROTO_ALL
+ *
+ * The SOCKS5 authentication method(s) to use. The options are:
+ * CURLAUTH_BASIC,
+ * CURLAUTH_GSSAPI,
+ * CURLAUTH_NONE.
+ *
+ * The bitwise | (or) operator can be used to combine
+ * more than one method. If this is done, cURL will poll the server to see
+ * what methods it supports and pick the best one.
+ *
+ * CURLAUTH_BASIC allows username/password authentication.
+ *
+ * CURLAUTH_GSSAPI allows GSS-API authentication.
+ *
+ * CURLAUTH_NONE allows no authentication.
+ *
+ * Defaults to CURLAUTH_BASIC|CURLAUTH_GSSAPI.
+ * Set the actual username and password with the CURLOPT_PROXYUSERPWD option.
+ *
+ * Your best bet is to not set this and let it use the default.
+ * Setting it to 2 or 3 is very dangerous given the known
+ * vulnerabilities in SSLv2 and SSLv3.
+ *
+ * Your best bet is to not set this and let it use the default CURL_SSLVERSION_DEFAULT
+ * which will attempt to figure out the remote SSL protocol version.
+ *
+ * value should be a string for the
+ * following values of the option parameter:
+ *
+ *
+ *
+ *
+ * Option
+ * Set value to
+ * Notes
+ *
+ *
+ *
+ *
+ * CURLOPT_ABSTRACT_UNIX_SOCKET
+ *
+ * Enables the use of an abstract Unix domain socket instead of
+ * establishing a TCP connection to a host and sets the path to
+ * the given string. This option shares the same semantics
+ * as CURLOPT_UNIX_SOCKET_PATH. These two options
+ * share the same storage and therefore only one of them can be set
+ * per handle.
+ *
+ *
+ * Available since PHP 7.3.0 and cURL 7.53.0
+ *
+ *
+ *
+ * CURLOPT_CAINFO
+ *
+ * The name of a file holding one or more certificates to verify the
+ * peer with. This only makes sense when used in combination with
+ * CURLOPT_SSL_VERIFYPEER.
+ *
+ *
+ * Might require an absolute path.
+ *
+ *
+ *
+ * CURLOPT_CAPATH
+ *
+ * A directory that holds multiple CA certificates. Use this option
+ * alongside CURLOPT_SSL_VERIFYPEER.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_COOKIE
+ *
+ * The contents of the "Cookie: " header to be
+ * used in the HTTP request.
+ * Note that multiple cookies are separated with a semicolon followed
+ * by a space (e.g., "fruit=apple; colour=red")
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_COOKIEFILE
+ *
+ * The name of the file containing the cookie data. The cookie file can
+ * be in Netscape format, or just plain HTTP-style headers dumped into
+ * a file.
+ * If the name is an empty string, no cookies are loaded, but cookie
+ * handling is still enabled.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_COOKIEJAR
+ *
+ * The name of a file to save all internal cookies to when the handle is closed,
+ * e.g. after a call to curl_close.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_COOKIELIST
+ *
+ * A cookie string (i.e. a single line in Netscape/Mozilla format, or a regular
+ * HTTP-style Set-Cookie header) adds that single cookie to the internal cookie store.
+ * "ALL" erases all cookies held in memory.
+ * "SESS" erases all session cookies held in memory.
+ * "FLUSH" writes all known cookies to the file specified by CURLOPT_COOKIEJAR.
+ * "RELOAD" loads all cookies from the files specified by CURLOPT_COOKIEFILE.
+ *
+ *
+ * Available since PHP 5.5.0 and cURL 7.14.1.
+ *
+ *
+ *
+ * CURLOPT_CUSTOMREQUEST
+ *
+ * A custom request method to use instead of
+ * "GET" or "HEAD" when doing
+ * a HTTP request. This is useful for doing
+ * "DELETE" or other, more obscure HTTP requests.
+ * Valid values are things like "GET",
+ * "POST", "CONNECT" and so on;
+ * i.e. Do not enter a whole HTTP request line here. For instance,
+ * entering "GET /index.html HTTP/1.0\r\n\r\n"
+ * would be incorrect.
+ *
+ *
+ * Don't do this without making sure the server supports the custom
+ * request method first.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_DEFAULT_PROTOCOL
+ *
+ * The default protocol to use if the URL is missing a scheme name.
+ *
+ *
+ * Added in cURL 7.45.0. Available since PHP 7.0.7.
+ *
+ *
+ *
+ * CURLOPT_DNS_INTERFACE
+ *
+ * Set the name of the network interface that the DNS resolver should bind to.
+ * This must be an interface name (not an address).
+ *
+ *
+ * Added in cURL 7.33.0. Available since PHP 7.0.7.
+ *
+ *
+ *
+ * CURLOPT_DNS_LOCAL_IP4
+ *
+ * Set the local IPv4 address that the resolver should bind to. The argument
+ * should contain a single numerical IPv4 address as a string.
+ *
+ *
+ * Added in cURL 7.33.0. Available since PHP 7.0.7.
+ *
+ *
+ *
+ * CURLOPT_DNS_LOCAL_IP6
+ *
+ * Set the local IPv6 address that the resolver should bind to. The argument
+ * should contain a single numerical IPv6 address as a string.
+ *
+ *
+ * Added in cURL 7.33.0. Available since PHP 7.0.7.
+ *
+ *
+ *
+ * CURLOPT_EGDSOCKET
+ *
+ * Like CURLOPT_RANDOM_FILE, except a filename
+ * to an Entropy Gathering Daemon socket.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_ENCODING
+ *
+ * The contents of the "Accept-Encoding: " header.
+ * This enables decoding of the response. Supported encodings are
+ * "identity", "deflate", and
+ * "gzip". If an empty string, "",
+ * is set, a header containing all supported encoding types is sent.
+ *
+ *
+ * Added in cURL 7.10.
+ *
+ *
+ *
+ * CURLOPT_FTPPORT
+ *
+ * The value which will be used to get the IP address to use
+ * for the FTP "PORT" instruction. The "PORT" instruction tells
+ * the remote server to connect to our specified IP address. The
+ * string may be a plain IP address, a hostname, a network
+ * interface name (under Unix), or just a plain '-' to use the
+ * systems default IP address.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_INTERFACE
+ *
+ * The name of the outgoing network interface to use. This can be an
+ * interface name, an IP address or a host name.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_KEYPASSWD
+ *
+ * The password required to use the CURLOPT_SSLKEY
+ * or CURLOPT_SSH_PRIVATE_KEYFILE private key.
+ *
+ *
+ * Added in cURL 7.16.1.
+ *
+ *
+ *
+ * CURLOPT_KRB4LEVEL
+ *
+ * The KRB4 (Kerberos 4) security level. Any of the following values
+ * (in order from least to most powerful) are valid:
+ * "clear",
+ * "safe",
+ * "confidential",
+ * "private"..
+ * If the string does not match one of these,
+ * "private" is used. Setting this option to NULL
+ * will disable KRB4 security. Currently KRB4 security only works
+ * with FTP transactions.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_LOGIN_OPTIONS
+ *
+ * Can be used to set protocol specific login options, such as the
+ * preferred authentication mechanism via "AUTH=NTLM" or "AUTH=*",
+ * and should be used in conjunction with the
+ * CURLOPT_USERNAME option.
+ *
+ *
+ * Added in cURL 7.34.0. Available since PHP 7.0.7.
+ *
+ *
+ *
+ * CURLOPT_PINNEDPUBLICKEY
+ *
+ * Set the pinned public key.
+ * The string can be the file name of your pinned public key. The file
+ * format expected is "PEM" or "DER". The string can also be any
+ * number of base64 encoded sha256 hashes preceded by "sha256//" and
+ * separated by ";".
+ *
+ *
+ * Added in cURL 7.39.0. Available since PHP 7.0.7.
+ *
+ *
+ *
+ * CURLOPT_POSTFIELDS
+ *
+ *
+ * The full data to post in a HTTP "POST" operation.
+ * To post a file, prepend a filename with @ and
+ * use the full path. The filetype can be explicitly specified by
+ * following the filename with the type in the format
+ * ';type=mimetype'. This parameter can either be
+ * passed as a urlencoded string like 'para1=val1&amp;para2=val2&amp;...'
+ * or as an array with the field name as key and field data as value.
+ * If value is an array, the
+ * Content-Type header will be set to
+ * multipart/form-data.
+ *
+ *
+ * As of PHP 5.2.0, value must be an array if
+ * files are passed to this option with the @ prefix.
+ *
+ *
+ * As of PHP 5.5.0, the @ prefix is deprecated and
+ * files can be sent using CURLFile. The
+ * @ prefix can be disabled for safe passing of
+ * values beginning with @ by setting the
+ * CURLOPT_SAFE_UPLOAD option to TRUE.
+ *
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_PRIVATE
+ *
+ * Any data that should be associated with this cURL handle. This data
+ * can subsequently be retrieved with the
+ * CURLINFO_PRIVATE option of
+ * curl_getinfo. cURL does nothing with this data.
+ * When using a cURL multi handle, this private data is typically a
+ * unique key to identify a standard cURL handle.
+ *
+ *
+ * Added in cURL 7.10.3.
+ *
+ *
+ *
+ * CURLOPT_PRE_PROXY
+ *
+ * Set a string holding the host name or dotted numerical
+ * IP address to be used as the preproxy that curl connects to before
+ * it connects to the HTTP(S) proxy specified in the
+ * CURLOPT_PROXY option for the upcoming request.
+ * The preproxy can only be a SOCKS proxy and it should be prefixed with
+ * [scheme]:// to specify which kind of socks is used.
+ * A numerical IPv6 address must be written within [brackets].
+ * Setting the preproxy to an empty string explicitly disables the use of a preproxy.
+ * To specify port number in this string, append :[port]
+ * to the end of the host name. The proxy's port number may optionally be
+ * specified with the separate option CURLOPT_PROXYPORT.
+ * Defaults to using port 1080 for proxies if a port is not specified.
+ *
+ *
+ * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
+ *
+ *
+ *
+ * CURLOPT_PROXY
+ *
+ * The HTTP proxy to tunnel requests through.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_PROXY_SERVICE_NAME
+ *
+ * The proxy authentication service name.
+ *
+ *
+ * Added in cURL 7.34.0. Available since PHP 7.0.7.
+ *
+ *
+ *
+ * CURLOPT_PROXY_CAINFO
+ *
+ * The path to proxy Certificate Authority (CA) bundle. Set the path as a
+ * string naming a file holding one or more certificates to
+ * verify the HTTPS proxy with.
+ * This option is for connecting to an HTTPS proxy, not an HTTPS server.
+ * Defaults set to the system path where libcurl's cacert bundle is assumed
+ * to be stored.
+ *
+ *
+ * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
+ *
+ *
+ *
+ * CURLOPT_PROXY_CAPATH
+ *
+ * The directory holding multiple CA certificates to verify the HTTPS proxy with.
+ *
+ *
+ * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
+ *
+ *
+ *
+ * CURLOPT_PROXY_CRLFILE
+ *
+ * Set the file name with the concatenation of CRL (Certificate Revocation List)
+ * in PEM format to use in the certificate validation that occurs during
+ * the SSL exchange.
+ *
+ *
+ * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
+ *
+ *
+ *
+ * CURLOPT_PROXY_KEYPASSWD
+ *
+ * Set the string be used as the password required to use the
+ * CURLOPT_PROXY_SSLKEY private key. You never needed a
+ * passphrase to load a certificate but you need one to load your private key.
+ * This option is for connecting to an HTTPS proxy, not an HTTPS server.
+ *
+ *
+ * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
+ *
+ *
+ *
+ * CURLOPT_PROXY_PINNEDPUBLICKEY
+ *
+ * Set the pinned public key for HTTPS proxy. The string can be the file name
+ * of your pinned public key. The file format expected is "PEM" or "DER".
+ * The string can also be any number of base64 encoded sha256 hashes preceded by
+ * "sha256//" and separated by ";"
+ *
+ *
+ * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
+ *
+ *
+ *
+ * CURLOPT_PROXY_SSLCERT
+ *
+ * The file name of your client certificate used to connect to the HTTPS proxy.
+ * The default format is "P12" on Secure Transport and "PEM" on other engines,
+ * and can be changed with CURLOPT_PROXY_SSLCERTTYPE.
+ * With NSS or Secure Transport, this can also be the nickname of the certificate
+ * you wish to authenticate with as it is named in the security database.
+ * If you want to use a file from the current directory, please precede it with
+ * "./" prefix, in order to avoid confusion with a nickname.
+ *
+ *
+ * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
+ *
+ *
+ *
+ * CURLOPT_PROXY_SSLCERTTYPE
+ *
+ * The format of your client certificate used when connecting to an HTTPS proxy.
+ * Supported formats are "PEM" and "DER", except with Secure Transport.
+ * OpenSSL (versions 0.9.3 and later) and Secure Transport
+ * (on iOS 5 or later, or OS X 10.7 or later) also support "P12" for
+ * PKCS#12-encoded files. Defaults to "PEM".
+ *
+ *
+ * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
+ *
+ *
+ *
+ * CURLOPT_PROXY_SSL_CIPHER_LIST
+ *
+ * The list of ciphers to use for the connection to the HTTPS proxy.
+ * The list must be syntactically correct, it consists of one or more cipher
+ * strings separated by colons. Commas or spaces are also acceptable separators
+ * but colons are normally used, !, - and + can be used as operators.
+ *
+ *
+ * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
+ *
+ *
+ *
+ * CURLOPT_PROXY_TLS13_CIPHERS
+ *
+ * The list of cipher suites to use for the TLS 1.3 connection to a proxy.
+ * The list must be syntactically correct, it consists of one or more
+ * cipher suite strings separated by colons. This option is currently used
+ * only when curl is built to use OpenSSL 1.1.1 or later.
+ * If you are using a different SSL backend you can try setting
+ * TLS 1.3 cipher suites by using the CURLOPT_PROXY_SSL_CIPHER_LIST option.
+ *
+ *
+ * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.61.0. Available when built with OpenSSL &gt;= 1.1.1.
+ *
+ *
+ *
+ * CURLOPT_PROXY_SSLKEY
+ *
+ * The file name of your private key used for connecting to the HTTPS proxy.
+ * The default format is "PEM" and can be changed with
+ * CURLOPT_PROXY_SSLKEYTYPE.
+ * (iOS and Mac OS X only) This option is ignored if curl was built against Secure Transport.
+ *
+ *
+ * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0. Available if built TLS enabled.
+ *
+ *
+ *
+ * CURLOPT_PROXY_SSLKEYTYPE
+ *
+ * The format of your private key. Supported formats are "PEM", "DER" and "ENG".
+ *
+ *
+ * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
+ *
+ *
+ *
+ * CURLOPT_PROXY_TLSAUTH_PASSWORD
+ *
+ * The password to use for the TLS authentication method specified with the
+ * CURLOPT_PROXY_TLSAUTH_TYPE option. Requires that the
+ * CURLOPT_PROXY_TLSAUTH_USERNAME option to also be set.
+ *
+ *
+ * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
+ *
+ *
+ *
+ * CURLOPT_PROXY_TLSAUTH_TYPE
+ *
+ * The method of the TLS authentication used for the HTTPS connection. Supported method is "SRP".
+ *
+ *
+ * Secure Remote Password (SRP) authentication for TLS provides mutual authentication
+ * if both sides have a shared secret. To use TLS-SRP, you must also set the
+ * CURLOPT_PROXY_TLSAUTH_USERNAME and
+ * CURLOPT_PROXY_TLSAUTH_PASSWORD options.
+ *
+ *
+ *
+ *
+ * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
+ *
+ *
+ *
+ * CURLOPT_PROXY_TLSAUTH_USERNAME
+ *
+ * Tusername to use for the HTTPS proxy TLS authentication method specified with the
+ * CURLOPT_PROXY_TLSAUTH_TYPE option. Requires that the
+ * CURLOPT_PROXY_TLSAUTH_PASSWORD option to also be set.
+ *
+ *
+ * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
+ *
+ *
+ *
+ * CURLOPT_PROXYUSERPWD
+ *
+ * A username and password formatted as
+ * "[username]:[password]" to use for the
+ * connection to the proxy.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_RANDOM_FILE
+ *
+ * A filename to be used to seed the random number generator for SSL.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_RANGE
+ *
+ * Range(s) of data to retrieve in the format
+ * "X-Y" where X or Y are optional. HTTP transfers
+ * also support several intervals, separated with commas in the format
+ * "X-Y,N-M".
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_REFERER
+ *
+ * The contents of the "Referer: " header to be used
+ * in a HTTP request.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_SERVICE_NAME
+ *
+ * The authentication service name.
+ *
+ *
+ * Added in cURL 7.43.0. Available since PHP 7.0.7.
+ *
+ *
+ *
+ * CURLOPT_SSH_HOST_PUBLIC_KEY_MD5
+ *
+ * A string containing 32 hexadecimal digits. The string should be the
+ * MD5 checksum of the remote host's public key, and libcurl will reject
+ * the connection to the host unless the md5sums match.
+ * This option is only for SCP and SFTP transfers.
+ *
+ *
+ * Added in cURL 7.17.1.
+ *
+ *
+ *
+ * CURLOPT_SSH_PUBLIC_KEYFILE
+ *
+ * The file name for your public key. If not used, libcurl defaults to
+ * $HOME/.ssh/id_dsa.pub if the HOME environment variable is set,
+ * and just "id_dsa.pub" in the current directory if HOME is not set.
+ *
+ *
+ * Added in cURL 7.16.1.
+ *
+ *
+ *
+ * CURLOPT_SSH_PRIVATE_KEYFILE
+ *
+ * The file name for your private key. If not used, libcurl defaults to
+ * $HOME/.ssh/id_dsa if the HOME environment variable is set,
+ * and just "id_dsa" in the current directory if HOME is not set.
+ * If the file is password-protected, set the password with
+ * CURLOPT_KEYPASSWD.
+ *
+ *
+ * Added in cURL 7.16.1.
+ *
+ *
+ *
+ * CURLOPT_SSL_CIPHER_LIST
+ *
+ * A list of ciphers to use for SSL. For example,
+ * RC4-SHA and TLSv1 are valid
+ * cipher lists.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_SSLCERT
+ *
+ * The name of a file containing a PEM formatted certificate.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_SSLCERTPASSWD
+ *
+ * The password required to use the
+ * CURLOPT_SSLCERT certificate.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_SSLCERTTYPE
+ *
+ * The format of the certificate. Supported formats are
+ * "PEM" (default), "DER",
+ * and "ENG".
+ * As of OpenSSL 0.9.3, "P12" (for PKCS#12-encoded files)
+ * is also supported.
+ *
+ *
+ * Added in cURL 7.9.3.
+ *
+ *
+ *
+ * CURLOPT_SSLENGINE
+ *
+ * The identifier for the crypto engine of the private SSL key
+ * specified in CURLOPT_SSLKEY.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_SSLENGINE_DEFAULT
+ *
+ * The identifier for the crypto engine used for asymmetric crypto
+ * operations.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_SSLKEY
+ *
+ * The name of a file containing a private SSL key.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_SSLKEYPASSWD
+ *
+ * The secret password needed to use the private SSL key specified in
+ * CURLOPT_SSLKEY.
+ *
+ *
+ * Since this option contains a sensitive password, remember to keep
+ * the PHP script it is contained within safe.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_SSLKEYTYPE
+ *
+ * The key type of the private SSL key specified in
+ * CURLOPT_SSLKEY. Supported key types are
+ * "PEM" (default), "DER",
+ * and "ENG".
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_TLS13_CIPHERS
+ *
+ * The list of cipher suites to use for the TLS 1.3 connection. The list must be
+ * syntactically correct, it consists of one or more cipher suite strings separated by colons.
+ * This option is currently used only when curl is built to use OpenSSL 1.1.1 or later.
+ * If you are using a different SSL backend you can try setting
+ * TLS 1.3 cipher suites by using the CURLOPT_SSL_CIPHER_LIST option.
+ *
+ *
+ * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.61.0. Available when built with OpenSSL &gt;= 1.1.1.
+ *
+ *
+ *
+ * CURLOPT_UNIX_SOCKET_PATH
+ *
+ * Enables the use of Unix domain sockets as connection endpoint and
+ * sets the path to the given string.
+ *
+ *
+ * Added in cURL 7.40.0. Available since PHP 7.0.7.
+ *
+ *
+ *
+ * CURLOPT_URL
+ *
+ * The URL to fetch. This can also be set when initializing a
+ * session with curl_init.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_USERAGENT
+ *
+ * The contents of the "User-Agent: " header to be
+ * used in a HTTP request.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_USERNAME
+ *
+ * The user name to use in authentication.
+ *
+ *
+ * Added in cURL 7.19.1. Available since PHP 5.5.0.
+ *
+ *
+ *
+ * CURLOPT_USERPWD
+ *
+ * A username and password formatted as
+ * "[username]:[password]" to use for the
+ * connection.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_XOAUTH2_BEARER
+ *
+ * Specifies the OAuth 2.0 access token.
+ *
+ *
+ * Added in cURL 7.33.0. Available since PHP 7.0.7.
+ *
+ *
+ *
+ *
+ *
+ *
+ * A custom request method to use instead of
+ * "GET" or "HEAD" when doing
+ * a HTTP request. This is useful for doing
+ * "DELETE" or other, more obscure HTTP requests.
+ * Valid values are things like "GET",
+ * "POST", "CONNECT" and so on;
+ * i.e. Do not enter a whole HTTP request line here. For instance,
+ * entering "GET /index.html HTTP/1.0\r\n\r\n"
+ * would be incorrect.
+ *
+ *
+ * Don't do this without making sure the server supports the custom
+ * request method first.
+ *
+ *
+ *
+ * Don't do this without making sure the server supports the custom
+ * request method first.
+ *
+ * The default protocol to use if the URL is missing a scheme name.
+ *
+ * Set the name of the network interface that the DNS resolver should bind to.
+ * This must be an interface name (not an address).
+ *
+ * Set the local IPv4 address that the resolver should bind to. The argument
+ * should contain a single numerical IPv4 address as a string.
+ *
+ * Set the local IPv6 address that the resolver should bind to. The argument
+ * should contain a single numerical IPv6 address as a string.
+ *
+ * Secure Remote Password (SRP) authentication for TLS provides mutual authentication
+ * if both sides have a shared secret. To use TLS-SRP, you must also set the
+ * CURLOPT_PROXY_TLSAUTH_USERNAME and
+ * CURLOPT_PROXY_TLSAUTH_PASSWORD options.
+ *
+ * The secret password needed to use the private SSL key specified in
+ * CURLOPT_SSLKEY.
+ *
+ *
+ * Since this option contains a sensitive password, remember to keep
+ * the PHP script it is contained within safe.
+ *
+ *
+ *
+ * Since this option contains a sensitive password, remember to keep
+ * the PHP script it is contained within safe.
+ *
+ * value should be an array for the
+ * following values of the option parameter:
+ *
+ *
+ *
+ *
+ * Option
+ * Set value to
+ * Notes
+ *
+ *
+ *
+ *
+ * CURLOPT_CONNECT_TO
+ *
+ * Connect to a specific host and port instead of the URL's host and port.
+ * Accepts an array of strings with the format
+ * HOST:PORT:CONNECT-TO-HOST:CONNECT-TO-PORT.
+ *
+ *
+ * Added in cURL 7.49.0. Available since PHP 7.0.7.
+ *
+ *
+ *
+ * CURLOPT_HTTP200ALIASES
+ *
+ * An array of HTTP 200 responses that will be treated as valid
+ * responses and not as errors.
+ *
+ *
+ * Added in cURL 7.10.3.
+ *
+ *
+ *
+ * CURLOPT_HTTPHEADER
+ *
+ * An array of HTTP header fields to set, in the format
+ *
+ * array('Content-type: text/plain', 'Content-length: 100')
+ *
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_POSTQUOTE
+ *
+ * An array of FTP commands to execute on the server after the FTP
+ * request has been performed.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_PROXYHEADER
+ *
+ * An array of custom HTTP headers to pass to proxies.
+ *
+ *
+ * Added in cURL 7.37.0. Available since PHP 7.0.7.
+ *
+ *
+ *
+ * CURLOPT_QUOTE
+ *
+ * An array of FTP commands to execute on the server prior to the FTP
+ * request.
+ *
+ *
+ *
+ *
+ *
+ * CURLOPT_RESOLVE
+ *
+ * Provide a custom address for a specific host and port pair. An array
+ * of hostname, port, and IP address strings, each element separated by
+ * a colon. In the format:
+ *
+ * array("example.com:80:127.0.0.1")
+ *
+ *
+ *
+ * Added in cURL 7.21.3. Available since PHP 5.5.0.
+ *
+ *
+ *
+ *
+ *
+ *
+ * value should be a stream resource (using
+ * fopen, for example) for the following values of the
+ * option parameter:
+ *
+ *
+ *
+ *
+ * Option
+ * Set value to
+ *
+ *
+ *
+ *
+ * CURLOPT_FILE
+ *
+ * The file that the transfer should be written to. The default
+ * is STDOUT (the browser window).
+ *
+ *
+ *
+ * CURLOPT_INFILE
+ *
+ * The file that the transfer should be read from when uploading.
+ *
+ *
+ *
+ * CURLOPT_STDERR
+ *
+ * An alternative location to output errors to instead of
+ * STDERR.
+ *
+ *
+ *
+ * CURLOPT_WRITEHEADER
+ *
+ * The file that the header part of the transfer is written to.
+ *
+ *
+ *
+ *
+ *
+ *
+ * value should be the name of a valid function or a Closure
+ * for the following values of the option parameter:
+ *
+ *
+ *
+ *
+ * Option
+ * Set value to
+ *
+ *
+ *
+ *
+ * CURLOPT_HEADERFUNCTION
+ *
+ * A callback accepting two parameters.
+ * The first is the cURL resource, the second is a
+ * string with the header data to be written. The header data must
+ * be written by this callback. Return the number of
+ * bytes written.
+ *
+ *
+ *
+ * CURLOPT_PASSWDFUNCTION
+ *
+ * A callback accepting three parameters.
+ * The first is the cURL resource, the second is a
+ * string containing a password prompt, and the third is the maximum
+ * password length. Return the string containing the password.
+ *
+ *
+ *
+ * CURLOPT_PROGRESSFUNCTION
+ *
+ *
+ * A callback accepting five parameters.
+ * The first is the cURL resource, the second is the total number of
+ * bytes expected to be downloaded in this transfer, the third is
+ * the number of bytes downloaded so far, the fourth is the total
+ * number of bytes expected to be uploaded in this transfer, and the
+ * fifth is the number of bytes uploaded so far.
+ *
+ *
+ *
+ * The callback is only called when the CURLOPT_NOPROGRESS
+ * option is set to FALSE.
+ *
+ *
+ *
+ * Return a non-zero value to abort the transfer. In which case, the
+ * transfer will set a CURLE_ABORTED_BY_CALLBACK
+ * error.
+ *
+ *
+ *
+ *
+ * CURLOPT_READFUNCTION
+ *
+ * A callback accepting three parameters.
+ * The first is the cURL resource, the second is a
+ * stream resource provided to cURL through the option
+ * CURLOPT_INFILE, and the third is the maximum
+ * amount of data to be read. The callback must return a string
+ * with a length equal or smaller than the amount of data requested,
+ * typically by reading it from the passed stream resource. It should
+ * return an empty string to signal EOF.
+ *
+ *
+ *
+ * CURLOPT_WRITEFUNCTION
+ *
+ * A callback accepting two parameters.
+ * The first is the cURL resource, and the second is a
+ * string with the data to be written. The data must be saved by
+ * this callback. It must return the exact number of bytes written
+ * or the transfer will be aborted with an error.
+ *
+ *
+ *
+ *
+ *
+ *
+ * A callback accepting five parameters.
+ * The first is the cURL resource, the second is the total number of
+ * bytes expected to be downloaded in this transfer, the third is
+ * the number of bytes downloaded so far, the fourth is the total
+ * number of bytes expected to be uploaded in this transfer, and the
+ * fifth is the number of bytes uploaded so far.
+ *
+ * The callback is only called when the CURLOPT_NOPROGRESS
+ * option is set to FALSE.
+ *
+ * Return a non-zero value to abort the transfer. In which case, the
+ * transfer will set a CURLE_ABORTED_BY_CALLBACK
+ * error.
+ *
+ * Other values:
+ *
+ *
+ *
+ *
+ * Option
+ * Set value to
+ *
+ *
+ *
+ *
+ * CURLOPT_SHARE
+ *
+ * A result of curl_share_init. Makes the cURL
+ * handle to use the data from the shared handle.
+ *
+ *
+ *
+ *
+ *
+ * @throws CurlException
+ *
+ */
+function curl_setopt($ch, int $option, $value): void
+{
+ error_clear_last();
+ $result = \curl_setopt($ch, $option, $value);
+ if ($result === false) {
+ throw CurlException::createFromCurlResource($ch);
+ }
+}
+
+
+/**
+ * Return an integer containing the last share curl error number.
+ *
+ * @param resource $sh A cURL share handle returned by curl_share_init.
+ * @return int Returns an integer containing the last share curl error number.
+ * @throws CurlException
+ *
+ */
+function curl_share_errno($sh): int
+{
+ error_clear_last();
+ $result = \curl_share_errno($sh);
+ if ($result === false) {
+ throw CurlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Sets an option on the given cURL share handle.
+ *
+ * @param resource $sh A cURL share handle returned by curl_share_init.
+ * @param int $option
+ *
+ *
+ *
+ * Option
+ * Description
+ *
+ *
+ *
+ *
+ * CURLSHOPT_SHARE
+ *
+ * Specifies a type of data that should be shared.
+ *
+ *
+ *
+ * CURLSHOPT_UNSHARE
+ *
+ * Specifies a type of data that will be no longer shared.
+ *
+ *
+ *
+ *
+ *
+ * @param string $value
+ *
+ *
+ *
+ * Value
+ * Description
+ *
+ *
+ *
+ *
+ * CURL_LOCK_DATA_COOKIE
+ *
+ * Shares cookie data.
+ *
+ *
+ *
+ * CURL_LOCK_DATA_DNS
+ *
+ * Shares DNS cache. Note that when you use cURL multi handles,
+ * all handles added to the same multi handle will share DNS cache
+ * by default.
+ *
+ *
+ *
+ * CURL_LOCK_DATA_SSL_SESSION
+ *
+ * Shares SSL session IDs, reducing the time spent on the SSL
+ * handshake when reconnecting to the same server. Note that SSL
+ * session IDs are reused within the same handle by default.
+ *
+ *
+ *
+ *
+ *
+ * @throws CurlException
+ *
+ */
+function curl_share_setopt($sh, int $option, string $value): void
+{
+ error_clear_last();
+ $result = \curl_share_setopt($sh, $option, $value);
+ if ($result === false) {
+ throw CurlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function decodes the given URL encoded string.
+ *
+ * @param resource $ch A cURL handle returned by
+ * curl_init.
+ * @param string $str The URL encoded string to be decoded.
+ * @return string Returns decoded string.
+ * @throws CurlException
+ *
+ */
+function curl_unescape($ch, string $str): string
+{
+ error_clear_last();
+ $result = \curl_unescape($ch, $str);
+ if ($result === false) {
+ throw CurlException::createFromCurlResource($ch);
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/datetime.php b/vendor/thecodingmachine/safe/generated/datetime.php
new file mode 100644
index 000000000..01bfa9364
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/datetime.php
@@ -0,0 +1,631 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\DatetimeException;
+
+/**
+ * Returns associative array with detailed info about given date/time.
+ *
+ * @param string $format Format accepted by DateTime::createFromFormat.
+ * @param string $datetime String representing the date/time.
+ * @return array Returns associative array with detailed info about given date/time.
+ * @throws DatetimeException
+ *
+ */
+function date_parse_from_format(string $format, string $datetime): array
+{
+ error_clear_last();
+ $result = \date_parse_from_format($format, $datetime);
+ if ($result === false) {
+ throw DatetimeException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ *
+ *
+ * @param string $datetime Date/time in format accepted by
+ * DateTimeImmutable::__construct.
+ * @return array Returns array with information about the parsed date/time
+ * on success.
+ * @throws DatetimeException
+ *
+ */
+function date_parse(string $datetime): array
+{
+ error_clear_last();
+ $result = \date_parse($datetime);
+ if ($result === false) {
+ throw DatetimeException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ *
+ *
+ * @param int $timestamp Unix timestamp.
+ * @param float $latitude Latitude in degrees.
+ * @param float $longitude Longitude in degrees.
+ * @return array Returns array on success.
+ * The structure of the array is detailed in the following list:
+ *
+ *
+ *
+ * sunrise
+ *
+ *
+ * The timestamp of the sunrise (zenith angle = 90°35').
+ *
+ *
+ *
+ *
+ * sunset
+ *
+ *
+ * The timestamp of the sunset (zenith angle = 90°35').
+ *
+ *
+ *
+ *
+ * transit
+ *
+ *
+ * The timestamp when the sun is at its zenith, i.e. has reached its topmost
+ * point.
+ *
+ *
+ *
+ *
+ * civil_twilight_begin
+ *
+ *
+ * The start of the civil dawn (zenith angle = 96°). It ends at sunrise.
+ *
+ *
+ *
+ *
+ * civil_twilight_end
+ *
+ *
+ * The end of the civil dusk (zenith angle = 96°). It starts at sunset.
+ *
+ *
+ *
+ *
+ * nautical_twilight_begin
+ *
+ *
+ * The start of the nautical dawn (zenith angle = 102°). It ends at
+ * civil_twilight_begin.
+ *
+ *
+ *
+ *
+ * nautical_twilight_end
+ *
+ *
+ * The end of the nautical dusk (zenith angle = 102°). It starts at
+ * civil_twilight_end.
+ *
+ *
+ *
+ *
+ * astronomical_twilight_begin
+ *
+ *
+ * The start of the astronomical dawn (zenith angle = 108°). It ends at
+ * nautical_twilight_begin.
+ *
+ *
+ *
+ *
+ * astronomical_twilight_end
+ *
+ *
+ * The end of the astronomical dusk (zenith angle = 108°). It starts at
+ * nautical_twilight_end.
+ *
+ *
+ *
+ *
+ *
+ * The values of the array elements are either UNIX timestamps, FALSE if the
+ * sun is below the respective zenith for the whole day, or TRUE if the sun is
+ * above the respective zenith for the whole day.
+ * @throws DatetimeException
+ *
+ */
+function date_sun_info(int $timestamp, float $latitude, float $longitude): array
+{
+ error_clear_last();
+ $result = \date_sun_info($timestamp, $latitude, $longitude);
+ if ($result === false) {
+ throw DatetimeException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * date_sunrise returns the sunrise time for a given
+ * day (specified as a timestamp) and location.
+ *
+ * @param int $timestamp The timestamp of the day from which the sunrise
+ * time is taken.
+ * @param int $returnFormat
+ * returnFormat constants
+ *
+ *
+ *
+ * constant
+ * description
+ * example
+ *
+ *
+ *
+ *
+ * SUNFUNCS_RET_STRING
+ * returns the result as string
+ * 16:46
+ *
+ *
+ * SUNFUNCS_RET_DOUBLE
+ * returns the result as float
+ * 16.78243132
+ *
+ *
+ * SUNFUNCS_RET_TIMESTAMP
+ * returns the result as integer (timestamp)
+ * 1095034606
+ *
+ *
+ *
+ *
+ * @param float $latitude Defaults to North, pass in a negative value for South.
+ * See also: date.default_latitude
+ * @param float $longitude Defaults to East, pass in a negative value for West.
+ * See also: date.default_longitude
+ * @param float $zenith zenith is the angle between the center of the sun
+ * and a line perpendicular to earth's surface. It defaults to
+ * date.sunrise_zenith
+ *
+ * Common zenith angles
+ *
+ *
+ *
+ * Angle
+ * Description
+ *
+ *
+ *
+ *
+ * 90°50'
+ * Sunrise: the point where the sun becomes visible.
+ *
+ *
+ * 96°
+ * Civil twilight: conventionally used to signify the start of dawn.
+ *
+ *
+ * 102°
+ * Nautical twilight: the point at which the horizon starts being visible at sea.
+ *
+ *
+ * 108°
+ * Astronomical twilight: the point at which the sun starts being the source of any illumination.
+ *
+ *
+ *
+ *
+ * @param float $utcOffset Specified in hours.
+ * The utcOffset is ignored, if
+ * returnFormat is
+ * SUNFUNCS_RET_TIMESTAMP.
+ * @return mixed Returns the sunrise time in a specified returnFormat on
+ * success. One potential reason for failure is that the
+ * sun does not rise at all, which happens inside the polar circles for part of
+ * the year.
+ * @throws DatetimeException
+ *
+ */
+function date_sunrise(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, float $latitude = null, float $longitude = null, float $zenith = null, float $utcOffset = 0)
+{
+ error_clear_last();
+ if ($utcOffset !== 0) {
+ $result = \date_sunrise($timestamp, $returnFormat, $latitude, $longitude, $zenith, $utcOffset);
+ } elseif ($zenith !== null) {
+ $result = \date_sunrise($timestamp, $returnFormat, $latitude, $longitude, $zenith);
+ } elseif ($longitude !== null) {
+ $result = \date_sunrise($timestamp, $returnFormat, $latitude, $longitude);
+ } elseif ($latitude !== null) {
+ $result = \date_sunrise($timestamp, $returnFormat, $latitude);
+ } else {
+ $result = \date_sunrise($timestamp, $returnFormat);
+ }
+ if ($result === false) {
+ throw DatetimeException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * date_sunset returns the sunset time for a given
+ * day (specified as a timestamp) and location.
+ *
+ * @param int $timestamp The timestamp of the day from which the sunset
+ * time is taken.
+ * @param int $returnFormat
+ * returnFormat constants
+ *
+ *
+ *
+ * constant
+ * description
+ * example
+ *
+ *
+ *
+ *
+ * SUNFUNCS_RET_STRING
+ * returns the result as string
+ * 16:46
+ *
+ *
+ * SUNFUNCS_RET_DOUBLE
+ * returns the result as float
+ * 16.78243132
+ *
+ *
+ * SUNFUNCS_RET_TIMESTAMP
+ * returns the result as integer (timestamp)
+ * 1095034606
+ *
+ *
+ *
+ *
+ * @param float $latitude Defaults to North, pass in a negative value for South.
+ * See also: date.default_latitude
+ * @param float $longitude Defaults to East, pass in a negative value for West.
+ * See also: date.default_longitude
+ * @param float $zenith zenith is the angle between the center of the sun
+ * and a line perpendicular to earth's surface. It defaults to
+ * date.sunset_zenith
+ *
+ * Common zenith angles
+ *
+ *
+ *
+ * Angle
+ * Description
+ *
+ *
+ *
+ *
+ * 90°50'
+ * Sunset: the point where the sun becomes invisible.
+ *
+ *
+ * 96°
+ * Civil twilight: conventionally used to signify the end of dusk.
+ *
+ *
+ * 102°
+ * Nautical twilight: the point at which the horizon ends being visible at sea.
+ *
+ *
+ * 108°
+ * Astronomical twilight: the point at which the sun ends being the source of any illumination.
+ *
+ *
+ *
+ *
+ * @param float $utcOffset Specified in hours.
+ * The utcOffset is ignored, if
+ * returnFormat is
+ * SUNFUNCS_RET_TIMESTAMP.
+ * @return mixed Returns the sunset time in a specified returnFormat on
+ * success. One potential reason for failure is that the
+ * sun does not set at all, which happens inside the polar circles for part of
+ * the year.
+ * @throws DatetimeException
+ *
+ */
+function date_sunset(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, float $latitude = null, float $longitude = null, float $zenith = null, float $utcOffset = 0)
+{
+ error_clear_last();
+ if ($utcOffset !== 0) {
+ $result = \date_sunset($timestamp, $returnFormat, $latitude, $longitude, $zenith, $utcOffset);
+ } elseif ($zenith !== null) {
+ $result = \date_sunset($timestamp, $returnFormat, $latitude, $longitude, $zenith);
+ } elseif ($longitude !== null) {
+ $result = \date_sunset($timestamp, $returnFormat, $latitude, $longitude);
+ } elseif ($latitude !== null) {
+ $result = \date_sunset($timestamp, $returnFormat, $latitude);
+ } else {
+ $result = \date_sunset($timestamp, $returnFormat);
+ }
+ if ($result === false) {
+ throw DatetimeException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Returns a string formatted according to the given format string using the
+ * given integer timestamp or the current time
+ * if no timestamp is given. In other words, timestamp
+ * is optional and defaults to the value of time.
+ *
+ * @param string $format Format accepted by DateTimeInterface::format.
+ * @param int $timestamp The optional timestamp parameter is an
+ * integer Unix timestamp that defaults to the current
+ * local time if a timestamp is not given. In other
+ * words, it defaults to the value of time.
+ * @return string Returns a formatted date string. If a non-numeric value is used for
+ * timestamp, FALSE is returned and an
+ * E_WARNING level error is emitted.
+ * @throws DatetimeException
+ *
+ */
+function date(string $format, int $timestamp = null): string
+{
+ error_clear_last();
+ if ($timestamp !== null) {
+ $result = \date($format, $timestamp);
+ } else {
+ $result = \date($format);
+ }
+ if ($result === false) {
+ throw DatetimeException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Identical to the date function except that
+ * the time returned is Greenwich Mean Time (GMT).
+ *
+ * @param string $format The format of the outputted date string. See the formatting
+ * options for the date function.
+ * @param int $timestamp The optional timestamp parameter is an
+ * integer Unix timestamp that defaults to the current
+ * local time if a timestamp is not given. In other
+ * words, it defaults to the value of time.
+ * @return string Returns a formatted date string. If a non-numeric value is used for
+ * timestamp, FALSE is returned and an
+ * E_WARNING level error is emitted.
+ * @throws DatetimeException
+ *
+ */
+function gmdate(string $format, int $timestamp = null): string
+{
+ error_clear_last();
+ if ($timestamp !== null) {
+ $result = \gmdate($format, $timestamp);
+ } else {
+ $result = \gmdate($format);
+ }
+ if ($result === false) {
+ throw DatetimeException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Returns the Unix timestamp corresponding to the arguments
+ * given. This timestamp is a long integer containing the number of
+ * seconds between the Unix Epoch (January 1 1970 00:00:00 GMT) and the time
+ * specified.
+ *
+ * Arguments may be left out in order from right to left; any
+ * arguments thus omitted will be set to the current value according
+ * to the local date and time.
+ *
+ * @param int $hour The number of the hour relative to the start of the day determined by
+ * month, day and year.
+ * Negative values reference the hour before midnight of the day in question.
+ * Values greater than 23 reference the appropriate hour in the following day(s).
+ * @param int $minute The number of the minute relative to the start of the hour.
+ * Negative values reference the minute in the previous hour.
+ * Values greater than 59 reference the appropriate minute in the following hour(s).
+ * @param int $second The number of seconds relative to the start of the minute.
+ * Negative values reference the second in the previous minute.
+ * Values greater than 59 reference the appropriate second in the following minute(s).
+ * @param int $month The number of the month relative to the end of the previous year.
+ * Values 1 to 12 reference the normal calendar months of the year in question.
+ * Values less than 1 (including negative values) reference the months in the previous year in reverse order, so 0 is December, -1 is November, etc.
+ * Values greater than 12 reference the appropriate month in the following year(s).
+ * @param int $day The number of the day relative to the end of the previous month.
+ * Values 1 to 28, 29, 30 or 31 (depending upon the month) reference the normal days in the relevant month.
+ * Values less than 1 (including negative values) reference the days in the previous month, so 0 is the last day of the previous month, -1 is the day before that, etc.
+ * Values greater than the number of days in the relevant month reference the appropriate day in the following month(s).
+ * @param int $year The number of the year, may be a two or four digit value,
+ * with values between 0-69 mapping to 2000-2069 and 70-100 to
+ * 1970-2000. On systems where time_t is a 32bit signed integer, as
+ * most common today, the valid range for year
+ * is somewhere between 1901 and 2038. However, before PHP 5.1.0 this
+ * range was limited from 1970 to 2038 on some systems (e.g. Windows).
+ * @return int mktime returns the Unix timestamp of the arguments
+ * given.
+ * If the arguments are invalid, the function returns FALSE (before PHP 5.1
+ * it returned -1).
+ * @throws DatetimeException
+ *
+ */
+function mktime(int $hour = null, int $minute = null, int $second = null, int $month = null, int $day = null, int $year = null): int
+{
+ error_clear_last();
+ if ($year !== null) {
+ $result = \mktime($hour, $minute, $second, $month, $day, $year);
+ } elseif ($day !== null) {
+ $result = \mktime($hour, $minute, $second, $month, $day);
+ } elseif ($month !== null) {
+ $result = \mktime($hour, $minute, $second, $month);
+ } elseif ($second !== null) {
+ $result = \mktime($hour, $minute, $second);
+ } elseif ($minute !== null) {
+ $result = \mktime($hour, $minute);
+ } elseif ($hour !== null) {
+ $result = \mktime($hour);
+ } else {
+ $result = \mktime();
+ }
+ if ($result === false) {
+ throw DatetimeException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * strptime returns an array with the
+ * date parsed.
+ *
+ * Month and weekday names and other language dependent strings respect the
+ * current locale set with setlocale (LC_TIME).
+ *
+ * @param string $date The string to parse (e.g. returned from strftime).
+ * @param string $format The format used in date (e.g. the same as
+ * used in strftime). Note that some of the format
+ * options available to strftime may not have any
+ * effect within strptime; the exact subset that are
+ * supported will vary based on the operating system and C library in
+ * use.
+ *
+ * For more information about the format options, read the
+ * strftime page.
+ * @return array Returns an array.
+ *
+ *
+ * The following parameters are returned in the array
+ *
+ *
+ *
+ * parameters
+ * Description
+ *
+ *
+ *
+ *
+ * "tm_sec"
+ * Seconds after the minute (0-61)
+ *
+ *
+ * "tm_min"
+ * Minutes after the hour (0-59)
+ *
+ *
+ * "tm_hour"
+ * Hour since midnight (0-23)
+ *
+ *
+ * "tm_mday"
+ * Day of the month (1-31)
+ *
+ *
+ * "tm_mon"
+ * Months since January (0-11)
+ *
+ *
+ * "tm_year"
+ * Years since 1900
+ *
+ *
+ * "tm_wday"
+ * Days since Sunday (0-6)
+ *
+ *
+ * "tm_yday"
+ * Days since January 1 (0-365)
+ *
+ *
+ * "unparsed"
+ * the date part which was not
+ * recognized using the specified format
+ *
+ *
+ *
+ *
+ * @throws DatetimeException
+ *
+ */
+function strptime(string $date, string $format): array
+{
+ error_clear_last();
+ $result = \strptime($date, $format);
+ if ($result === false) {
+ throw DatetimeException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Each parameter of this function uses the default time zone unless a
+ * time zone is specified in that parameter. Be careful not to use
+ * different time zones in each parameter unless that is intended.
+ * See date_default_timezone_get on the various
+ * ways to define the default time zone.
+ *
+ * @param string $datetime A date/time string. Valid formats are explained in Date and Time Formats.
+ * @param int $now The timestamp which is used as a base for the calculation of relative
+ * dates.
+ * @return int Returns a timestamp on success, FALSE otherwise. Previous to PHP 5.1.0,
+ * this function would return -1 on failure.
+ * @throws DatetimeException
+ *
+ */
+function strtotime(string $datetime, int $now = null): int
+{
+ error_clear_last();
+ if ($now !== null) {
+ $result = \strtotime($datetime, $now);
+ } else {
+ $result = \strtotime($datetime);
+ }
+ if ($result === false) {
+ throw DatetimeException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ *
+ *
+ * @param string $abbr Time zone abbreviation.
+ * @param int $utcOffset Offset from GMT in seconds. Defaults to -1 which means that first found
+ * time zone corresponding to abbr is returned.
+ * Otherwise exact offset is searched and only if not found then the first
+ * time zone with any offset is returned.
+ * @param int $isDST Daylight saving time indicator. Defaults to -1, which means that
+ * whether the time zone has daylight saving or not is not taken into
+ * consideration when searching. If this is set to 1, then the
+ * utcOffset is assumed to be an offset with
+ * daylight saving in effect; if 0, then utcOffset
+ * is assumed to be an offset without daylight saving in effect. If
+ * abbr doesn't exist then the time zone is
+ * searched solely by the utcOffset and
+ * isDST.
+ * @return string Returns time zone name on success.
+ * @throws DatetimeException
+ *
+ */
+function timezone_name_from_abbr(string $abbr, int $utcOffset = -1, int $isDST = -1): string
+{
+ error_clear_last();
+ $result = \timezone_name_from_abbr($abbr, $utcOffset, $isDST);
+ if ($result === false) {
+ throw DatetimeException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/dir.php b/vendor/thecodingmachine/safe/generated/dir.php
new file mode 100644
index 000000000..628dec537
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/dir.php
@@ -0,0 +1,157 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\DirException;
+
+/**
+ * Changes PHP's current directory to
+ * directory.
+ *
+ * @param string $directory The new current directory
+ * @throws DirException
+ *
+ */
+function chdir(string $directory): void
+{
+ error_clear_last();
+ $result = \chdir($directory);
+ if ($result === false) {
+ throw DirException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Changes the root directory of the current process to
+ * directory, and changes the current
+ * working directory to "/".
+ *
+ * This function is only available to GNU and BSD systems, and
+ * only when using the CLI, CGI or Embed SAPI. Also, this function
+ * requires root privileges.
+ *
+ * @param string $directory The path to change the root directory to.
+ * @throws DirException
+ *
+ */
+function chroot(string $directory): void
+{
+ error_clear_last();
+ $result = \chroot($directory);
+ if ($result === false) {
+ throw DirException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Gets the current working directory.
+ *
+ * @return string Returns the current working directory on success.
+ *
+ * On some Unix variants, getcwd will return
+ * FALSE if any one of the parent directories does not have the
+ * readable or search mode set, even if the current directory
+ * does. See chmod for more information on
+ * modes and permissions.
+ * @throws DirException
+ *
+ */
+function getcwd(): string
+{
+ error_clear_last();
+ $result = \getcwd();
+ if ($result === false) {
+ throw DirException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Opens up a directory handle to be used in subsequent
+ * closedir, readdir, and
+ * rewinddir calls.
+ *
+ * @param string $path The directory path that is to be opened
+ * @param resource $context For a description of the context parameter,
+ * refer to the streams section of
+ * the manual.
+ * @return resource Returns a directory handle resource on success
+ * @throws DirException
+ *
+ */
+function opendir(string $path, $context = null)
+{
+ error_clear_last();
+ if ($context !== null) {
+ $result = \opendir($path, $context);
+ } else {
+ $result = \opendir($path);
+ }
+ if ($result === false) {
+ throw DirException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Resets the directory stream indicated by
+ * dir_handle to the beginning of the
+ * directory.
+ *
+ * @param resource $dir_handle The directory handle resource previously opened
+ * with opendir. If the directory handle is
+ * not specified, the last link opened by opendir
+ * is assumed.
+ * @throws DirException
+ *
+ */
+function rewinddir($dir_handle = null): void
+{
+ error_clear_last();
+ if ($dir_handle !== null) {
+ $result = \rewinddir($dir_handle);
+ } else {
+ $result = \rewinddir();
+ }
+ if ($result === false) {
+ throw DirException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Returns an array of files and directories from the
+ * directory.
+ *
+ * @param string $directory The directory that will be scanned.
+ * @param int $sorting_order By default, the sorted order is alphabetical in ascending order. If
+ * the optional sorting_order is set to
+ * SCANDIR_SORT_DESCENDING, then the sort order is
+ * alphabetical in descending order. If it is set to
+ * SCANDIR_SORT_NONE then the result is unsorted.
+ * @param resource $context For a description of the context parameter,
+ * refer to the streams section of
+ * the manual.
+ * @return array Returns an array of filenames on success. If directory is not a directory, then
+ * boolean FALSE is returned, and an error of level
+ * E_WARNING is generated.
+ * @throws DirException
+ *
+ */
+function scandir(string $directory, int $sorting_order = SCANDIR_SORT_ASCENDING, $context = null): array
+{
+ error_clear_last();
+ if ($context !== null) {
+ $result = \scandir($directory, $sorting_order, $context);
+ } else {
+ $result = \scandir($directory, $sorting_order);
+ }
+ if ($result === false) {
+ throw DirException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/eio.php b/vendor/thecodingmachine/safe/generated/eio.php
new file mode 100644
index 000000000..8d2f538e8
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/eio.php
@@ -0,0 +1,2071 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\EioException;
+
+/**
+ * eio_busy artificially increases load taking
+ * delay seconds to execute. May be used for debugging,
+ * or benchmarking.
+ *
+ * @param int $delay Delay in seconds
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback This callback is called when all the group requests are done.
+ * @param mixed $data Arbitrary variable passed to callback.
+ * @return resource eio_busy returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_busy(int $delay, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null)
+{
+ error_clear_last();
+ $result = \eio_busy($delay, $pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * eio_chmod changes file, or directory permissions. The
+ * new permissions are specified by mode.
+ *
+ * @param string $path Path to the target file or directory
+ * Avoid relative
+ * paths
+ * @param int $mode The new permissions. E.g. 0644.
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param mixed $data is custom data passed to the request.
+ * @return resource eio_chmod returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_chmod(string $path, int $mode, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null)
+{
+ error_clear_last();
+ $result = \eio_chmod($path, $mode, $pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Changes file, or directory permissions.
+ *
+ * @param string $path Path to file or directory.
+ * Avoid relative
+ * paths
+ * @param int $uid User ID. Is ignored when equal to -1.
+ * @param int $gid Group ID. Is ignored when equal to -1.
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param mixed $data is custom data passed to the request.
+ * @return resource eio_chown returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_chown(string $path, int $uid, int $gid = -1, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null)
+{
+ error_clear_last();
+ $result = \eio_chown($path, $uid, $gid, $pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * eio_close closes file specified by
+ * fd.
+ *
+ * @param mixed $fd Stream, Socket resource, or numeric file descriptor
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param mixed $data is custom data passed to the request.
+ * @return resource eio_close returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_close($fd, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null)
+{
+ error_clear_last();
+ $result = \eio_close($fd, $pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * eio_custom executes custom function specified by
+ * execute processing it just like any other eio_* call.
+ *
+ * @param callable $execute Specifies the request function that should match the following prototype:
+ *
+ *
+ * callback is event completion callback that should match the following
+ * prototype:
+ *
+ *
+ * data is the data passed to
+ * execute via data argument
+ * without modifications
+ * result value returned by execute
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param mixed $data is custom data passed to the request.
+ * @return resource eio_custom returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_custom(callable $execute, int $pri, callable $callback, $data = null)
+{
+ error_clear_last();
+ $result = \eio_custom($execute, $pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * eio_dup2 duplicates file descriptor.
+ *
+ * @param mixed $fd Source stream, Socket resource, or numeric file descriptor
+ * @param mixed $fd2 Target stream, Socket resource, or numeric file descriptor
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param mixed $data is custom data passed to the request.
+ * @return resource eio_dup2 returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_dup2($fd, $fd2, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null)
+{
+ error_clear_last();
+ $result = \eio_dup2($fd, $fd2, $pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * eio_event_loop polls libeio until all requests proceeded.
+ *
+ * @throws EioException
+ *
+ */
+function eio_event_loop(): void
+{
+ error_clear_last();
+ $result = \eio_event_loop();
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+}
+
+
+/**
+ * eio_fallocate allows the caller to directly manipulate the allocated disk space for the
+ * file specified by fd file descriptor for the byte
+ * range starting at offset and continuing for
+ * length bytes.
+ *
+ * @param mixed $fd Stream, Socket resource, or numeric file descriptor, e.g. returned by eio_open.
+ * @param int $mode Currently only one flag is supported for mode:
+ * EIO_FALLOC_FL_KEEP_SIZE (the same as POSIX constant
+ * FALLOC_FL_KEEP_SIZE).
+ * @param int $offset Specifies start of the byte range.
+ * @param int $length Specifies length the byte range.
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param mixed $data is custom data passed to the request.
+ * @return resource eio_fallocate returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_fallocate($fd, int $mode, int $offset, int $length, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null)
+{
+ error_clear_last();
+ $result = \eio_fallocate($fd, $mode, $offset, $length, $pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * eio_fchmod changes permissions for the file specified
+ * by fd file descriptor.
+ *
+ * @param mixed $fd Stream, Socket resource, or numeric file descriptor, e.g. returned by eio_open.
+ * @param int $mode The new permissions. E.g. 0644.
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param mixed $data is custom data passed to the request.
+ * @return resource eio_fchmod returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_fchmod($fd, int $mode, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null)
+{
+ error_clear_last();
+ $result = \eio_fchmod($fd, $mode, $pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * eio_fdatasync synchronizes a file's in-core state with storage device.
+ *
+ * @param mixed $fd Stream, Socket resource, or numeric file descriptor, e.g. returned by eio_open.
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param mixed $data is custom data passed to the request.
+ * @return resource eio_fdatasync returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_fdatasync($fd, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null)
+{
+ error_clear_last();
+ $result = \eio_fdatasync($fd, $pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * eio_fstat returns file status information in
+ * result argument of callback
+ *
+ * @param mixed $fd Stream, Socket resource, or numeric file descriptor.
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param mixed $data is custom data passed to the request.
+ * @return resource eio_busy returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_fstat($fd, int $pri, callable $callback, $data = null)
+{
+ error_clear_last();
+ if ($data !== null) {
+ $result = \eio_fstat($fd, $pri, $callback, $data);
+ } else {
+ $result = \eio_fstat($fd, $pri, $callback);
+ }
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * eio_fstatvfs returns file system statistics in
+ * result of callback.
+ *
+ * @param mixed $fd A file descriptor of a file within the mounted file system.
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param mixed $data is custom data passed to the request.
+ * @return resource eio_fstatvfs returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_fstatvfs($fd, int $pri, callable $callback, $data = null)
+{
+ error_clear_last();
+ if ($data !== null) {
+ $result = \eio_fstatvfs($fd, $pri, $callback, $data);
+ } else {
+ $result = \eio_fstatvfs($fd, $pri, $callback);
+ }
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Synchronize a file's in-core state with storage device
+ *
+ * @param mixed $fd Stream, Socket resource, or numeric file descriptor.
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param mixed $data is custom data passed to the request.
+ * @return resource eio_fsync returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_fsync($fd, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null)
+{
+ error_clear_last();
+ $result = \eio_fsync($fd, $pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * eio_ftruncate causes a regular file referenced by
+ * fd file descriptor to be truncated to precisely
+ * length bytes.
+ *
+ * @param mixed $fd Stream, Socket resource, or numeric file descriptor.
+ * @param int $offset Offset from beginning of the file
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param mixed $data is custom data passed to the request.
+ * @return resource eio_ftruncate returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_ftruncate($fd, int $offset = 0, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null)
+{
+ error_clear_last();
+ $result = \eio_ftruncate($fd, $offset, $pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * eio_futime changes file last access and modification
+ * times.
+ *
+ * @param mixed $fd Stream, Socket resource, or numeric file descriptor, e.g. returned by eio_open
+ * @param float $atime Access time
+ * @param float $mtime Modification time
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param mixed $data is custom data passed to the request.
+ * @return resource eio_futime returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_futime($fd, float $atime, float $mtime, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null)
+{
+ error_clear_last();
+ $result = \eio_futime($fd, $atime, $mtime, $pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * eio_grp creates a request group.
+ *
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param string $data is custom data passed to the request.
+ * @return resource eio_grp returns request group resource on success.
+ * @throws EioException
+ *
+ */
+function eio_grp(callable $callback, string $data = null)
+{
+ error_clear_last();
+ $result = \eio_grp($callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * eio_lstat returns file status information in
+ * result argument of callback
+ *
+ * @param string $path The file path
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param mixed $data is custom data passed to the request.
+ * @return resource eio_lstat returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_lstat(string $path, int $pri, callable $callback, $data = null)
+{
+ error_clear_last();
+ $result = \eio_lstat($path, $pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * eio_mkdir creates directory with specified access
+ * mode.
+ *
+ * @param string $path Path for the new directory.
+ * @param int $mode Access mode, e.g. 0755
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param mixed $data is custom data passed to the request.
+ * @return resource eio_mkdir returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_mkdir(string $path, int $mode, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null)
+{
+ error_clear_last();
+ $result = \eio_mkdir($path, $mode, $pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * eio_mknod creates ordinary or special(often) file.
+ *
+ * @param string $path Path for the new node(file).
+ * @param int $mode Specifies both the permissions to use and the type of node to be
+ * created. It should be a combination (using bitwise OR) of one of the
+ * file types listed below and the permissions for the new node(e.g. 0640).
+ *
+ * Possible file types are: EIO_S_IFREG(regular file),
+ * EIO_S_IFCHR(character file),
+ * EIO_S_IFBLK(block special file),
+ * EIO_S_IFIFO(FIFO - named pipe) and
+ * EIO_S_IFSOCK(UNIX domain socket).
+ *
+ * To specify permissions EIO_S_I* constants could be
+ * used.
+ * @param int $dev If the file type is EIO_S_IFCHR or
+ * EIO_S_IFBLK then dev specifies the major and minor
+ * numbers of the newly created device special file. Otherwise
+ * dev ignored. See mknod(2) man page for
+ * details.
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param mixed $data is custom data passed to the request.
+ * @return resource eio_mknod returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_mknod(string $path, int $mode, int $dev, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null)
+{
+ error_clear_last();
+ $result = \eio_mknod($path, $mode, $dev, $pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * eio_nop does nothing, except go through the whole
+ * request cycle. Could be useful in debugging.
+ *
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param mixed $data is custom data passed to the request.
+ * @return resource eio_nop returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_nop(int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null)
+{
+ error_clear_last();
+ $result = \eio_nop($pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * eio_readahead populates the page cache with data from a file so that subsequent reads from
+ * that file will not block on disk I/O. See READAHEAD(2) man page for details.
+ *
+ * @param mixed $fd Stream, Socket resource, or numeric file descriptor
+ * @param int $offset Starting point from which data is to be read.
+ * @param int $length Number of bytes to be read.
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param mixed $data is custom data passed to the request.
+ * @return resource eio_readahead returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_readahead($fd, int $offset, int $length, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null)
+{
+ error_clear_last();
+ $result = \eio_readahead($fd, $offset, $length, $pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Reads through a whole directory(via the opendir, readdir and
+ * closedir system calls) and returns either the names or an array in
+ * result argument of callback
+ * function, depending on the flags argument.
+ *
+ * @param string $path Directory path.
+ * @param int $flags Combination of EIO_READDIR_* constants.
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param string $data is custom data passed to the request.
+ * @return resource eio_readdir returns request resource on success. Sets result argument of
+ * callback function according to
+ * flags:
+ *
+ *
+ *
+ *
+ *
+ *
+ * EIO_READDIR_DENTS
+ * (integer)
+ *
+ *
+ *
+ * eio_readdir flag. If specified, the result argument of the callback
+ * becomes an array with the following keys:
+ * 'names' - array of directory names
+ * 'dents' - array of struct
+ * eio_dirent-like arrays having the following keys each:
+ * 'name' - the directory name;
+ * 'type' - one of EIO_DT_*
+ * constants;
+ * 'inode' - the inode number, if available, otherwise
+ * unspecified;
+ *
+ *
+ *
+ *
+ *
+ * EIO_READDIR_DIRS_FIRST
+ * (integer)
+ *
+ *
+ *
+ * When this flag is specified, the names will be returned in an order
+ * where likely directories come first, in optimal stat order.
+ *
+ *
+ *
+ *
+ *
+ * EIO_READDIR_STAT_ORDER
+ * (integer)
+ *
+ *
+ *
+ * When this flag is specified, then the names will be returned in an order
+ * suitable for stat'ing each one. When planning to
+ * stat all files in the given directory, the
+ * returned order will likely be
+ * fastest.
+ *
+ *
+ *
+ *
+ *
+ * EIO_READDIR_FOUND_UNKNOWN
+ * (integer)
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * Node types:
+ *
+ *
+ *
+ *
+ *
+ * EIO_DT_UNKNOWN
+ * (integer)
+ *
+ *
+ *
+ * Unknown node type(very common). Further stat needed.
+ *
+ *
+ *
+ *
+ *
+ * EIO_DT_FIFO
+ * (integer)
+ *
+ *
+ *
+ * FIFO node type
+ *
+ *
+ *
+ *
+ *
+ * EIO_DT_CHR
+ * (integer)
+ *
+ *
+ *
+ * Node type
+ *
+ *
+ *
+ *
+ *
+ * EIO_DT_MPC
+ * (integer)
+ *
+ *
+ *
+ * Multiplexed char device (v7+coherent) node type
+ *
+ *
+ *
+ *
+ *
+ * EIO_DT_DIR
+ * (integer)
+ *
+ *
+ *
+ * Directory node type
+ *
+ *
+ *
+ *
+ *
+ * EIO_DT_NAM
+ * (integer)
+ *
+ *
+ *
+ * Xenix special named file node type
+ *
+ *
+ *
+ *
+ *
+ * EIO_DT_BLK
+ * (integer)
+ *
+ *
+ *
+ * Node type
+ *
+ *
+ *
+ *
+ *
+ * EIO_DT_MPB
+ * (integer)
+ *
+ *
+ *
+ * Multiplexed block device (v7+coherent)
+ *
+ *
+ *
+ *
+ *
+ * EIO_DT_REG
+ * (integer)
+ *
+ *
+ *
+ * Node type
+ *
+ *
+ *
+ *
+ *
+ * EIO_DT_NWK
+ * (integer)
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * EIO_DT_CMP
+ * (integer)
+ *
+ *
+ *
+ * HP-UX network special node type
+ *
+ *
+ *
+ *
+ *
+ * EIO_DT_LNK
+ * (integer)
+ *
+ *
+ *
+ * Link node type
+ *
+ *
+ *
+ *
+ *
+ * EIO_DT_SOCK
+ * (integer)
+ *
+ *
+ *
+ * Socket node type
+ *
+ *
+ *
+ *
+ *
+ * EIO_DT_DOOR
+ * (integer)
+ *
+ *
+ *
+ * Solaris door node type
+ *
+ *
+ *
+ *
+ *
+ * EIO_DT_WHT
+ * (integer)
+ *
+ *
+ *
+ * Node type
+ *
+ *
+ *
+ *
+ *
+ * EIO_DT_MAX
+ * (integer)
+ *
+ *
+ *
+ * Highest node type value
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * @throws EioException
+ *
+ */
+function eio_readdir(string $path, int $flags, int $pri, callable $callback, string $data = null)
+{
+ error_clear_last();
+ $result = \eio_readdir($path, $flags, $pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ *
+ *
+ * @param string $path Source symbolic link path
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param string $data is custom data passed to the request.
+ * @return resource eio_readlink returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_readlink(string $path, int $pri, callable $callback, string $data = null)
+{
+ error_clear_last();
+ $result = \eio_readlink($path, $pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * eio_rename renames or moves a file to new location.
+ *
+ * @param string $path Source path
+ * @param string $new_path Target path
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param mixed $data is custom data passed to the request.
+ * @return resource eio_rename returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_rename(string $path, string $new_path, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null)
+{
+ error_clear_last();
+ $result = \eio_rename($path, $new_path, $pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * eio_rmdir removes a directory.
+ *
+ * @param string $path Directory path
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param mixed $data is custom data passed to the request.
+ * @return resource eio_rmdir returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_rmdir(string $path, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null)
+{
+ error_clear_last();
+ $result = \eio_rmdir($path, $pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * eio_seek repositions the offset of the open file associated with
+ * stream, Socket resource, or file descriptor specified by fd to the argument offset according to the directive whence as follows:
+ *
+ * EIO_SEEK_SET - Set position equal to offset bytes.
+ * EIO_SEEK_CUR - Set position to current location plus offset.
+ * EIO_SEEK_END - Set position to end-of-file plus offset.
+ *
+ *
+ * @param mixed $fd Stream, Socket resource, or numeric file descriptor
+ * @param int $offset Starting point from which data is to be read.
+ * @param int $whence Number of bytes to be read.
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param mixed $data is custom data passed to the request.
+ * @return resource eio_seek returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_seek($fd, int $offset, int $whence, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null)
+{
+ error_clear_last();
+ $result = \eio_seek($fd, $offset, $whence, $pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * eio_sendfile copies data between one file descriptor
+ * and another. See SENDFILE(2) man page for details.
+ *
+ * @param mixed $out_fd Output stream, Socket resource, or file descriptor. Should be opened for writing.
+ * @param mixed $in_fd Input stream, Socket resource, or file descriptor. Should be opened for reading.
+ * @param int $offset Offset within the source file.
+ * @param int $length Number of bytes to copy.
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param string $data is custom data passed to the request.
+ * @return resource eio_sendfile returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_sendfile($out_fd, $in_fd, int $offset, int $length, int $pri = null, callable $callback = null, string $data = null)
+{
+ error_clear_last();
+ if ($data !== null) {
+ $result = \eio_sendfile($out_fd, $in_fd, $offset, $length, $pri, $callback, $data);
+ } elseif ($callback !== null) {
+ $result = \eio_sendfile($out_fd, $in_fd, $offset, $length, $pri, $callback);
+ } elseif ($pri !== null) {
+ $result = \eio_sendfile($out_fd, $in_fd, $offset, $length, $pri);
+ } else {
+ $result = \eio_sendfile($out_fd, $in_fd, $offset, $length);
+ }
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * eio_stat returns file status information in
+ * result argument of callback
+ *
+ * @param string $path The file path
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param mixed $data is custom data passed to the request.
+ * @return resource eio_stat returns request resource on success. On success assigns result argument of
+ * callback to an array.
+ * @throws EioException
+ *
+ */
+function eio_stat(string $path, int $pri, callable $callback, $data = null)
+{
+ error_clear_last();
+ $result = \eio_stat($path, $pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * eio_statvfs returns file system statistics information in
+ * result argument of callback
+ *
+ * @param string $path Pathname of any file within the mounted file system
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param mixed $data is custom data passed to the request.
+ * @return resource eio_statvfs returns request resource on success. On success assigns result argument of
+ * callback to an array.
+ * @throws EioException
+ *
+ */
+function eio_statvfs(string $path, int $pri, callable $callback, $data = null)
+{
+ error_clear_last();
+ if ($data !== null) {
+ $result = \eio_statvfs($path, $pri, $callback, $data);
+ } else {
+ $result = \eio_statvfs($path, $pri, $callback);
+ }
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * eio_symlink creates a symbolic link
+ * new_path to path.
+ *
+ * @param string $path Source path
+ * @param string $new_path Target path
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param mixed $data is custom data passed to the request.
+ * @return resource eio_symlink returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_symlink(string $path, string $new_path, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null)
+{
+ error_clear_last();
+ $result = \eio_symlink($path, $new_path, $pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * eio_sync_file_range permits fine control when synchronizing the open file referred to by the file
+ * descriptor fd with disk.
+ *
+ * @param mixed $fd File descriptor
+ * @param int $offset The starting byte of the file range to be synchronized
+ * @param int $nbytes Specifies the length of the range to be synchronized, in bytes. If
+ * nbytes is zero, then all bytes from offset through
+ * to the end of file are synchronized.
+ * @param int $flags A bit-mask. Can include any of the following values:
+ * EIO_SYNC_FILE_RANGE_WAIT_BEFORE,
+ * EIO_SYNC_FILE_RANGE_WRITE,
+ * EIO_SYNC_FILE_RANGE_WAIT_AFTER. These flags have
+ * the same meaning as their SYNC_FILE_RANGE_*
+ * counterparts(see SYNC_FILE_RANGE(2) man page).
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param mixed $data is custom data passed to the request.
+ * @return resource eio_sync_file_range returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_sync_file_range($fd, int $offset, int $nbytes, int $flags, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null)
+{
+ error_clear_last();
+ $result = \eio_sync_file_range($fd, $offset, $nbytes, $flags, $pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ *
+ *
+ * @param int $pri
+ * @param callable $callback
+ * @param mixed $data
+ * @return resource eio_sync returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_sync(int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null)
+{
+ error_clear_last();
+ $result = \eio_sync($pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ *
+ *
+ * @param mixed $fd File descriptor
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param mixed $data is custom data passed to the request.
+ * @return resource eio_syncfs returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_syncfs($fd, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null)
+{
+ error_clear_last();
+ $result = \eio_syncfs($fd, $pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * eio_truncate causes the regular file named by path to be truncated to
+ * a size of precisely length bytes
+ *
+ * @param string $path File path
+ * @param int $offset Offset from beginning of the file.
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param mixed $data is custom data passed to the request.
+ * @return resource eio_busy returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_truncate(string $path, int $offset = 0, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null)
+{
+ error_clear_last();
+ $result = \eio_truncate($path, $offset, $pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * eio_unlink deletes a name from the file system.
+ *
+ * @param string $path Path to file
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param mixed $data is custom data passed to the request.
+ * @return resource eio_unlink returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_unlink(string $path, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null)
+{
+ error_clear_last();
+ $result = \eio_unlink($path, $pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ *
+ *
+ * @param string $path Path to the file.
+ * @param float $atime Access time
+ * @param float $mtime Modification time
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param mixed $data is custom data passed to the request.
+ * @return resource eio_utime returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_utime(string $path, float $atime, float $mtime, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null)
+{
+ error_clear_last();
+ $result = \eio_utime($path, $atime, $mtime, $pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * eio_write writes up to length
+ * bytes from str at offset
+ * offset from the beginning of the file.
+ *
+ * @param mixed $fd Stream, Socket resource, or numeric file descriptor, e.g. returned by eio_open
+ * @param string $str Source string
+ * @param int $length Maximum number of bytes to write.
+ * @param int $offset Offset from the beginning of file.
+ * @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
+ * If NULL passed, pri internally is set to
+ * EIO_PRI_DEFAULT.
+ * @param callable $callback
+ * callback function is called when the request is done.
+ * It should match the following prototype:
+ *
+ *
+ * data
+ * is custom data passed to the request.
+ *
+ *
+ * result
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ *
+ * req
+ * is optional request resource which can be used with functions like eio_get_last_error
+ *
+ *
+ *
+ * is custom data passed to the request.
+ *
+ * request-specific result value; basically, the value returned by corresponding
+ * system call.
+ *
+ * is optional request resource which can be used with functions like eio_get_last_error
+ * @param mixed $data is custom data passed to the request.
+ * @return resource eio_write returns request resource on success.
+ * @throws EioException
+ *
+ */
+function eio_write($fd, string $str, int $length = 0, int $offset = 0, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null)
+{
+ error_clear_last();
+ $result = \eio_write($fd, $str, $length, $offset, $pri, $callback, $data);
+ if ($result === false) {
+ throw EioException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/errorfunc.php b/vendor/thecodingmachine/safe/generated/errorfunc.php
new file mode 100644
index 000000000..ac64a7d8b
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/errorfunc.php
@@ -0,0 +1,82 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\ErrorfuncException;
+
+/**
+ * Sends an error message to the web server's error log or to a file.
+ *
+ * @param string $message The error message that should be logged.
+ * @param int $message_type Says where the error should go. The possible message types are as
+ * follows:
+ *
+ *
+ * error_log log types
+ *
+ *
+ *
+ * 0
+ *
+ * message is sent to PHP's system logger, using
+ * the Operating System's system logging mechanism or a file, depending
+ * on what the error_log
+ * configuration directive is set to. This is the default option.
+ *
+ *
+ *
+ * 1
+ *
+ * message is sent by email to the address in
+ * the destination parameter. This is the only
+ * message type where the fourth parameter,
+ * extra_headers is used.
+ *
+ *
+ *
+ * 2
+ *
+ * No longer an option.
+ *
+ *
+ *
+ * 3
+ *
+ * message is appended to the file
+ * destination. A newline is not automatically
+ * added to the end of the message string.
+ *
+ *
+ *
+ * 4
+ *
+ * message is sent directly to the SAPI logging
+ * handler.
+ *
+ *
+ *
+ *
+ *
+ * @param string $destination The destination. Its meaning depends on the
+ * message_type parameter as described above.
+ * @param string $extra_headers The extra headers. It's used when the message_type
+ * parameter is set to 1.
+ * This message type uses the same internal function as
+ * mail does.
+ * @throws ErrorfuncException
+ *
+ */
+function error_log(string $message, int $message_type = 0, string $destination = null, string $extra_headers = null): void
+{
+ error_clear_last();
+ if ($extra_headers !== null) {
+ $result = \error_log($message, $message_type, $destination, $extra_headers);
+ } elseif ($destination !== null) {
+ $result = \error_log($message, $message_type, $destination);
+ } else {
+ $result = \error_log($message, $message_type);
+ }
+ if ($result === false) {
+ throw ErrorfuncException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/exec.php b/vendor/thecodingmachine/safe/generated/exec.php
new file mode 100644
index 000000000..e9a40e08b
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/exec.php
@@ -0,0 +1,159 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\ExecException;
+
+/**
+ * proc_get_status fetches data about a
+ * process opened using proc_open.
+ *
+ * @param resource $process The proc_open resource that will
+ * be evaluated.
+ * @return array An array of collected information on success. The returned array contains the following elements:
+ *
+ *
+ *
+ *
+ * elementtypedescription
+ *
+ *
+ *
+ * command
+ * string
+ *
+ * The command string that was passed to proc_open.
+ *
+ *
+ *
+ * pid
+ * int
+ * process id
+ *
+ *
+ * running
+ * bool
+ *
+ * TRUE if the process is still running, FALSE if it has
+ * terminated.
+ *
+ *
+ *
+ * signaled
+ * bool
+ *
+ * TRUE if the child process has been terminated by
+ * an uncaught signal. Always set to FALSE on Windows.
+ *
+ *
+ *
+ * stopped
+ * bool
+ *
+ * TRUE if the child process has been stopped by a
+ * signal. Always set to FALSE on Windows.
+ *
+ *
+ *
+ * exitcode
+ * int
+ *
+ * The exit code returned by the process (which is only
+ * meaningful if running is FALSE).
+ * Only first call of this function return real value, next calls return
+ * -1.
+ *
+ *
+ *
+ * termsig
+ * int
+ *
+ * The number of the signal that caused the child process to terminate
+ * its execution (only meaningful if signaled is TRUE).
+ *
+ *
+ *
+ * stopsig
+ * int
+ *
+ * The number of the signal that caused the child process to stop its
+ * execution (only meaningful if stopped is TRUE).
+ *
+ *
+ *
+ *
+ *
+ * @throws ExecException
+ *
+ */
+function proc_get_status($process): array
+{
+ error_clear_last();
+ $result = \proc_get_status($process);
+ if ($result === false) {
+ throw ExecException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * proc_nice changes the priority of the current
+ * process by the amount specified in increment. A
+ * positive increment will lower the priority of the
+ * current process, whereas a negative increment
+ * will raise the priority.
+ *
+ * proc_nice is not related to
+ * proc_open and its associated functions in any way.
+ *
+ * @param int $increment The new priority value, the value of this may differ on platforms.
+ *
+ * On Unix, a low value, such as -20 means high priority
+ * wheras a positive value have a lower priority.
+ *
+ * For Windows the increment parameter have the
+ * following meanings:
+ * @throws ExecException
+ *
+ */
+function proc_nice(int $increment): void
+{
+ error_clear_last();
+ $result = \proc_nice($increment);
+ if ($result === false) {
+ throw ExecException::createFromPhpError();
+ }
+}
+
+
+/**
+ * system is just like the C version of the
+ * function in that it executes the given
+ * command and outputs the result.
+ *
+ * The system call also tries to automatically
+ * flush the web server's output buffer after each line of output if
+ * PHP is running as a server module.
+ *
+ * If you need to execute a command and have all the data from the
+ * command passed directly back without any interference, use the
+ * passthru function.
+ *
+ * @param string $command The command that will be executed.
+ * @param int $return_var If the return_var argument is present, then the
+ * return status of the executed command will be written to this
+ * variable.
+ * @return string Returns the last line of the command output on success.
+ * @throws ExecException
+ *
+ */
+function system(string $command, int &$return_var = null): string
+{
+ error_clear_last();
+ $result = \system($command, $return_var);
+ if ($result === false) {
+ throw ExecException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/fileinfo.php b/vendor/thecodingmachine/safe/generated/fileinfo.php
new file mode 100644
index 000000000..50345b67c
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/fileinfo.php
@@ -0,0 +1,75 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\FileinfoException;
+
+/**
+ * This function closes the resource opened by finfo_open.
+ *
+ * @param resource $finfo Fileinfo resource returned by finfo_open.
+ * @throws FileinfoException
+ *
+ */
+function finfo_close($finfo): void
+{
+ error_clear_last();
+ $result = \finfo_close($finfo);
+ if ($result === false) {
+ throw FileinfoException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Procedural style
+ *
+ * Object oriented style (constructor):
+ *
+ * This function opens a magic database and returns its resource.
+ *
+ * @param int $options One or disjunction of more Fileinfo
+ * constants.
+ * @param string $magic_file Name of a magic database file, usually something like
+ * /path/to/magic.mime. If not specified, the
+ * MAGIC environment variable is used. If the
+ * environment variable isn't set, then PHP's bundled magic database will
+ * be used.
+ *
+ * Passing NULL or an empty string will be equivalent to the default
+ * value.
+ * @return resource (Procedural style only)
+ * Returns a magic database resource on success.
+ * @throws FileinfoException
+ *
+ */
+function finfo_open(int $options = FILEINFO_NONE, string $magic_file = "")
+{
+ error_clear_last();
+ $result = \finfo_open($options, $magic_file);
+ if ($result === false) {
+ throw FileinfoException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Returns the MIME content type for a file as determined by using
+ * information from the magic.mime file.
+ *
+ * @param string $filename Path to the tested file.
+ * @return string Returns the content type in MIME format, like
+ * text/plain or application/octet-stream.
+ * @throws FileinfoException
+ *
+ */
+function mime_content_type(string $filename): string
+{
+ error_clear_last();
+ $result = \mime_content_type($filename);
+ if ($result === false) {
+ throw FileinfoException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/filesystem.php b/vendor/thecodingmachine/safe/generated/filesystem.php
new file mode 100644
index 000000000..ee0a4bdf1
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/filesystem.php
@@ -0,0 +1,1488 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\FilesystemException;
+
+/**
+ * Attempts to change the group of the file filename
+ * to group.
+ *
+ * Only the superuser may change the group of a file arbitrarily; other users
+ * may change the group of a file to any group of which that user is a member.
+ *
+ * @param string $filename Path to the file.
+ * @param string|int $group A group name or number.
+ * @throws FilesystemException
+ *
+ */
+function chgrp(string $filename, $group): void
+{
+ error_clear_last();
+ $result = \chgrp($filename, $group);
+ if ($result === false) {
+ throw FilesystemException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Attempts to change the mode of the specified file to that given in
+ * mode.
+ *
+ * @param string $filename Path to the file.
+ * @param int $mode Note that mode is not automatically
+ * assumed to be an octal value, so to ensure the expected operation,
+ * you need to prefix mode with a zero (0).
+ * Strings such as "g+w" will not work properly.
+ *
+ *
+ *
+ *
+ * ]]>
+ *
+ *
+ *
+ * The mode parameter consists of three octal
+ * number components specifying access restrictions for the owner,
+ * the user group in which the owner is in, and to everybody else in
+ * this order. One component can be computed by adding up the needed
+ * permissions for that target user base. Number 1 means that you
+ * grant execute rights, number 2 means that you make the file
+ * writeable, number 4 means that you make the file readable. Add
+ * up these numbers to specify needed rights. You can also read more
+ * about modes on Unix systems with 'man 1 chmod'
+ * and 'man 2 chmod'.
+ *
+ *
+ *
+ *
+ */
+function chmod(string $filename, int $mode): void
+{
+ error_clear_last();
+ $result = \chmod($filename, $mode);
+ if ($result === false) {
+ throw 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();
+ $result = \chown($filename, $user);
+ if ($result === 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) {
+ $result = \copy($source, $dest, $context);
+ } else {
+ $result = \copy($source, $dest);
+ }
+ if ($result === 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();
+ $result = \disk_free_space($directory);
+ if ($result === false) {
+ throw FilesystemException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Given a string containing a directory, this function will return the total
+ * number of bytes on the corresponding filesystem or disk partition.
+ *
+ * @param string $directory A directory of the filesystem or disk partition.
+ * @return float Returns the total number of bytes as a float.
+ * @throws FilesystemException
+ *
+ */
+function disk_total_space(string $directory): float
+{
+ error_clear_last();
+ $result = \disk_total_space($directory);
+ if ($result === false) {
+ throw FilesystemException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * The file pointed to by handle is closed.
+ *
+ * @param resource $handle The file pointer must be valid, and must point to a file successfully
+ * opened by fopen or fsockopen.
+ * @throws FilesystemException
+ *
+ */
+function fclose($handle): void
+{
+ error_clear_last();
+ $result = \fclose($handle);
+ if ($result === false) {
+ throw FilesystemException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function forces a write of all buffered output to the resource
+ * pointed to by the file handle.
+ *
+ * @param resource $handle The file pointer must be valid, and must point to
+ * a file successfully opened by fopen or
+ * fsockopen (and not yet closed by
+ * fclose).
+ * @throws FilesystemException
+ *
+ */
+function fflush($handle): void
+{
+ error_clear_last();
+ $result = \fflush($handle);
+ if ($result === 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 maxlen bytes. On failure,
+ * file_get_contents will return FALSE.
+ *
+ * file_get_contents is the preferred way to read the
+ * contents of a file into a string. It will use memory mapping techniques if
+ * supported by your OS to enhance performance.
+ *
+ * @param string $filename Name of the file to read.
+ * @param bool $use_include_path The FILE_USE_INCLUDE_PATH constant can be used
+ * to trigger include path
+ * search.
+ * This is not possible if strict typing
+ * is enabled, since FILE_USE_INCLUDE_PATH is an
+ * int. Use TRUE instead.
+ * @param resource|null $context A valid context resource created with
+ * stream_context_create. If you don't need to use a
+ * custom context, you can skip this parameter by NULL.
+ * @param int $offset The offset where the reading starts on the original stream.
+ * Negative offsets count from the end of the stream.
+ *
+ * Seeking (offset) is not supported with remote files.
+ * Attempting to seek on non-local files may work with small offsets, but this
+ * is unpredictable because it works on the buffered stream.
+ * @param int $maxlen Maximum length of data read. The default is to read until end
+ * of file is reached. Note that this parameter is applied to the
+ * stream processed by the filters.
+ * @return string The function returns the read data.
+ * @throws FilesystemException
+ *
+ */
+function file_get_contents(string $filename, bool $use_include_path = false, $context = null, int $offset = 0, int $maxlen = null): string
+{
+ error_clear_last();
+ if ($maxlen !== null) {
+ $result = \file_get_contents($filename, $use_include_path, $context, $offset, $maxlen);
+ } elseif ($offset !== 0) {
+ $result = \file_get_contents($filename, $use_include_path, $context, $offset);
+ } elseif ($context !== null) {
+ $result = \file_get_contents($filename, $use_include_path, $context);
+ } else {
+ $result = \file_get_contents($filename, $use_include_path);
+ }
+ if ($result === false) {
+ throw FilesystemException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * 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 $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) {
+ $result = \file_put_contents($filename, $data, $flags, $context);
+ } else {
+ $result = \file_put_contents($filename, $data, $flags);
+ }
+ if ($result === false) {
+ throw FilesystemException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * 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) {
+ $result = \file($filename, $flags, $context);
+ } else {
+ $result = \file($filename, $flags);
+ }
+ if ($result === false) {
+ throw FilesystemException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ *
+ *
+ * @param string $filename Path to the file.
+ * @return int Returns the time the file was last accessed.
+ * The time is returned as a Unix timestamp.
+ * @throws FilesystemException
+ *
+ */
+function fileatime(string $filename): int
+{
+ error_clear_last();
+ $result = \fileatime($filename);
+ if ($result === false) {
+ throw FilesystemException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Gets the inode change time of a file.
+ *
+ * @param string $filename Path to the file.
+ * @return int Returns the time the file was last changed.
+ * The time is returned as a Unix timestamp.
+ * @throws FilesystemException
+ *
+ */
+function filectime(string $filename): int
+{
+ error_clear_last();
+ $result = \filectime($filename);
+ if ($result === false) {
+ throw FilesystemException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Gets the file inode.
+ *
+ * @param string $filename Path to the file.
+ * @return int Returns the inode number of the file.
+ * @throws FilesystemException
+ *
+ */
+function fileinode(string $filename): int
+{
+ error_clear_last();
+ $result = \fileinode($filename);
+ if ($result === false) {
+ throw FilesystemException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * This function returns the time when the data blocks of a file were being
+ * written to, that is, the time when the content of the file was changed.
+ *
+ * @param string $filename Path to the file.
+ * @return int Returns the time the file was last modified.
+ * The time is returned as a Unix timestamp, which is
+ * suitable for the date function.
+ * @throws FilesystemException
+ *
+ */
+function filemtime(string $filename): int
+{
+ error_clear_last();
+ $result = \filemtime($filename);
+ if ($result === false) {
+ throw FilesystemException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Gets the file owner.
+ *
+ * @param string $filename Path to the file.
+ * @return int Returns the user ID of the owner of the file.
+ * The user ID is returned in numerical format, use
+ * posix_getpwuid to resolve it to a username.
+ * @throws FilesystemException
+ *
+ */
+function fileowner(string $filename): int
+{
+ error_clear_last();
+ $result = \fileowner($filename);
+ if ($result === false) {
+ throw FilesystemException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * 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();
+ $result = \filesize($filename);
+ if ($result === false) {
+ throw FilesystemException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * 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).
+ *
+ * On versions of PHP before 5.3.2, the lock is released also by
+ * fclose (which is also called automatically when script
+ * finished).
+ *
+ * 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 $handle 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 $wouldblock The optional third argument is set to 1 if the lock would block
+ * (EWOULDBLOCK errno condition).
+ * @throws FilesystemException
+ *
+ */
+function flock($handle, int $operation, ?int &$wouldblock = null): void
+{
+ error_clear_last();
+ $result = \flock($handle, $operation, $wouldblock);
+ if ($result === 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; place the file pointer at
+ * the beginning of the file and truncate the file to zero
+ * length. If the file does not exist, attempt to create it.
+ *
+ *
+ *
+ * 'a'
+ *
+ * Open for writing only; place the file pointer at the end of
+ * the file. If the file does not exist, attempt to create it.
+ * In this mode, fseek has no effect, writes are always appended.
+ *
+ *
+ *
+ * 'a+'
+ *
+ * Open for reading and writing; place the file pointer at
+ * the end of the file. If the file does not exist, attempt to
+ * create it. In this mode, fseek only affects
+ * the reading position, writes are always appended.
+ *
+ *
+ *
+ * 'x'
+ *
+ * Create and open for writing only; place the file pointer at the
+ * beginning of the file. If the file already exists, the
+ * fopen call will fail by returning FALSE and
+ * generating an error of level E_WARNING. If
+ * the file does not exist, attempt to create it. This is equivalent
+ * to specifying O_EXCL|O_CREAT flags for the
+ * underlying open(2) system call.
+ *
+ *
+ *
+ * 'x+'
+ *
+ * Create and open for reading and writing; otherwise it has the
+ * same behavior as 'x'.
+ *
+ *
+ *
+ * 'c'
+ *
+ * Open the file for writing only. If the file does not exist, it is
+ * created. If it exists, it is neither truncated (as opposed to
+ * 'w'), nor the call to this function fails (as is
+ * the case with 'x'). The file pointer is
+ * positioned on the beginning of the file. This may be useful if it's
+ * desired to get an advisory lock (see flock)
+ * before attempting to modify the file, as using
+ * 'w' could truncate the file before the lock
+ * was obtained (if truncation is desired,
+ * ftruncate can be used after the lock is
+ * requested).
+ *
+ *
+ *
+ * 'c+'
+ *
+ * Open the file for reading and writing; otherwise it has the same
+ * behavior as 'c'.
+ *
+ *
+ *
+ * 'e'
+ *
+ * Set close-on-exec flag on the opened file descriptor. Only
+ * available in PHP compiled on POSIX.1-2008 conform systems.
+ *
+ *
+ *
+ *
+ *
+ *
+ * Different operating system families have different line-ending
+ * conventions. When you write a text file and want to insert a line
+ * break, you need to use the correct line-ending character(s) for your
+ * operating system. Unix based systems use \n as the
+ * line ending character, Windows based systems use \r\n
+ * as the line ending characters and Macintosh based systems (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 $context
+ * @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) {
+ $result = \fopen($filename, $mode, $use_include_path, $context);
+ } else {
+ $result = \fopen($filename, $mode, $use_include_path);
+ }
+ if ($result === false) {
+ throw FilesystemException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * fputcsv formats a line (passed as a
+ * fields array) as CSV and writes it (terminated by a
+ * newline) to the specified file handle.
+ *
+ * @param resource $handle The file pointer must be valid, and must point to
+ * a file successfully opened by fopen or
+ * fsockopen (and not yet closed by
+ * fclose).
+ * @param array $fields An array of strings.
+ * @param string $delimiter The optional delimiter parameter sets the field
+ * delimiter (one character only).
+ * @param string $enclosure The optional enclosure parameter sets the field
+ * enclosure (one character only).
+ * @param string $escape_char The optional escape_char parameter sets the
+ * escape character (at most one character).
+ * An empty string ("") disables the proprietary escape mechanism.
+ * @return int Returns the length of the written string.
+ * @throws FilesystemException
+ *
+ */
+function fputcsv($handle, array $fields, string $delimiter = ",", string $enclosure = '"', string $escape_char = "\\"): int
+{
+ error_clear_last();
+ $result = \fputcsv($handle, $fields, $delimiter, $enclosure, $escape_char);
+ if ($result === false) {
+ throw FilesystemException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * fread reads up to
+ * length bytes from the file pointer
+ * referenced by handle. Reading stops as soon as one
+ * of the following conditions is met:
+ *
+ *
+ *
+ * length bytes have been read
+ *
+ *
+ *
+ *
+ * EOF (end of file) is reached
+ *
+ *
+ *
+ *
+ * a packet becomes available or the
+ * socket timeout occurs (for network streams)
+ *
+ *
+ *
+ *
+ * if the stream is read buffered and it does not represent a plain file, at
+ * most one read of up to a number of bytes equal to the chunk size (usually
+ * 8192) is made; depending on the previously buffered data, the size of the
+ * returned data may be larger than the chunk size.
+ *
+ *
+ *
+ *
+ * @param resource $handle A file system pointer resource
+ * that is typically created using fopen.
+ * @param int $length Up to length number of bytes read.
+ * @return string Returns the read string.
+ * @throws FilesystemException
+ *
+ */
+function fread($handle, int $length): string
+{
+ error_clear_last();
+ $result = \fread($handle, $length);
+ if ($result === false) {
+ throw FilesystemException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Takes the filepointer, handle, and truncates the file to
+ * length, size.
+ *
+ * @param resource $handle The file pointer.
+ *
+ * The handle must be open for writing.
+ * @param int $size The size to truncate to.
+ *
+ * If size is larger than the file then the file
+ * is extended with null bytes.
+ *
+ * If size is smaller than the file then the file
+ * is truncated to that size.
+ * @throws FilesystemException
+ *
+ */
+function ftruncate($handle, int $size): void
+{
+ error_clear_last();
+ $result = \ftruncate($handle, $size);
+ if ($result === 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.
+ *
+ * Note that if the length argument is given,
+ * then the magic_quotes_runtime
+ * configuration option will be ignored and no slashes will be
+ * stripped from string.
+ * @return int
+ * @throws FilesystemException
+ *
+ */
+function fwrite($handle, string $string, int $length = null): int
+{
+ error_clear_last();
+ if ($length !== null) {
+ $result = \fwrite($handle, $string, $length);
+ } else {
+ $result = \fwrite($handle, $string);
+ }
+ if ($result === false) {
+ throw FilesystemException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * The glob function searches for all the pathnames
+ * matching pattern according to the rules used by
+ * the libc glob() function, which is similar to the rules used by common
+ * shells.
+ *
+ * @param string $pattern The pattern. No tilde expansion or parameter substitution is done.
+ *
+ * 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.
+ *
+ *
+ *
+ * @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();
+ $result = \glob($pattern, $flags);
+ if ($result === false) {
+ throw FilesystemException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * 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();
+ $result = \lchgrp($filename, $group);
+ if ($result === 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();
+ $result = \lchown($filename, $user);
+ if ($result === 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();
+ $result = \link($target, $link);
+ if ($result === false) {
+ throw FilesystemException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Attempts to create the directory specified by pathname.
+ *
+ * @param string $pathname The directory path.
+ * @param int $mode The mode is 0777 by default, which means the widest possible
+ * access. For more information on modes, read the details
+ * on the chmod page.
+ *
+ * mode is ignored on Windows.
+ *
+ * Note that you probably want to specify the mode as an octal number,
+ * which means it should have a leading zero. The mode is also modified
+ * by the current umask, which you can change using
+ * umask.
+ * @param bool $recursive Allows the creation of nested directories specified in the
+ * pathname.
+ * @param resource $context
+ * @throws FilesystemException
+ *
+ */
+function mkdir(string $pathname, int $mode = 0777, bool $recursive = false, $context = null): void
+{
+ error_clear_last();
+ if ($context !== null) {
+ $result = \mkdir($pathname, $mode, $recursive, $context);
+ } else {
+ $result = \mkdir($pathname, $mode, $recursive);
+ }
+ if ($result === false) {
+ throw 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();
+ $result = \parse_ini_file($filename, $process_sections, $scanner_mode);
+ if ($result === false) {
+ throw FilesystemException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * parse_ini_string returns the settings in string
+ * ini in an associative array.
+ *
+ * The structure of the ini string is the same as the php.ini's.
+ *
+ * @param string $ini 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, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array
+{
+ error_clear_last();
+ $result = \parse_ini_string($ini, $process_sections, $scanner_mode);
+ if ($result === false) {
+ throw FilesystemException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Reads a file and writes it to the output buffer.
+ *
+ * @param string $filename The filename being read.
+ * @param bool $use_include_path You can use the optional second parameter and set it to TRUE, if
+ * you want to search for the file in the include_path, too.
+ * @param resource $context A context stream resource.
+ * @return int Returns the number of bytes read from the file on success
+ * @throws FilesystemException
+ *
+ */
+function readfile(string $filename, bool $use_include_path = false, $context = null): int
+{
+ error_clear_last();
+ if ($context !== null) {
+ $result = \readfile($filename, $use_include_path, $context);
+ } else {
+ $result = \readfile($filename, $use_include_path);
+ }
+ if ($result === false) {
+ throw FilesystemException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * readlink does the same as the readlink C function.
+ *
+ * @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();
+ $result = \readlink($path);
+ if ($result === false) {
+ throw FilesystemException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * 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();
+ $result = \realpath($path);
+ if ($result === false) {
+ throw FilesystemException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Attempts to rename oldname to
+ * newname, moving it between directories if necessary.
+ * If renaming a file and newname exists,
+ * it will be overwritten. If renaming a directory and
+ * newname exists,
+ * this function will emit a warning.
+ *
+ * @param string $oldname The old name.
+ *
+ * The wrapper used in oldname
+ * must match the wrapper used in
+ * newname.
+ * @param string $newname The new name.
+ * @param resource $context
+ * @throws FilesystemException
+ *
+ */
+function rename(string $oldname, string $newname, $context = null): void
+{
+ error_clear_last();
+ if ($context !== null) {
+ $result = \rename($oldname, $newname, $context);
+ } else {
+ $result = \rename($oldname, $newname);
+ }
+ if ($result === false) {
+ throw FilesystemException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the file position indicator for handle
+ * to the beginning of the file stream.
+ *
+ * @param resource $handle The file pointer must be valid, and must point to a file
+ * successfully opened by fopen.
+ * @throws FilesystemException
+ *
+ */
+function rewind($handle): void
+{
+ error_clear_last();
+ $result = \rewind($handle);
+ if ($result === false) {
+ throw FilesystemException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Attempts to remove the directory named by dirname.
+ * The directory must be empty, and the relevant permissions must permit this.
+ * A E_WARNING level error will be generated on failure.
+ *
+ * @param string $dirname Path to the directory.
+ * @param resource $context
+ * @throws FilesystemException
+ *
+ */
+function rmdir(string $dirname, $context = null): void
+{
+ error_clear_last();
+ if ($context !== null) {
+ $result = \rmdir($dirname, $context);
+ } else {
+ $result = \rmdir($dirname);
+ }
+ if ($result === 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();
+ $result = \symlink($target, $link);
+ if ($result === 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 $dir 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 $dir, string $prefix): string
+{
+ error_clear_last();
+ $result = \tempnam($dir, $prefix);
+ if ($result === false) {
+ throw FilesystemException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * 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 Returns a file handle, similar to the one returned by
+ * fopen, for the new file.
+ * @throws FilesystemException
+ *
+ */
+function tmpfile()
+{
+ error_clear_last();
+ $result = \tmpfile();
+ if ($result === false) {
+ throw FilesystemException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Attempts to set the access and modification times of the file named in the
+ * filename parameter to the value given in
+ * time.
+ * Note that the access time is always modified, regardless of the number
+ * of parameters.
+ *
+ * If the file does not exist, it will be created.
+ *
+ * @param string $filename The name of the file being touched.
+ * @param int $time The touch time. If time is not supplied,
+ * the current system time is used.
+ * @param int $atime If present, the access time of the given filename is set to
+ * the value of atime. Otherwise, it is set to
+ * the value passed to the time parameter.
+ * If neither are present, the current system time is used.
+ * @throws FilesystemException
+ *
+ */
+function touch(string $filename, int $time = null, int $atime = null): void
+{
+ error_clear_last();
+ if ($atime !== null) {
+ $result = \touch($filename, $time, $atime);
+ } elseif ($time !== null) {
+ $result = \touch($filename, $time);
+ } else {
+ $result = \touch($filename);
+ }
+ if ($result === 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.
+ * @param resource $context
+ * @throws FilesystemException
+ *
+ */
+function unlink(string $filename, $context = null): void
+{
+ error_clear_last();
+ if ($context !== null) {
+ $result = \unlink($filename, $context);
+ } else {
+ $result = \unlink($filename);
+ }
+ if ($result === false) {
+ throw FilesystemException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/filter.php b/vendor/thecodingmachine/safe/generated/filter.php
new file mode 100644
index 000000000..2d836c6c9
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/filter.php
@@ -0,0 +1,93 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\FilterException;
+
+/**
+ * This function is useful for retrieving many values without
+ * repetitively calling filter_input.
+ *
+ * @param int $type One of INPUT_GET, INPUT_POST,
+ * INPUT_COOKIE, INPUT_SERVER, or
+ * INPUT_ENV.
+ * @param int|array $definition An array defining the arguments. A valid key is a string
+ * containing a variable name and a valid value is either a filter type, or an array
+ * optionally specifying the filter, flags and options. If the value is an
+ * array, valid keys are filter which specifies the
+ * filter type,
+ * flags which specifies any flags that apply to the
+ * filter, and options which specifies any options that
+ * apply to the filter. See the example below for a better understanding.
+ *
+ * This parameter can be also an integer holding a filter constant. Then all values in the
+ * input array are filtered by this filter.
+ * @param bool $add_empty Add missing keys as NULL to the return value.
+ * @return mixed An array containing the values of the requested variables on success.
+ * If the input array designated by type is not populated,
+ * the function returns NULL if the FILTER_NULL_ON_FAILURE
+ * flag is not given, or FALSE otherwise. For other failures, FALSE is returned.
+ *
+ * An array value will be FALSE if the filter fails, or NULL if
+ * the variable is not set. Or if the flag FILTER_NULL_ON_FAILURE
+ * is used, it returns FALSE if the variable is not set and NULL if the filter
+ * fails. If the add_empty parameter is FALSE, no array
+ * element will be added for unset variables.
+ * @throws FilterException
+ *
+ */
+function filter_input_array(int $type, $definition = null, bool $add_empty = true)
+{
+ error_clear_last();
+ if ($add_empty !== true) {
+ $result = \filter_input_array($type, $definition, $add_empty);
+ } elseif ($definition !== null) {
+ $result = \filter_input_array($type, $definition);
+ } else {
+ $result = \filter_input_array($type);
+ }
+ if ($result === false) {
+ throw FilterException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * This function is useful for retrieving many values without
+ * repetitively calling filter_var.
+ *
+ * @param array $data An array with string keys containing the data to filter.
+ * @param mixed $definition An array defining the arguments. A valid key is a string
+ * containing a variable name and a valid value is either a
+ * filter type, or an
+ * array optionally specifying the filter, flags and options.
+ * If the value is an array, valid keys are filter
+ * which specifies the filter type,
+ * flags which specifies any flags that apply to the
+ * filter, and options which specifies any options that
+ * apply to the filter. See the example below for a better understanding.
+ *
+ * This parameter can be also an integer holding a filter constant. Then all values in the
+ * input array are filtered by this filter.
+ * @param bool $add_empty Add missing keys as NULL to the return value.
+ * @return mixed An array containing the values of the requested variables on success. An array value will be FALSE if the filter fails, or NULL if
+ * the variable is not set.
+ * @throws FilterException
+ *
+ */
+function filter_var_array(array $data, $definition = null, bool $add_empty = true)
+{
+ error_clear_last();
+ if ($add_empty !== true) {
+ $result = \filter_var_array($data, $definition, $add_empty);
+ } elseif ($definition !== null) {
+ $result = \filter_var_array($data, $definition);
+ } else {
+ $result = \filter_var_array($data);
+ }
+ if ($result === false) {
+ throw FilterException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/fpm.php b/vendor/thecodingmachine/safe/generated/fpm.php
new file mode 100644
index 000000000..08b394107
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/fpm.php
@@ -0,0 +1,22 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\FpmException;
+
+/**
+ * This function flushes all response data to the client and finishes the
+ * request. This allows for time consuming tasks to be performed without
+ * leaving the connection to the client open.
+ *
+ * @throws FpmException
+ *
+ */
+function fastcgi_finish_request(): void
+{
+ error_clear_last();
+ $result = \fastcgi_finish_request();
+ if ($result === false) {
+ throw FpmException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/ftp.php b/vendor/thecodingmachine/safe/generated/ftp.php
new file mode 100644
index 000000000..174882657
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/ftp.php
@@ -0,0 +1,496 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\FtpException;
+
+/**
+ * Sends an ALLO command to the remote FTP server to
+ * allocate space for a file to be uploaded.
+ *
+ * @param resource $ftp_stream The link identifier of the FTP connection.
+ * @param int $filesize The number of bytes to allocate.
+ * @param string $result A textual representation of the servers response will be returned by
+ * reference in result if a variable is provided.
+ * @throws FtpException
+ *
+ */
+function ftp_alloc($ftp_stream, int $filesize, string &$result = null): void
+{
+ error_clear_last();
+ $result = \ftp_alloc($ftp_stream, $filesize, $result);
+ if ($result === false) {
+ throw FtpException::createFromPhpError();
+ }
+}
+
+
+/**
+ *
+ *
+ * @param resource $ftp
+ * @param string $remote_file
+ * @param string $local_file
+ * @param int $mode
+ * @throws FtpException
+ *
+ */
+function ftp_append($ftp, string $remote_file, string $local_file, int $mode = FTP_BINARY): void
+{
+ error_clear_last();
+ $result = \ftp_append($ftp, $remote_file, $local_file, $mode);
+ if ($result === false) {
+ throw FtpException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Changes to the parent directory.
+ *
+ * @param resource $ftp_stream The link identifier of the FTP connection.
+ * @throws FtpException
+ *
+ */
+function ftp_cdup($ftp_stream): void
+{
+ error_clear_last();
+ $result = \ftp_cdup($ftp_stream);
+ if ($result === false) {
+ throw FtpException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Changes the current directory to the specified one.
+ *
+ * @param resource $ftp_stream The link identifier of the FTP connection.
+ * @param string $directory The target directory.
+ * @throws FtpException
+ *
+ */
+function ftp_chdir($ftp_stream, string $directory): void
+{
+ error_clear_last();
+ $result = \ftp_chdir($ftp_stream, $directory);
+ if ($result === false) {
+ throw FtpException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the permissions on the specified remote file to
+ * mode.
+ *
+ * @param resource $ftp_stream The link identifier of the FTP connection.
+ * @param int $mode The new permissions, given as an octal value.
+ * @param string $filename The remote file.
+ * @return int Returns the new file permissions on success.
+ * @throws FtpException
+ *
+ */
+function ftp_chmod($ftp_stream, int $mode, string $filename): int
+{
+ error_clear_last();
+ $result = \ftp_chmod($ftp_stream, $mode, $filename);
+ if ($result === false) {
+ throw FtpException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * ftp_close closes the given link identifier
+ * and releases the resource.
+ *
+ * @param resource $ftp_stream The link identifier of the FTP connection.
+ * @throws FtpException
+ *
+ */
+function ftp_close($ftp_stream): void
+{
+ error_clear_last();
+ $result = \ftp_close($ftp_stream);
+ if ($result === false) {
+ throw FtpException::createFromPhpError();
+ }
+}
+
+
+/**
+ * ftp_connect opens an FTP connection to the
+ * specified host.
+ *
+ * @param string $host The FTP server address. This parameter shouldn't have any trailing
+ * slashes and shouldn't be prefixed with ftp://.
+ * @param int $port This parameter specifies an alternate port to connect to. If it is
+ * omitted or set to zero, then the default FTP port, 21, will be used.
+ * @param int $timeout This parameter specifies the timeout in seconds for all subsequent network operations.
+ * If omitted, the default value is 90 seconds. The timeout can be changed and
+ * queried at any time with ftp_set_option and
+ * ftp_get_option.
+ * @return resource Returns a FTP stream on success.
+ * @throws FtpException
+ *
+ */
+function ftp_connect(string $host, int $port = 21, int $timeout = 90)
+{
+ error_clear_last();
+ $result = \ftp_connect($host, $port, $timeout);
+ if ($result === false) {
+ throw FtpException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * ftp_delete deletes the file specified by
+ * path from the FTP server.
+ *
+ * @param resource $ftp_stream The link identifier of the FTP connection.
+ * @param string $path The file to delete.
+ * @throws FtpException
+ *
+ */
+function ftp_delete($ftp_stream, string $path): void
+{
+ error_clear_last();
+ $result = \ftp_delete($ftp_stream, $path);
+ if ($result === false) {
+ throw FtpException::createFromPhpError();
+ }
+}
+
+
+/**
+ * ftp_fget retrieves remote_file
+ * from the FTP server, and writes it to the given file pointer.
+ *
+ * @param resource $ftp_stream The link identifier of the FTP connection.
+ * @param resource $handle An open file pointer in which we store the data.
+ * @param string $remote_file The remote file path.
+ * @param int $mode The transfer mode. Must be either FTP_ASCII or
+ * FTP_BINARY.
+ * @param int $resumepos The position in the remote file to start downloading from.
+ * @throws FtpException
+ *
+ */
+function ftp_fget($ftp_stream, $handle, string $remote_file, int $mode = FTP_BINARY, int $resumepos = 0): void
+{
+ error_clear_last();
+ $result = \ftp_fget($ftp_stream, $handle, $remote_file, $mode, $resumepos);
+ if ($result === false) {
+ throw FtpException::createFromPhpError();
+ }
+}
+
+
+/**
+ * ftp_fput uploads the data from a file pointer
+ * to a remote file on the FTP server.
+ *
+ * @param resource $ftp_stream The link identifier of the FTP connection.
+ * @param string $remote_file The remote file path.
+ * @param resource $handle An open file pointer on the local file. Reading stops at end of file.
+ * @param int $mode The transfer mode. Must be either FTP_ASCII or
+ * FTP_BINARY.
+ * @param int $startpos The position in the remote file to start uploading to.
+ * @throws FtpException
+ *
+ */
+function ftp_fput($ftp_stream, string $remote_file, $handle, int $mode = FTP_BINARY, int $startpos = 0): void
+{
+ error_clear_last();
+ $result = \ftp_fput($ftp_stream, $remote_file, $handle, $mode, $startpos);
+ if ($result === false) {
+ throw FtpException::createFromPhpError();
+ }
+}
+
+
+/**
+ * ftp_get retrieves a remote file from the FTP server,
+ * and saves it into a local file.
+ *
+ * @param resource $ftp_stream The link identifier of the FTP connection.
+ * @param string $local_file The local file path (will be overwritten if the file already exists).
+ * @param string $remote_file The remote file path.
+ * @param int $mode The transfer mode. Must be either FTP_ASCII or
+ * FTP_BINARY.
+ * @param int $resumepos The position in the remote file to start downloading from.
+ * @throws FtpException
+ *
+ */
+function ftp_get($ftp_stream, string $local_file, string $remote_file, int $mode = FTP_BINARY, int $resumepos = 0): void
+{
+ error_clear_last();
+ $result = \ftp_get($ftp_stream, $local_file, $remote_file, $mode, $resumepos);
+ if ($result === false) {
+ throw FtpException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Logs in to the given FTP stream.
+ *
+ * @param resource $ftp_stream The link identifier of the FTP connection.
+ * @param string $username The username (USER).
+ * @param string $password The password (PASS).
+ * @throws FtpException
+ *
+ */
+function ftp_login($ftp_stream, string $username, string $password): void
+{
+ error_clear_last();
+ $result = \ftp_login($ftp_stream, $username, $password);
+ if ($result === false) {
+ throw FtpException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Creates the specified directory on the FTP server.
+ *
+ * @param resource $ftp_stream The link identifier of the FTP connection.
+ * @param string $directory The name of the directory that will be created.
+ * @return string Returns the newly created directory name on success.
+ * @throws FtpException
+ *
+ */
+function ftp_mkdir($ftp_stream, string $directory): string
+{
+ error_clear_last();
+ $result = \ftp_mkdir($ftp_stream, $directory);
+ if ($result === false) {
+ throw FtpException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ *
+ *
+ * @param resource $ftp_stream The link identifier of the FTP connection.
+ * @param string $directory The directory to be listed.
+ * @return array Returns an array of arrays with file infos from the specified directory on success.
+ * @throws FtpException
+ *
+ */
+function ftp_mlsd($ftp_stream, string $directory): array
+{
+ error_clear_last();
+ $result = \ftp_mlsd($ftp_stream, $directory);
+ if ($result === false) {
+ throw FtpException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ *
+ *
+ * @param resource $ftp_stream The link identifier of the FTP connection.
+ * @param string $directory The directory to be listed. This parameter can also include arguments, eg.
+ * ftp_nlist($conn_id, "-la /your/dir");
+ * Note that this parameter isn't escaped so there may be some issues with
+ * filenames containing spaces and other characters.
+ * @return array Returns an array of filenames from the specified directory on success.
+ * @throws FtpException
+ *
+ */
+function ftp_nlist($ftp_stream, string $directory): array
+{
+ error_clear_last();
+ $result = \ftp_nlist($ftp_stream, $directory);
+ if ($result === false) {
+ throw FtpException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * ftp_pasv turns on or off passive mode. In
+ * passive mode, data connections are initiated by the client,
+ * rather than by the server.
+ * It may be needed if the client is behind firewall.
+ *
+ * Please note that ftp_pasv can only be called after a
+ * successful login or otherwise it will fail.
+ *
+ * @param resource $ftp_stream The link identifier of the FTP connection.
+ * @param bool $pasv If TRUE, the passive mode is turned on, else it's turned off.
+ * @throws FtpException
+ *
+ */
+function ftp_pasv($ftp_stream, bool $pasv): void
+{
+ error_clear_last();
+ $result = \ftp_pasv($ftp_stream, $pasv);
+ if ($result === false) {
+ throw FtpException::createFromPhpError();
+ }
+}
+
+
+/**
+ * ftp_put stores a local file on the FTP server.
+ *
+ * @param resource $ftp_stream The link identifier of the FTP connection.
+ * @param string $remote_file The remote file path.
+ * @param string $local_file The local file path.
+ * @param int $mode The transfer mode. Must be either FTP_ASCII or
+ * FTP_BINARY.
+ * @param int $startpos The position in the remote file to start uploading to.
+ * @throws FtpException
+ *
+ */
+function ftp_put($ftp_stream, string $remote_file, string $local_file, int $mode = FTP_BINARY, int $startpos = 0): void
+{
+ error_clear_last();
+ $result = \ftp_put($ftp_stream, $remote_file, $local_file, $mode, $startpos);
+ if ($result === false) {
+ throw FtpException::createFromPhpError();
+ }
+}
+
+
+/**
+ *
+ *
+ * @param resource $ftp_stream The link identifier of the FTP connection.
+ * @return string Returns the current directory name.
+ * @throws FtpException
+ *
+ */
+function ftp_pwd($ftp_stream): string
+{
+ error_clear_last();
+ $result = \ftp_pwd($ftp_stream);
+ if ($result === false) {
+ throw FtpException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * ftp_rename renames a file or a directory on the FTP
+ * server.
+ *
+ * @param resource $ftp_stream The link identifier of the FTP connection.
+ * @param string $oldname The old file/directory name.
+ * @param string $newname The new name.
+ * @throws FtpException
+ *
+ */
+function ftp_rename($ftp_stream, string $oldname, string $newname): void
+{
+ error_clear_last();
+ $result = \ftp_rename($ftp_stream, $oldname, $newname);
+ if ($result === false) {
+ throw FtpException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Removes the specified directory on the FTP server.
+ *
+ * @param resource $ftp_stream The link identifier of the FTP connection.
+ * @param string $directory The directory to delete. This must be either an absolute or relative
+ * path to an empty directory.
+ * @throws FtpException
+ *
+ */
+function ftp_rmdir($ftp_stream, string $directory): void
+{
+ error_clear_last();
+ $result = \ftp_rmdir($ftp_stream, $directory);
+ if ($result === false) {
+ throw FtpException::createFromPhpError();
+ }
+}
+
+
+/**
+ * ftp_site sends the given SITE
+ * command to the FTP server.
+ *
+ * SITE commands are not standardized, and vary from server
+ * to server. They are useful for handling such things as file permissions and
+ * group membership.
+ *
+ * @param resource $ftp_stream The link identifier of the FTP connection.
+ * @param string $command The SITE command. Note that this parameter isn't escaped so there may
+ * be some issues with filenames containing spaces and other characters.
+ * @throws FtpException
+ *
+ */
+function ftp_site($ftp_stream, string $command): void
+{
+ error_clear_last();
+ $result = \ftp_site($ftp_stream, $command);
+ if ($result === false) {
+ throw FtpException::createFromPhpError();
+ }
+}
+
+
+/**
+ * ftp_ssl_connect opens an explicit SSL-FTP connection to the
+ * specified host. That implies that
+ * ftp_ssl_connect will succeed even if the server is not
+ * configured for SSL-FTP, or its certificate is invalid. Only when
+ * ftp_login is called, the client will send the
+ * appropriate AUTH FTP command, so ftp_login will fail in
+ * the mentioned cases.
+ *
+ * @param string $host The FTP server address. This parameter shouldn't have any trailing
+ * slashes and shouldn't be prefixed with ftp://.
+ * @param int $port This parameter specifies an alternate port to connect to. If it is
+ * omitted or set to zero, then the default FTP port, 21, will be used.
+ * @param int $timeout This parameter specifies the timeout for all subsequent network operations.
+ * If omitted, the default value is 90 seconds. The timeout can be changed and
+ * queried at any time with ftp_set_option and
+ * ftp_get_option.
+ * @return resource Returns a SSL-FTP stream on success.
+ * @throws FtpException
+ *
+ */
+function ftp_ssl_connect(string $host, int $port = 21, int $timeout = 90)
+{
+ error_clear_last();
+ $result = \ftp_ssl_connect($host, $port, $timeout);
+ if ($result === false) {
+ throw FtpException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Returns the system type identifier of the remote FTP server.
+ *
+ * @param resource $ftp_stream The link identifier of the FTP connection.
+ * @return string Returns the remote system type.
+ * @throws FtpException
+ *
+ */
+function ftp_systype($ftp_stream): string
+{
+ error_clear_last();
+ $result = \ftp_systype($ftp_stream);
+ if ($result === false) {
+ throw FtpException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/funchand.php b/vendor/thecodingmachine/safe/generated/funchand.php
new file mode 100644
index 000000000..64654526e
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/funchand.php
@@ -0,0 +1,47 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\FunchandException;
+
+/**
+ * Creates an anonymous function from the parameters passed, and
+ * returns a unique name for it.
+ *
+ * @param string $args The function arguments.
+ * @param string $code The function code.
+ * @return string Returns a unique function name as a string.
+ * @throws FunchandException
+ *
+ */
+function create_function(string $args, string $code): string
+{
+ error_clear_last();
+ $result = \create_function($args, $code);
+ if ($result === false) {
+ throw FunchandException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ *
+ *
+ * @param callable(): void $function The function to register.
+ * @param mixed $params
+ * @throws FunchandException
+ *
+ */
+function register_tick_function(callable $function, ...$params): void
+{
+ error_clear_last();
+ if ($params !== []) {
+ $result = \register_tick_function($function, ...$params);
+ } else {
+ $result = \register_tick_function($function);
+ }
+ if ($result === false) {
+ throw FunchandException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/functionsList.php b/vendor/thecodingmachine/safe/generated/functionsList.php
new file mode 100644
index 000000000..a43e7efa6
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/functionsList.php
@@ -0,0 +1,1070 @@
+<?php
+
+return [
+ 'apache_getenv',
+ 'apache_get_version',
+ 'apache_request_headers',
+ 'apache_reset_timeout',
+ 'apache_response_headers',
+ 'apache_setenv',
+ 'apcu_cache_info',
+ 'apcu_cas',
+ 'apcu_dec',
+ 'apcu_fetch',
+ 'apcu_inc',
+ 'apcu_sma_info',
+ 'apc_fetch',
+ 'array_combine',
+ 'array_flip',
+ 'array_replace',
+ 'array_replace_recursive',
+ 'array_walk_recursive',
+ 'arsort',
+ 'asort',
+ 'base64_decode',
+ 'bzclose',
+ 'bzflush',
+ 'bzread',
+ 'bzwrite',
+ 'chdir',
+ 'chgrp',
+ 'chmod',
+ 'chown',
+ 'chroot',
+ 'class_alias',
+ 'class_implements',
+ 'class_parents',
+ 'class_uses',
+ 'cli_set_process_title',
+ 'closelog',
+ 'com_event_sink',
+ 'com_load_typelib',
+ 'com_print_typeinfo',
+ 'convert_uudecode',
+ 'convert_uuencode',
+ 'copy',
+ 'create_function',
+ 'cubrid_free_result',
+ 'cubrid_get_charset',
+ 'cubrid_get_client_info',
+ 'cubrid_get_db_parameter',
+ 'cubrid_get_server_info',
+ 'cubrid_insert_id',
+ 'cubrid_lob2_new',
+ 'cubrid_lob2_size',
+ 'cubrid_lob2_size64',
+ 'cubrid_lob2_tell',
+ 'cubrid_lob2_tell64',
+ 'cubrid_set_db_parameter',
+ 'curl_escape',
+ 'curl_exec',
+ 'curl_getinfo',
+ 'curl_init',
+ 'curl_multi_errno',
+ 'curl_multi_info_read',
+ 'curl_multi_init',
+ 'curl_setopt',
+ 'curl_share_errno',
+ 'curl_share_setopt',
+ 'curl_unescape',
+ 'date',
+ 'date_parse',
+ 'date_parse_from_format',
+ 'date_sunrise',
+ 'date_sunset',
+ 'date_sun_info',
+ 'db2_autocommit',
+ 'db2_bind_param',
+ 'db2_client_info',
+ 'db2_close',
+ 'db2_commit',
+ 'db2_execute',
+ 'db2_free_result',
+ 'db2_free_stmt',
+ 'db2_get_option',
+ 'db2_pclose',
+ 'db2_rollback',
+ 'db2_server_info',
+ 'db2_set_option',
+ 'define',
+ 'deflate_add',
+ 'deflate_init',
+ 'disk_free_space',
+ 'disk_total_space',
+ 'dl',
+ 'dns_get_record',
+ 'eio_busy',
+ 'eio_chmod',
+ 'eio_chown',
+ 'eio_close',
+ 'eio_custom',
+ 'eio_dup2',
+ 'eio_event_loop',
+ 'eio_fallocate',
+ 'eio_fchmod',
+ 'eio_fdatasync',
+ 'eio_fstat',
+ 'eio_fstatvfs',
+ 'eio_fsync',
+ 'eio_ftruncate',
+ 'eio_futime',
+ 'eio_grp',
+ 'eio_lstat',
+ 'eio_mkdir',
+ 'eio_mknod',
+ 'eio_nop',
+ 'eio_readahead',
+ 'eio_readdir',
+ 'eio_readlink',
+ 'eio_rename',
+ 'eio_rmdir',
+ 'eio_seek',
+ 'eio_sendfile',
+ 'eio_stat',
+ 'eio_statvfs',
+ 'eio_symlink',
+ 'eio_sync',
+ 'eio_syncfs',
+ 'eio_sync_file_range',
+ 'eio_truncate',
+ 'eio_unlink',
+ 'eio_utime',
+ 'eio_write',
+ 'error_log',
+ 'fastcgi_finish_request',
+ 'fbird_blob_cancel',
+ 'fclose',
+ 'fflush',
+ 'file',
+ 'fileatime',
+ 'filectime',
+ 'fileinode',
+ 'filemtime',
+ 'fileowner',
+ 'filesize',
+ 'file_get_contents',
+ 'file_put_contents',
+ 'filter_input_array',
+ 'filter_var_array',
+ 'finfo_close',
+ 'finfo_open',
+ 'flock',
+ 'fopen',
+ 'fputcsv',
+ 'fread',
+ 'fsockopen',
+ 'ftp_alloc',
+ 'ftp_append',
+ 'ftp_cdup',
+ 'ftp_chdir',
+ 'ftp_chmod',
+ 'ftp_close',
+ 'ftp_connect',
+ 'ftp_delete',
+ 'ftp_fget',
+ 'ftp_fput',
+ 'ftp_get',
+ 'ftp_login',
+ 'ftp_mkdir',
+ 'ftp_mlsd',
+ 'ftp_nlist',
+ 'ftp_pasv',
+ 'ftp_put',
+ 'ftp_pwd',
+ 'ftp_rename',
+ 'ftp_rmdir',
+ 'ftp_site',
+ 'ftp_ssl_connect',
+ 'ftp_systype',
+ 'ftruncate',
+ 'fwrite',
+ 'getallheaders',
+ 'getcwd',
+ 'gethostname',
+ 'getimagesize',
+ 'getlastmod',
+ 'getmygid',
+ 'getmyinode',
+ 'getmypid',
+ 'getmyuid',
+ 'getopt',
+ 'getprotobyname',
+ 'getprotobynumber',
+ 'get_headers',
+ 'glob',
+ 'gmdate',
+ 'gmp_binomial',
+ 'gmp_export',
+ 'gmp_import',
+ 'gmp_random_seed',
+ 'gnupg_adddecryptkey',
+ 'gnupg_addencryptkey',
+ 'gnupg_addsignkey',
+ 'gnupg_cleardecryptkeys',
+ 'gnupg_clearencryptkeys',
+ 'gnupg_clearsignkeys',
+ 'gnupg_setarmor',
+ 'gnupg_setsignmode',
+ 'gzclose',
+ 'gzcompress',
+ 'gzdecode',
+ 'gzdeflate',
+ 'gzencode',
+ 'gzgets',
+ 'gzgetss',
+ 'gzinflate',
+ 'gzpassthru',
+ 'gzrewind',
+ 'gzuncompress',
+ 'hash_hkdf',
+ 'hash_update_file',
+ 'header_register_callback',
+ 'hex2bin',
+ 'highlight_file',
+ 'highlight_string',
+ 'ibase_add_user',
+ 'ibase_backup',
+ 'ibase_blob_cancel',
+ 'ibase_blob_create',
+ 'ibase_blob_get',
+ 'ibase_close',
+ 'ibase_commit',
+ 'ibase_commit_ret',
+ 'ibase_connect',
+ 'ibase_delete_user',
+ 'ibase_drop_db',
+ 'ibase_free_event_handler',
+ 'ibase_free_query',
+ 'ibase_free_result',
+ 'ibase_maintain_db',
+ 'ibase_modify_user',
+ 'ibase_name_result',
+ 'ibase_pconnect',
+ 'ibase_restore',
+ 'ibase_rollback',
+ 'ibase_rollback_ret',
+ 'ibase_service_attach',
+ 'ibase_service_detach',
+ 'iconv',
+ 'iconv_get_encoding',
+ 'iconv_set_encoding',
+ 'image2wbmp',
+ 'imageaffine',
+ 'imageaffinematrixconcat',
+ 'imageaffinematrixget',
+ 'imagealphablending',
+ 'imageantialias',
+ 'imagearc',
+ 'imagebmp',
+ 'imagechar',
+ 'imagecharup',
+ 'imagecolorat',
+ 'imagecolordeallocate',
+ 'imagecolormatch',
+ 'imageconvolution',
+ 'imagecopy',
+ 'imagecopymerge',
+ 'imagecopymergegray',
+ 'imagecopyresampled',
+ 'imagecopyresized',
+ 'imagecreate',
+ 'imagecreatefrombmp',
+ 'imagecreatefromgd',
+ 'imagecreatefromgd2',
+ 'imagecreatefromgd2part',
+ 'imagecreatefromgif',
+ 'imagecreatefromjpeg',
+ 'imagecreatefrompng',
+ 'imagecreatefromwbmp',
+ 'imagecreatefromwebp',
+ 'imagecreatefromxbm',
+ 'imagecreatefromxpm',
+ 'imagecreatetruecolor',
+ 'imagecrop',
+ 'imagecropauto',
+ 'imagedashedline',
+ 'imagedestroy',
+ 'imageellipse',
+ 'imagefill',
+ 'imagefilledarc',
+ 'imagefilledellipse',
+ 'imagefilledpolygon',
+ 'imagefilledrectangle',
+ 'imagefilltoborder',
+ 'imagefilter',
+ 'imageflip',
+ 'imagegammacorrect',
+ 'imagegd',
+ 'imagegd2',
+ 'imagegif',
+ 'imagegrabscreen',
+ 'imagegrabwindow',
+ 'imagejpeg',
+ 'imagelayereffect',
+ 'imageline',
+ 'imageloadfont',
+ 'imageopenpolygon',
+ 'imagepng',
+ 'imagepolygon',
+ 'imagerectangle',
+ 'imagerotate',
+ 'imagesavealpha',
+ 'imagescale',
+ 'imagesetbrush',
+ 'imagesetclip',
+ 'imagesetinterpolation',
+ 'imagesetpixel',
+ 'imagesetstyle',
+ 'imagesetthickness',
+ 'imagesettile',
+ 'imagestring',
+ 'imagestringup',
+ 'imagesx',
+ 'imagesy',
+ 'imagetruecolortopalette',
+ 'imagettfbbox',
+ 'imagettftext',
+ 'imagewbmp',
+ 'imagewebp',
+ 'imagexbm',
+ 'imap_append',
+ 'imap_check',
+ 'imap_clearflag_full',
+ 'imap_close',
+ 'imap_createmailbox',
+ 'imap_deletemailbox',
+ 'imap_fetchstructure',
+ 'imap_gc',
+ 'imap_headerinfo',
+ 'imap_mail',
+ 'imap_mailboxmsginfo',
+ 'imap_mail_compose',
+ 'imap_mail_copy',
+ 'imap_mail_move',
+ 'imap_mutf7_to_utf8',
+ 'imap_num_msg',
+ 'imap_open',
+ 'imap_renamemailbox',
+ 'imap_savebody',
+ 'imap_setacl',
+ 'imap_setflag_full',
+ 'imap_set_quota',
+ 'imap_sort',
+ 'imap_subscribe',
+ 'imap_thread',
+ 'imap_timeout',
+ 'imap_undelete',
+ 'imap_unsubscribe',
+ 'imap_utf8_to_mutf7',
+ 'inet_ntop',
+ 'inflate_add',
+ 'inflate_get_read_len',
+ 'inflate_get_status',
+ 'inflate_init',
+ 'ingres_autocommit',
+ 'ingres_close',
+ 'ingres_commit',
+ 'ingres_connect',
+ 'ingres_execute',
+ 'ingres_field_name',
+ 'ingres_field_type',
+ 'ingres_free_result',
+ 'ingres_pconnect',
+ 'ingres_result_seek',
+ 'ingres_rollback',
+ 'ingres_set_environment',
+ 'ini_get',
+ 'ini_set',
+ 'inotify_init',
+ 'inotify_rm_watch',
+ 'iptcembed',
+ 'iptcparse',
+ 'jdtounix',
+ 'jpeg2wbmp',
+ 'json_decode',
+ 'json_encode',
+ 'json_last_error_msg',
+ 'krsort',
+ 'ksort',
+ 'lchgrp',
+ 'lchown',
+ 'ldap_add',
+ 'ldap_add_ext',
+ 'ldap_bind',
+ 'ldap_bind_ext',
+ 'ldap_control_paged_result',
+ 'ldap_control_paged_result_response',
+ 'ldap_count_entries',
+ 'ldap_delete',
+ 'ldap_delete_ext',
+ 'ldap_exop',
+ 'ldap_exop_passwd',
+ 'ldap_exop_whoami',
+ 'ldap_explode_dn',
+ 'ldap_first_attribute',
+ 'ldap_first_entry',
+ 'ldap_free_result',
+ 'ldap_get_attributes',
+ 'ldap_get_dn',
+ 'ldap_get_entries',
+ 'ldap_get_option',
+ 'ldap_get_values',
+ 'ldap_get_values_len',
+ 'ldap_list',
+ 'ldap_modify_batch',
+ 'ldap_mod_add',
+ 'ldap_mod_add_ext',
+ 'ldap_mod_del',
+ 'ldap_mod_del_ext',
+ 'ldap_mod_replace',
+ 'ldap_mod_replace_ext',
+ 'ldap_next_attribute',
+ 'ldap_parse_exop',
+ 'ldap_parse_result',
+ 'ldap_read',
+ 'ldap_rename',
+ 'ldap_rename_ext',
+ 'ldap_sasl_bind',
+ 'ldap_search',
+ 'ldap_set_option',
+ 'ldap_unbind',
+ 'libxml_get_last_error',
+ 'libxml_set_external_entity_loader',
+ 'link',
+ 'lzf_compress',
+ 'lzf_decompress',
+ 'mailparse_msg_extract_part_file',
+ 'mailparse_msg_free',
+ 'mailparse_msg_parse',
+ 'mailparse_msg_parse_file',
+ 'mailparse_stream_encode',
+ 'mb_chr',
+ 'mb_detect_order',
+ 'mb_encoding_aliases',
+ 'mb_eregi_replace',
+ 'mb_ereg_replace',
+ 'mb_ereg_replace_callback',
+ 'mb_ereg_search_getregs',
+ 'mb_ereg_search_init',
+ 'mb_ereg_search_regs',
+ 'mb_ereg_search_setpos',
+ 'mb_http_output',
+ 'mb_internal_encoding',
+ 'mb_ord',
+ 'mb_parse_str',
+ 'mb_regex_encoding',
+ 'mb_send_mail',
+ 'mb_split',
+ 'mb_str_split',
+ 'md5_file',
+ 'metaphone',
+ 'mime_content_type',
+ 'mkdir',
+ 'mktime',
+ 'msg_queue_exists',
+ 'msg_receive',
+ 'msg_remove_queue',
+ 'msg_send',
+ 'msg_set_queue',
+ 'msql_affected_rows',
+ 'msql_close',
+ 'msql_connect',
+ 'msql_create_db',
+ 'msql_data_seek',
+ 'msql_db_query',
+ 'msql_drop_db',
+ 'msql_field_len',
+ 'msql_field_name',
+ 'msql_field_seek',
+ 'msql_field_table',
+ 'msql_field_type',
+ 'msql_free_result',
+ 'msql_pconnect',
+ 'msql_query',
+ 'msql_select_db',
+ 'mysqli_get_cache_stats',
+ 'mysqli_get_client_stats',
+ 'mysqlnd_ms_dump_servers',
+ 'mysqlnd_ms_fabric_select_global',
+ 'mysqlnd_ms_fabric_select_shard',
+ 'mysqlnd_ms_get_last_used_connection',
+ 'mysqlnd_qc_clear_cache',
+ 'mysqlnd_qc_set_is_select',
+ 'mysqlnd_qc_set_storage_handler',
+ 'mysql_close',
+ 'mysql_connect',
+ 'mysql_create_db',
+ 'mysql_data_seek',
+ 'mysql_db_name',
+ 'mysql_db_query',
+ 'mysql_drop_db',
+ 'mysql_fetch_lengths',
+ 'mysql_field_flags',
+ 'mysql_field_len',
+ 'mysql_field_name',
+ 'mysql_field_seek',
+ 'mysql_free_result',
+ 'mysql_get_host_info',
+ 'mysql_get_proto_info',
+ 'mysql_get_server_info',
+ 'mysql_info',
+ 'mysql_list_dbs',
+ 'mysql_list_fields',
+ 'mysql_list_processes',
+ 'mysql_list_tables',
+ 'mysql_num_fields',
+ 'mysql_num_rows',
+ 'mysql_query',
+ 'mysql_real_escape_string',
+ 'mysql_result',
+ 'mysql_select_db',
+ 'mysql_set_charset',
+ 'mysql_tablename',
+ 'mysql_thread_id',
+ 'mysql_unbuffered_query',
+ 'natcasesort',
+ 'natsort',
+ 'ob_end_clean',
+ 'ob_end_flush',
+ 'oci_bind_array_by_name',
+ 'oci_bind_by_name',
+ 'oci_cancel',
+ 'oci_close',
+ 'oci_commit',
+ 'oci_connect',
+ 'oci_define_by_name',
+ 'oci_execute',
+ 'oci_fetch_all',
+ 'oci_field_name',
+ 'oci_field_precision',
+ 'oci_field_scale',
+ 'oci_field_size',
+ 'oci_field_type',
+ 'oci_field_type_raw',
+ 'oci_free_descriptor',
+ 'oci_free_statement',
+ 'oci_new_collection',
+ 'oci_new_connect',
+ 'oci_new_cursor',
+ 'oci_new_descriptor',
+ 'oci_num_fields',
+ 'oci_num_rows',
+ 'oci_parse',
+ 'oci_pconnect',
+ 'oci_result',
+ 'oci_rollback',
+ 'oci_server_version',
+ 'oci_set_action',
+ 'oci_set_call_timeout',
+ 'oci_set_client_identifier',
+ 'oci_set_client_info',
+ 'oci_set_db_operation',
+ 'oci_set_edition',
+ 'oci_set_module_name',
+ 'oci_set_prefetch',
+ 'oci_statement_type',
+ 'oci_unregister_taf_callback',
+ 'odbc_autocommit',
+ 'odbc_binmode',
+ 'odbc_columnprivileges',
+ 'odbc_columns',
+ 'odbc_commit',
+ 'odbc_data_source',
+ 'odbc_exec',
+ 'odbc_execute',
+ 'odbc_fetch_into',
+ 'odbc_field_len',
+ 'odbc_field_name',
+ 'odbc_field_num',
+ 'odbc_field_scale',
+ 'odbc_field_type',
+ 'odbc_foreignkeys',
+ 'odbc_gettypeinfo',
+ 'odbc_longreadlen',
+ 'odbc_prepare',
+ 'odbc_primarykeys',
+ 'odbc_result',
+ 'odbc_result_all',
+ 'odbc_rollback',
+ 'odbc_setoption',
+ 'odbc_specialcolumns',
+ 'odbc_statistics',
+ 'odbc_tableprivileges',
+ 'odbc_tables',
+ 'opcache_compile_file',
+ 'opcache_get_status',
+ 'opendir',
+ 'openlog',
+ 'openssl_cipher_iv_length',
+ 'openssl_csr_export',
+ 'openssl_csr_export_to_file',
+ 'openssl_csr_get_subject',
+ 'openssl_csr_new',
+ 'openssl_csr_sign',
+ 'openssl_decrypt',
+ 'openssl_dh_compute_key',
+ 'openssl_digest',
+ 'openssl_encrypt',
+ 'openssl_open',
+ 'openssl_pbkdf2',
+ 'openssl_pkcs7_decrypt',
+ 'openssl_pkcs7_encrypt',
+ 'openssl_pkcs7_read',
+ 'openssl_pkcs7_sign',
+ 'openssl_pkcs12_export',
+ 'openssl_pkcs12_export_to_file',
+ 'openssl_pkcs12_read',
+ 'openssl_pkey_export',
+ 'openssl_pkey_export_to_file',
+ 'openssl_pkey_get_private',
+ 'openssl_pkey_get_public',
+ 'openssl_pkey_new',
+ 'openssl_private_decrypt',
+ 'openssl_private_encrypt',
+ 'openssl_public_decrypt',
+ 'openssl_public_encrypt',
+ 'openssl_random_pseudo_bytes',
+ 'openssl_seal',
+ 'openssl_sign',
+ 'openssl_x509_export',
+ 'openssl_x509_export_to_file',
+ 'openssl_x509_fingerprint',
+ 'openssl_x509_read',
+ 'output_add_rewrite_var',
+ 'output_reset_rewrite_vars',
+ 'pack',
+ 'parse_ini_file',
+ 'parse_ini_string',
+ 'parse_url',
+ 'password_hash',
+ 'pcntl_exec',
+ 'pcntl_getpriority',
+ 'pcntl_setpriority',
+ 'pcntl_signal_dispatch',
+ 'pcntl_sigprocmask',
+ 'pcntl_strerror',
+ 'PDF_activate_item',
+ 'PDF_add_locallink',
+ 'PDF_add_nameddest',
+ 'PDF_add_note',
+ 'PDF_add_pdflink',
+ 'PDF_add_thumbnail',
+ 'PDF_add_weblink',
+ 'PDF_attach_file',
+ 'PDF_begin_layer',
+ 'PDF_begin_page',
+ 'PDF_begin_page_ext',
+ 'PDF_circle',
+ 'PDF_clip',
+ 'PDF_close',
+ 'PDF_closepath',
+ 'PDF_closepath_fill_stroke',
+ 'PDF_closepath_stroke',
+ 'PDF_close_pdi',
+ 'PDF_close_pdi_page',
+ 'PDF_concat',
+ 'PDF_continue_text',
+ 'PDF_curveto',
+ 'PDF_delete',
+ 'PDF_end_layer',
+ 'PDF_end_page',
+ 'PDF_end_page_ext',
+ 'PDF_end_pattern',
+ 'PDF_end_template',
+ 'PDF_fill',
+ 'PDF_fill_stroke',
+ 'PDF_fit_image',
+ 'PDF_fit_pdi_page',
+ 'PDF_fit_textline',
+ 'PDF_initgraphics',
+ 'PDF_lineto',
+ 'PDF_makespotcolor',
+ 'PDF_moveto',
+ 'PDF_open_file',
+ 'PDF_place_image',
+ 'PDF_place_pdi_page',
+ 'PDF_rect',
+ 'PDF_restore',
+ 'PDF_rotate',
+ 'PDF_save',
+ 'PDF_scale',
+ 'PDF_setcolor',
+ 'PDF_setdash',
+ 'PDF_setdashpattern',
+ 'PDF_setflat',
+ 'PDF_setfont',
+ 'PDF_setgray',
+ 'PDF_setgray_fill',
+ 'PDF_setgray_stroke',
+ 'PDF_setlinejoin',
+ 'PDF_setlinewidth',
+ 'PDF_setmatrix',
+ 'PDF_setmiterlimit',
+ 'PDF_setrgbcolor',
+ 'PDF_setrgbcolor_fill',
+ 'PDF_setrgbcolor_stroke',
+ 'PDF_set_border_color',
+ 'PDF_set_border_dash',
+ 'PDF_set_border_style',
+ 'PDF_set_info',
+ 'PDF_set_layer_dependency',
+ 'PDF_set_parameter',
+ 'PDF_set_text_pos',
+ 'PDF_set_value',
+ 'PDF_show',
+ 'PDF_show_xy',
+ 'PDF_skew',
+ 'PDF_stroke',
+ 'pg_cancel_query',
+ 'pg_client_encoding',
+ 'pg_close',
+ 'pg_connect',
+ 'pg_connection_reset',
+ 'pg_convert',
+ 'pg_copy_from',
+ 'pg_copy_to',
+ 'pg_dbname',
+ 'pg_delete',
+ 'pg_end_copy',
+ 'pg_execute',
+ 'pg_field_name',
+ 'pg_field_table',
+ 'pg_field_type',
+ 'pg_flush',
+ 'pg_free_result',
+ 'pg_host',
+ 'pg_insert',
+ 'pg_last_error',
+ 'pg_last_notice',
+ 'pg_last_oid',
+ 'pg_lo_close',
+ 'pg_lo_export',
+ 'pg_lo_import',
+ 'pg_lo_open',
+ 'pg_lo_read',
+ 'pg_lo_read_all',
+ 'pg_lo_seek',
+ 'pg_lo_truncate',
+ 'pg_lo_unlink',
+ 'pg_lo_write',
+ 'pg_meta_data',
+ 'pg_options',
+ 'pg_parameter_status',
+ 'pg_pconnect',
+ 'pg_ping',
+ 'pg_port',
+ 'pg_prepare',
+ 'pg_put_line',
+ 'pg_query',
+ 'pg_query_params',
+ 'pg_result_error_field',
+ 'pg_result_seek',
+ 'pg_select',
+ 'pg_send_execute',
+ 'pg_send_prepare',
+ 'pg_send_query',
+ 'pg_send_query_params',
+ 'pg_socket',
+ 'pg_trace',
+ 'pg_tty',
+ 'pg_update',
+ 'pg_version',
+ 'phpcredits',
+ 'phpinfo',
+ 'png2wbmp',
+ 'posix_access',
+ 'posix_getgrnam',
+ 'posix_getpgid',
+ 'posix_initgroups',
+ 'posix_kill',
+ 'posix_mkfifo',
+ 'posix_mknod',
+ 'posix_setegid',
+ 'posix_seteuid',
+ 'posix_setgid',
+ 'posix_setpgid',
+ 'posix_setrlimit',
+ 'posix_setuid',
+ 'preg_match',
+ 'preg_match_all',
+ 'preg_replace',
+ 'preg_split',
+ 'proc_get_status',
+ 'proc_nice',
+ 'pspell_add_to_personal',
+ 'pspell_add_to_session',
+ 'pspell_clear_session',
+ 'pspell_config_create',
+ 'pspell_config_data_dir',
+ 'pspell_config_dict_dir',
+ 'pspell_config_ignore',
+ 'pspell_config_mode',
+ 'pspell_config_personal',
+ 'pspell_config_repl',
+ 'pspell_config_runtogether',
+ 'pspell_config_save_repl',
+ 'pspell_new',
+ 'pspell_new_config',
+ 'pspell_save_wordlist',
+ 'pspell_store_replacement',
+ 'ps_add_launchlink',
+ 'ps_add_locallink',
+ 'ps_add_note',
+ 'ps_add_pdflink',
+ 'ps_add_weblink',
+ 'ps_arc',
+ 'ps_arcn',
+ 'ps_begin_page',
+ 'ps_begin_pattern',
+ 'ps_begin_template',
+ 'ps_circle',
+ 'ps_clip',
+ 'ps_close',
+ 'ps_closepath',
+ 'ps_closepath_stroke',
+ 'ps_close_image',
+ 'ps_continue_text',
+ 'ps_curveto',
+ 'ps_delete',
+ 'ps_end_page',
+ 'ps_end_pattern',
+ 'ps_end_template',
+ 'ps_fill',
+ 'ps_fill_stroke',
+ 'ps_get_parameter',
+ 'ps_hyphenate',
+ 'ps_include_file',
+ 'ps_lineto',
+ 'ps_moveto',
+ 'ps_new',
+ 'ps_open_file',
+ 'ps_place_image',
+ 'ps_rect',
+ 'ps_restore',
+ 'ps_rotate',
+ 'ps_save',
+ 'ps_scale',
+ 'ps_setcolor',
+ 'ps_setdash',
+ 'ps_setflat',
+ 'ps_setfont',
+ 'ps_setgray',
+ 'ps_setlinecap',
+ 'ps_setlinejoin',
+ 'ps_setlinewidth',
+ 'ps_setmiterlimit',
+ 'ps_setoverprintmode',
+ 'ps_setpolydash',
+ 'ps_set_border_color',
+ 'ps_set_border_dash',
+ 'ps_set_border_style',
+ 'ps_set_info',
+ 'ps_set_parameter',
+ 'ps_set_text_pos',
+ 'ps_set_value',
+ 'ps_shading',
+ 'ps_shading_pattern',
+ 'ps_shfill',
+ 'ps_show',
+ 'ps_show2',
+ 'ps_show_xy',
+ 'ps_show_xy2',
+ 'ps_stroke',
+ 'ps_symbol',
+ 'ps_translate',
+ 'putenv',
+ 'readfile',
+ 'readgzfile',
+ 'readline_add_history',
+ 'readline_callback_handler_install',
+ 'readline_clear_history',
+ 'readline_completion_function',
+ 'readline_read_history',
+ 'readline_write_history',
+ 'readlink',
+ 'realpath',
+ 'register_tick_function',
+ 'rename',
+ 'rewind',
+ 'rewinddir',
+ 'rmdir',
+ 'rpmaddtag',
+ 'rrd_create',
+ 'rsort',
+ 'sapi_windows_cp_conv',
+ 'sapi_windows_cp_set',
+ 'sapi_windows_generate_ctrl_event',
+ 'sapi_windows_vt100_support',
+ 'scandir',
+ 'sem_acquire',
+ 'sem_get',
+ 'sem_release',
+ 'sem_remove',
+ 'session_abort',
+ 'session_decode',
+ 'session_destroy',
+ 'session_regenerate_id',
+ 'session_reset',
+ 'session_unset',
+ 'session_write_close',
+ 'settype',
+ 'set_include_path',
+ 'set_time_limit',
+ 'sha1_file',
+ 'shmop_delete',
+ 'shmop_read',
+ 'shmop_write',
+ 'shm_put_var',
+ 'shm_remove',
+ 'shm_remove_var',
+ 'shuffle',
+ 'simplexml_import_dom',
+ 'simplexml_load_file',
+ 'simplexml_load_string',
+ 'sleep',
+ 'socket_accept',
+ 'socket_addrinfo_bind',
+ 'socket_addrinfo_connect',
+ 'socket_bind',
+ 'socket_connect',
+ 'socket_create',
+ 'socket_create_listen',
+ 'socket_create_pair',
+ 'socket_export_stream',
+ 'socket_getpeername',
+ 'socket_getsockname',
+ 'socket_get_option',
+ 'socket_import_stream',
+ 'socket_listen',
+ 'socket_read',
+ 'socket_send',
+ 'socket_sendmsg',
+ 'socket_sendto',
+ 'socket_set_block',
+ 'socket_set_nonblock',
+ 'socket_set_option',
+ 'socket_shutdown',
+ 'socket_write',
+ 'socket_wsaprotocol_info_export',
+ 'socket_wsaprotocol_info_import',
+ 'socket_wsaprotocol_info_release',
+ 'sodium_crypto_pwhash',
+ 'sodium_crypto_pwhash_str',
+ 'solr_get_version',
+ 'sort',
+ 'soundex',
+ 'spl_autoload_register',
+ 'spl_autoload_unregister',
+ 'sprintf',
+ 'sqlsrv_begin_transaction',
+ 'sqlsrv_cancel',
+ 'sqlsrv_client_info',
+ 'sqlsrv_close',
+ 'sqlsrv_commit',
+ 'sqlsrv_configure',
+ 'sqlsrv_execute',
+ 'sqlsrv_free_stmt',
+ 'sqlsrv_get_field',
+ 'sqlsrv_next_result',
+ 'sqlsrv_num_fields',
+ 'sqlsrv_num_rows',
+ 'sqlsrv_prepare',
+ 'sqlsrv_query',
+ 'sqlsrv_rollback',
+ 'ssdeep_fuzzy_compare',
+ 'ssdeep_fuzzy_hash',
+ 'ssdeep_fuzzy_hash_filename',
+ 'ssh2_auth_agent',
+ 'ssh2_auth_hostbased_file',
+ 'ssh2_auth_password',
+ 'ssh2_auth_pubkey_file',
+ 'ssh2_connect',
+ 'ssh2_disconnect',
+ 'ssh2_exec',
+ 'ssh2_publickey_add',
+ 'ssh2_publickey_init',
+ 'ssh2_publickey_remove',
+ 'ssh2_scp_recv',
+ 'ssh2_scp_send',
+ 'ssh2_sftp',
+ 'ssh2_sftp_chmod',
+ 'ssh2_sftp_mkdir',
+ 'ssh2_sftp_rename',
+ 'ssh2_sftp_rmdir',
+ 'ssh2_sftp_symlink',
+ 'ssh2_sftp_unlink',
+ 'stream_context_set_params',
+ 'stream_copy_to_stream',
+ 'stream_filter_append',
+ 'stream_filter_prepend',
+ 'stream_filter_register',
+ 'stream_filter_remove',
+ 'stream_get_contents',
+ 'stream_isatty',
+ 'stream_resolve_include_path',
+ 'stream_set_blocking',
+ 'stream_set_timeout',
+ 'stream_socket_accept',
+ 'stream_socket_client',
+ 'stream_socket_pair',
+ 'stream_socket_server',
+ 'stream_socket_shutdown',
+ 'stream_supports_lock',
+ 'stream_wrapper_register',
+ 'stream_wrapper_restore',
+ 'stream_wrapper_unregister',
+ 'strptime',
+ 'strtotime',
+ 'substr',
+ 'swoole_async_write',
+ 'swoole_async_writefile',
+ 'swoole_event_defer',
+ 'swoole_event_del',
+ 'swoole_event_write',
+ 'symlink',
+ 'syslog',
+ 'system',
+ 'tempnam',
+ 'timezone_name_from_abbr',
+ 'time_nanosleep',
+ 'time_sleep_until',
+ 'tmpfile',
+ 'touch',
+ 'uasort',
+ 'uksort',
+ 'unlink',
+ 'unpack',
+ 'uopz_extend',
+ 'uopz_implement',
+ 'usort',
+ 'virtual',
+ 'vsprintf',
+ 'xdiff_file_bdiff',
+ 'xdiff_file_bpatch',
+ 'xdiff_file_diff',
+ 'xdiff_file_diff_binary',
+ 'xdiff_file_patch_binary',
+ 'xdiff_file_rabdiff',
+ 'xdiff_string_bpatch',
+ 'xdiff_string_patch',
+ 'xdiff_string_patch_binary',
+ 'xmlrpc_set_type',
+ 'xml_parser_create',
+ 'xml_parser_create_ns',
+ 'xml_set_object',
+ 'yaml_parse',
+ 'yaml_parse_file',
+ 'yaml_parse_url',
+ 'yaz_ccl_parse',
+ 'yaz_close',
+ 'yaz_connect',
+ 'yaz_database',
+ 'yaz_element',
+ 'yaz_present',
+ 'yaz_search',
+ 'yaz_wait',
+ 'zip_entry_close',
+ 'zip_entry_open',
+ 'zip_entry_read',
+ 'zlib_decode',
+];
diff --git a/vendor/thecodingmachine/safe/generated/gmp.php b/vendor/thecodingmachine/safe/generated/gmp.php
new file mode 100644
index 000000000..dae15975d
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/gmp.php
@@ -0,0 +1,87 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\GmpException;
+
+/**
+ * Calculates the binomial coefficient C(n, k).
+ *
+ * @param \GMP|string|int $n Either a GMP number resource in PHP 5.5 and earlier, a GMP object in PHP 5.6 and later, or a numeric string provided that it is possible to convert the latter to a number.
+ * @param int $k
+ * @return \GMP Returns the binomial coefficient C(n, k).
+ * @throws GmpException
+ *
+ */
+function gmp_binomial($n, int $k): \GMP
+{
+ error_clear_last();
+ $result = \gmp_binomial($n, $k);
+ if ($result === false) {
+ throw GmpException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Export a GMP number to a binary string
+ *
+ * @param \GMP|string|int $gmpnumber The GMP number being exported
+ * @param int $word_size Default value is 1. The number of bytes in each chunk of binary data. This is mainly used in conjunction with the options parameter.
+ * @param int $options Default value is GMP_MSW_FIRST | GMP_NATIVE_ENDIAN.
+ * @return string Returns a string.
+ * @throws GmpException
+ *
+ */
+function gmp_export($gmpnumber, int $word_size = 1, int $options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN): string
+{
+ error_clear_last();
+ $result = \gmp_export($gmpnumber, $word_size, $options);
+ if ($result === false) {
+ throw GmpException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Import a GMP number from a binary string
+ *
+ * @param string $data The binary string being imported
+ * @param int $word_size Default value is 1. The number of bytes in each chunk of binary data. This is mainly used in conjunction with the options parameter.
+ * @param int $options Default value is GMP_MSW_FIRST | GMP_NATIVE_ENDIAN.
+ * @return \GMP Returns a GMP number.
+ * @throws GmpException
+ *
+ */
+function gmp_import(string $data, int $word_size = 1, int $options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN): \GMP
+{
+ error_clear_last();
+ $result = \gmp_import($data, $word_size, $options);
+ if ($result === false) {
+ throw GmpException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ *
+ *
+ * @param \GMP|string|int $seed The seed to be set for the gmp_random,
+ * gmp_random_bits, and
+ * gmp_random_range functions.
+ *
+ * Either a GMP number resource in PHP 5.5 and earlier, a GMP object in PHP 5.6 and later, or a numeric string provided that it is possible to convert the latter to a number.
+ * @throws GmpException
+ *
+ */
+function gmp_random_seed($seed): void
+{
+ error_clear_last();
+ $result = \gmp_random_seed($seed);
+ if ($result === false) {
+ throw GmpException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/gnupg.php b/vendor/thecodingmachine/safe/generated/gnupg.php
new file mode 100644
index 000000000..b5d85ca3a
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/gnupg.php
@@ -0,0 +1,168 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\GnupgException;
+
+/**
+ *
+ *
+ * @param resource $identifier The gnupg identifier, from a call to
+ * gnupg_init or gnupg.
+ * @param string $fingerprint The fingerprint key.
+ * @param string $passphrase The pass phrase.
+ * @throws GnupgException
+ *
+ */
+function gnupg_adddecryptkey($identifier, string $fingerprint, string $passphrase): void
+{
+ error_clear_last();
+ $result = \gnupg_adddecryptkey($identifier, $fingerprint, $passphrase);
+ if ($result === false) {
+ throw GnupgException::createFromPhpError();
+ }
+}
+
+
+/**
+ *
+ *
+ * @param resource $identifier The gnupg identifier, from a call to
+ * gnupg_init or gnupg.
+ * @param string $fingerprint The fingerprint key.
+ * @throws GnupgException
+ *
+ */
+function gnupg_addencryptkey($identifier, string $fingerprint): void
+{
+ error_clear_last();
+ $result = \gnupg_addencryptkey($identifier, $fingerprint);
+ if ($result === false) {
+ throw GnupgException::createFromPhpError();
+ }
+}
+
+
+/**
+ *
+ *
+ * @param resource $identifier The gnupg identifier, from a call to
+ * gnupg_init or gnupg.
+ * @param string $fingerprint The fingerprint key.
+ * @param string $passphrase The pass phrase.
+ * @throws GnupgException
+ *
+ */
+function gnupg_addsignkey($identifier, string $fingerprint, string $passphrase = null): void
+{
+ error_clear_last();
+ if ($passphrase !== null) {
+ $result = \gnupg_addsignkey($identifier, $fingerprint, $passphrase);
+ } else {
+ $result = \gnupg_addsignkey($identifier, $fingerprint);
+ }
+ if ($result === false) {
+ throw GnupgException::createFromPhpError();
+ }
+}
+
+
+/**
+ *
+ *
+ * @param resource $identifier The gnupg identifier, from a call to
+ * gnupg_init or gnupg.
+ * @throws GnupgException
+ *
+ */
+function gnupg_cleardecryptkeys($identifier): void
+{
+ error_clear_last();
+ $result = \gnupg_cleardecryptkeys($identifier);
+ if ($result === false) {
+ throw GnupgException::createFromPhpError();
+ }
+}
+
+
+/**
+ *
+ *
+ * @param resource $identifier The gnupg identifier, from a call to
+ * gnupg_init or gnupg.
+ * @throws GnupgException
+ *
+ */
+function gnupg_clearencryptkeys($identifier): void
+{
+ error_clear_last();
+ $result = \gnupg_clearencryptkeys($identifier);
+ if ($result === false) {
+ throw GnupgException::createFromPhpError();
+ }
+}
+
+
+/**
+ *
+ *
+ * @param resource $identifier The gnupg identifier, from a call to
+ * gnupg_init or gnupg.
+ * @throws GnupgException
+ *
+ */
+function gnupg_clearsignkeys($identifier): void
+{
+ error_clear_last();
+ $result = \gnupg_clearsignkeys($identifier);
+ if ($result === false) {
+ throw GnupgException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Toggle the armored output.
+ *
+ * @param resource $identifier The gnupg identifier, from a call to
+ * gnupg_init or gnupg.
+ * @param int $armor Pass a non-zero integer-value to this function to enable armored-output
+ * (default).
+ * Pass 0 to disable armored output.
+ * @throws GnupgException
+ *
+ */
+function gnupg_setarmor($identifier, int $armor): void
+{
+ error_clear_last();
+ $result = \gnupg_setarmor($identifier, $armor);
+ if ($result === false) {
+ throw GnupgException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the mode for signing.
+ *
+ * @param resource $identifier The gnupg identifier, from a call to
+ * gnupg_init or gnupg.
+ * @param int $signmode The mode for signing.
+ *
+ * signmode takes a constant indicating what type of
+ * signature should be produced. The possible values are
+ * GNUPG_SIG_MODE_NORMAL,
+ * GNUPG_SIG_MODE_DETACH and
+ * GNUPG_SIG_MODE_CLEAR.
+ * By default GNUPG_SIG_MODE_CLEAR is used.
+ * @throws GnupgException
+ *
+ */
+function gnupg_setsignmode($identifier, int $signmode): void
+{
+ error_clear_last();
+ $result = \gnupg_setsignmode($identifier, $signmode);
+ if ($result === false) {
+ throw GnupgException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/hash.php b/vendor/thecodingmachine/safe/generated/hash.php
new file mode 100644
index 000000000..2c327c0e3
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/hash.php
@@ -0,0 +1,61 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\HashException;
+
+/**
+ *
+ *
+ * @param string $algo Name of selected hashing algorithm (i.e. "sha256", "sha512", "haval160,4", etc..)
+ * See hash_algos for a list of supported algorithms.
+ *
+ *
+ * Non-cryptographic hash functions are not allowed.
+ *
+ *
+ *
+ * Non-cryptographic hash functions are not allowed.
+ * @param string $ikm Input keying material (raw binary). Cannot be empty.
+ * @param int $length Desired output length in bytes.
+ * Cannot be greater than 255 times the chosen hash function size.
+ *
+ * If length is 0, the output length
+ * will default to the chosen hash function size.
+ * @param string $info Application/context-specific info string.
+ * @param string $salt Salt to use during derivation.
+ *
+ * While optional, adding random salt significantly improves the strength of HKDF.
+ * @return string Returns a string containing a raw binary representation of the derived key
+ * (also known as output keying material - OKM);.
+ * @throws HashException
+ *
+ */
+function hash_hkdf(string $algo, string $ikm, int $length = 0, string $info = '', string $salt = ''): string
+{
+ error_clear_last();
+ $result = \hash_hkdf($algo, $ikm, $length, $info, $salt);
+ if ($result === false) {
+ throw HashException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ *
+ *
+ * @param \HashContext $hcontext Hashing context returned by hash_init.
+ * @param string $filename URL describing location of file to be hashed; Supports fopen wrappers.
+ * @param \HashContext|null $scontext Stream context as returned by stream_context_create.
+ * @throws HashException
+ *
+ */
+function hash_update_file(\HashContext $hcontext, string $filename, ?\HashContext $scontext = null): void
+{
+ error_clear_last();
+ $result = \hash_update_file($hcontext, $filename, $scontext);
+ if ($result === false) {
+ throw HashException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/ibase.php b/vendor/thecodingmachine/safe/generated/ibase.php
new file mode 100644
index 000000000..49697400d
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/ibase.php
@@ -0,0 +1,633 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\IbaseException;
+
+/**
+ * This function will discard a BLOB if it has not yet been closed by
+ * fbird_blob_close.
+ *
+ * @param resource $blob_handle A BLOB handle opened with fbird_blob_create.
+ * @throws IbaseException
+ *
+ */
+function fbird_blob_cancel($blob_handle): void
+{
+ error_clear_last();
+ $result = \fbird_blob_cancel($blob_handle);
+ if ($result === false) {
+ throw IbaseException::createFromPhpError();
+ }
+}
+
+
+/**
+ *
+ *
+ * @param resource $service_handle The handle on the database server service.
+ * @param string $user_name The login name of the new database user.
+ * @param string $password The password of the new user.
+ * @param string $first_name The first name of the new database user.
+ * @param string $middle_name The middle name of the new database user.
+ * @param string $last_name The last name of the new database user.
+ * @throws IbaseException
+ *
+ */
+function ibase_add_user($service_handle, string $user_name, string $password, string $first_name = null, string $middle_name = null, string $last_name = null): void
+{
+ error_clear_last();
+ if ($last_name !== null) {
+ $result = \ibase_add_user($service_handle, $user_name, $password, $first_name, $middle_name, $last_name);
+ } elseif ($middle_name !== null) {
+ $result = \ibase_add_user($service_handle, $user_name, $password, $first_name, $middle_name);
+ } elseif ($first_name !== null) {
+ $result = \ibase_add_user($service_handle, $user_name, $password, $first_name);
+ } else {
+ $result = \ibase_add_user($service_handle, $user_name, $password);
+ }
+ if ($result === false) {
+ throw IbaseException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function passes the arguments to the (remote) database server. There it starts a new backup process. Therefore you
+ * won't get any responses.
+ *
+ * @param resource $service_handle A previously opened connection to the database server.
+ * @param string $source_db The absolute file path to the database on the database server. You can also use a database alias.
+ * @param string $dest_file The path to the backup file on the database server.
+ * @param int $options Additional options to pass to the database server for backup.
+ * The options parameter can be a combination
+ * of the following constants:
+ * IBASE_BKP_IGNORE_CHECKSUMS,
+ * IBASE_BKP_IGNORE_LIMBO,
+ * IBASE_BKP_METADATA_ONLY,
+ * IBASE_BKP_NO_GARBAGE_COLLECT,
+ * IBASE_BKP_OLD_DESCRIPTIONS,
+ * IBASE_BKP_NON_TRANSPORTABLE or
+ * IBASE_BKP_CONVERT.
+ * Read the section about for further information.
+ * @param bool $verbose Since the backup process is done on the database server, you don't have any chance
+ * to get its output. This argument is useless.
+ * @return mixed Returns TRUE on success.
+ *
+ * Since the backup process is done on the (remote) server, this function just passes the arguments to it.
+ * While the arguments are legal, you won't get FALSE.
+ * @throws IbaseException
+ *
+ */
+function ibase_backup($service_handle, string $source_db, string $dest_file, int $options = 0, bool $verbose = false)
+{
+ error_clear_last();
+ $result = \ibase_backup($service_handle, $source_db, $dest_file, $options, $verbose);
+ if ($result === false) {
+ throw IbaseException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * This function will discard a BLOB if it has not yet been closed by
+ * ibase_blob_close.
+ *
+ * @param resource $blob_handle A BLOB handle opened with ibase_blob_create.
+ * @throws IbaseException
+ *
+ */
+function ibase_blob_cancel($blob_handle): void
+{
+ error_clear_last();
+ $result = \ibase_blob_cancel($blob_handle);
+ if ($result === false) {
+ throw IbaseException::createFromPhpError();
+ }
+}
+
+
+/**
+ * ibase_blob_create creates a new BLOB for filling with
+ * data.
+ *
+ * @param resource $link_identifier An InterBase link identifier. If omitted, the last opened link is
+ * assumed.
+ * @return resource Returns a BLOB handle for later use with
+ * ibase_blob_add.
+ * @throws IbaseException
+ *
+ */
+function ibase_blob_create($link_identifier = null)
+{
+ error_clear_last();
+ $result = \ibase_blob_create($link_identifier);
+ if ($result === false) {
+ throw IbaseException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * This function returns at most len bytes from a BLOB
+ * that has been opened for reading by ibase_blob_open.
+ *
+ * @param resource $blob_handle A BLOB handle opened with ibase_blob_open.
+ * @param int $len Size of returned data.
+ * @return string Returns at most len bytes from the BLOB.
+ * @throws IbaseException
+ *
+ */
+function ibase_blob_get($blob_handle, int $len): string
+{
+ error_clear_last();
+ $result = \ibase_blob_get($blob_handle, $len);
+ if ($result === false) {
+ throw IbaseException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Closes the link to an InterBase database that's associated with
+ * a connection id returned from ibase_connect.
+ * Default transaction on link is committed, other transactions are
+ * rolled back.
+ *
+ * @param resource $connection_id An InterBase link identifier returned from
+ * ibase_connect. If omitted, the last opened link
+ * is assumed.
+ * @throws IbaseException
+ *
+ */
+function ibase_close($connection_id = null): void
+{
+ error_clear_last();
+ $result = \ibase_close($connection_id);
+ if ($result === false) {
+ throw IbaseException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Commits a transaction without closing it.
+ *
+ * @param resource $link_or_trans_identifier If called without an argument, this function commits the default
+ * transaction of the default link. If the argument is a connection
+ * identifier, the default transaction of the corresponding connection
+ * will be committed. If the argument is a transaction identifier, the
+ * corresponding transaction will be committed. The transaction context
+ * will be retained, so statements executed from within this transaction
+ * will not be invalidated.
+ * @throws IbaseException
+ *
+ */
+function ibase_commit_ret($link_or_trans_identifier = null): void
+{
+ error_clear_last();
+ $result = \ibase_commit_ret($link_or_trans_identifier);
+ if ($result === false) {
+ throw IbaseException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Commits a transaction.
+ *
+ * @param resource $link_or_trans_identifier If called without an argument, this function commits the default
+ * transaction of the default link. If the argument is a connection
+ * identifier, the default transaction of the corresponding connection
+ * will be committed. If the argument is a transaction identifier, the
+ * corresponding transaction will be committed.
+ * @throws IbaseException
+ *
+ */
+function ibase_commit($link_or_trans_identifier = null): void
+{
+ error_clear_last();
+ $result = \ibase_commit($link_or_trans_identifier);
+ if ($result === false) {
+ throw IbaseException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Establishes a connection to an Firebird/InterBase server.
+ *
+ * In case a second call is made to ibase_connect with
+ * the same arguments, no new link will be established, but instead, the link
+ * identifier of the already opened link will be returned. The link to the
+ * server will be closed as soon as the execution of the script ends, unless
+ * it's closed earlier by explicitly calling ibase_close.
+ *
+ * @param string $database The database argument has to be a valid path to
+ * database file on the server it resides on. If the server is not local,
+ * it must be prefixed with either 'hostname:' (TCP/IP), 'hostname/port:'
+ * (TCP/IP with interbase server on custom TCP port), '//hostname/'
+ * (NetBEUI), depending on the connection
+ * protocol used.
+ * @param string $username The user name. Can be set with the
+ * ibase.default_user php.ini directive.
+ * @param string $password The password for username. Can be set with the
+ * ibase.default_password php.ini directive.
+ * @param string $charset charset is the default character set for a
+ * database.
+ * @param int $buffers buffers is the number of database buffers to
+ * allocate for the server-side cache. If 0 or omitted, server chooses
+ * its own default.
+ * @param int $dialect dialect selects the default SQL dialect for any
+ * statement executed within a connection, and it defaults to the highest
+ * one supported by client libraries.
+ * @param string $role Functional only with InterBase 5 and up.
+ * @param int $sync
+ * @return resource Returns an Firebird/InterBase link identifier on success.
+ * @throws IbaseException
+ *
+ */
+function ibase_connect(string $database = null, string $username = null, string $password = null, string $charset = null, int $buffers = null, int $dialect = null, string $role = null, int $sync = null)
+{
+ error_clear_last();
+ if ($sync !== null) {
+ $result = \ibase_connect($database, $username, $password, $charset, $buffers, $dialect, $role, $sync);
+ } elseif ($role !== null) {
+ $result = \ibase_connect($database, $username, $password, $charset, $buffers, $dialect, $role);
+ } elseif ($dialect !== null) {
+ $result = \ibase_connect($database, $username, $password, $charset, $buffers, $dialect);
+ } elseif ($buffers !== null) {
+ $result = \ibase_connect($database, $username, $password, $charset, $buffers);
+ } elseif ($charset !== null) {
+ $result = \ibase_connect($database, $username, $password, $charset);
+ } elseif ($password !== null) {
+ $result = \ibase_connect($database, $username, $password);
+ } elseif ($username !== null) {
+ $result = \ibase_connect($database, $username);
+ } elseif ($database !== null) {
+ $result = \ibase_connect($database);
+ } else {
+ $result = \ibase_connect();
+ }
+ if ($result === false) {
+ throw IbaseException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ *
+ *
+ * @param resource $service_handle The handle on the database server service.
+ * @param string $user_name The login name of the user you want to delete from the database.
+ * @throws IbaseException
+ *
+ */
+function ibase_delete_user($service_handle, string $user_name): void
+{
+ error_clear_last();
+ $result = \ibase_delete_user($service_handle, $user_name);
+ if ($result === false) {
+ throw IbaseException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This functions drops a database that was opened by either ibase_connect
+ * or ibase_pconnect. The database is closed and deleted from the server.
+ *
+ * @param resource $connection An InterBase link identifier. If omitted, the last opened link is
+ * assumed.
+ * @throws IbaseException
+ *
+ */
+function ibase_drop_db($connection = null): void
+{
+ error_clear_last();
+ $result = \ibase_drop_db($connection);
+ if ($result === false) {
+ throw IbaseException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function causes the registered event handler specified by
+ * event to be cancelled. The callback function will
+ * no longer be called for the events it was registered to handle.
+ *
+ * @param resource $event An event resource, created by
+ * ibase_set_event_handler.
+ * @throws IbaseException
+ *
+ */
+function ibase_free_event_handler($event): void
+{
+ error_clear_last();
+ $result = \ibase_free_event_handler($event);
+ if ($result === false) {
+ throw IbaseException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Frees a prepared query.
+ *
+ * @param resource $query A query prepared with ibase_prepare.
+ * @throws IbaseException
+ *
+ */
+function ibase_free_query($query): void
+{
+ error_clear_last();
+ $result = \ibase_free_query($query);
+ if ($result === false) {
+ throw IbaseException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Frees a result set.
+ *
+ * @param resource $result_identifier A result set created by ibase_query or
+ * ibase_execute.
+ * @throws IbaseException
+ *
+ */
+function ibase_free_result($result_identifier): void
+{
+ error_clear_last();
+ $result = \ibase_free_result($result_identifier);
+ if ($result === false) {
+ throw IbaseException::createFromPhpError();
+ }
+}
+
+
+/**
+ *
+ *
+ * @param resource $service_handle
+ * @param string $db
+ * @param int $action
+ * @param int $argument
+ * @throws IbaseException
+ *
+ */
+function ibase_maintain_db($service_handle, string $db, int $action, int $argument = 0): void
+{
+ error_clear_last();
+ $result = \ibase_maintain_db($service_handle, $db, $action, $argument);
+ if ($result === false) {
+ throw IbaseException::createFromPhpError();
+ }
+}
+
+
+/**
+ *
+ *
+ * @param resource $service_handle The handle on the database server service.
+ * @param string $user_name The login name of the database user to modify.
+ * @param string $password The user's new password.
+ * @param string $first_name The user's new first name.
+ * @param string $middle_name The user's new middle name.
+ * @param string $last_name The user's new last name.
+ * @throws IbaseException
+ *
+ */
+function ibase_modify_user($service_handle, string $user_name, string $password, string $first_name = null, string $middle_name = null, string $last_name = null): void
+{
+ error_clear_last();
+ if ($last_name !== null) {
+ $result = \ibase_modify_user($service_handle, $user_name, $password, $first_name, $middle_name, $last_name);
+ } elseif ($middle_name !== null) {
+ $result = \ibase_modify_user($service_handle, $user_name, $password, $first_name, $middle_name);
+ } elseif ($first_name !== null) {
+ $result = \ibase_modify_user($service_handle, $user_name, $password, $first_name);
+ } else {
+ $result = \ibase_modify_user($service_handle, $user_name, $password);
+ }
+ if ($result === false) {
+ throw IbaseException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function assigns a name to a result set. This name can be used later in
+ * UPDATE|DELETE ... WHERE CURRENT OF name statements.
+ *
+ * @param resource $result An InterBase result set.
+ * @param string $name The name to be assigned.
+ * @throws IbaseException
+ *
+ */
+function ibase_name_result($result, string $name): void
+{
+ error_clear_last();
+ $result = \ibase_name_result($result, $name);
+ if ($result === false) {
+ throw IbaseException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Opens a persistent connection to an InterBase database.
+ *
+ * ibase_pconnect acts very much like
+ * ibase_connect with two major differences.
+ *
+ * First, when connecting, the function will first try to find a (persistent)
+ * link that's already opened with the same parameters. If one is found, an
+ * identifier for it will be returned instead of opening a new connection.
+ *
+ * Second, the connection to the InterBase server will not be closed when the
+ * execution of the script ends. Instead, the link will remain open for
+ * future use (ibase_close will not close links
+ * established by ibase_pconnect). This type of link is
+ * therefore called 'persistent'.
+ *
+ * @param string $database The database argument has to be a valid path to
+ * database file on the server it resides on. If the server is not local,
+ * it must be prefixed with either 'hostname:' (TCP/IP), '//hostname/'
+ * (NetBEUI) or 'hostname@' (IPX/SPX), depending on the connection
+ * protocol used.
+ * @param string $username The user name. Can be set with the
+ * ibase.default_user php.ini directive.
+ * @param string $password The password for username. Can be set with the
+ * ibase.default_password php.ini directive.
+ * @param string $charset charset is the default character set for a
+ * database.
+ * @param int $buffers buffers is the number of database buffers to
+ * allocate for the server-side cache. If 0 or omitted, server chooses
+ * its own default.
+ * @param int $dialect dialect selects the default SQL dialect for any
+ * statement executed within a connection, and it defaults to the highest
+ * one supported by client libraries. Functional only with InterBase 6
+ * and up.
+ * @param string $role Functional only with InterBase 5 and up.
+ * @param int $sync
+ * @return resource Returns an InterBase link identifier on success.
+ * @throws IbaseException
+ *
+ */
+function ibase_pconnect(string $database = null, string $username = null, string $password = null, string $charset = null, int $buffers = null, int $dialect = null, string $role = null, int $sync = null)
+{
+ error_clear_last();
+ if ($sync !== null) {
+ $result = \ibase_pconnect($database, $username, $password, $charset, $buffers, $dialect, $role, $sync);
+ } elseif ($role !== null) {
+ $result = \ibase_pconnect($database, $username, $password, $charset, $buffers, $dialect, $role);
+ } elseif ($dialect !== null) {
+ $result = \ibase_pconnect($database, $username, $password, $charset, $buffers, $dialect);
+ } elseif ($buffers !== null) {
+ $result = \ibase_pconnect($database, $username, $password, $charset, $buffers);
+ } elseif ($charset !== null) {
+ $result = \ibase_pconnect($database, $username, $password, $charset);
+ } elseif ($password !== null) {
+ $result = \ibase_pconnect($database, $username, $password);
+ } elseif ($username !== null) {
+ $result = \ibase_pconnect($database, $username);
+ } elseif ($database !== null) {
+ $result = \ibase_pconnect($database);
+ } else {
+ $result = \ibase_pconnect();
+ }
+ if ($result === false) {
+ throw IbaseException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * This function passes the arguments to the (remote) database server. There it starts a new restore process. Therefore you
+ * won't get any responses.
+ *
+ * @param resource $service_handle A previously opened connection to the database server.
+ * @param string $source_file The absolute path on the server where the backup file is located.
+ * @param string $dest_db The path to create the new database on the server. You can also use database alias.
+ * @param int $options Additional options to pass to the database server for restore.
+ * The options parameter can be a combination
+ * of the following constants:
+ * IBASE_RES_DEACTIVATE_IDX,
+ * IBASE_RES_NO_SHADOW,
+ * IBASE_RES_NO_VALIDITY,
+ * IBASE_RES_ONE_AT_A_TIME,
+ * IBASE_RES_REPLACE,
+ * IBASE_RES_CREATE,
+ * IBASE_RES_USE_ALL_SPACE,
+ * IBASE_PRP_PAGE_BUFFERS,
+ * IBASE_PRP_SWEEP_INTERVAL,
+ * IBASE_RES_CREATE.
+ * Read the section about for further information.
+ * @param bool $verbose Since the restore process is done on the database server, you don't have any chance
+ * to get its output. This argument is useless.
+ * @return mixed Returns TRUE on success.
+ *
+ * Since the restore process is done on the (remote) server, this function just passes the arguments to it.
+ * While the arguments are legal, you won't get FALSE.
+ * @throws IbaseException
+ *
+ */
+function ibase_restore($service_handle, string $source_file, string $dest_db, int $options = 0, bool $verbose = false)
+{
+ error_clear_last();
+ $result = \ibase_restore($service_handle, $source_file, $dest_db, $options, $verbose);
+ if ($result === false) {
+ throw IbaseException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Rolls back a transaction without closing it.
+ *
+ * @param resource $link_or_trans_identifier If called without an argument, this function rolls back the default
+ * transaction of the default link. If the argument is a connection
+ * identifier, the default transaction of the corresponding connection
+ * will be rolled back. If the argument is a transaction identifier, the
+ * corresponding transaction will be rolled back. The transaction context
+ * will be retained, so statements executed from within this transaction
+ * will not be invalidated.
+ * @throws IbaseException
+ *
+ */
+function ibase_rollback_ret($link_or_trans_identifier = null): void
+{
+ error_clear_last();
+ $result = \ibase_rollback_ret($link_or_trans_identifier);
+ if ($result === false) {
+ throw IbaseException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Rolls back a transaction.
+ *
+ * @param resource $link_or_trans_identifier If called without an argument, this function rolls back the default
+ * transaction of the default link. If the argument is a connection
+ * identifier, the default transaction of the corresponding connection
+ * will be rolled back. If the argument is a transaction identifier, the
+ * corresponding transaction will be rolled back.
+ * @throws IbaseException
+ *
+ */
+function ibase_rollback($link_or_trans_identifier = null): void
+{
+ error_clear_last();
+ $result = \ibase_rollback($link_or_trans_identifier);
+ if ($result === false) {
+ throw IbaseException::createFromPhpError();
+ }
+}
+
+
+/**
+ *
+ *
+ * @param string $host The name or ip address of the database host. You can define the port by adding
+ * '/' and port number. If no port is specified, port 3050 will be used.
+ * @param string $dba_username The name of any valid user.
+ * @param string $dba_password The user's password.
+ * @return resource Returns a Interbase / Firebird link identifier on success.
+ * @throws IbaseException
+ *
+ */
+function ibase_service_attach(string $host, string $dba_username, string $dba_password)
+{
+ error_clear_last();
+ $result = \ibase_service_attach($host, $dba_username, $dba_password);
+ if ($result === false) {
+ throw IbaseException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ *
+ *
+ * @param resource $service_handle A previously created connection to the database server.
+ * @throws IbaseException
+ *
+ */
+function ibase_service_detach($service_handle): void
+{
+ error_clear_last();
+ $result = \ibase_service_detach($service_handle);
+ if ($result === false) {
+ throw IbaseException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/ibmDb2.php b/vendor/thecodingmachine/safe/generated/ibmDb2.php
new file mode 100644
index 000000000..f97e7b086
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/ibmDb2.php
@@ -0,0 +1,1221 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\IbmDb2Exception;
+
+/**
+ * Sets or gets the AUTOCOMMIT behavior of the specified connection resource.
+ *
+ * @param resource $connection A valid database connection resource variable as returned from
+ * db2_connect or db2_pconnect.
+ * @param int $value One of the following constants:
+ *
+ *
+ * DB2_AUTOCOMMIT_OFF
+ *
+ *
+ * Turns AUTOCOMMIT off.
+ *
+ *
+ *
+ *
+ * DB2_AUTOCOMMIT_ON
+ *
+ *
+ * Turns AUTOCOMMIT on.
+ *
+ *
+ *
+ *
+ *
+ * Turns AUTOCOMMIT off.
+ *
+ * Turns AUTOCOMMIT on.
+ * @return mixed When db2_autocommit receives only the
+ * connection parameter, it returns the current state
+ * of AUTOCOMMIT for the requested connection as an integer value. A value of
+ * DB2_AUTOCOMMIT_OFF indicates that AUTOCOMMIT is off, while a value of DB2_AUTOCOMMIT_ON indicates that
+ * AUTOCOMMIT is on.
+ *
+ * When db2_autocommit receives both the
+ * connection parameter and
+ * autocommit parameter, it attempts to set the
+ * AUTOCOMMIT state of the requested connection to the corresponding state.
+ * Returns TRUE on success.
+ * @throws IbmDb2Exception
+ *
+ */
+function db2_autocommit($connection, int $value = null)
+{
+ error_clear_last();
+ if ($value !== null) {
+ $result = \db2_autocommit($connection, $value);
+ } else {
+ $result = \db2_autocommit($connection);
+ }
+ if ($result === false) {
+ throw IbmDb2Exception::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Binds a PHP variable to an SQL statement parameter in a statement resource
+ * returned by db2_prepare. This function gives you more
+ * control over the parameter type, data type, precision, and scale for the
+ * parameter than simply passing the variable as part of the optional input
+ * array to db2_execute.
+ *
+ * @param resource $stmt A prepared statement returned from db2_prepare.
+ * @param int $parameter_number Specifies the 1-indexed position of the parameter in the prepared
+ * statement.
+ * @param string $variable_name A string specifying the name of the PHP variable to bind to the
+ * parameter specified by parameter_number.
+ * @param int $parameter_type A constant specifying whether the PHP variable should be bound to the
+ * SQL parameter as an input parameter (DB2_PARAM_IN),
+ * an output parameter (DB2_PARAM_OUT), or as a
+ * parameter that accepts input and returns output
+ * (DB2_PARAM_INOUT). To avoid memory overhead, you can
+ * also specify DB2_PARAM_FILE to bind the PHP variable
+ * to the name of a file that contains large object (BLOB, CLOB, or DBCLOB)
+ * data.
+ * @param int $data_type A constant specifying the SQL data type that the PHP variable should be
+ * bound as: one of DB2_BINARY,
+ * DB2_CHAR, DB2_DOUBLE, or
+ * DB2_LONG .
+ * @param int $precision Specifies the precision with which the variable should be bound to the
+ * database. This parameter can also be used for retrieving XML output values
+ * from stored procedures. A non-negative value specifies the maximum size of
+ * the XML data that will be retrieved from the database. If this parameter
+ * is not used, a default of 1MB will be assumed for retrieving the XML
+ * output value from the stored procedure.
+ * @param int $scale Specifies the scale with which the variable should be bound to the
+ * database.
+ * @throws IbmDb2Exception
+ *
+ */
+function db2_bind_param($stmt, int $parameter_number, string $variable_name, int $parameter_type = null, int $data_type = 0, int $precision = -1, int $scale = 0): void
+{
+ error_clear_last();
+ if ($scale !== 0) {
+ $result = \db2_bind_param($stmt, $parameter_number, $variable_name, $parameter_type, $data_type, $precision, $scale);
+ } elseif ($precision !== -1) {
+ $result = \db2_bind_param($stmt, $parameter_number, $variable_name, $parameter_type, $data_type, $precision);
+ } elseif ($data_type !== 0) {
+ $result = \db2_bind_param($stmt, $parameter_number, $variable_name, $parameter_type, $data_type);
+ } elseif ($parameter_type !== null) {
+ $result = \db2_bind_param($stmt, $parameter_number, $variable_name, $parameter_type);
+ } else {
+ $result = \db2_bind_param($stmt, $parameter_number, $variable_name);
+ }
+ if ($result === false) {
+ throw IbmDb2Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function returns an object with read-only properties that return
+ * information about the DB2 database client. The following table lists
+ * the DB2 client properties:
+ *
+ * DB2 client properties
+ *
+ *
+ *
+ * Property name
+ * Return type
+ * Description
+ *
+ *
+ *
+ *
+ * APPL_CODEPAGE
+ * int
+ * The application code page.
+ *
+ *
+ * CONN_CODEPAGE
+ * int
+ * The code page for the current connection.
+ *
+ *
+ * DATA_SOURCE_NAME
+ * string
+ * The data source name (DSN) used to create the current connection
+ * to the database.
+ *
+ *
+ * DRIVER_NAME
+ * string
+ * The name of the library that implements the DB2 Call
+ * Level Interface (CLI) specification.
+ *
+ *
+ * DRIVER_ODBC_VER
+ * string
+ * The version of ODBC that the DB2 client supports. This returns a
+ * string "MM.mm" where MM is the major version and
+ * mm is the minor version. The DB2 client always
+ * returns "03.51".
+ *
+ *
+ *
+ * DRIVER_VER
+ * string
+ * The version of the client, in the form of a string "MM.mm.uuuu" where
+ * MM is the major version,
+ * mm is the minor version,
+ * and uuuu is the update. For example, "08.02.0001"
+ * represents major version 8, minor version 2, update 1.
+ *
+ *
+ *
+ * ODBC_SQL_CONFORMANCE
+ * string
+ *
+ * The level of ODBC SQL grammar supported by the client:
+ *
+ *
+ * MINIMUM
+ *
+ *
+ * Supports the minimum ODBC SQL grammar.
+ *
+ *
+ *
+ *
+ * CORE
+ *
+ *
+ * Supports the core ODBC SQL grammar.
+ *
+ *
+ *
+ *
+ * EXTENDED
+ *
+ *
+ * Supports extended ODBC SQL grammar.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * ODBC_VER
+ * string
+ * The version of ODBC that the ODBC driver manager supports. This
+ * returns a string "MM.mm.rrrr" where MM is the major
+ * version, mm is the minor version, and
+ * rrrr is the release. The DB2 client always returns
+ * "03.01.0000".
+ *
+ *
+ *
+ *
+ *
+ *
+ * @param resource $connection Specifies an active DB2 client connection.
+ * @return object Returns an object on a successful call. Returns FALSE on failure.
+ * @throws IbmDb2Exception
+ *
+ */
+function db2_client_info($connection): object
+{
+ error_clear_last();
+ $result = \db2_client_info($connection);
+ if ($result === false) {
+ throw IbmDb2Exception::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * This function closes a DB2 client connection created with
+ * db2_connect and returns the corresponding
+ * resources to the database server.
+ *
+ * If you attempt to close a persistent DB2 client connection created with
+ * db2_pconnect, the close request is ignored and the
+ * persistent DB2 client connection remains available for the next caller.
+ *
+ * @param resource $connection Specifies an active DB2 client connection.
+ * @throws IbmDb2Exception
+ *
+ */
+function db2_close($connection): void
+{
+ error_clear_last();
+ $result = \db2_close($connection);
+ if ($result === false) {
+ throw IbmDb2Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Commits an in-progress transaction on the specified connection resource and
+ * begins a new transaction. PHP applications normally default to AUTOCOMMIT
+ * mode, so db2_commit is not necessary unless AUTOCOMMIT
+ * has been turned off for the connection resource.
+ *
+ * @param resource $connection A valid database connection resource variable as returned from
+ * db2_connect or db2_pconnect.
+ * @throws IbmDb2Exception
+ *
+ */
+function db2_commit($connection): void
+{
+ error_clear_last();
+ $result = \db2_commit($connection);
+ if ($result === false) {
+ throw IbmDb2Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * db2_execute executes an SQL statement that was
+ * prepared by db2_prepare.
+ *
+ * If the SQL statement returns a result set, for example, a SELECT statement
+ * or a CALL to a stored procedure that returns one or more result sets, you
+ * can retrieve a row as an array from the stmt resource
+ * using db2_fetch_assoc,
+ * db2_fetch_both, or
+ * db2_fetch_array. Alternatively, you can use
+ * db2_fetch_row to move the result set pointer to the
+ * next row and fetch a column at a time from that row with
+ * db2_result.
+ *
+ * Refer to db2_prepare for a brief discussion of the
+ * advantages of using db2_prepare and
+ * db2_execute rather than db2_exec.
+ *
+ * @param resource $stmt A prepared statement returned from db2_prepare.
+ * @param array $parameters An array of input parameters matching any parameter markers contained
+ * in the prepared statement.
+ * @throws IbmDb2Exception
+ *
+ */
+function db2_execute($stmt, array $parameters = null): void
+{
+ error_clear_last();
+ if ($parameters !== null) {
+ $result = \db2_execute($stmt, $parameters);
+ } else {
+ $result = \db2_execute($stmt);
+ }
+ if ($result === false) {
+ throw IbmDb2Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Frees the system and database resources that are associated with a result
+ * set. These resources are freed implicitly when a script finishes, but you
+ * can call db2_free_result to explicitly free the result
+ * set resources before the end of the script.
+ *
+ * @param resource $stmt A valid statement resource.
+ * @throws IbmDb2Exception
+ *
+ */
+function db2_free_result($stmt): void
+{
+ error_clear_last();
+ $result = \db2_free_result($stmt);
+ if ($result === false) {
+ throw IbmDb2Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Frees the system and database resources that are associated with a statement
+ * resource. These resources are freed implicitly when a script finishes, but
+ * you can call db2_free_stmt to explicitly free the
+ * statement resources before the end of the script.
+ *
+ * @param resource $stmt A valid statement resource.
+ * @throws IbmDb2Exception
+ *
+ */
+function db2_free_stmt($stmt): void
+{
+ error_clear_last();
+ $result = \db2_free_stmt($stmt);
+ if ($result === false) {
+ throw IbmDb2Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Retrieves the value of a specified option value for a statement resource
+ * or a connection resource.
+ *
+ * @param resource $resource A valid statement resource as returned from
+ * db2_prepare or a valid connection resource as
+ * returned from db2_connect or
+ * db2_pconnect.
+ * @param string $option A valid statement or connection options. The following new options are available
+ * as of ibm_db2 version 1.6.0. They provide useful tracking information
+ * that can be set during execution with db2_get_option.
+ *
+ *
+ * Prior versions of ibm_db2 do not support these new options.
+ *
+ *
+ * When the value in each option is being set, some servers might not handle
+ * the entire length provided and might truncate the value.
+ *
+ *
+ * To ensure that the data specified in each option is converted correctly
+ * when transmitted to a host system, use only the characters A through Z,
+ * 0 through 9, and the underscore (_) or period (.).
+ *
+ *
+ *
+ *
+ * userid
+ *
+ *
+ * SQL_ATTR_INFO_USERID - A pointer to a null-terminated
+ * character string used to identify the client user ID sent to the host
+ * database server when using DB2 Connect.
+ *
+ *
+ * DB2 for z/OS and OS/390 servers support up to a length of 16 characters.
+ * This user-id is not to be confused with the authentication user-id, it is for
+ * identification purposes only and is not used for any authorization.
+ *
+ *
+ *
+ *
+ *
+ *
+ * acctstr
+ *
+ *
+ * SQL_ATTR_INFO_ACCTSTR - A pointer to a null-terminated
+ * character string used to identify the client accounting string sent to the
+ * host database server when using DB2 Connect.
+ *
+ *
+ * DB2 for z/OS and OS/390 servers support up to a length of 200 characters.
+ *
+ *
+ *
+ *
+ *
+ *
+ * applname
+ *
+ *
+ * SQL_ATTR_INFO_APPLNAME - A pointer to a null-terminated
+ * character string used to identify the client application name sent to the
+ * host database server when using DB2 Connect.
+ *
+ *
+ * DB2 for z/OS and OS/390 servers support up to a length of 32 characters.
+ *
+ *
+ *
+ *
+ *
+ *
+ * wrkstnname
+ *
+ *
+ * SQL_ATTR_INFO_WRKSTNNAME - A pointer to a null-terminated
+ * character string used to identify the client workstation name sent to the
+ * host database server when using DB2 Connect.
+ *
+ *
+ * DB2 for z/OS and OS/390 servers support up to a length of 18 characters.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * Prior versions of ibm_db2 do not support these new options.
+ *
+ * When the value in each option is being set, some servers might not handle
+ * the entire length provided and might truncate the value.
+ *
+ * To ensure that the data specified in each option is converted correctly
+ * when transmitted to a host system, use only the characters A through Z,
+ * 0 through 9, and the underscore (_) or period (.).
+ *
+ * SQL_ATTR_INFO_USERID - A pointer to a null-terminated
+ * character string used to identify the client user ID sent to the host
+ * database server when using DB2 Connect.
+ *
+ *
+ * DB2 for z/OS and OS/390 servers support up to a length of 16 characters.
+ * This user-id is not to be confused with the authentication user-id, it is for
+ * identification purposes only and is not used for any authorization.
+ *
+ *
+ *
+ * DB2 for z/OS and OS/390 servers support up to a length of 16 characters.
+ * This user-id is not to be confused with the authentication user-id, it is for
+ * identification purposes only and is not used for any authorization.
+ *
+ * SQL_ATTR_INFO_ACCTSTR - A pointer to a null-terminated
+ * character string used to identify the client accounting string sent to the
+ * host database server when using DB2 Connect.
+ *
+ *
+ * DB2 for z/OS and OS/390 servers support up to a length of 200 characters.
+ *
+ *
+ *
+ * DB2 for z/OS and OS/390 servers support up to a length of 200 characters.
+ *
+ * SQL_ATTR_INFO_APPLNAME - A pointer to a null-terminated
+ * character string used to identify the client application name sent to the
+ * host database server when using DB2 Connect.
+ *
+ *
+ * DB2 for z/OS and OS/390 servers support up to a length of 32 characters.
+ *
+ *
+ *
+ * DB2 for z/OS and OS/390 servers support up to a length of 32 characters.
+ *
+ * SQL_ATTR_INFO_WRKSTNNAME - A pointer to a null-terminated
+ * character string used to identify the client workstation name sent to the
+ * host database server when using DB2 Connect.
+ *
+ *
+ * DB2 for z/OS and OS/390 servers support up to a length of 18 characters.
+ *
+ *
+ *
+ * DB2 for z/OS and OS/390 servers support up to a length of 18 characters.
+ * @return string Returns the current setting of the connection attribute provided on success.
+ * @throws IbmDb2Exception
+ *
+ */
+function db2_get_option($resource, string $option): string
+{
+ error_clear_last();
+ $result = \db2_get_option($resource, $option);
+ if ($result === false) {
+ throw IbmDb2Exception::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * This function closes a DB2 client connection created with
+ * db2_pconnect and returns the corresponding resources
+ * to the database server.
+ *
+ *
+ * This function is only available on i5/OS in response to i5/OS system
+ * administration requests.
+ *
+ *
+ *
+ * If you have a persistent DB2 client connection created with
+ * db2_pconnect, you may use this function to close the
+ * connection. To avoid substantial connection performance penalties, this
+ * function should only be used in rare cases when the persistent connection
+ * has become unresponsive or the persistent connection will not be needed for
+ * a long period of time.
+ *
+ * @param resource $resource Specifies an active DB2 client connection.
+ * @throws IbmDb2Exception
+ *
+ */
+function db2_pclose($resource): void
+{
+ error_clear_last();
+ $result = \db2_pclose($resource);
+ if ($result === false) {
+ throw IbmDb2Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Rolls back an in-progress transaction on the specified connection resource and
+ * begins a new transaction. PHP applications normally default to AUTOCOMMIT
+ * mode, so db2_rollback normally has no effect unless
+ * AUTOCOMMIT has been turned off for the connection resource.
+ *
+ * @param resource $connection A valid database connection resource variable as returned from
+ * db2_connect or db2_pconnect.
+ * @throws IbmDb2Exception
+ *
+ */
+function db2_rollback($connection): void
+{
+ error_clear_last();
+ $result = \db2_rollback($connection);
+ if ($result === false) {
+ throw IbmDb2Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function returns an object with read-only properties that return
+ * information about the IBM DB2, Cloudscape, or Apache Derby database server.
+ * The following table lists the database server properties:
+ *
+ * Database server properties
+ *
+ *
+ *
+ * Property name
+ * Return type
+ * Description
+ *
+ *
+ *
+ *
+ * DBMS_NAME
+ * string
+ * The name of the database server to which you are
+ * connected. For DB2 servers this is a combination of
+ * DB2 followed by the operating system on which
+ * the database server is running.
+ *
+ *
+ * DBMS_VER
+ * string
+ * The version of the database server, in the form of a string
+ * "MM.mm.uuuu" where MM is the major version,
+ * mm is the minor version,
+ * and uuuu is the update. For example, "08.02.0001"
+ * represents major version 8, minor version 2, update 1.
+ *
+ *
+ *
+ * DB_CODEPAGE
+ * int
+ * The code page of the database to which you are connected.
+ *
+ *
+ * DB_NAME
+ * string
+ * The name of the database to which you are connected.
+ *
+ *
+ * DFT_ISOLATION
+ * string
+ *
+ * The default transaction isolation level supported by the
+ * server:
+ *
+ *
+ * UR
+ *
+ *
+ * Uncommitted read: changes are immediately visible by all
+ * concurrent transactions.
+ *
+ *
+ *
+ *
+ * CS
+ *
+ *
+ * Cursor stability: a row read by one transaction can be altered and
+ * committed by a second concurrent transaction.
+ *
+ *
+ *
+ *
+ * RS
+ *
+ *
+ * Read stability: a transaction can add or remove rows matching a
+ * search condition or a pending transaction.
+ *
+ *
+ *
+ *
+ * RR
+ *
+ *
+ * Repeatable read: data affected by pending transaction is not
+ * available to other transactions.
+ *
+ *
+ *
+ *
+ * NC
+ *
+ *
+ * No commit: any changes are visible at the end of a successful
+ * operation. Explicit commits and rollbacks are not allowed.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * IDENTIFIER_QUOTE_CHAR
+ * string
+ * The character used to delimit an identifier.
+ *
+ *
+ * INST_NAME
+ * string
+ * The instance on the database server that contains the
+ * database.
+ *
+ *
+ * ISOLATION_OPTION
+ * array
+ * An array of the isolation options supported by the
+ * database server. The isolation options are described in
+ * the DFT_ISOLATION property.
+ *
+ *
+ * KEYWORDS
+ * array
+ * An array of the keywords reserved by the database
+ * server.
+ *
+ *
+ * LIKE_ESCAPE_CLAUSE
+ * bool
+ * TRUE if the database server supports the
+ * use of % and _ wildcard
+ * characters. FALSE if the database server does not
+ * support these wildcard characters.
+ *
+ *
+ * MAX_COL_NAME_LEN
+ * int
+ * Maximum length of a column name supported by the database
+ * server, expressed in bytes.
+ *
+ *
+ * MAX_IDENTIFIER_LEN
+ * int
+ * Maximum length of an SQL identifier supported by the database
+ * server, expressed in characters.
+ *
+ *
+ * MAX_INDEX_SIZE
+ * int
+ * Maximum size of columns combined in an index supported by the
+ * database server, expressed in bytes.
+ *
+ *
+ * MAX_PROC_NAME_LEN
+ * int
+ * Maximum length of a procedure name supported by the database
+ * server, expressed in bytes.
+ *
+ *
+ * MAX_ROW_SIZE
+ * int
+ * Maximum length of a row in a base table supported by the
+ * database server, expressed in bytes.
+ *
+ *
+ * MAX_SCHEMA_NAME_LEN
+ * int
+ * Maximum length of a schema name supported by the database
+ * server, expressed in bytes.
+ *
+ *
+ * MAX_STATEMENT_LEN
+ * int
+ * Maximum length of an SQL statement supported by the database
+ * server, expressed in bytes.
+ *
+ *
+ * MAX_TABLE_NAME_LEN
+ * int
+ * Maximum length of a table name supported by the database
+ * server, expressed in bytes.
+ *
+ *
+ * NON_NULLABLE_COLUMNS
+ * bool
+ * TRUE if the database server supports columns that can be
+ * defined as NOT NULL, FALSE if the database server does not support
+ * columns defined as NOT NULL.
+ *
+ *
+ * PROCEDURES
+ * bool
+ * TRUE if the database server supports the use of the CALL
+ * statement to call stored procedures, FALSE if the database
+ * server does not support the CALL statement.
+ *
+ *
+ * SPECIAL_CHARS
+ * string
+ * A string containing all of the characters other than
+ * a-Z, 0-9, and underscore that can be used in an identifier name.
+ *
+ *
+ * SQL_CONFORMANCE
+ * string
+ *
+ * The level of conformance to the ANSI/ISO SQL-92 specification
+ * offered by the database server:
+ *
+ *
+ * ENTRY
+ *
+ *
+ * Entry-level SQL-92 compliance.
+ *
+ *
+ *
+ *
+ * FIPS127
+ *
+ *
+ * FIPS-127-2 transitional compliance.
+ *
+ *
+ *
+ *
+ * FULL
+ *
+ *
+ * Full level SQL-92 compliance.
+ *
+ *
+ *
+ *
+ * INTERMEDIATE
+ *
+ *
+ * Intermediate level SQL-92 compliance.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * @param resource $connection Specifies an active DB2 client connection.
+ * @return object Returns an object on a successful call. Returns FALSE on failure.
+ * @throws IbmDb2Exception
+ *
+ */
+function db2_server_info($connection): object
+{
+ error_clear_last();
+ $result = \db2_server_info($connection);
+ if ($result === false) {
+ throw IbmDb2Exception::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Sets options for a statement resource or a connection resource. You
+ * cannot set options for result set resources.
+ *
+ * @param resource $resource A valid statement resource as returned from
+ * db2_prepare or a valid connection resource as
+ * returned from db2_connect or
+ * db2_pconnect.
+ * @param array $options An associative array containing valid statement or connection
+ * options. This parameter can be used to change autocommit values,
+ * cursor types (scrollable or forward), and to specify the case of
+ * the column names (lower, upper, or natural) that will appear in a
+ * result set.
+ *
+ *
+ * autocommit
+ *
+ *
+ * Passing DB2_AUTOCOMMIT_ON turns
+ * autocommit on for the specified connection resource.
+ *
+ *
+ * Passing DB2_AUTOCOMMIT_OFF turns
+ * autocommit off for the specified connection resource.
+ *
+ *
+ *
+ *
+ * cursor
+ *
+ *
+ * Passing DB2_FORWARD_ONLY specifies a
+ * forward-only cursor for a statement resource. This is the
+ * default cursor type, and is supported by all database
+ * servers.
+ *
+ *
+ * Passing DB2_SCROLLABLE specifies a
+ * scrollable cursor for a statement resource. Scrollable
+ * cursors enable result set rows to be accessed in
+ * non-sequential order, but are only supported by
+ * IBM DB2 Universal Database databases.
+ *
+ *
+ *
+ *
+ * binmode
+ *
+ *
+ * Passing DB2_BINARY specifies that
+ * binary data will be returned as is. This is the default
+ * mode. This is the equivalent of setting
+ * ibm_db2.binmode=1 in php.ini.
+ *
+ *
+ * Passing DB2_CONVERT specifies that
+ * binary data will be converted to hexadecimal encoding,
+ * and will be returned as such. This is the equivalent of
+ * setting ibm_db2.binmode=2 in php.ini.
+ *
+ *
+ * Passing DB2_PASSTHRU specifies that
+ * binary data will be converted to NULL. This is the
+ * equivalent of setting ibm_db2.binmode=3
+ * in php.ini.
+ *
+ *
+ *
+ *
+ * db2_attr_case
+ *
+ *
+ * Passing DB2_CASE_LOWER specifies that
+ * column names of the result set are returned in lower case.
+ *
+ *
+ * Passing DB2_CASE_UPPER specifies that
+ * column names of the result set are returned in upper case.
+ *
+ *
+ * Passing DB2_CASE_NATURAL specifies that
+ * column names of the result set are returned in natural
+ * case.
+ *
+ *
+ *
+ *
+ * deferred_prepare
+ *
+ *
+ * Passing DB2_DEFERRED_PREPARE_ON turns deferred
+ * prepare on for the specified statement resource.
+ *
+ *
+ * Passing DB2_DEFERRED_PREPARE_OFF turns deferred
+ * prepare off for the specified statement resource.
+ *
+ *
+ *
+ *
+ *
+ * Passing DB2_AUTOCOMMIT_ON turns
+ * autocommit on for the specified connection resource.
+ *
+ * Passing DB2_AUTOCOMMIT_OFF turns
+ * autocommit off for the specified connection resource.
+ *
+ * Passing DB2_FORWARD_ONLY specifies a
+ * forward-only cursor for a statement resource. This is the
+ * default cursor type, and is supported by all database
+ * servers.
+ *
+ * Passing DB2_SCROLLABLE specifies a
+ * scrollable cursor for a statement resource. Scrollable
+ * cursors enable result set rows to be accessed in
+ * non-sequential order, but are only supported by
+ * IBM DB2 Universal Database databases.
+ *
+ * Passing DB2_BINARY specifies that
+ * binary data will be returned as is. This is the default
+ * mode. This is the equivalent of setting
+ * ibm_db2.binmode=1 in php.ini.
+ *
+ * Passing DB2_CONVERT specifies that
+ * binary data will be converted to hexadecimal encoding,
+ * and will be returned as such. This is the equivalent of
+ * setting ibm_db2.binmode=2 in php.ini.
+ *
+ * Passing DB2_PASSTHRU specifies that
+ * binary data will be converted to NULL. This is the
+ * equivalent of setting ibm_db2.binmode=3
+ * in php.ini.
+ *
+ * Passing DB2_CASE_LOWER specifies that
+ * column names of the result set are returned in lower case.
+ *
+ * Passing DB2_CASE_UPPER specifies that
+ * column names of the result set are returned in upper case.
+ *
+ * Passing DB2_CASE_NATURAL specifies that
+ * column names of the result set are returned in natural
+ * case.
+ *
+ * Passing DB2_DEFERRED_PREPARE_ON turns deferred
+ * prepare on for the specified statement resource.
+ *
+ * Passing DB2_DEFERRED_PREPARE_OFF turns deferred
+ * prepare off for the specified statement resource.
+ *
+ * The following new i5/OS options are available in ibm_db2 version 1.5.1
+ * and later. These options apply only when running PHP and ibm_db2 natively on i5 systems.
+ *
+ *
+ * i5_fetch_only
+ *
+ *
+ * DB2_I5_FETCH_ON - Cursors are read-only
+ * and cannot be used for positioned updates or deletes. This
+ * is the default unless SQL_ATTR_FOR_FETCH_ONLY
+ * environment has been set to SQL_FALSE.
+ *
+ *
+ * DB2_I5_FETCH_OFF - Cursors can be used
+ * for positioned updates and deletes.
+ *
+ *
+ *
+ *
+ *
+ * DB2_I5_FETCH_ON - Cursors are read-only
+ * and cannot be used for positioned updates or deletes. This
+ * is the default unless SQL_ATTR_FOR_FETCH_ONLY
+ * environment has been set to SQL_FALSE.
+ *
+ * DB2_I5_FETCH_OFF - Cursors can be used
+ * for positioned updates and deletes.
+ *
+ * The following new option is available in ibm_db2 version 1.8.0 and later.
+ *
+ *
+ * rowcount
+ *
+ *
+ * DB2_ROWCOUNT_PREFETCH_ON - Client can request
+ * the full row count prior to fetching, which means that
+ * db2_num_rows returns the number of rows selected
+ * even when a ROLLFORWARD_ONLY cursor is used.
+ *
+ *
+ * DB2_ROWCOUNT_PREFETCH_OFF - Client cannot request
+ * the full row count prior to fetching.
+ *
+ *
+ *
+ *
+ *
+ * DB2_ROWCOUNT_PREFETCH_ON - Client can request
+ * the full row count prior to fetching, which means that
+ * db2_num_rows returns the number of rows selected
+ * even when a ROLLFORWARD_ONLY cursor is used.
+ *
+ * DB2_ROWCOUNT_PREFETCH_OFF - Client cannot request
+ * the full row count prior to fetching.
+ *
+ * The following new options are available in ibm_db2 version 1.7.0 and later.
+ *
+ *
+ * trusted_user
+ *
+ *
+ * To switch the user to a trusted user, pass the User ID (String)
+ * of the trusted user as the value of this key. This option can
+ * be set on a connection resource only. To use this option, trusted
+ * context must be enabled on the connection resource.
+ *
+ *
+ *
+ *
+ * trusted_password
+ *
+ *
+ * The password (String) that corresponds to the user specified
+ * by the trusted_user key.
+ *
+ *
+ *
+ *
+ *
+ * To switch the user to a trusted user, pass the User ID (String)
+ * of the trusted user as the value of this key. This option can
+ * be set on a connection resource only. To use this option, trusted
+ * context must be enabled on the connection resource.
+ *
+ * The password (String) that corresponds to the user specified
+ * by the trusted_user key.
+ *
+ * The following new options are available in ibm_db2 version 1.6.0 and later.
+ * These options provide useful tracking information that can be accessed during
+ * execution with db2_get_option.
+ *
+ *
+ * When the value in each option is being set, some servers might not handle
+ * the entire length provided and might truncate the value.
+ *
+ *
+ * To ensure that the data specified in each option is converted correctly
+ * when transmitted to a host system, use only the characters A through Z,
+ * 0 through 9, and the underscore (_) or period (.).
+ *
+ *
+ *
+ *
+ * userid
+ *
+ *
+ * SQL_ATTR_INFO_USERID - A pointer to a null-terminated
+ * character string used to identify the client user ID sent to the host
+ * database server when using DB2 Connect.
+ *
+ *
+ * DB2 for z/OS and OS/390 servers support up to a length of 16 characters.
+ * This user-id is not to be confused with the authentication user-id, it is for
+ * identification purposes only and is not used for any authorization.
+ *
+ *
+ *
+ *
+ *
+ *
+ * acctstr
+ *
+ *
+ * SQL_ATTR_INFO_ACCTSTR - A pointer to a null-terminated
+ * character string used to identify the client accounting string sent to the
+ * host database server when using DB2 Connect.
+ *
+ *
+ * DB2 for z/OS and OS/390 servers support up to a length of 200 characters.
+ *
+ *
+ *
+ *
+ *
+ *
+ * applname
+ *
+ *
+ * SQL_ATTR_INFO_APPLNAME - A pointer to a null-terminated
+ * character string used to identify the client application name sent to the
+ * host database server when using DB2 Connect.
+ *
+ *
+ * DB2 for z/OS and OS/390 servers support up to a length of 32 characters.
+ *
+ *
+ *
+ *
+ *
+ *
+ * wrkstnname
+ *
+ *
+ * SQL_ATTR_INFO_WRKSTNNAME - A pointer to a null-terminated
+ * character string used to identify the client workstation name sent to the
+ * host database server when using DB2 Connect.
+ *
+ *
+ * DB2 for z/OS and OS/390 servers support up to a length of 18 characters.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * When the value in each option is being set, some servers might not handle
+ * the entire length provided and might truncate the value.
+ *
+ * To ensure that the data specified in each option is converted correctly
+ * when transmitted to a host system, use only the characters A through Z,
+ * 0 through 9, and the underscore (_) or period (.).
+ *
+ * SQL_ATTR_INFO_USERID - A pointer to a null-terminated
+ * character string used to identify the client user ID sent to the host
+ * database server when using DB2 Connect.
+ *
+ *
+ * DB2 for z/OS and OS/390 servers support up to a length of 16 characters.
+ * This user-id is not to be confused with the authentication user-id, it is for
+ * identification purposes only and is not used for any authorization.
+ *
+ *
+ *
+ * DB2 for z/OS and OS/390 servers support up to a length of 16 characters.
+ * This user-id is not to be confused with the authentication user-id, it is for
+ * identification purposes only and is not used for any authorization.
+ *
+ * SQL_ATTR_INFO_ACCTSTR - A pointer to a null-terminated
+ * character string used to identify the client accounting string sent to the
+ * host database server when using DB2 Connect.
+ *
+ *
+ * DB2 for z/OS and OS/390 servers support up to a length of 200 characters.
+ *
+ *
+ *
+ * DB2 for z/OS and OS/390 servers support up to a length of 200 characters.
+ *
+ * SQL_ATTR_INFO_APPLNAME - A pointer to a null-terminated
+ * character string used to identify the client application name sent to the
+ * host database server when using DB2 Connect.
+ *
+ *
+ * DB2 for z/OS and OS/390 servers support up to a length of 32 characters.
+ *
+ *
+ *
+ * DB2 for z/OS and OS/390 servers support up to a length of 32 characters.
+ *
+ * SQL_ATTR_INFO_WRKSTNNAME - A pointer to a null-terminated
+ * character string used to identify the client workstation name sent to the
+ * host database server when using DB2 Connect.
+ *
+ *
+ * DB2 for z/OS and OS/390 servers support up to a length of 18 characters.
+ *
+ *
+ *
+ * DB2 for z/OS and OS/390 servers support up to a length of 18 characters.
+ * @param int $type Passing DB2_AUTOCOMMIT_ON turns
+ * autocommit on for the specified connection resource.
+ *
+ * Passing DB2_AUTOCOMMIT_OFF turns
+ * autocommit off for the specified connection resource.
+ * @throws IbmDb2Exception
+ *
+ */
+function db2_set_option($resource, array $options, int $type): void
+{
+ error_clear_last();
+ $result = \db2_set_option($resource, $options, $type);
+ if ($result === false) {
+ throw IbmDb2Exception::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/iconv.php b/vendor/thecodingmachine/safe/generated/iconv.php
new file mode 100644
index 000000000..44cf96ab8
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/iconv.php
@@ -0,0 +1,96 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\IconvException;
+
+/**
+ * Retrieve internal configuration variables of iconv extension.
+ *
+ * @param string $type The value of the optional type can be:
+ *
+ * all
+ * input_encoding
+ * output_encoding
+ * internal_encoding
+ *
+ * @return mixed Returns the current value of the internal configuration variable if
+ * successful.
+ *
+ * If type is omitted or set to "all",
+ * iconv_get_encoding returns an array that
+ * stores all these variables.
+ * @throws IconvException
+ *
+ */
+function iconv_get_encoding(string $type = "all")
+{
+ error_clear_last();
+ $result = \iconv_get_encoding($type);
+ if ($result === false) {
+ throw IconvException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Changes the value of the internal configuration variable specified by
+ * type to charset.
+ *
+ * @param string $type The value of type can be any one of these:
+ *
+ * input_encoding
+ * output_encoding
+ * internal_encoding
+ *
+ * @param string $charset The character set.
+ * @throws IconvException
+ *
+ */
+function iconv_set_encoding(string $type, string $charset): void
+{
+ error_clear_last();
+ $result = \iconv_set_encoding($type, $charset);
+ if ($result === false) {
+ throw IconvException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Performs a character set conversion on the string
+ * str from in_charset
+ * to out_charset.
+ *
+ * @param string $in_charset The input charset.
+ * @param string $out_charset The output charset.
+ *
+ * If you append the string //TRANSLIT to
+ * out_charset transliteration is activated. This
+ * means that when a character can't be represented in the target charset,
+ * it can be approximated through one or several similarly looking
+ * characters. If you append the string //IGNORE,
+ * characters that cannot be represented in the target charset are silently
+ * discarded. Otherwise, E_NOTICE is generated and the function
+ * will return FALSE.
+ *
+ * If and how //TRANSLIT works exactly depends on the
+ * system's iconv() implementation (cf. ICONV_IMPL).
+ * Some implementations are known to ignore //TRANSLIT,
+ * so the conversion is likely to fail for characters which are illegal for
+ * the out_charset.
+ * @param string $str The string to be converted.
+ * @return string Returns the converted string.
+ * @throws IconvException
+ *
+ */
+function iconv(string $in_charset, string $out_charset, string $str): string
+{
+ error_clear_last();
+ $result = \iconv($in_charset, $out_charset, $str);
+ if ($result === false) {
+ throw IconvException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/image.php b/vendor/thecodingmachine/safe/generated/image.php
new file mode 100644
index 000000000..f1dc2183c
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/image.php
@@ -0,0 +1,2704 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\ImageException;
+
+/**
+ * The getimagesize function will determine the
+ * size of any supported given image file and return the dimensions along with
+ * the file type and a height/width text string to be used inside a
+ * normal HTML IMG tag and the
+ * correspondent HTTP content type.
+ *
+ * getimagesize can also return some more information
+ * in imageinfo parameter.
+ *
+ * @param string $filename This parameter specifies the file you wish to retrieve information
+ * about. It can reference a local file or (configuration permitting) a
+ * remote file using one of the supported streams.
+ * @param array $imageinfo This optional parameter allows you to extract some extended
+ * information from the image file. Currently, this will return the
+ * different JPG APP markers as an associative array.
+ * Some programs use these APP markers to embed text information in
+ * images. A very common one is to embed
+ * IPTC information in the APP13 marker.
+ * You can use the iptcparse function to parse the
+ * binary APP13 marker into something readable.
+ *
+ * The imageinfo only supports
+ * JFIF files.
+ * @return array Returns an array with up to 7 elements. Not all image types will include
+ * the channels and bits elements.
+ *
+ * Index 0 and 1 contains respectively the width and the height of the image.
+ *
+ * Index 2 is one of the IMAGETYPE_XXX constants indicating
+ * the type of the image.
+ *
+ * Index 3 is a text string with the correct
+ * height="yyy" width="xxx" string that can be used
+ * directly in an IMG tag.
+ *
+ * mime is the correspondant MIME type of the image.
+ * This information can be used to deliver images with the correct HTTP
+ * Content-type header:
+ *
+ * getimagesize and MIME types
+ *
+ *
+ * ]]>
+ *
+ *
+ *
+ * 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 &$imageinfo = null): array
+{
+ error_clear_last();
+ $result = \getimagesize($filename, $imageinfo);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * 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) {
+ $result = \image2wbmp($image, $filename, $foreground);
+ } elseif ($filename !== null) {
+ $result = \image2wbmp($image, $filename);
+ } else {
+ $result = \image2wbmp($image);
+ }
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ *
+ *
+ * @param resource $image An image resource, 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".
+ * @return resource Return affined image resource on success.
+ * @throws ImageException
+ *
+ */
+function imageaffine($image, array $affine, array $clip = null)
+{
+ error_clear_last();
+ if ($clip !== null) {
+ $result = \imageaffine($image, $affine, $clip);
+ } else {
+ $result = \imageaffine($image, $affine);
+ }
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * 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 $m1 An affine transformation matrix (an array with keys
+ * 0 to 5 and float values).
+ * @param array $m2 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 $m1, array $m2): array
+{
+ error_clear_last();
+ $result = \imageaffinematrixconcat($m1, $m2);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * 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 = null): array
+{
+ error_clear_last();
+ if ($options !== null) {
+ $result = \imageaffinematrixget($type, $options);
+ } else {
+ $result = \imageaffinematrixget($type);
+ }
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * 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 An image resource, returned by one of the image creation functions,
+ * such as imagecreatetruecolor.
+ * @param bool $blendmode 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 $blendmode): void
+{
+ error_clear_last();
+ $result = \imagealphablending($image, $blendmode);
+ if ($result === 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 An image resource, returned by one of the image creation functions,
+ * such as imagecreatetruecolor.
+ * @param bool $enabled Whether to enable antialiasing or not.
+ * @throws ImageException
+ *
+ */
+function imageantialias($image, bool $enabled): void
+{
+ error_clear_last();
+ $result = \imageantialias($image, $enabled);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * imagearc draws an arc of circle centered at the given
+ * coordinates.
+ *
+ * @param resource $image An image resource, returned by one of the image creation functions,
+ * such as imagecreatetruecolor.
+ * @param int $cx x-coordinate of the center.
+ * @param int $cy y-coordinate of the center.
+ * @param int $width The arc width.
+ * @param int $height The arc height.
+ * @param int $start The arc start angle, in degrees.
+ * @param int $end 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 $cx, int $cy, int $width, int $height, int $start, int $end, int $color): void
+{
+ error_clear_last();
+ $result = \imagearc($image, $cx, $cy, $width, $height, $start, $end, $color);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Outputs or saves a BMP version of the given image.
+ *
+ * @param resource $image An image resource, returned by one of the image creation functions,
+ * such as imagecreatetruecolor.
+ * @param mixed $to The path or an open stream resource (which is automatically being closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be outputted directly.
+ *
+ * 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, $to = null, bool $compressed = true): void
+{
+ error_clear_last();
+ $result = \imagebmp($image, $to, $compressed);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * imagechar draws the first character of
+ * c 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 An image resource, 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 any of your
+ * own font identifiers registered with imageloadfont.
+ * @param int $x x-coordinate of the start.
+ * @param int $y y-coordinate of the start.
+ * @param string $c 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 $c, int $color): void
+{
+ error_clear_last();
+ $result = \imagechar($image, $font, $x, $y, $c, $color);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Draws the character c vertically at the specified
+ * coordinate on the given image.
+ *
+ * @param resource $image An image resource, 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 any of your
+ * own font identifiers registered with imageloadfont.
+ * @param int $x x-coordinate of the start.
+ * @param int $y y-coordinate of the start.
+ * @param string $c 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 $c, int $color): void
+{
+ error_clear_last();
+ $result = \imagecharup($image, $font, $x, $y, $c, $color);
+ if ($result === 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 An image resource, 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();
+ $result = \imagecolorat($image, $x, $y);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * De-allocates a color previously allocated with
+ * imagecolorallocate or
+ * imagecolorallocatealpha.
+ *
+ * @param resource $image An image resource, 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();
+ $result = \imagecolordeallocate($image, $color);
+ if ($result === 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 resource.
+ * @param resource $image2 A palette image resource pointing to an image that has the same
+ * size as image1.
+ * @throws ImageException
+ *
+ */
+function imagecolormatch($image1, $image2): void
+{
+ error_clear_last();
+ $result = \imagecolormatch($image1, $image2);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Applies a convolution matrix on the image, using the given coefficient and
+ * offset.
+ *
+ * @param resource $image An image resource, 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 $div The divisor of the result of the convolution, used for normalization.
+ * @param float $offset Color offset.
+ * @throws ImageException
+ *
+ */
+function imageconvolution($image, array $matrix, float $div, float $offset): void
+{
+ error_clear_last();
+ $result = \imageconvolution($image, $matrix, $div, $offset);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Copy a part of src_im onto
+ * dst_im starting at the x,y coordinates
+ * src_x, src_y with
+ * a width of src_w and a height of
+ * src_h. The portion defined will be copied
+ * onto the x,y coordinates, dst_x and
+ * dst_y.
+ *
+ * @param resource $dst_im Destination image resource.
+ * @param resource $src_im 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_w Source width.
+ * @param int $src_h Source height.
+ * @throws ImageException
+ *
+ */
+function imagecopy($dst_im, $src_im, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_w, int $src_h): void
+{
+ error_clear_last();
+ $result = \imagecopy($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Copy a part of src_im onto
+ * dst_im starting at the x,y coordinates
+ * src_x, src_y with
+ * a width of src_w and a height of
+ * src_h. The portion defined will be copied
+ * onto the x,y coordinates, dst_x and
+ * dst_y.
+ *
+ * @param resource $dst_im Destination image resource.
+ * @param resource $src_im 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_w Source width.
+ * @param int $src_h 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_im, $src_im, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_w, int $src_h, int $pct): void
+{
+ error_clear_last();
+ $result = \imagecopymerge($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * imagecopymergegray copy a part of src_im onto
+ * dst_im starting at the x,y coordinates
+ * src_x, src_y with
+ * a width of src_w and a height of
+ * src_h. 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_im Destination image resource.
+ * @param resource $src_im 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_w Source width.
+ * @param int $src_h Source height.
+ * @param int $pct The src_im 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_im, $src_im, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_w, int $src_h, int $pct): void
+{
+ error_clear_last();
+ $result = \imagecopymergegray($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct);
+ if ($result === 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_w and height src_h at
+ * position (src_x,src_y)
+ * and place it in a rectangular area of dst_image
+ * of width dst_w and height dst_h
+ * 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_w Destination width.
+ * @param int $dst_h Destination height.
+ * @param int $src_w Source width.
+ * @param int $src_h Source height.
+ * @throws ImageException
+ *
+ */
+function imagecopyresampled($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_w, int $dst_h, int $src_w, int $src_h): void
+{
+ error_clear_last();
+ $result = \imagecopyresampled($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
+ if ($result === 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_w and height src_h at
+ * position (src_x,src_y)
+ * and place it in a rectangular area of dst_image
+ * of width dst_w and height dst_h
+ * 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_w Destination width.
+ * @param int $dst_h Destination height.
+ * @param int $src_w Source width.
+ * @param int $src_h Source height.
+ * @throws ImageException
+ *
+ */
+function imagecopyresized($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_w, int $dst_h, int $src_w, int $src_h): void
+{
+ error_clear_last();
+ $result = \imagecopyresized($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
+ if ($result === 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 Returns an image resource identifier on success, FALSE on errors.
+ * @throws ImageException
+ *
+ */
+function imagecreate(int $width, int $height)
+{
+ error_clear_last();
+ $result = \imagecreate($width, $height);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * 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 resource identifier on success, FALSE on errors.
+ * @throws ImageException
+ *
+ */
+function imagecreatefrombmp(string $filename)
+{
+ error_clear_last();
+ $result = \imagecreatefrombmp($filename);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Create a new image from GD file or URL.
+ *
+ * @param string $filename Path to the GD file.
+ * @return resource Returns an image resource identifier on success, FALSE on errors.
+ * @throws ImageException
+ *
+ */
+function imagecreatefromgd(string $filename)
+{
+ error_clear_last();
+ $result = \imagecreatefromgd($filename);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Create a new image from GD2 file or URL.
+ *
+ * @param string $filename Path to the GD2 image.
+ * @return resource Returns an image resource identifier on success, FALSE on errors.
+ * @throws ImageException
+ *
+ */
+function imagecreatefromgd2(string $filename)
+{
+ error_clear_last();
+ $result = \imagecreatefromgd2($filename);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Create a new image from a given part of GD2 file or URL.
+ *
+ * @param string $filename Path to the GD2 image.
+ * @param int $srcX x-coordinate of source point.
+ * @param int $srcY y-coordinate of source point.
+ * @param int $width Source width.
+ * @param int $height Source height.
+ * @return resource Returns an image resource identifier on success, FALSE on errors.
+ * @throws ImageException
+ *
+ */
+function imagecreatefromgd2part(string $filename, int $srcX, int $srcY, int $width, int $height)
+{
+ error_clear_last();
+ $result = \imagecreatefromgd2part($filename, $srcX, $srcY, $width, $height);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * 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 resource identifier on success, FALSE on errors.
+ * @throws ImageException
+ *
+ */
+function imagecreatefromgif(string $filename)
+{
+ error_clear_last();
+ $result = \imagecreatefromgif($filename);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * 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 resource identifier on success, FALSE on errors.
+ * @throws ImageException
+ *
+ */
+function imagecreatefromjpeg(string $filename)
+{
+ error_clear_last();
+ $result = \imagecreatefromjpeg($filename);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * 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 resource identifier on success, FALSE on errors.
+ * @throws ImageException
+ *
+ */
+function imagecreatefrompng(string $filename)
+{
+ error_clear_last();
+ $result = \imagecreatefrompng($filename);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * 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 resource identifier on success, FALSE on errors.
+ * @throws ImageException
+ *
+ */
+function imagecreatefromwbmp(string $filename)
+{
+ error_clear_last();
+ $result = \imagecreatefromwbmp($filename);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * 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 resource identifier on success, FALSE on errors.
+ * @throws ImageException
+ *
+ */
+function imagecreatefromwebp(string $filename)
+{
+ error_clear_last();
+ $result = \imagecreatefromwebp($filename);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * 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 resource identifier on success, FALSE on errors.
+ * @throws ImageException
+ *
+ */
+function imagecreatefromxbm(string $filename)
+{
+ error_clear_last();
+ $result = \imagecreatefromxbm($filename);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * 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 resource identifier on success, FALSE on errors.
+ * @throws ImageException
+ *
+ */
+function imagecreatefromxpm(string $filename)
+{
+ error_clear_last();
+ $result = \imagecreatefromxpm($filename);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * imagecreatetruecolor returns an image identifier
+ * representing a black image of the specified size.
+ *
+ * @param int $width Image width.
+ * @param int $height Image height.
+ * @return resource Returns an image resource identifier on success, FALSE on errors.
+ * @throws ImageException
+ *
+ */
+function imagecreatetruecolor(int $width, int $height)
+{
+ error_clear_last();
+ $result = \imagecreatetruecolor($width, $height);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Crops an image to the given rectangular area and returns the resulting image.
+ * The given image is not modified.
+ *
+ * @param resource $image An image resource, returned by one of the image creation functions,
+ * such as imagecreatetruecolor.
+ * @param array $rect The cropping rectangle as array with keys
+ * x, y, width and
+ * height.
+ * @return resource Return cropped image resource on success.
+ * @throws ImageException
+ *
+ */
+function imagecrop($image, array $rect)
+{
+ error_clear_last();
+ $result = \imagecrop($image, $rect);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Automatically crops an image according to the given
+ * mode.
+ *
+ * @param resource $image An image resource, 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 resource on success.
+ * If the complete image was cropped, imagecrop returns FALSE.
+ * @throws ImageException
+ *
+ */
+function imagecropauto($image, int $mode = IMG_CROP_DEFAULT, float $threshold = .5, int $color = -1)
+{
+ error_clear_last();
+ $result = \imagecropauto($image, $mode, $threshold, $color);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * This function is deprecated. Use combination of
+ * imagesetstyle and imageline
+ * instead.
+ *
+ * @param resource $image An image resource, 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();
+ $result = \imagedashedline($image, $x1, $y1, $x2, $y2, $color);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * imagedestroy frees any memory associated
+ * with image image.
+ *
+ * @param resource $image An image resource, returned by one of the image creation functions,
+ * such as imagecreatetruecolor.
+ * @throws ImageException
+ *
+ */
+function imagedestroy($image): void
+{
+ error_clear_last();
+ $result = \imagedestroy($image);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Draws an ellipse centered at the specified coordinates.
+ *
+ * @param resource $image An image resource, returned by one of the image creation functions,
+ * such as imagecreatetruecolor.
+ * @param int $cx x-coordinate of the center.
+ * @param int $cy 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 $cx, int $cy, int $width, int $height, int $color): void
+{
+ error_clear_last();
+ $result = \imageellipse($image, $cx, $cy, $width, $height, $color);
+ if ($result === 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 An image resource, 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();
+ $result = \imagefill($image, $x, $y, $color);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Draws a partial arc centered at the specified coordinate in the
+ * given image.
+ *
+ * @param resource $image An image resource, returned by one of the image creation functions,
+ * such as imagecreatetruecolor.
+ * @param int $cx x-coordinate of the center.
+ * @param int $cy y-coordinate of the center.
+ * @param int $width The arc width.
+ * @param int $height The arc height.
+ * @param int $start The arc start angle, in degrees.
+ * @param int $end 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 $cx, int $cy, int $width, int $height, int $start, int $end, int $color, int $style): void
+{
+ error_clear_last();
+ $result = \imagefilledarc($image, $cx, $cy, $width, $height, $start, $end, $color, $style);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Draws an ellipse centered at the specified coordinate on the given
+ * image.
+ *
+ * @param resource $image An image resource, returned by one of the image creation functions,
+ * such as imagecreatetruecolor.
+ * @param int $cx x-coordinate of the center.
+ * @param int $cy 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 $cx, int $cy, int $width, int $height, int $color): void
+{
+ error_clear_last();
+ $result = \imagefilledellipse($image, $cx, $cy, $width, $height, $color);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * imagefilledpolygon creates a filled polygon
+ * in the given image.
+ *
+ * @param resource $image An image resource, returned by one of the image creation functions,
+ * such as imagecreatetruecolor.
+ * @param array $points An array containing the x and y
+ * coordinates of the polygons vertices consecutively.
+ * @param int $num_points Total number of points (vertices), which must be at least 3.
+ * @param int $color A color identifier created with imagecolorallocate.
+ * @throws ImageException
+ *
+ */
+function imagefilledpolygon($image, array $points, int $num_points, int $color): void
+{
+ error_clear_last();
+ $result = \imagefilledpolygon($image, $points, $num_points, $color);
+ if ($result === 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 An image resource, 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();
+ $result = \imagefilledrectangle($image, $x1, $y1, $x2, $y2, $color);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * imagefilltoborder performs a flood fill
+ * whose border color is defined by border.
+ * 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 An image resource, 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 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, int $color): void
+{
+ error_clear_last();
+ $result = \imagefilltoborder($image, $x, $y, $border, $color);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * imagefilter applies the given filter
+ * filtertype on the image.
+ *
+ * @param resource $image An image resource, returned by one of the image creation functions,
+ * such as imagecreatetruecolor.
+ * @param int $filtertype filtertype 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 arg1 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 arg1 to set the level of
+ * contrast.
+ *
+ *
+ *
+ *
+ * IMG_FILTER_COLORIZE: Like
+ * IMG_FILTER_GRAYSCALE, except you can specify the
+ * color. Use arg1, 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 arg1 to set the level of smoothness.
+ *
+ *
+ *
+ *
+ * IMG_FILTER_PIXELATE: Applies pixelation effect
+ * to the image, use arg1 to set the block size
+ * and arg2 to set the pixelation effect mode.
+ *
+ *
+ *
+ *
+ * IMG_FILTER_SCATTER: Applies scatter effect
+ * to the image, use arg1 and
+ * arg2 to define the effect strength and
+ * additionally arg3 to only apply the
+ * on select pixel colors.
+ *
+ *
+ *
+ * @param int $arg1
+ *
+ *
+ * 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.
+ *
+ *
+ *
+ * @param int $arg2
+ *
+ *
+ * IMG_FILTER_COLORIZE: Value of green component.
+ *
+ *
+ *
+ *
+ * IMG_FILTER_PIXELATE: Whether to use advanced pixelation
+ * effect or not (defaults to FALSE).
+ *
+ *
+ *
+ *
+ * IMG_FILTER_SCATTER: Effect addition level.
+ *
+ *
+ *
+ * @param int $arg3
+ *
+ *
+ * IMG_FILTER_COLORIZE: Value of blue component.
+ *
+ *
+ *
+ *
+ * IMG_FILTER_SCATTER: Optional array indexed color values
+ * to apply effect at.
+ *
+ *
+ *
+ * @param int $arg4
+ *
+ *
+ * IMG_FILTER_COLORIZE: Alpha channel, A value
+ * between 0 and 127. 0 indicates completely opaque while 127 indicates
+ * completely transparent.
+ *
+ *
+ *
+ * @throws ImageException
+ *
+ */
+function imagefilter($image, int $filtertype, int $arg1 = null, int $arg2 = null, int $arg3 = null, int $arg4 = null): void
+{
+ error_clear_last();
+ if ($arg4 !== null) {
+ $result = \imagefilter($image, $filtertype, $arg1, $arg2, $arg3, $arg4);
+ } elseif ($arg3 !== null) {
+ $result = \imagefilter($image, $filtertype, $arg1, $arg2, $arg3);
+ } elseif ($arg2 !== null) {
+ $result = \imagefilter($image, $filtertype, $arg1, $arg2);
+ } elseif ($arg1 !== null) {
+ $result = \imagefilter($image, $filtertype, $arg1);
+ } else {
+ $result = \imagefilter($image, $filtertype);
+ }
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Flips the image image using the given
+ * mode.
+ *
+ * @param resource $image An image resource, 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();
+ $result = \imageflip($image, $mode);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Applies gamma correction to the given gd image
+ * given an input and an output gamma.
+ *
+ * @param resource $image An image resource, returned by one of the image creation functions,
+ * such as imagecreatetruecolor.
+ * @param float $inputgamma The input gamma.
+ * @param float $outputgamma The output gamma.
+ * @throws ImageException
+ *
+ */
+function imagegammacorrect($image, float $inputgamma, float $outputgamma): void
+{
+ error_clear_last();
+ $result = \imagegammacorrect($image, $inputgamma, $outputgamma);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Outputs a GD image to the given to.
+ *
+ * @param resource $image An image resource, returned by one of the image creation functions,
+ * such as imagecreatetruecolor.
+ * @param mixed $to The path or an open stream resource (which is automatically being closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be outputted directly.
+ * @throws ImageException
+ *
+ */
+function imagegd($image, $to = null): void
+{
+ error_clear_last();
+ $result = \imagegd($image, $to);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Outputs a GD2 image to the given to.
+ *
+ * @param resource $image An image resource, returned by one of the image creation functions,
+ * such as imagecreatetruecolor.
+ * @param mixed $to The path or an open stream resource (which is automatically being closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be outputted directly.
+ * @param int $chunk_size Chunk size.
+ * @param int $type Either IMG_GD2_RAW or
+ * IMG_GD2_COMPRESSED. Default is
+ * IMG_GD2_RAW.
+ * @throws ImageException
+ *
+ */
+function imagegd2($image, $to = null, int $chunk_size = 128, int $type = IMG_GD2_RAW): void
+{
+ error_clear_last();
+ $result = \imagegd2($image, $to, $chunk_size, $type);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * imagegif creates the GIF
+ * file in to 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 An image resource, returned by one of the image creation functions,
+ * such as imagecreatetruecolor.
+ * @param mixed $to The path or an open stream resource (which is automatically being closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be outputted directly.
+ * @throws ImageException
+ *
+ */
+function imagegif($image, $to = null): void
+{
+ error_clear_last();
+ $result = \imagegif($image, $to);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Grabs a screenshot of the whole screen.
+ *
+ * @return resource Returns an image resource identifier on success, FALSE on failure.
+ * @throws ImageException
+ *
+ */
+function imagegrabscreen()
+{
+ error_clear_last();
+ $result = \imagegrabscreen();
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Grabs a window or its client area using a windows handle (HWND property in COM instance)
+ *
+ * @param int $window_handle The HWND window ID.
+ * @param int $client_area Include the client area of the application window.
+ * @return resource Returns an image resource identifier on success, FALSE on failure.
+ * @throws ImageException
+ *
+ */
+function imagegrabwindow(int $window_handle, int $client_area = 0)
+{
+ error_clear_last();
+ $result = \imagegrabwindow($window_handle, $client_area);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * imagejpeg creates a JPEG file from
+ * the given image.
+ *
+ * @param resource $image An image resource, returned by one of the image creation functions,
+ * such as imagecreatetruecolor.
+ * @param mixed $to The path or an open stream resource (which is automatically being closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be outputted directly.
+ * @param int $quality quality 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, $to = null, int $quality = -1): void
+{
+ error_clear_last();
+ $result = \imagejpeg($image, $to, $quality);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Set the alpha blending flag to use layering effects.
+ *
+ * @param resource $image An image resource, 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();
+ $result = \imagelayereffect($image, $effect);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Draws a line between the two given points.
+ *
+ * @param resource $image An image resource, 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();
+ $result = \imageline($image, $x1, $y1, $x2, $y2, $color);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * imageloadfont loads a user-defined bitmap and returns
+ * its identifier.
+ *
+ * @param string $file 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 The font identifier which is always bigger than 5 to avoid conflicts with
+ * built-in fontss.
+ * @throws ImageException
+ *
+ */
+function imageloadfont(string $file): int
+{
+ error_clear_last();
+ $result = \imageloadfont($file);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * imageopenpolygon draws an open polygon on the given
+ * image. Contrary to imagepolygon,
+ * no line is drawn between the last and the first point.
+ *
+ * @param resource $image An image resource, returned by one of the image creation functions,
+ * such as imagecreatetruecolor.
+ * @param array $points An array containing the polygon's vertices, e.g.:
+ *
+ *
+ *
+ *
+ * points[0]
+ * = x0
+ *
+ *
+ * points[1]
+ * = y0
+ *
+ *
+ * points[2]
+ * = x1
+ *
+ *
+ * points[3]
+ * = y1
+ *
+ *
+ *
+ *
+ * @param int $num_points Total number of points (vertices), which must be at least 3.
+ * @param int $color A color identifier created with imagecolorallocate.
+ * @throws ImageException
+ *
+ */
+function imageopenpolygon($image, array $points, int $num_points, int $color): void
+{
+ error_clear_last();
+ $result = \imageopenpolygon($image, $points, $num_points, $color);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Outputs or saves a PNG image from the given
+ * image.
+ *
+ * @param resource $image An image resource, returned by one of the image creation functions,
+ * such as imagecreatetruecolor.
+ * @param mixed $to The path or an open stream resource (which is automatically being closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be outputted directly.
+ *
+ * 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, $to = null, int $quality = -1, int $filters = -1): void
+{
+ error_clear_last();
+ $result = \imagepng($image, $to, $quality, $filters);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * imagepolygon creates a polygon in the given
+ * image.
+ *
+ * @param resource $image An image resource, returned by one of the image creation functions,
+ * such as imagecreatetruecolor.
+ * @param array $points An array containing the polygon's vertices, e.g.:
+ *
+ *
+ *
+ *
+ * points[0]
+ * = x0
+ *
+ *
+ * points[1]
+ * = y0
+ *
+ *
+ * points[2]
+ * = x1
+ *
+ *
+ * points[3]
+ * = y1
+ *
+ *
+ *
+ *
+ * @param int $num_points Total number of points (vertices), which must be at least 3.
+ * @param int $color A color identifier created with imagecolorallocate.
+ * @throws ImageException
+ *
+ */
+function imagepolygon($image, array $points, int $num_points, int $color): void
+{
+ error_clear_last();
+ $result = \imagepolygon($image, $points, $num_points, $color);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * imagerectangle creates a rectangle starting at
+ * the specified coordinates.
+ *
+ * @param resource $image An image resource, 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();
+ $result = \imagerectangle($image, $x1, $y1, $x2, $y2, $color);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * 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 An image resource, 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 $bgd_color Specifies the color of the uncovered zone after the rotation
+ * @param int $dummy This parameter is unused.
+ * @return resource Returns an image resource for the rotated image.
+ * @throws ImageException
+ *
+ */
+function imagerotate($image, float $angle, int $bgd_color, int $dummy = 0)
+{
+ error_clear_last();
+ $result = \imagerotate($image, $angle, $bgd_color, $dummy);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * 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 An image resource, returned by one of the image creation functions,
+ * such as imagecreatetruecolor.
+ * @param bool $saveflag Whether to save the alpha channel or not. Defaults to FALSE.
+ * @throws ImageException
+ *
+ */
+function imagesavealpha($image, bool $saveflag): void
+{
+ error_clear_last();
+ $result = \imagesavealpha($image, $saveflag);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * imagescale scales an image using the given
+ * interpolation algorithm.
+ *
+ * @param resource $image An image resource, returned by one of the image creation functions,
+ * such as imagecreatetruecolor.
+ * @param int $new_width The width to scale the image to.
+ * @param int $new_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 resource on success.
+ * @throws ImageException
+ *
+ */
+function imagescale($image, int $new_width, int $new_height = -1, int $mode = IMG_BILINEAR_FIXED)
+{
+ error_clear_last();
+ $result = \imagescale($image, $new_width, $new_height, $mode);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * 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 An image resource, returned by one of the image creation functions,
+ * such as imagecreatetruecolor.
+ * @param resource $brush An image resource.
+ * @throws ImageException
+ *
+ */
+function imagesetbrush($image, $brush): void
+{
+ error_clear_last();
+ $result = \imagesetbrush($image, $brush);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * imagesetclip sets the current clipping rectangle, i.e.
+ * the area beyond which no pixels will be drawn.
+ *
+ * @param resource $im An image resource, 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($im, int $x1, int $y1, int $x2, int $y2): void
+{
+ error_clear_last();
+ $result = \imagesetclip($im, $x1, $y1, $x2, $y2);
+ if ($result === 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 An image resource, 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();
+ $result = \imagesetinterpolation($image, $method);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * imagesetpixel draws a pixel at the specified
+ * coordinate.
+ *
+ * @param resource $image An image resource, 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();
+ $result = \imagesetpixel($image, $x, $y, $color);
+ if ($result === 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 An image resource, 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();
+ $result = \imagesetstyle($image, $style);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * imagesetthickness sets the thickness of the lines
+ * drawn when drawing rectangles, polygons, arcs etc. to
+ * thickness pixels.
+ *
+ * @param resource $image An image resource, 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();
+ $result = \imagesetthickness($image, $thickness);
+ if ($result === 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 An image resource, returned by one of the image creation functions,
+ * such as imagecreatetruecolor.
+ * @param resource $tile The image resource to be used as a tile.
+ * @throws ImageException
+ *
+ */
+function imagesettile($image, $tile): void
+{
+ error_clear_last();
+ $result = \imagesettile($image, $tile);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Draws a string at the given coordinates.
+ *
+ * @param resource $image An image resource, 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 any of your
+ * own font identifiers registered with 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();
+ $result = \imagestring($image, $font, $x, $y, $string, $color);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Draws a string vertically at the given
+ * coordinates.
+ *
+ * @param resource $image An image resource, 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 any of your
+ * own font identifiers registered with 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();
+ $result = \imagestringup($image, $font, $x, $y, $string, $color);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Returns the width of the given image resource.
+ *
+ * @param resource $image An image resource, 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();
+ $result = \imagesx($image);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Returns the height of the given image resource.
+ *
+ * @param resource $image An image resource, 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();
+ $result = \imagesy($image);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * 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 An image resource, 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 $ncolors Sets the maximum number of colors that should be retained in the palette.
+ * @throws ImageException
+ *
+ */
+function imagetruecolortopalette($image, bool $dither, int $ncolors): void
+{
+ error_clear_last();
+ $result = \imagetruecolortopalette($image, $dither, $ncolors);
+ if ($result === 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 text will be measured.
+ * @param string $fontfile The path to the TrueType font you wish to use.
+ *
+ * Depending on which version of the GD library PHP is using, when
+ * fontfile does not begin with a leading
+ * / then .ttf will be appended
+ * to the filename and the library will attempt to search for that
+ * filename along a library-defined font path.
+ *
+ * When using versions of the GD library lower than 2.0.18, a space character,
+ * rather than a semicolon, was used as the 'path separator' for different font files.
+ * Unintentional use of this feature will result in the warning message:
+ * Warning: Could not find/open font. For these affected versions, the
+ * only solution is moving the font to a path which does not contain spaces.
+ *
+ * In many cases where a font resides in the same directory as the script using it
+ * the following trick will alleviate any include problems.
+ *
+ *
+ * ]]>
+ *
+ *
+ * Note that open_basedir does
+ * not apply to fontfile.
+ * @param string $text The string to be measured.
+ * @return array imagettfbbox returns an array with 8
+ * elements representing four points making the bounding box of the
+ * text on success and FALSE on error.
+ *
+ *
+ *
+ *
+ * key
+ * contents
+ *
+ *
+ *
+ *
+ * 0
+ * lower left corner, X position
+ *
+ *
+ * 1
+ * lower left corner, Y position
+ *
+ *
+ * 2
+ * lower right corner, X position
+ *
+ *
+ * 3
+ * lower right corner, Y position
+ *
+ *
+ * 4
+ * upper right corner, X position
+ *
+ *
+ * 5
+ * upper right corner, Y position
+ *
+ *
+ * 6
+ * upper left corner, X position
+ *
+ *
+ * 7
+ * upper left corner, Y position
+ *
+ *
+ *
+ *
+ *
+ * The points are relative to the text regardless of the
+ * angle, so "upper left" means in the top left-hand
+ * corner seeing the text horizontally.
+ * @throws ImageException
+ *
+ */
+function imagettfbbox(float $size, float $angle, string $fontfile, string $text): array
+{
+ error_clear_last();
+ $result = \imagettfbbox($size, $angle, $fontfile, $text);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Writes the given text into the image using TrueType
+ * fonts.
+ *
+ * @param resource $image An image resource, returned by one of the image creation functions,
+ * such as imagecreatetruecolor.
+ * @param float $size The font size in points.
+ * @param float $angle The angle in degrees, with 0 degrees being left-to-right reading text.
+ * Higher values represent a counter-clockwise rotation. For example, a
+ * value of 90 would result in bottom-to-top reading text.
+ * @param int $x The coordinates given by x and
+ * y will define the basepoint of the first
+ * character (roughly the lower-left corner of the character). This
+ * is different from the imagestring, where
+ * x and y define the
+ * upper-left corner of the first character. For example, "top left"
+ * is 0, 0.
+ * @param int $y The y-ordinate. This sets the position of the fonts baseline, not the
+ * very bottom of the character.
+ * @param int $color The color index. Using the negative of a color index has the effect of
+ * turning off antialiasing. See imagecolorallocate.
+ * @param string $fontfile The path to the TrueType font you wish to use.
+ *
+ * Depending on which version of the GD library PHP is using, when
+ * fontfile does not begin with a leading
+ * / then .ttf will be appended
+ * to the filename and the library will attempt to search for that
+ * filename along a library-defined font path.
+ *
+ * When using versions of the GD library lower than 2.0.18, a space character,
+ * rather than a semicolon, was used as the 'path separator' for different font files.
+ * Unintentional use of this feature will result in the warning message:
+ * Warning: Could not find/open font. For these affected versions, the
+ * only solution is moving the font to a path which does not contain spaces.
+ *
+ * In many cases where a font resides in the same directory as the script using it
+ * the following trick will alleviate any include problems.
+ *
+ *
+ * ]]>
+ *
+ *
+ * Note that open_basedir does
+ * not apply to fontfile.
+ * @param string $text The text string in UTF-8 encoding.
+ *
+ * May include decimal numeric character references (of the form:
+ * &amp;#8364;) to access characters in a font beyond position 127.
+ * The hexadecimal format (like &amp;#xA9;) is supported.
+ * Strings in UTF-8 encoding can be passed directly.
+ *
+ * Named entities, such as &amp;copy;, are not supported. Consider using
+ * html_entity_decode
+ * to decode these named entities into UTF-8 strings.
+ *
+ * If a character is used in the string which is not supported by the
+ * font, a hollow rectangle will replace the character.
+ * @return array Returns an array with 8 elements representing four points making the
+ * bounding box of the text. The order of the points is lower left, lower
+ * right, upper right, upper left. The points are relative to the text
+ * regardless of the angle, so "upper left" means in the top left-hand
+ * corner when you see the text horizontally.
+ * @throws ImageException
+ *
+ */
+function imagettftext($image, float $size, float $angle, int $x, int $y, int $color, string $fontfile, string $text): array
+{
+ error_clear_last();
+ $result = \imagettftext($image, $size, $angle, $x, $y, $color, $fontfile, $text);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * imagewbmp outputs or save a WBMP
+ * version of the given image.
+ *
+ * @param resource $image An image resource, returned by one of the image creation functions,
+ * such as imagecreatetruecolor.
+ * @param mixed $to The path or an open stream resource (which is automatically being closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be outputted directly.
+ * @param int $foreground You can set the foreground color with this parameter by setting an
+ * identifier obtained from imagecolorallocate.
+ * The default foreground color is black.
+ * @throws ImageException
+ *
+ */
+function imagewbmp($image, $to = null, int $foreground = null): void
+{
+ error_clear_last();
+ if ($foreground !== null) {
+ $result = \imagewbmp($image, $to, $foreground);
+ } else {
+ $result = \imagewbmp($image, $to);
+ }
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Outputs or saves a WebP version of the given image.
+ *
+ * @param resource $image An image resource, returned by one of the image creation functions,
+ * such as imagecreatetruecolor.
+ * @param mixed $to The path or an open stream resource (which is automatically being closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be outputted directly.
+ * @param int $quality quality ranges from 0 (worst
+ * quality, smaller file) to 100 (best quality, biggest file).
+ * @throws ImageException
+ *
+ */
+function imagewebp($image, $to = null, int $quality = 80): void
+{
+ error_clear_last();
+ $result = \imagewebp($image, $to, $quality);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Outputs or save an XBM version of the given
+ * image.
+ *
+ * @param resource $image An image resource, returned by one of the image creation functions,
+ * such as imagecreatetruecolor.
+ * @param string|null $filename The path to save the file to, 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 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, ?string $filename, int $foreground = null): void
+{
+ error_clear_last();
+ if ($foreground !== null) {
+ $result = \imagexbm($image, $filename, $foreground);
+ } else {
+ $result = \imagexbm($image, $filename);
+ }
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Embeds binary IPTC data into a JPEG image.
+ *
+ * @param string $iptcdata The data to be written.
+ * @param string $jpeg_file_name Path to the JPEG image.
+ * @param int $spool Spool flag. If the spool flag is less than 2 then the JPEG will be
+ * returned as a string. Otherwise the JPEG will be printed to STDOUT.
+ * @return string|bool If spool is less than 2, the JPEG will be returned. Otherwise returns TRUE on success.
+ * @throws ImageException
+ *
+ */
+function iptcembed(string $iptcdata, string $jpeg_file_name, int $spool = 0)
+{
+ error_clear_last();
+ $result = \iptcembed($iptcdata, $jpeg_file_name, $spool);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Parses an IPTC block into its single tags.
+ *
+ * @param string $iptcblock A binary IPTC block.
+ * @return array Returns an array using the tagmarker as an index and the value as the
+ * value. It returns FALSE on error or if no IPTC data was found.
+ * @throws ImageException
+ *
+ */
+function iptcparse(string $iptcblock): array
+{
+ error_clear_last();
+ $result = \iptcparse($iptcblock);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Converts a JPEG file into a WBMP file.
+ *
+ * @param string $jpegname Path to JPEG file.
+ * @param string $wbmpname Path to destination WBMP file.
+ * @param int $dest_height Destination image height.
+ * @param int $dest_width Destination image width.
+ * @param int $threshold Threshold value, between 0 and 8 (inclusive).
+ * @throws ImageException
+ *
+ */
+function jpeg2wbmp(string $jpegname, string $wbmpname, int $dest_height, int $dest_width, int $threshold): void
+{
+ error_clear_last();
+ $result = \jpeg2wbmp($jpegname, $wbmpname, $dest_height, $dest_width, $threshold);
+ if ($result === false) {
+ throw 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();
+ $result = \png2wbmp($pngname, $wbmpname, $dest_height, $dest_width, $threshold);
+ if ($result === false) {
+ throw ImageException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/imap.php b/vendor/thecodingmachine/safe/generated/imap.php
new file mode 100644
index 000000000..acd8672c6
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/imap.php
@@ -0,0 +1,1481 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\ImapException;
+
+/**
+ * Appends a string message to the specified mailbox.
+ *
+ * @param resource $imap_stream An IMAP stream returned by
+ * imap_open.
+ * @param string $mailbox The mailbox name, see imap_open for more
+ * information
+ * @param string $message The message to be append, as a string
+ *
+ * When talking to the Cyrus IMAP server, you must use "\r\n" as
+ * your end-of-line terminator instead of "\n" or the operation will
+ * fail
+ * @param string $options If provided, the options will also be written
+ * to the mailbox
+ * @param string $internal_date If this parameter is set, it will set the INTERNALDATE on the appended message. The parameter should be a date string that conforms to the rfc2060 specifications for a date_time value.
+ * @throws ImapException
+ *
+ */
+function imap_append($imap_stream, string $mailbox, string $message, string $options = null, string $internal_date = null): void
+{
+ error_clear_last();
+ $result = \imap_append($imap_stream, $mailbox, $message, $options, $internal_date);
+ if ($result === false) {
+ throw ImapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Checks information about the current mailbox.
+ *
+ * @param resource $imap_stream An IMAP stream returned by
+ * imap_open.
+ * @return \stdClass Returns the information in an object with following properties:
+ *
+ *
+ *
+ * Date - current system time formatted according to RFC2822
+ *
+ *
+ *
+ *
+ * Driver - protocol used to access this mailbox:
+ * POP3, IMAP, NNTP
+ *
+ *
+ *
+ *
+ * Mailbox - the mailbox name
+ *
+ *
+ *
+ *
+ * Nmsgs - number of messages in the mailbox
+ *
+ *
+ *
+ *
+ * Recent - number of recent messages in the mailbox
+ *
+ *
+ *
+ *
+ * Returns FALSE on failure.
+ * @throws ImapException
+ *
+ */
+function imap_check($imap_stream): \stdClass
+{
+ error_clear_last();
+ $result = \imap_check($imap_stream);
+ if ($result === false) {
+ throw ImapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * This function causes a store to delete the specified
+ * flag to the flags set for the
+ * messages in the specified sequence.
+ *
+ * @param resource $imap_stream An IMAP stream returned by
+ * imap_open.
+ * @param string $sequence A sequence of message numbers. You can enumerate desired messages
+ * with the X,Y syntax, or retrieve all messages
+ * within an interval with the X:Y syntax
+ * @param string $flag The flags which you can unset are "\\Seen", "\\Answered", "\\Flagged",
+ * "\\Deleted", and "\\Draft" (as defined by RFC2060)
+ * @param int $options options are a bit mask and may contain
+ * the single option:
+ *
+ *
+ *
+ * ST_UID - The sequence argument contains UIDs
+ * instead of sequence numbers
+ *
+ *
+ *
+ * @throws ImapException
+ *
+ */
+function imap_clearflag_full($imap_stream, string $sequence, string $flag, int $options = 0): void
+{
+ error_clear_last();
+ $result = \imap_clearflag_full($imap_stream, $sequence, $flag, $options);
+ if ($result === false) {
+ throw ImapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Closes the imap stream.
+ *
+ * @param resource $imap_stream An IMAP stream returned by
+ * imap_open.
+ * @param int $flag If set to CL_EXPUNGE, the function will silently
+ * expunge the mailbox before closing, removing all messages marked for
+ * deletion. You can achieve the same thing by using
+ * imap_expunge
+ * @throws ImapException
+ *
+ */
+function imap_close($imap_stream, int $flag = 0): void
+{
+ error_clear_last();
+ $result = \imap_close($imap_stream, $flag);
+ if ($result === false) {
+ throw ImapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Creates a new mailbox specified by mailbox.
+ *
+ * @param resource $imap_stream An IMAP stream returned by
+ * imap_open.
+ * @param string $mailbox The mailbox name, see imap_open for more
+ * information. Names containing international characters should be
+ * encoded by imap_utf7_encode
+ * @throws ImapException
+ *
+ */
+function imap_createmailbox($imap_stream, string $mailbox): void
+{
+ error_clear_last();
+ $result = \imap_createmailbox($imap_stream, $mailbox);
+ if ($result === false) {
+ throw ImapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Deletes the specified mailbox.
+ *
+ * @param resource $imap_stream An IMAP stream returned by
+ * imap_open.
+ * @param string $mailbox The mailbox name, see imap_open for more
+ * information
+ * @throws ImapException
+ *
+ */
+function imap_deletemailbox($imap_stream, string $mailbox): void
+{
+ error_clear_last();
+ $result = \imap_deletemailbox($imap_stream, $mailbox);
+ if ($result === false) {
+ throw ImapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Fetches all the structured information for a given message.
+ *
+ * @param resource $imap_stream An IMAP stream returned by
+ * imap_open.
+ * @param int $msg_number The message number
+ * @param int $options This optional parameter only has a single option,
+ * FT_UID, which tells the function to treat the
+ * msg_number argument as a
+ * UID.
+ * @return \stdClass Returns an object with properties listed in the table below.
+ *
+ *
+ *
+ * Returned Object for imap_fetchstructure
+ *
+ *
+ *
+ *
+ * type
+ * Primary body type
+ *
+ *
+ * encoding
+ * Body transfer encoding
+ *
+ *
+ * ifsubtype
+ * TRUE if there is a subtype string
+ *
+ *
+ * subtype
+ * MIME subtype
+ *
+ *
+ * ifdescription
+ * TRUE if there is a description string
+ *
+ *
+ * description
+ * Content description string
+ *
+ *
+ * ifid
+ * TRUE if there is an identification string
+ *
+ *
+ * id
+ * Identification string
+ *
+ *
+ * lines
+ * Number of lines
+ *
+ *
+ * bytes
+ * Number of bytes
+ *
+ *
+ * ifdisposition
+ * TRUE if there is a disposition string
+ *
+ *
+ * disposition
+ * Disposition string
+ *
+ *
+ * ifdparameters
+ * TRUE if the dparameters array exists
+ *
+ *
+ * dparameters
+ * An array of objects where each object has an
+ * "attribute" and a "value"
+ * property corresponding to the parameters on the
+ * Content-disposition MIME
+ * header.
+ *
+ *
+ * ifparameters
+ * TRUE if the parameters array exists
+ *
+ *
+ * parameters
+ * An array of objects where each object has an
+ * "attribute" and a "value"
+ * property.
+ *
+ *
+ * parts
+ * An array of objects identical in structure to the top-level
+ * object, each of which corresponds to a MIME body
+ * part.
+ *
+ *
+ *
+ *
+ *
+ *
+ * Primary body type (value may vary with used library, use of constants is recommended)
+ *
+ *
+ * ValueTypeConstant
+ *
+ *
+ * 0textTYPETEXT
+ * 1multipartTYPEMULTIPART
+ * 2messageTYPEMESSAGE
+ * 3applicationTYPEAPPLICATION
+ * 4audioTYPEAUDIO
+ * 5imageTYPEIMAGE
+ * 6videoTYPEVIDEO
+ * 7modelTYPEMODEL
+ * 8otherTYPEOTHER
+ *
+ *
+ *
+ *
+ *
+ * Transfer encodings (value may vary with used library, use of constants is recommended)
+ *
+ *
+ * ValueTypeConstant
+ *
+ *
+ * 07bitENC7BIT
+ * 18bitENC8BIT
+ * 2BinaryENCBINARY
+ * 3Base64ENCBASE64
+ * 4Quoted-PrintableENCQUOTEDPRINTABLE
+ * 5otherENCOTHER
+ *
+ *
+ *
+ * @throws ImapException
+ *
+ */
+function imap_fetchstructure($imap_stream, int $msg_number, int $options = 0): \stdClass
+{
+ error_clear_last();
+ $result = \imap_fetchstructure($imap_stream, $msg_number, $options);
+ if ($result === false) {
+ throw ImapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Purges the cache of entries of a specific type.
+ *
+ * @param resource $imap_stream An IMAP stream returned by
+ * imap_open.
+ * @param int $caches Specifies the cache to purge. It may one or a combination
+ * of the following constants:
+ * IMAP_GC_ELT (message cache elements),
+ * IMAP_GC_ENV (envelope and bodies),
+ * IMAP_GC_TEXTS (texts).
+ * @throws ImapException
+ *
+ */
+function imap_gc($imap_stream, int $caches): void
+{
+ error_clear_last();
+ $result = \imap_gc($imap_stream, $caches);
+ if ($result === false) {
+ throw ImapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Gets information about the given message number by reading its headers.
+ *
+ * @param resource $imap_stream An IMAP stream returned by
+ * imap_open.
+ * @param int $msg_number The message number
+ * @param int $fromlength Number of characters for the fetchfrom property.
+ * Must be greater than or equal to zero.
+ * @param int $subjectlength Number of characters for the fetchsubject property
+ * Must be greater than or equal to zero.
+ * @param string $defaulthost
+ * @return \stdClass Returns FALSE on error or, if successful, the information in an object with following properties:
+ *
+ *
+ *
+ * toaddress - full to: line, up to 1024 characters
+ *
+ *
+ *
+ *
+ * to - an array of objects from the To: line, with the following
+ * properties: personal, adl,
+ * mailbox, and host
+ *
+ *
+ *
+ *
+ * fromaddress - full from: line, up to 1024 characters
+ *
+ *
+ *
+ *
+ * from - an array of objects from the From: line, with the following
+ * properties: personal, adl,
+ * mailbox, and host
+ *
+ *
+ *
+ *
+ * ccaddress - full cc: line, up to 1024 characters
+ *
+ *
+ *
+ *
+ * cc - an array of objects from the Cc: line, with the following
+ * properties: personal, adl,
+ * mailbox, and host
+ *
+ *
+ *
+ *
+ * bccaddress - full bcc: line, up to 1024 characters
+ *
+ *
+ *
+ *
+ * bcc - an array of objects from the Bcc: line, with the following
+ * properties: personal, adl,
+ * mailbox, and host
+ *
+ *
+ *
+ *
+ * reply_toaddress - full Reply-To: line, up to 1024 characters
+ *
+ *
+ *
+ *
+ * reply_to - an array of objects from the Reply-To: line, with the following
+ * properties: personal, adl,
+ * mailbox, and host
+ *
+ *
+ *
+ *
+ * senderaddress - full sender: line, up to 1024 characters
+ *
+ *
+ *
+ *
+ * sender - an array of objects from the Sender: line, with the following
+ * properties: personal, adl,
+ * mailbox, and host
+ *
+ *
+ *
+ *
+ * return_pathaddress - full Return-Path: line, up to 1024 characters
+ *
+ *
+ *
+ *
+ * return_path - an array of objects from the Return-Path: line, with the
+ * following properties: personal,
+ * adl, mailbox, and
+ * host
+ *
+ *
+ *
+ *
+ * remail -
+ *
+ *
+ *
+ *
+ * date - The message date as found in its headers
+ *
+ *
+ *
+ *
+ * Date - Same as date
+ *
+ *
+ *
+ *
+ * subject - The message subject
+ *
+ *
+ *
+ *
+ * Subject - Same as subject
+ *
+ *
+ *
+ *
+ * in_reply_to -
+ *
+ *
+ *
+ *
+ * message_id -
+ *
+ *
+ *
+ *
+ * newsgroups -
+ *
+ *
+ *
+ *
+ * followup_to -
+ *
+ *
+ *
+ *
+ * references -
+ *
+ *
+ *
+ *
+ * Recent - R if recent and seen, N
+ * if recent and not seen, ' ' if not recent.
+ *
+ *
+ *
+ *
+ * Unseen - U if not seen AND not recent, ' ' if seen
+ * OR not seen and recent
+ *
+ *
+ *
+ *
+ * Flagged - F if flagged, ' ' if not flagged
+ *
+ *
+ *
+ *
+ * Answered - A if answered, ' ' if unanswered
+ *
+ *
+ *
+ *
+ * Deleted - D if deleted, ' ' if not deleted
+ *
+ *
+ *
+ *
+ * Draft - X if draft, ' ' if not draft
+ *
+ *
+ *
+ *
+ * Msgno - The message number
+ *
+ *
+ *
+ *
+ * MailDate -
+ *
+ *
+ *
+ *
+ * Size - The message size
+ *
+ *
+ *
+ *
+ * udate - mail message date in Unix time
+ *
+ *
+ *
+ *
+ * fetchfrom - from line formatted to fit fromlength
+ * characters
+ *
+ *
+ *
+ *
+ * fetchsubject - subject line formatted to fit
+ * subjectlength characters
+ *
+ *
+ *
+ * @throws ImapException
+ *
+ */
+function imap_headerinfo($imap_stream, int $msg_number, int $fromlength = 0, int $subjectlength = 0, string $defaulthost = null): \stdClass
+{
+ error_clear_last();
+ $result = \imap_headerinfo($imap_stream, $msg_number, $fromlength, $subjectlength, $defaulthost);
+ if ($result === false) {
+ throw ImapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Create a MIME message based on the given envelope
+ * and body sections.
+ *
+ * @param array $envelope An associative array of header fields. Valid keys are: "remail",
+ * "return_path", "date", "from", "reply_to", "in_reply_to", "subject",
+ * "to", "cc", "bcc" and "message_id", which set the respective message headers to the given string.
+ * To set additional headers, the key "custom_headers" is supported, which expects
+ * an array of those headers, e.g. ["User-Agent: My Mail Client"].
+ * @param array $body An indexed array of bodies. The first body is the main body of the message;
+ * only if it has a type of TYPEMULTIPART, further bodies
+ * are processed; these bodies constitute the bodies of the parts.
+ *
+ *
+ * Body Array Structure
+ *
+ *
+ *
+ * Key
+ * Type
+ * Description
+ *
+ *
+ *
+ *
+ * type
+ * int
+ *
+ * The MIME type.
+ * One of TYPETEXT (default), TYPEMULTIPART,
+ * TYPEMESSAGE, TYPEAPPLICATION,
+ * TYPEAUDIO, TYPEIMAGE,
+ * TYPEMODEL or TYPEOTHER.
+ *
+ *
+ *
+ * encoding
+ * int
+ *
+ * The Content-Transfer-Encoding.
+ * One of ENC7BIT (default), ENC8BIT,
+ * ENCBINARY, ENCBASE64,
+ * ENCQUOTEDPRINTABLE or ENCOTHER.
+ *
+ *
+ *
+ * charset
+ * string
+ * The charset parameter of the MIME type.
+ *
+ *
+ * type.parameters
+ * array
+ * An associative array of Content-Type parameter names and their values.
+ *
+ *
+ * subtype
+ * string
+ * The MIME subtype, e.g. 'jpeg' for TYPEIMAGE.
+ *
+ *
+ * id
+ * string
+ * The Content-ID.
+ *
+ *
+ * description
+ * string
+ * The Content-Description.
+ *
+ *
+ * disposition.type
+ * string
+ * The Content-Disposition, e.g. 'attachment'.
+ *
+ *
+ * disposition
+ * array
+ * An associative array of Content-Disposition parameter names and values.
+ *
+ *
+ * contents.data
+ * string
+ * The payload.
+ *
+ *
+ * lines
+ * int
+ * The size of the payload in lines.
+ *
+ *
+ * bytes
+ * int
+ * The size of the payload in bytes.
+ *
+ *
+ * md5
+ * string
+ * The MD5 checksum of the payload.
+ *
+ *
+ *
+ *
+ * @return string Returns the MIME message as string.
+ * @throws ImapException
+ *
+ */
+function imap_mail_compose(array $envelope, array $body): string
+{
+ error_clear_last();
+ $result = \imap_mail_compose($envelope, $body);
+ if ($result === false) {
+ throw ImapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Copies mail messages specified by msglist
+ * to specified mailbox.
+ *
+ * @param resource $imap_stream An IMAP stream returned by
+ * imap_open.
+ * @param string $msglist msglist is a range not just message
+ * numbers (as described in RFC2060).
+ * @param string $mailbox The mailbox name, see imap_open for more
+ * information
+ * @param int $options options is a bitmask of one or more of
+ *
+ *
+ *
+ * CP_UID - the sequence numbers contain UIDS
+ *
+ *
+ *
+ *
+ * CP_MOVE - Delete the messages from
+ * the current mailbox after copying
+ *
+ *
+ *
+ * @throws ImapException
+ *
+ */
+function imap_mail_copy($imap_stream, string $msglist, string $mailbox, int $options = 0): void
+{
+ error_clear_last();
+ $result = \imap_mail_copy($imap_stream, $msglist, $mailbox, $options);
+ if ($result === false) {
+ throw ImapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Moves mail messages specified by msglist to the
+ * specified mailbox.
+ *
+ * @param resource $imap_stream An IMAP stream returned by
+ * imap_open.
+ * @param string $msglist msglist is a range not just message numbers
+ * (as described in RFC2060).
+ * @param string $mailbox The mailbox name, see imap_open for more
+ * information
+ * @param int $options options is a bitmask and may contain the single option:
+ *
+ *
+ *
+ * CP_UID - the sequence numbers contain UIDS
+ *
+ *
+ *
+ * @throws ImapException
+ *
+ */
+function imap_mail_move($imap_stream, string $msglist, string $mailbox, int $options = 0): void
+{
+ error_clear_last();
+ $result = \imap_mail_move($imap_stream, $msglist, $mailbox, $options);
+ if ($result === false) {
+ throw ImapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function allows sending of emails with correct handling of
+ * Cc and Bcc receivers.
+ *
+ * The parameters to, cc
+ * and bcc are all strings and are all parsed
+ * as RFC822 address lists.
+ *
+ * @param string $to The receiver
+ * @param string $subject The mail subject
+ * @param string $message The mail body, see imap_mail_compose
+ * @param string $additional_headers As string with additional headers to be set on the mail
+ * @param string $cc
+ * @param string $bcc The receivers specified in bcc will get the
+ * mail, but are excluded from the headers.
+ * @param string $rpath Use this parameter to specify return path upon mail delivery failure.
+ * This is useful when using PHP as a mail client for multiple users.
+ * @throws ImapException
+ *
+ */
+function imap_mail(string $to, string $subject, string $message, string $additional_headers = null, string $cc = null, string $bcc = null, string $rpath = null): void
+{
+ error_clear_last();
+ $result = \imap_mail($to, $subject, $message, $additional_headers, $cc, $bcc, $rpath);
+ if ($result === false) {
+ throw ImapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Checks the current mailbox status on the server. It is similar to
+ * imap_status, but will additionally sum up the size of
+ * all messages in the mailbox, which will take some additional time to
+ * execute.
+ *
+ * @param resource $imap_stream An IMAP stream returned by
+ * imap_open.
+ * @return \stdClass Returns the information in an object with following properties:
+ *
+ * Mailbox properties
+ *
+ *
+ *
+ * Date
+ * date of last change (current datetime)
+ *
+ *
+ * Driver
+ * driver
+ *
+ *
+ * Mailbox
+ * name of the mailbox
+ *
+ *
+ * Nmsgs
+ * number of messages
+ *
+ *
+ * Recent
+ * number of recent messages
+ *
+ *
+ * Unread
+ * number of unread messages
+ *
+ *
+ * Deleted
+ * number of deleted messages
+ *
+ *
+ * Size
+ * mailbox size
+ *
+ *
+ *
+ *
+ *
+ * Returns FALSE on failure.
+ * @throws ImapException
+ *
+ */
+function imap_mailboxmsginfo($imap_stream): \stdClass
+{
+ error_clear_last();
+ $result = \imap_mailboxmsginfo($imap_stream);
+ if ($result === false) {
+ throw ImapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Decode a modified UTF-7 (as specified in RFC 2060, section 5.1.3) string to UTF-8.
+ *
+ * @param string $in A string encoded in modified UTF-7.
+ * @return string Returns in converted to UTF-8.
+ * @throws ImapException
+ *
+ */
+function imap_mutf7_to_utf8(string $in): string
+{
+ error_clear_last();
+ $result = \imap_mutf7_to_utf8($in);
+ if ($result === false) {
+ throw ImapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Gets the number of messages in the current mailbox.
+ *
+ * @param resource $imap_stream An IMAP stream returned by
+ * imap_open.
+ * @return int Return the number of messages in the current mailbox, as an integer.
+ * @throws ImapException
+ *
+ */
+function imap_num_msg($imap_stream): int
+{
+ error_clear_last();
+ $result = \imap_num_msg($imap_stream);
+ if ($result === false) {
+ throw ImapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Opens an IMAP stream to a mailbox.
+ *
+ * This function can also be used to open streams to POP3 and
+ * NNTP servers, but some functions and features are only
+ * available on IMAP servers.
+ *
+ * @param string $mailbox A mailbox name consists of a server and a mailbox path on this server.
+ * The special name INBOX stands for the current users
+ * personal mailbox. Mailbox names that contain international characters
+ * besides those in the printable ASCII space have to be encoded with
+ * imap_utf7_encode.
+ *
+ * The server part, which is enclosed in '{' and '}', consists of the servers
+ * name or ip address, an optional port (prefixed by ':'), and an optional
+ * protocol specification (prefixed by '/').
+ *
+ * The server part is mandatory in all mailbox
+ * parameters.
+ *
+ * All names which start with { are remote names, and are
+ * in the form "{" remote_system_name [":" port] [flags] "}"
+ * [mailbox_name] where:
+ *
+ *
+ *
+ * remote_system_name - Internet domain name or
+ * bracketed IP address of server.
+ *
+ *
+ *
+ *
+ * port - optional TCP port number, default is the
+ * default port for that service
+ *
+ *
+ *
+ *
+ * flags - optional flags, see following table.
+ *
+ *
+ *
+ *
+ * mailbox_name - remote mailbox name, default is INBOX
+ *
+ *
+ *
+ *
+ *
+ * Optional flags for names
+ *
+ *
+ *
+ * Flag
+ * Description
+ *
+ *
+ *
+ *
+ * /service=service
+ * mailbox access service, default is "imap"
+ *
+ *
+ * /user=user
+ * remote user name for login on the server
+ *
+ *
+ * /authuser=user
+ * remote authentication user; if specified this is the user name
+ * whose password is used (e.g. administrator)
+ *
+ *
+ * /anonymous
+ * remote access as anonymous user
+ *
+ *
+ * /debug
+ * record protocol telemetry in application's debug log
+ *
+ *
+ * /secure
+ * do not transmit a plaintext password over the network
+ *
+ *
+ * /imap, /imap2,
+ * /imap2bis, /imap4,
+ * /imap4rev1
+ * equivalent to /service=imap
+ *
+ *
+ * /pop3
+ * equivalent to /service=pop3
+ *
+ *
+ * /nntp
+ * equivalent to /service=nntp
+ *
+ *
+ * /norsh
+ * do not use rsh or ssh to establish a preauthenticated IMAP
+ * session
+ *
+ *
+ * /ssl
+ * use the Secure Socket Layer to encrypt the session
+ *
+ *
+ * /validate-cert
+ * validate certificates from TLS/SSL server (this is the default
+ * behavior)
+ *
+ *
+ * /novalidate-cert
+ * do not validate certificates from TLS/SSL server, needed if
+ * server uses self-signed certificates
+ *
+ *
+ * /tls
+ * force use of start-TLS to encrypt the session, and reject
+ * connection to servers that do not support it
+ *
+ *
+ * /notls
+ * do not do start-TLS to encrypt the session, even with servers
+ * that support it
+ *
+ *
+ * /readonly
+ * request read-only mailbox open (IMAP only; ignored on NNTP, and
+ * an error with SMTP and POP3)
+ *
+ *
+ *
+ *
+ * @param string $username The user name
+ * @param string $password The password associated with the username
+ * @param int $options The options are a bit mask with one or more of
+ * the following:
+ *
+ *
+ *
+ * OP_READONLY - Open mailbox read-only
+ *
+ *
+ *
+ *
+ * OP_ANONYMOUS - Don't use or update a
+ * .newsrc for news (NNTP only)
+ *
+ *
+ *
+ *
+ * OP_HALFOPEN - For IMAP
+ * and NNTP names, open a connection but
+ * don't open a mailbox.
+ *
+ *
+ *
+ *
+ * CL_EXPUNGE - Expunge mailbox automatically upon mailbox close
+ * (see also imap_delete and
+ * imap_expunge)
+ *
+ *
+ *
+ *
+ * OP_DEBUG - Debug protocol negotiations
+ *
+ *
+ *
+ *
+ * OP_SHORTCACHE - Short (elt-only) caching
+ *
+ *
+ *
+ *
+ * OP_SILENT - Don't pass up events (internal use)
+ *
+ *
+ *
+ *
+ * OP_PROTOTYPE - Return driver prototype
+ *
+ *
+ *
+ *
+ * OP_SECURE - Don't do non-secure authentication
+ *
+ *
+ *
+ * @param int $n_retries Number of maximum connect attempts
+ * @param array|null $params Connection parameters, the following (string) keys maybe used
+ * to set one or more connection parameters:
+ *
+ *
+ *
+ * DISABLE_AUTHENTICATOR - Disable authentication properties
+ *
+ *
+ *
+ * @return resource Returns an IMAP stream on success.
+ * @throws ImapException
+ *
+ */
+function imap_open(string $mailbox, string $username, string $password, int $options = 0, int $n_retries = 0, ?array $params = null)
+{
+ error_clear_last();
+ $result = \imap_open($mailbox, $username, $password, $options, $n_retries, $params);
+ if ($result === false) {
+ throw ImapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * This function renames on old mailbox to new mailbox (see
+ * imap_open for the format of
+ * mbox names).
+ *
+ * @param resource $imap_stream An IMAP stream returned by
+ * imap_open.
+ * @param string $old_mbox The old mailbox name, see imap_open for more
+ * information
+ * @param string $new_mbox The new mailbox name, see imap_open for more
+ * information
+ * @throws ImapException
+ *
+ */
+function imap_renamemailbox($imap_stream, string $old_mbox, string $new_mbox): void
+{
+ error_clear_last();
+ $result = \imap_renamemailbox($imap_stream, $old_mbox, $new_mbox);
+ if ($result === false) {
+ throw ImapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Saves a part or the whole body of the specified message.
+ *
+ * @param resource $imap_stream An IMAP stream returned by
+ * imap_open.
+ * @param string|resource $file The path to the saved file as a string, or a valid file descriptor
+ * returned by fopen.
+ * @param int $msg_number The message number
+ * @param string $part_number The part number. It is a string of integers delimited by period which
+ * index into a body part list as per the IMAP4 specification
+ * @param int $options A bitmask with one or more of the following:
+ *
+ *
+ *
+ * FT_UID - The msg_number is a UID
+ *
+ *
+ *
+ *
+ * FT_PEEK - Do not set the \Seen flag if
+ * not already set
+ *
+ *
+ *
+ *
+ * FT_INTERNAL - The return string is in
+ * internal format, will not canonicalize to CRLF.
+ *
+ *
+ *
+ * @throws ImapException
+ *
+ */
+function imap_savebody($imap_stream, $file, int $msg_number, string $part_number = "", int $options = 0): void
+{
+ error_clear_last();
+ $result = \imap_savebody($imap_stream, $file, $msg_number, $part_number, $options);
+ if ($result === false) {
+ throw ImapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets an upper limit quota on a per mailbox basis.
+ *
+ * @param resource $imap_stream An IMAP stream returned by
+ * imap_open.
+ * @param string $quota_root The mailbox to have a quota set. This should follow the IMAP standard
+ * format for a mailbox: user.name.
+ * @param int $quota_limit The maximum size (in KB) for the quota_root
+ * @throws ImapException
+ *
+ */
+function imap_set_quota($imap_stream, string $quota_root, int $quota_limit): void
+{
+ error_clear_last();
+ $result = \imap_set_quota($imap_stream, $quota_root, $quota_limit);
+ if ($result === false) {
+ throw ImapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the ACL for a giving mailbox.
+ *
+ * @param resource $imap_stream An IMAP stream returned by
+ * imap_open.
+ * @param string $mailbox The mailbox name, see imap_open for more
+ * information
+ * @param string $id The user to give the rights to.
+ * @param string $rights The rights to give to the user. Passing an empty string will delete
+ * acl.
+ * @throws ImapException
+ *
+ */
+function imap_setacl($imap_stream, string $mailbox, string $id, string $rights): void
+{
+ error_clear_last();
+ $result = \imap_setacl($imap_stream, $mailbox, $id, $rights);
+ if ($result === false) {
+ throw ImapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Causes a store to add the specified flag to the
+ * flags set for the messages in the specified
+ * sequence.
+ *
+ * @param resource $imap_stream An IMAP stream returned by
+ * imap_open.
+ * @param string $sequence A sequence of message numbers. You can enumerate desired messages
+ * with the X,Y syntax, or retrieve all messages
+ * within an interval with the X:Y syntax
+ * @param string $flag The flags which you can set are \Seen,
+ * \Answered, \Flagged,
+ * \Deleted, and \Draft as
+ * defined by RFC2060.
+ * @param int $options A bit mask that may contain the single option:
+ *
+ *
+ *
+ * ST_UID - The sequence argument contains UIDs
+ * instead of sequence numbers
+ *
+ *
+ *
+ * @throws ImapException
+ *
+ */
+function imap_setflag_full($imap_stream, string $sequence, string $flag, int $options = NIL): void
+{
+ error_clear_last();
+ $result = \imap_setflag_full($imap_stream, $sequence, $flag, $options);
+ if ($result === false) {
+ throw ImapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Gets and sorts message numbers by the given parameters.
+ *
+ * @param resource $imap_stream An IMAP stream returned by
+ * imap_open.
+ * @param int $criteria Criteria can be one (and only one) of the following:
+ *
+ *
+ *
+ * SORTDATE - message Date
+ *
+ *
+ *
+ *
+ * SORTARRIVAL - arrival date
+ *
+ *
+ *
+ *
+ * SORTFROM - mailbox in first From address
+ *
+ *
+ *
+ *
+ * SORTSUBJECT - message subject
+ *
+ *
+ *
+ *
+ * SORTTO - mailbox in first To address
+ *
+ *
+ *
+ *
+ * SORTCC - mailbox in first cc address
+ *
+ *
+ *
+ *
+ * SORTSIZE - size of message in octets
+ *
+ *
+ *
+ * @param int $reverse Set this to 1 for reverse sorting
+ * @param int $options The options are a bitmask of one or more of the
+ * following:
+ *
+ *
+ *
+ * SE_UID - Return UIDs instead of sequence numbers
+ *
+ *
+ *
+ *
+ * SE_NOPREFETCH - Don't prefetch searched messages
+ *
+ *
+ *
+ * @param string $search_criteria IMAP2-format search criteria string. For details see
+ * imap_search.
+ * @param string $charset MIME character set to use when sorting strings.
+ * @return array Returns an array of message numbers sorted by the given
+ * parameters.
+ * @throws ImapException
+ *
+ */
+function imap_sort($imap_stream, int $criteria, int $reverse, int $options = 0, string $search_criteria = null, string $charset = null): array
+{
+ error_clear_last();
+ $result = \imap_sort($imap_stream, $criteria, $reverse, $options, $search_criteria, $charset);
+ if ($result === false) {
+ throw ImapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Subscribe to a new mailbox.
+ *
+ * @param resource $imap_stream An IMAP stream returned by
+ * imap_open.
+ * @param string $mailbox The mailbox name, see imap_open for more
+ * information
+ * @throws ImapException
+ *
+ */
+function imap_subscribe($imap_stream, string $mailbox): void
+{
+ error_clear_last();
+ $result = \imap_subscribe($imap_stream, $mailbox);
+ if ($result === false) {
+ throw ImapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Gets a tree of a threaded message.
+ *
+ * @param resource $imap_stream An IMAP stream returned by
+ * imap_open.
+ * @param int $options
+ * @return array imap_thread returns an associative array containing
+ * a tree of messages threaded by REFERENCES.
+ *
+ * Every message in the current mailbox will be represented by three entries
+ * in the resulting array:
+ *
+ *
+ * $thread["XX.num"] - current message number
+ *
+ *
+ * $thread["XX.next"]
+ *
+ *
+ * $thread["XX.branch"]
+ *
+ *
+ * @throws ImapException
+ *
+ */
+function imap_thread($imap_stream, int $options = SE_FREE): array
+{
+ error_clear_last();
+ $result = \imap_thread($imap_stream, $options);
+ if ($result === false) {
+ throw ImapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Sets or fetches the imap timeout.
+ *
+ * @param int $timeout_type One of the following:
+ * IMAP_OPENTIMEOUT,
+ * IMAP_READTIMEOUT,
+ * IMAP_WRITETIMEOUT, or
+ * IMAP_CLOSETIMEOUT.
+ * @param int $timeout The timeout, in seconds.
+ * @return mixed If the timeout parameter is set, this function
+ * returns TRUE on success.
+ *
+ * If timeout is not provided or evaluates to -1,
+ * the current timeout value of timeout_type is
+ * returned as an integer.
+ * @throws ImapException
+ *
+ */
+function imap_timeout(int $timeout_type, int $timeout = -1)
+{
+ error_clear_last();
+ $result = \imap_timeout($timeout_type, $timeout);
+ if ($result === false) {
+ throw ImapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Removes the deletion flag for a specified message, which is set by
+ * imap_delete or imap_mail_move.
+ *
+ * @param resource $imap_stream An IMAP stream returned by
+ * imap_open.
+ * @param int $msg_number The message number
+ * @param int $flags
+ * @throws ImapException
+ *
+ */
+function imap_undelete($imap_stream, int $msg_number, int $flags = 0): void
+{
+ error_clear_last();
+ $result = \imap_undelete($imap_stream, $msg_number, $flags);
+ if ($result === false) {
+ throw ImapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Unsubscribe from the specified mailbox.
+ *
+ * @param resource $imap_stream An IMAP stream returned by
+ * imap_open.
+ * @param string $mailbox The mailbox name, see imap_open for more
+ * information
+ * @throws ImapException
+ *
+ */
+function imap_unsubscribe($imap_stream, string $mailbox): void
+{
+ error_clear_last();
+ $result = \imap_unsubscribe($imap_stream, $mailbox);
+ if ($result === false) {
+ throw ImapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Encode a UTF-8 string to modified UTF-7 (as specified in RFC 2060, section 5.1.3).
+ *
+ * @param string $in A UTF-8 encoded string.
+ * @return string Returns in converted to modified UTF-7.
+ * @throws ImapException
+ *
+ */
+function imap_utf8_to_mutf7(string $in): string
+{
+ error_clear_last();
+ $result = \imap_utf8_to_mutf7($in);
+ if ($result === false) {
+ throw ImapException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/info.php b/vendor/thecodingmachine/safe/generated/info.php
new file mode 100644
index 000000000..1a76b406e
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/info.php
@@ -0,0 +1,511 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\InfoException;
+
+/**
+ * Sets the process title visible in tools such as top and
+ * ps. This function is available only in
+ * CLI mode.
+ *
+ * @param string $title The new title.
+ * @throws InfoException
+ *
+ */
+function cli_set_process_title(string $title): void
+{
+ error_clear_last();
+ $result = \cli_set_process_title($title);
+ if ($result === false) {
+ throw InfoException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Loads the PHP extension given by the parameter
+ * library.
+ *
+ * Use extension_loaded to test whether a given
+ * extension is already available or not. This works on both built-in
+ * extensions and dynamically loaded ones (either through php.ini or
+ * dl).
+ *
+ * @param string $library This parameter is only the filename of the
+ * extension to load which also depends on your platform. For example,
+ * the sockets extension (if compiled
+ * as a shared module, not the default!) would be called
+ * sockets.so on Unix platforms whereas it is called
+ * php_sockets.dll on the Windows platform.
+ *
+ * The directory where the extension is loaded from depends on your
+ * platform:
+ *
+ * Windows - If not explicitly set in the php.ini, the extension is
+ * loaded from C:\php5\ by default.
+ *
+ * Unix - If not explicitly set in the php.ini, the default extension
+ * directory depends on
+ *
+ *
+ *
+ * whether PHP has been built with --enable-debug
+ * or not
+ *
+ *
+ *
+ *
+ * whether PHP has been built with (experimental) ZTS (Zend Thread Safety)
+ * support or not
+ *
+ *
+ *
+ *
+ * the current internal ZEND_MODULE_API_NO (Zend
+ * internal module API number, which is basically the date on which a
+ * major module API change happened, e.g. 20010901)
+ *
+ *
+ *
+ * Taking into account the above, the directory then defaults to
+ * &lt;install-dir&gt;/lib/php/extensions/ &lt;debug-or-not&gt;-&lt;zts-or-not&gt;-ZEND_MODULE_API_NO,
+ * e.g.
+ * /usr/local/php/lib/php/extensions/debug-non-zts-20010901
+ * or
+ * /usr/local/php/lib/php/extensions/no-debug-zts-20010901.
+ * @throws InfoException
+ *
+ */
+function dl(string $library): void
+{
+ error_clear_last();
+ $result = \dl($library);
+ if ($result === false) {
+ throw InfoException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Gets the time of the last modification of the main script of execution.
+ *
+ * If you're interested in getting the last modification time
+ * of a different file, consider using filemtime.
+ *
+ * @return int Returns the time of the last modification of the current
+ * page. The value returned is a Unix timestamp, suitable for
+ * feeding to date.
+ * @throws InfoException
+ *
+ */
+function getlastmod(): int
+{
+ error_clear_last();
+ $result = \getlastmod();
+ if ($result === false) {
+ throw InfoException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ *
+ *
+ * @return int Returns the group ID of the current script.
+ * @throws InfoException
+ *
+ */
+function getmygid(): int
+{
+ error_clear_last();
+ $result = \getmygid();
+ if ($result === false) {
+ throw InfoException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Gets the inode of the current script.
+ *
+ * @return int Returns the current script's inode as an integer.
+ * @throws InfoException
+ *
+ */
+function getmyinode(): int
+{
+ error_clear_last();
+ $result = \getmyinode();
+ if ($result === false) {
+ throw InfoException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Gets the current PHP process ID.
+ *
+ * @return int Returns the current PHP process ID.
+ * @throws InfoException
+ *
+ */
+function getmypid(): int
+{
+ error_clear_last();
+ $result = \getmypid();
+ if ($result === false) {
+ throw InfoException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ *
+ *
+ * @return int Returns the user ID of the current script.
+ * @throws InfoException
+ *
+ */
+function getmyuid(): int
+{
+ error_clear_last();
+ $result = \getmyuid();
+ if ($result === false) {
+ throw InfoException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Parses options passed to the script.
+ *
+ * @param string $options
+ * @param array $longopts
+ * @param int|null $optind
+ * @return array|array|array This function will return an array of option / argument pairs.
+ * @throws InfoException
+ *
+ */
+function getopt(string $options, array $longopts = null, ?int &$optind = null): array
+{
+ error_clear_last();
+ if ($optind !== null) {
+ $result = \getopt($options, $longopts, $optind);
+ } elseif ($longopts !== null) {
+ $result = \getopt($options, $longopts);
+ } else {
+ $result = \getopt($options);
+ }
+ if ($result === false) {
+ throw InfoException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Returns the value of the configuration option on success.
+ *
+ * @param string $varname The configuration option name.
+ * @return string Returns the value of the configuration option as a string on success, or an
+ * empty string for null values. Returns FALSE if the
+ * configuration option doesn't exist.
+ * @throws InfoException
+ *
+ */
+function ini_get(string $varname): string
+{
+ error_clear_last();
+ $result = \ini_get($varname);
+ if ($result === false) {
+ throw InfoException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Sets the value of the given configuration option. The configuration option
+ * will keep this new value during the script's execution, and will be restored
+ * at the script's ending.
+ *
+ * @param string $varname Not all the available options can be changed using
+ * ini_set. There is a list of all available options
+ * in the appendix.
+ * @param string|int|float|bool $newvalue The new value for the option.
+ * @return string Returns the old value on success, FALSE on failure.
+ * @throws InfoException
+ *
+ */
+function ini_set(string $varname, $newvalue): string
+{
+ error_clear_last();
+ $result = \ini_set($varname, $newvalue);
+ if ($result === false) {
+ throw InfoException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * This function prints out the credits listing the PHP developers,
+ * modules, etc. It generates the appropriate HTML codes to insert
+ * the information in a page.
+ *
+ * @param int $flag To generate a custom credits page, you may want to use the
+ * flag parameter.
+ *
+ *
+ * Pre-defined phpcredits flags
+ *
+ *
+ *
+ * name
+ * description
+ *
+ *
+ *
+ *
+ * CREDITS_ALL
+ *
+ * All the credits, equivalent to using: CREDITS_DOCS +
+ * CREDITS_GENERAL + CREDITS_GROUP +
+ * CREDITS_MODULES + CREDITS_FULLPAGE.
+ * It generates a complete stand-alone HTML page with the appropriate tags.
+ *
+ *
+ *
+ * CREDITS_DOCS
+ * The credits for the documentation team
+ *
+ *
+ * CREDITS_FULLPAGE
+ *
+ * Usually used in combination with the other flags. Indicates
+ * that a complete stand-alone HTML page needs to be
+ * printed including the information indicated by the other
+ * flags.
+ *
+ *
+ *
+ * CREDITS_GENERAL
+ *
+ * General credits: Language design and concept, PHP authors
+ * and SAPI module.
+ *
+ *
+ *
+ * CREDITS_GROUP
+ * A list of the core developers
+ *
+ *
+ * CREDITS_MODULES
+ *
+ * A list of the extension modules for PHP, and their authors
+ *
+ *
+ *
+ * CREDITS_SAPI
+ *
+ * A list of the server API modules for PHP, and their authors
+ *
+ *
+ *
+ *
+ *
+ * @throws InfoException
+ *
+ */
+function phpcredits(int $flag = CREDITS_ALL): void
+{
+ error_clear_last();
+ $result = \phpcredits($flag);
+ if ($result === false) {
+ throw InfoException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Outputs a large amount of information about the current state of PHP.
+ * This includes information about PHP compilation options and extensions,
+ * the PHP version, server information and environment (if compiled as a
+ * module), the PHP environment, OS version information, paths, master and
+ * local values of configuration options, HTTP headers, and the PHP License.
+ *
+ * Because every system is setup differently, phpinfo is
+ * commonly used to check configuration settings and for available
+ * predefined variables
+ * on a given system.
+ *
+ * phpinfo is also a valuable debugging tool as it
+ * contains all EGPCS (Environment, GET, POST, Cookie, Server) data.
+ *
+ * @param int $what The output may be customized by passing one or more of the
+ * following constants bitwise values summed
+ * together in the optional what parameter.
+ * One can also combine the respective constants or bitwise values
+ * together with the bitwise or operator.
+ *
+ *
+ * phpinfo options
+ *
+ *
+ *
+ * Name (constant)
+ * Value
+ * Description
+ *
+ *
+ *
+ *
+ * INFO_GENERAL
+ * 1
+ *
+ * The configuration line, php.ini location, build date, Web
+ * Server, System and more.
+ *
+ *
+ *
+ * INFO_CREDITS
+ * 2
+ *
+ * PHP Credits. See also phpcredits.
+ *
+ *
+ *
+ * INFO_CONFIGURATION
+ * 4
+ *
+ * Current Local and Master values for PHP directives. See
+ * also ini_get.
+ *
+ *
+ *
+ * INFO_MODULES
+ * 8
+ *
+ * Loaded modules and their respective settings. See also
+ * get_loaded_extensions.
+ *
+ *
+ *
+ * INFO_ENVIRONMENT
+ * 16
+ *
+ * Environment Variable information that's also available in
+ * $_ENV.
+ *
+ *
+ *
+ * INFO_VARIABLES
+ * 32
+ *
+ * Shows all
+ * predefined variables from EGPCS (Environment, GET,
+ * POST, Cookie, Server).
+ *
+ *
+ *
+ * INFO_LICENSE
+ * 64
+ *
+ * PHP License information. See also the license FAQ.
+ *
+ *
+ *
+ * INFO_ALL
+ * -1
+ *
+ * Shows all of the above.
+ *
+ *
+ *
+ *
+ *
+ * @throws InfoException
+ *
+ */
+function phpinfo(int $what = INFO_ALL): void
+{
+ error_clear_last();
+ $result = \phpinfo($what);
+ if ($result === false) {
+ throw InfoException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Adds setting to the server environment. The
+ * environment variable will only exist for the duration of the current
+ * request. At the end of the request the environment is restored to its
+ * original state.
+ *
+ * @param string $setting The setting, like "FOO=BAR"
+ * @throws InfoException
+ *
+ */
+function putenv(string $setting): void
+{
+ error_clear_last();
+ $result = \putenv($setting);
+ if ($result === false) {
+ throw InfoException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the include_path
+ * configuration option for the duration of the script.
+ *
+ * @param string $new_include_path The new value for the include_path
+ * @return string Returns the old include_path on
+ * success.
+ * @throws InfoException
+ *
+ */
+function set_include_path(string $new_include_path): string
+{
+ error_clear_last();
+ $result = \set_include_path($new_include_path);
+ if ($result === false) {
+ throw InfoException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Set the number of seconds a script is allowed to run. If this is reached,
+ * the script returns a fatal error. The default limit is 30 seconds or, if
+ * it exists, the max_execution_time value defined in the
+ * php.ini.
+ *
+ * When called, set_time_limit restarts the timeout
+ * counter from zero. In other words, if the timeout is the default 30
+ * seconds, and 25 seconds into script execution a call such as
+ * set_time_limit(20) is made, the script will run for a
+ * total of 45 seconds before timing out.
+ *
+ * @param int $seconds The maximum execution time, in seconds. If set to zero, no time limit
+ * is imposed.
+ * @throws InfoException
+ *
+ */
+function set_time_limit(int $seconds): void
+{
+ error_clear_last();
+ $result = \set_time_limit($seconds);
+ if ($result === false) {
+ throw InfoException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/ingres-ii.php b/vendor/thecodingmachine/safe/generated/ingres-ii.php
new file mode 100644
index 000000000..9ea8b5f35
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/ingres-ii.php
@@ -0,0 +1,720 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\IngresiiException;
+
+/**
+ * ingres_autocommit is called before opening a
+ * transaction (before the first call to
+ * ingres_query or just after a call to
+ * ingres_rollback or
+ * ingres_commit) to switch the
+ * autocommit mode of the server on or off (when the script begins
+ * the autocommit mode is off).
+ *
+ * When autocommit mode is on, every query is automatically
+ * committed by the server, as if ingres_commit
+ * was called after every call to ingres_query.
+ * To see if autocommit is enabled use,
+ * ingres_autocommit_state.
+ *
+ * By default Ingres will rollback any uncommitted transactions at the end of
+ * a request. Use this function or ingres_commit to
+ * ensure your data is committed to the database.
+ *
+ * @param resource $link The connection link identifier
+ * @throws IngresiiException
+ *
+ */
+function ingres_autocommit($link): void
+{
+ error_clear_last();
+ $result = \ingres_autocommit($link);
+ if ($result === false) {
+ throw IngresiiException::createFromPhpError();
+ }
+}
+
+
+/**
+ * ingres_close closes the connection to
+ * the Ingres server that is associated with the specified link.
+ *
+ * ingres_close is usually unnecessary, as it
+ * will not close persistent connections and all non-persistent connections
+ * are automatically closed at the end of the script.
+ *
+ * @param resource $link The connection link identifier
+ * @throws IngresiiException
+ *
+ */
+function ingres_close($link): void
+{
+ error_clear_last();
+ $result = \ingres_close($link);
+ if ($result === false) {
+ throw IngresiiException::createFromPhpError();
+ }
+}
+
+
+/**
+ * ingres_commit commits the currently open
+ * transaction, making all changes made to the database permanent.
+ *
+ * This closes the transaction. A new transaction can be opened by sending a
+ * query with ingres_query.
+ *
+ * You can also have the server commit automatically after every
+ * query by calling ingres_autocommit before
+ * opening the transaction.
+ *
+ * By default Ingres will roll back any uncommitted transactions at the end of
+ * a request. Use this function or ingres_autocommit to
+ * ensure your that data is committed to the database.
+ *
+ * @param resource $link The connection link identifier
+ * @throws IngresiiException
+ *
+ */
+function ingres_commit($link): void
+{
+ error_clear_last();
+ $result = \ingres_commit($link);
+ if ($result === false) {
+ throw IngresiiException::createFromPhpError();
+ }
+}
+
+
+/**
+ * ingres_connect opens a connection with the
+ * given Ingres database.
+ *
+ * The connection is closed when the script ends or when
+ * ingres_close is called on this link.
+ *
+ * @param string $database The database name. Must follow the syntax:
+ *
+ * [vnode::]dbname[/svr_class]
+ * @param string $username The Ingres user name
+ * @param string $password The password associated with username
+ * @param array $options ingres_connect options
+ *
+ *
+ *
+ *
+ * Option name
+ * Option type
+ * Description
+ * Example
+ *
+ *
+ *
+ *
+ * date_century_boundary
+ * integer
+ * The threshold by which a 2-digit year is determined to be in
+ * the current century or in the next century. Equivalent to II_DATE_CENTURY_BOUNDARY.
+ * 50
+ *
+ *
+ * group
+ * string
+ * Specifies the group ID of the user, equivalent to the "-G"
+ * flag
+ * payroll
+ *
+ *
+ * role
+ * string
+ * The role ID of the application. If a role password is
+ * required, the parameter value should be specified as "role/password"
+ *
+ *
+ * effective_user
+ * string
+ * The ingres user account being impersonated, equivalent to the "-u" flag
+ * another_user
+ *
+ *
+ * dbms_password
+ * string
+ * The internal database password for the user connecting to Ingres
+ * s3cr3t
+ *
+ *
+ * table_structure
+ * string
+ *
+ * The default structure for new tables.
+ * Valid values for table_structure are:
+ *
+ * INGRES_STRUCTURE_BTREE
+ * INGRES_STRUCTURE_HASH
+ * INGRES_STRUCTURE_HEAP
+ * INGRES_STRUCTURE_ISAM
+ * INGRES_STRUCTURE_CBTREE
+ * INGRES_STRUCTURE_CISAM
+ * INGRES_STRUCTURE_CHASH
+ * INGRES_STRUCTURE_CHEAP
+ *
+ *
+ *
+ * INGRES_STRUCTURE_BTREE
+ *
+ *
+ * index_structure
+ * string
+ *
+ * The default structure for new secondary indexes. Valid values
+ * for index_structure are:
+ *
+ * INGRES_STRUCTURE_CBTREE
+ * INGRES_STRUCTURE_CISAM
+ * INGRES_STRUCTURE_CHASH
+ * INGRES_STRUCTURE_BTREE
+ * INGRES_STRUCTURE_HASH
+ * INGRES_STRUCTURE_ISAM
+ *
+ *
+ *
+ * INGRES_STRUCTURE_HASH
+ *
+ *
+ * login_local
+ * boolean
+ * Determines how the connection user ID and password are
+ * used when a VNODE is included in the target database string.
+ * If set to TRUE, the user ID and password are used to locally access
+ * the VNODE, and the VNODE login information is used to establish the DBMS
+ * connection. If set to FALSE, the process user ID is used to access
+ * the VNODE, and the connection user ID and password are used in place
+ * of the VNODE login information to establish the DBMS connection.
+ * This parameter is ignored if no VNODE is included in the target
+ * database string. The default is FALSE.
+ * TRUE
+ *
+ *
+ * timezone
+ * string
+ * Controls the timezone of the session. If not set it will
+ * default to the value defined by II_TIMEZONE_NAME. If
+ * II_TIMEZONE_NAME is not defined, NA-PACIFIC (GMT-8 with Daylight
+ * Savings) is used.
+ *
+ *
+ * date_format
+ * integer
+ * Sets the allowable input and output format for Ingres dates.
+ * Defaults to the value defined by II_DATE_FORMAT. If II_DATE_FORMAT is
+ * not set the default date format is US, e.g. mm/dd/yy. Valid values
+ * for date_format are:
+ *
+ * INGRES_DATE_DMY
+ * INGRES_DATE_FINISH
+ * INGRES_DATE_GERMAN
+ * INGRES_DATE_ISO
+ * INGRES_DATE_ISO4
+ * INGRES_DATE_MDY
+ * INGRES_DATE_MULTINATIONAL
+ * INGRES_DATE_MULTINATIONAL4
+ * INGRES_DATE_YMD
+ * INGRES_DATE_US
+ *
+ *
+ *
+ * INGRES_DATE_MULTINATIONAL4
+ *
+ *
+ * decimal_separator
+ * string
+ * The character identifier for decimal data
+ * ","
+ *
+ *
+ * money_lort
+ * integer
+ * Leading or trailing currency sign. Valid values for money_lort
+ * are:
+ *
+ * INGRES_MONEY_LEADING
+ * INGRES_MONEY_TRAILING
+ *
+ *
+ *
+ * INGRES_MONEY_TRAILING
+ *
+ *
+ * money_sign
+ * string
+ * The currency symbol to be used with the MONEY datatype
+ * €
+ *
+ *
+ * money_precision
+ * integer
+ * The precision of the MONEY datatype
+ * 3
+ *
+ *
+ * float4_precision
+ * integer
+ * Precision of the FLOAT4 datatype
+ * 10
+ *
+ *
+ * float8_precision
+ * integer
+ * Precision of the FLOAT8 data
+ * 10
+ *
+ *
+ * blob_segment_length
+ * integer
+ * The amount of data in bytes to fetch at a time when retrieving
+ * BLOB or CLOB data, defaults to 4096 bytes when not explicitly set
+ * 8192
+ *
+ *
+ *
+ *
+ *
+ * The default structure for new tables.
+ * Valid values for table_structure are:
+ *
+ * INGRES_STRUCTURE_BTREE
+ * INGRES_STRUCTURE_HASH
+ * INGRES_STRUCTURE_HEAP
+ * INGRES_STRUCTURE_ISAM
+ * INGRES_STRUCTURE_CBTREE
+ * INGRES_STRUCTURE_CISAM
+ * INGRES_STRUCTURE_CHASH
+ * INGRES_STRUCTURE_CHEAP
+ *
+ *
+ * The default structure for new secondary indexes. Valid values
+ * for index_structure are:
+ *
+ * INGRES_STRUCTURE_CBTREE
+ * INGRES_STRUCTURE_CISAM
+ * INGRES_STRUCTURE_CHASH
+ * INGRES_STRUCTURE_BTREE
+ * INGRES_STRUCTURE_HASH
+ * INGRES_STRUCTURE_ISAM
+ *
+ *
+ * Sets the allowable input and output format for Ingres dates.
+ * Defaults to the value defined by II_DATE_FORMAT. If II_DATE_FORMAT is
+ * not set the default date format is US, e.g. mm/dd/yy. Valid values
+ * for date_format are:
+ *
+ * INGRES_DATE_DMY
+ * INGRES_DATE_FINISH
+ * INGRES_DATE_GERMAN
+ * INGRES_DATE_ISO
+ * INGRES_DATE_ISO4
+ * INGRES_DATE_MDY
+ * INGRES_DATE_MULTINATIONAL
+ * INGRES_DATE_MULTINATIONAL4
+ * INGRES_DATE_YMD
+ * INGRES_DATE_US
+ *
+ *
+ * Leading or trailing currency sign. Valid values for money_lort
+ * are:
+ *
+ * INGRES_MONEY_LEADING
+ * INGRES_MONEY_TRAILING
+ *
+ * @return resource Returns a Ingres link resource on success
+ * @throws IngresiiException
+ *
+ */
+function ingres_connect(string $database = null, string $username = null, string $password = null, array $options = null)
+{
+ error_clear_last();
+ if ($options !== null) {
+ $result = \ingres_connect($database, $username, $password, $options);
+ } elseif ($password !== null) {
+ $result = \ingres_connect($database, $username, $password);
+ } elseif ($username !== null) {
+ $result = \ingres_connect($database, $username);
+ } elseif ($database !== null) {
+ $result = \ingres_connect($database);
+ } else {
+ $result = \ingres_connect();
+ }
+ if ($result === false) {
+ throw IngresiiException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Execute a query prepared using ingres_prepare.
+ *
+ * @param resource $result The result query identifier
+ * @param array $params An array of parameter values to be used with the query
+ * @param string $types A string containing a sequence of types for the parameter values
+ * passed. See the types parameter in
+ * ingres_query for the list of type codes.
+ * @throws IngresiiException
+ *
+ */
+function ingres_execute($result, array $params = null, string $types = null): void
+{
+ error_clear_last();
+ if ($types !== null) {
+ $result = \ingres_execute($result, $params, $types);
+ } elseif ($params !== null) {
+ $result = \ingres_execute($result, $params);
+ } else {
+ $result = \ingres_execute($result);
+ }
+ if ($result === false) {
+ throw IngresiiException::createFromPhpError();
+ }
+}
+
+
+/**
+ * ingres_field_name returns the name of a field
+ * in a query result.
+ *
+ * @param resource $result The query result identifier
+ * @param int $index index is the field whose name will be
+ * retrieved.
+ *
+ * The possible values of index depend upon
+ * the value
+ * of ingres.array_index_start.
+ * If ingres.array_index_start
+ * is 1 (the default)
+ * then index must be
+ * between 1 and the value returned
+ * by ingres_num_fields. If ingres.array_index_start
+ * is 0 then index must
+ * be between 0
+ * and ingres_num_fields -
+ * 1.
+ * @return string Returns the name of a field
+ * in a query result
+ * @throws IngresiiException
+ *
+ */
+function ingres_field_name($result, int $index): string
+{
+ error_clear_last();
+ $result = \ingres_field_name($result, $index);
+ if ($result === false) {
+ throw IngresiiException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Get the type of a field in a query result.
+ *
+ * @param resource $result The query result identifier
+ * @param int $index index is the field whose type will be
+ * retrieved.
+ *
+ * The possible values of index depend upon
+ * the value
+ * of ingres.array_index_start.
+ * If ingres.array_index_start
+ * is 1 (the default)
+ * then index must be
+ * between 1 and the value returned
+ * by ingres_num_fields. If ingres.array_index_start
+ * is 0 then index must
+ * be between 0
+ * and ingres_num_fields -
+ * 1.
+ * @return string ingres_field_type returns the type of a
+ * field in a query result. Examples of
+ * types returned are IIAPI_BYTE_TYPE,
+ * IIAPI_CHA_TYPE, IIAPI_DTE_TYPE,
+ * IIAPI_FLT_TYPE, IIAPI_INT_TYPE,
+ * IIAPI_VCH_TYPE. Some of these types can map to more
+ * than one SQL type depending on the length of the field (see
+ * ingres_field_length). For example
+ * IIAPI_FLT_TYPE can be a float4 or a float8. For detailed
+ * information, see the Ingres OpenAPI User Guide, Appendix
+ * "Data Types" in the Ingres documentation.
+ * @throws IngresiiException
+ *
+ */
+function ingres_field_type($result, int $index): string
+{
+ error_clear_last();
+ $result = \ingres_field_type($result, $index);
+ if ($result === false) {
+ throw IngresiiException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ *
+ *
+ * @param resource $result The query result identifier
+ * @throws IngresiiException
+ *
+ */
+function ingres_free_result($result): void
+{
+ error_clear_last();
+ $result = \ingres_free_result($result);
+ if ($result === false) {
+ throw IngresiiException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Open a persistent connection to an Ingres database.
+ *
+ * There are only two differences between this function and
+ * ingres_connect: First, when connecting, the
+ * function will initially try to find a (persistent) link that is
+ * already opened with the same parameters. If one is found, an
+ * identifier for it will be returned instead of opening a new
+ * connection. Second, the connection to the Ingres server will not
+ * be closed when the execution of the script ends. Instead, the
+ * link will remain open for future use
+ * (ingres_close will not close links
+ * established by ingres_pconnect). This type
+ * of link is therefore called "persistent".
+ *
+ * @param string $database The database name. Must follow the syntax:
+ *
+ * [vnode::]dbname[/svr_class]
+ * @param string $username The Ingres user name
+ * @param string $password The password associated with username
+ * @param array $options See ingres_connect for the list of options that
+ * can be passed
+ * @return resource Returns an Ingres link resource on success
+ * @throws IngresiiException
+ *
+ */
+function ingres_pconnect(string $database = null, string $username = null, string $password = null, array $options = null)
+{
+ error_clear_last();
+ if ($options !== null) {
+ $result = \ingres_pconnect($database, $username, $password, $options);
+ } elseif ($password !== null) {
+ $result = \ingres_pconnect($database, $username, $password);
+ } elseif ($username !== null) {
+ $result = \ingres_pconnect($database, $username);
+ } elseif ($database !== null) {
+ $result = \ingres_pconnect($database);
+ } else {
+ $result = \ingres_pconnect();
+ }
+ if ($result === false) {
+ throw IngresiiException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * This function is used to position the cursor associated with the result
+ * resource before issuing a fetch. If ingres.array_index_start
+ * is set to 0 then the first row is 0 else it is 1.
+ * ingres_result_seek can be used only with queries that
+ * make use of scrollable
+ * cursors. It cannot be used with
+ * ingres_unbuffered_query.
+ *
+ * @param resource $result The result identifier for a query
+ * @param int $position The row to position the cursor on. If ingres.array_index_start
+ * is set to 0, then the first row is 0, else it is 1
+ * @throws IngresiiException
+ *
+ */
+function ingres_result_seek($result, int $position): void
+{
+ error_clear_last();
+ $result = \ingres_result_seek($result, $position);
+ if ($result === false) {
+ throw IngresiiException::createFromPhpError();
+ }
+}
+
+
+/**
+ * ingres_rollback rolls back the currently
+ * open transaction, actually cancelling all changes made to the
+ * database during the transaction.
+ *
+ * This closes the transaction. A new transaction can be opened by sending a
+ * query with ingres_query.
+ *
+ * @param resource $link The connection link identifier
+ * @throws IngresiiException
+ *
+ */
+function ingres_rollback($link): void
+{
+ error_clear_last();
+ $result = \ingres_rollback($link);
+ if ($result === false) {
+ throw IngresiiException::createFromPhpError();
+ }
+}
+
+
+/**
+ * ingres_set_environment is called to set environmental
+ * options that affect the output of certain values from Ingres, such as the
+ * timezone, date format, decimal character separator, and float precision.
+ *
+ * @param resource $link The connection link identifier
+ * @param array $options An enumerated array of option name/value pairs. The following table
+ * lists the option name and the expected type
+ *
+ *
+ *
+ *
+ *
+ * Option name
+ * Option type
+ * Description
+ * Example
+ *
+ *
+ *
+ *
+ * date_century_boundary
+ * integer
+ * The threshold by which a 2-digit year is determined to be in
+ * the current century or in the next century. Equivalent to II_DATE_CENTURY_BOUNDARY
+ * 50
+ *
+ *
+ * timezone
+ * string
+ * Controls the timezone of the session. If not set, it will
+ * default the value defined by II_TIMEZONE_NAME. If
+ * II_TIMEZONE_NAME is not defined, NA-PACIFIC (GMT-8 with Daylight
+ * Savings) is used.
+ * UNITED-KINGDOM
+ *
+ *
+ * date_format
+ * integer
+ * Sets the allowable input and output format for Ingres dates.
+ * Defaults to the value defined by II_DATE_FORMAT. If II_DATE_FORMAT is
+ * not set, the default date format is US, for example mm/dd/yy. Valid values
+ * for date_format are:
+ *
+ * INGRES_DATE_DMY
+ * INGRES_DATE_FINISH
+ * INGRES_DATE_GERMAN
+ * INGRES_DATE_ISO
+ * INGRES_DATE_ISO4
+ * INGRES_DATE_MDY
+ * INGRES_DATE_MULTINATIONAL
+ * INGRES_DATE_MULTINATIONAL4
+ * INGRES_DATE_YMD
+ * INGRES_DATE_US
+ *
+ *
+ *
+ * INGRES_DATE_ISO4
+ *
+ *
+ * decimal_separator
+ * string
+ * The character identifier for decimal data
+ * ","
+ *
+ *
+ * money_lort
+ * integer
+ * Leading or trailing currency sign. Valid values for money_lort
+ * are:
+ *
+ * INGRES_MONEY_LEADING
+ * INGRES_MONEY_TRAILING
+ *
+ *
+ *
+ * INGRES_MONEY_LEADING
+ *
+ *
+ * money_sign
+ * string
+ * The currency symbol to be used with the MONEY datatype
+ * €
+ *
+ *
+ * money_precision
+ * integer
+ * The precision of the MONEY datatype
+ * 2
+ *
+ *
+ * float4_precision
+ * integer
+ * Precision of the FLOAT4 datatype
+ * 10
+ *
+ *
+ * float8_precision
+ * integer
+ * Precision of the FLOAT8 data
+ * 10
+ *
+ *
+ * blob_segment_length
+ * integer
+ * The amount of data in bytes to fetch at a time when retrieving
+ * BLOB or CLOB data. Defaults to 4096 bytes when not set explicitly
+ * 8192
+ *
+ *
+ *
+ *
+ *
+ * Sets the allowable input and output format for Ingres dates.
+ * Defaults to the value defined by II_DATE_FORMAT. If II_DATE_FORMAT is
+ * not set, the default date format is US, for example mm/dd/yy. Valid values
+ * for date_format are:
+ *
+ * INGRES_DATE_DMY
+ * INGRES_DATE_FINISH
+ * INGRES_DATE_GERMAN
+ * INGRES_DATE_ISO
+ * INGRES_DATE_ISO4
+ * INGRES_DATE_MDY
+ * INGRES_DATE_MULTINATIONAL
+ * INGRES_DATE_MULTINATIONAL4
+ * INGRES_DATE_YMD
+ * INGRES_DATE_US
+ *
+ *
+ * Leading or trailing currency sign. Valid values for money_lort
+ * are:
+ *
+ * INGRES_MONEY_LEADING
+ * INGRES_MONEY_TRAILING
+ *
+ * @throws IngresiiException
+ *
+ */
+function ingres_set_environment($link, array $options): void
+{
+ error_clear_last();
+ $result = \ingres_set_environment($link, $options);
+ if ($result === false) {
+ throw IngresiiException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/inotify.php b/vendor/thecodingmachine/safe/generated/inotify.php
new file mode 100644
index 000000000..2e0704159
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/inotify.php
@@ -0,0 +1,44 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\InotifyException;
+
+/**
+ * Initialize an inotify instance for use with
+ * inotify_add_watch
+ *
+ * @return resource A stream resource.
+ * @throws InotifyException
+ *
+ */
+function inotify_init()
+{
+ error_clear_last();
+ $result = \inotify_init();
+ if ($result === false) {
+ throw InotifyException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * inotify_rm_watch removes the watch
+ * watch_descriptor from the inotify instance
+ * inotify_instance.
+ *
+ * @param resource $inotify_instance Resource returned by
+ * inotify_init
+ * @param int $watch_descriptor Watch to remove from the instance
+ * @throws InotifyException
+ *
+ */
+function inotify_rm_watch($inotify_instance, int $watch_descriptor): void
+{
+ error_clear_last();
+ $result = \inotify_rm_watch($inotify_instance, $watch_descriptor);
+ if ($result === false) {
+ throw InotifyException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/json.php b/vendor/thecodingmachine/safe/generated/json.php
new file mode 100644
index 000000000..dad455ccd
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/json.php
@@ -0,0 +1,73 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\JsonException;
+
+/**
+ * Returns a string containing the JSON representation of the supplied
+ * value.
+ *
+ * The encoding is affected by the supplied options
+ * and additionally the encoding of float values depends on the value of
+ * serialize_precision.
+ *
+ * @param mixed $value The value being encoded. Can be any type except
+ * a resource.
+ *
+ * All string data must be UTF-8 encoded.
+ *
+ * PHP implements a superset of JSON as specified in the original
+ * RFC 7159.
+ * @param int $options Bitmask consisting of
+ * JSON_FORCE_OBJECT,
+ * JSON_HEX_QUOT,
+ * JSON_HEX_TAG,
+ * JSON_HEX_AMP,
+ * JSON_HEX_APOS,
+ * JSON_INVALID_UTF8_IGNORE,
+ * JSON_INVALID_UTF8_SUBSTITUTE,
+ * JSON_NUMERIC_CHECK,
+ * JSON_PARTIAL_OUTPUT_ON_ERROR,
+ * JSON_PRESERVE_ZERO_FRACTION,
+ * JSON_PRETTY_PRINT,
+ * JSON_UNESCAPED_LINE_TERMINATORS,
+ * JSON_UNESCAPED_SLASHES,
+ * JSON_UNESCAPED_UNICODE,
+ * JSON_THROW_ON_ERROR.
+ * The behaviour of these constants is described on the
+ * JSON constants page.
+ * @param int $depth Set the maximum depth. Must be greater than zero.
+ * @return string Returns a JSON encoded string on success.
+ * @throws JsonException
+ *
+ */
+function json_encode($value, int $options = 0, int $depth = 512): string
+{
+ error_clear_last();
+ $result = \json_encode($value, $options, $depth);
+ if ($result === false) {
+ throw JsonException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Returns the error string of the last json_encode or json_decode
+ * call, which did not specify JSON_THROW_ON_ERROR.
+ *
+ * @return string Returns the error message on success, "No error" if no
+ * error has occurred.
+ * @throws JsonException
+ *
+ */
+function json_last_error_msg(): string
+{
+ error_clear_last();
+ $result = \json_last_error_msg();
+ if ($result === false) {
+ throw JsonException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/ldap.php b/vendor/thecodingmachine/safe/generated/ldap.php
new file mode 100644
index 000000000..871f29580
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/ldap.php
@@ -0,0 +1,1603 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\LdapException;
+
+/**
+ * Does the same thing as ldap_add but returns the LDAP result resource to be parsed with ldap_parse_result.
+ *
+ * @param resource $link_identifier
+ * @param string $dn
+ * @param array $entry
+ * @param array $serverctrls
+ * @return resource Returns an LDAP result identifier.
+ * @throws LdapException
+ *
+ */
+function ldap_add_ext($link_identifier, string $dn, array $entry, array $serverctrls = null)
+{
+ error_clear_last();
+ $result = \ldap_add_ext($link_identifier, $dn, $entry, $serverctrls);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Add entries in the LDAP directory.
+ *
+ * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect.
+ * @param string $dn The distinguished name of an LDAP entity.
+ * @param array $entry An array that specifies the information about the entry. The values in
+ * the entries are indexed by individual attributes.
+ * In case of multiple values for an attribute, they are indexed using
+ * integers starting with 0.
+ *
+ *
+ *
+ * ]]>
+ *
+ *
+ * @param array $serverctrls Array of LDAP Controls to send with the request.
+ * @throws LdapException
+ *
+ */
+function ldap_add($link_identifier, string $dn, array $entry, array $serverctrls = null): void
+{
+ error_clear_last();
+ $result = \ldap_add($link_identifier, $dn, $entry, $serverctrls);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Does the same thing as ldap_bind but returns the LDAP result resource to be parsed with ldap_parse_result.
+ *
+ * @param resource $link_identifier
+ * @param string|null $bind_rdn
+ * @param string|null $bind_password
+ * @param array $serverctrls
+ * @return resource Returns an LDAP result identifier.
+ * @throws LdapException
+ *
+ */
+function ldap_bind_ext($link_identifier, ?string $bind_rdn = null, ?string $bind_password = null, array $serverctrls = null)
+{
+ error_clear_last();
+ $result = \ldap_bind_ext($link_identifier, $bind_rdn, $bind_password, $serverctrls);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Binds to the LDAP directory with specified RDN and password.
+ *
+ * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect.
+ * @param string|null $bind_rdn
+ * @param string|null $bind_password
+ * @throws LdapException
+ *
+ */
+function ldap_bind($link_identifier, ?string $bind_rdn = null, ?string $bind_password = null): void
+{
+ error_clear_last();
+ $result = \ldap_bind($link_identifier, $bind_rdn, $bind_password);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Retrieve the pagination information send by the server.
+ *
+ * @param resource $link An LDAP link identifier, returned by ldap_connect.
+ * @param resource $result
+ * @param string|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();
+ $result = \ldap_control_paged_result_response($link, $result, $cookie, $estimated);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Enable LDAP pagination by sending the pagination control (page size, cookie...).
+ *
+ * @param resource $link An LDAP link identifier, returned by ldap_connect.
+ * @param int $pagesize The number of entries by page.
+ * @param bool $iscritical Indicates whether the pagination is critical or not.
+ * If true and if the server doesn't support pagination, the search
+ * will return no result.
+ * @param string $cookie An opaque structure sent by the server
+ * (ldap_control_paged_result_response).
+ * @throws LdapException
+ *
+ */
+function ldap_control_paged_result($link, int $pagesize, bool $iscritical = false, string $cookie = ""): void
+{
+ error_clear_last();
+ $result = \ldap_control_paged_result($link, $pagesize, $iscritical, $cookie);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Returns the number of entries stored in the result of previous search
+ * operations.
+ *
+ * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect.
+ * @param resource $result_identifier The internal LDAP result.
+ * @return int Returns number of entries in the result.
+ * @throws LdapException
+ *
+ */
+function ldap_count_entries($link_identifier, $result_identifier): int
+{
+ error_clear_last();
+ $result = \ldap_count_entries($link_identifier, $result_identifier);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Does the same thing as ldap_delete but returns the LDAP result resource to be parsed with ldap_parse_result.
+ *
+ * @param resource $link_identifier
+ * @param string $dn
+ * @param array $serverctrls
+ * @return resource Returns an LDAP result identifier.
+ * @throws LdapException
+ *
+ */
+function ldap_delete_ext($link_identifier, string $dn, array $serverctrls = null)
+{
+ error_clear_last();
+ $result = \ldap_delete_ext($link_identifier, $dn, $serverctrls);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Deletes a particular entry in LDAP directory.
+ *
+ * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect.
+ * @param string $dn The distinguished name of an LDAP entity.
+ * @param array $serverctrls Array of LDAP Controls to send with the request.
+ * @throws LdapException
+ *
+ */
+function ldap_delete($link_identifier, string $dn, array $serverctrls = null): void
+{
+ error_clear_last();
+ $result = \ldap_delete($link_identifier, $dn, $serverctrls);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Performs a PASSWD extended operation.
+ *
+ * @param resource $link An LDAP link identifier, returned by ldap_connect.
+ * @param string $user dn of the user to change the password of.
+ * @param string $oldpw The old password of this user. May be ommited depending of server configuration.
+ * @param string $newpw The new password for this user. May be omitted or empty to have a generated password.
+ * @param array $serverctrls 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 mixed Returns the generated password if newpw is empty or omitted.
+ * Otherwise returns TRUE on success.
+ * @throws LdapException
+ *
+ */
+function ldap_exop_passwd($link, string $user = "", string $oldpw = "", string $newpw = "", array &$serverctrls = null)
+{
+ error_clear_last();
+ $result = \ldap_exop_passwd($link, $user, $oldpw, $newpw, $serverctrls);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Performs a WHOAMI extended operation and returns the data.
+ *
+ * @param resource $link An LDAP link identifier, returned by ldap_connect.
+ * @return string The data returned by the server.
+ * @throws LdapException
+ *
+ */
+function ldap_exop_whoami($link): string
+{
+ error_clear_last();
+ $result = \ldap_exop_whoami($link);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Performs an extended operation on the specified link with
+ * reqoid the OID of the operation and
+ * reqdata the data.
+ *
+ * @param resource $link An LDAP link identifier, returned by ldap_connect.
+ * @param string $reqoid The extended operation request OID. You may use one of LDAP_EXOP_START_TLS, LDAP_EXOP_MODIFY_PASSWD, LDAP_EXOP_REFRESH, LDAP_EXOP_WHO_AM_I, LDAP_EXOP_TURN, or a string with the OID of the operation you want to send.
+ * @param string $reqdata The extended operation request data. May be NULL for some operations like LDAP_EXOP_WHO_AM_I, may also need to be BER encoded.
+ * @param array|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 mixed When used with retdata, returns TRUE on success.
+ * When used without retdata, returns a result identifier.
+ * @throws LdapException
+ *
+ */
+function ldap_exop($link, string $reqoid, string $reqdata = null, ?array $serverctrls = null, ?string &$retdata = null, ?string &$retoid = null)
+{
+ error_clear_last();
+ $result = \ldap_exop($link, $reqoid, $reqdata, $serverctrls, $retdata, $retoid);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Splits the DN returned by ldap_get_dn and breaks it
+ * up into its component parts. Each part is known as Relative Distinguished
+ * Name, or RDN.
+ *
+ * @param string $dn The distinguished name of an LDAP entity.
+ * @param int $with_attrib Used to request if the RDNs are returned with only values or their
+ * attributes as well. To get RDNs with the attributes (i.e. in
+ * attribute=value format) set with_attrib to 0
+ * and to get only values set it to 1.
+ * @return array Returns an array of all DN components.
+ * The first element in the array has count key and
+ * represents the number of returned values, next elements are numerically
+ * indexed DN components.
+ * @throws LdapException
+ *
+ */
+function ldap_explode_dn(string $dn, int $with_attrib): array
+{
+ error_clear_last();
+ $result = \ldap_explode_dn($dn, $with_attrib);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Gets the first attribute in the given entry. Remaining attributes are
+ * retrieved by calling ldap_next_attribute successively.
+ *
+ * Similar to reading entries, attributes are also read one by one from a
+ * particular entry.
+ *
+ * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect.
+ * @param resource $result_entry_identifier
+ * @return string Returns the first attribute in the entry on success and FALSE on
+ * error.
+ * @throws LdapException
+ *
+ */
+function ldap_first_attribute($link_identifier, $result_entry_identifier): string
+{
+ error_clear_last();
+ $result = \ldap_first_attribute($link_identifier, $result_entry_identifier);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Returns the entry identifier for first entry in the result. This entry
+ * identifier is then supplied to ldap_next_entry
+ * routine to get successive entries from the result.
+ *
+ * Entries in the LDAP result are read sequentially using the
+ * ldap_first_entry and
+ * ldap_next_entry functions.
+ *
+ * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect.
+ * @param resource $result_identifier
+ * @return resource Returns the result entry identifier for the first entry on success and
+ * FALSE on error.
+ * @throws LdapException
+ *
+ */
+function ldap_first_entry($link_identifier, $result_identifier)
+{
+ error_clear_last();
+ $result = \ldap_first_entry($link_identifier, $result_identifier);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Frees up the memory allocated internally to store the result. All result
+ * memory will be automatically freed when the script terminates.
+ *
+ * Typically all the memory allocated for the LDAP result gets freed at the
+ * end of the script. In case the script is making successive searches which
+ * return large result sets, ldap_free_result could be
+ * called to keep the runtime memory usage by the script low.
+ *
+ * @param resource $result_identifier
+ * @throws LdapException
+ *
+ */
+function ldap_free_result($result_identifier): void
+{
+ error_clear_last();
+ $result = \ldap_free_result($result_identifier);
+ if ($result === 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 $link_identifier An LDAP link identifier, returned by ldap_connect.
+ * @param resource $result_entry_identifier
+ * @return array Returns a complete entry information in a multi-dimensional array
+ * on success and FALSE on error.
+ * @throws LdapException
+ *
+ */
+function ldap_get_attributes($link_identifier, $result_entry_identifier): array
+{
+ error_clear_last();
+ $result = \ldap_get_attributes($link_identifier, $result_entry_identifier);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Finds out the DN of an entry in the result.
+ *
+ * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect.
+ * @param resource $result_entry_identifier
+ * @return string Returns the DN of the result entry and FALSE on error.
+ * @throws LdapException
+ *
+ */
+function ldap_get_dn($link_identifier, $result_entry_identifier): string
+{
+ error_clear_last();
+ $result = \ldap_get_dn($link_identifier, $result_entry_identifier);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Reads multiple entries from the given result, and then reading the
+ * attributes and multiple values.
+ *
+ * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect.
+ * @param resource $result_identifier
+ * @return array Returns a complete result information in a multi-dimensional array on
+ * success and FALSE on error.
+ *
+ * The structure of the array is as follows.
+ * The attribute index is converted to lowercase. (Attributes are
+ * case-insensitive for directory servers, but not when used as
+ * array indices.)
+ *
+ *
+ *
+ *
+ *
+ * @throws LdapException
+ *
+ */
+function ldap_get_entries($link_identifier, $result_identifier): array
+{
+ error_clear_last();
+ $result = \ldap_get_entries($link_identifier, $result_identifier);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Sets retval to the value of the specified option.
+ *
+ * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect.
+ * @param int $option The parameter option can be one of:
+ *
+ *
+ *
+ *
+ * Option
+ * Type
+ * since
+ *
+ *
+ *
+ *
+ * LDAP_OPT_DEREF
+ * integer
+ *
+ *
+ *
+ * LDAP_OPT_SIZELIMIT
+ * integer
+ *
+ *
+ *
+ * LDAP_OPT_TIMELIMIT
+ * integer
+ *
+ *
+ *
+ * LDAP_OPT_NETWORK_TIMEOUT
+ * integer
+ *
+ *
+ *
+ * LDAP_OPT_PROTOCOL_VERSION
+ * integer
+ *
+ *
+ *
+ * LDAP_OPT_ERROR_NUMBER
+ * integer
+ *
+ *
+ *
+ * LDAP_OPT_DIAGNOSTIC_MESSAGE
+ * integer
+ *
+ *
+ *
+ * LDAP_OPT_REFERRALS
+ * bool
+ *
+ *
+ *
+ * LDAP_OPT_RESTART
+ * bool
+ *
+ *
+ *
+ * LDAP_OPT_HOST_NAME
+ * string
+ *
+ *
+ *
+ * LDAP_OPT_ERROR_STRING
+ * string
+ *
+ *
+ *
+ * LDAP_OPT_MATCHED_DN
+ * string
+ *
+ *
+ *
+ * LDAP_OPT_SERVER_CONTROLS
+ * array
+ *
+ *
+ *
+ * LDAP_OPT_CLIENT_CONTROLS
+ * array
+ *
+ *
+ *
+ * LDAP_OPT_X_KEEPALIVE_IDLE
+ * int
+ * 7.1
+ *
+ *
+ * LDAP_OPT_X_KEEPALIVE_PROBES
+ * int
+ * 7.1
+ *
+ *
+ * LDAP_OPT_X_KEEPALIVE_INTERVAL
+ * int
+ * 7.1
+ *
+ *
+ * LDAP_OPT_X_TLS_CACERTDIR
+ * string
+ * 7.1
+ *
+ *
+ * LDAP_OPT_X_TLS_CACERTFILE
+ * string
+ * 7.1
+ *
+ *
+ * LDAP_OPT_X_TLS_CERTFILE
+ * string
+ * 7.1
+ *
+ *
+ * LDAP_OPT_X_TLS_CIPHER_SUITE
+ * string
+ * 7.1
+ *
+ *
+ * LDAP_OPT_X_TLS_CRLCHECK
+ * integer
+ * 7.1
+ *
+ *
+ * LDAP_OPT_X_TLS_CRL_NONE
+ * integer
+ * 7.1
+ *
+ *
+ * LDAP_OPT_X_TLS_CRL_PEER
+ * integer
+ * 7.1
+ *
+ *
+ * LDAP_OPT_X_TLS_CRL_ALL
+ * integer
+ * 7.1
+ *
+ *
+ * LDAP_OPT_X_TLS_CRLFILE
+ * string
+ * 7.1
+ *
+ *
+ * LDAP_OPT_X_TLS_DHFILE
+ * string
+ * 7.1
+ *
+ *
+ * LDAP_OPT_X_TLS_KEYILE
+ * string
+ * 7.1
+ *
+ *
+ * LDAP_OPT_X_TLS_PACKAGE
+ * string
+ * 7.1
+ *
+ *
+ * LDAP_OPT_X_TLS_PROTOCOL_MIN
+ * integer
+ * 7.1
+ *
+ *
+ * LDAP_OPT_X_TLS_RANDOM_FILE
+ * string
+ * 7.1
+ *
+ *
+ * LDAP_OPT_X_TLS_REQUIRE_CERT
+ * integer
+ *
+ *
+ *
+ *
+ *
+ * @param mixed $retval This will be set to the option value.
+ * @throws LdapException
+ *
+ */
+function ldap_get_option($link_identifier, int $option, &$retval): void
+{
+ error_clear_last();
+ $result = \ldap_get_option($link_identifier, $option, $retval);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Reads all the values of the attribute in the entry in the result.
+ *
+ * This function is used exactly like ldap_get_values
+ * except that it handles binary data and not string data.
+ *
+ * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect.
+ * @param resource $result_entry_identifier
+ * @param string $attribute
+ * @return array Returns an array of values for the attribute on success and FALSE on
+ * error. Individual values are accessed by integer index in the array. The
+ * first index is 0. The number of values can be found by indexing "count"
+ * in the resultant array.
+ * @throws LdapException
+ *
+ */
+function ldap_get_values_len($link_identifier, $result_entry_identifier, string $attribute): array
+{
+ error_clear_last();
+ $result = \ldap_get_values_len($link_identifier, $result_entry_identifier, $attribute);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Reads all the values of the attribute in the entry in the result.
+ *
+ * This call needs a result_entry_identifier,
+ * so needs to be preceded by one of the ldap search calls and one
+ * of the calls to get an individual entry.
+ *
+ * You application will either be hard coded to look for certain
+ * attributes (such as "surname" or "mail") or you will have to use
+ * the ldap_get_attributes call to work out
+ * what attributes exist for a given entry.
+ *
+ * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect.
+ * @param resource $result_entry_identifier
+ * @param string $attribute
+ * @return array Returns an array of values for the attribute on success and FALSE on
+ * error. The number of values can be found by indexing "count" in the
+ * resultant array. Individual values are accessed by integer index in the
+ * array. The first index is 0.
+ *
+ * LDAP allows more than one entry for an attribute, so it can, for example,
+ * store a number of email addresses for one person's directory entry all
+ * labeled with the attribute "mail"
+ *
+ *
+ * return_value["count"] = number of values for attribute
+ * return_value[0] = first value of attribute
+ * return_value[i] = ith value of attribute
+ *
+ *
+ * @throws LdapException
+ *
+ */
+function ldap_get_values($link_identifier, $result_entry_identifier, string $attribute): array
+{
+ error_clear_last();
+ $result = \ldap_get_values($link_identifier, $result_entry_identifier, $attribute);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Performs the search for a specified filter on the
+ * directory with the scope LDAP_SCOPE_ONELEVEL.
+ *
+ * LDAP_SCOPE_ONELEVEL means that the search should only
+ * return information that is at the level immediately below the
+ * base_dn given in the call.
+ * (Equivalent to typing "ls" and getting a list of files and folders in the
+ * current working directory.)
+ *
+ * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect.
+ * @param string $base_dn The base DN for the directory.
+ * @param string $filter
+ * @param array $attributes An array of the required attributes, e.g. array("mail", "sn", "cn").
+ * Note that the "dn" is always returned irrespective of which attributes
+ * types are requested.
+ *
+ * Using this parameter is much more efficient than the default action
+ * (which is to return all attributes and their associated values).
+ * The use of this parameter should therefore be considered good
+ * practice.
+ * @param int $attrsonly Should be set to 1 if only attribute types are wanted. If set to 0
+ * both attributes types and attribute values are fetched which is the
+ * default behaviour.
+ * @param int $sizelimit Enables you to limit the count of entries fetched. Setting this to 0
+ * means no limit.
+ *
+ * This parameter can NOT override server-side preset sizelimit. You can
+ * set it lower though.
+ *
+ * Some directory server hosts will be configured to return no more than
+ * a preset number of entries. If this occurs, the server will indicate
+ * that it has only returned a partial results set. This also occurs if
+ * you use this parameter to limit the count of fetched entries.
+ * @param int $timelimit Sets the number of seconds how long is spend on the search. Setting
+ * this to 0 means no limit.
+ *
+ * This parameter can NOT override server-side preset timelimit. You can
+ * set it lower though.
+ * @param int $deref Specifies how aliases should be handled during the search. It can be
+ * one of the following:
+ *
+ *
+ *
+ * LDAP_DEREF_NEVER - (default) aliases are never
+ * dereferenced.
+ *
+ *
+ *
+ *
+ * LDAP_DEREF_SEARCHING - aliases should be
+ * dereferenced during the search but not when locating the base object
+ * of the search.
+ *
+ *
+ *
+ *
+ * LDAP_DEREF_FINDING - aliases should be
+ * dereferenced when locating the base object but not during the search.
+ *
+ *
+ *
+ *
+ * LDAP_DEREF_ALWAYS - aliases should be dereferenced
+ * always.
+ *
+ *
+ *
+ * @param array $serverctrls Array of LDAP Controls to send with the request.
+ * @return resource Returns a search result identifier.
+ * @throws LdapException
+ *
+ */
+function ldap_list($link_identifier, string $base_dn, string $filter, array $attributes = null, int $attrsonly = 0, int $sizelimit = -1, int $timelimit = -1, int $deref = LDAP_DEREF_NEVER, array $serverctrls = null)
+{
+ error_clear_last();
+ if ($serverctrls !== null) {
+ $result = \ldap_list($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref, $serverctrls);
+ } elseif ($deref !== LDAP_DEREF_NEVER) {
+ $result = \ldap_list($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref);
+ } elseif ($timelimit !== -1) {
+ $result = \ldap_list($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit);
+ } elseif ($sizelimit !== -1) {
+ $result = \ldap_list($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit);
+ } elseif ($attrsonly !== 0) {
+ $result = \ldap_list($link_identifier, $base_dn, $filter, $attributes, $attrsonly);
+ } elseif ($attributes !== null) {
+ $result = \ldap_list($link_identifier, $base_dn, $filter, $attributes);
+ } else {
+ $result = \ldap_list($link_identifier, $base_dn, $filter);
+ }
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Does the same thing as ldap_mod_add but returns the LDAP result resource to be parsed with ldap_parse_result.
+ *
+ * @param resource $link_identifier
+ * @param string $dn
+ * @param array $entry
+ * @param array $serverctrls
+ * @return resource Returns an LDAP result identifier.
+ * @throws LdapException
+ *
+ */
+function ldap_mod_add_ext($link_identifier, string $dn, array $entry, array $serverctrls = null)
+{
+ error_clear_last();
+ $result = \ldap_mod_add_ext($link_identifier, $dn, $entry, $serverctrls);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Adds one or more attribute values to the specified dn.
+ * To add a whole new object see ldap_add function.
+ *
+ * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect.
+ * @param string $dn The distinguished name of an LDAP entity.
+ * @param array $entry An associative array listing the attirbute values to add. If an attribute was not existing yet it will be added. If an attribute is existing you can only add values to it if it supports multiple values.
+ * @param array $serverctrls Array of LDAP Controls to send with the request.
+ * @throws LdapException
+ *
+ */
+function ldap_mod_add($link_identifier, string $dn, array $entry, array $serverctrls = null): void
+{
+ error_clear_last();
+ $result = \ldap_mod_add($link_identifier, $dn, $entry, $serverctrls);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Does the same thing as ldap_mod_del but returns the LDAP result resource to be parsed with ldap_parse_result.
+ *
+ * @param resource $link_identifier
+ * @param string $dn
+ * @param array $entry
+ * @param array $serverctrls
+ * @return resource Returns an LDAP result identifier.
+ * @throws LdapException
+ *
+ */
+function ldap_mod_del_ext($link_identifier, string $dn, array $entry, array $serverctrls = null)
+{
+ error_clear_last();
+ $result = \ldap_mod_del_ext($link_identifier, $dn, $entry, $serverctrls);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Removes one or more attribute values from the specified dn.
+ * Object deletions are done by the
+ * ldap_delete function.
+ *
+ * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect.
+ * @param string $dn The distinguished name of an LDAP entity.
+ * @param array $entry
+ * @param array $serverctrls Array of LDAP Controls to send with the request.
+ * @throws LdapException
+ *
+ */
+function ldap_mod_del($link_identifier, string $dn, array $entry, array $serverctrls = null): void
+{
+ error_clear_last();
+ $result = \ldap_mod_del($link_identifier, $dn, $entry, $serverctrls);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Does the same thing as ldap_mod_replace but returns the LDAP result resource to be parsed with ldap_parse_result.
+ *
+ * @param resource $link_identifier
+ * @param string $dn
+ * @param array $entry
+ * @param array $serverctrls
+ * @return resource Returns an LDAP result identifier.
+ * @throws LdapException
+ *
+ */
+function ldap_mod_replace_ext($link_identifier, string $dn, array $entry, array $serverctrls = null)
+{
+ error_clear_last();
+ $result = \ldap_mod_replace_ext($link_identifier, $dn, $entry, $serverctrls);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Replaces one or more attributes from the specified dn.
+ * It may also add or remove attributes.
+ *
+ * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect.
+ * @param string $dn The distinguished name of an LDAP entity.
+ * @param array $entry An associative array listing the attributes to replace. Sending an empty array as value will remove the attribute, while sending an attribute not existing yet on this entry will add it.
+ * @param array $serverctrls Array of LDAP Controls to send with the request.
+ * @throws LdapException
+ *
+ */
+function ldap_mod_replace($link_identifier, string $dn, array $entry, array $serverctrls = null): void
+{
+ error_clear_last();
+ $result = \ldap_mod_replace($link_identifier, $dn, $entry, $serverctrls);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Modifies an existing entry in the LDAP directory. Allows detailed
+ * specification of the modifications to perform.
+ *
+ * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect.
+ * @param string $dn The distinguished name of an LDAP entity.
+ * @param array $entry An array that specifies the modifications to make. Each entry in this
+ * array is an associative array with two or three keys:
+ * attrib maps to the name of the attribute to modify,
+ * modtype maps to the type of modification to perform,
+ * and (depending on the type of modification) values
+ * maps to an array of attribute values relevant to the modification.
+ *
+ * Possible values for modtype include:
+ *
+ *
+ * LDAP_MODIFY_BATCH_ADD
+ *
+ *
+ * Each value specified through values is added (as
+ * an additional value) to the attribute named by
+ * attrib.
+ *
+ *
+ *
+ *
+ * LDAP_MODIFY_BATCH_REMOVE
+ *
+ *
+ * Each value specified through values is removed
+ * from the attribute named by attrib. Any value of
+ * the attribute not contained in the values array
+ * will remain untouched.
+ *
+ *
+ *
+ *
+ * LDAP_MODIFY_BATCH_REMOVE_ALL
+ *
+ *
+ * All values are removed from the attribute named by
+ * attrib. A values entry must
+ * not be provided.
+ *
+ *
+ *
+ *
+ * LDAP_MODIFY_BATCH_REPLACE
+ *
+ *
+ * All current values of the attribute named by
+ * attrib are replaced with the values specified
+ * through values.
+ *
+ *
+ *
+ *
+ *
+ * Each value specified through values is added (as
+ * an additional value) to the attribute named by
+ * attrib.
+ *
+ * Each value specified through values is removed
+ * from the attribute named by attrib. Any value of
+ * the attribute not contained in the values array
+ * will remain untouched.
+ *
+ * All values are removed from the attribute named by
+ * attrib. A values entry must
+ * not be provided.
+ *
+ * All current values of the attribute named by
+ * attrib are replaced with the values specified
+ * through values.
+ *
+ * Note that any value for attrib must be a string, any
+ * value for values must be an array of strings, and
+ * any value for modtype must be one of the
+ * LDAP_MODIFY_BATCH_* constants listed above.
+ * @param array $serverctrls Each value specified through values is added (as
+ * an additional value) to the attribute named by
+ * attrib.
+ * @throws LdapException
+ *
+ */
+function ldap_modify_batch($link_identifier, string $dn, array $entry, array $serverctrls = null): void
+{
+ error_clear_last();
+ $result = \ldap_modify_batch($link_identifier, $dn, $entry, $serverctrls);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Retrieves the attributes in an entry. The first call to
+ * ldap_next_attribute is made with the
+ * result_entry_identifier returned from
+ * ldap_first_attribute.
+ *
+ * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect.
+ * @param resource $result_entry_identifier
+ * @return string Returns the next attribute in an entry on success and FALSE on
+ * error.
+ * @throws LdapException
+ *
+ */
+function ldap_next_attribute($link_identifier, $result_entry_identifier): string
+{
+ error_clear_last();
+ $result = \ldap_next_attribute($link_identifier, $result_entry_identifier);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Parse LDAP extended operation data from result object result
+ *
+ * @param resource $link An LDAP link identifier, returned by ldap_connect.
+ * @param resource $result An LDAP result resource, returned by ldap_exop.
+ * @param string|null $retdata Will be filled by the response data.
+ * @param string|null $retoid Will be filled by the response OID.
+ * @throws LdapException
+ *
+ */
+function ldap_parse_exop($link, $result, ?string &$retdata = null, ?string &$retoid = null): void
+{
+ error_clear_last();
+ $result = \ldap_parse_exop($link, $result, $retdata, $retoid);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Parses an LDAP search result.
+ *
+ * @param resource $link An LDAP link identifier, returned by ldap_connect.
+ * @param resource $result An LDAP result resource, returned by ldap_list or
+ * ldap_search.
+ * @param int|null $errcode A reference to a variable that will be set to the LDAP error code in
+ * the result, or 0 if no error occurred.
+ * @param string|null $matcheddn A reference to a variable that will be set to a matched DN if one was
+ * recognised within the request, otherwise it will be set to NULL.
+ * @param string|null $errmsg A reference to a variable that will be set to the LDAP error message in
+ * the result, or an empty string if no error occurred.
+ * @param array|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 $serverctrls An array of LDAP Controls which have been sent with the response.
+ * @throws LdapException
+ *
+ */
+function ldap_parse_result($link, $result, ?int &$errcode, ?string &$matcheddn = null, ?string &$errmsg = null, ?array &$referrals = null, ?array &$serverctrls = null): void
+{
+ error_clear_last();
+ $result = \ldap_parse_result($link, $result, $errcode, $matcheddn, $errmsg, $referrals, $serverctrls);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Performs the search for a specified filter on the
+ * directory with the scope LDAP_SCOPE_BASE. So it is
+ * equivalent to reading an entry from the directory.
+ *
+ * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect.
+ * @param string $base_dn The base DN for the directory.
+ * @param string $filter An empty filter is not allowed. If you want to retrieve absolutely all
+ * information for this entry, use a filter of
+ * objectClass=*. If you know which entry types are
+ * used on the directory server, you might use an appropriate filter such
+ * as objectClass=inetOrgPerson.
+ * @param array $attributes An array of the required attributes, e.g. array("mail", "sn", "cn").
+ * Note that the "dn" is always returned irrespective of which attributes
+ * types are requested.
+ *
+ * Using this parameter is much more efficient than the default action
+ * (which is to return all attributes and their associated values).
+ * The use of this parameter should therefore be considered good
+ * practice.
+ * @param int $attrsonly Should be set to 1 if only attribute types are wanted. If set to 0
+ * both attributes types and attribute values are fetched which is the
+ * default behaviour.
+ * @param int $sizelimit Enables you to limit the count of entries fetched. Setting this to 0
+ * means no limit.
+ *
+ * This parameter can NOT override server-side preset sizelimit. You can
+ * set it lower though.
+ *
+ * Some directory server hosts will be configured to return no more than
+ * a preset number of entries. If this occurs, the server will indicate
+ * that it has only returned a partial results set. This also occurs if
+ * you use this parameter to limit the count of fetched entries.
+ * @param int $timelimit Sets the number of seconds how long is spend on the search. Setting
+ * this to 0 means no limit.
+ *
+ * This parameter can NOT override server-side preset timelimit. You can
+ * set it lower though.
+ * @param int $deref Specifies how aliases should be handled during the search. It can be
+ * one of the following:
+ *
+ *
+ *
+ * LDAP_DEREF_NEVER - (default) aliases are never
+ * dereferenced.
+ *
+ *
+ *
+ *
+ * LDAP_DEREF_SEARCHING - aliases should be
+ * dereferenced during the search but not when locating the base object
+ * of the search.
+ *
+ *
+ *
+ *
+ * LDAP_DEREF_FINDING - aliases should be
+ * dereferenced when locating the base object but not during the search.
+ *
+ *
+ *
+ *
+ * LDAP_DEREF_ALWAYS - aliases should be dereferenced
+ * always.
+ *
+ *
+ *
+ * @param array $serverctrls Array of LDAP Controls to send with the request.
+ * @return resource Returns a search result identifier.
+ * @throws LdapException
+ *
+ */
+function ldap_read($link_identifier, string $base_dn, string $filter, array $attributes = null, int $attrsonly = 0, int $sizelimit = -1, int $timelimit = -1, int $deref = LDAP_DEREF_NEVER, array $serverctrls = null)
+{
+ error_clear_last();
+ if ($serverctrls !== null) {
+ $result = \ldap_read($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref, $serverctrls);
+ } elseif ($deref !== LDAP_DEREF_NEVER) {
+ $result = \ldap_read($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref);
+ } elseif ($timelimit !== -1) {
+ $result = \ldap_read($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit);
+ } elseif ($sizelimit !== -1) {
+ $result = \ldap_read($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit);
+ } elseif ($attrsonly !== 0) {
+ $result = \ldap_read($link_identifier, $base_dn, $filter, $attributes, $attrsonly);
+ } elseif ($attributes !== null) {
+ $result = \ldap_read($link_identifier, $base_dn, $filter, $attributes);
+ } else {
+ $result = \ldap_read($link_identifier, $base_dn, $filter);
+ }
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Does the same thing as ldap_rename but returns the LDAP result resource to be parsed with ldap_parse_result.
+ *
+ * @param resource $link_identifier
+ * @param string $dn
+ * @param string $newrdn
+ * @param string $newparent
+ * @param bool $deleteoldrdn
+ * @param array $serverctrls
+ * @return resource Returns an LDAP result identifier.
+ * @throws LdapException
+ *
+ */
+function ldap_rename_ext($link_identifier, string $dn, string $newrdn, string $newparent, bool $deleteoldrdn, array $serverctrls = null)
+{
+ error_clear_last();
+ $result = \ldap_rename_ext($link_identifier, $dn, $newrdn, $newparent, $deleteoldrdn, $serverctrls);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * The entry specified by dn is renamed/moved.
+ *
+ * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect.
+ * @param string $dn The distinguished name of an LDAP entity.
+ * @param string $newrdn The new RDN.
+ * @param string $newparent The new parent/superior entry.
+ * @param bool $deleteoldrdn If TRUE the old RDN value(s) is removed, else the old RDN value(s)
+ * is retained as non-distinguished values of the entry.
+ * @param array $serverctrls Array of LDAP Controls to send with the request.
+ * @throws LdapException
+ *
+ */
+function ldap_rename($link_identifier, string $dn, string $newrdn, string $newparent, bool $deleteoldrdn, array $serverctrls = null): void
+{
+ error_clear_last();
+ $result = \ldap_rename($link_identifier, $dn, $newrdn, $newparent, $deleteoldrdn, $serverctrls);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+}
+
+
+/**
+ *
+ *
+ * @param resource $link
+ * @param string $binddn
+ * @param string $password
+ * @param string $sasl_mech
+ * @param string $sasl_realm
+ * @param string $sasl_authc_id
+ * @param string $sasl_authz_id
+ * @param string $props
+ * @throws LdapException
+ *
+ */
+function ldap_sasl_bind($link, string $binddn = null, string $password = null, string $sasl_mech = null, string $sasl_realm = null, string $sasl_authc_id = null, string $sasl_authz_id = null, string $props = null): void
+{
+ error_clear_last();
+ $result = \ldap_sasl_bind($link, $binddn, $password, $sasl_mech, $sasl_realm, $sasl_authc_id, $sasl_authz_id, $props);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Performs the search for a specified filter on the directory with the scope
+ * of LDAP_SCOPE_SUBTREE. This is equivalent to searching
+ * the entire directory.
+ *
+ * From 4.0.5 on it's also possible to do parallel searches. To do this
+ * you use an array of link identifiers, rather than a single identifier,
+ * as the first argument. If you don't want the same base DN and the
+ * same filter for all the searches, you can also use an array of base DNs
+ * and/or an array of filters. Those arrays must be of the same size as
+ * the link identifier array since the first entries of the arrays are
+ * used for one search, the second entries are used for another, and so
+ * on. When doing parallel searches an array of search result
+ * identifiers is returned, except in case of error, then the entry
+ * corresponding to the search will be FALSE. This is very much like
+ * the value normally returned, except that a result identifier is always
+ * returned when a search was made. There are some rare cases where the
+ * normal search returns FALSE while the parallel search returns an
+ * identifier.
+ *
+ * @param resource|array $link_identifier An LDAP link identifier, returned by ldap_connect.
+ * @param string $base_dn The base DN for the directory.
+ * @param string $filter The search filter can be simple or advanced, using boolean operators in
+ * the format described in the LDAP documentation (see the Netscape Directory SDK or
+ * RFC4515 for full
+ * information on filters).
+ * @param array $attributes An array of the required attributes, e.g. array("mail", "sn", "cn").
+ * Note that the "dn" is always returned irrespective of which attributes
+ * types are requested.
+ *
+ * Using this parameter is much more efficient than the default action
+ * (which is to return all attributes and their associated values).
+ * The use of this parameter should therefore be considered good
+ * practice.
+ * @param int $attrsonly Should be set to 1 if only attribute types are wanted. If set to 0
+ * both attributes types and attribute values are fetched which is the
+ * default behaviour.
+ * @param int $sizelimit Enables you to limit the count of entries fetched. Setting this to 0
+ * means no limit.
+ *
+ * This parameter can NOT override server-side preset sizelimit. You can
+ * set it lower though.
+ *
+ * Some directory server hosts will be configured to return no more than
+ * a preset number of entries. If this occurs, the server will indicate
+ * that it has only returned a partial results set. This also occurs if
+ * you use this parameter to limit the count of fetched entries.
+ * @param int $timelimit Sets the number of seconds how long is spend on the search. Setting
+ * this to 0 means no limit.
+ *
+ * This parameter can NOT override server-side preset timelimit. You can
+ * set it lower though.
+ * @param int $deref Specifies how aliases should be handled during the search. It can be
+ * one of the following:
+ *
+ *
+ *
+ * LDAP_DEREF_NEVER - (default) aliases are never
+ * dereferenced.
+ *
+ *
+ *
+ *
+ * LDAP_DEREF_SEARCHING - aliases should be
+ * dereferenced during the search but not when locating the base object
+ * of the search.
+ *
+ *
+ *
+ *
+ * LDAP_DEREF_FINDING - aliases should be
+ * dereferenced when locating the base object but not during the search.
+ *
+ *
+ *
+ *
+ * LDAP_DEREF_ALWAYS - aliases should be dereferenced
+ * always.
+ *
+ *
+ *
+ * @param array $serverctrls Array of LDAP Controls to send with the request.
+ * @return resource Returns a search result identifier.
+ * @throws LdapException
+ *
+ */
+function ldap_search($link_identifier, string $base_dn, string $filter, array $attributes = null, int $attrsonly = 0, int $sizelimit = -1, int $timelimit = -1, int $deref = LDAP_DEREF_NEVER, array $serverctrls = null)
+{
+ error_clear_last();
+ if ($serverctrls !== null) {
+ $result = \ldap_search($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref, $serverctrls);
+ } elseif ($deref !== LDAP_DEREF_NEVER) {
+ $result = \ldap_search($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref);
+ } elseif ($timelimit !== -1) {
+ $result = \ldap_search($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit);
+ } elseif ($sizelimit !== -1) {
+ $result = \ldap_search($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit);
+ } elseif ($attrsonly !== 0) {
+ $result = \ldap_search($link_identifier, $base_dn, $filter, $attributes, $attrsonly);
+ } elseif ($attributes !== null) {
+ $result = \ldap_search($link_identifier, $base_dn, $filter, $attributes);
+ } else {
+ $result = \ldap_search($link_identifier, $base_dn, $filter);
+ }
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Sets the value of the specified option to be newval.
+ *
+ * @param resource|null $link_identifier An LDAP link identifier, returned by ldap_connect.
+ * @param int $option The parameter option can be one of:
+ *
+ *
+ *
+ *
+ * Option
+ * Type
+ * Available since
+ *
+ *
+ *
+ *
+ * LDAP_OPT_DEREF
+ * integer
+ *
+ *
+ *
+ * LDAP_OPT_SIZELIMIT
+ * integer
+ *
+ *
+ *
+ * LDAP_OPT_TIMELIMIT
+ * integer
+ *
+ *
+ *
+ * LDAP_OPT_NETWORK_TIMEOUT
+ * integer
+ * PHP 5.3.0
+ *
+ *
+ * LDAP_OPT_PROTOCOL_VERSION
+ * integer
+ *
+ *
+ *
+ * LDAP_OPT_ERROR_NUMBER
+ * integer
+ *
+ *
+ *
+ * LDAP_OPT_REFERRALS
+ * bool
+ *
+ *
+ *
+ * LDAP_OPT_RESTART
+ * bool
+ *
+ *
+ *
+ * LDAP_OPT_HOST_NAME
+ * string
+ *
+ *
+ *
+ * LDAP_OPT_ERROR_STRING
+ * string
+ *
+ *
+ *
+ * LDAP_OPT_DIAGNOSTIC_MESSAGE
+ * string
+ *
+ *
+ *
+ * LDAP_OPT_MATCHED_DN
+ * string
+ *
+ *
+ *
+ * LDAP_OPT_SERVER_CONTROLS
+ * array
+ *
+ *
+ *
+ * LDAP_OPT_CLIENT_CONTROLS
+ * array
+ *
+ *
+ *
+ * LDAP_OPT_X_KEEPALIVE_IDLE
+ * int
+ * PHP 7.1.0
+ *
+ *
+ * LDAP_OPT_X_KEEPALIVE_PROBES
+ * int
+ * PHP 7.1.0
+ *
+ *
+ * LDAP_OPT_X_KEEPALIVE_INTERVAL
+ * int
+ * PHP 7.1.0
+ *
+ *
+ * LDAP_OPT_X_TLS_CACERTDIR
+ * string
+ * PHP 7.1.0
+ *
+ *
+ * LDAP_OPT_X_TLS_CACERTFILE
+ * string
+ * PHP 7.1.0
+ *
+ *
+ * LDAP_OPT_X_TLS_CERTFILE
+ * string
+ * PHP 7.1.0
+ *
+ *
+ * LDAP_OPT_X_TLS_CIPHER_SUITE
+ * string
+ * PHP 7.1.0
+ *
+ *
+ * LDAP_OPT_X_TLS_CRLCHECK
+ * integer
+ * PHP 7.1.0
+ *
+ *
+ * LDAP_OPT_X_TLS_CRLFILE
+ * string
+ * PHP 7.1.0
+ *
+ *
+ * LDAP_OPT_X_TLS_DHFILE
+ * string
+ * PHP 7.1.0
+ *
+ *
+ * LDAP_OPT_X_TLS_KEYFILE
+ * string
+ * PHP 7.1.0
+ *
+ *
+ * LDAP_OPT_X_TLS_PROTOCOL_MIN
+ * integer
+ * PHP 7.1.0
+ *
+ *
+ * LDAP_OPT_X_TLS_RANDOM_FILE
+ * string
+ * PHP 7.1.0
+ *
+ *
+ * LDAP_OPT_X_TLS_REQUIRE_CERT
+ * integer
+ * PHP 7.0.5
+ *
+ *
+ *
+ *
+ *
+ * LDAP_OPT_SERVER_CONTROLS and
+ * LDAP_OPT_CLIENT_CONTROLS require a list of
+ * controls, this means that the value must be an array of controls. A
+ * control consists of an oid identifying the control,
+ * an optional value, and an optional flag for
+ * criticality. In PHP a control is given by an
+ * array containing an element with the key oid
+ * and string value, and two optional elements. The optional
+ * elements are key value with string value
+ * and key iscritical with boolean value.
+ * iscritical defaults to FALSE
+ * if not supplied. See draft-ietf-ldapext-ldap-c-api-xx.txt
+ * for details. See also the second example below.
+ * @param mixed $newval The new value for the specified option.
+ * @throws LdapException
+ *
+ */
+function ldap_set_option($link_identifier, int $option, $newval): void
+{
+ error_clear_last();
+ $result = \ldap_set_option($link_identifier, $option, $newval);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Unbinds from the LDAP directory.
+ *
+ * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect.
+ * @throws LdapException
+ *
+ */
+function ldap_unbind($link_identifier): void
+{
+ error_clear_last();
+ $result = \ldap_unbind($link_identifier);
+ if ($result === false) {
+ throw LdapException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/libxml.php b/vendor/thecodingmachine/safe/generated/libxml.php
new file mode 100644
index 000000000..cef784c42
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/libxml.php
@@ -0,0 +1,43 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\LibxmlException;
+
+/**
+ * Retrieve last error from libxml.
+ *
+ * @return \LibXMLError Returns a LibXMLError object if there is any error in the
+ * buffer, FALSE otherwise.
+ * @throws LibxmlException
+ *
+ */
+function libxml_get_last_error(): \LibXMLError
+{
+ error_clear_last();
+ $result = \libxml_get_last_error();
+ if ($result === false) {
+ throw LibxmlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Changes the default external entity loader.
+ *
+ * @param callable $resolver_function A callable that takes three arguments. Two strings, a public id
+ * and system id, and a context (an array with four keys) as the third argument.
+ * This callback should return a resource, a string from which a resource can be
+ * opened, or NULL.
+ * @throws LibxmlException
+ *
+ */
+function libxml_set_external_entity_loader(callable $resolver_function): void
+{
+ error_clear_last();
+ $result = \libxml_set_external_entity_loader($resolver_function);
+ if ($result === false) {
+ throw LibxmlException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/lzf.php b/vendor/thecodingmachine/safe/generated/lzf.php
new file mode 100644
index 000000000..7fce838a4
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/lzf.php
@@ -0,0 +1,44 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\LzfException;
+
+/**
+ * lzf_compress compresses the given
+ * data string using LZF encoding.
+ *
+ * @param string $data The string to compress.
+ * @return string Returns the compressed data.
+ * @throws LzfException
+ *
+ */
+function lzf_compress(string $data): string
+{
+ error_clear_last();
+ $result = \lzf_compress($data);
+ if ($result === false) {
+ throw LzfException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * lzf_compress decompresses the given
+ * data string containing lzf encoded data.
+ *
+ * @param string $data The compressed string.
+ * @return string Returns the decompressed data.
+ * @throws LzfException
+ *
+ */
+function lzf_decompress(string $data): string
+{
+ error_clear_last();
+ $result = \lzf_decompress($data);
+ if ($result === false) {
+ throw LzfException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/mailparse.php b/vendor/thecodingmachine/safe/generated/mailparse.php
new file mode 100644
index 000000000..1bae182a6
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/mailparse.php
@@ -0,0 +1,127 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\MailparseException;
+
+/**
+ * Extracts/decodes a message section from the supplied filename.
+ *
+ * The contents of the section will be decoded according to their transfer
+ * encoding - base64, quoted-printable and uuencoded text are supported.
+ *
+ * @param resource $mimemail A valid MIME resource, created with
+ * mailparse_msg_create.
+ * @param mixed $filename Can be a file name or a valid stream resource.
+ * @param callable $callbackfunc If set, this must be either a valid callback that will be passed the
+ * extracted section, or NULL to make this function return the
+ * extracted section.
+ *
+ * If not specified, the contents will be sent to "stdout".
+ * @return string If callbackfunc is not NULL returns TRUE on
+ * success.
+ *
+ * If callbackfunc is set to NULL, returns the
+ * extracted section as a string.
+ * @throws MailparseException
+ *
+ */
+function mailparse_msg_extract_part_file($mimemail, $filename, callable $callbackfunc = null): string
+{
+ error_clear_last();
+ if ($callbackfunc !== null) {
+ $result = \mailparse_msg_extract_part_file($mimemail, $filename, $callbackfunc);
+ } else {
+ $result = \mailparse_msg_extract_part_file($mimemail, $filename);
+ }
+ if ($result === false) {
+ throw MailparseException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Frees a MIME resource.
+ *
+ * @param resource $mimemail A valid MIME resource allocated by
+ * mailparse_msg_create or
+ * mailparse_msg_parse_file.
+ * @throws MailparseException
+ *
+ */
+function mailparse_msg_free($mimemail): void
+{
+ error_clear_last();
+ $result = \mailparse_msg_free($mimemail);
+ if ($result === false) {
+ throw MailparseException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Parses a file.
+ * This is the optimal way of parsing a mail file that you have on disk.
+ *
+ * @param string $filename Path to the file holding the message.
+ * The file is opened and streamed through the parser.
+ *
+ * The message contained in filename is supposed to end with a newline
+ * (CRLF); otherwise the last line of the message will not be parsed.
+ * @return resource Returns a MIME resource representing the structure.
+ * @throws MailparseException
+ *
+ */
+function mailparse_msg_parse_file(string $filename)
+{
+ error_clear_last();
+ $result = \mailparse_msg_parse_file($filename);
+ if ($result === false) {
+ throw MailparseException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Incrementally parse data into the supplied mime mail resource.
+ *
+ * This function allow you to stream portions of a file at a time, rather
+ * than read and parse the whole thing.
+ *
+ * @param resource $mimemail A valid MIME resource.
+ * @param string $data The final chunk of data is supposed to end with a newline
+ * (CRLF); otherwise the last line of the message will not be parsed.
+ * @throws MailparseException
+ *
+ */
+function mailparse_msg_parse($mimemail, string $data): void
+{
+ error_clear_last();
+ $result = \mailparse_msg_parse($mimemail, $data);
+ if ($result === false) {
+ throw MailparseException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Streams data from the source file pointer, apply
+ * encoding and write to the destination file pointer.
+ *
+ * @param resource $sourcefp A valid file handle. The file is streamed through the parser.
+ * @param resource $destfp The destination file handle in which the encoded data will be written.
+ * @param string $encoding One of the character encodings supported by the
+ * mbstring module.
+ * @throws MailparseException
+ *
+ */
+function mailparse_stream_encode($sourcefp, $destfp, string $encoding): void
+{
+ error_clear_last();
+ $result = \mailparse_stream_encode($sourcefp, $destfp, $encoding);
+ if ($result === false) {
+ throw MailparseException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/mbstring.php b/vendor/thecodingmachine/safe/generated/mbstring.php
new file mode 100644
index 000000000..fa0829438
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/mbstring.php
@@ -0,0 +1,526 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\MbstringException;
+
+/**
+ *
+ *
+ * @param int $cp
+ * @param string $encoding
+ * @return string Returns a specific character.
+ * @throws MbstringException
+ *
+ */
+function mb_chr(int $cp, string $encoding = null): string
+{
+ error_clear_last();
+ if ($encoding !== null) {
+ $result = \mb_chr($cp, $encoding);
+ } else {
+ $result = \mb_chr($cp);
+ }
+ if ($result === false) {
+ throw MbstringException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Sets the automatic character
+ * encoding detection order to encoding_list.
+ *
+ * @param mixed $encoding_list encoding_list is an array or
+ * comma separated list of character encoding. See supported encodings.
+ *
+ * If encoding_list is omitted, it returns
+ * the current character encoding detection order as array.
+ *
+ * This setting affects mb_detect_encoding and
+ * mb_send_mail.
+ *
+ * mbstring currently implements the following
+ * encoding detection filters. If there is an invalid byte sequence
+ * for the following encodings, encoding detection will fail.
+ *
+ * For ISO-8859-*, mbstring
+ * always detects as ISO-8859-*.
+ *
+ * For UTF-16, UTF-32,
+ * UCS2 and UCS4, encoding
+ * detection will fail always.
+ * @return bool|array When setting the encoding detection order, TRUE is returned on success.
+ *
+ * When getting the encoding detection order, an ordered array of the encodings is returned.
+ * @throws MbstringException
+ *
+ */
+function mb_detect_order($encoding_list = null)
+{
+ error_clear_last();
+ if ($encoding_list !== null) {
+ $result = \mb_detect_order($encoding_list);
+ } else {
+ $result = \mb_detect_order();
+ }
+ if ($result === false) {
+ throw MbstringException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Returns an array of aliases for a known encoding type.
+ *
+ * @param string $encoding The encoding type being checked, for aliases.
+ * @return array Returns a numerically indexed array of encoding aliases on success
+ * @throws MbstringException
+ *
+ */
+function mb_encoding_aliases(string $encoding): array
+{
+ error_clear_last();
+ $result = \mb_encoding_aliases($encoding);
+ if ($result === false) {
+ throw MbstringException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Scans string for matches to
+ * pattern, then replaces the matched text
+ * with the output of callback function.
+ *
+ * The behavior of this function is almost identical to mb_ereg_replace,
+ * except for the fact that instead of
+ * replacement parameter, one should specify a
+ * callback.
+ *
+ * @param string $pattern The regular expression pattern.
+ *
+ * Multibyte characters may be used in pattern.
+ * @param callable $callback A callback that will be called and passed an array of matched elements
+ * in the subject string. The callback should
+ * return the replacement string.
+ *
+ * You'll often need the callback function
+ * for a mb_ereg_replace_callback in just one place.
+ * In this case you can use an
+ * anonymous function to
+ * declare the callback within the call to
+ * mb_ereg_replace_callback. By doing it this way
+ * you have all information for the call in one place and do not
+ * clutter the function namespace with a callback function's name
+ * not used anywhere else.
+ * @param string $string The string being checked.
+ * @param string $option The search option. See mb_regex_set_options for explanation.
+ * @return string The resultant string on success.
+ * @throws MbstringException
+ *
+ */
+function mb_ereg_replace_callback(string $pattern, callable $callback, string $string, string $option = "msr"): string
+{
+ error_clear_last();
+ $result = \mb_ereg_replace_callback($pattern, $callback, $string, $option);
+ if ($result === false) {
+ throw MbstringException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ *
+ *
+ * @param string $pattern The regular expression pattern.
+ *
+ * Multibyte characters may be used in pattern.
+ * @param string $replacement The replacement text.
+ * @param string $string The string being checked.
+ * @param string $option
+ * @return string The resultant string on success.
+ * @throws MbstringException
+ *
+ */
+function mb_ereg_replace(string $pattern, string $replacement, string $string, string $option = "msr"): string
+{
+ error_clear_last();
+ $result = \mb_ereg_replace($pattern, $replacement, $string, $option);
+ if ($result === false) {
+ throw MbstringException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ *
+ *
+ * @return array
+ * @throws MbstringException
+ *
+ */
+function mb_ereg_search_getregs(): array
+{
+ error_clear_last();
+ $result = \mb_ereg_search_getregs();
+ if ($result === false) {
+ throw MbstringException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * mb_ereg_search_init sets
+ * string and pattern
+ * for a multibyte regular expression. These values are used for
+ * mb_ereg_search,
+ * mb_ereg_search_pos, and
+ * mb_ereg_search_regs.
+ *
+ * @param string $string The search string.
+ * @param string $pattern The search pattern.
+ * @param string $option The search option. See mb_regex_set_options for explanation.
+ * @throws MbstringException
+ *
+ */
+function mb_ereg_search_init(string $string, string $pattern = null, string $option = "msr"): void
+{
+ error_clear_last();
+ if ($option !== "msr") {
+ $result = \mb_ereg_search_init($string, $pattern, $option);
+ } elseif ($pattern !== null) {
+ $result = \mb_ereg_search_init($string, $pattern);
+ } else {
+ $result = \mb_ereg_search_init($string);
+ }
+ if ($result === false) {
+ throw MbstringException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Returns the matched part of a multibyte regular expression.
+ *
+ * @param string $pattern The search pattern.
+ * @param string $option The search option. See mb_regex_set_options for explanation.
+ * @return array
+ * @throws MbstringException
+ *
+ */
+function mb_ereg_search_regs(string $pattern = null, string $option = "ms"): array
+{
+ error_clear_last();
+ if ($option !== "ms") {
+ $result = \mb_ereg_search_regs($pattern, $option);
+ } elseif ($pattern !== null) {
+ $result = \mb_ereg_search_regs($pattern);
+ } else {
+ $result = \mb_ereg_search_regs();
+ }
+ if ($result === false) {
+ throw MbstringException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ *
+ *
+ * @param int $position The position to set. If it is negative, it counts from the end of the string.
+ * @throws MbstringException
+ *
+ */
+function mb_ereg_search_setpos(int $position): void
+{
+ error_clear_last();
+ $result = \mb_ereg_search_setpos($position);
+ if ($result === false) {
+ throw MbstringException::createFromPhpError();
+ }
+}
+
+
+/**
+ *
+ *
+ * @param string $pattern The regular expression pattern. Multibyte characters may be used. The case will be ignored.
+ * @param string $replace The replacement text.
+ * @param string $string The searched string.
+ * @param string $option
+ * @return string The resultant string.
+ * @throws MbstringException
+ *
+ */
+function mb_eregi_replace(string $pattern, string $replace, string $string, string $option = "msri"): string
+{
+ error_clear_last();
+ $result = \mb_eregi_replace($pattern, $replace, $string, $option);
+ if ($result === false) {
+ throw MbstringException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Set/Get the HTTP output character encoding.
+ * Output after this function is called will be converted from the set internal encoding to encoding.
+ *
+ * @param string $encoding If encoding is set,
+ * mb_http_output sets the HTTP output character
+ * encoding to encoding.
+ *
+ * If encoding is omitted,
+ * mb_http_output returns the current HTTP output
+ * character encoding.
+ * @return string|bool If encoding is omitted,
+ * mb_http_output returns the current HTTP output
+ * character encoding. Otherwise,
+ * Returns TRUE on success.
+ * @throws MbstringException
+ *
+ */
+function mb_http_output(string $encoding = null)
+{
+ error_clear_last();
+ if ($encoding !== null) {
+ $result = \mb_http_output($encoding);
+ } else {
+ $result = \mb_http_output();
+ }
+ if ($result === false) {
+ throw MbstringException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Set/Get the internal character encoding
+ *
+ * @param string $encoding encoding is the character encoding name
+ * used for the HTTP input character encoding conversion, HTTP output
+ * character encoding conversion, and the default character encoding
+ * for string functions defined by the mbstring module.
+ * You should notice that the internal encoding is totally different from the one for multibyte regex.
+ * @return string|bool If encoding is set, then
+ * Returns TRUE on success.
+ * In this case, the character encoding for multibyte regex is NOT changed.
+ * If encoding is omitted, then
+ * the current character encoding name is returned.
+ * @throws MbstringException
+ *
+ */
+function mb_internal_encoding(string $encoding = null)
+{
+ error_clear_last();
+ if ($encoding !== null) {
+ $result = \mb_internal_encoding($encoding);
+ } else {
+ $result = \mb_internal_encoding();
+ }
+ if ($result === false) {
+ throw MbstringException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ *
+ *
+ * @param string $str
+ * @param string $encoding
+ * @return int Returns a code point of character.
+ * @throws MbstringException
+ *
+ */
+function mb_ord(string $str, string $encoding = null): int
+{
+ error_clear_last();
+ if ($encoding !== null) {
+ $result = \mb_ord($str, $encoding);
+ } else {
+ $result = \mb_ord($str);
+ }
+ if ($result === false) {
+ throw MbstringException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Parses GET/POST/COOKIE data and
+ * sets global variables. Since PHP does not provide raw POST/COOKIE
+ * data, it can only be used for GET data for now. It parses URL
+ * encoded data, detects encoding, converts coding to internal
+ * encoding and set values to the result array or
+ * global variables.
+ *
+ * @param string $encoded_string The URL encoded data.
+ * @param array|null $result An array containing decoded and character encoded converted values.
+ * @throws MbstringException
+ *
+ */
+function mb_parse_str(string $encoded_string, ?array &$result): void
+{
+ error_clear_last();
+ $result = \mb_parse_str($encoded_string, $result);
+ if ($result === false) {
+ throw MbstringException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Set/Get character encoding for a multibyte regex.
+ *
+ * @param string $encoding The encoding
+ * parameter is the character encoding. If it is omitted, the internal character
+ * encoding value will be used.
+ * @return string|bool
+ * @throws MbstringException
+ *
+ */
+function mb_regex_encoding(string $encoding = null)
+{
+ error_clear_last();
+ if ($encoding !== null) {
+ $result = \mb_regex_encoding($encoding);
+ } else {
+ $result = \mb_regex_encoding();
+ }
+ if ($result === false) {
+ throw MbstringException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Sends email. Headers and messages are converted and encoded according
+ * to the mb_language setting. It's a wrapper function
+ * for mail, so see also mail for details.
+ *
+ * @param string $to The mail addresses being sent to. Multiple
+ * recipients may be specified by putting a comma between each
+ * address in to.
+ * This parameter is not automatically encoded.
+ * @param string $subject The subject of the mail.
+ * @param string $message The message of the mail.
+ * @param string|array|null $additional_headers String or array to be inserted at the end of the email header.
+ *
+ * This is typically used to add extra headers (From, Cc, and Bcc).
+ * Multiple extra headers should be separated with a CRLF (\r\n).
+ * Validate parameter not to be injected unwanted headers by attackers.
+ *
+ * If an array is passed, its keys are the header names and its
+ * values are the respective header values.
+ *
+ * When sending mail, the mail must contain
+ * a From header. This can be set with the
+ * additional_headers parameter, or a default
+ * can be set in php.ini.
+ *
+ * Failing to do this will result in an error
+ * message similar to Warning: mail(): "sendmail_from" not
+ * set in php.ini or custom "From:" header missing.
+ * The From header sets also
+ * Return-Path under Windows.
+ *
+ * If messages are not received, try using a LF (\n) only.
+ * Some Unix mail transfer agents (most notably
+ * qmail) replace LF by CRLF
+ * automatically (which leads to doubling CR if CRLF is used).
+ * This should be a last resort, as it does not comply with
+ * RFC 2822.
+ * @param string $additional_parameter additional_parameter is a MTA command line
+ * parameter. It is useful when setting the correct Return-Path
+ * header when using sendmail.
+ *
+ * This parameter is escaped by escapeshellcmd internally
+ * to prevent command execution. escapeshellcmd prevents
+ * command execution, but allows to add additional parameters. For security reason,
+ * this parameter should be validated.
+ *
+ * Since escapeshellcmd is applied automatically, some characters
+ * that are allowed as email addresses by internet RFCs cannot be used. Programs
+ * that are required to use these characters mail cannot be used.
+ *
+ * The user that the webserver runs as should be added as a trusted user to the
+ * sendmail configuration to prevent a 'X-Warning' header from being added
+ * to the message when the envelope sender (-f) is set using this method.
+ * For sendmail users, this file is /etc/mail/trusted-users.
+ * @throws MbstringException
+ *
+ */
+function mb_send_mail(string $to, string $subject, string $message, $additional_headers = null, string $additional_parameter = null): void
+{
+ error_clear_last();
+ $result = \mb_send_mail($to, $subject, $message, $additional_headers, $additional_parameter);
+ if ($result === false) {
+ throw MbstringException::createFromPhpError();
+ }
+}
+
+
+/**
+ *
+ *
+ * @param string $pattern The regular expression pattern.
+ * @param string $string The string being split.
+ * @param int $limit
+ * @return array The result as an array.
+ * @throws MbstringException
+ *
+ */
+function mb_split(string $pattern, string $string, int $limit = -1): array
+{
+ error_clear_last();
+ $result = \mb_split($pattern, $string, $limit);
+ if ($result === false) {
+ throw MbstringException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * This function will return an array of strings, it is a version of str_split with support for encodings of variable character size as well as fixed-size encodings of 1,2 or 4 byte characters.
+ * If the split_length parameter is specified, the string is broken down into chunks of the specified length in characters (not bytes).
+ * The encoding parameter can be optionally specified and it is good practice to do so.
+ *
+ * @param string $string The string to split into characters or chunks.
+ * @param int $split_length If specified, each element of the returned array will be composed of multiple characters instead of a single character.
+ * @param string $encoding The encoding
+ * parameter is the character encoding. If it is omitted, the internal character
+ * encoding value will be used.
+ *
+ * A string specifying one of the supported encodings.
+ * @return array mb_str_split returns an array of strings.
+ * @throws MbstringException
+ *
+ */
+function mb_str_split(string $string, int $split_length = 1, string $encoding = null): array
+{
+ error_clear_last();
+ if ($encoding !== null) {
+ $result = \mb_str_split($string, $split_length, $encoding);
+ } else {
+ $result = \mb_str_split($string, $split_length);
+ }
+ if ($result === false) {
+ throw MbstringException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/misc.php b/vendor/thecodingmachine/safe/generated/misc.php
new file mode 100644
index 000000000..ff636fd49
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/misc.php
@@ -0,0 +1,464 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\MiscException;
+
+/**
+ * Defines a named constant at runtime.
+ *
+ * @param string $name The name of the constant.
+ *
+ * It is possible to define constants with reserved or
+ * even invalid names, whose value can (only) be retrieved with
+ * constant. However, doing so is not recommended.
+ * @param mixed $value The value of the constant. In PHP 5, value must
+ * be a scalar value (integer,
+ * float, string, boolean, or
+ * NULL). In PHP 7, array values are also accepted.
+ *
+ * While it is possible to define resource constants, it is
+ * not recommended and may cause unpredictable behavior.
+ * @param bool $case_insensitive If set to TRUE, the constant will be defined case-insensitive.
+ * The default behavior is case-sensitive; i.e.
+ * CONSTANT and Constant represent
+ * different values.
+ *
+ * Case-insensitive constants are stored as lower-case.
+ * @throws MiscException
+ *
+ */
+function define(string $name, $value, bool $case_insensitive = false): void
+{
+ error_clear_last();
+ $result = \define($name, $value, $case_insensitive);
+ if ($result === false) {
+ throw MiscException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Prints out or returns a syntax highlighted version of the code contained
+ * in filename using the colors defined in the
+ * built-in syntax highlighter for PHP.
+ *
+ * Many servers are configured to automatically highlight files
+ * with a phps extension. For example,
+ * example.phps when viewed will show the
+ * syntax highlighted source of the file. To enable this, add this
+ * line to the httpd.conf:
+ *
+ * @param string $filename Path to the PHP file to be highlighted.
+ * @param bool $return Set this parameter to TRUE to make this function return the
+ * highlighted code.
+ * @return string|bool If return is set to TRUE, returns the highlighted
+ * code as a string instead of printing it out. Otherwise, it will return
+ * TRUE on success, FALSE on failure.
+ * @throws MiscException
+ *
+ */
+function highlight_file(string $filename, bool $return = false)
+{
+ error_clear_last();
+ $result = \highlight_file($filename, $return);
+ if ($result === false) {
+ throw MiscException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ *
+ *
+ * @param string $str The PHP code to be highlighted. This should include the opening tag.
+ * @param bool $return Set this parameter to TRUE to make this function return the
+ * highlighted code.
+ * @return string|bool If return is set to TRUE, returns the highlighted
+ * code as a string instead of printing it out. Otherwise, it will return
+ * TRUE on success, FALSE on failure.
+ * @throws MiscException
+ *
+ */
+function highlight_string(string $str, bool $return = false)
+{
+ error_clear_last();
+ $result = \highlight_string($str, $return);
+ if ($result === false) {
+ throw MiscException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Pack given arguments into a binary string according to
+ * format.
+ *
+ * The idea for this function was taken from Perl and all formatting codes
+ * work the same as in Perl. However, there are some formatting codes that are
+ * missing such as Perl's "u" format code.
+ *
+ * Note that the distinction between signed and unsigned values only
+ * affects the function unpack, where as
+ * function pack gives the same result for
+ * signed and unsigned format codes.
+ *
+ * @param string $format The format string consists of format codes
+ * followed by an optional repeater argument. The repeater argument can
+ * be either an integer value or * for repeating to
+ * the end of the input data. For a, A, h, H the repeat count specifies
+ * how many characters of one data argument are taken, for @ it is the
+ * absolute position where to put the next data, for everything else the
+ * repeat count specifies how many data arguments are consumed and packed
+ * into the resulting binary string.
+ *
+ * Currently implemented formats are:
+ *
+ * pack format characters
+ *
+ *
+ *
+ * Code
+ * Description
+ *
+ *
+ *
+ *
+ * a
+ * NUL-padded string
+ *
+ *
+ * A
+ * SPACE-padded string
+ *
+ * h
+ * Hex string, low nibble first
+ *
+ * H
+ * Hex string, high nibble first
+ * csigned char
+ *
+ * C
+ * unsigned char
+ *
+ * s
+ * signed short (always 16 bit, machine byte order)
+ *
+ *
+ * S
+ * unsigned short (always 16 bit, machine byte order)
+ *
+ *
+ * n
+ * unsigned short (always 16 bit, big endian byte order)
+ *
+ *
+ * v
+ * unsigned short (always 16 bit, little endian byte order)
+ *
+ *
+ * i
+ * signed integer (machine dependent size and byte order)
+ *
+ *
+ * I
+ * unsigned integer (machine dependent size and byte order)
+ *
+ *
+ * l
+ * signed long (always 32 bit, machine byte order)
+ *
+ *
+ * L
+ * unsigned long (always 32 bit, machine byte order)
+ *
+ *
+ * N
+ * unsigned long (always 32 bit, big endian byte order)
+ *
+ *
+ * V
+ * unsigned long (always 32 bit, little endian byte order)
+ *
+ *
+ * q
+ * signed long long (always 64 bit, machine byte order)
+ *
+ *
+ * Q
+ * unsigned long long (always 64 bit, machine byte order)
+ *
+ *
+ * J
+ * unsigned long long (always 64 bit, big endian byte order)
+ *
+ *
+ * P
+ * unsigned long long (always 64 bit, little endian byte order)
+ *
+ *
+ * f
+ * float (machine dependent size and representation)
+ *
+ *
+ * g
+ * float (machine dependent size, little endian byte order)
+ *
+ *
+ * G
+ * float (machine dependent size, big endian byte order)
+ *
+ *
+ * d
+ * double (machine dependent size and representation)
+ *
+ *
+ * e
+ * double (machine dependent size, little endian byte order)
+ *
+ *
+ * E
+ * double (machine dependent size, big endian byte order)
+ *
+ *
+ * x
+ * NUL byte
+ *
+ *
+ * X
+ * Back up one byte
+ *
+ *
+ * Z
+ * NUL-padded string (new in PHP 5.5)
+ *
+ *
+ * @
+ * NUL-fill to absolute position
+ *
+ *
+ *
+ *
+ * @param mixed $params
+ * @return string Returns a binary string containing data.
+ * @throws MiscException
+ *
+ */
+function pack(string $format, ...$params): string
+{
+ error_clear_last();
+ if ($params !== []) {
+ $result = \pack($format, ...$params);
+ } else {
+ $result = \pack($format);
+ }
+ if ($result === false) {
+ throw MiscException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Convert string from one codepage to another.
+ *
+ * @param int|string $in_codepage The codepage of the subject string.
+ * Either the codepage name or identifier.
+ * @param int|string $out_codepage The codepage to convert the subject string to.
+ * Either the codepage name or identifier.
+ * @param string $subject The string to convert.
+ * @return string The subject string converted to
+ * out_codepage.
+ * @throws MiscException
+ *
+ */
+function sapi_windows_cp_conv($in_codepage, $out_codepage, string $subject): string
+{
+ error_clear_last();
+ $result = \sapi_windows_cp_conv($in_codepage, $out_codepage, $subject);
+ if ($result === null) {
+ throw MiscException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Set the codepage of the current process.
+ *
+ * @param int $cp A codepage identifier.
+ * @throws MiscException
+ *
+ */
+function sapi_windows_cp_set(int $cp): void
+{
+ error_clear_last();
+ $result = \sapi_windows_cp_set($cp);
+ if ($result === false) {
+ throw MiscException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sends a CTRL event to another process in the same process group.
+ *
+ * @param int $event The CTRL even to send;
+ * either PHP_WINDOWS_EVENT_CTRL_C
+ * or PHP_WINDOWS_EVENT_CTRL_BREAK.
+ * @param int $pid The ID of the process to which to send the event to. If 0
+ * is given, the event is sent to all processes of the process group.
+ * @throws MiscException
+ *
+ */
+function sapi_windows_generate_ctrl_event(int $event, int $pid = 0): void
+{
+ error_clear_last();
+ $result = \sapi_windows_generate_ctrl_event($event, $pid);
+ if ($result === false) {
+ throw MiscException::createFromPhpError();
+ }
+}
+
+
+/**
+ * If enable is omitted, the function returns TRUE if the stream stream has VT100 control codes enabled, FALSE otherwise.
+ *
+ * If enable is specified, the function will try to enable or disable the VT100 features of the stream stream.
+ * If the feature has been successfully enabled (or disabled).
+ *
+ * At startup, PHP tries to enable the VT100 feature of the STDOUT/STDERR streams. By the way, if those streams are redirected to a file, the VT100 features may not be enabled.
+ *
+ * If VT100 support is enabled, it is possible to use control sequences as they are known from the VT100 terminal.
+ * They allow the modification of the terminal's output. On Windows these sequences are called Console Virtual Terminal Sequences.
+ *
+ * @param resource $stream The stream on which the function will operate.
+ * @param bool $enable If specified, the VT100 feature will be enabled (if TRUE) or disabled (if FALSE).
+ * @throws MiscException
+ *
+ */
+function sapi_windows_vt100_support($stream, bool $enable = null): void
+{
+ error_clear_last();
+ if ($enable !== null) {
+ $result = \sapi_windows_vt100_support($stream, $enable);
+ } else {
+ $result = \sapi_windows_vt100_support($stream);
+ }
+ if ($result === false) {
+ throw MiscException::createFromPhpError();
+ }
+}
+
+
+/**
+ *
+ *
+ * @param int $seconds Halt time in seconds.
+ * @return int Returns zero on success.
+ *
+ * If the call was interrupted by a signal, sleep returns
+ * a non-zero value. On Windows, this value will always be
+ * 192 (the value of the
+ * WAIT_IO_COMPLETION constant within the Windows API).
+ * On other platforms, the return value will be the number of seconds left to
+ * sleep.
+ * @throws MiscException
+ *
+ */
+function sleep(int $seconds): int
+{
+ error_clear_last();
+ $result = \sleep($seconds);
+ if ($result === false) {
+ throw MiscException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Delays program execution for the given number of
+ * seconds and nanoseconds.
+ *
+ * @param int $seconds Must be a non-negative integer.
+ * @param int $nanoseconds Must be a non-negative integer less than 1 billion.
+ * @return array{0:int,1:int}|bool Returns TRUE on success.
+ *
+ * If the delay was interrupted by a signal, an associative array will be
+ * returned with the components:
+ *
+ *
+ *
+ * seconds - number of seconds remaining in
+ * the delay
+ *
+ *
+ *
+ *
+ * nanoseconds - number of nanoseconds
+ * remaining in the delay
+ *
+ *
+ *
+ * @throws MiscException
+ *
+ */
+function time_nanosleep(int $seconds, int $nanoseconds)
+{
+ error_clear_last();
+ $result = \time_nanosleep($seconds, $nanoseconds);
+ if ($result === false) {
+ throw MiscException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Makes the script sleep until the specified
+ * timestamp.
+ *
+ * @param float $timestamp The timestamp when the script should wake.
+ * @throws MiscException
+ *
+ */
+function time_sleep_until(float $timestamp): void
+{
+ error_clear_last();
+ $result = \time_sleep_until($timestamp);
+ if ($result === false) {
+ throw MiscException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Unpacks from a binary string into an array according to the given
+ * format.
+ *
+ * The unpacked data is stored in an associative array. To
+ * accomplish this you have to name the different format codes and
+ * separate them by a slash /. If a repeater argument is present,
+ * then each of the array keys will have a sequence number behind
+ * the given name.
+ *
+ * @param string $format See pack for an explanation of the format codes.
+ * @param string $data The packed data.
+ * @param int $offset The offset to begin unpacking from.
+ * @return array Returns an associative array containing unpacked elements of binary
+ * string.
+ * @throws MiscException
+ *
+ */
+function unpack(string $format, string $data, int $offset = 0): array
+{
+ error_clear_last();
+ $result = \unpack($format, $data, $offset);
+ if ($result === false) {
+ throw MiscException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/msql.php b/vendor/thecodingmachine/safe/generated/msql.php
new file mode 100644
index 000000000..331c1b6cd
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/msql.php
@@ -0,0 +1,443 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\MsqlException;
+
+/**
+ * Returns number of affected rows by the last SELECT, UPDATE or DELETE
+ * query associated with result.
+ *
+ * @param resource $result The result resource that
+ * is being evaluated. This result comes from a call to
+ * msql_query.
+ * @return int Returns the number of affected rows on success.
+ * @throws MsqlException
+ *
+ */
+function msql_affected_rows($result): int
+{
+ error_clear_last();
+ $result = \msql_affected_rows($result);
+ if ($result === false) {
+ throw MsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * msql_close closes the non-persistent connection to
+ * the mSQL server that's associated with the specified link identifier.
+ *
+ * Using msql_close isn't usually necessary, as
+ * non-persistent open links are automatically closed at the end of the
+ * script's execution. See also freeing resources.
+ *
+ * @param resource|null $link_identifier The mSQL connection.
+ * If not specified, the last link opened by msql_connect
+ * is assumed. If no such link is found, the function will try to establish a
+ * link as if msql_connect was called, and use it.
+ * @throws MsqlException
+ *
+ */
+function msql_close($link_identifier = null): void
+{
+ error_clear_last();
+ if ($link_identifier !== null) {
+ $result = \msql_close($link_identifier);
+ } else {
+ $result = \msql_close();
+ }
+ if ($result === false) {
+ throw MsqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * msql_connect establishes a connection to a mSQL
+ * server.
+ *
+ * If a second call is made to msql_connect with
+ * the same arguments, no new link will be established, but instead, the
+ * link identifier of the already opened link will be returned.
+ *
+ * The link to the server will be closed as soon as the execution of the
+ * script ends, unless it's closed earlier by explicitly calling
+ * msql_close.
+ *
+ * @param string $hostname The hostname can also include a port number. e.g.
+ * hostname,port.
+ *
+ * If not specified, the connection is established by the means of a Unix
+ * domain socket, being then more efficient then a localhost TCP socket
+ * connection.
+ *
+ * While this function will accept a colon (:) as a
+ * host/port separator, a comma (,) is the preferred
+ * method.
+ * @return resource Returns a positive mSQL link identifier on success.
+ * @throws MsqlException
+ *
+ */
+function msql_connect(string $hostname = null)
+{
+ error_clear_last();
+ if ($hostname !== null) {
+ $result = \msql_connect($hostname);
+ } else {
+ $result = \msql_connect();
+ }
+ if ($result === false) {
+ throw MsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * msql_create_db attempts to create a new database on
+ * the mSQL server.
+ *
+ * @param string $database_name The name of the mSQL database.
+ * @param resource|null $link_identifier The mSQL connection.
+ * If not specified, the last link opened by msql_connect
+ * is assumed. If no such link is found, the function will try to establish a
+ * link as if msql_connect was called, and use it.
+ * @throws MsqlException
+ *
+ */
+function msql_create_db(string $database_name, $link_identifier = null): void
+{
+ error_clear_last();
+ if ($link_identifier !== null) {
+ $result = \msql_create_db($database_name, $link_identifier);
+ } else {
+ $result = \msql_create_db($database_name);
+ }
+ if ($result === false) {
+ throw MsqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * msql_data_seek moves the internal row
+ * pointer of the mSQL result associated with the specified query
+ * identifier to point to the specified row number. The next call
+ * to msql_fetch_row would return that
+ * row.
+ *
+ * @param resource $result The result resource that
+ * is being evaluated. This result comes from a call to
+ * msql_query.
+ * @param int $row_number The seeked row number.
+ * @throws MsqlException
+ *
+ */
+function msql_data_seek($result, int $row_number): void
+{
+ error_clear_last();
+ $result = \msql_data_seek($result, $row_number);
+ if ($result === false) {
+ throw MsqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * msql_db_query selects a database and executes a query
+ * on it.
+ *
+ * @param string $database The name of the mSQL database.
+ * @param string $query The SQL query.
+ * @param resource|null $link_identifier The mSQL connection.
+ * If not specified, the last link opened by msql_connect
+ * is assumed. If no such link is found, the function will try to establish a
+ * link as if msql_connect was called, and use it.
+ * @return resource Returns a positive mSQL query identifier to the query result.
+ * @throws MsqlException
+ *
+ */
+function msql_db_query(string $database, string $query, $link_identifier = null)
+{
+ error_clear_last();
+ if ($link_identifier !== null) {
+ $result = \msql_db_query($database, $query, $link_identifier);
+ } else {
+ $result = \msql_db_query($database, $query);
+ }
+ if ($result === false) {
+ throw MsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * msql_drop_db attempts to drop (remove) a database
+ * from the mSQL server.
+ *
+ * @param string $database_name The name of the database.
+ * @param resource|null $link_identifier The mSQL connection.
+ * If not specified, the last link opened by msql_connect
+ * is assumed. If no such link is found, the function will try to establish a
+ * link as if msql_connect was called, and use it.
+ * @throws MsqlException
+ *
+ */
+function msql_drop_db(string $database_name, $link_identifier = null): void
+{
+ error_clear_last();
+ if ($link_identifier !== null) {
+ $result = \msql_drop_db($database_name, $link_identifier);
+ } else {
+ $result = \msql_drop_db($database_name);
+ }
+ if ($result === false) {
+ throw MsqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * msql_field_len returns the length of the specified
+ * field.
+ *
+ * @param resource $result The result resource that
+ * is being evaluated. This result comes from a call to
+ * msql_query.
+ * @param int $field_offset The numerical field offset. The
+ * field_offset starts at 1.
+ * @return int Returns the length of the specified field.
+ * @throws MsqlException
+ *
+ */
+function msql_field_len($result, int $field_offset): int
+{
+ error_clear_last();
+ $result = \msql_field_len($result, $field_offset);
+ if ($result === false) {
+ throw MsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * msql_field_name gets the name of the specified field
+ * index.
+ *
+ * @param resource $result The result resource that
+ * is being evaluated. This result comes from a call to
+ * msql_query.
+ * @param int $field_offset The numerical field offset. The
+ * field_offset starts at 1.
+ * @return string The name of the field.
+ * @throws MsqlException
+ *
+ */
+function msql_field_name($result, int $field_offset): string
+{
+ error_clear_last();
+ $result = \msql_field_name($result, $field_offset);
+ if ($result === false) {
+ throw MsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Seeks to the specified field offset. If the next call to
+ * msql_fetch_field won't include a field offset, this
+ * field would be returned.
+ *
+ * @param resource $result The result resource that
+ * is being evaluated. This result comes from a call to
+ * msql_query.
+ * @param int $field_offset The numerical field offset. The
+ * field_offset starts at 1.
+ * @throws MsqlException
+ *
+ */
+function msql_field_seek($result, int $field_offset): void
+{
+ error_clear_last();
+ $result = \msql_field_seek($result, $field_offset);
+ if ($result === false) {
+ throw MsqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Returns the name of the table that the specified field is in.
+ *
+ * @param resource $result The result resource that
+ * is being evaluated. This result comes from a call to
+ * msql_query.
+ * @param int $field_offset The numerical field offset. The
+ * field_offset starts at 1.
+ * @return int The name of the table on success.
+ * @throws MsqlException
+ *
+ */
+function msql_field_table($result, int $field_offset): int
+{
+ error_clear_last();
+ $result = \msql_field_table($result, $field_offset);
+ if ($result === false) {
+ throw MsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * msql_field_type gets the type of the specified field
+ * index.
+ *
+ * @param resource $result The result resource that
+ * is being evaluated. This result comes from a call to
+ * msql_query.
+ * @param int $field_offset The numerical field offset. The
+ * field_offset starts at 1.
+ * @return string The type of the field. One of int,
+ * char, real, ident,
+ * null or unknown. This functions will
+ * return FALSE on failure.
+ * @throws MsqlException
+ *
+ */
+function msql_field_type($result, int $field_offset): string
+{
+ error_clear_last();
+ $result = \msql_field_type($result, $field_offset);
+ if ($result === false) {
+ throw MsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * msql_free_result frees the memory associated
+ * with query_identifier. When PHP completes a
+ * request, this memory is freed automatically, so you only need to
+ * call this function when you want to make sure you don't use too
+ * much memory while the script is running.
+ *
+ * @param resource $result The result resource that
+ * is being evaluated. This result comes from a call to
+ * msql_query.
+ * @throws MsqlException
+ *
+ */
+function msql_free_result($result): void
+{
+ error_clear_last();
+ $result = \msql_free_result($result);
+ if ($result === false) {
+ throw MsqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * msql_pconnect acts very much like
+ * msql_connect with two major differences.
+ *
+ * First, when connecting, the function would first try to find a
+ * (persistent) link that's already open with the same host.
+ * If one is found, an identifier for it will be returned instead of opening
+ * a new connection.
+ *
+ * Second, the connection to the SQL server will not be closed when the
+ * execution of the script ends. Instead, the link will remain open for
+ * future use (msql_close will not close links
+ * established by this function).
+ *
+ * @param string $hostname The hostname can also include a port number. e.g.
+ * hostname,port.
+ *
+ * If not specified, the connection is established by the means of a Unix
+ * domain socket, being more efficient than a localhost TCP socket
+ * connection.
+ * @return resource Returns a positive mSQL link identifier on success.
+ * @throws MsqlException
+ *
+ */
+function msql_pconnect(string $hostname = null)
+{
+ error_clear_last();
+ if ($hostname !== null) {
+ $result = \msql_pconnect($hostname);
+ } else {
+ $result = \msql_pconnect();
+ }
+ if ($result === false) {
+ throw MsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * msql_query sends a query to the currently active
+ * database on the server that's associated with the specified link
+ * identifier.
+ *
+ * @param string $query The SQL query.
+ * @param resource|null $link_identifier The mSQL connection.
+ * If not specified, the last link opened by msql_connect
+ * is assumed. If no such link is found, the function will try to establish a
+ * link as if msql_connect was called, and use it.
+ * @return resource Returns a positive mSQL query identifier on success.
+ * @throws MsqlException
+ *
+ */
+function msql_query(string $query, $link_identifier = null)
+{
+ error_clear_last();
+ if ($link_identifier !== null) {
+ $result = \msql_query($query, $link_identifier);
+ } else {
+ $result = \msql_query($query);
+ }
+ if ($result === false) {
+ throw MsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * msql_select_db sets the current active database on
+ * the server that's associated with the specified
+ * link_identifier.
+ *
+ * Subsequent calls to msql_query will be made on the
+ * active database.
+ *
+ * @param string $database_name The database name.
+ * @param resource|null $link_identifier The mSQL connection.
+ * If not specified, the last link opened by msql_connect
+ * is assumed. If no such link is found, the function will try to establish a
+ * link as if msql_connect was called, and use it.
+ * @throws MsqlException
+ *
+ */
+function msql_select_db(string $database_name, $link_identifier = null): void
+{
+ error_clear_last();
+ if ($link_identifier !== null) {
+ $result = \msql_select_db($database_name, $link_identifier);
+ } else {
+ $result = \msql_select_db($database_name);
+ }
+ if ($result === false) {
+ throw MsqlException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/mysql.php b/vendor/thecodingmachine/safe/generated/mysql.php
new file mode 100644
index 000000000..475c609c9
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/mysql.php
@@ -0,0 +1,938 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\MysqlException;
+
+/**
+ * mysql_close closes the non-persistent connection to
+ * the MySQL server that's associated with the specified link identifier. If
+ * link_identifier isn't specified, the last opened
+ * link is used.
+ *
+ *
+ * Open non-persistent MySQL connections and result sets are automatically destroyed when a
+ * PHP script finishes its execution. So, while explicitly closing open
+ * connections and freeing result sets is optional, doing so is recommended.
+ * This will immediately return resources to PHP and MySQL, which can
+ * improve performance. For related information, see
+ * freeing resources
+ *
+ * @param resource $link_identifier The MySQL connection. If the
+ * link identifier is not specified, the last link opened by
+ * mysql_connect is assumed. If no connection is found or
+ * established, an E_WARNING level error is
+ * generated.
+ * @throws MysqlException
+ *
+ */
+function mysql_close($link_identifier = null): void
+{
+ error_clear_last();
+ $result = \mysql_close($link_identifier);
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Opens or reuses a connection to a MySQL server.
+ *
+ * @param string $server The MySQL server. It can also include a port number. e.g.
+ * "hostname:port" or a path to a local socket e.g. ":/path/to/socket" for
+ * the localhost.
+ *
+ * If the PHP directive
+ * mysql.default_host is undefined (default), then the default
+ * value is 'localhost:3306'. In SQL safe mode, this parameter is ignored
+ * and value 'localhost:3306' is always used.
+ * @param string $username The username. Default value is defined by mysql.default_user. In
+ * SQL safe mode, this parameter is ignored and the name of the user that
+ * owns the server process is used.
+ * @param string $password The password. Default value is defined by mysql.default_password. In
+ * SQL safe mode, this parameter is ignored and empty password is used.
+ * @param bool $new_link If a second call is made to mysql_connect
+ * with the same arguments, no new link will be established, but
+ * instead, the link identifier of the already opened link will be
+ * returned. The new_link parameter modifies this
+ * behavior and makes mysql_connect always open
+ * a new link, even if mysql_connect was called
+ * before with the same parameters.
+ * In SQL safe mode, this parameter is ignored.
+ * @param int $client_flags The client_flags parameter can be a combination
+ * of the following constants:
+ * 128 (enable LOAD DATA LOCAL handling),
+ * MYSQL_CLIENT_SSL,
+ * MYSQL_CLIENT_COMPRESS,
+ * MYSQL_CLIENT_IGNORE_SPACE or
+ * MYSQL_CLIENT_INTERACTIVE.
+ * Read the section about for further information.
+ * In SQL safe mode, this parameter is ignored.
+ * @return resource Returns a MySQL link identifier on success.
+ * @throws MysqlException
+ *
+ */
+function mysql_connect(string $server = null, string $username = null, string $password = null, bool $new_link = false, int $client_flags = 0)
+{
+ error_clear_last();
+ if ($client_flags !== 0) {
+ $result = \mysql_connect($server, $username, $password, $new_link, $client_flags);
+ } elseif ($new_link !== false) {
+ $result = \mysql_connect($server, $username, $password, $new_link);
+ } elseif ($password !== null) {
+ $result = \mysql_connect($server, $username, $password);
+ } elseif ($username !== null) {
+ $result = \mysql_connect($server, $username);
+ } elseif ($server !== null) {
+ $result = \mysql_connect($server);
+ } else {
+ $result = \mysql_connect();
+ }
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * mysql_create_db attempts to create a new
+ * database on the server associated with the specified link
+ * identifier.
+ *
+ * @param string $database_name The name of the database being created.
+ * @param resource $link_identifier The MySQL connection. If the
+ * link identifier is not specified, the last link opened by
+ * mysql_connect is assumed. If no such link is found, it
+ * will try to create one as if mysql_connect had been called
+ * with no arguments. If no connection is found or established, an
+ * E_WARNING level error is generated.
+ * @throws MysqlException
+ *
+ */
+function mysql_create_db(string $database_name, $link_identifier = null): void
+{
+ error_clear_last();
+ $result = \mysql_create_db($database_name, $link_identifier);
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * mysql_data_seek moves the internal row
+ * pointer of the MySQL result associated with the specified result
+ * identifier to point to the specified row number. The next call
+ * to a MySQL fetch function, such as mysql_fetch_assoc,
+ * would return that row.
+ *
+ * row_number starts at 0. The
+ * row_number should be a value in the range from 0 to
+ * mysql_num_rows - 1. However if the result set
+ * is empty (mysql_num_rows == 0), a seek to 0 will
+ * fail with an E_WARNING and
+ * mysql_data_seek will return FALSE.
+ *
+ * @param resource $result The result resource that
+ * is being evaluated. This result comes from a call to
+ * mysql_query.
+ * @param int $row_number The desired row number of the new result pointer.
+ * @throws MysqlException
+ *
+ */
+function mysql_data_seek($result, int $row_number): void
+{
+ error_clear_last();
+ $result = \mysql_data_seek($result, $row_number);
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Retrieve the database name from a call to
+ * mysql_list_dbs.
+ *
+ * @param resource $result The result pointer from a call to mysql_list_dbs.
+ * @param int $row The index into the result set.
+ * @param mixed $field The field name.
+ * @return string Returns the database name on success. If FALSE
+ * is returned, use mysql_error to determine the nature
+ * of the error.
+ * @throws MysqlException
+ *
+ */
+function mysql_db_name($result, int $row, $field = null): string
+{
+ error_clear_last();
+ $result = \mysql_db_name($result, $row, $field);
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * mysql_db_query selects a database, and executes a
+ * query on it.
+ *
+ * @param string $database The name of the database that will be selected.
+ * @param string $query The MySQL query.
+ *
+ * Data inside the query should be properly escaped.
+ * @param resource $link_identifier The MySQL connection. If the
+ * link identifier is not specified, the last link opened by
+ * mysql_connect is assumed. If no such link is found, it
+ * will try to create one as if mysql_connect had been called
+ * with no arguments. If no connection is found or established, an
+ * E_WARNING level error is generated.
+ * @return resource|bool Returns a positive MySQL result resource to the query result. The function also returns TRUE/FALSE for
+ * INSERT/UPDATE/DELETE
+ * queries to indicate success/failure.
+ * @throws MysqlException
+ *
+ */
+function mysql_db_query(string $database, string $query, $link_identifier = null)
+{
+ error_clear_last();
+ $result = \mysql_db_query($database, $query, $link_identifier);
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * mysql_drop_db attempts to drop (remove) an
+ * entire database from the server associated with the specified
+ * link identifier. This function is deprecated, it is preferable to use
+ * mysql_query to issue an sql
+ * DROP DATABASE statement instead.
+ *
+ * @param string $database_name The name of the database that will be deleted.
+ * @param resource $link_identifier The MySQL connection. If the
+ * link identifier is not specified, the last link opened by
+ * mysql_connect is assumed. If no such link is found, it
+ * will try to create one as if mysql_connect had been called
+ * with no arguments. If no connection is found or established, an
+ * E_WARNING level error is generated.
+ * @throws MysqlException
+ *
+ */
+function mysql_drop_db(string $database_name, $link_identifier = null): void
+{
+ error_clear_last();
+ $result = \mysql_drop_db($database_name, $link_identifier);
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Returns an array that corresponds to the lengths of each field
+ * in the last row fetched by MySQL.
+ *
+ * mysql_fetch_lengths stores the lengths of
+ * each result column in the last row returned by
+ * mysql_fetch_row,
+ * mysql_fetch_assoc,
+ * mysql_fetch_array, and
+ * mysql_fetch_object in an array, starting at
+ * offset 0.
+ *
+ * @param resource $result The result resource that
+ * is being evaluated. This result comes from a call to
+ * mysql_query.
+ * @return array An array of lengths on success.
+ * @throws MysqlException
+ *
+ */
+function mysql_fetch_lengths($result): array
+{
+ error_clear_last();
+ $result = \mysql_fetch_lengths($result);
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * mysql_field_flags returns the field flags of
+ * the specified field. The flags are reported as a single word
+ * per flag separated by a single space, so that you can split the
+ * returned value using explode.
+ *
+ * @param resource $result The result resource that
+ * is being evaluated. This result comes from a call to
+ * mysql_query.
+ * @param int $field_offset The numerical field offset. The
+ * field_offset starts at 0. If
+ * field_offset does not exist, an error of level
+ * E_WARNING is also issued.
+ * @return string Returns a string of flags associated with the result.
+ *
+ * The following flags are reported, if your version of MySQL
+ * is current enough to support them: "not_null",
+ * "primary_key", "unique_key",
+ * "multiple_key", "blob",
+ * "unsigned", "zerofill",
+ * "binary", "enum",
+ * "auto_increment" and "timestamp".
+ * @throws MysqlException
+ *
+ */
+function mysql_field_flags($result, int $field_offset): string
+{
+ error_clear_last();
+ $result = \mysql_field_flags($result, $field_offset);
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * mysql_field_len returns the length of the
+ * specified field.
+ *
+ * @param resource $result The result resource that
+ * is being evaluated. This result comes from a call to
+ * mysql_query.
+ * @param int $field_offset The numerical field offset. The
+ * field_offset starts at 0. If
+ * field_offset does not exist, an error of level
+ * E_WARNING is also issued.
+ * @return int The length of the specified field index on success.
+ * @throws MysqlException
+ *
+ */
+function mysql_field_len($result, int $field_offset): int
+{
+ error_clear_last();
+ $result = \mysql_field_len($result, $field_offset);
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * mysql_field_name returns the name of the
+ * specified field index.
+ *
+ * @param resource $result The result resource that
+ * is being evaluated. This result comes from a call to
+ * mysql_query.
+ * @param int $field_offset The numerical field offset. The
+ * field_offset starts at 0. If
+ * field_offset does not exist, an error of level
+ * E_WARNING is also issued.
+ * @return string The name of the specified field index on success.
+ * @throws MysqlException
+ *
+ */
+function mysql_field_name($result, int $field_offset): string
+{
+ error_clear_last();
+ $result = \mysql_field_name($result, $field_offset);
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Seeks to the specified field offset. If the next call to
+ * mysql_fetch_field doesn't include a field
+ * offset, the field offset specified in
+ * mysql_field_seek will be returned.
+ *
+ * @param resource $result The result resource that
+ * is being evaluated. This result comes from a call to
+ * mysql_query.
+ * @param int $field_offset The numerical field offset. The
+ * field_offset starts at 0. If
+ * field_offset does not exist, an error of level
+ * E_WARNING is also issued.
+ * @throws MysqlException
+ *
+ */
+function mysql_field_seek($result, int $field_offset): void
+{
+ error_clear_last();
+ $result = \mysql_field_seek($result, $field_offset);
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * mysql_free_result will free all memory
+ * associated with the result identifier result.
+ *
+ * mysql_free_result only needs to be called if
+ * you are concerned about how much memory is being used for queries
+ * that return large result sets. All associated result memory is
+ * automatically freed at the end of the script's execution.
+ *
+ * @param resource $result The result resource that
+ * is being evaluated. This result comes from a call to
+ * mysql_query.
+ * @throws MysqlException
+ *
+ */
+function mysql_free_result($result): void
+{
+ error_clear_last();
+ $result = \mysql_free_result($result);
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Describes the type of connection in use for the connection, including the
+ * server host name.
+ *
+ * @param resource $link_identifier The MySQL connection. If the
+ * link identifier is not specified, the last link opened by
+ * mysql_connect is assumed. If no such link is found, it
+ * will try to create one as if mysql_connect had been called
+ * with no arguments. If no connection is found or established, an
+ * E_WARNING level error is generated.
+ * @return string Returns a string describing the type of MySQL connection in use for the
+ * connection.
+ * @throws MysqlException
+ *
+ */
+function mysql_get_host_info($link_identifier = null): string
+{
+ error_clear_last();
+ $result = \mysql_get_host_info($link_identifier);
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Retrieves the MySQL protocol.
+ *
+ * @param resource $link_identifier The MySQL connection. If the
+ * link identifier is not specified, the last link opened by
+ * mysql_connect is assumed. If no such link is found, it
+ * will try to create one as if mysql_connect had been called
+ * with no arguments. If no connection is found or established, an
+ * E_WARNING level error is generated.
+ * @return int Returns the MySQL protocol on success.
+ * @throws MysqlException
+ *
+ */
+function mysql_get_proto_info($link_identifier = null): int
+{
+ error_clear_last();
+ $result = \mysql_get_proto_info($link_identifier);
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Retrieves the MySQL server version.
+ *
+ * @param resource $link_identifier The MySQL connection. If the
+ * link identifier is not specified, the last link opened by
+ * mysql_connect is assumed. If no such link is found, it
+ * will try to create one as if mysql_connect had been called
+ * with no arguments. If no connection is found or established, an
+ * E_WARNING level error is generated.
+ * @return string Returns the MySQL server version on success.
+ * @throws MysqlException
+ *
+ */
+function mysql_get_server_info($link_identifier = null): string
+{
+ error_clear_last();
+ $result = \mysql_get_server_info($link_identifier);
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Returns detailed information about the last query.
+ *
+ * @param resource $link_identifier The MySQL connection. If the
+ * link identifier is not specified, the last link opened by
+ * mysql_connect is assumed. If no such link is found, it
+ * will try to create one as if mysql_connect had been called
+ * with no arguments. If no connection is found or established, an
+ * E_WARNING level error is generated.
+ * @return string Returns information about the statement on success. See the example below for which statements provide information,
+ * and what the returned value may look like. Statements that are not listed
+ * will return FALSE.
+ * @throws MysqlException
+ *
+ */
+function mysql_info($link_identifier = null): string
+{
+ error_clear_last();
+ $result = \mysql_info($link_identifier);
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Returns a result pointer containing the databases available from the
+ * current mysql daemon.
+ *
+ * @param resource $link_identifier The MySQL connection. If the
+ * link identifier is not specified, the last link opened by
+ * mysql_connect is assumed. If no such link is found, it
+ * will try to create one as if mysql_connect had been called
+ * with no arguments. If no connection is found or established, an
+ * E_WARNING level error is generated.
+ * @return resource Returns a result pointer resource on success. Use the mysql_tablename function to traverse
+ * this result pointer, or any function for result tables, such as
+ * mysql_fetch_array.
+ * @throws MysqlException
+ *
+ */
+function mysql_list_dbs($link_identifier = null)
+{
+ error_clear_last();
+ $result = \mysql_list_dbs($link_identifier);
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Retrieves information about the given table name.
+ *
+ * This function is deprecated. It is preferable to use
+ * mysql_query to issue an SQL SHOW COLUMNS FROM
+ * table [LIKE 'name'] statement instead.
+ *
+ * @param string $database_name The name of the database that's being queried.
+ * @param string $table_name The name of the table that's being queried.
+ * @param resource $link_identifier The MySQL connection. If the
+ * link identifier is not specified, the last link opened by
+ * mysql_connect is assumed. If no such link is found, it
+ * will try to create one as if mysql_connect had been called
+ * with no arguments. If no connection is found or established, an
+ * E_WARNING level error is generated.
+ * @return resource A result pointer resource on success.
+ *
+ * The returned result can be used with mysql_field_flags,
+ * mysql_field_len,
+ * mysql_field_name and
+ * mysql_field_type.
+ * @throws MysqlException
+ *
+ */
+function mysql_list_fields(string $database_name, string $table_name, $link_identifier = null)
+{
+ error_clear_last();
+ $result = \mysql_list_fields($database_name, $table_name, $link_identifier);
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Retrieves the current MySQL server threads.
+ *
+ * @param resource $link_identifier The MySQL connection. If the
+ * link identifier is not specified, the last link opened by
+ * mysql_connect is assumed. If no such link is found, it
+ * will try to create one as if mysql_connect had been called
+ * with no arguments. If no connection is found or established, an
+ * E_WARNING level error is generated.
+ * @return resource A result pointer resource on success.
+ * @throws MysqlException
+ *
+ */
+function mysql_list_processes($link_identifier = null)
+{
+ error_clear_last();
+ $result = \mysql_list_processes($link_identifier);
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Retrieves a list of table names from a MySQL database.
+ *
+ * This function is deprecated. It is preferable to use
+ * mysql_query to issue an SQL SHOW TABLES
+ * [FROM db_name] [LIKE 'pattern'] statement instead.
+ *
+ * @param string $database The name of the database
+ * @param resource $link_identifier The MySQL connection. If the
+ * link identifier is not specified, the last link opened by
+ * mysql_connect is assumed. If no such link is found, it
+ * will try to create one as if mysql_connect had been called
+ * with no arguments. If no connection is found or established, an
+ * E_WARNING level error is generated.
+ * @return resource A result pointer resource on success.
+ *
+ * Use the mysql_tablename function to
+ * traverse this result pointer, or any function for result tables,
+ * such as mysql_fetch_array.
+ * @throws MysqlException
+ *
+ */
+function mysql_list_tables(string $database, $link_identifier = null)
+{
+ error_clear_last();
+ $result = \mysql_list_tables($database, $link_identifier);
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Retrieves the number of fields from a query.
+ *
+ * @param resource $result The result resource that
+ * is being evaluated. This result comes from a call to
+ * mysql_query.
+ * @return int Returns the number of fields in the result set resource on
+ * success.
+ * @throws MysqlException
+ *
+ */
+function mysql_num_fields($result): int
+{
+ error_clear_last();
+ $result = \mysql_num_fields($result);
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Retrieves the number of rows from a result set. This command is only valid
+ * for statements like SELECT or SHOW that return an actual result set.
+ * To retrieve the number of rows affected by a INSERT, UPDATE, REPLACE or
+ * DELETE query, use mysql_affected_rows.
+ *
+ * @param resource $result The result resource that
+ * is being evaluated. This result comes from a call to
+ * mysql_query.
+ * @return int The number of rows in a result set on success.
+ * @throws MysqlException
+ *
+ */
+function mysql_num_rows($result): int
+{
+ error_clear_last();
+ $result = \mysql_num_rows($result);
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * mysql_query sends a unique query (multiple queries
+ * are not supported) to the currently
+ * active database on the server that's associated with the
+ * specified link_identifier.
+ *
+ * @param string $query An SQL query
+ *
+ * The query string should not end with a semicolon.
+ * Data inside the query should be properly escaped.
+ * @param resource $link_identifier The MySQL connection. If the
+ * link identifier is not specified, the last link opened by
+ * mysql_connect is assumed. If no such link is found, it
+ * will try to create one as if mysql_connect had been called
+ * with no arguments. If no connection is found or established, an
+ * E_WARNING level error is generated.
+ * @return resource|bool For SELECT, SHOW, DESCRIBE, EXPLAIN and other statements returning resultset,
+ * mysql_query
+ * returns a resource on success.
+ *
+ * For other type of SQL statements, INSERT, UPDATE, DELETE, DROP, etc,
+ * mysql_query returns TRUE on success.
+ *
+ * The returned result resource should be passed to
+ * mysql_fetch_array, and other
+ * functions for dealing with result tables, to access the returned data.
+ *
+ * Use mysql_num_rows to find out how many rows
+ * were returned for a SELECT statement or
+ * mysql_affected_rows to find out how many
+ * rows were affected by a DELETE, INSERT, REPLACE, or UPDATE
+ * statement.
+ *
+ * mysql_query will also fail and return FALSE
+ * if the user does not have permission to access the table(s) referenced by
+ * the query.
+ * @throws MysqlException
+ *
+ */
+function mysql_query(string $query, $link_identifier = null)
+{
+ error_clear_last();
+ $result = \mysql_query($query, $link_identifier);
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Escapes special characters in the unescaped_string,
+ * taking into account the current character set of the connection so that it
+ * is safe to place it in a mysql_query. If binary data
+ * is to be inserted, this function must be used.
+ *
+ * mysql_real_escape_string calls MySQL's library function
+ * mysql_real_escape_string, which prepends backslashes to the following characters:
+ * \x00, \n,
+ * \r, \, ',
+ * " and \x1a.
+ *
+ * This function must always (with few exceptions) be used to make data
+ * safe before sending a query to MySQL.
+ *
+ * @param string $unescaped_string The string that is to be escaped.
+ * @param resource $link_identifier The MySQL connection. If the
+ * link identifier is not specified, the last link opened by
+ * mysql_connect is assumed. If no such link is found, it
+ * will try to create one as if mysql_connect had been called
+ * with no arguments. If no connection is found or established, an
+ * E_WARNING level error is generated.
+ * @return string Returns the escaped string.
+ * @throws MysqlException
+ *
+ */
+function mysql_real_escape_string(string $unescaped_string, $link_identifier = null): string
+{
+ error_clear_last();
+ $result = \mysql_real_escape_string($unescaped_string, $link_identifier);
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Retrieves the contents of one cell from a MySQL result set.
+ *
+ * When working on large result sets, you should consider using one
+ * of the functions that fetch an entire row (specified below). As
+ * these functions return the contents of multiple cells in one
+ * function call, they're MUCH quicker than
+ * mysql_result. Also, note that specifying a
+ * numeric offset for the field argument is much quicker than
+ * specifying a fieldname or tablename.fieldname argument.
+ *
+ * @param resource $result The result resource that
+ * is being evaluated. This result comes from a call to
+ * mysql_query.
+ * @param int $row The row number from the result that's being retrieved. Row numbers
+ * start at 0.
+ * @param mixed $field The name or offset of the field being retrieved.
+ *
+ * It can be the field's offset, the field's name, or the field's table
+ * dot field name (tablename.fieldname). If the column name has been
+ * aliased ('select foo as bar from...'), use the alias instead of the
+ * column name. If undefined, the first field is retrieved.
+ * @return string The contents of one cell from a MySQL result set on success.
+ * @throws MysqlException
+ *
+ */
+function mysql_result($result, int $row, $field = 0): string
+{
+ error_clear_last();
+ $result = \mysql_result($result, $row, $field);
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Sets the current active database on the server that's associated with the
+ * specified link identifier. Every subsequent call to
+ * mysql_query will be made on the active database.
+ *
+ * @param string $database_name The name of the database that is to be selected.
+ * @param resource $link_identifier The MySQL connection. If the
+ * link identifier is not specified, the last link opened by
+ * mysql_connect is assumed. If no such link is found, it
+ * will try to create one as if mysql_connect had been called
+ * with no arguments. If no connection is found or established, an
+ * E_WARNING level error is generated.
+ * @throws MysqlException
+ *
+ */
+function mysql_select_db(string $database_name, $link_identifier = null): void
+{
+ error_clear_last();
+ $result = \mysql_select_db($database_name, $link_identifier);
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the default character set for the current connection.
+ *
+ * @param string $charset A valid character set name.
+ * @param resource $link_identifier The MySQL connection. If the
+ * link identifier is not specified, the last link opened by
+ * mysql_connect is assumed. If no such link is found, it
+ * will try to create one as if mysql_connect had been called
+ * with no arguments. If no connection is found or established, an
+ * E_WARNING level error is generated.
+ * @throws MysqlException
+ *
+ */
+function mysql_set_charset(string $charset, $link_identifier = null): void
+{
+ error_clear_last();
+ $result = \mysql_set_charset($charset, $link_identifier);
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Retrieves the table name from a result.
+ *
+ * This function is deprecated. It is preferable to use
+ * mysql_query to issue an SQL SHOW TABLES
+ * [FROM db_name] [LIKE 'pattern'] statement instead.
+ *
+ * @param resource $result A result pointer resource that's returned from
+ * mysql_list_tables.
+ * @param int $i The integer index (row/table number)
+ * @return string The name of the table on success.
+ *
+ * Use the mysql_tablename function to
+ * traverse this result pointer, or any function for result tables,
+ * such as mysql_fetch_array.
+ * @throws MysqlException
+ *
+ */
+function mysql_tablename($result, int $i): string
+{
+ error_clear_last();
+ $result = \mysql_tablename($result, $i);
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Retrieves the current thread ID. If the connection is lost, and a reconnect
+ * with mysql_ping is executed, the thread ID will
+ * change. This means only retrieve the thread ID when needed.
+ *
+ * @param resource $link_identifier The MySQL connection. If the
+ * link identifier is not specified, the last link opened by
+ * mysql_connect is assumed. If no such link is found, it
+ * will try to create one as if mysql_connect had been called
+ * with no arguments. If no connection is found or established, an
+ * E_WARNING level error is generated.
+ * @return int The thread ID on success.
+ * @throws MysqlException
+ *
+ */
+function mysql_thread_id($link_identifier = null): int
+{
+ error_clear_last();
+ $result = \mysql_thread_id($link_identifier);
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * mysql_unbuffered_query sends the SQL query
+ * query to MySQL without automatically
+ * fetching and buffering the result rows as
+ * mysql_query does. This saves a considerable
+ * amount of memory with SQL queries that produce large result sets,
+ * and you can start working on the result set immediately after the
+ * first row has been retrieved as you don't have to wait until the
+ * complete SQL query has been performed. To use
+ * mysql_unbuffered_query while multiple database
+ * connections are open, you must specify the optional parameter
+ * link_identifier to identify which connection
+ * you want to use.
+ *
+ * @param string $query The SQL query to execute.
+ *
+ * Data inside the query should be properly escaped.
+ * @param resource $link_identifier The MySQL connection. If the
+ * link identifier is not specified, the last link opened by
+ * mysql_connect is assumed. If no such link is found, it
+ * will try to create one as if mysql_connect had been called
+ * with no arguments. If no connection is found or established, an
+ * E_WARNING level error is generated.
+ * @return resource|bool For SELECT, SHOW, DESCRIBE or EXPLAIN statements,
+ * mysql_unbuffered_query
+ * returns a resource on success.
+ *
+ * For other type of SQL statements, UPDATE, DELETE, DROP, etc,
+ * mysql_unbuffered_query returns TRUE on success.
+ * @throws MysqlException
+ *
+ */
+function mysql_unbuffered_query(string $query, $link_identifier = null)
+{
+ error_clear_last();
+ $result = \mysql_unbuffered_query($query, $link_identifier);
+ if ($result === false) {
+ throw MysqlException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/mysqli.php b/vendor/thecodingmachine/safe/generated/mysqli.php
new file mode 100644
index 000000000..c8807af4a
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/mysqli.php
@@ -0,0 +1,42 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\MysqliException;
+
+/**
+ * Returns an empty array.
+ * Available only with mysqlnd.
+ *
+ * @return array Returns an empty array on success, FALSE otherwise.
+ * @throws MysqliException
+ *
+ */
+function mysqli_get_cache_stats(): array
+{
+ error_clear_last();
+ $result = \mysqli_get_cache_stats();
+ if ($result === false) {
+ throw MysqliException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Returns client per-process statistics.
+ * Available only with mysqlnd.
+ *
+ * @return array Returns an array with client stats if success, FALSE otherwise.
+ * @throws MysqliException
+ *
+ */
+function mysqli_get_client_stats(): array
+{
+ error_clear_last();
+ $result = \mysqli_get_client_stats();
+ if ($result === false) {
+ throw MysqliException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/mysqlndMs.php b/vendor/thecodingmachine/safe/generated/mysqlndMs.php
new file mode 100644
index 000000000..2fd4f32a2
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/mysqlndMs.php
@@ -0,0 +1,119 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\MysqlndMsException;
+
+/**
+ * Returns a list of currently configured servers.
+ *
+ * @param mixed $connection A MySQL connection handle obtained from any of the
+ * connect functions of the mysqli,
+ * mysql or
+ * PDO_MYSQL extensions.
+ * @return array FALSE on error. Otherwise, returns an array with two entries
+ * masters and slaves each of which contains
+ * an array listing all corresponding servers.
+ *
+ * The function can be used to check and debug the list of servers currently
+ * used by the plugin. It is mostly useful when the list of servers changes at
+ * runtime, for example, when using MySQL Fabric.
+ *
+ * masters and slaves server entries
+ * @throws MysqlndMsException
+ *
+ */
+function mysqlnd_ms_dump_servers($connection): array
+{
+ error_clear_last();
+ $result = \mysqlnd_ms_dump_servers($connection);
+ if ($result === false) {
+ throw MysqlndMsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * MySQL Fabric related.
+ *
+ * Switch the connection to the nodes handling global sharding queries
+ * for the given table name.
+ *
+ * @param mixed $connection A MySQL connection handle obtained from any of the
+ * connect functions of the mysqli,
+ * mysql or
+ * PDO_MYSQL extensions.
+ * @param mixed $table_name The table name to ask Fabric about.
+ * @return array FALSE on error. Otherwise, TRUE
+ * @throws MysqlndMsException
+ *
+ */
+function mysqlnd_ms_fabric_select_global($connection, $table_name): array
+{
+ error_clear_last();
+ $result = \mysqlnd_ms_fabric_select_global($connection, $table_name);
+ if ($result === false) {
+ throw MysqlndMsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * MySQL Fabric related.
+ *
+ * Switch the connection to the shards responsible for the
+ * given table name and shard key.
+ *
+ * @param mixed $connection A MySQL connection handle obtained from any of the
+ * connect functions of the mysqli,
+ * mysql or
+ * PDO_MYSQL extensions.
+ * @param mixed $table_name The table name to ask Fabric about.
+ * @param mixed $shard_key The shard key to ask Fabric about.
+ * @return array FALSE on error. Otherwise, TRUE
+ * @throws MysqlndMsException
+ *
+ */
+function mysqlnd_ms_fabric_select_shard($connection, $table_name, $shard_key): array
+{
+ error_clear_last();
+ $result = \mysqlnd_ms_fabric_select_shard($connection, $table_name, $shard_key);
+ if ($result === false) {
+ throw MysqlndMsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Returns an array which describes the last used connection from the plugins
+ * connection pool currently pointed to by the user connection handle. If using the
+ * plugin, a user connection handle represents a pool of database connections.
+ * It is not possible to tell from the user connection handles properties to which
+ * database server from the pool the user connection handle points.
+ *
+ * The function can be used to debug or monitor PECL mysqlnd_ms.
+ *
+ * @param mixed $connection A MySQL connection handle obtained from any of the
+ * connect functions of the mysqli,
+ * mysql or
+ * PDO_MYSQL extensions.
+ * @return array FALSE on error. Otherwise, an
+ * array which describes the connection used to
+ * execute the last statement on.
+ *
+ * Array which describes the connection.
+ * @throws MysqlndMsException
+ *
+ */
+function mysqlnd_ms_get_last_used_connection($connection): array
+{
+ error_clear_last();
+ $result = \mysqlnd_ms_get_last_used_connection($connection);
+ if ($result === false) {
+ throw MysqlndMsException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/mysqlndQc.php b/vendor/thecodingmachine/safe/generated/mysqlndQc.php
new file mode 100644
index 000000000..9a99a379c
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/mysqlndQc.php
@@ -0,0 +1,103 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\MysqlndQcException;
+
+/**
+ * Flush all cache contents.
+ *
+ * Flushing the cache is a storage handler responsibility.
+ * All built-in storage handler but the
+ * memcache storage
+ * handler support flushing the cache. The
+ * memcache
+ * storage handler cannot flush its cache contents.
+ *
+ * User-defined storage handler may or may not support the operation.
+ *
+ * @throws MysqlndQcException
+ *
+ */
+function mysqlnd_qc_clear_cache(): void
+{
+ error_clear_last();
+ $result = \mysqlnd_qc_clear_cache();
+ if ($result === false) {
+ throw MysqlndQcException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Installs a callback which decides whether a statement is cached.
+ *
+ * There are several ways of hinting PELC/mysqlnd_qc to cache a query.
+ * By default, PECL/mysqlnd_qc attempts to cache a if caching of all statements
+ * is enabled or the query string begins with a certain SQL hint.
+ * The plugin internally calls a function named is_select()
+ * to find out. This internal function can be replaced with a user-defined callback.
+ * Then, the user-defined callback is responsible to decide whether the plugin
+ * attempts to cache a statement. Because the internal function is replaced
+ * with the callback, the callback gains full control. The callback is free
+ * to ignore the configuration setting mysqlnd_qc.cache_by_default
+ * and SQL hints.
+ *
+ * The callback is invoked for every statement inspected by the plugin.
+ * It is given the statements string as a parameter. The callback returns
+ * FALSE if the statement shall not be cached. It returns TRUE to
+ * make the plugin attempt to cache the statements result set, if any.
+ * A so-created cache entry is given the default TTL set with the
+ * PHP configuration directive mysqlnd_qc.ttl.
+ * If a different TTL shall be used, the callback returns a numeric
+ * value to be used as the TTL.
+ *
+ * The internal is_select function is part of the internal
+ * cache storage handler interface. Thus, a user-defined storage handler
+ * offers the same capabilities.
+ *
+ * @param string $callback
+ * @return mixed Returns TRUE on success.
+ * @throws MysqlndQcException
+ *
+ */
+function mysqlnd_qc_set_is_select(string $callback)
+{
+ error_clear_last();
+ $result = \mysqlnd_qc_set_is_select($callback);
+ if ($result === false) {
+ throw MysqlndQcException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Sets the storage handler used by the query cache. A list of available
+ * storage handler can be obtained from
+ * mysqlnd_qc_get_available_handlers.
+ * Which storage are available depends on the compile time
+ * configuration of the query cache plugin. The
+ * default storage handler is always available.
+ * All other storage handler must be enabled explicitly when building the
+ * extension.
+ *
+ * @param string $handler Handler can be of type string representing the name of a
+ * built-in storage handler or an object of type
+ * mysqlnd_qc_handler_default.
+ * The names of the built-in storage handler are
+ * default,
+ * APC,
+ * MEMCACHE,
+ * sqlite.
+ * @throws MysqlndQcException
+ *
+ */
+function mysqlnd_qc_set_storage_handler(string $handler): void
+{
+ error_clear_last();
+ $result = \mysqlnd_qc_set_storage_handler($handler);
+ if ($result === false) {
+ throw MysqlndQcException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/network.php b/vendor/thecodingmachine/safe/generated/network.php
new file mode 100644
index 000000000..6d46b6ce3
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/network.php
@@ -0,0 +1,639 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\NetworkException;
+
+/**
+ * closelog closes the descriptor being used to write to
+ * the system logger. The use of closelog is optional.
+ *
+ * @throws NetworkException
+ *
+ */
+function closelog(): void
+{
+ error_clear_last();
+ $result = \closelog();
+ if ($result === false) {
+ throw NetworkException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Fetch DNS Resource Records associated with the given
+ * hostname.
+ *
+ * @param string $hostname hostname should be a valid DNS hostname such
+ * as "www.example.com". Reverse lookups can be generated
+ * using in-addr.arpa notation, but
+ * gethostbyaddr is more suitable for
+ * the majority of reverse lookups.
+ *
+ * Per DNS standards, email addresses are given in user.host format (for
+ * example: hostmaster.example.com as opposed to [email protected]),
+ * be sure to check this value and modify if necessary before using it
+ * with a functions such as mail.
+ * @param int $type By default, dns_get_record will search for any
+ * resource records associated with hostname.
+ * To limit the query, specify the optional type
+ * parameter. May be any one of the following:
+ * DNS_A, DNS_CNAME,
+ * DNS_HINFO, DNS_CAA,
+ * DNS_MX, DNS_NS,
+ * DNS_PTR, DNS_SOA,
+ * DNS_TXT, DNS_AAAA,
+ * DNS_SRV, DNS_NAPTR,
+ * DNS_A6, DNS_ALL
+ * or DNS_ANY.
+ *
+ * Because of eccentricities in the performance of libresolv
+ * between platforms, DNS_ANY will not
+ * always return every record, the slower DNS_ALL
+ * will collect all records more reliably.
+ *
+ * DNS_CAA is not supported on Windows.
+ * @param array|null $authns Passed by reference and, if given, will be populated with Resource
+ * Records for the Authoritative Name Servers.
+ * @param array|null $addtl Passed by reference and, if given, will be populated with any
+ * Additional Records.
+ * @param bool $raw The type will be interpreted as a raw DNS type ID
+ * (the DNS_* constants cannot be used).
+ * The return value will contain a data key, which needs
+ * to be manually parsed.
+ * @return array This function returns an array of associative arrays. Each associative array contains
+ * at minimum the following keys:
+ *
+ * Basic DNS attributes
+ *
+ *
+ *
+ * Attribute
+ * Meaning
+ *
+ *
+ *
+ *
+ * host
+ *
+ * The record in the DNS namespace to which the rest of the associated data refers.
+ *
+ *
+ *
+ * class
+ *
+ * dns_get_record only returns Internet class records and as
+ * such this parameter will always return IN.
+ *
+ *
+ *
+ * type
+ *
+ * String containing the record type. Additional attributes will also be contained
+ * in the resulting array dependant on the value of type. See table below.
+ *
+ *
+ *
+ * ttl
+ *
+ * "Time To Live" remaining for this record. This will not equal
+ * the record's original ttl, but will rather equal the original ttl minus whatever
+ * length of time has passed since the authoritative name server was queried.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * Other keys in associative arrays dependant on 'type'
+ *
+ *
+ *
+ * Type
+ * Extra Columns
+ *
+ *
+ *
+ *
+ * A
+ *
+ * ip: An IPv4 addresses in dotted decimal notation.
+ *
+ *
+ *
+ * MX
+ *
+ * pri: Priority of mail exchanger.
+ * Lower numbers indicate greater priority.
+ * target: FQDN of the mail exchanger.
+ * See also dns_get_mx.
+ *
+ *
+ *
+ * CNAME
+ *
+ * target: FQDN of location in DNS namespace to which
+ * the record is aliased.
+ *
+ *
+ *
+ * NS
+ *
+ * target: FQDN of the name server which is authoritative
+ * for this hostname.
+ *
+ *
+ *
+ * PTR
+ *
+ * target: Location within the DNS namespace to which
+ * this record points.
+ *
+ *
+ *
+ * TXT
+ *
+ * txt: Arbitrary string data associated with this record.
+ *
+ *
+ *
+ * HINFO
+ *
+ * cpu: IANA number designating the CPU of the machine
+ * referenced by this record.
+ * os: IANA number designating the Operating System on
+ * the machine referenced by this record.
+ * See IANA's Operating System
+ * Names for the meaning of these values.
+ *
+ *
+ *
+ * CAA
+ *
+ * flags: A one-byte bitfield; currently only bit 0 is defined,
+ * meaning 'critical'; other bits are reserved and should be ignored.
+ * tag: The CAA tag name (alphanumeric ASCII string).
+ * value: The CAA tag value (binary string, may use subformats).
+ * For additional information see: RFC 6844
+ *
+ *
+ *
+ * SOA
+ *
+ * mname: FQDN of the machine from which the resource
+ * records originated.
+ * rname: Email address of the administrative contact
+ * for this domain.
+ * serial: Serial # of this revision of the requested
+ * domain.
+ * refresh: Refresh interval (seconds) secondary name
+ * servers should use when updating remote copies of this domain.
+ * retry: Length of time (seconds) to wait after a
+ * failed refresh before making a second attempt.
+ * expire: Maximum length of time (seconds) a secondary
+ * DNS server should retain remote copies of the zone data without a
+ * successful refresh before discarding.
+ * minimum-ttl: Minimum length of time (seconds) a
+ * client can continue to use a DNS resolution before it should request
+ * a new resolution from the server. Can be overridden by individual
+ * resource records.
+ *
+ *
+ *
+ * AAAA
+ *
+ * ipv6: IPv6 address
+ *
+ *
+ *
+ * A6(PHP &gt;= 5.1.0)
+ *
+ * masklen: Length (in bits) to inherit from the target
+ * specified by chain.
+ * ipv6: Address for this specific record to merge with
+ * chain.
+ * chain: Parent record to merge with
+ * ipv6 data.
+ *
+ *
+ *
+ * SRV
+ *
+ * pri: (Priority) lowest priorities should be used first.
+ * weight: Ranking to weight which of commonly prioritized
+ * targets should be chosen at random.
+ * target and port: hostname and port
+ * where the requested service can be found.
+ * For additional information see: RFC 2782
+ *
+ *
+ *
+ * NAPTR
+ *
+ * order and pref: Equivalent to
+ * pri and weight above.
+ * flags, services, regex,
+ * and replacement: Parameters as defined by
+ * RFC 2915.
+ *
+ *
+ *
+ *
+ *
+ * @throws NetworkException
+ *
+ */
+function dns_get_record(string $hostname, int $type = DNS_ANY, ?array &$authns = null, ?array &$addtl = null, bool $raw = false): array
+{
+ error_clear_last();
+ $result = \dns_get_record($hostname, $type, $authns, $addtl, $raw);
+ if ($result === false) {
+ throw NetworkException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Initiates a socket connection to the resource specified by
+ * hostname.
+ *
+ * PHP supports targets in the Internet and Unix domains as described in
+ * . A list of supported transports can also be
+ * retrieved using stream_get_transports.
+ *
+ * The socket will by default be opened in blocking mode. You can
+ * switch it to non-blocking mode by using
+ * stream_set_blocking.
+ *
+ * The function stream_socket_client is similar but
+ * provides a richer set of options, including non-blocking connection and the
+ * ability to provide a stream context.
+ *
+ * @param string $hostname If OpenSSL support is
+ * installed, you may prefix the hostname
+ * with either ssl:// or tls:// to
+ * use an SSL or TLS client connection over TCP/IP to connect to the
+ * remote host.
+ * @param int $port The port number. This can be omitted and skipped with
+ * -1 for transports that do not use ports, such as
+ * unix://.
+ * @param int|null $errno If provided, holds the system level error number that occurred in the
+ * system-level connect() call.
+ *
+ * If the value returned in errno is
+ * 0 and the function returned FALSE, it is an
+ * indication that the error occurred before the
+ * connect() call. This is most likely due to a
+ * problem initializing the socket.
+ * @param string|null $errstr The error message as a string.
+ * @param float $timeout The connection timeout, in seconds.
+ *
+ * If you need to set a timeout for reading/writing data over the
+ * socket, use stream_set_timeout, as the
+ * timeout parameter to
+ * fsockopen only applies while connecting the
+ * socket.
+ * @return resource fsockopen returns a file pointer which may be used
+ * together with the other file functions (such as
+ * fgets, fgetss,
+ * fwrite, fclose, and
+ * feof). If the call fails, it will return FALSE
+ * @throws NetworkException
+ *
+ */
+function fsockopen(string $hostname, int $port = -1, ?int &$errno = null, ?string &$errstr = null, float $timeout = null)
+{
+ error_clear_last();
+ if ($timeout !== null) {
+ $result = \fsockopen($hostname, $port, $errno, $errstr, $timeout);
+ } else {
+ $result = \fsockopen($hostname, $port, $errno, $errstr);
+ }
+ if ($result === false) {
+ throw NetworkException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * gethostname gets the standard host name for
+ * the local machine.
+ *
+ * @return string Returns a string with the hostname on success, otherwise FALSE is
+ * returned.
+ * @throws NetworkException
+ *
+ */
+function gethostname(): string
+{
+ error_clear_last();
+ $result = \gethostname();
+ if ($result === false) {
+ throw NetworkException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * getprotobyname returns the protocol number
+ * associated with the protocol name as per
+ * /etc/protocols.
+ *
+ * @param string $name The protocol name.
+ * @return int Returns the protocol number.
+ * @throws NetworkException
+ *
+ */
+function getprotobyname(string $name): int
+{
+ error_clear_last();
+ $result = \getprotobyname($name);
+ if ($result === false) {
+ throw NetworkException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * getprotobynumber returns the protocol name
+ * associated with protocol number as per
+ * /etc/protocols.
+ *
+ * @param int $number The protocol number.
+ * @return string Returns the protocol name as a string.
+ * @throws NetworkException
+ *
+ */
+function getprotobynumber(int $number): string
+{
+ error_clear_last();
+ $result = \getprotobynumber($number);
+ if ($result === false) {
+ throw NetworkException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Registers a function that will be called when PHP starts sending output.
+ *
+ * The callback is executed just after PHP prepares all
+ * headers to be sent, and before any other output is sent, creating a window
+ * to manipulate the outgoing headers before being sent.
+ *
+ * @param callable $callback Function called just before the headers are sent. It gets no parameters
+ * and the return value is ignored.
+ * @throws NetworkException
+ *
+ */
+function header_register_callback(callable $callback): void
+{
+ error_clear_last();
+ $result = \header_register_callback($callback);
+ if ($result === false) {
+ throw NetworkException::createFromPhpError();
+ }
+}
+
+
+/**
+ *
+ *
+ * @param string $in_addr A 32bit IPv4, or 128bit IPv6 address.
+ * @return string Returns a string representation of the address.
+ * @throws NetworkException
+ *
+ */
+function inet_ntop(string $in_addr): string
+{
+ error_clear_last();
+ $result = \inet_ntop($in_addr);
+ if ($result === false) {
+ throw NetworkException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * openlog opens a connection to the system
+ * logger for a program.
+ *
+ * The use of openlog is optional. It
+ * will automatically be called by syslog if
+ * necessary, in which case ident will default
+ * to FALSE.
+ *
+ * @param string $ident The string ident is added to each message.
+ * @param int $option The option argument is used to indicate
+ * what logging options will be used when generating a log message.
+ *
+ * openlog Options
+ *
+ *
+ *
+ * Constant
+ * Description
+ *
+ *
+ *
+ *
+ * LOG_CONS
+ *
+ * if there is an error while sending data to the system logger,
+ * write directly to the system console
+ *
+ *
+ *
+ * LOG_NDELAY
+ *
+ * open the connection to the logger immediately
+ *
+ *
+ *
+ * LOG_ODELAY
+ *
+ * (default) delay opening the connection until the first
+ * message is logged
+ *
+ *
+ *
+ * LOG_PERROR
+ * print log message also to standard error
+ *
+ *
+ * LOG_PID
+ * include PID with each message
+ *
+ *
+ *
+ *
+ * You can use one or more of these options. When using multiple options
+ * you need to OR them, i.e. to open the connection
+ * immediately, write to the console and include the PID in each message,
+ * you will use: LOG_CONS | LOG_NDELAY | LOG_PID
+ * @param int $facility The facility argument is used to specify what
+ * type of program is logging the message. This allows you to specify
+ * (in your machine's syslog configuration) how messages coming from
+ * different facilities will be handled.
+ *
+ * openlog Facilities
+ *
+ *
+ *
+ * Constant
+ * Description
+ *
+ *
+ *
+ *
+ * LOG_AUTH
+ *
+ * security/authorization messages (use
+ * LOG_AUTHPRIV instead
+ * in systems where that constant is defined)
+ *
+ *
+ *
+ * LOG_AUTHPRIV
+ * security/authorization messages (private)
+ *
+ *
+ * LOG_CRON
+ * clock daemon (cron and at)
+ *
+ *
+ * LOG_DAEMON
+ * other system daemons
+ *
+ *
+ * LOG_KERN
+ * kernel messages
+ *
+ *
+ * LOG_LOCAL0 ... LOG_LOCAL7
+ * reserved for local use, these are not available in Windows
+ *
+ *
+ * LOG_LPR
+ * line printer subsystem
+ *
+ *
+ * LOG_MAIL
+ * mail subsystem
+ *
+ *
+ * LOG_NEWS
+ * USENET news subsystem
+ *
+ *
+ * LOG_SYSLOG
+ * messages generated internally by syslogd
+ *
+ *
+ * LOG_USER
+ * generic user-level messages
+ *
+ *
+ * LOG_UUCP
+ * UUCP subsystem
+ *
+ *
+ *
+ *
+ *
+ * LOG_USER is the only valid log type under Windows
+ * operating systems
+ * @throws NetworkException
+ *
+ */
+function openlog(string $ident, int $option, int $facility): void
+{
+ error_clear_last();
+ $result = \openlog($ident, $option, $facility);
+ if ($result === false) {
+ throw NetworkException::createFromPhpError();
+ }
+}
+
+
+/**
+ * syslog generates a log message that will be
+ * distributed by the system logger.
+ *
+ * For information on setting up a user defined log handler, see the
+ * syslog.conf
+ * 5 Unix manual page. More
+ * information on the syslog facilities and option can be found in the man
+ * pages for syslog
+ * 3 on Unix machines.
+ *
+ * @param int $priority priority is a combination of the facility and
+ * the level. Possible values are:
+ *
+ * syslog Priorities (in descending order)
+ *
+ *
+ *
+ * Constant
+ * Description
+ *
+ *
+ *
+ *
+ * LOG_EMERG
+ * system is unusable
+ *
+ *
+ * LOG_ALERT
+ * action must be taken immediately
+ *
+ *
+ * LOG_CRIT
+ * critical conditions
+ *
+ *
+ * LOG_ERR
+ * error conditions
+ *
+ *
+ * LOG_WARNING
+ * warning conditions
+ *
+ *
+ * LOG_NOTICE
+ * normal, but significant, condition
+ *
+ *
+ * LOG_INFO
+ * informational message
+ *
+ *
+ * LOG_DEBUG
+ * debug-level message
+ *
+ *
+ *
+ *
+ * @param string $message The message to send, except that the two characters
+ * %m will be replaced by the error message string
+ * (strerror) corresponding to the present value of
+ * errno.
+ * @throws NetworkException
+ *
+ */
+function syslog(int $priority, string $message): void
+{
+ error_clear_last();
+ $result = \syslog($priority, $message);
+ if ($result === false) {
+ throw NetworkException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/oci8.php b/vendor/thecodingmachine/safe/generated/oci8.php
new file mode 100644
index 000000000..f2bac2781
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/oci8.php
@@ -0,0 +1,1721 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\Oci8Exception;
+
+/**
+ * Binds the PHP array var_array to the Oracle
+ * placeholder name, which points to an Oracle PL/SQL
+ * array. Whether it will be used for input or output will be determined at
+ * run-time.
+ *
+ * @param resource $statement A valid OCI statement identifier.
+ * @param string $name The Oracle placeholder.
+ * @param array $var_array An array.
+ * @param int $max_table_length Sets the maximum length both for incoming and result arrays.
+ * @param int $max_item_length Sets maximum length for array items. If not specified or equals to -1,
+ * oci_bind_array_by_name will find the longest
+ * element in the incoming array and will use it as the maximum length.
+ * @param int $type Should be used to set the type of PL/SQL array items. See list of
+ * available types below:
+ *
+ *
+ *
+ *
+ * SQLT_NUM - for arrays of NUMBER.
+ *
+ *
+ *
+ *
+ * SQLT_INT - for arrays of INTEGER (Note: INTEGER
+ * it is actually a synonym for NUMBER(38), but
+ * SQLT_NUM type won't work in this case even
+ * though they are synonyms).
+ *
+ *
+ *
+ *
+ * SQLT_FLT - for arrays of FLOAT.
+ *
+ *
+ *
+ *
+ * SQLT_AFC - for arrays of CHAR.
+ *
+ *
+ *
+ *
+ * SQLT_CHR - for arrays of VARCHAR2.
+ *
+ *
+ *
+ *
+ * SQLT_VCS - for arrays of VARCHAR.
+ *
+ *
+ *
+ *
+ * SQLT_AVC - for arrays of CHARZ.
+ *
+ *
+ *
+ *
+ * SQLT_STR - for arrays of STRING.
+ *
+ *
+ *
+ *
+ * SQLT_LVC - for arrays of LONG VARCHAR.
+ *
+ *
+ *
+ *
+ * SQLT_ODT - for arrays of DATE.
+ *
+ *
+ *
+ *
+ * SQLT_NUM - for arrays of NUMBER.
+ *
+ * SQLT_INT - for arrays of INTEGER (Note: INTEGER
+ * it is actually a synonym for NUMBER(38), but
+ * SQLT_NUM type won't work in this case even
+ * though they are synonyms).
+ *
+ * SQLT_FLT - for arrays of FLOAT.
+ *
+ * SQLT_AFC - for arrays of CHAR.
+ *
+ * SQLT_CHR - for arrays of VARCHAR2.
+ *
+ * SQLT_VCS - for arrays of VARCHAR.
+ *
+ * SQLT_AVC - for arrays of CHARZ.
+ *
+ * SQLT_STR - for arrays of STRING.
+ *
+ * SQLT_LVC - for arrays of LONG VARCHAR.
+ *
+ * SQLT_ODT - for arrays of DATE.
+ * @throws Oci8Exception
+ *
+ */
+function oci_bind_array_by_name($statement, string $name, array &$var_array, int $max_table_length, int $max_item_length = -1, int $type = SQLT_AFC): void
+{
+ error_clear_last();
+ $result = \oci_bind_array_by_name($statement, $name, $var_array, $max_table_length, $max_item_length, $type);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Binds a PHP variable variable to the Oracle
+ * bind variable placeholder bv_name. Binding
+ * is important for Oracle database performance and also as a way to
+ * avoid SQL Injection security issues.
+ *
+ * Binding allows the database to reuse the statement context and
+ * caches from previous executions of the statement, even if another
+ * user or process originally executed it. Binding reduces SQL
+ * Injection concerns because the data associated with a bind
+ * variable is never treated as part of the SQL statement. It does
+ * not need quoting or escaping.
+ *
+ * PHP variables that have been bound can be changed and the
+ * statement re-executed without needing to re-parse the statement or
+ * re-bind.
+ *
+ * In Oracle, bind variables are commonly divided
+ * into IN binds for values that are passed into
+ * the database, and OUT binds for values that are
+ * returned to PHP. A bind variable may be
+ * both IN and OUT. Whether a
+ * bind variable will be used for input or output is determined at
+ * run-time.
+ *
+ * You must specify maxlength when using
+ * an OUT bind so that PHP allocates enough memory
+ * to hold the returned value.
+ *
+ * For IN binds it is recommended to set
+ * the maxlength length if the statement is
+ * re-executed multiple times with different values for the PHP
+ * variable. Otherwise Oracle may truncate data to the length of the
+ * initial PHP variable value. If you don't know what the maximum
+ * length will be, then re-call oci_bind_by_name
+ * with the current data size prior to
+ * each oci_execute call. Binding an
+ * unnecessarily large length will have an impact on process memory
+ * in the database.
+ *
+ * A bind call tells Oracle which memory address to read data from.
+ * For IN binds that address needs to contain
+ * valid data when oci_execute is called. This
+ * means that the variable bound must remain in scope until
+ * execution. If it doesn't, unexpected results or errors such as
+ * "ORA-01460: unimplemented or unreasonable conversion requested"
+ * may occur. For OUT binds one symptom is no
+ * value being set in the PHP variable.
+ *
+ * For a statement that is repeatedly executed, binding values that
+ * never change may reduce the ability of the Oracle optimizer to
+ * choose the best statement execution plan. Long running statements
+ * that are rarely re-executed may not benefit from binding. However
+ * in both cases, binding might be safer than joining strings into a
+ * SQL statement, as this can be a security risk if unfiltered user
+ * text is concatenated.
+ *
+ * @param resource $statement A valid OCI8 statement identifer.
+ * @param string $bv_name The colon-prefixed bind variable placeholder used in the
+ * statement. The colon is optional
+ * in bv_name. Oracle does not use question
+ * marks for placeholders.
+ * @param mixed $variable The PHP variable to be associated with bv_name
+ * @param int $maxlength Sets the maximum length for the data. If you set it to -1, this
+ * function will use the current length
+ * of variable to set the maximum
+ * length. In this case the variable must
+ * exist and contain data
+ * when oci_bind_by_name is called.
+ * @param int $type The datatype that Oracle will treat the data as. The
+ * default type used
+ * is SQLT_CHR. Oracle will convert the data
+ * between this type and the database column (or PL/SQL variable
+ * type), when possible.
+ *
+ * If you need to bind an abstract datatype (LOB/ROWID/BFILE) you
+ * need to allocate it first using the
+ * oci_new_descriptor function. The
+ * length is not used for abstract datatypes
+ * and should be set to -1.
+ *
+ * Possible values for type are:
+ *
+ *
+ *
+ * SQLT_BFILEE or OCI_B_BFILE
+ * - for BFILEs;
+ *
+ *
+ *
+ *
+ * SQLT_CFILEE or OCI_B_CFILEE
+ * - for CFILEs;
+ *
+ *
+ *
+ *
+ * SQLT_CLOB or OCI_B_CLOB
+ * - for CLOBs;
+ *
+ *
+ *
+ *
+ * SQLT_BLOB or OCI_B_BLOB
+ * - for BLOBs;
+ *
+ *
+ *
+ *
+ * SQLT_RDD or OCI_B_ROWID
+ * - for ROWIDs;
+ *
+ *
+ *
+ *
+ * SQLT_NTY or OCI_B_NTY
+ * - for named datatypes;
+ *
+ *
+ *
+ *
+ * SQLT_INT or OCI_B_INT - for integers;
+ *
+ *
+ *
+ *
+ * SQLT_CHR - for VARCHARs;
+ *
+ *
+ *
+ *
+ * SQLT_BIN or OCI_B_BIN
+ * - for RAW columns;
+ *
+ *
+ *
+ *
+ * SQLT_LNG - for LONG columns;
+ *
+ *
+ *
+ *
+ * SQLT_LBI - for LONG RAW columns;
+ *
+ *
+ *
+ *
+ * SQLT_RSET - for cursors created
+ * with oci_new_cursor;
+ *
+ *
+ *
+ *
+ * SQLT_BOL or OCI_B_BOL
+ * - for PL/SQL BOOLEANs (Requires OCI8 2.0.7 and Oracle Database 12c)
+ *
+ *
+ *
+ *
+ * SQLT_BFILEE or OCI_B_BFILE
+ * - for BFILEs;
+ *
+ * SQLT_CFILEE or OCI_B_CFILEE
+ * - for CFILEs;
+ *
+ * SQLT_CLOB or OCI_B_CLOB
+ * - for CLOBs;
+ *
+ * SQLT_BLOB or OCI_B_BLOB
+ * - for BLOBs;
+ *
+ * SQLT_RDD or OCI_B_ROWID
+ * - for ROWIDs;
+ *
+ * SQLT_NTY or OCI_B_NTY
+ * - for named datatypes;
+ *
+ * SQLT_INT or OCI_B_INT - for integers;
+ *
+ * SQLT_CHR - for VARCHARs;
+ *
+ * SQLT_BIN or OCI_B_BIN
+ * - for RAW columns;
+ *
+ * SQLT_LNG - for LONG columns;
+ *
+ * SQLT_LBI - for LONG RAW columns;
+ *
+ * SQLT_RSET - for cursors created
+ * with oci_new_cursor;
+ *
+ * SQLT_BOL or OCI_B_BOL
+ * - for PL/SQL BOOLEANs (Requires OCI8 2.0.7 and Oracle Database 12c)
+ * @throws Oci8Exception
+ *
+ */
+function oci_bind_by_name($statement, string $bv_name, &$variable, int $maxlength = -1, int $type = SQLT_CHR): void
+{
+ error_clear_last();
+ $result = \oci_bind_by_name($statement, $bv_name, $variable, $maxlength, $type);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Invalidates a cursor, freeing all associated resources and cancels the
+ * ability to read from it.
+ *
+ * @param resource $statement An OCI statement.
+ * @throws Oci8Exception
+ *
+ */
+function oci_cancel($statement): void
+{
+ error_clear_last();
+ $result = \oci_cancel($statement);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Unsets connection. The underlying database
+ * connection is closed if no other resources are using it and if it
+ * was created with oci_connect
+ * or oci_new_connect.
+ *
+ * It is recommended to close connections that are no longer needed
+ * because this makes database resources available for other users.
+ *
+ * @param resource $connection An Oracle connection identifier returned by
+ * oci_connect, oci_pconnect,
+ * or oci_new_connect.
+ * @throws Oci8Exception
+ *
+ */
+function oci_close($connection): void
+{
+ error_clear_last();
+ $result = \oci_close($connection);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Commits the outstanding transaction for the
+ * Oracle connection. A commit ends the
+ * current transaction and makes permanent all changes. It releases
+ * all locks held.
+ *
+ * A transaction begins when the first SQL statement that changes data
+ * is executed with oci_execute using
+ * the OCI_NO_AUTO_COMMIT flag. Further data
+ * changes made by other statements become part of the same
+ * transaction. Data changes made in a transaction are temporary
+ * until the transaction is committed or rolled back. Other users of
+ * the database will not see the changes until they are committed.
+ *
+ * When inserting or updating data, using transactions is recommended
+ * for relational data consistency and for performance reasons.
+ *
+ * @param resource $connection An Oracle connection identifier, returned by
+ * oci_connect, oci_pconnect, or oci_new_connect.
+ * @throws Oci8Exception
+ *
+ */
+function oci_commit($connection): void
+{
+ error_clear_last();
+ $result = \oci_commit($connection);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Returns a connection identifier needed for most other OCI8 operations.
+ *
+ * See Connection Handling for
+ * general information on connection management and connection
+ * pooling.
+ *
+ * From PHP 5.1.2 (PECL OCI8 1.1) oci_close can
+ * be used to close the connection.
+ *
+ * The second and subsequent calls to oci_connect
+ * with the same parameters will return the connection handle returned
+ * from the first call. This means that transactions in one handle are
+ * also in the other handles, because they use the
+ * same underlying database connection. If two
+ * handles need to be transactionally isolated from each other, use
+ * oci_new_connect instead.
+ *
+ * @param string $username The Oracle user name.
+ * @param string $password The password for username.
+ * @param string $connection_string Contains
+ * the Oracle instance to connect to. It can be
+ * an Easy Connect
+ * string, or a Connect Name from
+ * the tnsnames.ora file, or the name of a local
+ * Oracle instance.
+ *
+ * If not specified, PHP uses
+ * environment variables such as TWO_TASK (on Linux)
+ * or LOCAL (on Windows)
+ * and ORACLE_SID to determine the
+ * Oracle instance to connect to.
+ *
+ *
+ * To use the Easy Connect naming method, PHP must be linked with Oracle
+ * 10g or greater Client libraries. The Easy Connect string for Oracle
+ * 10g is of the form:
+ * [//]host_name[:port][/service_name]. From Oracle
+ * 11g, the syntax is:
+ * [//]host_name[:port][/service_name][:server_type][/instance_name].
+ * Service names can be found by running the Oracle
+ * utility lsnrctl status on the database server
+ * machine.
+ *
+ *
+ * The tnsnames.ora file can be in the Oracle Net
+ * search path, which
+ * includes $ORACLE_HOME/network/admin
+ * and /etc. Alternatively
+ * set TNS_ADMIN so
+ * that $TNS_ADMIN/tnsnames.ora is read. Make sure
+ * the web daemon has read access to the file.
+ * @param string $character_set Determines
+ * the character set used by the Oracle Client libraries. The character
+ * set does not need to match the character set used by the database. If
+ * it doesn't match, Oracle will do its best to convert data to and from
+ * the database character set. Depending on the character sets this may
+ * not give usable results. Conversion also adds some time overhead.
+ *
+ * If not specified, the
+ * Oracle Client libraries determine a character set from
+ * the NLS_LANG environment variable.
+ *
+ * Passing this parameter can
+ * reduce the time taken to connect.
+ * @param int $session_mode This
+ * parameter is available since version PHP 5 (PECL OCI8 1.1) and accepts the
+ * following values: OCI_DEFAULT,
+ * OCI_SYSOPER and OCI_SYSDBA.
+ * If either OCI_SYSOPER or
+ * OCI_SYSDBA were specified, this function will try
+ * to establish privileged connection using external credentials.
+ * Privileged connections are disabled by default. To enable them you
+ * need to set oci8.privileged_connect
+ * to On.
+ *
+ *
+ * PHP 5.3 (PECL OCI8 1.3.4) introduced the
+ * OCI_CRED_EXT mode value. This tells Oracle to use
+ * External or OS authentication, which must be configured in the
+ * database. The OCI_CRED_EXT flag can only be used
+ * with username of "/" and a empty password.
+ * oci8.privileged_connect
+ * may be On or Off.
+ *
+ *
+ * OCI_CRED_EXT may be combined with the
+ * OCI_SYSOPER or
+ * OCI_SYSDBA modes.
+ *
+ *
+ * OCI_CRED_EXT is not supported on Windows for
+ * security reasons.
+ * @return resource Returns a connection identifier.
+ * @throws Oci8Exception
+ *
+ */
+function oci_connect(string $username, string $password, string $connection_string = null, string $character_set = null, int $session_mode = null)
+{
+ error_clear_last();
+ if ($session_mode !== null) {
+ $result = \oci_connect($username, $password, $connection_string, $character_set, $session_mode);
+ } elseif ($character_set !== null) {
+ $result = \oci_connect($username, $password, $connection_string, $character_set);
+ } elseif ($connection_string !== null) {
+ $result = \oci_connect($username, $password, $connection_string);
+ } else {
+ $result = \oci_connect($username, $password);
+ }
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Associates a PHP variable with a column for query fetches using oci_fetch.
+ *
+ * The oci_define_by_name call must occur before
+ * executing oci_execute.
+ *
+ * @param resource $statement A valid OCI8 statement
+ * identifier created by oci_parse and executed
+ * by oci_execute, or a REF
+ * CURSOR statement identifier.
+ * @param string $column_name The column name used in the query.
+ *
+ * Use uppercase for Oracle's default, non-case sensitive column
+ * names. Use the exact column name case for case-sensitive
+ * column names.
+ * @param mixed $variable The PHP variable that will contain the returned column value.
+ * @param int $type The data type to be returned. Generally not needed. Note that
+ * Oracle-style data conversions are not performed. For example,
+ * SQLT_INT will be ignored and the returned
+ * data type will still be SQLT_CHR.
+ *
+ * You can optionally use oci_new_descriptor
+ * to allocate LOB/ROWID/BFILE descriptors.
+ * @throws Oci8Exception
+ *
+ */
+function oci_define_by_name($statement, string $column_name, &$variable, int $type = SQLT_CHR): void
+{
+ error_clear_last();
+ $result = \oci_define_by_name($statement, $column_name, $variable, $type);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Executes a statement previously returned
+ * from oci_parse.
+ *
+ * After execution, statements like INSERT will
+ * have data committed to the database by default. For statements
+ * like SELECT, execution performs the logic of the
+ * query. Query results can subsequently be fetched in PHP with
+ * functions like oci_fetch_array.
+ *
+ * Each parsed statement may be executed multiple times, saving the
+ * cost of re-parsing. This is commonly used
+ * for INSERT statements when data is bound
+ * with oci_bind_by_name.
+ *
+ * @param resource $statement A valid OCI statement identifier.
+ * @param int $mode An optional second parameter can be one of the following constants:
+ *
+ * Execution Modes
+ *
+ *
+ *
+ * Constant
+ * Description
+ *
+ *
+ *
+ *
+ * OCI_COMMIT_ON_SUCCESS
+ * Automatically commit all outstanding changes for
+ * this connection when the statement has succeeded. This
+ * is the default.
+ *
+ *
+ * OCI_DESCRIBE_ONLY
+ * Make query meta data available to functions
+ * like oci_field_name but do not
+ * create a result set. Any subsequent fetch call such
+ * as oci_fetch_array will
+ * fail.
+ *
+ *
+ * OCI_NO_AUTO_COMMIT
+ * Do not automatically commit changes. Prior to PHP
+ * 5.3.2 (PECL OCI8 1.4)
+ * use OCI_DEFAULT which is equivalent
+ * to OCI_NO_AUTO_COMMIT.
+ *
+ *
+ *
+ *
+ *
+ * Using OCI_NO_AUTO_COMMIT mode starts or continues a
+ * transaction. Transactions are automatically rolled back when
+ * the connection is closed, or when the script ends. Explicitly
+ * call oci_commit to commit a transaction,
+ * or oci_rollback to abort it.
+ *
+ * When inserting or updating data, using transactions is
+ * recommended for relational data consistency and for performance
+ * reasons.
+ *
+ * If OCI_NO_AUTO_COMMIT mode is used for any
+ * statement including queries, and
+ * oci_commit
+ * or oci_rollback is not subsequently
+ * called, then OCI8 will perform a rollback at the end of the
+ * script even if no data was changed. To avoid an unnecessary
+ * rollback, many scripts do not
+ * use OCI_NO_AUTO_COMMIT mode for queries or
+ * PL/SQL. Be careful to ensure the appropriate transactional
+ * consistency for the application when
+ * using oci_execute with different modes in
+ * the same script.
+ * @throws Oci8Exception
+ *
+ */
+function oci_execute($statement, int $mode = OCI_COMMIT_ON_SUCCESS): void
+{
+ error_clear_last();
+ $result = \oci_execute($statement, $mode);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Fetches multiple rows from a query into a two-dimensional array.
+ * By default, all rows are returned.
+ *
+ * This function can be called only once for each query executed
+ * with oci_execute.
+ *
+ * @param resource $statement A valid OCI8 statement
+ * identifier created by oci_parse and executed
+ * by oci_execute, or a REF
+ * CURSOR statement identifier.
+ * @param array|null $output The variable to contain the returned rows.
+ *
+ * LOB columns are returned as strings, where Oracle supports
+ * conversion.
+ *
+ * See oci_fetch_array for more information
+ * on how data and types are fetched.
+ * @param int $skip The number of initial rows to discard when fetching the
+ * result. The default value is 0, so the first row onwards is
+ * returned.
+ * @param int $maxrows The number of rows to return. The default is -1 meaning return
+ * all the rows from skip + 1 onwards.
+ * @param int $flags Parameter flags indicates the array
+ * structure and whether associative arrays should be used.
+ *
+ * oci_fetch_all Array Structure Modes
+ *
+ *
+ *
+ * Constant
+ * Description
+ *
+ *
+ *
+ *
+ * OCI_FETCHSTATEMENT_BY_ROW
+ * The outer array will contain one sub-array per query
+ * row.
+ *
+ *
+ * OCI_FETCHSTATEMENT_BY_COLUMN
+ * The outer array will contain one sub-array per query
+ * column. This is the default.
+ *
+ *
+ *
+ *
+ *
+ * Arrays can be indexed either by column heading or numerically.
+ * Only one index mode will be returned.
+ *
+ * oci_fetch_all Array Index Modes
+ *
+ *
+ *
+ * Constant
+ * Description
+ *
+ *
+ *
+ *
+ * OCI_NUM
+ * Numeric indexes are used for each column's array.
+ *
+ *
+ * OCI_ASSOC
+ * Associative indexes are used for each column's
+ * array. This is the default.
+ *
+ *
+ *
+ *
+ *
+ * Use the addition operator "+" to choose a combination
+ * of array structure and index modes.
+ *
+ * Oracle's default, non-case sensitive column names will have
+ * uppercase array keys. Case-sensitive column names will have
+ * array keys using the exact column case.
+ * Use var_dump
+ * on output to verify the appropriate case
+ * to use for each query.
+ *
+ * Queries that have more than one column with the same name
+ * should use column aliases. Otherwise only one of the columns
+ * will appear in an associative array.
+ * @return int Returns the number of rows in output, which
+ * may be 0 or more.
+ * @throws Oci8Exception
+ *
+ */
+function oci_fetch_all($statement, ?array &$output, int $skip = 0, int $maxrows = -1, int $flags = OCI_FETCHSTATEMENT_BY_COLUMN + OCI_ASSOC): int
+{
+ error_clear_last();
+ $result = \oci_fetch_all($statement, $output, $skip, $maxrows, $flags);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Returns the name of the field.
+ *
+ * @param resource $statement A valid OCI statement identifier.
+ * @param mixed $field Can be the field's index (1-based) or name.
+ * @return string Returns the name as a strings.
+ * @throws Oci8Exception
+ *
+ */
+function oci_field_name($statement, $field): string
+{
+ error_clear_last();
+ $result = \oci_field_name($statement, $field);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Returns precision of the field.
+ *
+ * For FLOAT columns, precision is nonzero and scale is -127.
+ * If precision is 0, then column is NUMBER. Else it's
+ * NUMBER(precision, scale).
+ *
+ * @param resource $statement A valid OCI statement identifier.
+ * @param mixed $field Can be the field's index (1-based) or name.
+ * @return int Returns the precision as an integers.
+ * @throws Oci8Exception
+ *
+ */
+function oci_field_precision($statement, $field): int
+{
+ error_clear_last();
+ $result = \oci_field_precision($statement, $field);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Returns the scale of the column with field index.
+ *
+ * For FLOAT columns, precision is nonzero and scale is -127.
+ * If precision is 0, then column is NUMBER. Else it's
+ * NUMBER(precision, scale).
+ *
+ * @param resource $statement A valid OCI statement identifier.
+ * @param mixed $field Can be the field's index (1-based) or name.
+ * @return int Returns the scale as an integers.
+ * @throws Oci8Exception
+ *
+ */
+function oci_field_scale($statement, $field): int
+{
+ error_clear_last();
+ $result = \oci_field_scale($statement, $field);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Returns the size of a field.
+ *
+ * @param resource $statement A valid OCI statement identifier.
+ * @param mixed $field Can be the field's index (1-based) or name.
+ * @return int Returns the size of a field in bytess.
+ * @throws Oci8Exception
+ *
+ */
+function oci_field_size($statement, $field): int
+{
+ error_clear_last();
+ $result = \oci_field_size($statement, $field);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Returns Oracle's raw "SQLT" data type of the field.
+ *
+ * If you want a field's type name, then use oci_field_type instead.
+ *
+ * @param resource $statement A valid OCI statement identifier.
+ * @param mixed $field Can be the field's index (1-based) or name.
+ * @return int Returns Oracle's raw data type as a numbers.
+ * @throws Oci8Exception
+ *
+ */
+function oci_field_type_raw($statement, $field): int
+{
+ error_clear_last();
+ $result = \oci_field_type_raw($statement, $field);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Returns a field's data type name.
+ *
+ * @param resource $statement A valid OCI statement identifier.
+ * @param mixed $field Can be the field's index (1-based) or name.
+ * @return mixed Returns the field data type as a strings.
+ * @throws Oci8Exception
+ *
+ */
+function oci_field_type($statement, $field)
+{
+ error_clear_last();
+ $result = \oci_field_type($statement, $field);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Frees a descriptor allocated by oci_new_descriptor.
+ *
+ * @param resource $descriptor
+ * @throws Oci8Exception
+ *
+ */
+function oci_free_descriptor($descriptor): void
+{
+ error_clear_last();
+ $result = \oci_free_descriptor($descriptor);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Frees resources associated with Oracle's cursor or statement, which was
+ * received from as a result of oci_parse or obtained
+ * from Oracle.
+ *
+ * @param resource $statement A valid OCI statement identifier.
+ * @throws Oci8Exception
+ *
+ */
+function oci_free_statement($statement): void
+{
+ error_clear_last();
+ $result = \oci_free_statement($statement);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Allocates a new collection object.
+ *
+ * @param resource $connection An Oracle connection identifier, returned by
+ * oci_connect or oci_pconnect.
+ * @param string $tdo Should be a valid named type (uppercase).
+ * @param string $schema Should point to the scheme, where the named type was created. The name
+ * of the current user is the default value.
+ * @return \OCI-Collection Returns a new OCICollection object.
+ * @throws Oci8Exception
+ *
+ */
+function oci_new_collection($connection, string $tdo, string $schema = null)
+{
+ error_clear_last();
+ $result = \oci_new_collection($connection, $tdo, $schema);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Establishes a new connection to an Oracle server and logs on.
+ *
+ * Unlike oci_connect and
+ * oci_pconnect, oci_new_connect
+ * does not cache connections and will always return a brand-new freshly
+ * opened connection handle. This is useful if your application needs
+ * transactional isolation between two sets of queries.
+ *
+ * @param string $username The Oracle user name.
+ * @param string $password The password for username.
+ * @param string $connection_string Contains
+ * the Oracle instance to connect to. It can be
+ * an Easy Connect
+ * string, or a Connect Name from
+ * the tnsnames.ora file, or the name of a local
+ * Oracle instance.
+ *
+ * If not specified, PHP uses
+ * environment variables such as TWO_TASK (on Linux)
+ * or LOCAL (on Windows)
+ * and ORACLE_SID to determine the
+ * Oracle instance to connect to.
+ *
+ *
+ * To use the Easy Connect naming method, PHP must be linked with Oracle
+ * 10g or greater Client libraries. The Easy Connect string for Oracle
+ * 10g is of the form:
+ * [//]host_name[:port][/service_name]. From Oracle
+ * 11g, the syntax is:
+ * [//]host_name[:port][/service_name][:server_type][/instance_name].
+ * Service names can be found by running the Oracle
+ * utility lsnrctl status on the database server
+ * machine.
+ *
+ *
+ * The tnsnames.ora file can be in the Oracle Net
+ * search path, which
+ * includes $ORACLE_HOME/network/admin
+ * and /etc. Alternatively
+ * set TNS_ADMIN so
+ * that $TNS_ADMIN/tnsnames.ora is read. Make sure
+ * the web daemon has read access to the file.
+ * @param string $character_set Determines
+ * the character set used by the Oracle Client libraries. The character
+ * set does not need to match the character set used by the database. If
+ * it doesn't match, Oracle will do its best to convert data to and from
+ * the database character set. Depending on the character sets this may
+ * not give usable results. Conversion also adds some time overhead.
+ *
+ * If not specified, the
+ * Oracle Client libraries determine a character set from
+ * the NLS_LANG environment variable.
+ *
+ * Passing this parameter can
+ * reduce the time taken to connect.
+ * @param int $session_mode This
+ * parameter is available since version PHP 5 (PECL OCI8 1.1) and accepts the
+ * following values: OCI_DEFAULT,
+ * OCI_SYSOPER and OCI_SYSDBA.
+ * If either OCI_SYSOPER or
+ * OCI_SYSDBA were specified, this function will try
+ * to establish privileged connection using external credentials.
+ * Privileged connections are disabled by default. To enable them you
+ * need to set oci8.privileged_connect
+ * to On.
+ *
+ *
+ * PHP 5.3 (PECL OCI8 1.3.4) introduced the
+ * OCI_CRED_EXT mode value. This tells Oracle to use
+ * External or OS authentication, which must be configured in the
+ * database. The OCI_CRED_EXT flag can only be used
+ * with username of "/" and a empty password.
+ * oci8.privileged_connect
+ * may be On or Off.
+ *
+ *
+ * OCI_CRED_EXT may be combined with the
+ * OCI_SYSOPER or
+ * OCI_SYSDBA modes.
+ *
+ *
+ * OCI_CRED_EXT is not supported on Windows for
+ * security reasons.
+ * @return resource Returns a connection identifier.
+ * @throws Oci8Exception
+ *
+ */
+function oci_new_connect(string $username, string $password, string $connection_string = null, string $character_set = null, int $session_mode = null)
+{
+ error_clear_last();
+ if ($session_mode !== null) {
+ $result = \oci_new_connect($username, $password, $connection_string, $character_set, $session_mode);
+ } elseif ($character_set !== null) {
+ $result = \oci_new_connect($username, $password, $connection_string, $character_set);
+ } elseif ($connection_string !== null) {
+ $result = \oci_new_connect($username, $password, $connection_string);
+ } else {
+ $result = \oci_new_connect($username, $password);
+ }
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Allocates a new statement handle on the specified connection.
+ *
+ * @param resource $connection An Oracle connection identifier, returned by
+ * oci_connect or oci_pconnect.
+ * @return resource Returns a new statement handle.
+ * @throws Oci8Exception
+ *
+ */
+function oci_new_cursor($connection)
+{
+ error_clear_last();
+ $result = \oci_new_cursor($connection);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Allocates resources to hold descriptor or LOB locator.
+ *
+ * @param resource $connection An Oracle connection identifier, returned by
+ * oci_connect or oci_pconnect.
+ * @param int $type Valid values for type are:
+ * OCI_DTYPE_FILE, OCI_DTYPE_LOB and
+ * OCI_DTYPE_ROWID.
+ * @return \OCI-Lob Returns a new LOB or FILE descriptor on success, FALSE on error.
+ * @throws Oci8Exception
+ *
+ */
+function oci_new_descriptor($connection, int $type = OCI_DTYPE_LOB)
+{
+ error_clear_last();
+ $result = \oci_new_descriptor($connection, $type);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Gets the number of columns in the given statement.
+ *
+ * @param resource $statement A valid OCI statement identifier.
+ * @return int Returns the number of columns as an integers.
+ * @throws Oci8Exception
+ *
+ */
+function oci_num_fields($statement): int
+{
+ error_clear_last();
+ $result = \oci_num_fields($statement);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Gets the number of rows affected during statement execution.
+ *
+ * @param resource $statement A valid OCI statement identifier.
+ * @return int Returns the number of rows affected as an integers.
+ * @throws Oci8Exception
+ *
+ */
+function oci_num_rows($statement): int
+{
+ error_clear_last();
+ $result = \oci_num_rows($statement);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Prepares sql_text using
+ * connection and returns the statement identifier,
+ * which can be used with oci_bind_by_name,
+ * oci_execute and other functions.
+ *
+ * Statement identifiers can be freed
+ * with oci_free_statement or by setting the
+ * variable to NULL.
+ *
+ * @param resource $connection An Oracle connection identifier, returned by
+ * oci_connect, oci_pconnect, or oci_new_connect.
+ * @param string $sql_text The SQL or PL/SQL statement.
+ *
+ * SQL statements should not end with a
+ * semi-colon (";"). PL/SQL
+ * statements should end with a semi-colon
+ * (";").
+ * @return resource Returns a statement handle on success.
+ * @throws Oci8Exception
+ *
+ */
+function oci_parse($connection, string $sql_text)
+{
+ error_clear_last();
+ $result = \oci_parse($connection, $sql_text);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Creates a persistent connection to an Oracle server and logs on.
+ *
+ * Persistent connections are cached and re-used between requests, resulting
+ * in reduced overhead on each page load; a typical PHP application will have
+ * a single persistent connection open against an Oracle server per Apache
+ * child process (or PHP FastCGI/CGI process). See the Persistent Database
+ * Connections section for more information.
+ *
+ * @param string $username The Oracle user name.
+ * @param string $password The password for username.
+ * @param string $connection_string Contains
+ * the Oracle instance to connect to. It can be
+ * an Easy Connect
+ * string, or a Connect Name from
+ * the tnsnames.ora file, or the name of a local
+ * Oracle instance.
+ *
+ * If not specified, PHP uses
+ * environment variables such as TWO_TASK (on Linux)
+ * or LOCAL (on Windows)
+ * and ORACLE_SID to determine the
+ * Oracle instance to connect to.
+ *
+ *
+ * To use the Easy Connect naming method, PHP must be linked with Oracle
+ * 10g or greater Client libraries. The Easy Connect string for Oracle
+ * 10g is of the form:
+ * [//]host_name[:port][/service_name]. From Oracle
+ * 11g, the syntax is:
+ * [//]host_name[:port][/service_name][:server_type][/instance_name].
+ * Service names can be found by running the Oracle
+ * utility lsnrctl status on the database server
+ * machine.
+ *
+ *
+ * The tnsnames.ora file can be in the Oracle Net
+ * search path, which
+ * includes $ORACLE_HOME/network/admin
+ * and /etc. Alternatively
+ * set TNS_ADMIN so
+ * that $TNS_ADMIN/tnsnames.ora is read. Make sure
+ * the web daemon has read access to the file.
+ * @param string $character_set Determines
+ * the character set used by the Oracle Client libraries. The character
+ * set does not need to match the character set used by the database. If
+ * it doesn't match, Oracle will do its best to convert data to and from
+ * the database character set. Depending on the character sets this may
+ * not give usable results. Conversion also adds some time overhead.
+ *
+ * If not specified, the
+ * Oracle Client libraries determine a character set from
+ * the NLS_LANG environment variable.
+ *
+ * Passing this parameter can
+ * reduce the time taken to connect.
+ * @param int $session_mode This
+ * parameter is available since version PHP 5 (PECL OCI8 1.1) and accepts the
+ * following values: OCI_DEFAULT,
+ * OCI_SYSOPER and OCI_SYSDBA.
+ * If either OCI_SYSOPER or
+ * OCI_SYSDBA were specified, this function will try
+ * to establish privileged connection using external credentials.
+ * Privileged connections are disabled by default. To enable them you
+ * need to set oci8.privileged_connect
+ * to On.
+ *
+ *
+ * PHP 5.3 (PECL OCI8 1.3.4) introduced the
+ * OCI_CRED_EXT mode value. This tells Oracle to use
+ * External or OS authentication, which must be configured in the
+ * database. The OCI_CRED_EXT flag can only be used
+ * with username of "/" and a empty password.
+ * oci8.privileged_connect
+ * may be On or Off.
+ *
+ *
+ * OCI_CRED_EXT may be combined with the
+ * OCI_SYSOPER or
+ * OCI_SYSDBA modes.
+ *
+ *
+ * OCI_CRED_EXT is not supported on Windows for
+ * security reasons.
+ * @return resource Returns a connection identifier.
+ * @throws Oci8Exception
+ *
+ */
+function oci_pconnect(string $username, string $password, string $connection_string = null, string $character_set = null, int $session_mode = null)
+{
+ error_clear_last();
+ if ($session_mode !== null) {
+ $result = \oci_pconnect($username, $password, $connection_string, $character_set, $session_mode);
+ } elseif ($character_set !== null) {
+ $result = \oci_pconnect($username, $password, $connection_string, $character_set);
+ } elseif ($connection_string !== null) {
+ $result = \oci_pconnect($username, $password, $connection_string);
+ } else {
+ $result = \oci_pconnect($username, $password);
+ }
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Returns the data from field in the current row,
+ * fetched by oci_fetch.
+ *
+ * For details on the data type mapping performed by
+ * the OCI8 extension, see the datatypes
+ * supported by the driver
+ *
+ * @param resource $statement
+ * @param mixed $field Can be either use the column number (1-based) or the column name.
+ * The case of the column name must be the case that Oracle meta data
+ * describes the column as, which is uppercase for columns created
+ * case insensitively.
+ * @return string Returns everything as strings except for abstract types (ROWIDs, LOBs and
+ * FILEs).
+ * @throws Oci8Exception
+ *
+ */
+function oci_result($statement, $field): string
+{
+ error_clear_last();
+ $result = \oci_result($statement, $field);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Reverts all uncommitted changes for the Oracle
+ * connection and ends the transaction. It
+ * releases all locks held. All Oracle SAVEPOINTS
+ * are erased.
+ *
+ * A transaction begins when the first SQL statement that changes data
+ * is executed with oci_execute using
+ * the OCI_NO_AUTO_COMMIT flag. Further data
+ * changes made by other statements become part of the same
+ * transaction. Data changes made in a transaction are temporary
+ * until the transaction is committed or rolled back. Other users of
+ * the database will not see the changes until they are committed.
+ *
+ * When inserting or updating data, using transactions is recommended
+ * for relational data consistency and for performance reasons.
+ *
+ * @param resource $connection An Oracle connection identifier, returned by
+ * oci_connect, oci_pconnect
+ * or oci_new_connect.
+ * @throws Oci8Exception
+ *
+ */
+function oci_rollback($connection): void
+{
+ error_clear_last();
+ $result = \oci_rollback($connection);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Returns a string with the Oracle Database version and available options
+ *
+ * @param resource $connection
+ * @return string Returns the version information as a string.
+ * @throws Oci8Exception
+ *
+ */
+function oci_server_version($connection): string
+{
+ error_clear_last();
+ $result = \oci_server_version($connection);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Sets the action name for Oracle tracing.
+ *
+ * The action name is registered with the database when the next
+ * 'round-trip' from PHP to the database occurs, typically when an SQL
+ * statement is executed.
+ *
+ * The action name can subsequently be queried from database administration
+ * views such as V$SESSION. It can be used for
+ * tracing and monitoring such as with V$SQLAREA
+ * and DBMS_MONITOR.SERV_MOD_ACT_STAT_ENABLE.
+ *
+ * The value may be retained across persistent connections.
+ *
+ * @param resource $connection An Oracle connection identifier,
+ * returned by oci_connect, oci_pconnect,
+ * or oci_new_connect.
+ * @param string $action_name User chosen string up to 32 bytes long.
+ * @throws Oci8Exception
+ *
+ */
+function oci_set_action($connection, string $action_name): void
+{
+ error_clear_last();
+ $result = \oci_set_action($connection, $action_name);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets a timeout limiting the maxium time a database round-trip using this connection may take.
+ *
+ * Each OCI8 operation may make zero or more calls to Oracle's client
+ * library. These internal calls may then may make zero or more
+ * round-trips to Oracle Database. If any one of those round-trips
+ * takes more than time_out milliseconds, then the
+ * operation is cancelled and an error is returned to the application.
+ *
+ * The time_out value applies to each round-trip
+ * individually, not to the sum of all round-trips. Time spent
+ * processing in PHP OCI8 before or after the completion of each
+ * round-trip is not counted.
+ *
+ * When a call is interrupted, Oracle will attempt to clean up the
+ * connection for reuse. This operation is allowed to run for
+ * another time_out period. Depending on the
+ * outcome of the cleanup, the connection may or may not be reusable.
+ *
+ * When persistent connections are used, the timeout value will be
+ * retained across PHP requests.
+ *
+ * The oci_set_call_timeout function is available
+ * when OCI8 uses Oracle 18 (or later) Client libraries.
+ *
+ * @param resource $connection An Oracle connection identifier,
+ * returned by oci_connect, oci_pconnect,
+ * or oci_new_connect.
+ * @param int $time_out The maximum time in milliseconds that any single round-trip between PHP and Oracle Database may take.
+ * @throws Oci8Exception
+ *
+ */
+function oci_set_call_timeout($connection, int $time_out): void
+{
+ error_clear_last();
+ $result = \oci_set_call_timeout($connection, $time_out);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the client identifier used by various database components to
+ * identify lightweight application users who authenticate as the same
+ * database user.
+ *
+ * The client identifier is registered with the database when the next
+ * 'round-trip' from PHP to the database occurs, typically when an SQL
+ * statement is executed.
+ *
+ * The identifier can subsequently be queried, for example
+ * with SELECT SYS_CONTEXT('USERENV','CLIENT_IDENTIFIER')
+ * FROM DUAL. Database administration views such
+ * as V$SESSION will also contain the value. It
+ * can be used with DBMS_MONITOR.CLIENT_ID_TRACE_ENABLE
+ * for tracing and can also be used for auditing.
+ *
+ * The value may be retained across page requests that use the same persistent connection.
+ *
+ * @param resource $connection An Oracle connection identifier,
+ * returned by oci_connect, oci_pconnect,
+ * or oci_new_connect.
+ * @param string $client_identifier User chosen string up to 64 bytes long.
+ * @throws Oci8Exception
+ *
+ */
+function oci_set_client_identifier($connection, string $client_identifier): void
+{
+ error_clear_last();
+ $result = \oci_set_client_identifier($connection, $client_identifier);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the client information for Oracle tracing.
+ *
+ * The client information is registered with the database when the next
+ * 'round-trip' from PHP to the database occurs, typically when an SQL
+ * statement is executed.
+ *
+ * The client information can subsequently be queried from database
+ * administration views such as V$SESSION.
+ *
+ * The value may be retained across persistent connections.
+ *
+ * @param resource $connection An Oracle connection identifier,
+ * returned by oci_connect, oci_pconnect,
+ * or oci_new_connect.
+ * @param string $client_info User chosen string up to 64 bytes long.
+ * @throws Oci8Exception
+ *
+ */
+function oci_set_client_info($connection, string $client_info): void
+{
+ error_clear_last();
+ $result = \oci_set_client_info($connection, $client_info);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the DBOP for Oracle tracing.
+ *
+ * The database operation name is registered with the database when the next
+ * 'round-trip' from PHP to the database occurs, typically when a SQL
+ * statement is executed.
+ *
+ * The database operation can subsequently be queried from database administration
+ * views such as V$SQL_MONITOR.
+ *
+ * The oci_set_db_operation function is available
+ * when OCI8 uses Oracle 12 (or later) Client libraries and Oracle Database 12 (or later).
+ *
+ * @param resource $connection An Oracle connection identifier,
+ * returned by oci_connect, oci_pconnect,
+ * or oci_new_connect.
+ * @param string $dbop User chosen string.
+ * @throws Oci8Exception
+ *
+ */
+function oci_set_db_operation($connection, string $dbop): void
+{
+ error_clear_last();
+ $result = \oci_set_db_operation($connection, $dbop);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the database "edition" of objects to be used by a subsequent
+ * connections.
+ *
+ * Oracle Editions allow concurrent versions of applications to run
+ * using the same schema and object names. This is useful for
+ * upgrading live systems.
+ *
+ * Call oci_set_edition before calling
+ * oci_connect, oci_pconnect
+ * or oci_new_connect.
+ *
+ * If an edition is set that is not valid in the database, connection
+ * will fail even if oci_set_edition returns success.
+ *
+ * When using persistent connections, if a connection with the
+ * requested edition setting already exists, it is reused. Otherwise,
+ * a different persistent connection is created
+ *
+ * @param string $edition Oracle Database edition name previously created with the SQL
+ * "CREATE EDITION" command.
+ * @throws Oci8Exception
+ *
+ */
+function oci_set_edition(string $edition): void
+{
+ error_clear_last();
+ $result = \oci_set_edition($edition);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the module name for Oracle tracing.
+ *
+ * The module name is registered with the database when the next
+ * 'round-trip' from PHP to the database occurs, typically when an SQL
+ * statement is executed.
+ *
+ * The name can subsequently be queried from database administration
+ * views such as V$SESSION. It can be used for
+ * tracing and monitoring such as with V$SQLAREA
+ * and DBMS_MONITOR.SERV_MOD_ACT_STAT_ENABLE.
+ *
+ * The value may be retained across persistent connections.
+ *
+ * @param resource $connection An Oracle connection identifier,
+ * returned by oci_connect, oci_pconnect,
+ * or oci_new_connect.
+ * @param string $module_name User chosen string up to 48 bytes long.
+ * @throws Oci8Exception
+ *
+ */
+function oci_set_module_name($connection, string $module_name): void
+{
+ error_clear_last();
+ $result = \oci_set_module_name($connection, $module_name);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the number of rows to be buffered by the Oracle Client
+ * libraries after a successful query call
+ * to oci_execute and for each subsequent
+ * internal fetch request to the database. For queries returning a
+ * large number of rows, performance can be significantly improved by
+ * increasing the prefetch count above the
+ * default oci8.default_prefetch
+ * value.
+ *
+ * Prefetching is Oracle's efficient way of returning more than one
+ * data row from the database in each network request. This can
+ * result in better network and CPU utilization. The buffering of
+ * rows is internal to OCI8 and the behavior of OCI8 fetching
+ * functions is unchanged regardless of the prefetch count. For
+ * example, oci_fetch_row will always return one
+ * row. The prefetch buffer is per-statement and is not used by
+ * re-executed statements or by other connections.
+ *
+ * Call oci_set_prefetch before
+ * calling oci_execute.
+ *
+ * A tuning goal is to set the prefetch value to a reasonable size for
+ * the network and database to handle. For queries returning a very
+ * large number of rows, overall system efficiency might be better if
+ * rows are retrieved from the database in several chunks (i.e set the
+ * prefetch value smaller than the number of rows). This allows the
+ * database to handle other users' statements while the PHP script is
+ * processing the current set of rows.
+ *
+ * Query prefetching was introduced in Oracle 8i. REF CURSOR
+ * prefetching was introduced in Oracle 11gR2 and occurs when PHP is
+ * linked with Oracle 11gR2 (or later) Client libraries.
+ * Nested cursor prefetching was
+ * introduced in Oracle 11gR2 and requires both the Oracle Client
+ * libraries and the database to be version 11gR2 or greater.
+ *
+ * Prefetching is not supported when queries contain LONG or LOB
+ * columns. The prefetch value is ignored and single-row fetches will
+ * be used in all the situations when prefetching is not supported.
+ *
+ * When using Oracle Database 12c, the prefetch
+ * value set by PHP can be overridden by Oracle's
+ * client oraaccess.xml configuration file. Refer
+ * to Oracle documentation for more detail.
+ *
+ * @param resource $statement A valid OCI8 statement
+ * identifier created by oci_parse and executed
+ * by oci_execute, or a REF
+ * CURSOR statement identifier.
+ * @param int $rows The number of rows to be prefetched, &gt;= 0
+ * @throws Oci8Exception
+ *
+ */
+function oci_set_prefetch($statement, int $rows): void
+{
+ error_clear_last();
+ $result = \oci_set_prefetch($statement, $rows);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Returns a keyword identifying the type of the
+ * OCI8 statement.
+ *
+ * @param resource $statement A valid OCI8 statement identifier from oci_parse.
+ * @return string Returns the type of statement as one of the
+ * following strings.
+ *
+ * Statement type
+ *
+ *
+ *
+ * Return String
+ * Notes
+ *
+ *
+ *
+ *
+ * ALTER
+ *
+ *
+ *
+ * BEGIN
+ *
+ *
+ *
+ * CALL
+ * Introduced in PHP 5.2.1 (PECL OCI8 1.2.3)
+ *
+ *
+ * CREATE
+ *
+ *
+ *
+ * DECLARE
+ *
+ *
+ *
+ * DELETE
+ *
+ *
+ *
+ * DROP
+ *
+ *
+ *
+ * INSERT
+ *
+ *
+ *
+ * SELECT
+ *
+ *
+ *
+ * UPDATE
+ *
+ *
+ *
+ * UNKNOW.
+ * @throws Oci8Exception
+ *
+ */
+function oci_statement_type($statement): string
+{
+ error_clear_last();
+ $result = \oci_statement_type($statement);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Unregister the user-defined callback function registered to connection
+ * by oci_register_taf_callback. See
+ * OCI8 Transparent Application Failover (TAF) Support
+ * for information.
+ *
+ * @param resource $connection An Oracle connection identifier.
+ * @throws Oci8Exception
+ *
+ */
+function oci_unregister_taf_callback($connection): void
+{
+ error_clear_last();
+ $result = \oci_unregister_taf_callback($connection);
+ if ($result === false) {
+ throw Oci8Exception::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/opcache.php b/vendor/thecodingmachine/safe/generated/opcache.php
new file mode 100644
index 000000000..04a58205f
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/opcache.php
@@ -0,0 +1,42 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\OpcacheException;
+
+/**
+ * This function compiles a PHP script and adds it to the opcode cache without
+ * executing it. This can be used to prime the cache after a Web server
+ * restart by pre-caching files that will be included in later requests.
+ *
+ * @param string $file The path to the PHP script to be compiled.
+ * @throws OpcacheException
+ *
+ */
+function opcache_compile_file(string $file): void
+{
+ error_clear_last();
+ $result = \opcache_compile_file($file);
+ if ($result === false) {
+ throw OpcacheException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function returns state information about the cache instance
+ *
+ * @param bool $get_scripts Include script specific state information
+ * @return array Returns an array of information, optionally containing script specific state information.
+ * @throws OpcacheException
+ *
+ */
+function opcache_get_status(bool $get_scripts = true): array
+{
+ error_clear_last();
+ $result = \opcache_get_status($get_scripts);
+ if ($result === false) {
+ throw OpcacheException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/openssl.php b/vendor/thecodingmachine/safe/generated/openssl.php
new file mode 100644
index 000000000..117b53d6a
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/openssl.php
@@ -0,0 +1,1088 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\OpensslException;
+
+/**
+ * Gets the cipher initialization vector (iv) length.
+ *
+ * @param string $method The cipher method, see openssl_get_cipher_methods for a list of potential values.
+ * @return int Returns the cipher length on success.
+ * @throws OpensslException
+ *
+ */
+function openssl_cipher_iv_length(string $method): int
+{
+ error_clear_last();
+ $result = \openssl_cipher_iv_length($method);
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * openssl_csr_export_to_file takes the Certificate
+ * Signing Request represented by csr and saves it
+ * in PEM format into the file named by outfilename.
+ *
+ * @param string|resource $csr See CSR parameters for a list of valid values.
+ * @param string $outfilename Path to the output file.
+ * @param bool $notext
+ * The optional parameter notext affects
+ * the verbosity of the output; if it is FALSE, then additional human-readable
+ * information is included in the output. The default value of
+ * notext is TRUE.
+ * @throws OpensslException
+ *
+ */
+function openssl_csr_export_to_file($csr, string $outfilename, bool $notext = true): void
+{
+ error_clear_last();
+ $result = \openssl_csr_export_to_file($csr, $outfilename, $notext);
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+}
+
+
+/**
+ * openssl_csr_export takes the Certificate Signing
+ * Request represented by csr and stores it in
+ * PEM format in out, which is passed by
+ * reference.
+ *
+ * @param string|resource $csr See CSR parameters for a list of valid values.
+ * @param string|null $out on success, this string will contain the PEM encoded CSR
+ * @param bool $notext
+ * The optional parameter notext affects
+ * the verbosity of the output; if it is FALSE, then additional human-readable
+ * information is included in the output. The default value of
+ * notext is TRUE.
+ * @throws OpensslException
+ *
+ */
+function openssl_csr_export($csr, ?string &$out, bool $notext = true): void
+{
+ error_clear_last();
+ $result = \openssl_csr_export($csr, $out, $notext);
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+}
+
+
+/**
+ * openssl_csr_get_subject returns subject
+ * distinguished name information encoded in the csr
+ * including fields commonName (CN), organizationName (O), countryName (C) etc.
+ *
+ * @param string|resource $csr See CSR parameters for a list of valid values.
+ * @param bool $use_shortnames shortnames controls how the data is indexed in the
+ * array - if shortnames is TRUE (the default) then
+ * fields will be indexed with the short name form, otherwise, the long name
+ * form will be used - e.g.: CN is the shortname form of commonName.
+ * @return array Returns an associative array with subject description.
+ * @throws OpensslException
+ *
+ */
+function openssl_csr_get_subject($csr, bool $use_shortnames = true): array
+{
+ error_clear_last();
+ $result = \openssl_csr_get_subject($csr, $use_shortnames);
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * openssl_csr_new generates a new CSR (Certificate Signing Request)
+ * based on the information provided by dn.
+ *
+ * @param array $dn The Distinguished Name or subject fields to be used in the certificate.
+ * @param resource $privkey privkey should be set to a private key that was
+ * previously generated by openssl_pkey_new (or
+ * otherwise obtained from the other openssl_pkey family of functions).
+ * The corresponding public portion of the key will be used to sign the
+ * CSR.
+ * @param array $configargs By default, the information in your system openssl.conf
+ * is used to initialize the request; you can specify a configuration file
+ * section by setting the config_section_section key of
+ * configargs. You can also specify an alternative
+ * openssl configuration file by setting the value of the
+ * config key to the path of the file you want to use.
+ * The following keys, if present in configargs
+ * behave as their equivalents in the openssl.conf, as
+ * listed in the table below.
+ *
+ * Configuration overrides
+ *
+ *
+ *
+ * configargs key
+ * type
+ * openssl.conf equivalent
+ * description
+ *
+ *
+ *
+ *
+ * digest_alg
+ * string
+ * default_md
+ * Digest method or signature hash, usually one of openssl_get_md_methods
+ *
+ *
+ * x509_extensions
+ * string
+ * x509_extensions
+ * Selects which extensions should be used when creating an x509
+ * certificate
+ *
+ *
+ * req_extensions
+ * string
+ * req_extensions
+ * Selects which extensions should be used when creating a CSR
+ *
+ *
+ * private_key_bits
+ * integer
+ * default_bits
+ * Specifies how many bits should be used to generate a private
+ * key
+ *
+ *
+ * private_key_type
+ * integer
+ * none
+ * Specifies the type of private key to create. This can be one
+ * of OPENSSL_KEYTYPE_DSA,
+ * OPENSSL_KEYTYPE_DH,
+ * OPENSSL_KEYTYPE_RSA or
+ * OPENSSL_KEYTYPE_EC.
+ * The default value is OPENSSL_KEYTYPE_RSA.
+ *
+ *
+ *
+ * encrypt_key
+ * boolean
+ * encrypt_key
+ * Should an exported key (with passphrase) be encrypted?
+ *
+ *
+ * encrypt_key_cipher
+ * integer
+ * none
+ *
+ * One of cipher constants.
+ *
+ *
+ *
+ * curve_name
+ * string
+ * none
+ *
+ * One of openssl_get_curve_names.
+ *
+ *
+ *
+ * config
+ * string
+ * N/A
+ *
+ * Path to your own alternative openssl.conf file.
+ *
+ *
+ *
+ *
+ *
+ * @param array $extraattribs extraattribs is used to specify additional
+ * configuration options for the CSR. Both dn and
+ * extraattribs are associative arrays whose keys are
+ * converted to OIDs and applied to the relevant part of the request.
+ * @return resource Returns the CSR.
+ * @throws OpensslException
+ *
+ */
+function openssl_csr_new(array $dn, &$privkey, array $configargs = null, array $extraattribs = null)
+{
+ error_clear_last();
+ if ($extraattribs !== null) {
+ $result = \openssl_csr_new($dn, $privkey, $configargs, $extraattribs);
+ } elseif ($configargs !== null) {
+ $result = \openssl_csr_new($dn, $privkey, $configargs);
+ } else {
+ $result = \openssl_csr_new($dn, $privkey);
+ }
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * openssl_csr_sign generates an x509 certificate
+ * resource from the given CSR.
+ *
+ * @param string|resource $csr A CSR previously generated by openssl_csr_new.
+ * It can also be the path to a PEM encoded CSR when specified as
+ * file://path/to/csr or an exported string generated
+ * by openssl_csr_export.
+ * @param mixed $cacert The generated certificate will be signed by cacert.
+ * If cacert is NULL, the generated certificate
+ * will be a self-signed certificate.
+ * @param string|resource|array $priv_key priv_key is the private key that corresponds to
+ * cacert.
+ * @param int $days days specifies the length of time for which the
+ * generated certificate will be valid, in days.
+ * @param array $configargs You can finetune the CSR signing by configargs.
+ * See openssl_csr_new for more information about
+ * configargs.
+ * @param int $serial An optional the serial number of issued certificate. If not specified
+ * it will default to 0.
+ * @return resource Returns an x509 certificate resource on success, FALSE on failure.
+ * @throws OpensslException
+ *
+ */
+function openssl_csr_sign($csr, $cacert, $priv_key, int $days, array $configargs = null, int $serial = 0)
+{
+ error_clear_last();
+ if ($serial !== 0) {
+ $result = \openssl_csr_sign($csr, $cacert, $priv_key, $days, $configargs, $serial);
+ } elseif ($configargs !== null) {
+ $result = \openssl_csr_sign($csr, $cacert, $priv_key, $days, $configargs);
+ } else {
+ $result = \openssl_csr_sign($csr, $cacert, $priv_key, $days);
+ }
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Takes a raw or base64 encoded string and decrypts it using a given method and key.
+ *
+ * @param string $data The encrypted message to be decrypted.
+ * @param string $method The cipher method. For a list of available cipher methods, use
+ * openssl_get_cipher_methods.
+ * @param string $key The key.
+ * @param int $options options can be one of
+ * OPENSSL_RAW_DATA,
+ * OPENSSL_ZERO_PADDING.
+ * @param string $iv A non-NULL Initialization Vector.
+ * @param string $tag The authentication tag in AEAD cipher mode. If it is incorrect, the authentication fails and the function returns FALSE.
+ * @param string $aad Additional authentication data.
+ * @return string The decrypted string on success.
+ * @throws OpensslException
+ *
+ */
+function openssl_decrypt(string $data, string $method, string $key, int $options = 0, string $iv = "", string $tag = "", string $aad = ""): string
+{
+ error_clear_last();
+ $result = \openssl_decrypt($data, $method, $key, $options, $iv, $tag, $aad);
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * The shared secret returned by openssl_dh_compute_key is
+ * often used as an encryption key to secretly communicate with a remote party.
+ * This is known as the Diffie-Hellman key exchange.
+ *
+ * @param string $pub_key DH Public key of the remote party.
+ * @param resource $dh_key A local DH private key, corresponding to the public key to be shared with the remote party.
+ * @return string Returns shared secret on success.
+ * @throws OpensslException
+ *
+ */
+function openssl_dh_compute_key(string $pub_key, $dh_key): string
+{
+ error_clear_last();
+ $result = \openssl_dh_compute_key($pub_key, $dh_key);
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Computes a digest hash value for the given data using a given method,
+ * and returns a raw or binhex encoded string.
+ *
+ * @param string $data The data.
+ * @param string $method The digest method to use, e.g. "sha256", see openssl_get_md_methods for a list of available digest methods.
+ * @param bool $raw_output Setting to TRUE will return as raw output data, otherwise the return
+ * value is binhex encoded.
+ * @return string Returns the digested hash value on success.
+ * @throws OpensslException
+ *
+ */
+function openssl_digest(string $data, string $method, bool $raw_output = false): string
+{
+ error_clear_last();
+ $result = \openssl_digest($data, $method, $raw_output);
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * openssl_open opens (decrypts)
+ * sealed_data using the private key associated with
+ * the key identifier priv_key_id and the envelope key
+ * env_key, and fills
+ * open_data with the decrypted data.
+ * The envelope key is generated when the
+ * data are sealed and can only be used by one specific private key. See
+ * openssl_seal for more information.
+ *
+ * @param string $sealed_data
+ * @param string|null $open_data If the call is successful the opened data is returned in this
+ * parameter.
+ * @param string $env_key
+ * @param string|array|resource $priv_key_id
+ * @param string $method The cipher method.
+ * @param string $iv The initialization vector.
+ * @throws OpensslException
+ *
+ */
+function openssl_open(string $sealed_data, ?string &$open_data, string $env_key, $priv_key_id, string $method = "RC4", string $iv = null): void
+{
+ error_clear_last();
+ if ($iv !== null) {
+ $result = \openssl_open($sealed_data, $open_data, $env_key, $priv_key_id, $method, $iv);
+ } else {
+ $result = \openssl_open($sealed_data, $open_data, $env_key, $priv_key_id, $method);
+ }
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+}
+
+
+/**
+ * openssl_pbkdf2 computes PBKDF2 (Password-Based Key Derivation Function 2),
+ * a key derivation function defined in PKCS5 v2.
+ *
+ * @param string $password Password from which the derived key is generated.
+ * @param string $salt PBKDF2 recommends a crytographic salt of at least 64 bits (8 bytes).
+ * @param int $key_length Length of desired output key.
+ * @param int $iterations The number of iterations desired. NIST
+ * recommends at least 10,000.
+ * @param string $digest_algorithm Optional hash or digest algorithm from openssl_get_md_methods. Defaults to SHA-1.
+ * @return string Returns raw binary string.
+ * @throws OpensslException
+ *
+ */
+function openssl_pbkdf2(string $password, string $salt, int $key_length, int $iterations, string $digest_algorithm = "sha1"): string
+{
+ error_clear_last();
+ $result = \openssl_pbkdf2($password, $salt, $key_length, $iterations, $digest_algorithm);
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * openssl_pkcs12_export_to_file stores
+ * x509 into a file named by
+ * filename in a PKCS#12 file format.
+ *
+ * @param string|resource $x509 See Key/Certificate parameters for a list of valid values.
+ * @param string $filename Path to the output file.
+ * @param string|array|resource $priv_key Private key component of PKCS#12 file.
+ * See Public/Private Key parameters for a list of valid values.
+ * @param string $pass Encryption password for unlocking the PKCS#12 file.
+ * @param array $args Optional array, other keys will be ignored.
+ *
+ *
+ *
+ *
+ * Key
+ * Description
+ *
+ *
+ *
+ *
+ * "extracerts"
+ * array of extra certificates or a single certificate to be included in the PKCS#12 file.
+ *
+ *
+ * "friendlyname"
+ * string to be used for the supplied certificate and key
+ *
+ *
+ *
+ *
+ * @throws OpensslException
+ *
+ */
+function openssl_pkcs12_export_to_file($x509, string $filename, $priv_key, string $pass, array $args = null): void
+{
+ error_clear_last();
+ if ($args !== null) {
+ $result = \openssl_pkcs12_export_to_file($x509, $filename, $priv_key, $pass, $args);
+ } else {
+ $result = \openssl_pkcs12_export_to_file($x509, $filename, $priv_key, $pass);
+ }
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+}
+
+
+/**
+ * openssl_pkcs12_export stores
+ * x509 into a string named by
+ * out in a PKCS#12 file format.
+ *
+ * @param string|resource $x509 See Key/Certificate parameters for a list of valid values.
+ * @param string|null $out On success, this will hold the PKCS#12.
+ * @param string|array|resource $priv_key Private key component of PKCS#12 file.
+ * See Public/Private Key parameters for a list of valid values.
+ * @param string $pass Encryption password for unlocking the PKCS#12 file.
+ * @param array $args Optional array, other keys will be ignored.
+ *
+ *
+ *
+ *
+ * Key
+ * Description
+ *
+ *
+ *
+ *
+ * "extracerts"
+ * array of extra certificates or a single certificate to be included in the PKCS#12 file.
+ *
+ *
+ * "friendlyname"
+ * string to be used for the supplied certificate and key
+ *
+ *
+ *
+ *
+ * @throws OpensslException
+ *
+ */
+function openssl_pkcs12_export($x509, ?string &$out, $priv_key, string $pass, array $args = null): void
+{
+ error_clear_last();
+ if ($args !== null) {
+ $result = \openssl_pkcs12_export($x509, $out, $priv_key, $pass, $args);
+ } else {
+ $result = \openssl_pkcs12_export($x509, $out, $priv_key, $pass);
+ }
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+}
+
+
+/**
+ * openssl_pkcs12_read parses the PKCS#12 certificate store supplied by
+ * pkcs12 into a array named
+ * certs.
+ *
+ * @param string $pkcs12 The certificate store contents, not its file name.
+ * @param array|null $certs On success, this will hold the Certificate Store Data.
+ * @param string $pass Encryption password for unlocking the PKCS#12 file.
+ * @throws OpensslException
+ *
+ */
+function openssl_pkcs12_read(string $pkcs12, ?array &$certs, string $pass): void
+{
+ error_clear_last();
+ $result = \openssl_pkcs12_read($pkcs12, $certs, $pass);
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Decrypts the S/MIME encrypted message contained in the file specified by
+ * infilename using the certificate and its
+ * associated private key specified by recipcert and
+ * recipkey.
+ *
+ * @param string $infilename
+ * @param string $outfilename The decrypted message is written to the file specified by
+ * outfilename.
+ * @param string|resource $recipcert
+ * @param string|resource|array $recipkey
+ * @throws OpensslException
+ *
+ */
+function openssl_pkcs7_decrypt(string $infilename, string $outfilename, $recipcert, $recipkey = null): void
+{
+ error_clear_last();
+ if ($recipkey !== null) {
+ $result = \openssl_pkcs7_decrypt($infilename, $outfilename, $recipcert, $recipkey);
+ } else {
+ $result = \openssl_pkcs7_decrypt($infilename, $outfilename, $recipcert);
+ }
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+}
+
+
+/**
+ * openssl_pkcs7_encrypt takes the contents of the
+ * file named infile and encrypts them using an RC2
+ * 40-bit cipher so that they can only be read by the intended recipients
+ * specified by recipcerts.
+ *
+ * @param string $infile
+ * @param string $outfile
+ * @param string|resource|array $recipcerts Either a lone X.509 certificate, or an array of X.509 certificates.
+ * @param array $headers headers is an array of headers that
+ * will be prepended to the data after it has been encrypted.
+ *
+ * headers can be either an associative array
+ * keyed by header name, or an indexed array, where each element contains
+ * a single header line.
+ * @param int $flags flags can be used to specify options that affect
+ * the encoding process - see PKCS7
+ * constants.
+ * @param int $cipherid One of cipher constants.
+ * @throws OpensslException
+ *
+ */
+function openssl_pkcs7_encrypt(string $infile, string $outfile, $recipcerts, array $headers, int $flags = 0, int $cipherid = OPENSSL_CIPHER_RC2_40): void
+{
+ error_clear_last();
+ $result = \openssl_pkcs7_encrypt($infile, $outfile, $recipcerts, $headers, $flags, $cipherid);
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+}
+
+
+/**
+ *
+ *
+ * @param string $infilename
+ * @param array|null $certs
+ * @throws OpensslException
+ *
+ */
+function openssl_pkcs7_read(string $infilename, ?array &$certs): void
+{
+ error_clear_last();
+ $result = \openssl_pkcs7_read($infilename, $certs);
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+}
+
+
+/**
+ * openssl_pkcs7_sign takes the contents of the file
+ * named infilename and signs them using the
+ * certificate and its matching private key specified by
+ * signcert and privkey
+ * parameters.
+ *
+ * @param string $infilename The input file you are intending to digitally sign.
+ * @param string $outfilename The file which the digital signature will be written to.
+ * @param string|resource $signcert The X.509 certificate used to digitally sign infilename.
+ * See Key/Certificate parameters for a list of valid values.
+ * @param string|resource|array $privkey privkey is the private key corresponding to signcert.
+ * See Public/Private Key parameters for a list of valid values.
+ * @param array $headers headers is an array of headers that
+ * will be prepended to the data after it has been signed (see
+ * openssl_pkcs7_encrypt for more information about
+ * the format of this parameter).
+ * @param int $flags flags can be used to alter the output - see PKCS7 constants.
+ * @param string $extracerts extracerts specifies the name of a file containing
+ * a bunch of extra certificates to include in the signature which can for
+ * example be used to help the recipient to verify the certificate that you used.
+ * @throws OpensslException
+ *
+ */
+function openssl_pkcs7_sign(string $infilename, string $outfilename, $signcert, $privkey, array $headers, int $flags = PKCS7_DETACHED, string $extracerts = null): void
+{
+ error_clear_last();
+ if ($extracerts !== null) {
+ $result = \openssl_pkcs7_sign($infilename, $outfilename, $signcert, $privkey, $headers, $flags, $extracerts);
+ } else {
+ $result = \openssl_pkcs7_sign($infilename, $outfilename, $signcert, $privkey, $headers, $flags);
+ }
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+}
+
+
+/**
+ * openssl_pkey_export_to_file saves an ascii-armoured
+ * (PEM encoded) rendition of key into the file named
+ * by outfilename.
+ *
+ * @param resource|string|array $key
+ * @param string $outfilename Path to the output file.
+ * @param string $passphrase The key can be optionally protected by a
+ * passphrase.
+ * @param array $configargs configargs can be used to fine-tune the export
+ * process by specifying and/or overriding options for the openssl
+ * configuration file. See openssl_csr_new for more
+ * information about configargs.
+ * @throws OpensslException
+ *
+ */
+function openssl_pkey_export_to_file($key, string $outfilename, string $passphrase = null, array $configargs = null): void
+{
+ error_clear_last();
+ if ($configargs !== null) {
+ $result = \openssl_pkey_export_to_file($key, $outfilename, $passphrase, $configargs);
+ } elseif ($passphrase !== null) {
+ $result = \openssl_pkey_export_to_file($key, $outfilename, $passphrase);
+ } else {
+ $result = \openssl_pkey_export_to_file($key, $outfilename);
+ }
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+}
+
+
+/**
+ * openssl_pkey_export exports
+ * key as a PEM encoded string and stores it into
+ * out (which is passed by reference).
+ *
+ * @param resource $key
+ * @param string|null $out
+ * @param string $passphrase The key is optionally protected by passphrase.
+ * @param array $configargs configargs can be used to fine-tune the export
+ * process by specifying and/or overriding options for the openssl
+ * configuration file. See openssl_csr_new for more
+ * information about configargs.
+ * @throws OpensslException
+ *
+ */
+function openssl_pkey_export($key, ?string &$out, string $passphrase = null, array $configargs = null): void
+{
+ error_clear_last();
+ if ($configargs !== null) {
+ $result = \openssl_pkey_export($key, $out, $passphrase, $configargs);
+ } elseif ($passphrase !== null) {
+ $result = \openssl_pkey_export($key, $out, $passphrase);
+ } else {
+ $result = \openssl_pkey_export($key, $out);
+ }
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+}
+
+
+/**
+ * openssl_pkey_get_private parses
+ * key and prepares it for use by other functions.
+ *
+ * @param string $key key can be one of the following:
+ *
+ * a string having the format
+ * file://path/to/file.pem. The named file must
+ * contain a PEM encoded certificate/private key (it may contain both).
+ *
+ *
+ * A PEM formatted private key.
+ *
+ * @param string $passphrase The optional parameter passphrase must be used
+ * if the specified key is encrypted (protected by a passphrase).
+ * @return resource Returns a positive key resource identifier on success.
+ * @throws OpensslException
+ *
+ */
+function openssl_pkey_get_private(string $key, string $passphrase = "")
+{
+ error_clear_last();
+ $result = \openssl_pkey_get_private($key, $passphrase);
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * openssl_pkey_get_public extracts the public key from
+ * certificate and prepares it for use by other
+ * functions.
+ *
+ * @param resource|string $certificate certificate can be one of the following:
+ *
+ * an X.509 certificate resource
+ * a string having the format
+ * file://path/to/file.pem. The named file must
+ * contain a PEM encoded certificate/public key (it may contain both).
+ *
+ *
+ * A PEM formatted public key.
+ *
+ * @return resource Returns a positive key resource identifier on success.
+ * @throws OpensslException
+ *
+ */
+function openssl_pkey_get_public($certificate)
+{
+ error_clear_last();
+ $result = \openssl_pkey_get_public($certificate);
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * openssl_pkey_new generates a new private and public
+ * key pair. The public component of the key can be obtained using
+ * openssl_pkey_get_public.
+ *
+ * @param array $configargs You can finetune the key generation (such as specifying the number of
+ * bits) using configargs. See
+ * openssl_csr_new for more information about
+ * configargs.
+ * @return resource Returns a resource identifier for the pkey on success.
+ * @throws OpensslException
+ *
+ */
+function openssl_pkey_new(array $configargs = null)
+{
+ error_clear_last();
+ if ($configargs !== null) {
+ $result = \openssl_pkey_new($configargs);
+ } else {
+ $result = \openssl_pkey_new();
+ }
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * openssl_private_decrypt decrypts
+ * data that was previously encrypted via
+ * openssl_public_encrypt and stores the result into
+ * decrypted.
+ *
+ * You can use this function e.g. to decrypt data which is supposed to only be available to you.
+ *
+ * @param string $data
+ * @param string|null $decrypted
+ * @param string|resource|array $key key must be the private key corresponding that
+ * was used to encrypt the data.
+ * @param int $padding padding can be one of
+ * OPENSSL_PKCS1_PADDING,
+ * OPENSSL_SSLV23_PADDING,
+ * OPENSSL_PKCS1_OAEP_PADDING,
+ * OPENSSL_NO_PADDING.
+ * @throws OpensslException
+ *
+ */
+function openssl_private_decrypt(string $data, ?string &$decrypted, $key, int $padding = OPENSSL_PKCS1_PADDING): void
+{
+ error_clear_last();
+ $result = \openssl_private_decrypt($data, $decrypted, $key, $padding);
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+}
+
+
+/**
+ * openssl_private_encrypt encrypts data
+ * with private key and stores the result into
+ * crypted. Encrypted data can be decrypted via
+ * openssl_public_decrypt.
+ *
+ * This function can be used e.g. to sign data (or its hash) to prove that it
+ * is not written by someone else.
+ *
+ * @param string $data
+ * @param string|null $crypted
+ * @param string|resource|array $key
+ * @param int $padding padding can be one of
+ * OPENSSL_PKCS1_PADDING,
+ * OPENSSL_NO_PADDING.
+ * @throws OpensslException
+ *
+ */
+function openssl_private_encrypt(string $data, ?string &$crypted, $key, int $padding = OPENSSL_PKCS1_PADDING): void
+{
+ error_clear_last();
+ $result = \openssl_private_encrypt($data, $crypted, $key, $padding);
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+}
+
+
+/**
+ * openssl_public_decrypt decrypts
+ * data that was previous encrypted via
+ * openssl_private_encrypt and stores the result into
+ * decrypted.
+ *
+ * You can use this function e.g. to check if the message was written by the
+ * owner of the private key.
+ *
+ * @param string $data
+ * @param string|null $decrypted
+ * @param string|resource $key key must be the public key corresponding that
+ * was used to encrypt the data.
+ * @param int $padding padding can be one of
+ * OPENSSL_PKCS1_PADDING,
+ * OPENSSL_NO_PADDING.
+ * @throws OpensslException
+ *
+ */
+function openssl_public_decrypt(string $data, ?string &$decrypted, $key, int $padding = OPENSSL_PKCS1_PADDING): void
+{
+ error_clear_last();
+ $result = \openssl_public_decrypt($data, $decrypted, $key, $padding);
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+}
+
+
+/**
+ * openssl_public_encrypt encrypts data
+ * with public key and stores the result into
+ * crypted. Encrypted data can be decrypted via
+ * openssl_private_decrypt.
+ *
+ * This function can be used e.g. to encrypt message which can be then read
+ * only by owner of the private key. It can be also used to store secure data
+ * in database.
+ *
+ * @param string $data
+ * @param string|null $crypted This will hold the result of the encryption.
+ * @param string|resource $key The public key.
+ * @param int $padding padding can be one of
+ * OPENSSL_PKCS1_PADDING,
+ * OPENSSL_SSLV23_PADDING,
+ * OPENSSL_PKCS1_OAEP_PADDING,
+ * OPENSSL_NO_PADDING.
+ * @throws OpensslException
+ *
+ */
+function openssl_public_encrypt(string $data, ?string &$crypted, $key, int $padding = OPENSSL_PKCS1_PADDING): void
+{
+ error_clear_last();
+ $result = \openssl_public_encrypt($data, $crypted, $key, $padding);
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Generates a string of pseudo-random bytes, with the number of bytes
+ * determined by the length parameter.
+ *
+ * It also indicates if a cryptographically strong algorithm was used to produce the
+ * pseudo-random bytes, and does this via the optional crypto_strong
+ * parameter. It's rare for this to be FALSE, but some systems may be broken or old.
+ *
+ * @param int $length The length of the desired string of bytes. Must be a positive integer. PHP will
+ * try to cast this parameter to a non-null integer to use it.
+ * @param bool|null $crypto_strong If passed into the function, this will hold a boolean value that determines
+ * if the algorithm used was "cryptographically strong", e.g., safe for usage with GPG,
+ * passwords, etc. TRUE if it did, otherwise FALSE
+ * @return string Returns the generated string of bytes on success.
+ * @throws OpensslException
+ *
+ */
+function openssl_random_pseudo_bytes(int $length, ?bool &$crypto_strong = null): string
+{
+ error_clear_last();
+ $result = \openssl_random_pseudo_bytes($length, $crypto_strong);
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * openssl_seal seals (encrypts)
+ * data by using the given method with a randomly generated
+ * secret key. The key is encrypted with each of the public keys
+ * associated with the identifiers in pub_key_ids
+ * and each encrypted key is returned
+ * in env_keys. This means that one can send
+ * sealed data to multiple recipients (provided one has obtained their
+ * public keys). Each recipient must receive both the sealed data and
+ * the envelope key that was encrypted with the recipient's public key.
+ *
+ * @param string $data The data to seal.
+ * @param string|null $sealed_data The sealed data.
+ * @param array $env_keys Array of encrypted keys.
+ * @param array $pub_key_ids Array of public key resource identifiers.
+ * @param string $method The cipher method.
+ * @param string $iv The initialization vector.
+ * @return int Returns the length of the sealed data on success.
+ * If successful the sealed data is returned in
+ * sealed_data, and the envelope keys in
+ * env_keys.
+ * @throws OpensslException
+ *
+ */
+function openssl_seal(string $data, ?string &$sealed_data, array &$env_keys, array $pub_key_ids, string $method = "RC4", string &$iv = null): int
+{
+ error_clear_last();
+ $result = \openssl_seal($data, $sealed_data, $env_keys, $pub_key_ids, $method, $iv);
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * openssl_sign computes a signature for the
+ * specified data by generating a cryptographic
+ * digital signature using the private key associated with
+ * priv_key_id. Note that the data itself is
+ * not encrypted.
+ *
+ * @param string $data The string of data you wish to sign
+ * @param string|null $signature If the call was successful the signature is returned in
+ * signature.
+ * @param resource|string $priv_key_id resource - a key, returned by openssl_get_privatekey
+ *
+ * string - a PEM formatted key
+ * @param int|string $signature_alg int - one of these Signature Algorithms.
+ *
+ * string - a valid string returned by openssl_get_md_methods example, "sha256WithRSAEncryption" or "sha384".
+ * @throws OpensslException
+ *
+ */
+function openssl_sign(string $data, ?string &$signature, $priv_key_id, $signature_alg = OPENSSL_ALGO_SHA1): void
+{
+ error_clear_last();
+ $result = \openssl_sign($data, $signature, $priv_key_id, $signature_alg);
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+}
+
+
+/**
+ * openssl_x509_export_to_file stores
+ * x509 into a file named by
+ * outfilename in a PEM encoded format.
+ *
+ * @param string|resource $x509 See Key/Certificate parameters for a list of valid values.
+ * @param string $outfilename Path to the output file.
+ * @param bool $notext
+ * The optional parameter notext affects
+ * the verbosity of the output; if it is FALSE, then additional human-readable
+ * information is included in the output. The default value of
+ * notext is TRUE.
+ * @throws OpensslException
+ *
+ */
+function openssl_x509_export_to_file($x509, string $outfilename, bool $notext = true): void
+{
+ error_clear_last();
+ $result = \openssl_x509_export_to_file($x509, $outfilename, $notext);
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+}
+
+
+/**
+ * openssl_x509_export stores
+ * x509 into a string named by
+ * output in a PEM encoded format.
+ *
+ * @param string|resource $x509 See Key/Certificate parameters for a list of valid values.
+ * @param string|null $output On success, this will hold the PEM.
+ * @param bool $notext
+ * The optional parameter notext affects
+ * the verbosity of the output; if it is FALSE, then additional human-readable
+ * information is included in the output. The default value of
+ * notext is TRUE.
+ * @throws OpensslException
+ *
+ */
+function openssl_x509_export($x509, ?string &$output, bool $notext = true): void
+{
+ error_clear_last();
+ $result = \openssl_x509_export($x509, $output, $notext);
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+}
+
+
+/**
+ * openssl_x509_fingerprint returns the digest of
+ * x509 as a string.
+ *
+ * @param string|resource $x509 See Key/Certificate parameters for a list of valid values.
+ * @param string $hash_algorithm The digest method or hash algorithm to use, e.g. "sha256", one of openssl_get_md_methods.
+ * @param bool $raw_output When set to TRUE, outputs raw binary data. FALSE outputs lowercase hexits.
+ * @return string Returns a string containing the calculated certificate fingerprint as lowercase hexits unless raw_output is set to TRUE in which case the raw binary representation of the message digest is returned.
+ *
+ * Returns FALSE on failure.
+ * @throws OpensslException
+ *
+ */
+function openssl_x509_fingerprint($x509, string $hash_algorithm = "sha1", bool $raw_output = false): string
+{
+ error_clear_last();
+ $result = \openssl_x509_fingerprint($x509, $hash_algorithm, $raw_output);
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * openssl_x509_read parses the certificate supplied by
+ * x509certdata and returns a resource identifier for
+ * it.
+ *
+ * @param string|resource $x509certdata X509 certificate. See Key/Certificate parameters for a list of valid values.
+ * @return resource Returns a resource identifier on success.
+ * @throws OpensslException
+ *
+ */
+function openssl_x509_read($x509certdata)
+{
+ error_clear_last();
+ $result = \openssl_x509_read($x509certdata);
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/outcontrol.php b/vendor/thecodingmachine/safe/generated/outcontrol.php
new file mode 100644
index 000000000..fce7c6dd8
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/outcontrol.php
@@ -0,0 +1,100 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\OutcontrolException;
+
+/**
+ * This function discards the contents of the topmost output buffer and turns
+ * off this output buffering. If you want to further process the buffer's
+ * contents you have to call ob_get_contents before
+ * ob_end_clean as the buffer contents are discarded
+ * when ob_end_clean is called.
+ *
+ * The output buffer must be started by
+ * ob_start with PHP_OUTPUT_HANDLER_CLEANABLE
+ * and PHP_OUTPUT_HANDLER_REMOVABLE
+ * flags. Otherwise ob_end_clean will not work.
+ *
+ * @throws OutcontrolException
+ *
+ */
+function ob_end_clean(): void
+{
+ error_clear_last();
+ $result = \ob_end_clean();
+ if ($result === false) {
+ throw OutcontrolException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function will send the contents of the topmost output buffer (if
+ * any) and turn this output buffer off. If you want to further
+ * process the buffer's contents you have to call
+ * ob_get_contents before
+ * ob_end_flush as the buffer contents are
+ * discarded after ob_end_flush is called.
+ *
+ * The output buffer must be started by
+ * ob_start with PHP_OUTPUT_HANDLER_FLUSHABLE
+ * and PHP_OUTPUT_HANDLER_REMOVABLE
+ * flags. Otherwise ob_end_flush will not work.
+ *
+ * @throws OutcontrolException
+ *
+ */
+function ob_end_flush(): void
+{
+ error_clear_last();
+ $result = \ob_end_flush();
+ if ($result === false) {
+ throw OutcontrolException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function adds another name/value pair to the URL rewrite mechanism.
+ * The name and value will be added to URLs (as GET parameter) and forms
+ * (as hidden input fields) the same way as the session ID when transparent
+ * URL rewriting is enabled with session.use_trans_sid.
+ *
+ * This function's behaviour is controlled by the url_rewriter.tags and
+ * url_rewriter.hosts php.ini
+ * parameters.
+ *
+ * Note that this function can be successfully called at most once per request.
+ *
+ * @param string $name The variable name.
+ * @param string $value The variable value.
+ * @throws OutcontrolException
+ *
+ */
+function output_add_rewrite_var(string $name, string $value): void
+{
+ error_clear_last();
+ $result = \output_add_rewrite_var($name, $value);
+ if ($result === false) {
+ throw OutcontrolException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function resets the URL rewriter and removes all rewrite
+ * variables previously set by the output_add_rewrite_var
+ * function.
+ *
+ * @throws OutcontrolException
+ *
+ */
+function output_reset_rewrite_vars(): void
+{
+ error_clear_last();
+ $result = \output_reset_rewrite_vars();
+ if ($result === false) {
+ throw OutcontrolException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/password.php b/vendor/thecodingmachine/safe/generated/password.php
new file mode 100644
index 000000000..3808e02b9
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/password.php
@@ -0,0 +1,126 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\PasswordException;
+
+/**
+ * password_hash creates a new password hash using a strong one-way hashing
+ * algorithm. password_hash is compatible with crypt.
+ * Therefore, password hashes created by crypt can be used with
+ * password_hash.
+ *
+ *
+ *
+ *
+ * PASSWORD_DEFAULT - Use the bcrypt algorithm (default as of PHP 5.5.0).
+ * Note that this constant is designed to change over time as new and stronger algorithms are added
+ * to PHP. For that reason, the length of the result from using this identifier can change over
+ * time. Therefore, it is recommended to store the result in a database column that can expand
+ * beyond 60 characters (255 characters would be a good choice).
+ *
+ *
+ *
+ *
+ * PASSWORD_BCRYPT - Use the CRYPT_BLOWFISH algorithm to
+ * create the hash. This will produce a standard crypt compatible hash using
+ * the "$2y$" identifier. The result will always be a 60 character string.
+ *
+ *
+ *
+ *
+ * PASSWORD_ARGON2I - Use the Argon2i hashing algorithm to create the hash.
+ * This algorithm is only available if PHP has been compiled with Argon2 support.
+ *
+ *
+ *
+ *
+ * PASSWORD_ARGON2ID - Use the Argon2id hashing algorithm to create the hash.
+ * This algorithm is only available if PHP has been compiled with Argon2 support.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * salt (string) - to manually provide a salt to use when hashing the password.
+ * Note that this will override and prevent a salt from being automatically generated.
+ *
+ *
+ * If omitted, a random salt will be generated by password_hash for
+ * each password hashed. This is the intended mode of operation.
+ *
+ *
+ *
+ * The salt option has been deprecated as of PHP 7.0.0. It is now
+ * preferred to simply use the salt that is generated by default.
+ *
+ *
+ *
+ *
+ *
+ * cost (integer) - which denotes the algorithmic cost that should be used.
+ * Examples of these values can be found on the crypt page.
+ *
+ *
+ * If omitted, a default value of 10 will be used. This is a good
+ * baseline cost, but you may want to consider increasing it depending on your hardware.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * memory_cost (integer) - Maximum memory (in kibibytes) that may
+ * be used to compute the Argon2 hash. Defaults to PASSWORD_ARGON2_DEFAULT_MEMORY_COST.
+ *
+ *
+ *
+ *
+ * time_cost (integer) - Maximum amount of time it may
+ * take to compute the Argon2 hash. Defaults to PASSWORD_ARGON2_DEFAULT_TIME_COST.
+ *
+ *
+ *
+ *
+ * threads (integer) - Number of threads to use for computing
+ * the Argon2 hash. Defaults to PASSWORD_ARGON2_DEFAULT_THREADS.
+ *
+ *
+ *
+ *
+ * @param string $password The user's password.
+ *
+ * Using the PASSWORD_BCRYPT as the
+ * algorithm, will result
+ * in the password parameter being truncated to a
+ * maximum length of 72 characters.
+ * @param int|string|null $algo A password algorithm constant denoting the algorithm to use when hashing the password.
+ * @param array $options An associative array containing options. See the password algorithm constants for documentation on the supported options for each algorithm.
+ *
+ * If omitted, a random salt will be created and the default cost will be
+ * used.
+ * @return string Returns the hashed password.
+ *
+ * The used algorithm, cost and salt are returned as part of the hash. Therefore,
+ * all information that's needed to verify the hash is included in it. This allows
+ * the password_verify function to verify the hash without
+ * needing separate storage for the salt or algorithm information.
+ * @throws PasswordException
+ *
+ */
+function password_hash(string $password, $algo, array $options = null): string
+{
+ error_clear_last();
+ if ($options !== null) {
+ $result = \password_hash($password, $algo, $options);
+ } else {
+ $result = \password_hash($password, $algo);
+ }
+ if ($result === false) {
+ throw PasswordException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/pcntl.php b/vendor/thecodingmachine/safe/generated/pcntl.php
new file mode 100644
index 000000000..1cb721e22
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/pcntl.php
@@ -0,0 +1,166 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\PcntlException;
+
+/**
+ * Executes the program with the given arguments.
+ *
+ * @param string $path path must be the path to a binary executable or a
+ * script with a valid path pointing to an executable in the shebang (
+ * #!/usr/local/bin/perl for example) as the first line. See your system's
+ * man execve(2) page for additional information.
+ * @param array $args args is an array of argument strings passed to the
+ * program.
+ * @param array $envs envs is an array of strings which are passed as
+ * environment to the program. The array is in the format of name =&gt; value,
+ * the key being the name of the environmental variable and the value being
+ * the value of that variable.
+ * @throws PcntlException
+ *
+ */
+function pcntl_exec(string $path, array $args = null, array $envs = null): void
+{
+ error_clear_last();
+ if ($envs !== null) {
+ $result = \pcntl_exec($path, $args, $envs);
+ } elseif ($args !== null) {
+ $result = \pcntl_exec($path, $args);
+ } else {
+ $result = \pcntl_exec($path);
+ }
+ if ($result === false) {
+ throw PcntlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * pcntl_getpriority gets the priority of
+ * pid. Because priority levels can differ between
+ * system types and kernel versions, please see your system's getpriority(2)
+ * man page for specific details.
+ *
+ * @param int $pid If not specified, the pid of the current process is used.
+ * @param int $process_identifier One of PRIO_PGRP, PRIO_USER
+ * or PRIO_PROCESS.
+ * @return int pcntl_getpriority returns the priority of the process. A lower numerical value causes more favorable
+ * scheduling.
+ * @throws PcntlException
+ *
+ */
+function pcntl_getpriority(int $pid = null, int $process_identifier = PRIO_PROCESS): int
+{
+ error_clear_last();
+ if ($process_identifier !== PRIO_PROCESS) {
+ $result = \pcntl_getpriority($pid, $process_identifier);
+ } elseif ($pid !== null) {
+ $result = \pcntl_getpriority($pid);
+ } else {
+ $result = \pcntl_getpriority();
+ }
+ if ($result === false) {
+ throw PcntlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pcntl_setpriority sets the priority of
+ * pid.
+ *
+ * @param int $priority priority is generally a value in the range
+ * -20 to 20. The default priority
+ * is 0 while a lower numerical value causes more
+ * favorable scheduling. Because priority levels can differ between
+ * system types and kernel versions, please see your system's setpriority(2)
+ * man page for specific details.
+ * @param int $pid If not specified, the pid of the current process is used.
+ * @param int $process_identifier One of PRIO_PGRP, PRIO_USER
+ * or PRIO_PROCESS.
+ * @throws PcntlException
+ *
+ */
+function pcntl_setpriority(int $priority, int $pid = null, int $process_identifier = PRIO_PROCESS): void
+{
+ error_clear_last();
+ if ($process_identifier !== PRIO_PROCESS) {
+ $result = \pcntl_setpriority($priority, $pid, $process_identifier);
+ } elseif ($pid !== null) {
+ $result = \pcntl_setpriority($priority, $pid);
+ } else {
+ $result = \pcntl_setpriority($priority);
+ }
+ if ($result === false) {
+ throw PcntlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * The pcntl_signal_dispatch function calls the signal
+ * handlers installed by pcntl_signal for each pending
+ * signal.
+ *
+ * @throws PcntlException
+ *
+ */
+function pcntl_signal_dispatch(): void
+{
+ error_clear_last();
+ $result = \pcntl_signal_dispatch();
+ if ($result === false) {
+ throw PcntlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * The pcntl_sigprocmask function adds, removes or sets blocked
+ * signals, depending on the how parameter.
+ *
+ * @param int $how Sets the behavior of pcntl_sigprocmask. Possible
+ * values:
+ *
+ * SIG_BLOCK: Add the signals to the
+ * currently blocked signals.
+ * SIG_UNBLOCK: Remove the signals from the
+ * currently blocked signals.
+ * SIG_SETMASK: Replace the currently
+ * blocked signals by the given list of signals.
+ *
+ * @param array $set List of signals.
+ * @param array|null $oldset The oldset parameter is set to an array
+ * containing the list of the previously blocked signals.
+ * @throws PcntlException
+ *
+ */
+function pcntl_sigprocmask(int $how, array $set, ?array &$oldset = null): void
+{
+ error_clear_last();
+ $result = \pcntl_sigprocmask($how, $set, $oldset);
+ if ($result === false) {
+ throw PcntlException::createFromPhpError();
+ }
+}
+
+
+/**
+ *
+ *
+ * @param int $errno
+ * @return string Returns error description on success.
+ * @throws PcntlException
+ *
+ */
+function pcntl_strerror(int $errno): string
+{
+ error_clear_last();
+ $result = \pcntl_strerror($errno);
+ if ($result === false) {
+ throw PcntlException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/pcre.php b/vendor/thecodingmachine/safe/generated/pcre.php
new file mode 100644
index 000000000..c40f14cc2
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/pcre.php
@@ -0,0 +1,659 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\PcreException;
+
+/**
+ * Searches subject for all matches to the regular
+ * expression given in pattern and puts them in
+ * matches in the order specified by
+ * flags.
+ *
+ * After the first match is found, the subsequent searches are continued
+ * on from end of the last match.
+ *
+ * @param string $pattern The pattern to search for, as a string.
+ * @param string $subject The input string.
+ * @param array $matches Array of all matches in multi-dimensional array ordered according to
+ * flags.
+ * @param int $flags Can be a combination of the following flags (note that it doesn't make
+ * sense to use PREG_PATTERN_ORDER together with
+ * PREG_SET_ORDER):
+ *
+ *
+ * PREG_PATTERN_ORDER
+ *
+ *
+ * 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.
+ *
+ *
+ *
+ *
+ * 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 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 = PREG_PATTERN_ORDER, int $offset = 0): int
+{
+ error_clear_last();
+ $result = \preg_match_all($pattern, $subject, $matches, $flags, $offset);
+ if ($result === false) {
+ throw PcreException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Searches subject for a match to the regular
+ * expression given in pattern.
+ *
+ * @param string $pattern The pattern to search for, as a string.
+ * @param string $subject The input string.
+ * @param array $matches If matches is provided, then it is filled with
+ * the results of search. $matches[0] will contain the
+ * text that matched the full pattern, $matches[1]
+ * will have the text that matched the first captured parenthesized
+ * subpattern, and so on.
+ * @param int $flags flags can be a combination of the following flags:
+ *
+ *
+ * PREG_OFFSET_CAPTURE
+ *
+ *
+ * If this flag is passed, for every occurring match the appendant string
+ * offset (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, array &$matches = null, int $flags = 0, int $offset = 0): int
+{
+ error_clear_last();
+ $result = \preg_match($pattern, $subject, $matches, $flags, $offset);
+ if ($result === false) {
+ throw PcreException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Split the given string by a regular expression.
+ *
+ * @param string $pattern The pattern to search for, as a string.
+ * @param string $subject The input string.
+ * @param int|null $limit If specified, then only substrings up to limit
+ * are returned with the rest of the string being placed in the last
+ * substring. A limit of -1 or 0 means "no limit".
+ * @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();
+ $result = \preg_split($pattern, $subject, $limit, $flags);
+ if ($result === false) {
+ throw PcreException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/pdf.php b/vendor/thecodingmachine/safe/generated/pdf.php
new file mode 100644
index 000000000..d039b27a9
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/pdf.php
@@ -0,0 +1,1553 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\PdfException;
+
+/**
+ * Activates a previously created structure element or other content item.
+ * Returns TRUE on success.
+ *
+ * @param resource $pdfdoc
+ * @param int $id
+ * @throws PdfException
+ *
+ */
+function PDF_activate_item($pdfdoc, int $id): void
+{
+ error_clear_last();
+ $result = \PDF_activate_item($pdfdoc, $id);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Add a link annotation to a target within the current PDF file.
+ * Returns TRUE on success.
+ *
+ * This function is deprecated since PDFlib version 6, use
+ * PDF_create_action with type=GoTo
+ * and PDF_create_annotation with
+ * type=Link instead.
+ *
+ * @param resource $pdfdoc
+ * @param float $lowerleftx
+ * @param float $lowerlefty
+ * @param float $upperrightx
+ * @param float $upperrighty
+ * @param int $page
+ * @param string $dest
+ * @throws PdfException
+ *
+ */
+function PDF_add_locallink($pdfdoc, float $lowerleftx, float $lowerlefty, float $upperrightx, float $upperrighty, int $page, string $dest): void
+{
+ error_clear_last();
+ $result = \PDF_add_locallink($pdfdoc, $lowerleftx, $lowerlefty, $upperrightx, $upperrighty, $page, $dest);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Creates a named destination on an arbitrary page in the current document.
+ * Returns TRUE on success.
+ *
+ * @param resource $pdfdoc
+ * @param string $name
+ * @param string $optlist
+ * @throws PdfException
+ *
+ */
+function PDF_add_nameddest($pdfdoc, string $name, string $optlist): void
+{
+ error_clear_last();
+ $result = \PDF_add_nameddest($pdfdoc, $name, $optlist);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets an annotation for the current page. Returns TRUE on success.
+ *
+ * This function is deprecated since PDFlib version 6, use
+ * PDF_create_annotation with
+ * type=Text instead.
+ *
+ * @param resource $pdfdoc
+ * @param float $llx
+ * @param float $lly
+ * @param float $urx
+ * @param float $ury
+ * @param string $contents
+ * @param string $title
+ * @param string $icon
+ * @param int $open
+ * @throws PdfException
+ *
+ */
+function PDF_add_note($pdfdoc, float $llx, float $lly, float $urx, float $ury, string $contents, string $title, string $icon, int $open): void
+{
+ error_clear_last();
+ $result = \PDF_add_note($pdfdoc, $llx, $lly, $urx, $ury, $contents, $title, $icon, $open);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Add a file link annotation to a PDF target.
+ * Returns TRUE on success.
+ *
+ * This function is deprecated since PDFlib version 6, use
+ * PDF_create_action with
+ * type=GoToR and
+ * PDF_create_annotation with
+ * type=Link instead.
+ *
+ * @param resource $pdfdoc
+ * @param float $bottom_left_x
+ * @param float $bottom_left_y
+ * @param float $up_right_x
+ * @param float $up_right_y
+ * @param string $filename
+ * @param int $page
+ * @param string $dest
+ * @throws PdfException
+ *
+ */
+function PDF_add_pdflink($pdfdoc, float $bottom_left_x, float $bottom_left_y, float $up_right_x, float $up_right_y, string $filename, int $page, string $dest): void
+{
+ error_clear_last();
+ $result = \PDF_add_pdflink($pdfdoc, $bottom_left_x, $bottom_left_y, $up_right_x, $up_right_y, $filename, $page, $dest);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Adds an existing image as thumbnail for the current page.
+ * Returns TRUE on success.
+ *
+ * @param resource $pdfdoc
+ * @param int $image
+ * @throws PdfException
+ *
+ */
+function PDF_add_thumbnail($pdfdoc, int $image): void
+{
+ error_clear_last();
+ $result = \PDF_add_thumbnail($pdfdoc, $image);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Adds a weblink annotation to a target url on the Web.
+ * Returns TRUE on success.
+ *
+ * This function is deprecated since PDFlib version 6, use
+ * PDF_create_action with type=URI
+ * and PDF_create_annotation with
+ * type=Link instead.
+ *
+ * @param resource $pdfdoc
+ * @param float $lowerleftx
+ * @param float $lowerlefty
+ * @param float $upperrightx
+ * @param float $upperrighty
+ * @param string $url
+ * @throws PdfException
+ *
+ */
+function PDF_add_weblink($pdfdoc, float $lowerleftx, float $lowerlefty, float $upperrightx, float $upperrighty, string $url): void
+{
+ error_clear_last();
+ $result = \PDF_add_weblink($pdfdoc, $lowerleftx, $lowerlefty, $upperrightx, $upperrighty, $url);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Adds a file attachment annotation. Returns TRUE on success.
+ *
+ * This function is deprecated since PDFlib version 6, use
+ * PDF_create_annotation with
+ * type=FileAttachment instead.
+ *
+ * @param resource $pdfdoc
+ * @param float $llx
+ * @param float $lly
+ * @param float $urx
+ * @param float $ury
+ * @param string $filename
+ * @param string $description
+ * @param string $author
+ * @param string $mimetype
+ * @param string $icon
+ * @throws PdfException
+ *
+ */
+function PDF_attach_file($pdfdoc, float $llx, float $lly, float $urx, float $ury, string $filename, string $description, string $author, string $mimetype, string $icon): void
+{
+ error_clear_last();
+ $result = \PDF_attach_file($pdfdoc, $llx, $lly, $urx, $ury, $filename, $description, $author, $mimetype, $icon);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Starts a layer for subsequent output on the page. Returns TRUE on success.
+ *
+ * This function requires PDF 1.5.
+ *
+ * @param resource $pdfdoc
+ * @param int $layer
+ * @throws PdfException
+ *
+ */
+function PDF_begin_layer($pdfdoc, int $layer): void
+{
+ error_clear_last();
+ $result = \PDF_begin_layer($pdfdoc, $layer);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Adds a new page to the document, and specifies various options.
+ * The parameters width and height
+ * are the dimensions of the new page in points. Returns TRUE on success.
+ *
+ *
+ * Common Page Sizes in Points
+ *
+ *
+ *
+ * name
+ * size
+ *
+ *
+ *
+ *
+ * A0
+ * 2380 x 3368
+ *
+ *
+ * A1
+ * 1684 x 2380
+ *
+ *
+ * A2
+ * 1190 x 1684
+ *
+ *
+ * A3
+ * 842 x 1190
+ *
+ *
+ * A4
+ * 595 x 842
+ *
+ *
+ * A5
+ * 421 x 595
+ *
+ *
+ * A6
+ * 297 x 421
+ *
+ *
+ * B5
+ * 501 x 709
+ *
+ *
+ * letter (8.5" x 11")
+ * 612 x 792
+ *
+ *
+ * legal (8.5" x 14")
+ * 612 x 1008
+ *
+ *
+ * ledger (17" x 11")
+ * 1224 x 792
+ *
+ *
+ * 11" x 17"
+ * 792 x 1224
+ *
+ *
+ *
+ *
+ *
+ * @param resource $pdfdoc
+ * @param float $width
+ * @param float $height
+ * @param string $optlist
+ * @throws PdfException
+ *
+ */
+function PDF_begin_page_ext($pdfdoc, float $width, float $height, string $optlist): void
+{
+ error_clear_last();
+ $result = \PDF_begin_page_ext($pdfdoc, $width, $height, $optlist);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Adds a new page to the document. Returns TRUE on success.
+ *
+ * This function is deprecated since PDFlib version 6, use
+ * PDF_begin_page_ext instead.
+ *
+ * @param resource $pdfdoc
+ * @param float $width
+ * @param float $height
+ * @throws PdfException
+ *
+ */
+function PDF_begin_page($pdfdoc, float $width, float $height): void
+{
+ error_clear_last();
+ $result = \PDF_begin_page($pdfdoc, $width, $height);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Adds a circle. Returns TRUE on success.
+ *
+ * @param resource $pdfdoc
+ * @param float $x
+ * @param float $y
+ * @param float $r
+ * @throws PdfException
+ *
+ */
+function PDF_circle($pdfdoc, float $x, float $y, float $r): void
+{
+ error_clear_last();
+ $result = \PDF_circle($pdfdoc, $x, $y, $r);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Uses the current path as clipping path, and terminate the path. Returns TRUE on success.
+ *
+ * @param resource $p
+ * @throws PdfException
+ *
+ */
+function PDF_clip($p): void
+{
+ error_clear_last();
+ $result = \PDF_clip($p);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Closes the page handle, and frees all page-related resources. Returns TRUE on success.
+ *
+ * @param resource $p
+ * @param int $page
+ * @throws PdfException
+ *
+ */
+function PDF_close_pdi_page($p, int $page): void
+{
+ error_clear_last();
+ $result = \PDF_close_pdi_page($p, $page);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Closes all open page handles, and closes the input PDF document. Returns TRUE on success.
+ *
+ * This function is deprecated since PDFlib version 7,
+ * use PDF_close_pdi_document instead.
+ *
+ * @param resource $p
+ * @param int $doc
+ * @throws PdfException
+ *
+ */
+function PDF_close_pdi($p, int $doc): void
+{
+ error_clear_last();
+ $result = \PDF_close_pdi($p, $doc);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Closes the generated PDF file, and frees all document-related resources.
+ * Returns TRUE on success.
+ *
+ * This function is deprecated since PDFlib version 6, use
+ * PDF_end_document instead.
+ *
+ * @param resource $p
+ * @throws PdfException
+ *
+ */
+function PDF_close($p): void
+{
+ error_clear_last();
+ $result = \PDF_close($p);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Closes the path, fills, and strokes it. Returns TRUE on success.
+ *
+ * @param resource $p
+ * @throws PdfException
+ *
+ */
+function PDF_closepath_fill_stroke($p): void
+{
+ error_clear_last();
+ $result = \PDF_closepath_fill_stroke($p);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Closes the path, and strokes it. Returns TRUE on success.
+ *
+ * @param resource $p
+ * @throws PdfException
+ *
+ */
+function PDF_closepath_stroke($p): void
+{
+ error_clear_last();
+ $result = \PDF_closepath_stroke($p);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Closes the current path. Returns TRUE on success.
+ *
+ * @param resource $p
+ * @throws PdfException
+ *
+ */
+function PDF_closepath($p): void
+{
+ error_clear_last();
+ $result = \PDF_closepath($p);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Concatenates a matrix to the current transformation matrix (CTM). Returns TRUE on success.
+ *
+ * @param resource $p
+ * @param float $a
+ * @param float $b
+ * @param float $c
+ * @param float $d
+ * @param float $e
+ * @param float $f
+ * @throws PdfException
+ *
+ */
+function PDF_concat($p, float $a, float $b, float $c, float $d, float $e, float $f): void
+{
+ error_clear_last();
+ $result = \PDF_concat($p, $a, $b, $c, $d, $e, $f);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Prints text at the next line. Returns TRUE on success.
+ *
+ * @param resource $p
+ * @param string $text
+ * @throws PdfException
+ *
+ */
+function PDF_continue_text($p, string $text): void
+{
+ error_clear_last();
+ $result = \PDF_continue_text($p, $text);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Draws a Bezier curve from the current point, using 3 more control points.
+ * Returns TRUE on success.
+ *
+ * @param resource $p
+ * @param float $x1
+ * @param float $y1
+ * @param float $x2
+ * @param float $y2
+ * @param float $x3
+ * @param float $y3
+ * @throws PdfException
+ *
+ */
+function PDF_curveto($p, float $x1, float $y1, float $x2, float $y2, float $x3, float $y3): void
+{
+ error_clear_last();
+ $result = \PDF_curveto($p, $x1, $y1, $x2, $y2, $x3, $y3);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Deletes a PDFlib object, and frees all internal resources. Returns TRUE on success.
+ *
+ * @param resource $pdfdoc
+ * @throws PdfException
+ *
+ */
+function PDF_delete($pdfdoc): void
+{
+ error_clear_last();
+ $result = \PDF_delete($pdfdoc);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Deactivates all active layers. Returns TRUE on success.
+ *
+ * This function requires PDF 1.5.
+ *
+ * @param resource $pdfdoc
+ * @throws PdfException
+ *
+ */
+function PDF_end_layer($pdfdoc): void
+{
+ error_clear_last();
+ $result = \PDF_end_layer($pdfdoc);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Finishes a page, and applies various options. Returns TRUE on success.
+ *
+ * @param resource $pdfdoc
+ * @param string $optlist
+ * @throws PdfException
+ *
+ */
+function PDF_end_page_ext($pdfdoc, string $optlist): void
+{
+ error_clear_last();
+ $result = \PDF_end_page_ext($pdfdoc, $optlist);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Finishes the page. Returns TRUE on success.
+ *
+ * @param resource $p
+ * @throws PdfException
+ *
+ */
+function PDF_end_page($p): void
+{
+ error_clear_last();
+ $result = \PDF_end_page($p);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Finishes the pattern definition. Returns TRUE on success.
+ *
+ * @param resource $p
+ * @throws PdfException
+ *
+ */
+function PDF_end_pattern($p): void
+{
+ error_clear_last();
+ $result = \PDF_end_pattern($p);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Finishes a template definition. Returns TRUE on success.
+ *
+ * @param resource $p
+ * @throws PdfException
+ *
+ */
+function PDF_end_template($p): void
+{
+ error_clear_last();
+ $result = \PDF_end_template($p);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Fills and strokes the current path with the current fill and stroke color.
+ * Returns TRUE on success.
+ *
+ * @param resource $p
+ * @throws PdfException
+ *
+ */
+function PDF_fill_stroke($p): void
+{
+ error_clear_last();
+ $result = \PDF_fill_stroke($p);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Fills the interior of the current path with the current fill color.
+ * Returns TRUE on success.
+ *
+ * @param resource $p
+ * @throws PdfException
+ *
+ */
+function PDF_fill($p): void
+{
+ error_clear_last();
+ $result = \PDF_fill($p);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Places an image or template on the page, subject to various options.
+ * Returns TRUE on success.
+ *
+ * @param resource $pdfdoc
+ * @param int $image
+ * @param float $x
+ * @param float $y
+ * @param string $optlist
+ * @throws PdfException
+ *
+ */
+function PDF_fit_image($pdfdoc, int $image, float $x, float $y, string $optlist): void
+{
+ error_clear_last();
+ $result = \PDF_fit_image($pdfdoc, $image, $x, $y, $optlist);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Places an imported PDF page on the page, subject to various options.
+ * Returns TRUE on success.
+ *
+ * @param resource $pdfdoc
+ * @param int $page
+ * @param float $x
+ * @param float $y
+ * @param string $optlist
+ * @throws PdfException
+ *
+ */
+function PDF_fit_pdi_page($pdfdoc, int $page, float $x, float $y, string $optlist): void
+{
+ error_clear_last();
+ $result = \PDF_fit_pdi_page($pdfdoc, $page, $x, $y, $optlist);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Places a single line of text on the page, subject to various options. Returns TRUE on success.
+ *
+ * @param resource $pdfdoc
+ * @param string $text
+ * @param float $x
+ * @param float $y
+ * @param string $optlist
+ * @throws PdfException
+ *
+ */
+function PDF_fit_textline($pdfdoc, string $text, float $x, float $y, string $optlist): void
+{
+ error_clear_last();
+ $result = \PDF_fit_textline($pdfdoc, $text, $x, $y, $optlist);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Reset all color and graphics state parameters to their defaults.
+ * Returns TRUE on success.
+ *
+ * @param resource $p
+ * @throws PdfException
+ *
+ */
+function PDF_initgraphics($p): void
+{
+ error_clear_last();
+ $result = \PDF_initgraphics($p);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Draws a line from the current point to another point. Returns TRUE on success.
+ *
+ * @param resource $p
+ * @param float $x
+ * @param float $y
+ * @throws PdfException
+ *
+ */
+function PDF_lineto($p, float $x, float $y): void
+{
+ error_clear_last();
+ $result = \PDF_lineto($p, $x, $y);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Finds a built-in spot color name, or makes a named spot color from the
+ * current fill color. Returns TRUE on success.
+ *
+ * @param resource $p
+ * @param string $spotname
+ * @return int
+ * @throws PdfException
+ *
+ */
+function PDF_makespotcolor($p, string $spotname): int
+{
+ error_clear_last();
+ $result = \PDF_makespotcolor($p, $spotname);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Sets the current point for graphics output. Returns TRUE on success.
+ *
+ * @param resource $p
+ * @param float $x
+ * @param float $y
+ * @throws PdfException
+ *
+ */
+function PDF_moveto($p, float $x, float $y): void
+{
+ error_clear_last();
+ $result = \PDF_moveto($p, $x, $y);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Creates a new PDF file using the supplied file name.
+ * Returns TRUE on success.
+ *
+ * This function is deprecated since PDFlib version 6, use
+ * PDF_begin_document instead.
+ *
+ * @param resource $p
+ * @param string $filename
+ * @throws PdfException
+ *
+ */
+function PDF_open_file($p, string $filename): void
+{
+ error_clear_last();
+ $result = \PDF_open_file($p, $filename);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Places an image and scales it. Returns TRUE on success.
+ *
+ * This function is deprecated since PDFlib version 5, use
+ * PDF_fit_image instead.
+ *
+ * @param resource $pdfdoc
+ * @param int $image
+ * @param float $x
+ * @param float $y
+ * @param float $scale
+ * @throws PdfException
+ *
+ */
+function PDF_place_image($pdfdoc, int $image, float $x, float $y, float $scale): void
+{
+ error_clear_last();
+ $result = \PDF_place_image($pdfdoc, $image, $x, $y, $scale);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Places a PDF page and scales it. Returns TRUE on success.
+ *
+ * This function is deprecated since PDFlib version 5, use
+ * PDF_fit_pdi_page instead.
+ *
+ * @param resource $pdfdoc
+ * @param int $page
+ * @param float $x
+ * @param float $y
+ * @param float $sx
+ * @param float $sy
+ * @throws PdfException
+ *
+ */
+function PDF_place_pdi_page($pdfdoc, int $page, float $x, float $y, float $sx, float $sy): void
+{
+ error_clear_last();
+ $result = \PDF_place_pdi_page($pdfdoc, $page, $x, $y, $sx, $sy);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Draws a rectangle. Returns TRUE on success.
+ *
+ * @param resource $p
+ * @param float $x
+ * @param float $y
+ * @param float $width
+ * @param float $height
+ * @throws PdfException
+ *
+ */
+function PDF_rect($p, float $x, float $y, float $width, float $height): void
+{
+ error_clear_last();
+ $result = \PDF_rect($p, $x, $y, $width, $height);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Restores the most recently saved graphics state. Returns TRUE on success.
+ *
+ * @param resource $p
+ * @throws PdfException
+ *
+ */
+function PDF_restore($p): void
+{
+ error_clear_last();
+ $result = \PDF_restore($p);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Rotates the coordinate system. Returns TRUE on success.
+ *
+ * @param resource $p
+ * @param float $phi
+ * @throws PdfException
+ *
+ */
+function PDF_rotate($p, float $phi): void
+{
+ error_clear_last();
+ $result = \PDF_rotate($p, $phi);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Saves the current graphics state. Returns TRUE on success.
+ *
+ * @param resource $p
+ * @throws PdfException
+ *
+ */
+function PDF_save($p): void
+{
+ error_clear_last();
+ $result = \PDF_save($p);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Scales the coordinate system. Returns TRUE on success.
+ *
+ * @param resource $p
+ * @param float $sx
+ * @param float $sy
+ * @throws PdfException
+ *
+ */
+function PDF_scale($p, float $sx, float $sy): void
+{
+ error_clear_last();
+ $result = \PDF_scale($p, $sx, $sy);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the border color for all kinds of annotations. Returns TRUE on success.
+ *
+ * This function is deprecated since PDFlib version 6, use
+ * the option annotcolor in
+ * PDF_create_annotation instead.
+ *
+ * @param resource $p
+ * @param float $red
+ * @param float $green
+ * @param float $blue
+ * @throws PdfException
+ *
+ */
+function PDF_set_border_color($p, float $red, float $green, float $blue): void
+{
+ error_clear_last();
+ $result = \PDF_set_border_color($p, $red, $green, $blue);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the border dash style for all kinds of annotations. Returns TRUE on success.
+ *
+ * This function is deprecated since PDFlib version 6, use
+ * the option dasharray in
+ * PDF_create_annotation instead.
+ *
+ * @param resource $pdfdoc
+ * @param float $black
+ * @param float $white
+ * @throws PdfException
+ *
+ */
+function PDF_set_border_dash($pdfdoc, float $black, float $white): void
+{
+ error_clear_last();
+ $result = \PDF_set_border_dash($pdfdoc, $black, $white);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the border style for all kinds of annotations. Returns TRUE on success.
+ *
+ * This function is deprecated since PDFlib version 6, use
+ * the options borderstyle and
+ * linewidth in
+ * PDF_create_annotation instead.
+ *
+ * @param resource $pdfdoc
+ * @param string $style
+ * @param float $width
+ * @throws PdfException
+ *
+ */
+function PDF_set_border_style($pdfdoc, string $style, float $width): void
+{
+ error_clear_last();
+ $result = \PDF_set_border_style($pdfdoc, $style, $width);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Fill document information field key with
+ * value. Returns TRUE on success.
+ *
+ * @param resource $p
+ * @param string $key
+ * @param string $value
+ * @throws PdfException
+ *
+ */
+function PDF_set_info($p, string $key, string $value): void
+{
+ error_clear_last();
+ $result = \PDF_set_info($p, $key, $value);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Defines hierarchical and group relationships among layers. Returns TRUE on success.
+ *
+ * This function requires PDF 1.5.
+ *
+ * @param resource $pdfdoc
+ * @param string $type
+ * @param string $optlist
+ * @throws PdfException
+ *
+ */
+function PDF_set_layer_dependency($pdfdoc, string $type, string $optlist): void
+{
+ error_clear_last();
+ $result = \PDF_set_layer_dependency($pdfdoc, $type, $optlist);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets some PDFlib parameter with string type. Returns TRUE on success.
+ *
+ * @param resource $p
+ * @param string $key
+ * @param string $value
+ * @throws PdfException
+ *
+ */
+function PDF_set_parameter($p, string $key, string $value): void
+{
+ error_clear_last();
+ $result = \PDF_set_parameter($p, $key, $value);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the position for text output on the page. Returns TRUE on success.
+ *
+ * @param resource $p
+ * @param float $x
+ * @param float $y
+ * @throws PdfException
+ *
+ */
+function PDF_set_text_pos($p, float $x, float $y): void
+{
+ error_clear_last();
+ $result = \PDF_set_text_pos($p, $x, $y);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the value of some PDFlib parameter with numerical type. Returns TRUE on success.
+ *
+ * @param resource $p
+ * @param string $key
+ * @param float $value
+ * @throws PdfException
+ *
+ */
+function PDF_set_value($p, string $key, float $value): void
+{
+ error_clear_last();
+ $result = \PDF_set_value($p, $key, $value);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the current color space and color. Returns TRUE on success.
+ *
+ * @param resource $p
+ * @param string $fstype
+ * @param string $colorspace
+ * @param float $c1
+ * @param float $c2
+ * @param float $c3
+ * @param float $c4
+ * @throws PdfException
+ *
+ */
+function PDF_setcolor($p, string $fstype, string $colorspace, float $c1, float $c2, float $c3, float $c4): void
+{
+ error_clear_last();
+ $result = \PDF_setcolor($p, $fstype, $colorspace, $c1, $c2, $c3, $c4);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the current dash pattern to b black
+ * and w white units. Returns TRUE on success.
+ *
+ * @param resource $pdfdoc
+ * @param float $b
+ * @param float $w
+ * @throws PdfException
+ *
+ */
+function PDF_setdash($pdfdoc, float $b, float $w): void
+{
+ error_clear_last();
+ $result = \PDF_setdash($pdfdoc, $b, $w);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets a dash pattern defined by an option list. Returns TRUE on success.
+ *
+ * @param resource $pdfdoc
+ * @param string $optlist
+ * @throws PdfException
+ *
+ */
+function PDF_setdashpattern($pdfdoc, string $optlist): void
+{
+ error_clear_last();
+ $result = \PDF_setdashpattern($pdfdoc, $optlist);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the flatness parameter. Returns TRUE on success.
+ *
+ * @param resource $pdfdoc
+ * @param float $flatness
+ * @throws PdfException
+ *
+ */
+function PDF_setflat($pdfdoc, float $flatness): void
+{
+ error_clear_last();
+ $result = \PDF_setflat($pdfdoc, $flatness);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the current font in the specified fontsize, using a
+ * font handle returned by PDF_load_font.
+ * Returns TRUE on success.
+ *
+ * @param resource $pdfdoc
+ * @param int $font
+ * @param float $fontsize
+ * @throws PdfException
+ *
+ */
+function PDF_setfont($pdfdoc, int $font, float $fontsize): void
+{
+ error_clear_last();
+ $result = \PDF_setfont($pdfdoc, $font, $fontsize);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the current fill color to a gray value between 0 and 1 inclusive.
+ * Returns TRUE on success.
+ *
+ * This function is deprecated since PDFlib version 4, use
+ * PDF_setcolor instead.
+ *
+ * @param resource $p
+ * @param float $g
+ * @throws PdfException
+ *
+ */
+function PDF_setgray_fill($p, float $g): void
+{
+ error_clear_last();
+ $result = \PDF_setgray_fill($p, $g);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the current stroke color to a gray value between 0 and 1 inclusive.
+ * Returns TRUE on success.
+ *
+ * This function is deprecated since PDFlib version 4, use
+ * PDF_setcolor instead.
+ *
+ * @param resource $p
+ * @param float $g
+ * @throws PdfException
+ *
+ */
+function PDF_setgray_stroke($p, float $g): void
+{
+ error_clear_last();
+ $result = \PDF_setgray_stroke($p, $g);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the current fill and stroke color to a gray value between 0 and 1 inclusive. Returns TRUE on success.
+ *
+ * This function is deprecated since PDFlib version 4, use
+ * PDF_setcolor instead.
+ *
+ * @param resource $p
+ * @param float $g
+ * @throws PdfException
+ *
+ */
+function PDF_setgray($p, float $g): void
+{
+ error_clear_last();
+ $result = \PDF_setgray($p, $g);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the linejoin parameter to specify the shape
+ * at the corners of paths that are stroked. Returns TRUE on success.
+ *
+ * @param resource $p
+ * @param int $value
+ * @throws PdfException
+ *
+ */
+function PDF_setlinejoin($p, int $value): void
+{
+ error_clear_last();
+ $result = \PDF_setlinejoin($p, $value);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the current line width. Returns TRUE on success.
+ *
+ * @param resource $p
+ * @param float $width
+ * @throws PdfException
+ *
+ */
+function PDF_setlinewidth($p, float $width): void
+{
+ error_clear_last();
+ $result = \PDF_setlinewidth($p, $width);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Explicitly sets the current transformation matrix. Returns TRUE on success.
+ *
+ * @param resource $p
+ * @param float $a
+ * @param float $b
+ * @param float $c
+ * @param float $d
+ * @param float $e
+ * @param float $f
+ * @throws PdfException
+ *
+ */
+function PDF_setmatrix($p, float $a, float $b, float $c, float $d, float $e, float $f): void
+{
+ error_clear_last();
+ $result = \PDF_setmatrix($p, $a, $b, $c, $d, $e, $f);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the miter limit.Returns TRUE on success.
+ *
+ * @param resource $pdfdoc
+ * @param float $miter
+ * @throws PdfException
+ *
+ */
+function PDF_setmiterlimit($pdfdoc, float $miter): void
+{
+ error_clear_last();
+ $result = \PDF_setmiterlimit($pdfdoc, $miter);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the current fill color to the supplied RGB values. Returns TRUE on success.
+ *
+ * This function is deprecated since PDFlib version 4, use
+ * PDF_setcolor instead.
+ *
+ * @param resource $p
+ * @param float $red
+ * @param float $green
+ * @param float $blue
+ * @throws PdfException
+ *
+ */
+function PDF_setrgbcolor_fill($p, float $red, float $green, float $blue): void
+{
+ error_clear_last();
+ $result = \PDF_setrgbcolor_fill($p, $red, $green, $blue);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the current stroke color to the supplied RGB values. Returns TRUE on success.
+ *
+ * This function is deprecated since PDFlib version 4, use
+ * PDF_setcolor instead.
+ *
+ * @param resource $p
+ * @param float $red
+ * @param float $green
+ * @param float $blue
+ * @throws PdfException
+ *
+ */
+function PDF_setrgbcolor_stroke($p, float $red, float $green, float $blue): void
+{
+ error_clear_last();
+ $result = \PDF_setrgbcolor_stroke($p, $red, $green, $blue);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the current fill and stroke color to the supplied RGB values.
+ * Returns TRUE on success.
+ *
+ * This function is deprecated since PDFlib version 4, use
+ * PDF_setcolor instead.
+ *
+ * @param resource $p
+ * @param float $red
+ * @param float $green
+ * @param float $blue
+ * @throws PdfException
+ *
+ */
+function PDF_setrgbcolor($p, float $red, float $green, float $blue): void
+{
+ error_clear_last();
+ $result = \PDF_setrgbcolor($p, $red, $green, $blue);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Prints text in the current font. Returns TRUE on success.
+ *
+ * @param resource $p
+ * @param string $text
+ * @param float $x
+ * @param float $y
+ * @throws PdfException
+ *
+ */
+function PDF_show_xy($p, string $text, float $x, float $y): void
+{
+ error_clear_last();
+ $result = \PDF_show_xy($p, $text, $x, $y);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Prints text in the current font and size at
+ * the current position. Returns TRUE on success.
+ *
+ * @param resource $pdfdoc
+ * @param string $text
+ * @throws PdfException
+ *
+ */
+function PDF_show($pdfdoc, string $text): void
+{
+ error_clear_last();
+ $result = \PDF_show($pdfdoc, $text);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Skews the coordinate system in x and y direction by alpha
+ * and beta degrees, respectively. Returns TRUE on success.
+ *
+ * @param resource $p
+ * @param float $alpha
+ * @param float $beta
+ * @throws PdfException
+ *
+ */
+function PDF_skew($p, float $alpha, float $beta): void
+{
+ error_clear_last();
+ $result = \PDF_skew($p, $alpha, $beta);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Strokes the path with the current color and line width, and clear it.
+ * Returns TRUE on success.
+ *
+ * @param resource $p
+ * @throws PdfException
+ *
+ */
+function PDF_stroke($p): void
+{
+ error_clear_last();
+ $result = \PDF_stroke($p);
+ if ($result === false) {
+ throw PdfException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/pgsql.php b/vendor/thecodingmachine/safe/generated/pgsql.php
new file mode 100644
index 000000000..007faacbb
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/pgsql.php
@@ -0,0 +1,1878 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\PgsqlException;
+
+/**
+ * pg_cancel_query cancels an asynchronous query sent with
+ * pg_send_query, pg_send_query_params
+ * or pg_send_execute. You cannot cancel a query executed using
+ * pg_query.
+ *
+ * @param resource $connection PostgreSQL database connection resource.
+ * @throws PgsqlException
+ *
+ */
+function pg_cancel_query($connection): void
+{
+ error_clear_last();
+ $result = \pg_cancel_query($connection);
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * PostgreSQL supports automatic character set conversion between
+ * server and client for certain character sets.
+ * pg_client_encoding returns the client
+ * encoding as a string. The returned string will be one of the
+ * standard PostgreSQL encoding identifiers.
+ *
+ * @param resource $connection PostgreSQL database connection resource. When
+ * connection is not present, the default connection
+ * is used. The default connection is the last connection made by
+ * pg_connect or pg_pconnect.
+ * @return string The client encoding.
+ * @throws PgsqlException
+ *
+ */
+function pg_client_encoding($connection = null): string
+{
+ error_clear_last();
+ if ($connection !== null) {
+ $result = \pg_client_encoding($connection);
+ } else {
+ $result = \pg_client_encoding();
+ }
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_close closes the non-persistent
+ * connection to a PostgreSQL database associated with the given
+ * connection resource.
+ *
+ * If there is open large object resource on the connection, do not
+ * close the connection before closing all large object resources.
+ *
+ * @param resource $connection PostgreSQL database connection resource. When
+ * connection is not present, the default connection
+ * is used. The default connection is the last connection made by
+ * pg_connect or pg_pconnect.
+ * @throws PgsqlException
+ *
+ */
+function pg_close($connection = null): void
+{
+ error_clear_last();
+ if ($connection !== null) {
+ $result = \pg_close($connection);
+ } else {
+ $result = \pg_close();
+ }
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * pg_connect opens a connection to a
+ * PostgreSQL database specified by the
+ * connection_string.
+ *
+ * If a second call is made to pg_connect with
+ * the same connection_string as an existing connection, the
+ * existing connection will be returned unless you pass
+ * PGSQL_CONNECT_FORCE_NEW as
+ * connect_type.
+ *
+ * The old syntax with multiple parameters
+ * $conn = pg_connect("host", "port", "options", "tty", "dbname")
+ * has been deprecated.
+ *
+ * @param string $connection_string The connection_string can be empty to use all default parameters, or it
+ * can contain one or more parameter settings separated by whitespace.
+ * Each parameter setting is in the form keyword = value. Spaces around
+ * the equal sign are optional. To write an empty value or a value
+ * containing spaces, surround it with single quotes, e.g., keyword =
+ * 'a value'. Single quotes and backslashes within the value must be
+ * escaped with a backslash, i.e., \' and \\.
+ *
+ * The currently recognized parameter keywords are:
+ * host, hostaddr, port,
+ * dbname (defaults to value of user),
+ * user,
+ * password, connect_timeout,
+ * options, tty (ignored), sslmode,
+ * requiressl (deprecated in favor of sslmode), and
+ * service. Which of these arguments exist depends
+ * on your PostgreSQL version.
+ *
+ * The options parameter can be used to set command line parameters
+ * to be invoked by the server.
+ * @param int $connect_type If PGSQL_CONNECT_FORCE_NEW is passed, then a new connection
+ * is created, even if the connection_string is identical to
+ * an existing connection.
+ *
+ * If PGSQL_CONNECT_ASYNC is given, then the
+ * connection is established asynchronously. The state of the connection
+ * can then be checked via pg_connect_poll or
+ * pg_connection_status.
+ * @return resource PostgreSQL connection resource on success, FALSE on failure.
+ * @throws PgsqlException
+ *
+ */
+function pg_connect(string $connection_string, int $connect_type = null)
+{
+ error_clear_last();
+ if ($connect_type !== null) {
+ $result = \pg_connect($connection_string, $connect_type);
+ } else {
+ $result = \pg_connect($connection_string);
+ }
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_connection_reset resets the connection.
+ * It is useful for error recovery.
+ *
+ * @param resource $connection PostgreSQL database connection resource.
+ * @throws PgsqlException
+ *
+ */
+function pg_connection_reset($connection): void
+{
+ error_clear_last();
+ $result = \pg_connection_reset($connection);
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * pg_convert checks and converts the values in
+ * assoc_array into suitable values for use in an SQL
+ * statement. Precondition for pg_convert is the
+ * existence of a table table_name which has at least
+ * as many columns as assoc_array has elements. The
+ * fieldnames in table_name must match the indices in
+ * assoc_array and the corresponding datatypes must be
+ * compatible. Returns an array with the converted values on success, FALSE
+ * otherwise.
+ *
+ * @param resource $connection PostgreSQL database connection resource.
+ * @param string $table_name Name of the table against which to convert types.
+ * @param array $assoc_array Data to be converted.
+ * @param int $options Any number of PGSQL_CONV_IGNORE_DEFAULT,
+ * PGSQL_CONV_FORCE_NULL or
+ * PGSQL_CONV_IGNORE_NOT_NULL, combined.
+ * @return array An array of converted values.
+ * @throws PgsqlException
+ *
+ */
+function pg_convert($connection, string $table_name, array $assoc_array, int $options = 0): array
+{
+ error_clear_last();
+ $result = \pg_convert($connection, $table_name, $assoc_array, $options);
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_copy_from inserts records into a table from
+ * rows. It issues a COPY FROM SQL command
+ * internally to insert records.
+ *
+ * @param resource $connection PostgreSQL database connection resource.
+ * @param string $table_name Name of the table into which to copy the rows.
+ * @param array $rows An array of data to be copied into table_name.
+ * Each value in rows becomes a row in table_name.
+ * Each value in rows should be a delimited string of the values
+ * to insert into each field. Values should be linefeed terminated.
+ * @param string $delimiter The token that separates values for each field in each element of
+ * rows. Default is TAB.
+ * @param string $null_as How SQL NULL values are represented in the
+ * rows. Default is \N ("\\N").
+ * @throws PgsqlException
+ *
+ */
+function pg_copy_from($connection, string $table_name, array $rows, string $delimiter = null, string $null_as = null): void
+{
+ error_clear_last();
+ if ($null_as !== null) {
+ $result = \pg_copy_from($connection, $table_name, $rows, $delimiter, $null_as);
+ } elseif ($delimiter !== null) {
+ $result = \pg_copy_from($connection, $table_name, $rows, $delimiter);
+ } else {
+ $result = \pg_copy_from($connection, $table_name, $rows);
+ }
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * pg_copy_to copies a table to an array. It
+ * issues COPY TO SQL command internally to
+ * retrieve records.
+ *
+ * @param resource $connection PostgreSQL database connection resource.
+ * @param string $table_name Name of the table from which to copy the data into rows.
+ * @param string $delimiter The token that separates values for each field in each element of
+ * rows. Default is TAB.
+ * @param string $null_as How SQL NULL values are represented in the
+ * rows. Default is \N ("\\N").
+ * @return array An array with one element for each line of COPY data.
+ * It returns FALSE on failure.
+ * @throws PgsqlException
+ *
+ */
+function pg_copy_to($connection, string $table_name, string $delimiter = null, string $null_as = null): array
+{
+ error_clear_last();
+ if ($null_as !== null) {
+ $result = \pg_copy_to($connection, $table_name, $delimiter, $null_as);
+ } elseif ($delimiter !== null) {
+ $result = \pg_copy_to($connection, $table_name, $delimiter);
+ } else {
+ $result = \pg_copy_to($connection, $table_name);
+ }
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_dbname returns the name of the database
+ * that the given PostgreSQL connection
+ * resource.
+ *
+ * @param resource $connection PostgreSQL database connection resource. When
+ * connection is not present, the default connection
+ * is used. The default connection is the last connection made by
+ * pg_connect or pg_pconnect.
+ * @return string A string containing the name of the database the
+ * connection is to.
+ * @throws PgsqlException
+ *
+ */
+function pg_dbname($connection = null): string
+{
+ error_clear_last();
+ if ($connection !== null) {
+ $result = \pg_dbname($connection);
+ } else {
+ $result = \pg_dbname();
+ }
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_delete deletes records from a table
+ * specified by the keys and values
+ * in assoc_array. If options
+ * is specified, pg_convert is applied
+ * to assoc_array with the specified options.
+ *
+ * If options is specified,
+ * pg_convert is applied to
+ * assoc_array with the specified flags.
+ *
+ * By default pg_delete passes raw values. Values
+ * must be escaped or PGSQL_DML_ESCAPE option must be
+ * specified. PGSQL_DML_ESCAPE quotes and escapes
+ * parameters/identifiers. Therefore, table/column names became case
+ * sensitive.
+ *
+ * Note that neither escape nor prepared query can protect LIKE query,
+ * JSON, Array, Regex, etc. These parameters should be handled
+ * according to their contexts. i.e. Escape/validate values.
+ *
+ * @param resource $connection PostgreSQL database connection resource.
+ * @param string $table_name Name of the table from which to delete rows.
+ * @param array $assoc_array An array whose keys are field names in the table table_name,
+ * and whose values are the values of those fields that are to be deleted.
+ * @param int $options Any number of PGSQL_CONV_FORCE_NULL,
+ * PGSQL_DML_NO_CONV,
+ * PGSQL_DML_ESCAPE,
+ * PGSQL_DML_EXEC,
+ * PGSQL_DML_ASYNC or
+ * PGSQL_DML_STRING combined. If PGSQL_DML_STRING is part of the
+ * options then query string is returned. When PGSQL_DML_NO_CONV
+ * or PGSQL_DML_ESCAPE is set, it does not call pg_convert internally.
+ * @return mixed Returns TRUE on success. Returns string if PGSQL_DML_STRING is passed
+ * via options.
+ * @throws PgsqlException
+ *
+ */
+function pg_delete($connection, string $table_name, array $assoc_array, int $options = PGSQL_DML_EXEC)
+{
+ error_clear_last();
+ $result = \pg_delete($connection, $table_name, $assoc_array, $options);
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_end_copy syncs the PostgreSQL frontend
+ * (usually a web server process) with the PostgreSQL server after
+ * doing a copy operation performed by
+ * pg_put_line. pg_end_copy
+ * must be issued, otherwise the PostgreSQL server may get out of
+ * sync with the frontend and will report an error.
+ *
+ * @param resource $connection PostgreSQL database connection resource. When
+ * connection is not present, the default connection
+ * is used. The default connection is the last connection made by
+ * pg_connect or pg_pconnect.
+ * @throws PgsqlException
+ *
+ */
+function pg_end_copy($connection = null): void
+{
+ error_clear_last();
+ if ($connection !== null) {
+ $result = \pg_end_copy($connection);
+ } else {
+ $result = \pg_end_copy();
+ }
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sends a request to execute a prepared statement with given parameters, and
+ * waits for the result.
+ *
+ * pg_execute is like pg_query_params,
+ * but the command to be executed is
+ * specified by naming a previously-prepared statement, instead of giving a
+ * query string. This feature allows commands that will be used repeatedly to
+ * be parsed and planned just once, rather than each time they are executed.
+ * The statement must have been prepared previously in the current session.
+ * pg_execute is supported only against PostgreSQL 7.4 or
+ * higher connections; it will fail when using earlier versions.
+ *
+ * The parameters are identical to pg_query_params, except that the name of a
+ * prepared statement is given instead of a query string.
+ *
+ * @param resource $connection PostgreSQL database connection resource. When
+ * connection is not present, the default connection
+ * is used. The default connection is the last connection made by
+ * pg_connect or pg_pconnect.
+ * @param string $stmtname The name of the prepared statement to execute. if
+ * "" is specified, then the unnamed statement is executed. The name must have
+ * been previously prepared using pg_prepare,
+ * pg_send_prepare or a PREPARE SQL
+ * command.
+ * @param array $params An array of parameter values to substitute for the $1, $2, etc. placeholders
+ * in the original prepared query string. The number of elements in the array
+ * must match the number of placeholders.
+ *
+ * Elements are converted to strings by calling this function.
+ * @return resource A query result resource on success.
+ * @throws PgsqlException
+ *
+ */
+function pg_execute($connection = null, string $stmtname = null, array $params = null)
+{
+ error_clear_last();
+ if ($params !== null) {
+ $result = \pg_execute($connection, $stmtname, $params);
+ } elseif ($stmtname !== null) {
+ $result = \pg_execute($connection, $stmtname);
+ } elseif ($connection !== null) {
+ $result = \pg_execute($connection);
+ } else {
+ $result = \pg_execute();
+ }
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_field_name returns the name of the field
+ * occupying the given field_number in the
+ * given PostgreSQL result resource. Field
+ * numbering starts from 0.
+ *
+ * @param resource $result PostgreSQL query result resource, returned by pg_query,
+ * pg_query_params or pg_execute
+ * (among others).
+ * @param int $field_number Field number, starting from 0.
+ * @return string The field name.
+ * @throws PgsqlException
+ *
+ */
+function pg_field_name($result, int $field_number): string
+{
+ error_clear_last();
+ $result = \pg_field_name($result, $field_number);
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_field_table returns the name of the table that field
+ * belongs to, or the table's oid if oid_only is TRUE.
+ *
+ * @param resource $result PostgreSQL query result resource, returned by pg_query,
+ * pg_query_params or pg_execute
+ * (among others).
+ * @param int $field_number Field number, starting from 0.
+ * @param bool $oid_only By default the tables name that field belongs to is returned but
+ * if oid_only is set to TRUE, then the
+ * oid will instead be returned.
+ * @return mixed On success either the fields table name or oid. Or, FALSE on failure.
+ * @throws PgsqlException
+ *
+ */
+function pg_field_table($result, int $field_number, bool $oid_only = false)
+{
+ error_clear_last();
+ $result = \pg_field_table($result, $field_number, $oid_only);
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_field_type returns a string containing the
+ * base type name of the given field_number in the
+ * given PostgreSQL result resource.
+ *
+ * @param resource $result PostgreSQL query result resource, returned by pg_query,
+ * pg_query_params or pg_execute
+ * (among others).
+ * @param int $field_number Field number, starting from 0.
+ * @return string A string containing the base name of the field's type.
+ * @throws PgsqlException
+ *
+ */
+function pg_field_type($result, int $field_number): string
+{
+ error_clear_last();
+ $result = \pg_field_type($result, $field_number);
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_flush flushes any outbound query data waiting to be
+ * sent on the connection.
+ *
+ * @param resource $connection PostgreSQL database connection resource.
+ * @return mixed Returns TRUE if the flush was successful or no data was waiting to be
+ * flushed, 0 if part of the pending data was flushed but
+ * more remains.
+ * @throws PgsqlException
+ *
+ */
+function pg_flush($connection)
+{
+ error_clear_last();
+ $result = \pg_flush($connection);
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_free_result frees the memory and data associated with the
+ * specified PostgreSQL query result resource.
+ *
+ * This function need only be called if memory
+ * consumption during script execution is a problem. Otherwise, all result memory will
+ * be automatically freed when the script ends.
+ *
+ * @param resource $result PostgreSQL query result resource, returned by pg_query,
+ * pg_query_params or pg_execute
+ * (among others).
+ * @throws PgsqlException
+ *
+ */
+function pg_free_result($result): void
+{
+ error_clear_last();
+ $result = \pg_free_result($result);
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * pg_host returns the host name of the given
+ * PostgreSQL connection resource is
+ * connected to.
+ *
+ * @param resource $connection PostgreSQL database connection resource. When
+ * connection is not present, the default connection
+ * is used. The default connection is the last connection made by
+ * pg_connect or pg_pconnect.
+ * @return string A string containing the name of the host the
+ * connection is to.
+ * @throws PgsqlException
+ *
+ */
+function pg_host($connection = null): string
+{
+ error_clear_last();
+ if ($connection !== null) {
+ $result = \pg_host($connection);
+ } else {
+ $result = \pg_host();
+ }
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_insert inserts the values
+ * of assoc_array into the table specified
+ * by table_name. If options
+ * is specified, pg_convert is applied
+ * to assoc_array with the specified options.
+ *
+ * If options is specified,
+ * pg_convert is applied to
+ * assoc_array with the specified flags.
+ *
+ * By default pg_insert passes raw values. Values
+ * must be escaped or PGSQL_DML_ESCAPE option must be
+ * specified. PGSQL_DML_ESCAPE quotes and escapes
+ * parameters/identifiers. Therefore, table/column names became case
+ * sensitive.
+ *
+ * Note that neither escape nor prepared query can protect LIKE query,
+ * JSON, Array, Regex, etc. These parameters should be handled
+ * according to their contexts. i.e. Escape/validate values.
+ *
+ * @param resource $connection PostgreSQL database connection resource.
+ * @param string $table_name Name of the table into which to insert rows. The table table_name must at least
+ * have as many columns as assoc_array has elements.
+ * @param array $assoc_array An array whose keys are field names in the table table_name,
+ * and whose values are the values of those fields that are to be inserted.
+ * @param int $options Any number of PGSQL_CONV_OPTS,
+ * PGSQL_DML_NO_CONV,
+ * PGSQL_DML_ESCAPE,
+ * PGSQL_DML_EXEC,
+ * PGSQL_DML_ASYNC or
+ * PGSQL_DML_STRING combined. If PGSQL_DML_STRING is part of the
+ * options then query string is returned. When PGSQL_DML_NO_CONV
+ * or PGSQL_DML_ESCAPE is set, it does not call pg_convert internally.
+ * @return mixed Returns the connection resource on success. Returns string if PGSQL_DML_STRING is passed
+ * via options.
+ * @throws PgsqlException
+ *
+ */
+function pg_insert($connection, string $table_name, array $assoc_array, int $options = PGSQL_DML_EXEC)
+{
+ error_clear_last();
+ $result = \pg_insert($connection, $table_name, $assoc_array, $options);
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_last_error returns the last error message
+ * for a given connection.
+ *
+ * Error messages may be overwritten by internal PostgreSQL (libpq)
+ * function calls. It may not return an appropriate error message if
+ * multiple errors occur inside a PostgreSQL module function.
+ *
+ * Use pg_result_error, pg_result_error_field,
+ * pg_result_status and
+ * pg_connection_status for better error handling.
+ *
+ * @param resource $connection PostgreSQL database connection resource. When
+ * connection is not present, the default connection
+ * is used. The default connection is the last connection made by
+ * pg_connect or pg_pconnect.
+ * @return string A string containing the last error message on the
+ * given connection.
+ * @throws PgsqlException
+ *
+ */
+function pg_last_error($connection = null): string
+{
+ error_clear_last();
+ if ($connection !== null) {
+ $result = \pg_last_error($connection);
+ } else {
+ $result = \pg_last_error();
+ }
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_last_notice returns the last notice
+ * message from the PostgreSQL server on the specified
+ * connection. The PostgreSQL server sends notice
+ * messages in several cases, for instance when creating a SERIAL
+ * column in a table.
+ *
+ * With pg_last_notice, you can avoid issuing useless
+ * queries by checking whether or not the notice is related to your transaction.
+ *
+ * Notice message tracking can be set to optional by setting 1 for
+ * pgsql.ignore_notice in php.ini.
+ *
+ * Notice message logging can be set to optional by setting 0 for
+ * pgsql.log_notice in php.ini.
+ * Unless pgsql.ignore_notice is set
+ * to 0, notice message cannot be logged.
+ *
+ * @param resource $connection PostgreSQL database connection resource.
+ * @param int $option One of PGSQL_NOTICE_LAST (to return last notice),
+ * PGSQL_NOTICE_ALL (to return all notices),
+ * or PGSQL_NOTICE_CLEAR (to clear notices).
+ * @return string A string containing the last notice on the
+ * given connection with
+ * PGSQL_NOTICE_LAST,
+ * an array with PGSQL_NOTICE_ALL,
+ * a boolean with PGSQL_NOTICE_CLEAR.
+ * @throws PgsqlException
+ *
+ */
+function pg_last_notice($connection, int $option = PGSQL_NOTICE_LAST): string
+{
+ error_clear_last();
+ $result = \pg_last_notice($connection, $option);
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_last_oid is used to retrieve the
+ * OID assigned to an inserted row.
+ *
+ * OID field became an optional field from PostgreSQL 7.2 and will
+ * not be present by default in PostgreSQL 8.1. When the
+ * OID field is not present in a table, the programmer must use
+ * pg_result_status to check for successful
+ * insertion.
+ *
+ * To get the value of a SERIAL field in an inserted
+ * row, it is necessary to use the PostgreSQL CURRVAL
+ * function, naming the sequence whose last value is required. If the
+ * name of the sequence is unknown, the pg_get_serial_sequence
+ * PostgreSQL 8.0 function is necessary.
+ *
+ * PostgreSQL 8.1 has a function LASTVAL that returns
+ * the value of the most recently used sequence in the session. This avoids
+ * the need for naming the sequence, table or column altogether.
+ *
+ * @param resource $result PostgreSQL query result resource, returned by pg_query,
+ * pg_query_params or pg_execute
+ * (among others).
+ * @return string A string containing the OID assigned to the most recently inserted
+ * row in the specified connection or
+ * no available OID.
+ * @throws PgsqlException
+ *
+ */
+function pg_last_oid($result): string
+{
+ error_clear_last();
+ $result = \pg_last_oid($result);
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_lo_close closes a large
+ * object. large_object is a resource for the
+ * large object from pg_lo_open.
+ *
+ * To use the large object interface, it is necessary to
+ * enclose it within a transaction block.
+ *
+ * @param resource $large_object PostgreSQL large object (LOB) resource, returned by pg_lo_open.
+ * @throws PgsqlException
+ *
+ */
+function pg_lo_close($large_object): void
+{
+ error_clear_last();
+ $result = \pg_lo_close($large_object);
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * pg_lo_export takes a large object in a
+ * PostgreSQL database and saves its contents to a file on the local
+ * filesystem.
+ *
+ * To use the large object interface, it is necessary to
+ * enclose it within a transaction block.
+ *
+ * @param resource $connection PostgreSQL database connection resource. When
+ * connection is not present, the default connection
+ * is used. The default connection is the last connection made by
+ * pg_connect or pg_pconnect.
+ * @param int $oid The OID of the large object in the database.
+ * @param string $pathname The full path and file name of the file in which to write the
+ * large object on the client filesystem.
+ * @throws PgsqlException
+ *
+ */
+function pg_lo_export($connection = null, int $oid = null, string $pathname = null): void
+{
+ error_clear_last();
+ if ($pathname !== null) {
+ $result = \pg_lo_export($connection, $oid, $pathname);
+ } elseif ($oid !== null) {
+ $result = \pg_lo_export($connection, $oid);
+ } elseif ($connection !== null) {
+ $result = \pg_lo_export($connection);
+ } else {
+ $result = \pg_lo_export();
+ }
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * pg_lo_import creates a new large object
+ * in the database using a file on the filesystem as its data
+ * source.
+ *
+ * To use the large object interface, it is necessary to
+ * enclose it within a transaction block.
+ *
+ * @param resource $connection PostgreSQL database connection resource. When
+ * connection is not present, the default connection
+ * is used. The default connection is the last connection made by
+ * pg_connect or pg_pconnect.
+ * @param string $pathname The full path and file name of the file on the client
+ * filesystem from which to read the large object data.
+ * @param mixed $object_id If an object_id is given the function
+ * will try to create a large object with this id, else a free
+ * object id is assigned by the server. The parameter
+ * was added in PHP 5.3 and relies on functionality that first
+ * appeared in PostgreSQL 8.1.
+ * @return int The OID of the newly created large object.
+ * @throws PgsqlException
+ *
+ */
+function pg_lo_import($connection = null, string $pathname = null, $object_id = null): int
+{
+ error_clear_last();
+ if ($object_id !== null) {
+ $result = \pg_lo_import($connection, $pathname, $object_id);
+ } elseif ($pathname !== null) {
+ $result = \pg_lo_import($connection, $pathname);
+ } elseif ($connection !== null) {
+ $result = \pg_lo_import($connection);
+ } else {
+ $result = \pg_lo_import();
+ }
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_lo_open opens a large object in the database
+ * and returns large object resource so that it can be manipulated.
+ *
+ * To use the large object interface, it is necessary to
+ * enclose it within a transaction block.
+ *
+ * @param resource $connection PostgreSQL database connection resource. When
+ * connection is not present, the default connection
+ * is used. The default connection is the last connection made by
+ * pg_connect or pg_pconnect.
+ * @param int $oid The OID of the large object in the database.
+ * @param string $mode Can be either "r" for read-only, "w" for write only or "rw" for read and
+ * write.
+ * @return resource A large object resource.
+ * @throws PgsqlException
+ *
+ */
+function pg_lo_open($connection, int $oid, string $mode)
+{
+ error_clear_last();
+ $result = \pg_lo_open($connection, $oid, $mode);
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_lo_read_all reads a large object and passes
+ * it straight through to the browser after sending all pending
+ * headers. Mainly intended for sending binary data like images or
+ * sound.
+ *
+ * To use the large object interface, it is necessary to
+ * enclose it within a transaction block.
+ *
+ * @param resource $large_object PostgreSQL large object (LOB) resource, returned by pg_lo_open.
+ * @return int Number of bytes read.
+ * @throws PgsqlException
+ *
+ */
+function pg_lo_read_all($large_object): int
+{
+ error_clear_last();
+ $result = \pg_lo_read_all($large_object);
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_lo_read reads at most
+ * len bytes from a large object and
+ * returns it as a string.
+ *
+ * To use the large object interface, it is necessary to
+ * enclose it within a transaction block.
+ *
+ * @param resource $large_object PostgreSQL large object (LOB) resource, returned by pg_lo_open.
+ * @param int $len An optional maximum number of bytes to return.
+ * @return string A string containing len bytes from the
+ * large object.
+ * @throws PgsqlException
+ *
+ */
+function pg_lo_read($large_object, int $len = 8192): string
+{
+ error_clear_last();
+ $result = \pg_lo_read($large_object, $len);
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_lo_seek seeks a position within a large object
+ * resource.
+ *
+ * To use the large object interface, it is necessary to
+ * enclose it within a transaction block.
+ *
+ * @param resource $large_object PostgreSQL large object (LOB) resource, returned by pg_lo_open.
+ * @param int $offset The number of bytes to seek.
+ * @param int $whence One of the constants PGSQL_SEEK_SET (seek from object start),
+ * PGSQL_SEEK_CUR (seek from current position)
+ * or PGSQL_SEEK_END (seek from object end) .
+ * @throws PgsqlException
+ *
+ */
+function pg_lo_seek($large_object, int $offset, int $whence = PGSQL_SEEK_CUR): void
+{
+ error_clear_last();
+ $result = \pg_lo_seek($large_object, $offset, $whence);
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * pg_lo_truncate truncates a large object
+ * resource.
+ *
+ * To use the large object interface, it is necessary to
+ * enclose it within a transaction block.
+ *
+ * @param resource $large_object PostgreSQL large object (LOB) resource, returned by pg_lo_open.
+ * @param int $size The number of bytes to truncate.
+ * @throws PgsqlException
+ *
+ */
+function pg_lo_truncate($large_object, int $size): void
+{
+ error_clear_last();
+ $result = \pg_lo_truncate($large_object, $size);
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * pg_lo_unlink deletes a large object with the
+ * oid. Returns TRUE on success.
+ *
+ * To use the large object interface, it is necessary to
+ * enclose it within a transaction block.
+ *
+ * @param resource $connection PostgreSQL database connection resource. When
+ * connection is not present, the default connection
+ * is used. The default connection is the last connection made by
+ * pg_connect or pg_pconnect.
+ * @param int $oid The OID of the large object in the database.
+ * @throws PgsqlException
+ *
+ */
+function pg_lo_unlink($connection, int $oid): void
+{
+ error_clear_last();
+ $result = \pg_lo_unlink($connection, $oid);
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * pg_lo_write writes data into a large object
+ * at the current seek position.
+ *
+ * To use the large object interface, it is necessary to
+ * enclose it within a transaction block.
+ *
+ * @param resource $large_object PostgreSQL large object (LOB) resource, returned by pg_lo_open.
+ * @param string $data The data to be written to the large object. If len is
+ * specified and is less than the length of data, only
+ * len bytes will be written.
+ * @param int $len An optional maximum number of bytes to write. Must be greater than zero
+ * and no greater than the length of data. Defaults to
+ * the length of data.
+ * @return int The number of bytes written to the large object.
+ * @throws PgsqlException
+ *
+ */
+function pg_lo_write($large_object, string $data, int $len = null): int
+{
+ error_clear_last();
+ if ($len !== null) {
+ $result = \pg_lo_write($large_object, $data, $len);
+ } else {
+ $result = \pg_lo_write($large_object, $data);
+ }
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_meta_data returns table definition for
+ * table_name as an array.
+ *
+ * @param resource $connection PostgreSQL database connection resource.
+ * @param string $table_name The name of the table.
+ * @param bool $extended Flag for returning extended meta data. Default to FALSE.
+ * @return array An array of the table definition.
+ * @throws PgsqlException
+ *
+ */
+function pg_meta_data($connection, string $table_name, bool $extended = false): array
+{
+ error_clear_last();
+ $result = \pg_meta_data($connection, $table_name, $extended);
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_options will return a string containing
+ * the options specified on the given PostgreSQL
+ * connection resource.
+ *
+ * @param resource $connection PostgreSQL database connection resource. When
+ * connection is not present, the default connection
+ * is used. The default connection is the last connection made by
+ * pg_connect or pg_pconnect.
+ * @return string A string containing the connection
+ * options.
+ * @throws PgsqlException
+ *
+ */
+function pg_options($connection = null): string
+{
+ error_clear_last();
+ if ($connection !== null) {
+ $result = \pg_options($connection);
+ } else {
+ $result = \pg_options();
+ }
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Looks up a current parameter setting of the server.
+ *
+ * Certain parameter values are reported by the server automatically at
+ * connection startup or whenever their values change. pg_parameter_status can be
+ * used to interrogate these settings. It returns the current value of a
+ * parameter if known, or FALSE if the parameter is not known.
+ *
+ * Parameters reported as of PostgreSQL 8.0 include server_version,
+ * server_encoding, client_encoding,
+ * is_superuser, session_authorization,
+ * DateStyle, TimeZone, and integer_datetimes.
+ * (server_encoding, TimeZone, and
+ * integer_datetimes were not reported by releases before 8.0.) Note that
+ * server_version, server_encoding and integer_datetimes
+ * cannot change after PostgreSQL startup.
+ *
+ * PostgreSQL 7.3 or lower servers do not report parameter settings,
+ * pg_parameter_status
+ * includes logic to obtain values for server_version and
+ * client_encoding
+ * anyway. Applications are encouraged to use pg_parameter_status rather than ad
+ * hoc code to determine these values.
+ *
+ * @param resource $connection PostgreSQL database connection resource. When
+ * connection is not present, the default connection
+ * is used. The default connection is the last connection made by
+ * pg_connect or pg_pconnect.
+ * @param string $param_name Possible param_name values include server_version,
+ * server_encoding, client_encoding,
+ * is_superuser, session_authorization,
+ * DateStyle, TimeZone, and
+ * integer_datetimes. Note that this value is case-sensitive.
+ * @return string A string containing the value of the parameter, FALSE on failure or invalid
+ * param_name.
+ * @throws PgsqlException
+ *
+ */
+function pg_parameter_status($connection = null, string $param_name = null): string
+{
+ error_clear_last();
+ if ($param_name !== null) {
+ $result = \pg_parameter_status($connection, $param_name);
+ } elseif ($connection !== null) {
+ $result = \pg_parameter_status($connection);
+ } else {
+ $result = \pg_parameter_status();
+ }
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_pconnect opens a connection to a
+ * PostgreSQL database. It returns a connection resource that is
+ * needed by other PostgreSQL functions.
+ *
+ * If a second call is made to pg_pconnect with
+ * the same connection_string as an existing connection, the
+ * existing connection will be returned unless you pass
+ * PGSQL_CONNECT_FORCE_NEW as
+ * connect_type.
+ *
+ * To enable persistent connection, the pgsql.allow_persistent
+ * php.ini directive must be set to "On" (which is the default).
+ * The maximum number of persistent connection can be defined with the pgsql.max_persistent
+ * php.ini directive (defaults to -1 for no limit). The total number
+ * of connections can be set with the pgsql.max_links
+ * php.ini directive.
+ *
+ * pg_close will not close persistent links
+ * generated by pg_pconnect.
+ *
+ * @param string $connection_string The connection_string can be empty to use all default parameters, or it
+ * can contain one or more parameter settings separated by whitespace.
+ * Each parameter setting is in the form keyword = value. Spaces around
+ * the equal sign are optional. To write an empty value or a value
+ * containing spaces, surround it with single quotes, e.g., keyword =
+ * 'a value'. Single quotes and backslashes within the value must be
+ * escaped with a backslash, i.e., \' and \\.
+ *
+ * The currently recognized parameter keywords are:
+ * host, hostaddr, port,
+ * dbname, user,
+ * password, connect_timeout,
+ * options, tty (ignored), sslmode,
+ * requiressl (deprecated in favor of sslmode), and
+ * service. Which of these arguments exist depends
+ * on your PostgreSQL version.
+ * @param int $connect_type If PGSQL_CONNECT_FORCE_NEW is passed, then a new connection
+ * is created, even if the connection_string is identical to
+ * an existing connection.
+ * @return resource PostgreSQL connection resource on success, FALSE on failure.
+ * @throws PgsqlException
+ *
+ */
+function pg_pconnect(string $connection_string, int $connect_type = null)
+{
+ error_clear_last();
+ if ($connect_type !== null) {
+ $result = \pg_pconnect($connection_string, $connect_type);
+ } else {
+ $result = \pg_pconnect($connection_string);
+ }
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_ping pings a database connection and tries to
+ * reconnect it if it is broken.
+ *
+ * @param resource $connection PostgreSQL database connection resource. When
+ * connection is not present, the default connection
+ * is used. The default connection is the last connection made by
+ * pg_connect or pg_pconnect.
+ * @throws PgsqlException
+ *
+ */
+function pg_ping($connection = null): void
+{
+ error_clear_last();
+ if ($connection !== null) {
+ $result = \pg_ping($connection);
+ } else {
+ $result = \pg_ping();
+ }
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * pg_port returns the port number that the
+ * given PostgreSQL connection resource is
+ * connected to.
+ *
+ * @param resource $connection PostgreSQL database connection resource. When
+ * connection is not present, the default connection
+ * is used. The default connection is the last connection made by
+ * pg_connect or pg_pconnect.
+ * @return int An int containing the port number of the database
+ * server the connection is to.
+ * @throws PgsqlException
+ *
+ */
+function pg_port($connection = null): int
+{
+ error_clear_last();
+ if ($connection !== null) {
+ $result = \pg_port($connection);
+ } else {
+ $result = \pg_port();
+ }
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_prepare creates a prepared statement for later execution with
+ * pg_execute or pg_send_execute.
+ * This feature allows commands that will be used repeatedly to
+ * be parsed and planned just once, rather than each time they are executed.
+ * pg_prepare is supported only against PostgreSQL 7.4 or
+ * higher connections; it will fail when using earlier versions.
+ *
+ * The function creates a prepared statement named stmtname from the query
+ * string, which must contain a single SQL command. stmtname may be "" to
+ * create an unnamed statement, in which case any pre-existing unnamed
+ * statement is automatically replaced; otherwise it is an error if the
+ * statement name is already defined in the current session. If any parameters
+ * are used, they are referred to in the query as $1, $2, etc.
+ *
+ * Prepared statements for use with pg_prepare can also be created by
+ * executing SQL PREPARE statements. (But pg_prepare is more flexible since it
+ * does not require parameter types to be pre-specified.) Also, although there
+ * is no PHP function for deleting a prepared statement, the SQL DEALLOCATE
+ * statement can be used for that purpose.
+ *
+ * @param resource $connection PostgreSQL database connection resource. When
+ * connection is not present, the default connection
+ * is used. The default connection is the last connection made by
+ * pg_connect or pg_pconnect.
+ * @param string $stmtname The name to give the prepared statement. Must be unique per-connection. If
+ * "" is specified, then an unnamed statement is created, overwriting any
+ * previously defined unnamed statement.
+ * @param string $query The parameterized SQL statement. Must contain only a single statement.
+ * (multiple statements separated by semi-colons are not allowed.) If any parameters
+ * are used, they are referred to as $1, $2, etc.
+ * @return resource A query result resource on success.
+ * @throws PgsqlException
+ *
+ */
+function pg_prepare($connection = null, string $stmtname = null, string $query = null)
+{
+ error_clear_last();
+ if ($query !== null) {
+ $result = \pg_prepare($connection, $stmtname, $query);
+ } elseif ($stmtname !== null) {
+ $result = \pg_prepare($connection, $stmtname);
+ } elseif ($connection !== null) {
+ $result = \pg_prepare($connection);
+ } else {
+ $result = \pg_prepare();
+ }
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_put_line sends a NULL-terminated string
+ * to the PostgreSQL backend server. This is needed in conjunction
+ * with PostgreSQL's COPY FROM command.
+ *
+ * COPY is a high-speed data loading interface
+ * supported by PostgreSQL. Data is passed in without being parsed,
+ * and in a single transaction.
+ *
+ * An alternative to using raw pg_put_line commands
+ * is to use pg_copy_from. This is a far simpler
+ * interface.
+ *
+ * @param resource $connection PostgreSQL database connection resource. When
+ * connection is not present, the default connection
+ * is used. The default connection is the last connection made by
+ * pg_connect or pg_pconnect.
+ * @param string $data A line of text to be sent directly to the PostgreSQL backend. A NULL
+ * terminator is added automatically.
+ * @throws PgsqlException
+ *
+ */
+function pg_put_line($connection = null, string $data = null): void
+{
+ error_clear_last();
+ if ($data !== null) {
+ $result = \pg_put_line($connection, $data);
+ } elseif ($connection !== null) {
+ $result = \pg_put_line($connection);
+ } else {
+ $result = \pg_put_line();
+ }
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Submits a command to the server and waits for the result, with the ability
+ * to pass parameters separately from the SQL command text.
+ *
+ * pg_query_params is like pg_query,
+ * but offers additional functionality: parameter
+ * values can be specified separately from the command string proper.
+ * pg_query_params is supported only against PostgreSQL 7.4 or
+ * higher connections; it will fail when using earlier versions.
+ *
+ * If parameters are used, they are referred to in the
+ * query string as $1, $2, etc. The same parameter may
+ * appear more than once in the query; the same value
+ * will be used in that case. params specifies the
+ * actual values of the parameters. A NULL value in this array means the
+ * corresponding parameter is SQL NULL.
+ *
+ * The primary advantage of pg_query_params over pg_query
+ * is that parameter values
+ * may be separated from the query string, thus avoiding the need for tedious
+ * and error-prone quoting and escaping. Unlike pg_query,
+ * pg_query_params allows at
+ * most one SQL command in the given string. (There can be semicolons in it,
+ * but not more than one nonempty command.)
+ *
+ * @param resource $connection PostgreSQL database connection resource. When
+ * connection is not present, the default connection
+ * is used. The default connection is the last connection made by
+ * pg_connect or pg_pconnect.
+ * @param string $query The parameterized SQL statement. Must contain only a single statement.
+ * (multiple statements separated by semi-colons are not allowed.) If any parameters
+ * are used, they are referred to as $1, $2, etc.
+ *
+ * User-supplied values should always be passed as parameters, not
+ * interpolated into the query string, where they form possible
+ * SQL injection
+ * attack vectors and introduce bugs when handling data containing quotes.
+ * If for some reason you cannot use a parameter, ensure that interpolated
+ * values are properly escaped.
+ * @param array $params An array of parameter values to substitute for the $1, $2, etc. placeholders
+ * in the original prepared query string. The number of elements in the array
+ * must match the number of placeholders.
+ *
+ * Values intended for bytea fields are not supported as
+ * parameters. Use pg_escape_bytea instead, or use the
+ * large object functions.
+ * @return resource A query result resource on success.
+ * @throws PgsqlException
+ *
+ */
+function pg_query_params($connection = null, string $query = null, array $params = null)
+{
+ error_clear_last();
+ if ($params !== null) {
+ $result = \pg_query_params($connection, $query, $params);
+ } elseif ($query !== null) {
+ $result = \pg_query_params($connection, $query);
+ } elseif ($connection !== null) {
+ $result = \pg_query_params($connection);
+ } else {
+ $result = \pg_query_params();
+ }
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_query executes the query
+ * on the specified database connection.
+ * pg_query_params should be preferred
+ * in most cases.
+ *
+ * If an error occurs, and FALSE is returned, details of the error can
+ * be retrieved using the pg_last_error
+ * function if the connection is valid.
+ *
+ *
+ *
+ * Although connection can be omitted, it
+ * is not recommended, since it can be the cause of hard to find
+ * bugs in scripts.
+ *
+ *
+ *
+ * @param resource $connection PostgreSQL database connection resource. When
+ * connection is not present, the default connection
+ * is used. The default connection is the last connection made by
+ * pg_connect or pg_pconnect.
+ * @param string $query The SQL statement or statements to be executed. When multiple statements are passed to the function,
+ * they are automatically executed as one transaction, unless there are explicit BEGIN/COMMIT commands
+ * included in the query string. However, using multiple transactions in one function call is not recommended.
+ *
+ * String interpolation of user-supplied data is extremely dangerous and is
+ * likely to lead to SQL
+ * injection vulnerabilities. In most cases
+ * pg_query_params should be preferred, passing
+ * user-supplied values as parameters rather than substituting them into
+ * the query string.
+ *
+ * Any user-supplied data substituted directly into a query string should
+ * be properly escaped.
+ * @return resource A query result resource on success.
+ * @throws PgsqlException
+ *
+ */
+function pg_query($connection = null, string $query = null)
+{
+ error_clear_last();
+ if ($query !== null) {
+ $result = \pg_query($connection, $query);
+ } elseif ($connection !== null) {
+ $result = \pg_query($connection);
+ } else {
+ $result = \pg_query();
+ }
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_result_error_field returns one of the detailed error message
+ * fields associated with result resource. It is only available
+ * against a PostgreSQL 7.4 or above server. The error field is specified by
+ * the fieldcode.
+ *
+ * Because pg_query and pg_query_params return FALSE if the query fails,
+ * you must use pg_send_query and
+ * pg_get_result to get the result handle.
+ *
+ * If you need to get additional error information from failed pg_query queries,
+ * use pg_set_error_verbosity and pg_last_error
+ * and then parse the result.
+ *
+ * @param resource $result A PostgreSQL query result resource from a previously executed
+ * statement.
+ * @param int $fieldcode Possible fieldcode values are: PGSQL_DIAG_SEVERITY,
+ * PGSQL_DIAG_SQLSTATE, PGSQL_DIAG_MESSAGE_PRIMARY,
+ * PGSQL_DIAG_MESSAGE_DETAIL,
+ * PGSQL_DIAG_MESSAGE_HINT, PGSQL_DIAG_STATEMENT_POSITION,
+ * PGSQL_DIAG_INTERNAL_POSITION (PostgreSQL 8.0+ only),
+ * PGSQL_DIAG_INTERNAL_QUERY (PostgreSQL 8.0+ only),
+ * PGSQL_DIAG_CONTEXT, PGSQL_DIAG_SOURCE_FILE,
+ * PGSQL_DIAG_SOURCE_LINE or
+ * PGSQL_DIAG_SOURCE_FUNCTION.
+ * @return string|null A string containing the contents of the error field, NULL if the field does not exist.
+ * @throws PgsqlException
+ *
+ */
+function pg_result_error_field($result, int $fieldcode): ?string
+{
+ error_clear_last();
+ $result = \pg_result_error_field($result, $fieldcode);
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_result_seek sets the internal row offset in
+ * a result resource.
+ *
+ * @param resource $result PostgreSQL query result resource, returned by pg_query,
+ * pg_query_params or pg_execute
+ * (among others).
+ * @param int $offset Row to move the internal offset to in the result resource.
+ * Rows are numbered starting from zero.
+ * @throws PgsqlException
+ *
+ */
+function pg_result_seek($result, int $offset): void
+{
+ error_clear_last();
+ $result = \pg_result_seek($result, $offset);
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * pg_select selects records specified by
+ * assoc_array which has
+ * field=&gt;value. For a successful query, it returns an
+ * array containing all records and fields that match the condition
+ * specified by assoc_array.
+ *
+ * If options is specified,
+ * pg_convert is applied to
+ * assoc_array with the specified flags.
+ *
+ * By default pg_select passes raw values. Values
+ * must be escaped or PGSQL_DML_ESCAPE option must be
+ * specified. PGSQL_DML_ESCAPE quotes and escapes
+ * parameters/identifiers. Therefore, table/column names became case
+ * sensitive.
+ *
+ * Note that neither escape nor prepared query can protect LIKE query,
+ * JSON, Array, Regex, etc. These parameters should be handled
+ * according to their contexts. i.e. Escape/validate values.
+ *
+ * @param resource $connection PostgreSQL database connection resource.
+ * @param string $table_name Name of the table from which to select rows.
+ * @param array $assoc_array An array whose keys are field names in the table table_name,
+ * and whose values are the conditions that a row must meet to be retrieved.
+ * @param int $options Any number of PGSQL_CONV_FORCE_NULL,
+ * PGSQL_DML_NO_CONV,
+ * PGSQL_DML_ESCAPE,
+ * PGSQL_DML_EXEC,
+ * PGSQL_DML_ASYNC or
+ * PGSQL_DML_STRING combined. If PGSQL_DML_STRING is part of the
+ * options then query string is returned. When PGSQL_DML_NO_CONV
+ * or PGSQL_DML_ESCAPE is set, it does not call pg_convert internally.
+ * @param int $result_type
+ * @return mixed Returns TRUE on success. Returns string if PGSQL_DML_STRING is passed
+ * via options.
+ * @throws PgsqlException
+ *
+ */
+function pg_select($connection, string $table_name, array $assoc_array, int $options = PGSQL_DML_EXEC, int $result_type = PGSQL_ASSOC)
+{
+ error_clear_last();
+ $result = \pg_select($connection, $table_name, $assoc_array, $options, $result_type);
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Sends a request to execute a prepared statement with given parameters,
+ * without waiting for the result(s).
+ *
+ * This is similar to pg_send_query_params, but the command to be executed is specified
+ * by naming a previously-prepared statement, instead of giving a query string. The
+ * function's parameters are handled identically to pg_execute.
+ * Like pg_execute, it will not work on pre-7.4 versions of
+ * PostgreSQL.
+ *
+ * @param resource $connection PostgreSQL database connection resource. When
+ * connection is not present, the default connection
+ * is used. The default connection is the last connection made by
+ * pg_connect or pg_pconnect.
+ * @param string $stmtname The name of the prepared statement to execute. if
+ * "" is specified, then the unnamed statement is executed. The name must have
+ * been previously prepared using pg_prepare,
+ * pg_send_prepare or a PREPARE SQL
+ * command.
+ * @param array $params An array of parameter values to substitute for the $1, $2, etc. placeholders
+ * in the original prepared query string. The number of elements in the array
+ * must match the number of placeholders.
+ * @throws PgsqlException
+ *
+ */
+function pg_send_execute($connection, string $stmtname, array $params): void
+{
+ error_clear_last();
+ $result = \pg_send_execute($connection, $stmtname, $params);
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sends a request to create a prepared statement with the given parameters,
+ * without waiting for completion.
+ *
+ * This is an asynchronous version of pg_prepare: it returns TRUE if it was able to
+ * dispatch the request, and FALSE if not. After a successful call, call
+ * pg_get_result to determine whether the server successfully created the
+ * prepared statement. The function's parameters are handled identically to
+ * pg_prepare. Like pg_prepare, it will not work
+ * on pre-7.4 versions of PostgreSQL.
+ *
+ * @param resource $connection PostgreSQL database connection resource. When
+ * connection is not present, the default connection
+ * is used. The default connection is the last connection made by
+ * pg_connect or pg_pconnect.
+ * @param string $stmtname The name to give the prepared statement. Must be unique per-connection. If
+ * "" is specified, then an unnamed statement is created, overwriting any
+ * previously defined unnamed statement.
+ * @param string $query The parameterized SQL statement. Must contain only a single statement.
+ * (multiple statements separated by semi-colons are not allowed.) If any parameters
+ * are used, they are referred to as $1, $2, etc.
+ * @throws PgsqlException
+ *
+ */
+function pg_send_prepare($connection, string $stmtname, string $query): void
+{
+ error_clear_last();
+ $result = \pg_send_prepare($connection, $stmtname, $query);
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Submits a command and separate parameters to the server without
+ * waiting for the result(s).
+ *
+ * This is equivalent to pg_send_query except that query
+ * parameters can be specified separately from the
+ * query string. The function's parameters are
+ * handled identically to pg_query_params. Like
+ * pg_query_params, it will not work on pre-7.4 PostgreSQL
+ * connections, and it allows only one command in the query string.
+ *
+ * @param resource $connection PostgreSQL database connection resource.
+ * @param string $query The parameterized SQL statement. Must contain only a single statement.
+ * (multiple statements separated by semi-colons are not allowed.) If any parameters
+ * are used, they are referred to as $1, $2, etc.
+ * @param array $params An array of parameter values to substitute for the $1, $2, etc. placeholders
+ * in the original prepared query string. The number of elements in the array
+ * must match the number of placeholders.
+ * @throws PgsqlException
+ *
+ */
+function pg_send_query_params($connection, string $query, array $params): void
+{
+ error_clear_last();
+ $result = \pg_send_query_params($connection, $query, $params);
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * pg_send_query sends a query or queries asynchronously to the
+ * connection. Unlike
+ * pg_query, it can send multiple queries at once to
+ * PostgreSQL and get the results one by one using
+ * pg_get_result.
+ *
+ * Script execution is not blocked while the queries are executing. Use
+ * pg_connection_busy to check if the connection is
+ * busy (i.e. the query is executing). Queries may be cancelled using
+ * pg_cancel_query.
+ *
+ * Although the user can send multiple queries at once, multiple queries
+ * cannot be sent over a busy connection. If a query is sent while
+ * the connection is busy, it waits until the last query is finished and
+ * discards all its results.
+ *
+ * @param resource $connection PostgreSQL database connection resource.
+ * @param string $query The SQL statement or statements to be executed.
+ *
+ * Data inside the query should be properly escaped.
+ * @throws PgsqlException
+ *
+ */
+function pg_send_query($connection, string $query): void
+{
+ error_clear_last();
+ $result = \pg_send_query($connection, $query);
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * pg_socket returns a read only resource
+ * corresponding to the socket underlying the given PostgreSQL connection.
+ *
+ * @param resource $connection PostgreSQL database connection resource.
+ * @return resource A socket resource on success.
+ * @throws PgsqlException
+ *
+ */
+function pg_socket($connection)
+{
+ error_clear_last();
+ $result = \pg_socket($connection);
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_trace enables tracing of the PostgreSQL
+ * frontend/backend communication to a file. To fully understand the results,
+ * one needs to be familiar with the internals of PostgreSQL
+ * communication protocol.
+ *
+ * For those who are not, it can still be
+ * useful for tracing errors in queries sent to the server, you
+ * could do for example grep '^To backend'
+ * trace.log and see what queries actually were sent to the
+ * PostgreSQL server. For more information, refer to the
+ * PostgreSQL Documentation.
+ *
+ * @param string $pathname The full path and file name of the file in which to write the
+ * trace log. Same as in fopen.
+ * @param string $mode An optional file access mode, same as for fopen.
+ * @param resource $connection PostgreSQL database connection resource. When
+ * connection is not present, the default connection
+ * is used. The default connection is the last connection made by
+ * pg_connect or pg_pconnect.
+ * @throws PgsqlException
+ *
+ */
+function pg_trace(string $pathname, string $mode = "w", $connection = null): void
+{
+ error_clear_last();
+ if ($connection !== null) {
+ $result = \pg_trace($pathname, $mode, $connection);
+ } else {
+ $result = \pg_trace($pathname, $mode);
+ }
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+}
+
+
+/**
+ * pg_tty returns the TTY name that server
+ * side debugging output is sent to on the given PostgreSQL
+ * connection resource.
+ *
+ * @param resource $connection PostgreSQL database connection resource. When
+ * connection is not present, the default connection
+ * is used. The default connection is the last connection made by
+ * pg_connect or pg_pconnect.
+ * @return string A string containing the debug TTY of
+ * the connection.
+ * @throws PgsqlException
+ *
+ */
+function pg_tty($connection = null): string
+{
+ error_clear_last();
+ if ($connection !== null) {
+ $result = \pg_tty($connection);
+ } else {
+ $result = \pg_tty();
+ }
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_update updates records that matches
+ * condition with data. If
+ * options is specified,
+ * pg_convert is applied to
+ * data with specified options.
+ *
+ * pg_update updates records specified by
+ * assoc_array which has
+ * field=&gt;value.
+ *
+ * If options is specified,
+ * pg_convert is applied to
+ * assoc_array with the specified flags.
+ *
+ * By default pg_update passes raw values. Values
+ * must be escaped or PGSQL_DML_ESCAPE option must be
+ * specified. PGSQL_DML_ESCAPE quotes and escapes
+ * parameters/identifiers. Therefore, table/column names became case
+ * sensitive.
+ *
+ * Note that neither escape nor prepared query can protect LIKE query,
+ * JSON, Array, Regex, etc. These parameters should be handled
+ * according to their contexts. i.e. Escape/validate values.
+ *
+ * @param resource $connection PostgreSQL database connection resource.
+ * @param string $table_name Name of the table into which to update rows.
+ * @param array $data An array whose keys are field names in the table table_name,
+ * and whose values are what matched rows are to be updated to.
+ * @param array $condition An array whose keys are field names in the table table_name,
+ * and whose values are the conditions that a row must meet to be updated.
+ * @param int $options Any number of PGSQL_CONV_FORCE_NULL,
+ * PGSQL_DML_NO_CONV,
+ * PGSQL_DML_ESCAPE,
+ * PGSQL_DML_EXEC,
+ * PGSQL_DML_ASYNC or
+ * PGSQL_DML_STRING combined. If PGSQL_DML_STRING is part of the
+ * options then query string is returned. When PGSQL_DML_NO_CONV
+ * or PGSQL_DML_ESCAPE is set, it does not call pg_convert internally.
+ * @return mixed Returns TRUE on success. Returns string if PGSQL_DML_STRING is passed
+ * via options.
+ * @throws PgsqlException
+ *
+ */
+function pg_update($connection, string $table_name, array $data, array $condition, int $options = PGSQL_DML_EXEC)
+{
+ error_clear_last();
+ $result = \pg_update($connection, $table_name, $data, $condition, $options);
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pg_version returns an array with the client, protocol
+ * and server version. Protocol and server versions are only available if PHP
+ * was compiled with PostgreSQL 7.4 or later.
+ *
+ * For more detailed server information, use pg_parameter_status.
+ *
+ * @param resource $connection PostgreSQL database connection resource. When
+ * connection is not present, the default connection
+ * is used. The default connection is the last connection made by
+ * pg_connect or pg_pconnect.
+ * @return array Returns an array with client, protocol
+ * and server keys and values (if available) or invalid connection.
+ * @throws PgsqlException
+ *
+ */
+function pg_version($connection = null): array
+{
+ error_clear_last();
+ if ($connection !== null) {
+ $result = \pg_version($connection);
+ } else {
+ $result = \pg_version();
+ }
+ if ($result === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/posix.php b/vendor/thecodingmachine/safe/generated/posix.php
new file mode 100644
index 000000000..6ae99d88c
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/posix.php
@@ -0,0 +1,329 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\PosixException;
+
+/**
+ * posix_access checks the user's permission of a file.
+ *
+ * @param string $file The name of the file to be tested.
+ * @param int $mode A mask consisting of one or more of POSIX_F_OK,
+ * POSIX_R_OK, POSIX_W_OK and
+ * POSIX_X_OK.
+ *
+ * POSIX_R_OK, POSIX_W_OK and
+ * POSIX_X_OK request checking whether the file
+ * exists and has read, write and execute permissions, respectively.
+ * POSIX_F_OK just requests checking for the
+ * existence of the file.
+ * @throws PosixException
+ *
+ */
+function posix_access(string $file, int $mode = POSIX_F_OK): void
+{
+ error_clear_last();
+ $result = \posix_access($file, $mode);
+ if ($result === false) {
+ throw PosixException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Gets information about a group provided its name.
+ *
+ * @param string $name The name of the group
+ * @return array Returns an array on success.
+ * The array elements returned are:
+ *
+ * The group information array
+ *
+ *
+ *
+ * Element
+ * Description
+ *
+ *
+ *
+ *
+ * name
+ *
+ * The name element contains the name of the group. This is
+ * a short, usually less than 16 character "handle" of the
+ * group, not the real, full name. This should be the same as
+ * the name parameter used when
+ * calling the function, and hence redundant.
+ *
+ *
+ *
+ * passwd
+ *
+ * The passwd element contains the group's password in an
+ * encrypted format. Often, for example on a system employing
+ * "shadow" passwords, an asterisk is returned instead.
+ *
+ *
+ *
+ * gid
+ *
+ * Group ID of the group in numeric form.
+ *
+ *
+ *
+ * members
+ *
+ * This consists of an array of
+ * string's for all the members in the group.
+ *
+ *
+ *
+ *
+ *
+ * @throws PosixException
+ *
+ */
+function posix_getgrnam(string $name): array
+{
+ error_clear_last();
+ $result = \posix_getgrnam($name);
+ if ($result === false) {
+ throw PosixException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Returns the process group identifier of the process
+ * pid.
+ *
+ * @param int $pid The process id.
+ * @return int Returns the identifier, as an integer.
+ * @throws PosixException
+ *
+ */
+function posix_getpgid(int $pid): int
+{
+ error_clear_last();
+ $result = \posix_getpgid($pid);
+ if ($result === false) {
+ throw PosixException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Calculates the group access list for the user specified in name.
+ *
+ * @param string $name The user to calculate the list for.
+ * @param int $base_group_id Typically the group number from the password file.
+ * @throws PosixException
+ *
+ */
+function posix_initgroups(string $name, int $base_group_id): void
+{
+ error_clear_last();
+ $result = \posix_initgroups($name, $base_group_id);
+ if ($result === false) {
+ throw PosixException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Send the signal sig to the process with
+ * the process identifier pid.
+ *
+ * @param int $pid The process identifier.
+ * @param int $sig One of the PCNTL signals constants.
+ * @throws PosixException
+ *
+ */
+function posix_kill(int $pid, int $sig): void
+{
+ error_clear_last();
+ $result = \posix_kill($pid, $sig);
+ if ($result === false) {
+ throw PosixException::createFromPhpError();
+ }
+}
+
+
+/**
+ * posix_mkfifo creates a special
+ * FIFO file which exists in the file system and acts as
+ * a bidirectional communication endpoint for processes.
+ *
+ * @param string $pathname Path to the FIFO file.
+ * @param int $mode The second parameter mode has to be given in
+ * octal notation (e.g. 0644). The permission of the newly created
+ * FIFO also depends on the setting of the current
+ * umask. The permissions of the created file are
+ * (mode &amp; ~umask).
+ * @throws PosixException
+ *
+ */
+function posix_mkfifo(string $pathname, int $mode): void
+{
+ error_clear_last();
+ $result = \posix_mkfifo($pathname, $mode);
+ if ($result === false) {
+ throw PosixException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Creates a special or ordinary file.
+ *
+ * @param string $pathname The file to create
+ * @param int $mode This parameter is constructed by a bitwise OR between file type (one of
+ * the following constants: POSIX_S_IFREG,
+ * POSIX_S_IFCHR, POSIX_S_IFBLK,
+ * POSIX_S_IFIFO or
+ * POSIX_S_IFSOCK) and permissions.
+ * @param int $major The major device kernel identifier (required to pass when using
+ * S_IFCHR or S_IFBLK).
+ * @param int $minor The minor device kernel identifier.
+ * @throws PosixException
+ *
+ */
+function posix_mknod(string $pathname, int $mode, int $major = 0, int $minor = 0): void
+{
+ error_clear_last();
+ $result = \posix_mknod($pathname, $mode, $major, $minor);
+ if ($result === false) {
+ throw PosixException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Set the effective group ID of the current process. This is a
+ * privileged function and needs appropriate privileges (usually
+ * root) on the system to be able to perform this function.
+ *
+ * @param int $gid The group id.
+ * @throws PosixException
+ *
+ */
+function posix_setegid(int $gid): void
+{
+ error_clear_last();
+ $result = \posix_setegid($gid);
+ if ($result === false) {
+ throw PosixException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Set the effective user ID of the current process. This is a privileged
+ * function and needs appropriate privileges (usually root) on
+ * the system to be able to perform this function.
+ *
+ * @param int $uid The user id.
+ * @throws PosixException
+ *
+ */
+function posix_seteuid(int $uid): void
+{
+ error_clear_last();
+ $result = \posix_seteuid($uid);
+ if ($result === false) {
+ throw PosixException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Set the real group ID of the current process. This is a
+ * privileged function and needs appropriate privileges (usually
+ * root) on the system to be able to perform this function. The
+ * appropriate order of function calls is
+ * posix_setgid first,
+ * posix_setuid last.
+ *
+ * @param int $gid The group id.
+ * @throws PosixException
+ *
+ */
+function posix_setgid(int $gid): void
+{
+ error_clear_last();
+ $result = \posix_setgid($gid);
+ if ($result === false) {
+ throw PosixException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Let the process pid join the process group
+ * pgid.
+ *
+ * @param int $pid The process id.
+ * @param int $pgid The process group id.
+ * @throws PosixException
+ *
+ */
+function posix_setpgid(int $pid, int $pgid): void
+{
+ error_clear_last();
+ $result = \posix_setpgid($pid, $pgid);
+ if ($result === false) {
+ throw PosixException::createFromPhpError();
+ }
+}
+
+
+/**
+ * posix_setrlimit sets the soft and hard limits for a
+ * given system resource.
+ *
+ *
+ * Each resource has an associated soft and hard limit. The soft
+ * limit is the value that the kernel enforces for the corresponding
+ * resource. The hard limit acts as a ceiling for the soft limit.
+ * An unprivileged process may only set its soft limit to a value
+ * from 0 to the hard limit, and irreversibly lower its hard limit.
+ *
+ * @param int $resource The
+ * resource limit constant
+ * corresponding to the limit that is being set.
+ * @param int $softlimit The soft limit, in whatever unit the resource limit requires, or
+ * POSIX_RLIMIT_INFINITY.
+ * @param int $hardlimit The hard limit, in whatever unit the resource limit requires, or
+ * POSIX_RLIMIT_INFINITY.
+ * @throws PosixException
+ *
+ */
+function posix_setrlimit(int $resource, int $softlimit, int $hardlimit): void
+{
+ error_clear_last();
+ $result = \posix_setrlimit($resource, $softlimit, $hardlimit);
+ if ($result === false) {
+ throw PosixException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Set the real user ID of the current process. This is a privileged
+ * function that needs appropriate privileges (usually root) on
+ * the system to be able to perform this function.
+ *
+ * @param int $uid The user id.
+ * @throws PosixException
+ *
+ */
+function posix_setuid(int $uid): void
+{
+ error_clear_last();
+ $result = \posix_setuid($uid);
+ if ($result === false) {
+ throw PosixException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/ps.php b/vendor/thecodingmachine/safe/generated/ps.php
new file mode 100644
index 000000000..a66667aa9
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/ps.php
@@ -0,0 +1,1812 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\PsException;
+
+/**
+ * Places a hyperlink at the given position pointing to a file program
+ * which is being started when clicked on. The hyperlink's source position
+ * is a rectangle
+ * with its lower left corner at (llx, lly) and its upper right corner at
+ * (urx, ury). The rectangle has by default a thin blue border.
+ *
+ * The note will not be visible if the document
+ * is printed or viewed but it will show up if the document is converted to
+ * pdf by either Acrobat Distiller™ or Ghostview.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param float $llx The x-coordinate of the lower left corner.
+ * @param float $lly The y-coordinate of the lower left corner.
+ * @param float $urx The x-coordinate of the upper right corner.
+ * @param float $ury The y-coordinate of the upper right corner.
+ * @param string $filename The path of the program to be started, when the link is clicked on.
+ * @throws PsException
+ *
+ */
+function ps_add_launchlink($psdoc, float $llx, float $lly, float $urx, float $ury, string $filename): void
+{
+ error_clear_last();
+ $result = \ps_add_launchlink($psdoc, $llx, $lly, $urx, $ury, $filename);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Places a hyperlink at the given position pointing to a page in the same
+ * document. Clicking on the link will jump to the given page. The first page
+ * in a document has number 1.
+ *
+ * The hyperlink's source position is a rectangle with its lower left corner at
+ * (llx, lly) and its upper
+ * right corner at (urx, ury).
+ * The rectangle has by default a thin blue border.
+ *
+ * The note will not be visible if the document
+ * is printed or viewed but it will show up if the document is converted to
+ * pdf by either Acrobat Distiller™ or Ghostview.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param float $llx The x-coordinate of the lower left corner.
+ * @param float $lly The y-coordinate of the lower left corner.
+ * @param float $urx The x-coordinate of the upper right corner.
+ * @param float $ury The y-coordinate of the upper right corner.
+ * @param int $page The number of the page displayed when clicking on the link.
+ * @param string $dest The parameter dest determines how the document
+ * is being viewed. It can be fitpage,
+ * fitwidth, fitheight, or
+ * fitbbox.
+ * @throws PsException
+ *
+ */
+function ps_add_locallink($psdoc, float $llx, float $lly, float $urx, float $ury, int $page, string $dest): void
+{
+ error_clear_last();
+ $result = \ps_add_locallink($psdoc, $llx, $lly, $urx, $ury, $page, $dest);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Adds a note at a certain position on the page. Notes are like little
+ * rectangular sheets with text on it, which can be placed anywhere on
+ * a page. They
+ * are shown either folded or unfolded. If folded, the specified icon
+ * is used as a placeholder.
+ *
+ * The note will not be visible if the document
+ * is printed or viewed but it will show up if the document is converted to
+ * pdf by either Acrobat Distiller™ or Ghostview.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param float $llx The x-coordinate of the lower left corner.
+ * @param float $lly The y-coordinate of the lower left corner.
+ * @param float $urx The x-coordinate of the upper right corner.
+ * @param float $ury The y-coordinate of the upper right corner.
+ * @param string $contents The text of the note.
+ * @param string $title The title of the note as displayed in the header of the note.
+ * @param string $icon The icon shown if the note is folded. This parameter can be set
+ * to comment, insert,
+ * note, paragraph,
+ * newparagraph, key, or
+ * help.
+ * @param int $open If open is unequal to zero the note will
+ * be shown unfolded after opening the document with a pdf viewer.
+ * @throws PsException
+ *
+ */
+function ps_add_note($psdoc, float $llx, float $lly, float $urx, float $ury, string $contents, string $title, string $icon, int $open): void
+{
+ error_clear_last();
+ $result = \ps_add_note($psdoc, $llx, $lly, $urx, $ury, $contents, $title, $icon, $open);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Places a hyperlink at the given position pointing to a second pdf document.
+ * Clicking on the link will branch to the document at the given page. The
+ * first page in a document has number 1.
+ *
+ * The hyperlink's source position is a rectangle with its lower left corner at
+ * (llx, lly) and its upper
+ * right corner at (urx, ury).
+ * The rectangle has by default a thin blue border.
+ *
+ * The note will not be visible if the document
+ * is printed or viewed but it will show up if the document is converted to
+ * pdf by either Acrobat Distiller™ or Ghostview.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param float $llx The x-coordinate of the lower left corner.
+ * @param float $lly The y-coordinate of the lower left corner.
+ * @param float $urx The x-coordinate of the upper right corner.
+ * @param float $ury The y-coordinate of the upper right corner.
+ * @param string $filename The name of the pdf document to be opened when clicking on
+ * this link.
+ * @param int $page The page number of the destination pdf document
+ * @param string $dest The parameter dest determines how the document
+ * is being viewed. It can be fitpage,
+ * fitwidth, fitheight, or
+ * fitbbox.
+ * @throws PsException
+ *
+ */
+function ps_add_pdflink($psdoc, float $llx, float $lly, float $urx, float $ury, string $filename, int $page, string $dest): void
+{
+ error_clear_last();
+ $result = \ps_add_pdflink($psdoc, $llx, $lly, $urx, $ury, $filename, $page, $dest);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Places a hyperlink at the given position pointing to a web page. The
+ * hyperlink's source position is a rectangle with its lower left corner at
+ * (llx, lly) and
+ * its upper right corner at (urx,
+ * ury). The rectangle has by default a thin
+ * blue border.
+ *
+ * The note will not be visible if the document
+ * is printed or viewed but it will show up if the document is converted to
+ * pdf by either Acrobat Distiller™ or Ghostview.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param float $llx The x-coordinate of the lower left corner.
+ * @param float $lly The y-coordinate of the lower left corner.
+ * @param float $urx The x-coordinate of the upper right corner.
+ * @param float $ury The y-coordinate of the upper right corner.
+ * @param string $url The url of the hyperlink to be opened when clicking on
+ * this link, e.g. http://www.php.net.
+ * @throws PsException
+ *
+ */
+function ps_add_weblink($psdoc, float $llx, float $lly, float $urx, float $ury, string $url): void
+{
+ error_clear_last();
+ $result = \ps_add_weblink($psdoc, $llx, $lly, $urx, $ury, $url);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Draws a portion of a circle with at middle point at
+ * (x, y). The arc starts at an
+ * angle of alpha and ends at an angle of
+ * beta. It is drawn counterclockwise (use
+ * ps_arcn to draw clockwise). The subpath added
+ * to the current path starts on the arc at angle alpha
+ * and ends on the arc at angle beta.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param float $x The x-coordinate of the circle's middle point.
+ * @param float $y The y-coordinate of the circle's middle point.
+ * @param float $radius The radius of the circle
+ * @param float $alpha The start angle given in degrees.
+ * @param float $beta The end angle given in degrees.
+ * @throws PsException
+ *
+ */
+function ps_arc($psdoc, float $x, float $y, float $radius, float $alpha, float $beta): void
+{
+ error_clear_last();
+ $result = \ps_arc($psdoc, $x, $y, $radius, $alpha, $beta);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Draws a portion of a circle with at middle point at
+ * (x, y). The arc starts at an
+ * angle of alpha and ends at an angle of
+ * beta. It is drawn clockwise (use
+ * ps_arc to draw counterclockwise). The subpath added to
+ * the current path starts on the arc at angle beta and
+ * ends on the arc at angle alpha.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param float $x The x-coordinate of the circle's middle point.
+ * @param float $y The y-coordinate of the circle's middle point.
+ * @param float $radius The radius of the circle
+ * @param float $alpha The starting angle given in degrees.
+ * @param float $beta The end angle given in degrees.
+ * @throws PsException
+ *
+ */
+function ps_arcn($psdoc, float $x, float $y, float $radius, float $alpha, float $beta): void
+{
+ error_clear_last();
+ $result = \ps_arcn($psdoc, $x, $y, $radius, $alpha, $beta);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Starts a new page. Although the parameters width
+ * and height imply a different page size for each
+ * page, this is not possible in PostScript. The first call of
+ * ps_begin_page will set the page size for the whole
+ * document. Consecutive calls will have no effect, except for creating a new
+ * page. The situation is different if you intent to convert the PostScript
+ * document into PDF. This function places pdfmarks into the document which
+ * can set the size for each page indiviually. The resulting PDF document will
+ * have different page sizes.
+ *
+ * Though PostScript does not know different page sizes, pslib places
+ * a bounding box for each page into the document. This size is evaluated
+ * by some PostScript viewers and will have precedence over the BoundingBox
+ * in the Header of the document. This can lead to unexpected results when
+ * you set a BoundingBox whose lower left corner is not (0, 0), because the
+ * bounding box of the page will always have a lower left corner (0, 0)
+ * and overwrites the global setting.
+ *
+ * Each page is encapsulated into save/restore. This means, that most of the
+ * settings made on one page will not be retained on the next page.
+ *
+ * If there is up to the first call of ps_begin_page no
+ * call of ps_findfont, then the header of the PostScript
+ * document will be output and the bounding box will be set to the size of
+ * the first page. The lower left corner of the bounding box is set to (0, 0).
+ * If ps_findfont was called before, then the
+ * header has been output already, and the document will not have a valid
+ * bounding box. In order to prevent this, one should call
+ * ps_set_info to set the info field
+ * BoundingBox and possibly Orientation
+ * before any ps_findfont or
+ * ps_begin_page calls.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param float $width The width of the page in pixel, e.g. 596 for A4 format.
+ * @param float $height The height of the page in pixel, e.g. 842 for A4 format.
+ * @throws PsException
+ *
+ */
+function ps_begin_page($psdoc, float $width, float $height): void
+{
+ error_clear_last();
+ $result = \ps_begin_page($psdoc, $width, $height);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Starts a new pattern. A pattern is like a page containing e.g. a drawing
+ * which can be used for filling areas. It is used like a color by calling
+ * ps_setcolor and setting the color space to
+ * pattern.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param float $width The width of the pattern in pixel.
+ * @param float $height The height of the pattern in pixel.
+ * @param float $xstep The distance in pixel of placements of the pattern in
+ * horizontal direction.
+ * @param float $ystep The distance in pixel of placements of the pattern in
+ * vertical direction.
+ * @param int $painttype Must be 1 or 2.
+ * @return int The identifier of the pattern.
+ * @throws PsException
+ *
+ */
+function ps_begin_pattern($psdoc, float $width, float $height, float $xstep, float $ystep, int $painttype): int
+{
+ error_clear_last();
+ $result = \ps_begin_pattern($psdoc, $width, $height, $xstep, $ystep, $painttype);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Starts a new template. A template is called a form in the postscript
+ * language. It is created similar to a pattern but used like an image.
+ * Templates are often used for drawings which are placed several times
+ * through out the document, e.g. like a company logo. All drawing functions
+ * may be used within a template. The template will not be drawn until
+ * it is placed by ps_place_image.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param float $width The width of the template in pixel.
+ * @param float $height The height of the template in pixel.
+ * @return int Returns TRUE on success.
+ * @throws PsException
+ *
+ */
+function ps_begin_template($psdoc, float $width, float $height): int
+{
+ error_clear_last();
+ $result = \ps_begin_template($psdoc, $width, $height);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Draws a circle with its middle point at (x,
+ * y). The circle starts and ends at position
+ * (x+radius,
+ * y). If this function is called outside a path it
+ * will start a new path. If it is called within a path it will add the circle
+ * as a subpath. If the last drawing operation does not end in point
+ * (x+radius,
+ * y) then there will be a gap in the path.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param float $x The x-coordinate of the circle's middle point.
+ * @param float $y The y-coordinate of the circle's middle point.
+ * @param float $radius The radius of the circle
+ * @throws PsException
+ *
+ */
+function ps_circle($psdoc, float $x, float $y, float $radius): void
+{
+ error_clear_last();
+ $result = \ps_circle($psdoc, $x, $y, $radius);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Takes the current path and uses it to define the border of a clipping area.
+ * Everything drawn outside of that area will not be visible.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @throws PsException
+ *
+ */
+function ps_clip($psdoc): void
+{
+ error_clear_last();
+ $result = \ps_clip($psdoc);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Closes an image and frees its resources. Once an image is closed
+ * it cannot be used anymore.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param int $imageid Resource identifier of the image as returned by
+ * ps_open_image or
+ * ps_open_image_file.
+ * @throws PsException
+ *
+ */
+function ps_close_image($psdoc, int $imageid): void
+{
+ error_clear_last();
+ $result = \ps_close_image($psdoc, $imageid);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Closes the PostScript document.
+ *
+ * This function writes the trailer of the PostScript document.
+ * It also writes the bookmark tree. ps_close does
+ * not free any resources, which is done by ps_delete.
+ *
+ * This function is also called by ps_delete if it
+ * has not been called before.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @throws PsException
+ *
+ */
+function ps_close($psdoc): void
+{
+ error_clear_last();
+ $result = \ps_close($psdoc);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Connects the last point with first point of a path and draws the resulting
+ * closed line.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @throws PsException
+ *
+ */
+function ps_closepath_stroke($psdoc): void
+{
+ error_clear_last();
+ $result = \ps_closepath_stroke($psdoc);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Connects the last point with the first point of a path. The resulting
+ * path can be used for stroking, filling, clipping, etc..
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @throws PsException
+ *
+ */
+function ps_closepath($psdoc): void
+{
+ error_clear_last();
+ $result = \ps_closepath($psdoc);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Output a text one line below the last line. The line spacing is
+ * taken from the value "leading" which must be set with
+ * ps_set_value. The actual position of the
+ * text is determined by the values "textx" and "texty" which can be requested
+ * with ps_get_value
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param string $text The text to output.
+ * @throws PsException
+ *
+ */
+function ps_continue_text($psdoc, string $text): void
+{
+ error_clear_last();
+ $result = \ps_continue_text($psdoc, $text);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Add a section of a cubic Bézier curve described by the three given control
+ * points to the current path.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param float $x1 x-coordinate of first control point.
+ * @param float $y1 y-coordinate of first control point.
+ * @param float $x2 x-coordinate of second control point.
+ * @param float $y2 y-coordinate of second control point.
+ * @param float $x3 x-coordinate of third control point.
+ * @param float $y3 y-coordinate of third control point.
+ * @throws PsException
+ *
+ */
+function ps_curveto($psdoc, float $x1, float $y1, float $x2, float $y2, float $x3, float $y3): void
+{
+ error_clear_last();
+ $result = \ps_curveto($psdoc, $x1, $y1, $x2, $y2, $x3, $y3);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Mainly frees memory used by the document. Also closes a file, if it was not
+ * closed before with ps_close. You should in any case
+ * close the file with ps_close before, because
+ * ps_close not just closes the file but also outputs a
+ * trailor containing PostScript comments like the number of pages in the
+ * document and adding the bookmark hierarchy.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @throws PsException
+ *
+ */
+function ps_delete($psdoc): void
+{
+ error_clear_last();
+ $result = \ps_delete($psdoc);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Ends a page which was started with ps_begin_page.
+ * Ending a page will leave the current drawing context, which e.g. requires
+ * to reload fonts if they were loading within the page, and to set many
+ * other drawing parameters like the line width, or color..
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @throws PsException
+ *
+ */
+function ps_end_page($psdoc): void
+{
+ error_clear_last();
+ $result = \ps_end_page($psdoc);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Ends a pattern which was started with ps_begin_pattern.
+ * Once a pattern has been ended, it can be used like a color to fill
+ * areas.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @throws PsException
+ *
+ */
+function ps_end_pattern($psdoc): void
+{
+ error_clear_last();
+ $result = \ps_end_pattern($psdoc);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Ends a template which was started with ps_begin_template.
+ * Once a template has been ended, it can be used like an image.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @throws PsException
+ *
+ */
+function ps_end_template($psdoc): void
+{
+ error_clear_last();
+ $result = \ps_end_template($psdoc);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Fills and draws the path constructed with previously called drawing
+ * functions like ps_lineto.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @throws PsException
+ *
+ */
+function ps_fill_stroke($psdoc): void
+{
+ error_clear_last();
+ $result = \ps_fill_stroke($psdoc);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Fills the path constructed with previously called drawing functions like
+ * ps_lineto.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @throws PsException
+ *
+ */
+function ps_fill($psdoc): void
+{
+ error_clear_last();
+ $result = \ps_fill($psdoc);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Gets several parameters which were directly set by
+ * ps_set_parameter or indirectly by one of the other
+ * functions. Parameters are by definition string
+ * values. This function cannot be used to retrieve resources which were also
+ * set by ps_set_parameter.
+ *
+ * The parameter name can have the following values.
+ *
+ *
+ *
+ * fontname
+ *
+ *
+ * The name of the currently active font or the font whose
+ * identifier is passed in parameter modifier.
+ *
+ *
+ *
+ *
+ * fontencoding
+ *
+ *
+ * The encoding of the currently active font.
+ *
+ *
+ *
+ *
+ * dottedversion
+ *
+ *
+ * The version of the underlying pslib library in the format
+ * &lt;major&gt;.&lt;minor&gt;.&lt;subminor&gt;
+ *
+ *
+ *
+ *
+ * scope
+ *
+ *
+ * The current drawing scope. Can be object, document, null, page,
+ * pattern, path, template, prolog, font, glyph.
+ *
+ *
+ *
+ *
+ * ligaturedisolvechar
+ *
+ *
+ * The character which dissolves a ligature. If your are using a font
+ * which contains the ligature `ff' and `|' is the char to dissolve the
+ * ligature, then `f|f' will result in two `f' instead of the ligature `ff'.
+ *
+ *
+ *
+ *
+ * imageencoding
+ *
+ *
+ * The encoding used for encoding images. Can be either
+ * hex or 85. hex encoding
+ * uses two bytes in the postscript file each byte in the image.
+ * 85 stand for Ascii85 encoding.
+ *
+ *
+ *
+ *
+ * linenumbermode
+ *
+ *
+ * Set to paragraph if lines are numbered
+ * within a paragraph or box if they are
+ * numbered within the surrounding box.
+ *
+ *
+ *
+ *
+ * linebreak
+ *
+ *
+ * Only used if text is output with ps_show_boxed.
+ * If set to TRUE a carriage return will add a line
+ * break.
+ *
+ *
+ *
+ *
+ * parbreak
+ *
+ *
+ * Only used if text is output with ps_show_boxed.
+ * If set to TRUE a carriage return will start
+ * a new paragraph.
+ *
+ *
+ *
+ *
+ * hyphenation
+ *
+ *
+ * Only used if text is output with ps_show_boxed.
+ * If set to TRUE the paragraph will be hyphenated
+ * if a hypen dictionary is set and exists.
+ *
+ *
+ *
+ *
+ * hyphendict
+ *
+ *
+ * Filename of the dictionary used for hyphenation pattern.
+ *
+ *
+ *
+ *
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param string $name Name of the parameter.
+ * @param float $modifier An identifier needed if a parameter of a resource is requested,
+ * e.g. the size of an image. In such a case the resource id is
+ * passed.
+ * @return string Returns the value of the parameter.
+ * @throws PsException
+ *
+ */
+function ps_get_parameter($psdoc, string $name, float $modifier = null): string
+{
+ error_clear_last();
+ if ($modifier !== null) {
+ $result = \ps_get_parameter($psdoc, $name, $modifier);
+ } else {
+ $result = \ps_get_parameter($psdoc, $name);
+ }
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Hyphenates the passed word. ps_hyphenate evaluates the
+ * value hyphenminchars (set by ps_set_value) and
+ * the parameter hyphendict (set by ps_set_parameter).
+ * hyphendict must be set before calling this function.
+ *
+ * This function requires the locale category LC_CTYPE to be set properly.
+ * This is done when the extension is initialized by using the environment
+ * variables. On Unix systems read the man page of locale for more information.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param string $text text should not contain any non alpha
+ * characters. Possible positions for breaks are returned in an array of
+ * interger numbers. Each number is the position of the char in
+ * text after which a hyphenation can take place.
+ * @return array An array of integers indicating the position of possible breaks in
+ * the text.
+ * @throws PsException
+ *
+ */
+function ps_hyphenate($psdoc, string $text): array
+{
+ error_clear_last();
+ $result = \ps_hyphenate($psdoc, $text);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * This function is
+ * currently not documented; only its argument list is available.
+ *
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param string $file
+ * @throws PsException
+ *
+ */
+function ps_include_file($psdoc, string $file): void
+{
+ error_clear_last();
+ $result = \ps_include_file($psdoc, $file);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Adds a straight line from the current point to the given coordinates to the
+ * current path. Use ps_moveto to set the starting point
+ * of the line.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param float $x x-coordinate of the end point of the line.
+ * @param float $y y-coordinate of the end point of the line.
+ * @throws PsException
+ *
+ */
+function ps_lineto($psdoc, float $x, float $y): void
+{
+ error_clear_last();
+ $result = \ps_lineto($psdoc, $x, $y);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the current point to new coordinates. If this is the first call of
+ * ps_moveto after a previous path has been ended then it
+ * will start a new path. If this function is called in the middle of a path
+ * it will just set the current point and start a subpath.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param float $x x-coordinate of the point to move to.
+ * @param float $y y-coordinate of the point to move to.
+ * @throws PsException
+ *
+ */
+function ps_moveto($psdoc, float $x, float $y): void
+{
+ error_clear_last();
+ $result = \ps_moveto($psdoc, $x, $y);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Creates a new document instance. It does not create the file on disk or in
+ * memory, it just sets up everything. ps_new is usually
+ * followed by a call of ps_open_file to actually create
+ * the postscript document.
+ *
+ * @return resource Resource of PostScript document. The return value
+ * is passed to all other functions as the first argument.
+ * @throws PsException
+ *
+ */
+function ps_new()
+{
+ error_clear_last();
+ $result = \ps_new();
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Creates a new file on disk and writes the PostScript document into it. The
+ * file will be closed when ps_close is called.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param string $filename The name of the postscript file.
+ * If filename is not passed the document will be
+ * created in memory and all output will go straight to the browser.
+ * @throws PsException
+ *
+ */
+function ps_open_file($psdoc, string $filename = null): void
+{
+ error_clear_last();
+ if ($filename !== null) {
+ $result = \ps_open_file($psdoc, $filename);
+ } else {
+ $result = \ps_open_file($psdoc);
+ }
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Places a formerly loaded image on the page. The image can be scaled.
+ * If the image shall be rotated as well, you will have to rotate the
+ * coordinate system before with ps_rotate.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param int $imageid The resource identifier of the image as returned by
+ * ps_open_image or
+ * ps_open_image_file.
+ * @param float $x x-coordinate of the lower left corner of the image.
+ * @param float $y y-coordinate of the lower left corner of the image.
+ * @param float $scale The scaling factor for the image. A scale of 1.0 will result
+ * in a resolution of 72 dpi, because each pixel is equivalent to
+ * 1 point.
+ * @throws PsException
+ *
+ */
+function ps_place_image($psdoc, int $imageid, float $x, float $y, float $scale): void
+{
+ error_clear_last();
+ $result = \ps_place_image($psdoc, $imageid, $x, $y, $scale);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Draws a rectangle with its lower left corner at (x,
+ * y). The rectangle starts and ends in its lower left
+ * corner. If this function is called outside a path it will start a new path.
+ * If it is called within a path it will add the rectangle as a subpath. If
+ * the last drawing operation does not end in the lower left corner then there
+ * will be a gap in the path.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param float $x x-coordinate of the lower left corner of the rectangle.
+ * @param float $y y-coordinate of the lower left corner of the rectangle.
+ * @param float $width The width of the image.
+ * @param float $height The height of the image.
+ * @throws PsException
+ *
+ */
+function ps_rect($psdoc, float $x, float $y, float $width, float $height): void
+{
+ error_clear_last();
+ $result = \ps_rect($psdoc, $x, $y, $width, $height);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Restores a previously saved graphics context. Any call of
+ * ps_save must be accompanied by a call to
+ * ps_restore. All coordinate transformations, line
+ * style settings, color settings, etc. are being restored to the state
+ * before the call of ps_save.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @throws PsException
+ *
+ */
+function ps_restore($psdoc): void
+{
+ error_clear_last();
+ $result = \ps_restore($psdoc);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the rotation of the coordinate system.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param float $rot Angle of rotation in degree.
+ * @throws PsException
+ *
+ */
+function ps_rotate($psdoc, float $rot): void
+{
+ error_clear_last();
+ $result = \ps_rotate($psdoc, $rot);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Saves the current graphics context, containing colors, translation and
+ * rotation settings and some more. A saved context can be restored with
+ * ps_restore.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @throws PsException
+ *
+ */
+function ps_save($psdoc): void
+{
+ error_clear_last();
+ $result = \ps_save($psdoc);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets horizontal and vertical scaling of the coordinate system.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param float $x Scaling factor in horizontal direction.
+ * @param float $y Scaling factor in vertical direction.
+ * @throws PsException
+ *
+ */
+function ps_scale($psdoc, float $x, float $y): void
+{
+ error_clear_last();
+ $result = \ps_scale($psdoc, $x, $y);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Links added with one of the functions ps_add_weblink,
+ * ps_add_pdflink, etc. will be displayed with a
+ * surounded rectangle when the postscript document is converted to
+ * pdf and viewed in a pdf viewer. This rectangle is not visible in
+ * the postscript document.
+ * This function sets the color of the rectangle's border line.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param float $red The red component of the border color.
+ * @param float $green The green component of the border color.
+ * @param float $blue The blue component of the border color.
+ * @throws PsException
+ *
+ */
+function ps_set_border_color($psdoc, float $red, float $green, float $blue): void
+{
+ error_clear_last();
+ $result = \ps_set_border_color($psdoc, $red, $green, $blue);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Links added with one of the functions ps_add_weblink,
+ * ps_add_pdflink, etc. will be displayed with a
+ * surounded rectangle when the postscript document is converted to
+ * pdf and viewed in a pdf viewer. This rectangle is not visible in
+ * the postscript document.
+ * This function sets the length of the black and white portion of a
+ * dashed border line.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param float $black The length of the dash.
+ * @param float $white The length of the gap between dashes.
+ * @throws PsException
+ *
+ */
+function ps_set_border_dash($psdoc, float $black, float $white): void
+{
+ error_clear_last();
+ $result = \ps_set_border_dash($psdoc, $black, $white);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Links added with one of the functions ps_add_weblink,
+ * ps_add_pdflink, etc. will be displayed with a
+ * surounded rectangle when the postscript document is converted to
+ * pdf and viewed in a pdf viewer. This rectangle is not visible in
+ * the postscript document.
+ * This function sets the appearance and width of the border line.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param string $style style can be solid or
+ * dashed.
+ * @param float $width The line width of the border.
+ * @throws PsException
+ *
+ */
+function ps_set_border_style($psdoc, string $style, float $width): void
+{
+ error_clear_last();
+ $result = \ps_set_border_style($psdoc, $style, $width);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets certain information fields of the document. This fields will be shown
+ * as a comment in the header of the PostScript file. If the document is
+ * converted to pdf this fields will also be used for the document
+ * information.
+ *
+ * The BoundingBox is usually set to the value given to the
+ * first page. This only works if ps_findfont has not
+ * been called before. In such cases the BoundingBox would be left unset
+ * unless you set it explicitly with this function.
+ *
+ * This function will have no effect anymore when the header of the postscript
+ * file has been already written. It must be called before the first page
+ * or the first call of ps_findfont.
+ *
+ * @param resource $p Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param string $key The name of the information field to set. The values which can be
+ * set are Keywords, Subject,
+ * Title, Creator,
+ * Author, BoundingBox, and
+ * Orientation. Be aware that some of them has a
+ * meaning to PostScript viewers.
+ * @param string $val The value of the information field. The field
+ * Orientation can be set to either
+ * Portrait or Landscape. The
+ * BoundingBox is a string consisting of four numbers.
+ * The first two numbers are the coordinates of the lower left corner of
+ * the page. The last two numbers are the coordinates of the upper
+ * right corner.
+ *
+ * Up to version 0.2.6 of pslib, the BoundingBox and Orientation
+ * will be overwritten by ps_begin_page,
+ * unless ps_findfont has been called before.
+ * @throws PsException
+ *
+ */
+function ps_set_info($p, string $key, string $val): void
+{
+ error_clear_last();
+ $result = \ps_set_info($p, $key, $val);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets several parameters which are used by many functions. Parameters are by
+ * definition string values.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param string $name For a list of possible names see ps_get_parameter.
+ * @param string $value The value of the parameter.
+ * @throws PsException
+ *
+ */
+function ps_set_parameter($psdoc, string $name, string $value): void
+{
+ error_clear_last();
+ $result = \ps_set_parameter($psdoc, $name, $value);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Set the position for the next text output. You may alternatively set the x
+ * and y value separately by calling ps_set_value and
+ * choosing textx respectively texty as
+ * the value name.
+ *
+ * If you want to output text at a certain position it is more convenient
+ * to use ps_show_xy instead of setting the text position
+ * and calling ps_show.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param float $x x-coordinate of the new text position.
+ * @param float $y y-coordinate of the new text position.
+ * @throws PsException
+ *
+ */
+function ps_set_text_pos($psdoc, float $x, float $y): void
+{
+ error_clear_last();
+ $result = \ps_set_text_pos($psdoc, $x, $y);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets several values which are used by many functions. Parameters are by
+ * definition float values.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param string $name The name can be one of the following:
+ *
+ *
+ * textrendering
+ *
+ *
+ * The way how text is shown.
+ *
+ *
+ *
+ *
+ * textx
+ *
+ *
+ * The x coordinate for text output.
+ *
+ *
+ *
+ *
+ * texty
+ *
+ *
+ * The y coordinate for text output.
+ *
+ *
+ *
+ *
+ * wordspacing
+ *
+ *
+ * The distance between words relative to the width of a space.
+ *
+ *
+ *
+ *
+ * leading
+ *
+ *
+ * The distance between lines in pixels.
+ *
+ *
+ *
+ *
+ *
+ * The way how text is shown.
+ *
+ * The x coordinate for text output.
+ *
+ * The y coordinate for text output.
+ *
+ * The distance between words relative to the width of a space.
+ *
+ * The distance between lines in pixels.
+ * @param float $value The way how text is shown.
+ * @throws PsException
+ *
+ */
+function ps_set_value($psdoc, string $name, float $value): void
+{
+ error_clear_last();
+ $result = \ps_set_value($psdoc, $name, $value);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the color for drawing, filling, or both.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param string $type The parameter type can be
+ * both, fill, or
+ * fillstroke.
+ * @param string $colorspace The colorspace should be one of gray,
+ * rgb, cmyk,
+ * spot, pattern. Depending on the
+ * colorspace either only the first, the first three or all parameters
+ * will be used.
+ * @param float $c1 Depending on the colorspace this is either the red component (rgb),
+ * the cyan component (cmyk), the gray value (gray), the identifier of
+ * the spot color or the identifier of the pattern.
+ * @param float $c2 Depending on the colorspace this is either the green component (rgb),
+ * the magenta component (cmyk).
+ * @param float $c3 Depending on the colorspace this is either the blue component (rgb),
+ * the yellow component (cmyk).
+ * @param float $c4 This must only be set in cmyk colorspace and specifies the black
+ * component.
+ * @throws PsException
+ *
+ */
+function ps_setcolor($psdoc, string $type, string $colorspace, float $c1, float $c2, float $c3, float $c4): void
+{
+ error_clear_last();
+ $result = \ps_setcolor($psdoc, $type, $colorspace, $c1, $c2, $c3, $c4);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the length of the black and white portions of a dashed line.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param float $on The length of the dash.
+ * @param float $off The length of the gap between dashes.
+ * @throws PsException
+ *
+ */
+function ps_setdash($psdoc, float $on, float $off): void
+{
+ error_clear_last();
+ $result = \ps_setdash($psdoc, $on, $off);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function is
+ * currently not documented; only its argument list is available.
+ *
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param float $value The value must be between 0.2 and 1.
+ * @throws PsException
+ *
+ */
+function ps_setflat($psdoc, float $value): void
+{
+ error_clear_last();
+ $result = \ps_setflat($psdoc, $value);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets a font, which has to be loaded before with
+ * ps_findfont. Outputting text without setting a font
+ * results in an error.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param int $fontid The font identifier as returned by ps_findfont.
+ * @param float $size The size of the font.
+ * @throws PsException
+ *
+ */
+function ps_setfont($psdoc, int $fontid, float $size): void
+{
+ error_clear_last();
+ $result = \ps_setfont($psdoc, $fontid, $size);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the gray value for all following drawing operations.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param float $gray The value must be between 0 (white) and 1 (black).
+ * @throws PsException
+ *
+ */
+function ps_setgray($psdoc, float $gray): void
+{
+ error_clear_last();
+ $result = \ps_setgray($psdoc, $gray);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets how line ends look like.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param int $type The type of line ends. Possible values are
+ * PS_LINECAP_BUTT,
+ * PS_LINECAP_ROUND, or
+ * PS_LINECAP_SQUARED.
+ * @throws PsException
+ *
+ */
+function ps_setlinecap($psdoc, int $type): void
+{
+ error_clear_last();
+ $result = \ps_setlinecap($psdoc, $type);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets how lines are joined.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param int $type The way lines are joined. Possible values are
+ * PS_LINEJOIN_MITER,
+ * PS_LINEJOIN_ROUND, or
+ * PS_LINEJOIN_BEVEL.
+ * @throws PsException
+ *
+ */
+function ps_setlinejoin($psdoc, int $type): void
+{
+ error_clear_last();
+ $result = \ps_setlinejoin($psdoc, $type);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the line width for all following drawing operations.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param float $width The width of lines in points.
+ * @throws PsException
+ *
+ */
+function ps_setlinewidth($psdoc, float $width): void
+{
+ error_clear_last();
+ $result = \ps_setlinewidth($psdoc, $width);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * If two lines join in a small angle and the line join is set to
+ * PS_LINEJOIN_MITER, then
+ * the resulting spike will be very long. The miter limit is the maximum
+ * ratio of the miter length (the length of the spike) and the line width.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param float $value The maximum ratio between the miter length and the line width. Larger
+ * values (&gt; 10) will result in very long spikes when two lines meet
+ * in a small angle. Keep the default unless you know what you are doing.
+ * @throws PsException
+ *
+ */
+function ps_setmiterlimit($psdoc, float $value): void
+{
+ error_clear_last();
+ $result = \ps_setmiterlimit($psdoc, $value);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function is
+ * currently not documented; only its argument list is available.
+ *
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param int $mode
+ * @throws PsException
+ *
+ */
+function ps_setoverprintmode($psdoc, int $mode): void
+{
+ error_clear_last();
+ $result = \ps_setoverprintmode($psdoc, $mode);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the length of the black and white portions of a dashed line.
+ * ps_setpolydash is used to set more complicated dash
+ * patterns.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param float $arr arr is a list of length elements alternately for
+ * the black and white portion.
+ * @throws PsException
+ *
+ */
+function ps_setpolydash($psdoc, float $arr): void
+{
+ error_clear_last();
+ $result = \ps_setpolydash($psdoc, $arr);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Creates a pattern based on a shading, which has to be created before with
+ * ps_shading. Shading patterns can be used like regular
+ * patterns.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param int $shadingid The identifier of a shading previously created with
+ * ps_shading.
+ * @param string $optlist This argument is not currently used.
+ * @return int The identifier of the pattern.
+ * @throws PsException
+ *
+ */
+function ps_shading_pattern($psdoc, int $shadingid, string $optlist): int
+{
+ error_clear_last();
+ $result = \ps_shading_pattern($psdoc, $shadingid, $optlist);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Creates a shading, which can be used by ps_shfill or
+ * ps_shading_pattern.
+ *
+ * The color of the shading can be in any color space except for
+ * pattern.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param string $type The type of shading can be either radial or
+ * axial. Each shading starts with the current fill
+ * color and ends with the given color values passed in the parameters
+ * c1 to c4
+ * (see ps_setcolor for their meaning).
+ * @param float $x0 The coordinates x0, y0,
+ * x1, y1 are the start and
+ * end point of the shading. If the type of shading is
+ * radial the two points are the middle points of
+ * a starting and ending circle.
+ * @param float $y0 See ps_setcolor for their meaning.
+ * @param float $x1 If the shading is of type radial the
+ * optlist must also contain the parameters
+ * r0 and r1 with the radius of the
+ * start and end circle.
+ * @param float $y1
+ * @param float $c1
+ * @param float $c2
+ * @param float $c3
+ * @param float $c4
+ * @param string $optlist
+ * @return int Returns the identifier of the pattern.
+ * @throws PsException
+ *
+ */
+function ps_shading($psdoc, string $type, float $x0, float $y0, float $x1, float $y1, float $c1, float $c2, float $c3, float $c4, string $optlist): int
+{
+ error_clear_last();
+ $result = \ps_shading($psdoc, $type, $x0, $y0, $x1, $y1, $c1, $c2, $c3, $c4, $optlist);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Fills an area with a shading, which has to be created before with
+ * ps_shading. This is an alternative way to creating
+ * a pattern from a shading ps_shading_pattern and using
+ * the pattern as the filling color.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param int $shadingid The identifier of a shading previously created with
+ * ps_shading.
+ * @throws PsException
+ *
+ */
+function ps_shfill($psdoc, int $shadingid): void
+{
+ error_clear_last();
+ $result = \ps_shfill($psdoc, $shadingid);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Output a text at the given text position.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param string $text The text to be output.
+ * @param float $x x-coordinate of the lower left corner of the box surrounding the text.
+ * @param float $y y-coordinate of the lower left corner of the box surrounding the text.
+ * @throws PsException
+ *
+ */
+function ps_show_xy($psdoc, string $text, float $x, float $y): void
+{
+ error_clear_last();
+ $result = \ps_show_xy($psdoc, $text, $x, $y);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function is
+ * currently not documented; only its argument list is available.
+ *
+ *
+ * @param resource $psdoc
+ * @param string $text
+ * @param int $len
+ * @param float $xcoor
+ * @param float $ycoor
+ * @throws PsException
+ *
+ */
+function ps_show_xy2($psdoc, string $text, int $len, float $xcoor, float $ycoor): void
+{
+ error_clear_last();
+ $result = \ps_show_xy2($psdoc, $text, $len, $xcoor, $ycoor);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Output a text at the current text position. The text position can be set
+ * by storing the x and y coordinates into the values textx
+ * and texty with the function
+ * ps_set_value. The function will issue an
+ * error if a font was not set before with ps_setfont.
+ *
+ * ps_show evaluates the following parameters and values
+ * as set by ps_set_parameter and
+ * ps_set_value.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param string $text The text to be output.
+ * @throws PsException
+ *
+ */
+function ps_show($psdoc, string $text): void
+{
+ error_clear_last();
+ $result = \ps_show($psdoc, $text);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Output text at the current position. Do not print more than len characters.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param string $text The text to be output.
+ * @param int $len The maximum number of characters to print.
+ * @throws PsException
+ *
+ */
+function ps_show2($psdoc, string $text, int $len): void
+{
+ error_clear_last();
+ $result = \ps_show2($psdoc, $text, $len);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Draws the path constructed with previously called drawing functions like
+ * ps_lineto.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @throws PsException
+ *
+ */
+function ps_stroke($psdoc): void
+{
+ error_clear_last();
+ $result = \ps_stroke($psdoc);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Output the glyph at position ord in the font
+ * encoding vector of the current font. The font encoding for a font can be
+ * set when loading the font with ps_findfont.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param int $ord The position of the glyph in the font encoding vector.
+ * @throws PsException
+ *
+ */
+function ps_symbol($psdoc, int $ord): void
+{
+ error_clear_last();
+ $result = \ps_symbol($psdoc, $ord);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets a new initial point of the coordinate system.
+ *
+ * @param resource $psdoc Resource identifier of the postscript file
+ * as returned by ps_new.
+ * @param float $x x-coordinate of the origin of the translated coordinate system.
+ * @param float $y y-coordinate of the origin of the translated coordinate system.
+ * @throws PsException
+ *
+ */
+function ps_translate($psdoc, float $x, float $y): void
+{
+ error_clear_last();
+ $result = \ps_translate($psdoc, $x, $y);
+ if ($result === false) {
+ throw PsException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/pspell.php b/vendor/thecodingmachine/safe/generated/pspell.php
new file mode 100644
index 000000000..4cf4c36a6
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/pspell.php
@@ -0,0 +1,451 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\PspellException;
+
+/**
+ *
+ *
+ * @param int $dictionary_link
+ * @param string $word The added word.
+ * @throws PspellException
+ *
+ */
+function pspell_add_to_personal(int $dictionary_link, string $word): void
+{
+ error_clear_last();
+ $result = \pspell_add_to_personal($dictionary_link, $word);
+ if ($result === false) {
+ throw PspellException::createFromPhpError();
+ }
+}
+
+
+/**
+ *
+ *
+ * @param int $dictionary_link
+ * @param string $word The added word.
+ * @throws PspellException
+ *
+ */
+function pspell_add_to_session(int $dictionary_link, string $word): void
+{
+ error_clear_last();
+ $result = \pspell_add_to_session($dictionary_link, $word);
+ if ($result === false) {
+ throw PspellException::createFromPhpError();
+ }
+}
+
+
+/**
+ *
+ *
+ * @param int $dictionary_link
+ * @throws PspellException
+ *
+ */
+function pspell_clear_session(int $dictionary_link): void
+{
+ error_clear_last();
+ $result = \pspell_clear_session($dictionary_link);
+ if ($result === false) {
+ throw PspellException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Create a config used to open a dictionary.
+ *
+ * pspell_config_create has a very similar syntax to
+ * pspell_new. In fact, using
+ * pspell_config_create immediately followed by
+ * pspell_new_config will produce the exact same result.
+ * However, after creating a new config, you can also use
+ * pspell_config_* functions before calling
+ * pspell_new_config to take advantage of some
+ * advanced functionality.
+ *
+ * For more information and examples, check out inline manual pspell
+ * website:http://aspell.net/.
+ *
+ * @param string $language The language parameter is the language code which consists of the
+ * two letter ISO 639 language code and an optional two letter ISO
+ * 3166 country code after a dash or underscore.
+ * @param string $spelling The spelling parameter is the requested spelling for languages
+ * with more than one spelling such as English. Known values are
+ * 'american', 'british', and 'canadian'.
+ * @param string $jargon The jargon parameter contains extra information to distinguish
+ * two different words lists that have the same language and
+ * spelling parameters.
+ * @param string $encoding The encoding parameter is the encoding that words are expected to
+ * be in. Valid values are 'utf-8', 'iso8859-*', 'koi8-r',
+ * 'viscii', 'cp1252', 'machine unsigned 16', 'machine unsigned
+ * 32'. This parameter is largely untested, so be careful when
+ * using.
+ * @return int Returns a pspell config identifier.
+ * @throws PspellException
+ *
+ */
+function pspell_config_create(string $language, string $spelling = null, string $jargon = null, string $encoding = null): int
+{
+ error_clear_last();
+ if ($encoding !== null) {
+ $result = \pspell_config_create($language, $spelling, $jargon, $encoding);
+ } elseif ($jargon !== null) {
+ $result = \pspell_config_create($language, $spelling, $jargon);
+ } elseif ($spelling !== null) {
+ $result = \pspell_config_create($language, $spelling);
+ } else {
+ $result = \pspell_config_create($language);
+ }
+ if ($result === false) {
+ throw PspellException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * This function is
+ * currently not documented; only its argument list is available.
+ *
+ *
+ * @param int $conf
+ * @param string $directory
+ * @throws PspellException
+ *
+ */
+function pspell_config_data_dir(int $conf, string $directory): void
+{
+ error_clear_last();
+ $result = \pspell_config_data_dir($conf, $directory);
+ if ($result === false) {
+ throw PspellException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function is
+ * currently not documented; only its argument list is available.
+ *
+ *
+ * @param int $conf
+ * @param string $directory
+ * @throws PspellException
+ *
+ */
+function pspell_config_dict_dir(int $conf, string $directory): void
+{
+ error_clear_last();
+ $result = \pspell_config_dict_dir($conf, $directory);
+ if ($result === false) {
+ throw PspellException::createFromPhpError();
+ }
+}
+
+
+/**
+ *
+ *
+ * @param int $dictionary_link
+ * @param int $n Words less than n characters will be skipped.
+ * @throws PspellException
+ *
+ */
+function pspell_config_ignore(int $dictionary_link, int $n): void
+{
+ error_clear_last();
+ $result = \pspell_config_ignore($dictionary_link, $n);
+ if ($result === false) {
+ throw PspellException::createFromPhpError();
+ }
+}
+
+
+/**
+ *
+ *
+ * @param int $dictionary_link
+ * @param int $mode The mode parameter is the mode in which spellchecker will work.
+ * There are several modes available:
+ *
+ *
+ *
+ * PSPELL_FAST - Fast mode (least number of
+ * suggestions)
+ *
+ *
+ *
+ *
+ * PSPELL_NORMAL - Normal mode (more suggestions)
+ *
+ *
+ *
+ *
+ * PSPELL_BAD_SPELLERS - Slow mode (a lot of
+ * suggestions)
+ *
+ *
+ *
+ * @throws PspellException
+ *
+ */
+function pspell_config_mode(int $dictionary_link, int $mode): void
+{
+ error_clear_last();
+ $result = \pspell_config_mode($dictionary_link, $mode);
+ if ($result === false) {
+ throw PspellException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Set a file that contains personal wordlist. The personal wordlist will be
+ * loaded and used in addition to the standard one after you call
+ * pspell_new_config. The file is also the file where
+ * pspell_save_wordlist will save personal wordlist to.
+ *
+ * pspell_config_personal should be used on a config
+ * before calling pspell_new_config.
+ *
+ * @param int $dictionary_link
+ * @param string $file The personal wordlist. If the file does not exist, it will be created.
+ * The file should be writable by whoever PHP runs as (e.g. nobody).
+ * @throws PspellException
+ *
+ */
+function pspell_config_personal(int $dictionary_link, string $file): void
+{
+ error_clear_last();
+ $result = \pspell_config_personal($dictionary_link, $file);
+ if ($result === false) {
+ throw PspellException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Set a file that contains replacement pairs.
+ *
+ * The replacement pairs improve the quality of the spellchecker. When a word
+ * is misspelled, and a proper suggestion was not found in the list,
+ * pspell_store_replacement can be used to store a
+ * replacement pair and then pspell_save_wordlist to
+ * save the wordlist along with the replacement pairs.
+ *
+ * pspell_config_repl should be used on a config
+ * before calling pspell_new_config.
+ *
+ * @param int $dictionary_link
+ * @param string $file The file should be writable by whoever PHP runs as (e.g. nobody).
+ * @throws PspellException
+ *
+ */
+function pspell_config_repl(int $dictionary_link, string $file): void
+{
+ error_clear_last();
+ $result = \pspell_config_repl($dictionary_link, $file);
+ if ($result === false) {
+ throw PspellException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function determines whether run-together words will be treated as
+ * legal compounds. That is, "thecat" will be a legal compound, although
+ * there should be a space between the two words. Changing this setting only
+ * affects the results returned by pspell_check;
+ * pspell_suggest will still return suggestions.
+ *
+ * pspell_config_runtogether should be used on a config
+ * before calling pspell_new_config.
+ *
+ * @param int $dictionary_link
+ * @param bool $flag TRUE if run-together words should be treated as legal compounds,
+ * FALSE otherwise.
+ * @throws PspellException
+ *
+ */
+function pspell_config_runtogether(int $dictionary_link, bool $flag): void
+{
+ error_clear_last();
+ $result = \pspell_config_runtogether($dictionary_link, $flag);
+ if ($result === false) {
+ throw PspellException::createFromPhpError();
+ }
+}
+
+
+/**
+ * pspell_config_save_repl determines whether
+ * pspell_save_wordlist will save the replacement pairs
+ * along with the wordlist. Usually there is no need to use this function
+ * because if pspell_config_repl is used, the
+ * replacement pairs will be saved by
+ * pspell_save_wordlist anyway, and if it is not,
+ * the replacement pairs will not be saved.
+ *
+ * pspell_config_save_repl should be used on a config
+ * before calling pspell_new_config.
+ *
+ * @param int $dictionary_link
+ * @param bool $flag TRUE if replacement pairs should be saved, FALSE otherwise.
+ * @throws PspellException
+ *
+ */
+function pspell_config_save_repl(int $dictionary_link, bool $flag): void
+{
+ error_clear_last();
+ $result = \pspell_config_save_repl($dictionary_link, $flag);
+ if ($result === false) {
+ throw PspellException::createFromPhpError();
+ }
+}
+
+
+/**
+ *
+ *
+ * @param int $config The config parameter is the one returned by
+ * pspell_config_create when the config was created.
+ * @return int Returns a dictionary link identifier on success.
+ * @throws PspellException
+ *
+ */
+function pspell_new_config(int $config): int
+{
+ error_clear_last();
+ $result = \pspell_new_config($config);
+ if ($result === false) {
+ throw PspellException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * pspell_new opens up a new dictionary and
+ * returns the dictionary link identifier for use in other pspell
+ * functions.
+ *
+ * For more information and examples, check out inline manual pspell
+ * website:http://aspell.net/.
+ *
+ * @param string $language The language parameter is the language code which consists of the
+ * two letter ISO 639 language code and an optional two letter ISO
+ * 3166 country code after a dash or underscore.
+ * @param string $spelling The spelling parameter is the requested spelling for languages
+ * with more than one spelling such as English. Known values are
+ * 'american', 'british', and 'canadian'.
+ * @param string $jargon The jargon parameter contains extra information to distinguish
+ * two different words lists that have the same language and
+ * spelling parameters.
+ * @param string $encoding The encoding parameter is the encoding that words are expected to
+ * be in. Valid values are 'utf-8', 'iso8859-*', 'koi8-r',
+ * 'viscii', 'cp1252', 'machine unsigned 16', 'machine unsigned
+ * 32'. This parameter is largely untested, so be careful when
+ * using.
+ * @param int $mode The mode parameter is the mode in which spellchecker will work.
+ * There are several modes available:
+ *
+ *
+ *
+ * PSPELL_FAST - Fast mode (least number of
+ * suggestions)
+ *
+ *
+ *
+ *
+ * PSPELL_NORMAL - Normal mode (more suggestions)
+ *
+ *
+ *
+ *
+ * PSPELL_BAD_SPELLERS - Slow mode (a lot of
+ * suggestions)
+ *
+ *
+ *
+ *
+ * PSPELL_RUN_TOGETHER - Consider run-together words
+ * as legal compounds. That is, "thecat" will be a legal compound,
+ * although there should be a space between the two words. Changing this
+ * setting only affects the results returned by
+ * pspell_check; pspell_suggest
+ * will still return suggestions.
+ *
+ *
+ *
+ * Mode is a bitmask constructed from different constants listed above.
+ * However, PSPELL_FAST,
+ * PSPELL_NORMAL and
+ * PSPELL_BAD_SPELLERS are mutually exclusive, so you
+ * should select only one of them.
+ * @return int Returns the dictionary link identifier on success.
+ * @throws PspellException
+ *
+ */
+function pspell_new(string $language, string $spelling = null, string $jargon = null, string $encoding = null, int $mode = 0): int
+{
+ error_clear_last();
+ if ($mode !== 0) {
+ $result = \pspell_new($language, $spelling, $jargon, $encoding, $mode);
+ } elseif ($encoding !== null) {
+ $result = \pspell_new($language, $spelling, $jargon, $encoding);
+ } elseif ($jargon !== null) {
+ $result = \pspell_new($language, $spelling, $jargon);
+ } elseif ($spelling !== null) {
+ $result = \pspell_new($language, $spelling);
+ } else {
+ $result = \pspell_new($language);
+ }
+ if ($result === false) {
+ throw PspellException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ *
+ *
+ * @param int $dictionary_link A dictionary link identifier opened with
+ * pspell_new_personal.
+ * @throws PspellException
+ *
+ */
+function pspell_save_wordlist(int $dictionary_link): void
+{
+ error_clear_last();
+ $result = \pspell_save_wordlist($dictionary_link);
+ if ($result === false) {
+ throw PspellException::createFromPhpError();
+ }
+}
+
+
+/**
+ *
+ *
+ * @param int $dictionary_link A dictionary link identifier, opened with
+ * pspell_new_personal
+ * @param string $misspelled The misspelled word.
+ * @param string $correct The fixed spelling for the misspelled word.
+ * @throws PspellException
+ *
+ */
+function pspell_store_replacement(int $dictionary_link, string $misspelled, string $correct): void
+{
+ error_clear_last();
+ $result = \pspell_store_replacement($dictionary_link, $misspelled, $correct);
+ if ($result === false) {
+ throw PspellException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/readline.php b/vendor/thecodingmachine/safe/generated/readline.php
new file mode 100644
index 000000000..a1c52c755
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/readline.php
@@ -0,0 +1,157 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\ReadlineException;
+
+/**
+ * This function adds a line to the command line history.
+ *
+ * @param string $line The line to be added in the history.
+ * @throws ReadlineException
+ *
+ */
+function readline_add_history(string $line): void
+{
+ error_clear_last();
+ $result = \readline_add_history($line);
+ if ($result === false) {
+ throw ReadlineException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets up a readline callback interface then prints
+ * prompt and immediately returns.
+ * Calling this function twice without removing the previous
+ * callback interface will automatically and conveniently overwrite the old
+ * interface.
+ *
+ * The callback feature is useful when combined with
+ * stream_select as it allows interleaving of IO and
+ * user input, unlike readline.
+ *
+ *
+ * Readline Callback Interface Example
+ *
+ * 10) {
+ * $prompting = false;
+ * readline_callback_handler_remove();
+ * } else {
+ * readline_callback_handler_install("[$c] Enter something: ", 'rl_callback');
+ * }
+ * }
+ *
+ * $c = 1;
+ * $prompting = true;
+ *
+ * readline_callback_handler_install("[$c] Enter something: ", 'rl_callback');
+ *
+ * while ($prompting) {
+ * $w = NULL;
+ * $e = NULL;
+ * $n = stream_select($r = array(STDIN), $w, $e, null);
+ * if ($n && in_array(STDIN, $r)) {
+ * // read a character, will call the callback when a newline is entered
+ * readline_callback_read_char();
+ * }
+ * }
+ *
+ * echo "Prompting disabled. All done.\n";
+ * ?>
+ * ]]>
+ *
+ *
+ *
+ * @param string $prompt The prompt message.
+ * @param callable $callback The callback function takes one parameter; the
+ * user input returned.
+ * @throws ReadlineException
+ *
+ */
+function readline_callback_handler_install(string $prompt, callable $callback): void
+{
+ error_clear_last();
+ $result = \readline_callback_handler_install($prompt, $callback);
+ if ($result === false) {
+ throw ReadlineException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function clears the entire command line history.
+ *
+ * @throws ReadlineException
+ *
+ */
+function readline_clear_history(): void
+{
+ error_clear_last();
+ $result = \readline_clear_history();
+ if ($result === false) {
+ throw ReadlineException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function registers a completion function. This is the same kind of
+ * functionality you'd get if you hit your tab key while using Bash.
+ *
+ * @param callable $function You must supply the name of an existing function which accepts a
+ * partial command line and returns an array of possible matches.
+ * @throws ReadlineException
+ *
+ */
+function readline_completion_function(callable $function): void
+{
+ error_clear_last();
+ $result = \readline_completion_function($function);
+ if ($result === false) {
+ throw ReadlineException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function reads a command history from a file.
+ *
+ * @param string $filename Path to the filename containing the command history.
+ * @throws ReadlineException
+ *
+ */
+function readline_read_history(string $filename = null): void
+{
+ error_clear_last();
+ if ($filename !== null) {
+ $result = \readline_read_history($filename);
+ } else {
+ $result = \readline_read_history();
+ }
+ if ($result === false) {
+ throw ReadlineException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function writes the command history to a file.
+ *
+ * @param string $filename Path to the saved file.
+ * @throws ReadlineException
+ *
+ */
+function readline_write_history(string $filename = null): void
+{
+ error_clear_last();
+ if ($filename !== null) {
+ $result = \readline_write_history($filename);
+ } else {
+ $result = \readline_write_history();
+ }
+ if ($result === false) {
+ throw ReadlineException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/rpminfo.php b/vendor/thecodingmachine/safe/generated/rpminfo.php
new file mode 100644
index 000000000..44de1ce23
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/rpminfo.php
@@ -0,0 +1,21 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\RpminfoException;
+
+/**
+ * Add an additional retrieved tag in subsequent queries.
+ *
+ * @param int $tag One of RPMTAG_* constant, see the rpminfo constants page.
+ * @throws RpminfoException
+ *
+ */
+function rpmaddtag(int $tag): void
+{
+ error_clear_last();
+ $result = \rpmaddtag($tag);
+ if ($result === false) {
+ throw RpminfoException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/rrd.php b/vendor/thecodingmachine/safe/generated/rrd.php
new file mode 100644
index 000000000..9bb3b5c52
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/rrd.php
@@ -0,0 +1,23 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\RrdException;
+
+/**
+ * Creates the rdd database file.
+ *
+ * @param string $filename Filename for newly created rrd file.
+ * @param array $options Options for rrd create - list of strings. See man page of rrd create
+ * for whole list of options.
+ * @throws RrdException
+ *
+ */
+function rrd_create(string $filename, array $options): void
+{
+ error_clear_last();
+ $result = \rrd_create($filename, $options);
+ if ($result === false) {
+ throw RrdException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/sem.php b/vendor/thecodingmachine/safe/generated/sem.php
new file mode 100644
index 000000000..739e8b389
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/sem.php
@@ -0,0 +1,367 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\SemException;
+
+/**
+ * Checks whether the message queue key exists.
+ *
+ * @param int $key Queue key.
+ * @throws SemException
+ *
+ */
+function msg_queue_exists(int $key): void
+{
+ error_clear_last();
+ $result = \msg_queue_exists($key);
+ if ($result === false) {
+ throw SemException::createFromPhpError();
+ }
+}
+
+
+/**
+ * msg_receive will receive the first message from the
+ * specified queue of the type specified by
+ * desiredmsgtype.
+ *
+ * @param resource $queue Message queue resource handle
+ * @param int $desiredmsgtype If desiredmsgtype is 0, the message from the front
+ * of the queue is returned. If desiredmsgtype is
+ * greater than 0, then the first message of that type is returned.
+ * If desiredmsgtype is less than 0, the first
+ * message on the queue with a type less than or equal to the
+ * absolute value of desiredmsgtype will be read.
+ * If no messages match the criteria, your script will wait until a suitable
+ * message arrives on the queue. You can prevent the script from blocking
+ * by specifying MSG_IPC_NOWAIT in the
+ * flags parameter.
+ * @param int|null $msgtype The type of the message that was received will be stored in this
+ * parameter.
+ * @param int $maxsize The maximum size of message to be accepted is specified by the
+ * maxsize; if the message in the queue is larger
+ * than this size the function will fail (unless you set
+ * flags as described below).
+ * @param mixed $message The received message will be stored in message,
+ * unless there were errors receiving the message.
+ * @param bool $unserialize If set to
+ * TRUE, the message is treated as though it was serialized using the
+ * same mechanism as the session module. The message will be unserialized
+ * and then returned to your script. This allows you to easily receive
+ * arrays or complex object structures from other PHP scripts, or if you
+ * are using the WDDX serializer, from any WDDX compatible source.
+ *
+ * If unserialize is FALSE, the message will be
+ * returned as a binary-safe string.
+ * @param int $flags The optional flags allows you to pass flags to the
+ * low-level msgrcv system call. It defaults to 0, but you may specify one
+ * or more of the following values (by adding or ORing them together).
+ *
+ * Flag values for msg_receive
+ *
+ *
+ *
+ * MSG_IPC_NOWAIT
+ * If there are no messages of the
+ * desiredmsgtype, return immediately and do not
+ * wait. The function will fail and return an integer value
+ * corresponding to MSG_ENOMSG.
+ *
+ *
+ *
+ * MSG_EXCEPT
+ * Using this flag in combination with a
+ * desiredmsgtype greater than 0 will cause the
+ * function to receive the first message that is not equal to
+ * desiredmsgtype.
+ *
+ *
+ * MSG_NOERROR
+ *
+ * If the message is longer than maxsize,
+ * setting this flag will truncate the message to
+ * maxsize and will not signal an error.
+ *
+ *
+ *
+ *
+ *
+ * @param int|null $errorcode If the function fails, the optional errorcode
+ * will be set to the value of the system errno variable.
+ * @throws SemException
+ *
+ */
+function msg_receive($queue, int $desiredmsgtype, ?int &$msgtype, int $maxsize, &$message, bool $unserialize = true, int $flags = 0, ?int &$errorcode = null): void
+{
+ error_clear_last();
+ $result = \msg_receive($queue, $desiredmsgtype, $msgtype, $maxsize, $message, $unserialize, $flags, $errorcode);
+ if ($result === false) {
+ throw SemException::createFromPhpError();
+ }
+}
+
+
+/**
+ * msg_remove_queue destroys the message queue specified
+ * by the queue. Only use this function when all
+ * processes have finished working with the message queue and you need to
+ * release the system resources held by it.
+ *
+ * @param resource $queue Message queue resource handle
+ * @throws SemException
+ *
+ */
+function msg_remove_queue($queue): void
+{
+ error_clear_last();
+ $result = \msg_remove_queue($queue);
+ if ($result === false) {
+ throw SemException::createFromPhpError();
+ }
+}
+
+
+/**
+ * msg_send sends a message of type
+ * msgtype (which MUST be greater than 0) to
+ * the message queue specified by queue.
+ *
+ * @param resource $queue Message queue resource handle
+ * @param int $msgtype The type of the message (MUST be greater than 0)
+ * @param mixed $message The body of the message.
+ *
+ * If serialize set to FALSE is supplied,
+ * MUST be of type: string, integer, float
+ * or bool. In other case a warning will be issued.
+ * @param bool $serialize The optional serialize controls how the
+ * message is sent. serialize
+ * defaults to TRUE which means that the message is
+ * serialized using the same mechanism as the session module before being
+ * sent to the queue. This allows complex arrays and objects to be sent to
+ * other PHP scripts, or if you are using the WDDX serializer, to any WDDX
+ * compatible client.
+ * @param bool $blocking If the message is too large to fit in the queue, your script will wait
+ * until another process reads messages from the queue and frees enough
+ * space for your message to be sent.
+ * This is called blocking; you can prevent blocking by setting the
+ * optional blocking parameter to FALSE, in which
+ * case msg_send will immediately return FALSE if the
+ * message is too big for the queue, and set the optional
+ * errorcode to MSG_EAGAIN,
+ * indicating that you should try to send your message again a little
+ * later on.
+ * @param int|null $errorcode If the function fails, the optional errorcode will be set to the value of the system errno variable.
+ * @throws SemException
+ *
+ */
+function msg_send($queue, int $msgtype, $message, bool $serialize = true, bool $blocking = true, ?int &$errorcode = null): void
+{
+ error_clear_last();
+ $result = \msg_send($queue, $msgtype, $message, $serialize, $blocking, $errorcode);
+ if ($result === false) {
+ throw SemException::createFromPhpError();
+ }
+}
+
+
+/**
+ * msg_set_queue allows you to change the values of the
+ * msg_perm.uid, msg_perm.gid, msg_perm.mode and msg_qbytes fields of the
+ * underlying message queue data structure.
+ *
+ * Changing the data structure will require that PHP be running as the same
+ * user that created the queue, owns the queue (as determined by the
+ * existing msg_perm.xxx fields), or be running with root privileges.
+ * root privileges are required to raise the msg_qbytes values above the
+ * system defined limit.
+ *
+ * @param resource $queue Message queue resource handle
+ * @param array $data You specify the values you require by setting the value of the keys
+ * that you require in the data array.
+ * @throws SemException
+ *
+ */
+function msg_set_queue($queue, array $data): void
+{
+ error_clear_last();
+ $result = \msg_set_queue($queue, $data);
+ if ($result === false) {
+ throw SemException::createFromPhpError();
+ }
+}
+
+
+/**
+ * sem_acquire by default blocks (if necessary) until the
+ * semaphore can be acquired. A process attempting to acquire a semaphore which
+ * it has already acquired will block forever if acquiring the semaphore would
+ * cause its maximum number of semaphore to be exceeded.
+ *
+ * After processing a request, any semaphores acquired by the process but not
+ * explicitly released will be released automatically and a warning will be
+ * generated.
+ *
+ * @param resource $sem_identifier sem_identifier is a semaphore resource,
+ * obtained from sem_get.
+ * @param bool $nowait Specifies if the process shouldn't wait for the semaphore to be acquired.
+ * If set to true, the call will return
+ * false immediately if a semaphore cannot be immediately
+ * acquired.
+ * @throws SemException
+ *
+ */
+function sem_acquire($sem_identifier, bool $nowait = false): void
+{
+ error_clear_last();
+ $result = \sem_acquire($sem_identifier, $nowait);
+ if ($result === false) {
+ throw SemException::createFromPhpError();
+ }
+}
+
+
+/**
+ * sem_get returns an id that can be used to
+ * access the System V semaphore with the given key.
+ *
+ * A second call to sem_get for the same key
+ * will return a different semaphore identifier, but both
+ * identifiers access the same underlying semaphore.
+ *
+ * If key is 0, a new private semaphore
+ * is created for each call to sem_get.
+ *
+ * @param int $key
+ * @param int $max_acquire The number of processes that can acquire the semaphore simultaneously
+ * is set to max_acquire.
+ * @param int $perm The semaphore permissions. Actually this value is
+ * set only if the process finds it is the only process currently
+ * attached to the semaphore.
+ * @param int $auto_release Specifies if the semaphore should be automatically released on request
+ * shutdown.
+ * @return resource Returns a positive semaphore identifier on success.
+ * @throws SemException
+ *
+ */
+function sem_get(int $key, int $max_acquire = 1, int $perm = 0666, int $auto_release = 1)
+{
+ error_clear_last();
+ $result = \sem_get($key, $max_acquire, $perm, $auto_release);
+ if ($result === false) {
+ throw SemException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * sem_release releases the semaphore if it
+ * is currently acquired by the calling process, otherwise
+ * a warning is generated.
+ *
+ * After releasing the semaphore, sem_acquire
+ * may be called to re-acquire it.
+ *
+ * @param resource $sem_identifier A Semaphore resource handle as returned by
+ * sem_get.
+ * @throws SemException
+ *
+ */
+function sem_release($sem_identifier): void
+{
+ error_clear_last();
+ $result = \sem_release($sem_identifier);
+ if ($result === false) {
+ throw SemException::createFromPhpError();
+ }
+}
+
+
+/**
+ * sem_remove removes the given semaphore.
+ *
+ * After removing the semaphore, it is no longer accessible.
+ *
+ * @param resource $sem_identifier A semaphore resource identifier as returned
+ * by sem_get.
+ * @throws SemException
+ *
+ */
+function sem_remove($sem_identifier): void
+{
+ error_clear_last();
+ $result = \sem_remove($sem_identifier);
+ if ($result === false) {
+ throw SemException::createFromPhpError();
+ }
+}
+
+
+/**
+ * shm_put_var inserts or updates the
+ * variable with the given
+ * variable_key.
+ *
+ * Warnings (E_WARNING level) will be issued if
+ * shm_identifier is not a valid SysV shared memory
+ * index or if there was not enough shared memory remaining to complete your
+ * request.
+ *
+ * @param resource $shm_identifier A shared memory resource handle as returned by
+ * shm_attach
+ * @param int $variable_key The variable key.
+ * @param mixed $variable The variable. All variable types
+ * that serialize supports may be used: generally
+ * this means all types except for resources and some internal objects
+ * that cannot be serialized.
+ * @throws SemException
+ *
+ */
+function shm_put_var($shm_identifier, int $variable_key, $variable): void
+{
+ error_clear_last();
+ $result = \shm_put_var($shm_identifier, $variable_key, $variable);
+ if ($result === false) {
+ throw SemException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Removes a variable with a given variable_key
+ * and frees the occupied memory.
+ *
+ * @param resource $shm_identifier The shared memory identifier as returned by
+ * shm_attach
+ * @param int $variable_key The variable key.
+ * @throws SemException
+ *
+ */
+function shm_remove_var($shm_identifier, int $variable_key): void
+{
+ error_clear_last();
+ $result = \shm_remove_var($shm_identifier, $variable_key);
+ if ($result === false) {
+ throw SemException::createFromPhpError();
+ }
+}
+
+
+/**
+ * shm_remove removes the shared memory
+ * shm_identifier. All data will be destroyed.
+ *
+ * @param resource $shm_identifier The shared memory identifier as returned by
+ * shm_attach
+ * @throws SemException
+ *
+ */
+function shm_remove($shm_identifier): void
+{
+ error_clear_last();
+ $result = \shm_remove($shm_identifier);
+ if ($result === false) {
+ throw SemException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/session.php b/vendor/thecodingmachine/safe/generated/session.php
new file mode 100644
index 000000000..7b8c9478d
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/session.php
@@ -0,0 +1,153 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\SessionException;
+
+/**
+ * session_abort finishes session without saving
+ * data. Thus the original values in session data are kept.
+ *
+ * @throws SessionException
+ *
+ */
+function session_abort(): void
+{
+ error_clear_last();
+ $result = \session_abort();
+ if ($result === false) {
+ throw SessionException::createFromPhpError();
+ }
+}
+
+
+/**
+ * session_decode decodes the serialized session data provided in
+ * $data, and populates the $_SESSION superglobal
+ * with the result.
+ *
+ * By default, the unserialization method used is internal to PHP, and is not the same as unserialize.
+ * The serialization method can be set using session.serialize_handler.
+ *
+ * @param string $data The encoded data to be stored.
+ * @throws SessionException
+ *
+ */
+function session_decode(string $data): void
+{
+ error_clear_last();
+ $result = \session_decode($data);
+ if ($result === false) {
+ throw SessionException::createFromPhpError();
+ }
+}
+
+
+/**
+ * In order to kill the session altogether, the
+ * session ID must also be unset. If a cookie is used to propagate the
+ * session ID (default behavior), then the session cookie must be deleted.
+ * setcookie may be used for that.
+ *
+ * When session.use_strict_mode
+ * is enabled. You do not have to remove obsolete session ID cookie because
+ * session module will not accept session ID cookie when there is no
+ * data associated to the session ID and set new session ID cookie.
+ * Enabling session.use_strict_mode
+ * is recommended for all sites.
+ *
+ * @throws SessionException
+ *
+ */
+function session_destroy(): void
+{
+ error_clear_last();
+ $result = \session_destroy();
+ if ($result === false) {
+ throw SessionException::createFromPhpError();
+ }
+}
+
+
+/**
+ * session_regenerate_id will replace the current
+ * session id with a new one, and keep the current session information.
+ *
+ * When session.use_trans_sid
+ * is enabled, output must be started after session_regenerate_id
+ * call. Otherwise, old session ID is used.
+ *
+ * @param bool $delete_old_session Whether to delete the old associated session file or not.
+ * You should not delete old session if you need to avoid
+ * races caused by deletion or detect/avoid session hijack
+ * attacks.
+ * @throws SessionException
+ *
+ */
+function session_regenerate_id(bool $delete_old_session = false): void
+{
+ error_clear_last();
+ $result = \session_regenerate_id($delete_old_session);
+ if ($result === false) {
+ throw SessionException::createFromPhpError();
+ }
+}
+
+
+/**
+ * session_reset reinitializes a session with
+ * original values stored in session storage. This function requires an active session and
+ * discards changes in $_SESSION.
+ *
+ * @throws SessionException
+ *
+ */
+function session_reset(): void
+{
+ error_clear_last();
+ $result = \session_reset();
+ if ($result === false) {
+ throw SessionException::createFromPhpError();
+ }
+}
+
+
+/**
+ * The session_unset function frees all session variables
+ * currently registered.
+ *
+ * @throws SessionException
+ *
+ */
+function session_unset(): void
+{
+ error_clear_last();
+ $result = \session_unset();
+ if ($result === false) {
+ throw SessionException::createFromPhpError();
+ }
+}
+
+
+/**
+ * End the current session and store session data.
+ *
+ * Session data is usually stored after your script terminated without the
+ * need to call session_write_close, but as session data
+ * is locked to prevent concurrent writes only one script may operate on a
+ * session at any time. When using framesets together with sessions you will
+ * experience the frames loading one by one due to this locking. You can
+ * reduce the time needed to load all the frames by ending the session as
+ * soon as all changes to session variables are done.
+ *
+ * @throws SessionException
+ *
+ */
+function session_write_close(): void
+{
+ error_clear_last();
+ $result = \session_write_close();
+ if ($result === false) {
+ throw SessionException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/shmop.php b/vendor/thecodingmachine/safe/generated/shmop.php
new file mode 100644
index 000000000..04ba57cb5
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/shmop.php
@@ -0,0 +1,68 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\ShmopException;
+
+/**
+ * shmop_delete is used to delete a shared memory block.
+ *
+ * @param resource $shmid The shared memory block resource created by
+ * shmop_open
+ * @throws ShmopException
+ *
+ */
+function shmop_delete($shmid): void
+{
+ error_clear_last();
+ $result = \shmop_delete($shmid);
+ if ($result === false) {
+ throw ShmopException::createFromPhpError();
+ }
+}
+
+
+/**
+ * shmop_read will read a string from shared memory block.
+ *
+ * @param resource $shmid The shared memory block identifier created by
+ * shmop_open
+ * @param int $start Offset from which to start reading
+ * @param int $count The number of bytes to read.
+ * 0 reads shmop_size($shmid) - $start bytes.
+ * @return string Returns the data.
+ * @throws ShmopException
+ *
+ */
+function shmop_read($shmid, int $start, int $count): string
+{
+ error_clear_last();
+ $result = \shmop_read($shmid, $start, $count);
+ if ($result === false) {
+ throw ShmopException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * shmop_write will write a string into shared memory block.
+ *
+ * @param resource $shmid The shared memory block identifier created by
+ * shmop_open
+ * @param string $data A string to write into shared memory block
+ * @param int $offset Specifies where to start writing data inside the shared memory
+ * segment.
+ * @return int The size of the written data.
+ * @throws ShmopException
+ *
+ */
+function shmop_write($shmid, string $data, int $offset): int
+{
+ error_clear_last();
+ $result = \shmop_write($shmid, $data, $offset);
+ if ($result === false) {
+ throw ShmopException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/simplexml.php b/vendor/thecodingmachine/safe/generated/simplexml.php
new file mode 100644
index 000000000..118de4432
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/simplexml.php
@@ -0,0 +1,94 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\SimplexmlException;
+
+/**
+ * This function takes a node of a DOM
+ * document and makes it into a SimpleXML node. This new object can
+ * then be used as a native SimpleXML element.
+ *
+ * @param \DOMNode $node A DOM Element node
+ * @param string $class_name You may use this optional parameter so that
+ * simplexml_import_dom will return an object of
+ * the specified class. That class should extend the
+ * SimpleXMLElement class.
+ * @return \SimpleXMLElement Returns a SimpleXMLElement.
+ * @throws SimplexmlException
+ *
+ */
+function simplexml_import_dom(\DOMNode $node, string $class_name = "SimpleXMLElement"): \SimpleXMLElement
+{
+ error_clear_last();
+ $result = \simplexml_import_dom($node, $class_name);
+ if ($result === false) {
+ throw SimplexmlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Convert the well-formed XML document in the given file to an object.
+ *
+ * @param string $filename Path to the XML file
+ *
+ * Libxml 2 unescapes the URI, so if you want to pass e.g.
+ * b&amp;c as the URI parameter a,
+ * you have to call
+ * simplexml_load_file(rawurlencode('http://example.com/?a=' .
+ * urlencode('b&amp;c'))). Since PHP 5.1.0 you don't need to do
+ * this because PHP will do it for you.
+ * @param string $class_name You may use this optional parameter so that
+ * simplexml_load_file will return an object of
+ * the specified class. That class should extend the
+ * SimpleXMLElement class.
+ * @param int $options Since PHP 5.1.0 and Libxml 2.6.0, you may also use the
+ * options parameter to specify additional Libxml parameters.
+ * @param string $ns Namespace prefix or URI.
+ * @param bool $is_prefix TRUE if ns is a prefix, FALSE if it's a URI;
+ * defaults to FALSE.
+ * @return \SimpleXMLElement Returns an object of class SimpleXMLElement with
+ * properties containing the data held within the XML document.
+ * @throws SimplexmlException
+ *
+ */
+function simplexml_load_file(string $filename, string $class_name = "SimpleXMLElement", int $options = 0, string $ns = "", bool $is_prefix = false): \SimpleXMLElement
+{
+ error_clear_last();
+ $result = \simplexml_load_file($filename, $class_name, $options, $ns, $is_prefix);
+ if ($result === false) {
+ throw SimplexmlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Takes a well-formed XML string and returns it as an object.
+ *
+ * @param string $data A well-formed XML string
+ * @param string $class_name You may use this optional parameter so that
+ * simplexml_load_string will return an object of
+ * the specified class. That class should extend the
+ * SimpleXMLElement class.
+ * @param int $options Since PHP 5.1.0 and Libxml 2.6.0, you may also use the
+ * options parameter to specify additional Libxml parameters.
+ * @param string $ns Namespace prefix or URI.
+ * @param bool $is_prefix TRUE if ns is a prefix, FALSE if it's a URI;
+ * defaults to FALSE.
+ * @return \SimpleXMLElement Returns an object of class SimpleXMLElement with
+ * properties containing the data held within the xml document.
+ * @throws SimplexmlException
+ *
+ */
+function simplexml_load_string(string $data, string $class_name = "SimpleXMLElement", int $options = 0, string $ns = "", bool $is_prefix = false): \SimpleXMLElement
+{
+ error_clear_last();
+ $result = \simplexml_load_string($data, $class_name, $options, $ns, $is_prefix);
+ if ($result === false) {
+ throw SimplexmlException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/sockets.php b/vendor/thecodingmachine/safe/generated/sockets.php
new file mode 100644
index 000000000..d6cc892b4
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/sockets.php
@@ -0,0 +1,813 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\SocketsException;
+
+/**
+ * After the socket socket has been created
+ * using socket_create, bound to a name with
+ * socket_bind, and told to listen for connections
+ * with socket_listen, this function will accept
+ * incoming connections on that socket. Once a successful connection
+ * is made, a new socket resource is returned, which may be used
+ * for communication. If there are multiple connections queued on
+ * the socket, the first will be used. If there are no pending
+ * connections, socket_accept will block until
+ * a connection becomes present. If socket
+ * has been made non-blocking using
+ * socket_set_blocking or
+ * socket_set_nonblock, FALSE will be returned.
+ *
+ * The socket resource returned by
+ * socket_accept may not be used to accept new
+ * connections. The original listening socket
+ * socket, however, remains open and may be
+ * reused.
+ *
+ * @param resource $socket A valid socket resource created with socket_create.
+ * @return resource Returns a new socket resource on success. The actual
+ * error code can be retrieved by calling
+ * socket_last_error. This error code may be passed to
+ * socket_strerror to get a textual explanation of the
+ * error.
+ * @throws SocketsException
+ *
+ */
+function socket_accept($socket)
+{
+ error_clear_last();
+ $result = \socket_accept($socket);
+ if ($result === false) {
+ throw SocketsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Create a Socket resource, and bind it to the provided AddrInfo resource. The return
+ * value of this function may be used with socket_listen.
+ *
+ * @param resource $addr Resource created from socket_addrinfo_lookup.
+ * @return resource Returns a Socket resource on success.
+ * @throws SocketsException
+ *
+ */
+function socket_addrinfo_bind($addr)
+{
+ error_clear_last();
+ $result = \socket_addrinfo_bind($addr);
+ if ($result === null) {
+ throw SocketsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Create a Socket resource, and connect it to the provided AddrInfo resource. The return
+ * value of this function may be used with the rest of the socket functions.
+ *
+ * @param resource $addr Resource created from socket_addrinfo_lookup
+ * @return resource Returns a Socket resource on success.
+ * @throws SocketsException
+ *
+ */
+function socket_addrinfo_connect($addr)
+{
+ error_clear_last();
+ $result = \socket_addrinfo_connect($addr);
+ if ($result === null) {
+ throw SocketsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Binds the name given in address to the socket
+ * described by socket. This has to be done before
+ * a connection is be established using socket_connect
+ * or socket_listen.
+ *
+ * @param resource $socket A valid socket resource created with socket_create.
+ * @param string $address If the socket is of the AF_INET family, the
+ * address is an IP in dotted-quad notation
+ * (e.g. 127.0.0.1).
+ *
+ * If the socket is of the AF_UNIX family, the
+ * address is the path of a
+ * Unix-domain socket (e.g. /tmp/my.sock).
+ * @param int $port The port parameter is only used when
+ * binding an AF_INET socket, and designates
+ * the port on which to listen for connections.
+ * @throws SocketsException
+ *
+ */
+function socket_bind($socket, string $address, int $port = 0): void
+{
+ error_clear_last();
+ $result = \socket_bind($socket, $address, $port);
+ if ($result === false) {
+ throw SocketsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Initiate a connection to address using the socket resource
+ * socket, which must be a valid socket
+ * resource created with socket_create.
+ *
+ * @param resource $socket
+ * @param string $address The address parameter is either an IPv4 address
+ * in dotted-quad notation (e.g. 127.0.0.1) if
+ * socket is AF_INET, a valid
+ * IPv6 address (e.g. ::1) if IPv6 support is enabled and
+ * socket is AF_INET6
+ * or the pathname of a Unix domain socket, if the socket family is
+ * AF_UNIX.
+ * @param int $port The port parameter is only used and is mandatory
+ * when connecting to an AF_INET or an
+ * AF_INET6 socket, and designates
+ * the port on the remote host to which a connection should be made.
+ * @throws SocketsException
+ *
+ */
+function socket_connect($socket, string $address, int $port = 0): void
+{
+ error_clear_last();
+ $result = \socket_connect($socket, $address, $port);
+ if ($result === false) {
+ throw SocketsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * socket_create_listen creates a new socket resource of
+ * type AF_INET listening on all
+ * local interfaces on the given port waiting for new connections.
+ *
+ * This function is meant to ease the task of creating a new socket which
+ * only listens to accept new connections.
+ *
+ * @param int $port The port on which to listen on all interfaces.
+ * @param int $backlog The backlog parameter defines the maximum length
+ * the queue of pending connections may grow to.
+ * SOMAXCONN may be passed as
+ * backlog parameter, see
+ * socket_listen for more information.
+ * @return resource socket_create_listen returns a new socket resource
+ * on success. The error code can be retrieved with
+ * socket_last_error. This code may be passed to
+ * socket_strerror to get a textual explanation of the
+ * error.
+ * @throws SocketsException
+ *
+ */
+function socket_create_listen(int $port, int $backlog = 128)
+{
+ error_clear_last();
+ $result = \socket_create_listen($port, $backlog);
+ if ($result === false) {
+ throw SocketsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * socket_create_pair creates two connected and
+ * indistinguishable sockets, and stores them in fd.
+ * This function is commonly used in IPC (InterProcess Communication).
+ *
+ * @param int $domain The domain parameter specifies the protocol
+ * family to be used by the socket. See socket_create
+ * for the full list.
+ * @param int $type The type parameter selects the type of communication
+ * to be used by the socket. See socket_create for the
+ * full list.
+ * @param int $protocol The protocol parameter sets the specific
+ * protocol within the specified domain to be used
+ * when communicating on the returned socket. The proper value can be retrieved by
+ * name by using getprotobyname. If
+ * the desired protocol is TCP, or UDP the corresponding constants
+ * SOL_TCP, and SOL_UDP
+ * can also be used.
+ *
+ * See socket_create for the full list of supported
+ * protocols.
+ * @param resource[]|null $fd Reference to an array in which the two socket resources will be inserted.
+ * @throws SocketsException
+ *
+ */
+function socket_create_pair(int $domain, int $type, int $protocol, ?iterable &$fd): void
+{
+ error_clear_last();
+ $result = \socket_create_pair($domain, $type, $protocol, $fd);
+ if ($result === false) {
+ throw SocketsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Creates and returns a socket resource, also referred to as an endpoint
+ * of communication. A typical network connection is made up of 2 sockets, one
+ * performing the role of the client, and another performing the role of the server.
+ *
+ * @param int $domain The domain parameter specifies the protocol
+ * family to be used by the socket.
+ * @param int $type The type parameter selects the type of communication
+ * to be used by the socket.
+ * @param int $protocol The protocol parameter sets the specific
+ * protocol within the specified domain to be used
+ * when communicating on the returned socket. The proper value can be
+ * retrieved by name by using getprotobyname. If
+ * the desired protocol is TCP, or UDP the corresponding constants
+ * SOL_TCP, and SOL_UDP
+ * can also be used.
+ * @return resource socket_create returns a socket resource on success. The actual error code can be retrieved by calling
+ * socket_last_error. This error code may be passed to
+ * socket_strerror to get a textual explanation of the
+ * error.
+ * @throws SocketsException
+ *
+ */
+function socket_create(int $domain, int $type, int $protocol)
+{
+ error_clear_last();
+ $result = \socket_create($domain, $type, $protocol);
+ if ($result === false) {
+ throw SocketsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ *
+ *
+ * @param resource $socket
+ * @return resource Return resource.
+ * @throws SocketsException
+ *
+ */
+function socket_export_stream($socket)
+{
+ error_clear_last();
+ $result = \socket_export_stream($socket);
+ if ($result === false) {
+ throw SocketsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * The socket_get_option function retrieves the value for
+ * the option specified by the optname parameter for the
+ * specified socket.
+ *
+ * @param resource $socket A valid socket resource created with socket_create
+ * or socket_accept.
+ * @param int $level The level parameter specifies the protocol
+ * level at which the option resides. For example, to retrieve options at
+ * the socket level, a level parameter of
+ * SOL_SOCKET would be used. Other levels, such as
+ * TCP, can be used by
+ * specifying the protocol number of that level. Protocol numbers can be
+ * found by using the getprotobyname function.
+ * @param int $optname Reports whether the socket lingers on
+ * socket_close if data is present. By default,
+ * when the socket is closed, it attempts to send all unsent data.
+ * In the case of a connection-oriented socket,
+ * socket_close will wait for its peer to
+ * acknowledge the data.
+ *
+ * If l_onoff is non-zero and
+ * l_linger is zero, all the
+ * unsent data will be discarded and RST (reset) is sent to the
+ * peer in the case of a connection-oriented socket.
+ *
+ * On the other hand, if l_onoff is
+ * non-zero and l_linger is non-zero,
+ * socket_close will block until all the data
+ * is sent or the time specified in l_linger
+ * elapses. If the socket is non-blocking,
+ * socket_close will fail and return an error.
+ * @return mixed Returns the value of the given options.
+ * @throws SocketsException
+ *
+ */
+function socket_get_option($socket, int $level, int $optname)
+{
+ error_clear_last();
+ $result = \socket_get_option($socket, $level, $optname);
+ if ($result === false) {
+ throw SocketsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Queries the remote side of the given socket which may either result in
+ * host/port or in a Unix filesystem path, dependent on its type.
+ *
+ * @param resource $socket A valid socket resource created with socket_create
+ * or socket_accept.
+ * @param string $address If the given socket is of type AF_INET or
+ * AF_INET6, socket_getpeername
+ * will return the peers (remote) IP address in
+ * appropriate notation (e.g. 127.0.0.1 or
+ * fe80::1) in the address
+ * parameter and, if the optional port parameter is
+ * present, also the associated port.
+ *
+ * If the given socket is of type AF_UNIX,
+ * socket_getpeername will return the Unix filesystem
+ * path (e.g. /var/run/daemon.sock) in the
+ * address parameter.
+ * @param int|null $port If given, this will hold the port associated to
+ * address.
+ * @throws SocketsException
+ *
+ */
+function socket_getpeername($socket, string &$address, ?int &$port = null): void
+{
+ error_clear_last();
+ $result = \socket_getpeername($socket, $address, $port);
+ if ($result === false) {
+ throw SocketsException::createFromPhpError();
+ }
+}
+
+
+/**
+ *
+ *
+ * @param resource $socket A valid socket resource created with socket_create
+ * or socket_accept.
+ * @param string|null $addr If the given socket is of type AF_INET
+ * or AF_INET6, socket_getsockname
+ * will return the local IP address in appropriate notation (e.g.
+ * 127.0.0.1 or fe80::1) in the
+ * address parameter and, if the optional
+ * port parameter is present, also the associated port.
+ *
+ * If the given socket is of type AF_UNIX,
+ * socket_getsockname will return the Unix filesystem
+ * path (e.g. /var/run/daemon.sock) in the
+ * address parameter.
+ * @param int|null $port If provided, this will hold the associated port.
+ * @throws SocketsException
+ *
+ */
+function socket_getsockname($socket, ?string &$addr, ?int &$port = null): void
+{
+ error_clear_last();
+ $result = \socket_getsockname($socket, $addr, $port);
+ if ($result === false) {
+ throw SocketsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Imports a stream that encapsulates a socket into a socket extension resource.
+ *
+ * @param resource $stream The stream resource to import.
+ * @return resource|false Returns FALSE.
+ * @throws SocketsException
+ *
+ */
+function socket_import_stream($stream)
+{
+ error_clear_last();
+ $result = \socket_import_stream($stream);
+ if ($result === null) {
+ throw SocketsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * After the socket socket has been created
+ * using socket_create and bound to a name with
+ * socket_bind, it may be told to listen for incoming
+ * connections on socket.
+ *
+ * socket_listen is applicable only to sockets of
+ * type SOCK_STREAM or
+ * SOCK_SEQPACKET.
+ *
+ * @param resource $socket A valid socket resource created with socket_create
+ * or socket_addrinfo_bind
+ * @param int $backlog A maximum of backlog incoming connections will be
+ * queued for processing. If a connection request arrives with the queue
+ * full the client may receive an error with an indication of
+ * ECONNREFUSED, or, if the underlying protocol supports
+ * retransmission, the request may be ignored so that retries may succeed.
+ *
+ * The maximum number passed to the backlog
+ * parameter highly depends on the underlying platform. On Linux, it is
+ * silently truncated to SOMAXCONN. On win32, if
+ * passed SOMAXCONN, the underlying service provider
+ * responsible for the socket will set the backlog to a maximum
+ * reasonable value. There is no standard provision to
+ * find out the actual backlog value on this platform.
+ * @throws SocketsException
+ *
+ */
+function socket_listen($socket, int $backlog = 0): void
+{
+ error_clear_last();
+ $result = \socket_listen($socket, $backlog);
+ if ($result === false) {
+ throw SocketsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * The function socket_read reads from the socket
+ * resource socket created by the
+ * socket_create or
+ * socket_accept functions.
+ *
+ * @param resource $socket A valid socket resource created with socket_create
+ * or socket_accept.
+ * @param int $length The maximum number of bytes read is specified by the
+ * length parameter. Otherwise you can use
+ * \r, \n,
+ * or \0 to end reading (depending on the type
+ * parameter, see below).
+ * @param int $type Optional type parameter is a named constant:
+ *
+ *
+ *
+ * PHP_BINARY_READ (Default) - use the system
+ * recv() function. Safe for reading binary data.
+ *
+ *
+ *
+ *
+ * PHP_NORMAL_READ - reading stops at
+ * \n or \r.
+ *
+ *
+ *
+ * @return string socket_read returns the data as a string on success (including if the remote host has closed the
+ * connection). The error code can be retrieved with
+ * socket_last_error. This code may be passed to
+ * socket_strerror to get a textual representation of
+ * the error.
+ * @throws SocketsException
+ *
+ */
+function socket_read($socket, int $length, int $type = PHP_BINARY_READ): string
+{
+ error_clear_last();
+ $result = \socket_read($socket, $length, $type);
+ if ($result === false) {
+ throw SocketsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * The function socket_send sends
+ * len bytes to the socket
+ * socket from buf.
+ *
+ * @param resource $socket A valid socket resource created with socket_create
+ * or socket_accept.
+ * @param string $buf A buffer containing the data that will be sent to the remote host.
+ * @param int $len The number of bytes that will be sent to the remote host from
+ * buf.
+ * @param int $flags The value of flags can be any combination of
+ * the following flags, joined with the binary OR (|)
+ * operator.
+ *
+ * Possible values for flags
+ *
+ *
+ *
+ * MSG_OOB
+ *
+ * Send OOB (out-of-band) data.
+ *
+ *
+ *
+ * MSG_EOR
+ *
+ * Indicate a record mark. The sent data completes the record.
+ *
+ *
+ *
+ * MSG_EOF
+ *
+ * Close the sender side of the socket and include an appropriate
+ * notification of this at the end of the sent data. The sent data
+ * completes the transaction.
+ *
+ *
+ *
+ * MSG_DONTROUTE
+ *
+ * Bypass routing, use direct interface.
+ *
+ *
+ *
+ *
+ *
+ * @return int socket_send returns the number of bytes sent.
+ * @throws SocketsException
+ *
+ */
+function socket_send($socket, string $buf, int $len, int $flags): int
+{
+ error_clear_last();
+ $result = \socket_send($socket, $buf, $len, $flags);
+ if ($result === false) {
+ throw SocketsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ *
+ *
+ * @param resource $socket
+ * @param array $message
+ * @param int $flags
+ * @return int Returns the number of bytes sent.
+ * @throws SocketsException
+ *
+ */
+function socket_sendmsg($socket, array $message, int $flags = 0): int
+{
+ error_clear_last();
+ $result = \socket_sendmsg($socket, $message, $flags);
+ if ($result === false) {
+ throw SocketsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * The function socket_sendto sends
+ * len bytes from buf
+ * through the socket socket to the
+ * port at the address addr.
+ *
+ * @param resource $socket A valid socket resource created using socket_create.
+ * @param string $buf The sent data will be taken from buffer buf.
+ * @param int $len len bytes from buf will be
+ * sent.
+ * @param int $flags The value of flags can be any combination of
+ * the following flags, joined with the binary OR (|)
+ * operator.
+ *
+ * Possible values for flags
+ *
+ *
+ *
+ * MSG_OOB
+ *
+ * Send OOB (out-of-band) data.
+ *
+ *
+ *
+ * MSG_EOR
+ *
+ * Indicate a record mark. The sent data completes the record.
+ *
+ *
+ *
+ * MSG_EOF
+ *
+ * Close the sender side of the socket and include an appropriate
+ * notification of this at the end of the sent data. The sent data
+ * completes the transaction.
+ *
+ *
+ *
+ * MSG_DONTROUTE
+ *
+ * Bypass routing, use direct interface.
+ *
+ *
+ *
+ *
+ *
+ * @param string $addr IP address of the remote host.
+ * @param int $port port is the remote port number at which the data
+ * will be sent.
+ * @return int socket_sendto returns the number of bytes sent to the
+ * remote host.
+ * @throws SocketsException
+ *
+ */
+function socket_sendto($socket, string $buf, int $len, int $flags, string $addr, int $port = 0): int
+{
+ error_clear_last();
+ $result = \socket_sendto($socket, $buf, $len, $flags, $addr, $port);
+ if ($result === false) {
+ throw SocketsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * The socket_set_block function removes the
+ * O_NONBLOCK flag on the socket specified by the
+ * socket parameter.
+ *
+ * When an operation (e.g. receive, send, connect, accept, ...) is performed on
+ * a blocking socket, the script will pause its execution until it receives
+ * a signal or it can perform the operation.
+ *
+ * @param resource $socket A valid socket resource created with socket_create
+ * or socket_accept.
+ * @throws SocketsException
+ *
+ */
+function socket_set_block($socket): void
+{
+ error_clear_last();
+ $result = \socket_set_block($socket);
+ if ($result === false) {
+ throw SocketsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * The socket_set_nonblock function sets the
+ * O_NONBLOCK flag on the socket specified by
+ * the socket parameter.
+ *
+ * When an operation (e.g. receive, send, connect, accept, ...) is performed on
+ * a non-blocking socket, the script will not pause its execution until it receives a
+ * signal or it can perform the operation. Rather, if the operation would result
+ * in a block, the called function will fail.
+ *
+ * @param resource $socket A valid socket resource created with socket_create
+ * or socket_accept.
+ * @throws SocketsException
+ *
+ */
+function socket_set_nonblock($socket): void
+{
+ error_clear_last();
+ $result = \socket_set_nonblock($socket);
+ if ($result === false) {
+ throw SocketsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * The socket_set_option function sets the option
+ * specified by the optname parameter, at the
+ * specified protocol level, to the value pointed to
+ * by the optval parameter for the
+ * socket.
+ *
+ * @param resource $socket A valid socket resource created with socket_create
+ * or socket_accept.
+ * @param int $level The level parameter specifies the protocol
+ * level at which the option resides. For example, to retrieve options at
+ * the socket level, a level parameter of
+ * SOL_SOCKET would be used. Other levels, such as
+ * TCP, can be used by specifying the protocol number of that level.
+ * Protocol numbers can be found by using the
+ * getprotobyname function.
+ * @param int $optname The available socket options are the same as those for the
+ * socket_get_option function.
+ * @param int|string|array $optval The option value.
+ * @throws SocketsException
+ *
+ */
+function socket_set_option($socket, int $level, int $optname, $optval): void
+{
+ error_clear_last();
+ $result = \socket_set_option($socket, $level, $optname, $optval);
+ if ($result === false) {
+ throw SocketsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * The socket_shutdown function allows you to stop
+ * incoming, outgoing or all data (the default) from being sent through the
+ * socket
+ *
+ * @param resource $socket A valid socket resource created with socket_create.
+ * @param int $how The value of how can be one of the following:
+ *
+ * possible values for how
+ *
+ *
+ *
+ * 0
+ *
+ * Shutdown socket reading
+ *
+ *
+ *
+ * 1
+ *
+ * Shutdown socket writing
+ *
+ *
+ *
+ * 2
+ *
+ * Shutdown socket reading and writing
+ *
+ *
+ *
+ *
+ *
+ * @throws SocketsException
+ *
+ */
+function socket_shutdown($socket, int $how = 2): void
+{
+ error_clear_last();
+ $result = \socket_shutdown($socket, $how);
+ if ($result === false) {
+ throw SocketsException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Exports the WSAPROTOCOL_INFO structure into shared memory and returns
+ * an identifier to be used with socket_wsaprotocol_info_import. The
+ * exported ID is only valid for the given target_pid.
+ *
+ * @param resource $socket A valid socket resource.
+ * @param int $target_pid The ID of the process which will import the socket.
+ * @return string Returns an identifier to be used for the import
+ * @throws SocketsException
+ *
+ */
+function socket_wsaprotocol_info_export($socket, int $target_pid): string
+{
+ error_clear_last();
+ $result = \socket_wsaprotocol_info_export($socket, $target_pid);
+ if ($result === false) {
+ throw SocketsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Imports a socket which has formerly been exported from another process.
+ *
+ * @param string $info_id The ID which has been returned by a former call to
+ * socket_wsaprotocol_info_export.
+ * @return resource Returns the socket resource
+ * @throws SocketsException
+ *
+ */
+function socket_wsaprotocol_info_import(string $info_id)
+{
+ error_clear_last();
+ $result = \socket_wsaprotocol_info_import($info_id);
+ if ($result === false) {
+ throw SocketsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Releases the shared memory corresponding to the given info_id.
+ *
+ * @param string $info_id The ID which has been returned by a former call to
+ * socket_wsaprotocol_info_export.
+ * @throws SocketsException
+ *
+ */
+function socket_wsaprotocol_info_release(string $info_id): void
+{
+ error_clear_last();
+ $result = \socket_wsaprotocol_info_release($info_id);
+ if ($result === false) {
+ throw SocketsException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/sodium.php b/vendor/thecodingmachine/safe/generated/sodium.php
new file mode 100644
index 000000000..6cb378adb
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/sodium.php
@@ -0,0 +1,58 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\SodiumException;
+
+/**
+ * Uses a CPU- and memory-hard hash algorithm along with a randomly-generated salt, and memory and CPU limits to generate an ASCII-encoded hash suitable for password storage.
+ *
+ * @param string $password string; The password to generate a hash for.
+ * @param int $opslimit Represents a maximum amount of computations to perform. Raising this number will make the function require more CPU cycles to compute a key. There are constants available to set the operations limit to appropriate values depending on intended use, in order of strength: SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE, SODIUM_CRYPTO_PWHASH_OPSLIMIT_MODERATE and SODIUM_CRYPTO_PWHASH_OPSLIMIT_SENSITIVE.
+ * @param int $memlimit The maximum amount of RAM that the function will use, in bytes. There are constants to help you choose an appropriate value, in order of size: SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE, SODIUM_CRYPTO_PWHASH_MEMLIMIT_MODERATE, and SODIUM_CRYPTO_PWHASH_MEMLIMIT_SENSITIVE. Typically these should be paired with the matching opslimit values.
+ * @return string Returns the hashed password.
+ *
+ * In order to produce the same password hash from the same password, the same values for opslimit and memlimit must be used. These are embedded within the generated hash, so
+ * everything that's needed to verify the hash is included. This allows
+ * the sodium_crypto_pwhash_str_verify function to verify the hash without
+ * needing separate storage for the other parameters.
+ * @throws SodiumException
+ *
+ */
+function sodium_crypto_pwhash_str(string $password, int $opslimit, int $memlimit): string
+{
+ error_clear_last();
+ $result = \sodium_crypto_pwhash_str($password, $opslimit, $memlimit);
+ if ($result === false) {
+ throw SodiumException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * This function provides low-level access to libsodium's crypto_pwhash key derivation function. Unless you have specific reason to use this function, you should use sodium_crypto_pwhash_str or password_hash functions instead.
+ *
+ * @param int $length integer; The length of the password hash to generate, in bytes.
+ * @param string $password string; The password to generate a hash for.
+ * @param string $salt string A salt to add to the password before hashing. The salt should be unpredictable, ideally generated from a good random mumber source such as random_bytes, and have a length of at least SODIUM_CRYPTO_PWHASH_SALTBYTES bytes.
+ * @param int $opslimit Represents a maximum amount of computations to perform. Raising this number will make the function require more CPU cycles to compute a key. There are some constants available to set the operations limit to appropriate values depending on intended use, in order of strength: SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE, SODIUM_CRYPTO_PWHASH_OPSLIMIT_MODERATE and SODIUM_CRYPTO_PWHASH_OPSLIMIT_SENSITIVE.
+ * @param int $memlimit The maximum amount of RAM that the function will use, in bytes. There are constants to help you choose an appropriate value, in order of size: SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE, SODIUM_CRYPTO_PWHASH_MEMLIMIT_MODERATE, and SODIUM_CRYPTO_PWHASH_MEMLIMIT_SENSITIVE. Typically these should be paired with the matching opslimit values.
+ * @param int $alg integer A number indicating the hash algorithm to use. By default SODIUM_CRYPTO_PWHASH_ALG_DEFAULT (the currently recommended algorithm, which can change from one version of libsodium to another), or explicitly using SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13, representing the Argon2id algorithm version 1.3.
+ * @return string Returns the derived key. The return value is a binary string of the hash, not an ASCII-encoded representation, and does not contain additional information about the parameters used to create the hash, so you will need to keep that information if you are ever going to verify the password in future. Use sodium_crypto_pwhash_str to avoid needing to do all that.
+ * @throws SodiumException
+ *
+ */
+function sodium_crypto_pwhash(int $length, string $password, string $salt, int $opslimit, int $memlimit, int $alg = null): string
+{
+ error_clear_last();
+ if ($alg !== null) {
+ $result = \sodium_crypto_pwhash($length, $password, $salt, $opslimit, $memlimit, $alg);
+ } else {
+ $result = \sodium_crypto_pwhash($length, $password, $salt, $opslimit, $memlimit);
+ }
+ if ($result === false) {
+ throw SodiumException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/solr.php b/vendor/thecodingmachine/safe/generated/solr.php
new file mode 100644
index 000000000..4d4e0418a
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/solr.php
@@ -0,0 +1,22 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\SolrException;
+
+/**
+ * This function returns the current version of the extension as a string.
+ *
+ * @return string It returns a string on success.
+ * @throws SolrException
+ *
+ */
+function solr_get_version(): string
+{
+ error_clear_last();
+ $result = \solr_get_version();
+ if ($result === false) {
+ throw SolrException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/spl.php b/vendor/thecodingmachine/safe/generated/spl.php
new file mode 100644
index 000000000..679e68991
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/spl.php
@@ -0,0 +1,139 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\SplException;
+
+/**
+ * This function returns an array with the names of the interfaces that the
+ * given class and its parents implement.
+ *
+ * @param mixed $class An object (class instance) or a string (class or interface name).
+ * @param bool $autoload Whether to allow this function to load the class automatically through
+ * the __autoload magic method.
+ * @return array An array on success.
+ * @throws SplException
+ *
+ */
+function class_implements($class, bool $autoload = true): array
+{
+ error_clear_last();
+ $result = \class_implements($class, $autoload);
+ if ($result === false) {
+ throw SplException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * This function returns an array with the name of the parent classes of
+ * the given class.
+ *
+ * @param mixed $class An object (class instance) or a string (class name).
+ * @param bool $autoload Whether to allow this function to load the class automatically through
+ * the __autoload magic method.
+ * @return array An array on success.
+ * @throws SplException
+ *
+ */
+function class_parents($class, bool $autoload = true): array
+{
+ error_clear_last();
+ $result = \class_parents($class, $autoload);
+ if ($result === false) {
+ throw SplException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * This function returns an array with the names of the traits that the
+ * given class uses. This does however not include
+ * any traits used by a parent class.
+ *
+ * @param mixed $class An object (class instance) or a string (class name).
+ * @param bool $autoload Whether to allow this function to load the class automatically through
+ * the __autoload magic method.
+ * @return array An array on success.
+ * @throws SplException
+ *
+ */
+function class_uses($class, bool $autoload = true): array
+{
+ error_clear_last();
+ $result = \class_uses($class, $autoload);
+ if ($result === false) {
+ throw SplException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Register a function with the spl provided __autoload queue. If the queue
+ * is not yet activated it will be activated.
+ *
+ * If your code has an existing __autoload function then
+ * this function must be explicitly registered on the __autoload queue. This
+ * is because spl_autoload_register will effectively
+ * replace the engine cache for the __autoload function
+ * by either spl_autoload or
+ * spl_autoload_call.
+ *
+ * If there must be multiple autoload functions, spl_autoload_register
+ * allows for this. It effectively creates a queue of autoload functions, and
+ * runs through each of them in the order they are defined. By contrast,
+ * __autoload may only be defined once.
+ *
+ * @param callable(string):void $autoload_function The autoload function being registered.
+ * If no parameter is provided, then the default implementation of
+ * spl_autoload will be registered.
+ * @param bool $throw This parameter specifies whether
+ * spl_autoload_register should throw
+ * exceptions when the autoload_function
+ * cannot be registered.
+ * @param bool $prepend If true, spl_autoload_register will prepend
+ * the autoloader on the autoload queue instead of appending it.
+ * @throws SplException
+ *
+ */
+function spl_autoload_register(callable $autoload_function = null, bool $throw = true, bool $prepend = false): void
+{
+ error_clear_last();
+ if ($prepend !== false) {
+ $result = \spl_autoload_register($autoload_function, $throw, $prepend);
+ } elseif ($throw !== true) {
+ $result = \spl_autoload_register($autoload_function, $throw);
+ } elseif ($autoload_function !== null) {
+ $result = \spl_autoload_register($autoload_function);
+ } else {
+ $result = \spl_autoload_register();
+ }
+ if ($result === false) {
+ throw SplException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Removes a function from the autoload queue. If the queue
+ * is activated and empty after removing the given function then it will
+ * be deactivated.
+ *
+ * When this function results in the queue being deactivated, any
+ * __autoload function that previously existed will not be reactivated.
+ *
+ * @param mixed $autoload_function The autoload function being unregistered.
+ * @throws SplException
+ *
+ */
+function spl_autoload_unregister($autoload_function): void
+{
+ error_clear_last();
+ $result = \spl_autoload_unregister($autoload_function);
+ if ($result === false) {
+ throw SplException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/sqlsrv.php b/vendor/thecodingmachine/safe/generated/sqlsrv.php
new file mode 100644
index 000000000..e93aa37af
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/sqlsrv.php
@@ -0,0 +1,429 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\SqlsrvException;
+
+/**
+ * The transaction begun by sqlsrv_begin_transaction includes
+ * all statements that were executed after the call to
+ * sqlsrv_begin_transaction and before calls to
+ * sqlsrv_rollback or sqlsrv_commit.
+ * Explicit transactions should be started and committed or rolled back using
+ * these functions instead of executing SQL statements that begin and commit/roll
+ * back transactions. For more information, see
+ * SQLSRV Transactions.
+ *
+ * @param resource $conn The connection resource returned by a call to sqlsrv_connect.
+ * @throws SqlsrvException
+ *
+ */
+function sqlsrv_begin_transaction($conn): void
+{
+ error_clear_last();
+ $result = \sqlsrv_begin_transaction($conn);
+ if ($result === false) {
+ throw SqlsrvException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Cancels a statement. Any results associated with the statement that have not
+ * been consumed are deleted. After sqlsrv_cancel has been
+ * called, the specified statement can be re-executed if it was created with
+ * sqlsrv_prepare. Calling sqlsrv_cancel
+ * is not necessary if all the results associated with the statement have been
+ * consumed.
+ *
+ * @param resource $stmt The statement resource to be cancelled.
+ * @throws SqlsrvException
+ *
+ */
+function sqlsrv_cancel($stmt): void
+{
+ error_clear_last();
+ $result = \sqlsrv_cancel($stmt);
+ if ($result === false) {
+ throw SqlsrvException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Returns information about the client and specified connection
+ *
+ * @param resource $conn The connection about which information is returned.
+ * @return array Returns an associative array with keys described in the table below.
+ *
+ * Array returned by sqlsrv_client_info
+ *
+ *
+ *
+ * Key
+ * Description
+ *
+ *
+ *
+ *
+ * DriverDllName
+ * SQLNCLI10.DLL
+ *
+ *
+ * DriverODBCVer
+ * ODBC version (xx.yy)
+ *
+ *
+ * DriverVer
+ * SQL Server Native Client DLL version (10.5.xxx)
+ *
+ *
+ * ExtensionVer
+ * php_sqlsrv.dll version (2.0.xxx.x)
+ *
+ *
+ *
+ *
+ * @throws SqlsrvException
+ *
+ */
+function sqlsrv_client_info($conn): array
+{
+ error_clear_last();
+ $result = \sqlsrv_client_info($conn);
+ if ($result === false) {
+ throw SqlsrvException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Closes an open connection and releases resourses associated with the connection.
+ *
+ * @param resource $conn The connection to be closed.
+ * @throws SqlsrvException
+ *
+ */
+function sqlsrv_close($conn): void
+{
+ error_clear_last();
+ $result = \sqlsrv_close($conn);
+ if ($result === false) {
+ throw SqlsrvException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Commits a transaction that was begun with sqlsrv_begin_transaction.
+ * The connection is returned to auto-commit mode after sqlsrv_commit
+ * is called. The transaction that is committed includes all statements that were
+ * executed after the call to sqlsrv_begin_transaction.
+ * Explicit transactions should be started and committed or rolled back using these
+ * functions instead of executing SQL statements that begin and commit/roll back
+ * transactions. For more information, see
+ * SQLSRV Transactions.
+ *
+ * @param resource $conn The connection on which the transaction is to be committed.
+ * @throws SqlsrvException
+ *
+ */
+function sqlsrv_commit($conn): void
+{
+ error_clear_last();
+ $result = \sqlsrv_commit($conn);
+ if ($result === false) {
+ throw SqlsrvException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Changes the driver error handling and logging configurations.
+ *
+ * @param string $setting The name of the setting to set. The possible values are
+ * "WarningsReturnAsErrors", "LogSubsystems", and "LogSeverity".
+ * @param mixed $value The value of the specified setting. The following table shows possible values:
+ *
+ * Error and Logging Setting Options
+ *
+ *
+ *
+ * Setting
+ * Options
+ *
+ *
+ *
+ *
+ * WarningsReturnAsErrors
+ * 1 (TRUE) or 0 (FALSE)
+ *
+ *
+ * LogSubsystems
+ * SQLSRV_LOG_SYSTEM_ALL (-1)
+ * SQLSRV_LOG_SYSTEM_CONN (2)
+ * SQLSRV_LOG_SYSTEM_INIT (1)
+ * SQLSRV_LOG_SYSTEM_OFF (0)
+ * SQLSRV_LOG_SYSTEM_STMT (4)
+ * SQLSRV_LOG_SYSTEM_UTIL (8)
+ *
+ *
+ * LogSeverity
+ * SQLSRV_LOG_SEVERITY_ALL (-1)
+ * SQLSRV_LOG_SEVERITY_ERROR (1)
+ * SQLSRV_LOG_SEVERITY_NOTICE (4)
+ * SQLSRV_LOG_SEVERITY_WARNING (2)
+ *
+ *
+ *
+ *
+ * @throws SqlsrvException
+ *
+ */
+function sqlsrv_configure(string $setting, $value): void
+{
+ error_clear_last();
+ $result = \sqlsrv_configure($setting, $value);
+ if ($result === false) {
+ throw SqlsrvException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Executes a statement prepared with sqlsrv_prepare. This
+ * function is ideal for executing a prepared statement multiple times with
+ * different parameter values.
+ *
+ * @param resource $stmt A statement resource returned by sqlsrv_prepare.
+ * @throws SqlsrvException
+ *
+ */
+function sqlsrv_execute($stmt): void
+{
+ error_clear_last();
+ $result = \sqlsrv_execute($stmt);
+ if ($result === false) {
+ throw SqlsrvException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Frees all resources for the specified statement. The statement cannot be used
+ * after sqlsrv_free_stmt has been called on it. If
+ * sqlsrv_free_stmt is called on an in-progress statement
+ * that alters server state, statement execution is terminated and the statement
+ * is rolled back.
+ *
+ * @param resource $stmt The statement for which resources are freed.
+ * Note that NULL is a valid parameter value. This allows the function to be
+ * called multiple times in a script.
+ * @throws SqlsrvException
+ *
+ */
+function sqlsrv_free_stmt($stmt): void
+{
+ error_clear_last();
+ $result = \sqlsrv_free_stmt($stmt);
+ if ($result === false) {
+ throw SqlsrvException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Gets field data from the currently selected row. Fields must be accessed in
+ * order. Field indices start at 0.
+ *
+ * @param resource $stmt A statement resource returned by sqlsrv_query or
+ * sqlsrv_execute.
+ * @param int $fieldIndex The index of the field to be retrieved. Field indices start at 0. Fields
+ * must be accessed in order. i.e. If you access field index 1, then field
+ * index 0 will not be available.
+ * @param int $getAsType The PHP data type for the returned field data. If this parameter is not
+ * set, the field data will be returned as its default PHP data type.
+ * For information about default PHP data types, see
+ * Default PHP Data Types
+ * in the Microsoft SQLSRV documentation.
+ * @return mixed Returns data from the specified field on success.
+ * @throws SqlsrvException
+ *
+ */
+function sqlsrv_get_field($stmt, int $fieldIndex, int $getAsType = null)
+{
+ error_clear_last();
+ if ($getAsType !== null) {
+ $result = \sqlsrv_get_field($stmt, $fieldIndex, $getAsType);
+ } else {
+ $result = \sqlsrv_get_field($stmt, $fieldIndex);
+ }
+ if ($result === false) {
+ throw SqlsrvException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Makes the next result of the specified statement active. Results include result
+ * sets, row counts, and output parameters.
+ *
+ * @param resource $stmt The statement on which the next result is being called.
+ * @return bool|null Returns TRUE if the next result was successfully retrieved, FALSE if an error
+ * occurred, and NULL if there are no more results to retrieve.
+ * @throws SqlsrvException
+ *
+ */
+function sqlsrv_next_result($stmt): ?bool
+{
+ error_clear_last();
+ $result = \sqlsrv_next_result($stmt);
+ if ($result === false) {
+ throw SqlsrvException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Retrieves the number of fields (columns) on a statement.
+ *
+ * @param resource $stmt The statement for which the number of fields is returned.
+ * sqlsrv_num_fields can be called on a statement before
+ * or after statement execution.
+ * @return int Returns the number of fields on success.
+ * @throws SqlsrvException
+ *
+ */
+function sqlsrv_num_fields($stmt): int
+{
+ error_clear_last();
+ $result = \sqlsrv_num_fields($stmt);
+ if ($result === false) {
+ throw SqlsrvException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Retrieves the number of rows in a result set. This function requires that the
+ * statement resource be created with a static or keyset cursor. For more information,
+ * see sqlsrv_query, sqlsrv_prepare,
+ * or Specifying a Cursor Type and Selecting Rows
+ * in the Microsoft SQLSRV documentation.
+ *
+ * @param resource $stmt The statement for which the row count is returned. The statement resource
+ * must be created with a static or keyset cursor. For more information, see
+ * sqlsrv_query, sqlsrv_prepare, or
+ * Specifying a Cursor Type and Selecting Rows
+ * in the Microsoft SQLSRV documentation.
+ * @return int Returns the number of rows retrieved on success.
+ * If a forward cursor (the default) or dynamic cursor is used, FALSE is returned.
+ * @throws SqlsrvException
+ *
+ */
+function sqlsrv_num_rows($stmt): int
+{
+ error_clear_last();
+ $result = \sqlsrv_num_rows($stmt);
+ if ($result === false) {
+ throw SqlsrvException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Prepares a query for execution. This function is ideal for preparing a query
+ * that will be executed multiple times with different parameter values.
+ *
+ * @param resource $conn A connection resource returned by sqlsrv_connect.
+ * @param string $sql The string that defines the query to be prepared and executed.
+ * @param array $params An array specifying parameter information when executing a parameterized
+ * query. Array elements can be any of the following:
+ *
+ * A literal value
+ * A PHP variable
+ * An array with this structure:
+ * array($value [, $direction [, $phpType [, $sqlType]]])
+ *
+ * The following table describes the elements in the array structure above:
+ * @param array $options An array specifying query property options. The supported keys are described
+ * in the following table:
+ * @return resource Returns a statement resource on success.
+ * @throws SqlsrvException
+ *
+ */
+function sqlsrv_prepare($conn, string $sql, array $params = null, array $options = null)
+{
+ error_clear_last();
+ if ($options !== null) {
+ $result = \sqlsrv_prepare($conn, $sql, $params, $options);
+ } elseif ($params !== null) {
+ $result = \sqlsrv_prepare($conn, $sql, $params);
+ } else {
+ $result = \sqlsrv_prepare($conn, $sql);
+ }
+ if ($result === false) {
+ throw SqlsrvException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Prepares and executes a query.
+ *
+ * @param resource $conn A connection resource returned by sqlsrv_connect.
+ * @param string $sql The string that defines the query to be prepared and executed.
+ * @param array $params An array specifying parameter information when executing a parameterized query.
+ * Array elements can be any of the following:
+ *
+ * A literal value
+ * A PHP variable
+ * An array with this structure:
+ * array($value [, $direction [, $phpType [, $sqlType]]])
+ *
+ * The following table describes the elements in the array structure above:
+ * @param array $options An array specifying query property options. The supported keys are described
+ * in the following table:
+ * @return resource Returns a statement resource on success.
+ * @throws SqlsrvException
+ *
+ */
+function sqlsrv_query($conn, string $sql, array $params = null, array $options = null)
+{
+ error_clear_last();
+ if ($options !== null) {
+ $result = \sqlsrv_query($conn, $sql, $params, $options);
+ } elseif ($params !== null) {
+ $result = \sqlsrv_query($conn, $sql, $params);
+ } else {
+ $result = \sqlsrv_query($conn, $sql);
+ }
+ if ($result === false) {
+ throw SqlsrvException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Rolls back a transaction that was begun with sqlsrv_begin_transaction
+ * and returns the connection to auto-commit mode.
+ *
+ * @param resource $conn The connection resource returned by a call to sqlsrv_connect.
+ * @throws SqlsrvException
+ *
+ */
+function sqlsrv_rollback($conn): void
+{
+ error_clear_last();
+ $result = \sqlsrv_rollback($conn);
+ if ($result === false) {
+ throw SqlsrvException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/ssdeep.php b/vendor/thecodingmachine/safe/generated/ssdeep.php
new file mode 100644
index 000000000..662fc9b94
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/ssdeep.php
@@ -0,0 +1,70 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\SsdeepException;
+
+/**
+ * Calculates the match score between signature1
+ * and signature2 using
+ * context-triggered piecewise hashing, and returns the match
+ * score.
+ *
+ * @param string $signature1 The first fuzzy hash signature string.
+ * @param string $signature2 The second fuzzy hash signature string.
+ * @return int Returns an integer from 0 to 100 on success, FALSE otherwise.
+ * @throws SsdeepException
+ *
+ */
+function ssdeep_fuzzy_compare(string $signature1, string $signature2): int
+{
+ error_clear_last();
+ $result = \ssdeep_fuzzy_compare($signature1, $signature2);
+ if ($result === false) {
+ throw SsdeepException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * ssdeep_fuzzy_hash_filename calculates the hash
+ * of the file specified by file_name using
+ * context-triggered piecewise
+ * hashing, and returns that hash.
+ *
+ * @param string $file_name The filename of the file to hash.
+ * @return string Returns a string on success, FALSE otherwise.
+ * @throws SsdeepException
+ *
+ */
+function ssdeep_fuzzy_hash_filename(string $file_name): string
+{
+ error_clear_last();
+ $result = \ssdeep_fuzzy_hash_filename($file_name);
+ if ($result === false) {
+ throw SsdeepException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * ssdeep_fuzzy_hash calculates the hash of
+ * to_hash using
+ * context-triggered piecewise hashing, and returns that hash.
+ *
+ * @param string $to_hash The input string.
+ * @return string Returns a string on success, FALSE otherwise.
+ * @throws SsdeepException
+ *
+ */
+function ssdeep_fuzzy_hash(string $to_hash): string
+{
+ error_clear_last();
+ $result = \ssdeep_fuzzy_hash($to_hash);
+ if ($result === false) {
+ throw SsdeepException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/ssh2.php b/vendor/thecodingmachine/safe/generated/ssh2.php
new file mode 100644
index 000000000..96af9df32
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/ssh2.php
@@ -0,0 +1,641 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\Ssh2Exception;
+
+/**
+ * Authenticate over SSH using the ssh agent
+ *
+ * @param resource $session An SSH connection link identifier, obtained from a call to
+ * ssh2_connect.
+ * @param string $username Remote user name.
+ * @throws Ssh2Exception
+ *
+ */
+function ssh2_auth_agent($session, string $username): void
+{
+ error_clear_last();
+ $result = \ssh2_auth_agent($session, $username);
+ if ($result === false) {
+ throw Ssh2Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Authenticate using a public hostkey read from a file.
+ *
+ * @param resource $session An SSH connection link identifier, obtained from a call to
+ * ssh2_connect.
+ * @param string $username
+ * @param string $hostname
+ * @param string $pubkeyfile
+ * @param string $privkeyfile
+ * @param string $passphrase If privkeyfile is encrypted (which it should
+ * be), the passphrase must be provided.
+ * @param string $local_username If local_username is omitted, then the value
+ * for username will be used for it.
+ * @throws Ssh2Exception
+ *
+ */
+function ssh2_auth_hostbased_file($session, string $username, string $hostname, string $pubkeyfile, string $privkeyfile, string $passphrase = null, string $local_username = null): void
+{
+ error_clear_last();
+ if ($local_username !== null) {
+ $result = \ssh2_auth_hostbased_file($session, $username, $hostname, $pubkeyfile, $privkeyfile, $passphrase, $local_username);
+ } elseif ($passphrase !== null) {
+ $result = \ssh2_auth_hostbased_file($session, $username, $hostname, $pubkeyfile, $privkeyfile, $passphrase);
+ } else {
+ $result = \ssh2_auth_hostbased_file($session, $username, $hostname, $pubkeyfile, $privkeyfile);
+ }
+ if ($result === false) {
+ throw Ssh2Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Authenticate over SSH using a plain password. Since version 0.12 this function
+ * also supports keyboard_interactive method.
+ *
+ * @param resource $session An SSH connection link identifier, obtained from a call to
+ * ssh2_connect.
+ * @param string $username Remote user name.
+ * @param string $password Password for username
+ * @throws Ssh2Exception
+ *
+ */
+function ssh2_auth_password($session, string $username, string $password): void
+{
+ error_clear_last();
+ $result = \ssh2_auth_password($session, $username, $password);
+ if ($result === false) {
+ throw Ssh2Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Authenticate using a public key read from a file.
+ *
+ * @param resource $session An SSH connection link identifier, obtained from a call to
+ * ssh2_connect.
+ * @param string $username
+ * @param string $pubkeyfile The public key file needs to be in OpenSSH's format. It should look something like:
+ *
+ * ssh-rsa AAAAB3NzaC1yc2EAAA....NX6sqSnHA8= rsa-key-20121110
+ * @param string $privkeyfile
+ * @param string $passphrase If privkeyfile is encrypted (which it should
+ * be), the passphrase must be provided.
+ * @throws Ssh2Exception
+ *
+ */
+function ssh2_auth_pubkey_file($session, string $username, string $pubkeyfile, string $privkeyfile, string $passphrase = null): void
+{
+ error_clear_last();
+ if ($passphrase !== null) {
+ $result = \ssh2_auth_pubkey_file($session, $username, $pubkeyfile, $privkeyfile, $passphrase);
+ } else {
+ $result = \ssh2_auth_pubkey_file($session, $username, $pubkeyfile, $privkeyfile);
+ }
+ if ($result === false) {
+ throw Ssh2Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Establish a connection to a remote SSH server.
+ *
+ * Once connected, the client should verify the server's hostkey using
+ * ssh2_fingerprint, then authenticate using either
+ * password or public key.
+ *
+ * @param string $host
+ * @param int $port
+ * @param array $methods methods may be an associative array with up to four parameters
+ * as described below.
+ *
+ *
+ * methods may be an associative array
+ * with any or all of the following parameters.
+ *
+ *
+ *
+ * Index
+ * Meaning
+ * Supported Values*
+ *
+ *
+ *
+ *
+ * kex
+ *
+ * List of key exchange methods to advertise, comma separated
+ * in order of preference.
+ *
+ *
+ * diffie-hellman-group1-sha1,
+ * diffie-hellman-group14-sha1, and
+ * diffie-hellman-group-exchange-sha1
+ *
+ *
+ *
+ * hostkey
+ *
+ * List of hostkey methods to advertise, comma separated
+ * in order of preference.
+ *
+ *
+ * ssh-rsa and
+ * ssh-dss
+ *
+ *
+ *
+ * client_to_server
+ *
+ * Associative array containing crypt, compression, and
+ * message authentication code (MAC) method preferences
+ * for messages sent from client to server.
+ *
+ *
+ *
+ *
+ * server_to_client
+ *
+ * Associative array containing crypt, compression, and
+ * message authentication code (MAC) method preferences
+ * for messages sent from server to client.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * * - Supported Values are dependent on methods supported by underlying library.
+ * See libssh2 documentation for additional
+ * information.
+ *
+ *
+ *
+ * client_to_server and
+ * server_to_client may be an associative array
+ * with any or all of the following parameters.
+ *
+ *
+ *
+ *
+ * Index
+ * Meaning
+ * Supported Values*
+ *
+ *
+ *
+ *
+ * crypt
+ * List of crypto methods to advertise, comma separated
+ * in order of preference.
+ *
+ * aes256-cbc,
+ * aes192-cbc,
+ * aes128-cbc,
+ * 3des-cbc,
+ * blowfish-cbc,
+ * cast128-cbc,
+ * arcfour, and
+ * none**
+ *
+ *
+ *
+ * comp
+ * List of compression methods to advertise, comma separated
+ * in order of preference.
+ *
+ * zlib and
+ * none
+ *
+ *
+ *
+ * mac
+ * List of MAC methods to advertise, comma separated
+ * in order of preference.
+ *
+ * hmac-sha1,
+ * hmac-sha1-96,
+ * hmac-ripemd160,
+ * none**
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * Crypt and MAC method "none"
+ *
+ * For security reasons, none is disabled by the underlying
+ * libssh2 library unless explicitly enabled
+ * during build time by using the appropriate ./configure options. See documentation
+ * for the underlying library for more information.
+ *
+ *
+ *
+ * For security reasons, none is disabled by the underlying
+ * libssh2 library unless explicitly enabled
+ * during build time by using the appropriate ./configure options. See documentation
+ * for the underlying library for more information.
+ * @param array $callbacks callbacks may be an associative array with any
+ * or all of the following parameters.
+ *
+ *
+ * Callbacks parameters
+ *
+ *
+ *
+ *
+ * Index
+ * Meaning
+ * Prototype
+ *
+ *
+ *
+ *
+ * ignore
+ *
+ * Name of function to call when an
+ * SSH2_MSG_IGNORE packet is received
+ *
+ * void ignore_cb($message)
+ *
+ *
+ * debug
+ *
+ * Name of function to call when an
+ * SSH2_MSG_DEBUG packet is received
+ *
+ * void debug_cb($message, $language, $always_display)
+ *
+ *
+ * macerror
+ *
+ * Name of function to call when a packet is received but the
+ * message authentication code failed. If the callback returns
+ * TRUE, the mismatch will be ignored, otherwise the connection
+ * will be terminated.
+ *
+ * bool macerror_cb($packet)
+ *
+ *
+ * disconnect
+ *
+ * Name of function to call when an
+ * SSH2_MSG_DISCONNECT packet is received
+ *
+ * void disconnect_cb($reason, $message, $language)
+ *
+ *
+ *
+ *
+ * @return resource Returns a resource on success.
+ * @throws Ssh2Exception
+ *
+ */
+function ssh2_connect(string $host, int $port = 22, array $methods = null, array $callbacks = null)
+{
+ error_clear_last();
+ if ($callbacks !== null) {
+ $result = \ssh2_connect($host, $port, $methods, $callbacks);
+ } elseif ($methods !== null) {
+ $result = \ssh2_connect($host, $port, $methods);
+ } else {
+ $result = \ssh2_connect($host, $port);
+ }
+ if ($result === false) {
+ throw Ssh2Exception::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Close a connection to a remote SSH server.
+ *
+ * @param resource $session An SSH connection link identifier, obtained from a call to
+ * ssh2_connect.
+ * @throws Ssh2Exception
+ *
+ */
+function ssh2_disconnect($session): void
+{
+ error_clear_last();
+ $result = \ssh2_disconnect($session);
+ if ($result === false) {
+ throw Ssh2Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Execute a command at the remote end and allocate a channel for it.
+ *
+ * @param resource $session An SSH connection link identifier, obtained from a call to
+ * ssh2_connect.
+ * @param string $command
+ * @param string $pty
+ * @param array $env env may be passed as an associative array of
+ * name/value pairs to set in the target environment.
+ * @param int $width Width of the virtual terminal.
+ * @param int $height Height of the virtual terminal.
+ * @param int $width_height_type width_height_type should be one of
+ * SSH2_TERM_UNIT_CHARS or
+ * SSH2_TERM_UNIT_PIXELS.
+ * @return resource Returns a stream on success.
+ * @throws Ssh2Exception
+ *
+ */
+function ssh2_exec($session, string $command, string $pty = null, array $env = null, int $width = 80, int $height = 25, int $width_height_type = SSH2_TERM_UNIT_CHARS)
+{
+ error_clear_last();
+ if ($width_height_type !== SSH2_TERM_UNIT_CHARS) {
+ $result = \ssh2_exec($session, $command, $pty, $env, $width, $height, $width_height_type);
+ } elseif ($height !== 25) {
+ $result = \ssh2_exec($session, $command, $pty, $env, $width, $height);
+ } elseif ($width !== 80) {
+ $result = \ssh2_exec($session, $command, $pty, $env, $width);
+ } elseif ($env !== null) {
+ $result = \ssh2_exec($session, $command, $pty, $env);
+ } elseif ($pty !== null) {
+ $result = \ssh2_exec($session, $command, $pty);
+ } else {
+ $result = \ssh2_exec($session, $command);
+ }
+ if ($result === false) {
+ throw Ssh2Exception::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ *
+ *
+ * @param resource $pkey Publickey Subsystem resource created by ssh2_publickey_init.
+ * @param string $algoname Publickey algorithm (e.g.): ssh-dss, ssh-rsa
+ * @param string $blob Publickey blob as raw binary data
+ * @param bool $overwrite If the specified key already exists, should it be overwritten?
+ * @param array $attributes Associative array of attributes to assign to this public key.
+ * Refer to ietf-secsh-publickey-subsystem for a list of supported attributes.
+ * To mark an attribute as mandatory, precede its name with an asterisk.
+ * If the server is unable to support an attribute marked mandatory,
+ * it will abort the add process.
+ * @throws Ssh2Exception
+ *
+ */
+function ssh2_publickey_add($pkey, string $algoname, string $blob, bool $overwrite = false, array $attributes = null): void
+{
+ error_clear_last();
+ if ($attributes !== null) {
+ $result = \ssh2_publickey_add($pkey, $algoname, $blob, $overwrite, $attributes);
+ } else {
+ $result = \ssh2_publickey_add($pkey, $algoname, $blob, $overwrite);
+ }
+ if ($result === false) {
+ throw Ssh2Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Request the Publickey subsystem from an already connected SSH2 server.
+ *
+ * The publickey subsystem allows an already connected and authenticated
+ * client to manage the list of authorized public keys stored on the
+ * target server in an implementation agnostic manner.
+ * If the remote server does not support the publickey subsystem,
+ * the ssh2_publickey_init function will return FALSE.
+ *
+ * @param resource $session
+ * @return resource Returns an SSH2 Publickey Subsystem resource for use
+ * with all other ssh2_publickey_*() methods.
+ * @throws Ssh2Exception
+ *
+ */
+function ssh2_publickey_init($session)
+{
+ error_clear_last();
+ $result = \ssh2_publickey_init($session);
+ if ($result === false) {
+ throw Ssh2Exception::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Removes an authorized publickey.
+ *
+ * @param resource $pkey Publickey Subsystem Resource
+ * @param string $algoname Publickey algorithm (e.g.): ssh-dss, ssh-rsa
+ * @param string $blob Publickey blob as raw binary data
+ * @throws Ssh2Exception
+ *
+ */
+function ssh2_publickey_remove($pkey, string $algoname, string $blob): void
+{
+ error_clear_last();
+ $result = \ssh2_publickey_remove($pkey, $algoname, $blob);
+ if ($result === false) {
+ throw Ssh2Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Copy a file from the remote server to the local filesystem using the SCP protocol.
+ *
+ * @param resource $session An SSH connection link identifier, obtained from a call to
+ * ssh2_connect.
+ * @param string $remote_file Path to the remote file.
+ * @param string $local_file Path to the local file.
+ * @throws Ssh2Exception
+ *
+ */
+function ssh2_scp_recv($session, string $remote_file, string $local_file): void
+{
+ error_clear_last();
+ $result = \ssh2_scp_recv($session, $remote_file, $local_file);
+ if ($result === false) {
+ throw Ssh2Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Copy a file from the local filesystem to the remote server using the SCP protocol.
+ *
+ * @param resource $session An SSH connection link identifier, obtained from a call to
+ * ssh2_connect.
+ * @param string $local_file Path to the local file.
+ * @param string $remote_file Path to the remote file.
+ * @param int $create_mode The file will be created with the mode specified by
+ * create_mode.
+ * @throws Ssh2Exception
+ *
+ */
+function ssh2_scp_send($session, string $local_file, string $remote_file, int $create_mode = 0644): void
+{
+ error_clear_last();
+ $result = \ssh2_scp_send($session, $local_file, $remote_file, $create_mode);
+ if ($result === false) {
+ throw Ssh2Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Attempts to change the mode of the specified file to that given in
+ * mode.
+ *
+ * @param resource $sftp An SSH2 SFTP resource opened by ssh2_sftp.
+ * @param string $filename Path to the file.
+ * @param int $mode Permissions on the file. See the chmod for more details on this parameter.
+ * @throws Ssh2Exception
+ *
+ */
+function ssh2_sftp_chmod($sftp, string $filename, int $mode): void
+{
+ error_clear_last();
+ $result = \ssh2_sftp_chmod($sftp, $filename, $mode);
+ if ($result === false) {
+ throw Ssh2Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Creates a directory on the remote file server with permissions set to
+ * mode.
+ *
+ * This function is similar to using mkdir with the
+ * ssh2.sftp:// wrapper.
+ *
+ * @param resource $sftp An SSH2 SFTP resource opened by ssh2_sftp.
+ * @param string $dirname Path of the new directory.
+ * @param int $mode Permissions on the new directory.
+ * @param bool $recursive If recursive is TRUE any parent directories
+ * required for dirname will be automatically created as well.
+ * @throws Ssh2Exception
+ *
+ */
+function ssh2_sftp_mkdir($sftp, string $dirname, int $mode = 0777, bool $recursive = false): void
+{
+ error_clear_last();
+ $result = \ssh2_sftp_mkdir($sftp, $dirname, $mode, $recursive);
+ if ($result === false) {
+ throw Ssh2Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Renames a file on the remote filesystem.
+ *
+ * @param resource $sftp An SSH2 SFTP resource opened by ssh2_sftp.
+ * @param string $from The current file that is being renamed.
+ * @param string $to The new file name that replaces from.
+ * @throws Ssh2Exception
+ *
+ */
+function ssh2_sftp_rename($sftp, string $from, string $to): void
+{
+ error_clear_last();
+ $result = \ssh2_sftp_rename($sftp, $from, $to);
+ if ($result === false) {
+ throw Ssh2Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Removes a directory from the remote file server.
+ *
+ * This function is similar to using rmdir with the
+ * ssh2.sftp:// wrapper.
+ *
+ * @param resource $sftp An SSH2 SFTP resource opened by ssh2_sftp.
+ * @param string $dirname
+ * @throws Ssh2Exception
+ *
+ */
+function ssh2_sftp_rmdir($sftp, string $dirname): void
+{
+ error_clear_last();
+ $result = \ssh2_sftp_rmdir($sftp, $dirname);
+ if ($result === false) {
+ throw Ssh2Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Creates a symbolic link named link on the remote
+ * filesystem pointing to target.
+ *
+ * @param resource $sftp An SSH2 SFTP resource opened by ssh2_sftp.
+ * @param string $target Target of the symbolic link.
+ * @param string $link
+ * @throws Ssh2Exception
+ *
+ */
+function ssh2_sftp_symlink($sftp, string $target, string $link): void
+{
+ error_clear_last();
+ $result = \ssh2_sftp_symlink($sftp, $target, $link);
+ if ($result === false) {
+ throw Ssh2Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Deletes a file on the remote filesystem.
+ *
+ * @param resource $sftp An SSH2 SFTP resource opened by ssh2_sftp.
+ * @param string $filename
+ * @throws Ssh2Exception
+ *
+ */
+function ssh2_sftp_unlink($sftp, string $filename): void
+{
+ error_clear_last();
+ $result = \ssh2_sftp_unlink($sftp, $filename);
+ if ($result === false) {
+ throw Ssh2Exception::createFromPhpError();
+ }
+}
+
+
+/**
+ * Request the SFTP subsystem from an already connected SSH2 server.
+ *
+ * @param resource $session An SSH connection link identifier, obtained from a call to
+ * ssh2_connect.
+ * @return resource This method returns an SSH2 SFTP resource for use with
+ * all other ssh2_sftp_*() methods and the
+ * ssh2.sftp:// fopen wrapper.
+ * @throws Ssh2Exception
+ *
+ */
+function ssh2_sftp($session)
+{
+ error_clear_last();
+ $result = \ssh2_sftp($session);
+ if ($result === false) {
+ throw Ssh2Exception::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/stream.php b/vendor/thecodingmachine/safe/generated/stream.php
new file mode 100644
index 000000000..573d0295a
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/stream.php
@@ -0,0 +1,609 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\StreamException;
+
+/**
+ * Sets parameters on the specified context.
+ *
+ * @param resource $stream_or_context The stream or context to apply the parameters too.
+ * @param array $params An array of parameters to set.
+ *
+ * params should be an associative array of the structure:
+ * $params['paramname'] = "paramvalue";.
+ * @throws StreamException
+ *
+ */
+function stream_context_set_params($stream_or_context, array $params): void
+{
+ error_clear_last();
+ $result = \stream_context_set_params($stream_or_context, $params);
+ if ($result === false) {
+ throw StreamException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Makes a copy of up to maxlength bytes
+ * of data from the current position (or from the
+ * offset position, if specified) in
+ * source to dest. If
+ * maxlength is not specified, all remaining content in
+ * source will be copied.
+ *
+ * @param resource $source The source stream
+ * @param resource $dest The destination stream
+ * @param int $maxlength Maximum bytes to copy
+ * @param int $offset The offset where to start to copy data
+ * @return int Returns the total count of bytes copied.
+ * @throws StreamException
+ *
+ */
+function stream_copy_to_stream($source, $dest, int $maxlength = -1, int $offset = 0): int
+{
+ error_clear_last();
+ $result = \stream_copy_to_stream($source, $dest, $maxlength, $offset);
+ if ($result === false) {
+ throw StreamException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Adds filtername to the list of filters
+ * attached to stream.
+ *
+ * @param resource $stream The target stream.
+ * @param string $filtername The filter name.
+ * @param int $read_write By default, stream_filter_append will
+ * attach the filter to the read filter chain
+ * if the file was opened for reading (i.e. File Mode:
+ * r, and/or +). The filter
+ * will also be attached to the write filter chain
+ * if the file was opened for writing (i.e. File Mode:
+ * w, a, and/or +).
+ * STREAM_FILTER_READ,
+ * STREAM_FILTER_WRITE, and/or
+ * STREAM_FILTER_ALL can also be passed to the
+ * read_write parameter to override this behavior.
+ * @param mixed $params This filter will be added with the specified
+ * params to the end of
+ * the list and will therefore be called last during stream operations.
+ * To add a filter to the beginning of the list, use
+ * stream_filter_prepend.
+ * @return resource Returns a resource on success. The resource can be
+ * used to refer to this filter instance during a call to
+ * stream_filter_remove.
+ *
+ * FALSE is returned if stream is not a resource or
+ * if filtername cannot be located.
+ * @throws StreamException
+ *
+ */
+function stream_filter_append($stream, string $filtername, int $read_write = null, $params = null)
+{
+ error_clear_last();
+ if ($params !== null) {
+ $result = \stream_filter_append($stream, $filtername, $read_write, $params);
+ } elseif ($read_write !== null) {
+ $result = \stream_filter_append($stream, $filtername, $read_write);
+ } else {
+ $result = \stream_filter_append($stream, $filtername);
+ }
+ if ($result === false) {
+ throw StreamException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Adds filtername to the list of filters
+ * attached to stream.
+ *
+ * @param resource $stream The target stream.
+ * @param string $filtername The filter name.
+ * @param int $read_write By default, stream_filter_prepend will
+ * attach the filter to the read filter chain
+ * if the file was opened for reading (i.e. File Mode:
+ * r, and/or +). The filter
+ * will also be attached to the write filter chain
+ * if the file was opened for writing (i.e. File Mode:
+ * w, a, and/or +).
+ * STREAM_FILTER_READ,
+ * STREAM_FILTER_WRITE, and/or
+ * STREAM_FILTER_ALL can also be passed to the
+ * read_write parameter to override this behavior.
+ * See stream_filter_append for an example of
+ * using this parameter.
+ * @param mixed $params This filter will be added with the specified params
+ * to the beginning of the list and will therefore be
+ * called first during stream operations. To add a filter to the end of the
+ * list, use stream_filter_append.
+ * @return resource Returns a resource on success. The resource can be
+ * used to refer to this filter instance during a call to
+ * stream_filter_remove.
+ *
+ * FALSE is returned if stream is not a resource or
+ * if filtername cannot be located.
+ * @throws StreamException
+ *
+ */
+function stream_filter_prepend($stream, string $filtername, int $read_write = null, $params = null)
+{
+ error_clear_last();
+ if ($params !== null) {
+ $result = \stream_filter_prepend($stream, $filtername, $read_write, $params);
+ } elseif ($read_write !== null) {
+ $result = \stream_filter_prepend($stream, $filtername, $read_write);
+ } else {
+ $result = \stream_filter_prepend($stream, $filtername);
+ }
+ if ($result === false) {
+ throw StreamException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * stream_filter_register allows you to implement
+ * your own filter on any registered stream used with all the other
+ * filesystem functions (such as fopen,
+ * fread etc.).
+ *
+ * @param string $filtername The filter name to be registered.
+ * @param string $classname To implement a filter, you need to define a class as an extension of
+ * php_user_filter with a number of member
+ * functions. When performing read/write operations on the stream
+ * to which your filter is attached, PHP will pass the data through your
+ * filter (and any other filters attached to that stream) so that the
+ * data may be modified as desired. You must implement the methods
+ * exactly as described in php_user_filter - doing
+ * otherwise will lead to undefined behaviour.
+ * @throws StreamException
+ *
+ */
+function stream_filter_register(string $filtername, string $classname): void
+{
+ error_clear_last();
+ $result = \stream_filter_register($filtername, $classname);
+ if ($result === false) {
+ throw StreamException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Removes a stream filter previously added to a stream with
+ * stream_filter_prepend or
+ * stream_filter_append. Any data remaining in the
+ * filter's internal buffer will be flushed through to the next filter before
+ * removing it.
+ *
+ * @param resource $stream_filter The stream filter to be removed.
+ * @throws StreamException
+ *
+ */
+function stream_filter_remove($stream_filter): void
+{
+ error_clear_last();
+ $result = \stream_filter_remove($stream_filter);
+ if ($result === false) {
+ throw StreamException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Identical to file_get_contents, except that
+ * stream_get_contents operates on an already open
+ * stream resource and returns the remaining contents in a string, up to
+ * maxlength bytes and starting at the specified
+ * offset.
+ *
+ * @param resource $handle A stream resource (e.g. returned from fopen)
+ * @param int $maxlength The maximum bytes to read. Defaults to -1 (read all the remaining
+ * buffer).
+ * @param int $offset Seek to the specified offset before reading. If this number is negative,
+ * no seeking will occur and reading will start from the current position.
+ * @return string Returns a string.
+ * @throws StreamException
+ *
+ */
+function stream_get_contents($handle, int $maxlength = -1, int $offset = -1): string
+{
+ error_clear_last();
+ $result = \stream_get_contents($handle, $maxlength, $offset);
+ if ($result === false) {
+ throw StreamException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Determines if stream stream refers to a valid terminal type device.
+ * This is a more portable version of posix_isatty, since it works on Windows systems too.
+ *
+ * @param resource $stream
+ * @throws StreamException
+ *
+ */
+function stream_isatty($stream): void
+{
+ error_clear_last();
+ $result = \stream_isatty($stream);
+ if ($result === false) {
+ throw StreamException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Resolve filename against the include path according to the same rules as fopen/include.
+ *
+ * @param string $filename The filename to resolve.
+ * @return string Returns a string containing the resolved absolute filename.
+ * @throws StreamException
+ *
+ */
+function stream_resolve_include_path(string $filename): string
+{
+ error_clear_last();
+ $result = \stream_resolve_include_path($filename);
+ if ($result === false) {
+ throw StreamException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Sets blocking or non-blocking mode on a stream.
+ *
+ * This function works for any stream that supports non-blocking mode
+ * (currently, regular files and socket streams).
+ *
+ * @param resource $stream The stream.
+ * @param bool $mode If mode is FALSE, the given stream
+ * will be switched to non-blocking mode, and if TRUE, it
+ * will be switched to blocking mode. This affects calls like
+ * fgets and fread
+ * that read from the stream. In non-blocking mode an
+ * fgets call will always return right away
+ * while in blocking mode it will wait for data to become available
+ * on the stream.
+ * @throws StreamException
+ *
+ */
+function stream_set_blocking($stream, bool $mode): void
+{
+ error_clear_last();
+ $result = \stream_set_blocking($stream, $mode);
+ if ($result === false) {
+ throw StreamException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Sets the timeout value on stream,
+ * expressed in the sum of seconds and
+ * microseconds.
+ *
+ * When the stream times out, the 'timed_out' key of the array returned by
+ * stream_get_meta_data is set to TRUE, although no
+ * error/warning is generated.
+ *
+ * @param resource $stream The target stream.
+ * @param int $seconds The seconds part of the timeout to be set.
+ * @param int $microseconds The microseconds part of the timeout to be set.
+ * @throws StreamException
+ *
+ */
+function stream_set_timeout($stream, int $seconds, int $microseconds = 0): void
+{
+ error_clear_last();
+ $result = \stream_set_timeout($stream, $seconds, $microseconds);
+ if ($result === false) {
+ throw StreamException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Accept a connection on a socket previously created by
+ * stream_socket_server.
+ *
+ * @param resource $server_socket The server socket to accept a connection from.
+ * @param float $timeout Override the default socket accept timeout. Time should be given in
+ * seconds.
+ * @param string|null $peername Will be set to the name (address) of the client which connected, if
+ * included and available from the selected transport.
+ *
+ * Can also be determined later using
+ * stream_socket_get_name.
+ * @return resource Returns a stream to the accepted socket connection.
+ * @throws StreamException
+ *
+ */
+function stream_socket_accept($server_socket, float $timeout = null, ?string &$peername = null)
+{
+ error_clear_last();
+ if ($peername !== null) {
+ $result = \stream_socket_accept($server_socket, $timeout, $peername);
+ } elseif ($timeout !== null) {
+ $result = \stream_socket_accept($server_socket, $timeout);
+ } else {
+ $result = \stream_socket_accept($server_socket);
+ }
+ if ($result === false) {
+ throw StreamException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Initiates a stream or datagram connection to the destination specified
+ * by remote_socket. The type of socket created
+ * is determined by the transport specified using standard URL formatting:
+ * transport://target. For Internet Domain sockets
+ * (AF_INET) such as TCP and UDP, the target portion
+ * of the remote_socket parameter should consist of
+ * a hostname or IP address followed by a colon and a port number. For Unix
+ * domain sockets, the target portion should point
+ * to the socket file on the filesystem.
+ *
+ * @param string $remote_socket Address to the socket to connect to.
+ * @param int $errno Will be set to the system level error number if connection fails.
+ * @param string $errstr Will be set to the system level error message if the connection fails.
+ * @param float $timeout Number of seconds until the connect() system call
+ * should timeout.
+ *
+ *
+ * This parameter only applies when not making asynchronous
+ * connection attempts.
+ *
+ *
+ *
+ *
+ * To set a timeout for reading/writing data over the socket, use the
+ * stream_set_timeout, as the
+ * timeout only applies while making connecting
+ * the socket.
+ *
+ *
+ *
+ * To set a timeout for reading/writing data over the socket, use the
+ * stream_set_timeout, as the
+ * timeout only applies while making connecting
+ * the socket.
+ * @param int $flags Bitmask field which may be set to any combination of connection flags.
+ * Currently the select of connection flags is limited to
+ * STREAM_CLIENT_CONNECT (default),
+ * STREAM_CLIENT_ASYNC_CONNECT and
+ * STREAM_CLIENT_PERSISTENT.
+ * @param resource $context A valid context resource created with stream_context_create.
+ * @return resource On success a stream resource is returned which may
+ * be used together with the other file functions (such as
+ * fgets, fgetss,
+ * fwrite, fclose, and
+ * feof), FALSE on failure.
+ * @throws StreamException
+ *
+ */
+function stream_socket_client(string $remote_socket, int &$errno = null, string &$errstr = null, float $timeout = null, int $flags = STREAM_CLIENT_CONNECT, $context = null)
+{
+ error_clear_last();
+ if ($context !== null) {
+ $result = \stream_socket_client($remote_socket, $errno, $errstr, $timeout, $flags, $context);
+ } elseif ($flags !== STREAM_CLIENT_CONNECT) {
+ $result = \stream_socket_client($remote_socket, $errno, $errstr, $timeout, $flags);
+ } elseif ($timeout !== null) {
+ $result = \stream_socket_client($remote_socket, $errno, $errstr, $timeout);
+ } else {
+ $result = \stream_socket_client($remote_socket, $errno, $errstr);
+ }
+ if ($result === false) {
+ throw StreamException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * stream_socket_pair creates a pair of connected,
+ * indistinguishable socket streams. This function is commonly used in IPC
+ * (Inter-Process Communication).
+ *
+ * @param int $domain The protocol family to be used: STREAM_PF_INET,
+ * STREAM_PF_INET6 or
+ * STREAM_PF_UNIX
+ * @param int $type The type of communication to be used:
+ * STREAM_SOCK_DGRAM,
+ * STREAM_SOCK_RAW,
+ * STREAM_SOCK_RDM,
+ * STREAM_SOCK_SEQPACKET or
+ * STREAM_SOCK_STREAM
+ * @param int $protocol The protocol to be used: STREAM_IPPROTO_ICMP,
+ * STREAM_IPPROTO_IP,
+ * STREAM_IPPROTO_RAW,
+ * STREAM_IPPROTO_TCP or
+ * STREAM_IPPROTO_UDP
+ * @return resource[] Returns an array with the two socket resources on success.
+ * @throws StreamException
+ *
+ */
+function stream_socket_pair(int $domain, int $type, int $protocol): iterable
+{
+ error_clear_last();
+ $result = \stream_socket_pair($domain, $type, $protocol);
+ if ($result === false) {
+ throw StreamException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Creates a stream or datagram socket on the specified
+ * local_socket.
+ *
+ * This function only creates a socket, to begin accepting connections
+ * use stream_socket_accept.
+ *
+ * @param string $local_socket The type of socket created is determined by the transport specified
+ * using standard URL formatting: transport://target.
+ *
+ * For Internet Domain sockets (AF_INET) such as TCP and UDP, the
+ * target portion of the
+ * remote_socket parameter should consist of a
+ * hostname or IP address followed by a colon and a port number. For
+ * Unix domain sockets, the target portion should
+ * point to the socket file on the filesystem.
+ *
+ * Depending on the environment, Unix domain sockets may not be available.
+ * A list of available transports can be retrieved using
+ * stream_get_transports. See
+ * for a list of bulitin transports.
+ * @param int $errno If the optional errno and errstr
+ * arguments are present they will be set to indicate the actual system
+ * level error that occurred in the system-level socket(),
+ * bind(), and listen() calls. If
+ * the value returned in errno is
+ * 0 and the function returned FALSE, it is an
+ * indication that the error occurred before the bind()
+ * call. This is most likely due to a problem initializing the socket.
+ * Note that the errno and
+ * errstr arguments will always be passed by reference.
+ * @param string $errstr See errno description.
+ * @param int $flags A bitmask field which may be set to any combination of socket creation
+ * flags.
+ *
+ * For UDP sockets, you must use STREAM_SERVER_BIND as
+ * the flags parameter.
+ * @param resource $context
+ * @return resource Returns the created stream.
+ * @throws StreamException
+ *
+ */
+function stream_socket_server(string $local_socket, int &$errno = null, string &$errstr = null, int $flags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN, $context = null)
+{
+ error_clear_last();
+ if ($context !== null) {
+ $result = \stream_socket_server($local_socket, $errno, $errstr, $flags, $context);
+ } else {
+ $result = \stream_socket_server($local_socket, $errno, $errstr, $flags);
+ }
+ if ($result === false) {
+ throw StreamException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Shutdowns (partially or not) a full-duplex connection.
+ *
+ * @param resource $stream An open stream (opened with stream_socket_client,
+ * for example)
+ * @param int $how One of the following constants: STREAM_SHUT_RD
+ * (disable further receptions), STREAM_SHUT_WR
+ * (disable further transmissions) or
+ * STREAM_SHUT_RDWR (disable further receptions and
+ * transmissions).
+ * @throws StreamException
+ *
+ */
+function stream_socket_shutdown($stream, int $how): void
+{
+ error_clear_last();
+ $result = \stream_socket_shutdown($stream, $how);
+ if ($result === false) {
+ throw StreamException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Tells whether the stream supports locking through
+ * flock.
+ *
+ * @param resource $stream The stream to check.
+ * @throws StreamException
+ *
+ */
+function stream_supports_lock($stream): void
+{
+ error_clear_last();
+ $result = \stream_supports_lock($stream);
+ if ($result === false) {
+ throw StreamException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Allows you to implement your own protocol handlers and streams for use
+ * with all the other filesystem functions (such as fopen,
+ * fread etc.).
+ *
+ * @param string $protocol The wrapper name to be registered.
+ * @param string $classname The classname which implements the protocol.
+ * @param int $flags Should be set to STREAM_IS_URL if
+ * protocol is a URL protocol. Default is 0, local
+ * stream.
+ * @throws StreamException
+ *
+ */
+function stream_wrapper_register(string $protocol, string $classname, int $flags = 0): void
+{
+ error_clear_last();
+ $result = \stream_wrapper_register($protocol, $classname, $flags);
+ if ($result === false) {
+ throw StreamException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Restores a built-in wrapper previously unregistered with
+ * stream_wrapper_unregister.
+ *
+ * @param string $protocol
+ * @throws StreamException
+ *
+ */
+function stream_wrapper_restore(string $protocol): void
+{
+ error_clear_last();
+ $result = \stream_wrapper_restore($protocol);
+ if ($result === false) {
+ throw StreamException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Allows you to disable an already defined stream wrapper. Once the wrapper
+ * has been disabled you may override it with a user-defined wrapper using
+ * stream_wrapper_register or reenable it later on with
+ * stream_wrapper_restore.
+ *
+ * @param string $protocol
+ * @throws StreamException
+ *
+ */
+function stream_wrapper_unregister(string $protocol): void
+{
+ error_clear_last();
+ $result = \stream_wrapper_unregister($protocol);
+ if ($result === false) {
+ throw StreamException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/strings.php b/vendor/thecodingmachine/safe/generated/strings.php
new file mode 100644
index 000000000..9bc728415
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/strings.php
@@ -0,0 +1,846 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\StringsException;
+
+/**
+ * convert_uudecode decodes a uuencoded string.
+ *
+ * @param string $data The uuencoded data.
+ * @return string Returns the decoded data as a string.
+ * @throws StringsException
+ *
+ */
+function convert_uudecode(string $data): string
+{
+ error_clear_last();
+ $result = \convert_uudecode($data);
+ if ($result === false) {
+ throw StringsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * convert_uuencode encodes a string using the uuencode
+ * algorithm.
+ *
+ * Uuencode translates all strings (including binary data) into printable
+ * characters, making them safe for network transmissions. Uuencoded data is
+ * about 35% larger than the original.
+ *
+ * @param string $data The data to be encoded.
+ * @return string Returns the uuencoded data.
+ * @throws StringsException
+ *
+ */
+function convert_uuencode(string $data): string
+{
+ error_clear_last();
+ $result = \convert_uuencode($data);
+ if ($result === false) {
+ throw StringsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Decodes a hexadecimally encoded binary string.
+ *
+ * @param string $data Hexadecimal representation of data.
+ * @return string Returns the binary representation of the given data.
+ * @throws StringsException
+ *
+ */
+function hex2bin(string $data): string
+{
+ error_clear_last();
+ $result = \hex2bin($data);
+ if ($result === false) {
+ throw StringsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Calculates the MD5 hash of the file specified by the
+ * filename parameter using the
+ * RSA Data Security, Inc.
+ * MD5 Message-Digest Algorithm, and returns that hash.
+ * The hash is a 32-character hexadecimal number.
+ *
+ * @param string $filename The filename
+ * @param bool $raw_output When TRUE, returns the digest in raw binary format with a length of
+ * 16.
+ * @return string Returns a string on success, FALSE otherwise.
+ * @throws StringsException
+ *
+ */
+function md5_file(string $filename, bool $raw_output = false): string
+{
+ error_clear_last();
+ $result = \md5_file($filename, $raw_output);
+ if ($result === false) {
+ throw StringsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Calculates the metaphone key of str.
+ *
+ * Similar to soundex metaphone creates the same key for
+ * similar sounding words. It's more accurate than
+ * soundex as it knows the basic rules of English
+ * pronunciation. The metaphone generated keys are of variable length.
+ *
+ * Metaphone was developed by Lawrence Philips
+ * &lt;lphilips at verity dot com&gt;. It is described in ["Practical
+ * Algorithms for Programmers", Binstock &amp; Rex, Addison Wesley,
+ * 1995].
+ *
+ * @param string $str The input string.
+ * @param int $phonemes This parameter restricts the returned metaphone key to
+ * phonemes characters in length.
+ * The default value of 0 means no restriction.
+ * @return string Returns the metaphone key as a string.
+ * @throws StringsException
+ *
+ */
+function metaphone(string $str, int $phonemes = 0): string
+{
+ error_clear_last();
+ $result = \metaphone($str, $phonemes);
+ if ($result === false) {
+ throw StringsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ *
+ *
+ * @param string $filename The filename of the file to hash.
+ * @param bool $raw_output When TRUE, returns the digest in raw binary format with a length of
+ * 20.
+ * @return string Returns a string on success, FALSE otherwise.
+ * @throws StringsException
+ *
+ */
+function sha1_file(string $filename, bool $raw_output = false): string
+{
+ error_clear_last();
+ $result = \sha1_file($filename, $raw_output);
+ if ($result === false) {
+ throw StringsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Calculates the soundex key of str.
+ *
+ * Soundex keys have the property that words pronounced similarly
+ * produce the same soundex key, and can thus be used to simplify
+ * searches in databases where you know the pronunciation but not
+ * the spelling. This soundex function returns a string 4 characters
+ * long, starting with a letter.
+ *
+ * This particular soundex function is one described by Donald Knuth
+ * in "The Art Of Computer Programming, vol. 3: Sorting And
+ * Searching", Addison-Wesley (1973), pp. 391-392.
+ *
+ * @param string $str The input string.
+ * @return string Returns the soundex key as a string.
+ * @throws StringsException
+ *
+ */
+function soundex(string $str): string
+{
+ error_clear_last();
+ $result = \soundex($str);
+ if ($result === false) {
+ throw StringsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Returns a string produced according to the formatting string
+ * format.
+ *
+ * @param string $format The format string is composed of zero or more directives:
+ * ordinary characters (excluding %) that are
+ * copied directly to the result and conversion
+ * specifications, each of which results in fetching its
+ * own parameter.
+ *
+ * A conversion specification follows this prototype:
+ * %[argnum$][flags][width][.precision]specifier.
+ *
+ * An integer followed by a dollar sign $,
+ * to specify which number argument to treat in the conversion.
+ *
+ *
+ * Flags
+ *
+ *
+ *
+ * Flag
+ * Description
+ *
+ *
+ *
+ *
+ * -
+ *
+ * Left-justify within the given field width;
+ * Right justification is the default
+ *
+ *
+ *
+ * +
+ *
+ * Prefix positive numbers with a plus sign
+ * +; Default only negative
+ * are prefixed with a negative sign.
+ *
+ *
+ *
+ * (space)
+ *
+ * Pads the result with spaces.
+ * This is the default.
+ *
+ *
+ *
+ * 0
+ *
+ * Only left-pads numbers with zeros.
+ * With s specifiers this can
+ * also right-pad with zeros.
+ *
+ *
+ *
+ * '(char)
+ *
+ * Pads the result with the character (char).
+ *
+ *
+ *
+ *
+ *
+ *
+ * An integer that says how many characters (minimum)
+ * this conversion should result in.
+ *
+ * A period . followed by an integer
+ * who's meaning depends on the specifier:
+ *
+ *
+ *
+ * For e, E,
+ * f and F
+ * specifiers: this is the number of digits to be printed
+ * after the decimal point (by default, this is 6).
+ *
+ *
+ *
+ *
+ * For g and G
+ * specifiers: this is the maximum number of significant
+ * digits to be printed.
+ *
+ *
+ *
+ *
+ * For s specifier: it acts as a cutoff point,
+ * setting a maximum character limit to the string.
+ *
+ *
+ *
+ *
+ *
+ * If the period is specified without an explicit value for precision,
+ * 0 is assumed.
+ *
+ *
+ *
+ *
+ * Specifiers
+ *
+ *
+ *
+ * Specifier
+ * Description
+ *
+ *
+ *
+ *
+ * %
+ *
+ * A literal percent character. No argument is required.
+ *
+ *
+ *
+ * b
+ *
+ * The argument is treated as an integer and presented
+ * as a binary number.
+ *
+ *
+ *
+ * c
+ *
+ * The argument is treated as an integer and presented
+ * as the character with that ASCII.
+ *
+ *
+ *
+ * d
+ *
+ * The argument is treated as an integer and presented
+ * as a (signed) decimal number.
+ *
+ *
+ *
+ * e
+ *
+ * The argument is treated as scientific notation (e.g. 1.2e+2).
+ * The precision specifier stands for the number of digits after the
+ * decimal point since PHP 5.2.1. In earlier versions, it was taken as
+ * number of significant digits (one less).
+ *
+ *
+ *
+ * E
+ *
+ * Like the e specifier but uses
+ * uppercase letter (e.g. 1.2E+2).
+ *
+ *
+ *
+ * f
+ *
+ * The argument is treated as a float and presented
+ * as a floating-point number (locale aware).
+ *
+ *
+ *
+ * F
+ *
+ * The argument is treated as a float and presented
+ * as a floating-point number (non-locale aware).
+ * Available as of PHP 5.0.3.
+ *
+ *
+ *
+ * g
+ *
+ *
+ * General format.
+ *
+ *
+ * Let P equal the precision if nonzero, 6 if the precision is omitted,
+ * or 1 if the precision is zero.
+ * Then, if a conversion with style E would have an exponent of X:
+ *
+ *
+ * If P &gt; X ≥ −4, the conversion is with style f and precision P − (X + 1).
+ * Otherwise, the conversion is with style e and precision P − 1.
+ *
+ *
+ *
+ *
+ * G
+ *
+ * Like the g specifier but uses
+ * E and f.
+ *
+ *
+ *
+ * o
+ *
+ * The argument is treated as an integer and presented
+ * as an octal number.
+ *
+ *
+ *
+ * s
+ *
+ * The argument is treated and presented as a string.
+ *
+ *
+ *
+ * u
+ *
+ * The argument is treated as an integer and presented
+ * as an unsigned decimal number.
+ *
+ *
+ *
+ * x
+ *
+ * The argument is treated as an integer and presented
+ * as a hexadecimal number (with lowercase letters).
+ *
+ *
+ *
+ * X
+ *
+ * The argument is treated as an integer and presented
+ * as a hexadecimal number (with uppercase letters).
+ *
+ *
+ *
+ *
+ *
+ *
+ * General format.
+ *
+ * Let P equal the precision if nonzero, 6 if the precision is omitted,
+ * or 1 if the precision is zero.
+ * Then, if a conversion with style E would have an exponent of X:
+ *
+ * If P &gt; X ≥ −4, the conversion is with style f and precision P − (X + 1).
+ * Otherwise, the conversion is with style e and precision P − 1.
+ *
+ * The c type specifier ignores padding and width
+ *
+ * Attempting to use a combination of the string and width specifiers with character sets that require more than one byte per character may result in unexpected results
+ *
+ * Variables will be co-erced to a suitable type for the specifier:
+ *
+ * Type Handling
+ *
+ *
+ *
+ * Type
+ * Specifiers
+ *
+ *
+ *
+ *
+ * string
+ * s
+ *
+ *
+ * integer
+ *
+ * d,
+ * u,
+ * c,
+ * o,
+ * x,
+ * X,
+ * b
+ *
+ *
+ *
+ * double
+ *
+ * g,
+ * G,
+ * e,
+ * E,
+ * f,
+ * F
+ *
+ *
+ *
+ *
+ *
+ * @param mixed $params
+ * @return string Returns a string produced according to the formatting string
+ * format.
+ * @throws StringsException
+ *
+ */
+function sprintf(string $format, ...$params): string
+{
+ error_clear_last();
+ if ($params !== []) {
+ $result = \sprintf($format, ...$params);
+ } else {
+ $result = \sprintf($format);
+ }
+ if ($result === false) {
+ throw StringsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Returns the portion of string specified by the
+ * start and length parameters.
+ *
+ * @param string $string The input string.
+ * @param int $start If start is non-negative, the returned string
+ * will start at the start'th position in
+ * string, counting from zero. For instance,
+ * in the string 'abcdef', the character at
+ * position 0 is 'a', the
+ * character at position 2 is
+ * 'c', and so forth.
+ *
+ * If start is negative, the returned string
+ * will start at the start'th character
+ * from the end of string.
+ *
+ * If string is less than
+ * start characters long, FALSE will be returned.
+ *
+ *
+ * Using a negative start
+ *
+ *
+ * ]]>
+ *
+ *
+ * @param int $length If length is given and is positive, the string
+ * returned will contain at most length characters
+ * beginning from start (depending on the length of
+ * string).
+ *
+ * If length is given and is negative, then that many
+ * characters will be omitted from the end of string
+ * (after the start position has been calculated when a
+ * start is negative). If
+ * start denotes the position of this truncation or
+ * beyond, FALSE will be returned.
+ *
+ * If length is given and is 0,
+ * FALSE or NULL, an empty string will be returned.
+ *
+ * If length is omitted, the substring starting from
+ * start until the end of the string will be
+ * returned.
+ * @return string Returns the extracted part of string;, or
+ * an empty string.
+ * @throws StringsException
+ *
+ */
+function substr(string $string, int $start, int $length = null): string
+{
+ error_clear_last();
+ if ($length !== null) {
+ $result = \substr($string, $start, $length);
+ } else {
+ $result = \substr($string, $start);
+ }
+ if ($result === false) {
+ throw StringsException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Operates as sprintf but accepts an array of
+ * arguments, rather than a variable number of arguments.
+ *
+ * @param string $format The format string is composed of zero or more directives:
+ * ordinary characters (excluding %) that are
+ * copied directly to the result and conversion
+ * specifications, each of which results in fetching its
+ * own parameter.
+ *
+ * A conversion specification follows this prototype:
+ * %[argnum$][flags][width][.precision]specifier.
+ *
+ * An integer followed by a dollar sign $,
+ * to specify which number argument to treat in the conversion.
+ *
+ *
+ * Flags
+ *
+ *
+ *
+ * Flag
+ * Description
+ *
+ *
+ *
+ *
+ * -
+ *
+ * Left-justify within the given field width;
+ * Right justification is the default
+ *
+ *
+ *
+ * +
+ *
+ * Prefix positive numbers with a plus sign
+ * +; Default only negative
+ * are prefixed with a negative sign.
+ *
+ *
+ *
+ * (space)
+ *
+ * Pads the result with spaces.
+ * This is the default.
+ *
+ *
+ *
+ * 0
+ *
+ * Only left-pads numbers with zeros.
+ * With s specifiers this can
+ * also right-pad with zeros.
+ *
+ *
+ *
+ * '(char)
+ *
+ * Pads the result with the character (char).
+ *
+ *
+ *
+ *
+ *
+ *
+ * An integer that says how many characters (minimum)
+ * this conversion should result in.
+ *
+ * A period . followed by an integer
+ * who's meaning depends on the specifier:
+ *
+ *
+ *
+ * For e, E,
+ * f and F
+ * specifiers: this is the number of digits to be printed
+ * after the decimal point (by default, this is 6).
+ *
+ *
+ *
+ *
+ * For g and G
+ * specifiers: this is the maximum number of significant
+ * digits to be printed.
+ *
+ *
+ *
+ *
+ * For s specifier: it acts as a cutoff point,
+ * setting a maximum character limit to the string.
+ *
+ *
+ *
+ *
+ *
+ * If the period is specified without an explicit value for precision,
+ * 0 is assumed.
+ *
+ *
+ *
+ *
+ * Specifiers
+ *
+ *
+ *
+ * Specifier
+ * Description
+ *
+ *
+ *
+ *
+ * %
+ *
+ * A literal percent character. No argument is required.
+ *
+ *
+ *
+ * b
+ *
+ * The argument is treated as an integer and presented
+ * as a binary number.
+ *
+ *
+ *
+ * c
+ *
+ * The argument is treated as an integer and presented
+ * as the character with that ASCII.
+ *
+ *
+ *
+ * d
+ *
+ * The argument is treated as an integer and presented
+ * as a (signed) decimal number.
+ *
+ *
+ *
+ * e
+ *
+ * The argument is treated as scientific notation (e.g. 1.2e+2).
+ * The precision specifier stands for the number of digits after the
+ * decimal point since PHP 5.2.1. In earlier versions, it was taken as
+ * number of significant digits (one less).
+ *
+ *
+ *
+ * E
+ *
+ * Like the e specifier but uses
+ * uppercase letter (e.g. 1.2E+2).
+ *
+ *
+ *
+ * f
+ *
+ * The argument is treated as a float and presented
+ * as a floating-point number (locale aware).
+ *
+ *
+ *
+ * F
+ *
+ * The argument is treated as a float and presented
+ * as a floating-point number (non-locale aware).
+ * Available as of PHP 5.0.3.
+ *
+ *
+ *
+ * g
+ *
+ *
+ * General format.
+ *
+ *
+ * Let P equal the precision if nonzero, 6 if the precision is omitted,
+ * or 1 if the precision is zero.
+ * Then, if a conversion with style E would have an exponent of X:
+ *
+ *
+ * If P &gt; X ≥ −4, the conversion is with style f and precision P − (X + 1).
+ * Otherwise, the conversion is with style e and precision P − 1.
+ *
+ *
+ *
+ *
+ * G
+ *
+ * Like the g specifier but uses
+ * E and f.
+ *
+ *
+ *
+ * o
+ *
+ * The argument is treated as an integer and presented
+ * as an octal number.
+ *
+ *
+ *
+ * s
+ *
+ * The argument is treated and presented as a string.
+ *
+ *
+ *
+ * u
+ *
+ * The argument is treated as an integer and presented
+ * as an unsigned decimal number.
+ *
+ *
+ *
+ * x
+ *
+ * The argument is treated as an integer and presented
+ * as a hexadecimal number (with lowercase letters).
+ *
+ *
+ *
+ * X
+ *
+ * The argument is treated as an integer and presented
+ * as a hexadecimal number (with uppercase letters).
+ *
+ *
+ *
+ *
+ *
+ *
+ * General format.
+ *
+ * Let P equal the precision if nonzero, 6 if the precision is omitted,
+ * or 1 if the precision is zero.
+ * Then, if a conversion with style E would have an exponent of X:
+ *
+ * If P &gt; X ≥ −4, the conversion is with style f and precision P − (X + 1).
+ * Otherwise, the conversion is with style e and precision P − 1.
+ *
+ * The c type specifier ignores padding and width
+ *
+ * Attempting to use a combination of the string and width specifiers with character sets that require more than one byte per character may result in unexpected results
+ *
+ * Variables will be co-erced to a suitable type for the specifier:
+ *
+ * Type Handling
+ *
+ *
+ *
+ * Type
+ * Specifiers
+ *
+ *
+ *
+ *
+ * string
+ * s
+ *
+ *
+ * integer
+ *
+ * d,
+ * u,
+ * c,
+ * o,
+ * x,
+ * X,
+ * b
+ *
+ *
+ *
+ * double
+ *
+ * g,
+ * G,
+ * e,
+ * E,
+ * f,
+ * F
+ *
+ *
+ *
+ *
+ *
+ * @param array $args
+ * @return string Return array values as a formatted string according to
+ * format.
+ * @throws StringsException
+ *
+ */
+function vsprintf(string $format, array $args): string
+{
+ error_clear_last();
+ $result = \vsprintf($format, $args);
+ if ($result === false) {
+ throw StringsException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/swoole.php b/vendor/thecodingmachine/safe/generated/swoole.php
new file mode 100644
index 000000000..334d96bd9
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/swoole.php
@@ -0,0 +1,108 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\SwooleException;
+
+/**
+ *
+ *
+ * @param string $filename The filename being written.
+ * @param string $content The content writing to the file.
+ * @param int $offset The offset.
+ * @param callable $callback
+ * @throws SwooleException
+ *
+ */
+function swoole_async_write(string $filename, string $content, int $offset = null, callable $callback = null): void
+{
+ error_clear_last();
+ if ($callback !== null) {
+ $result = \swoole_async_write($filename, $content, $offset, $callback);
+ } elseif ($offset !== null) {
+ $result = \swoole_async_write($filename, $content, $offset);
+ } else {
+ $result = \swoole_async_write($filename, $content);
+ }
+ if ($result === false) {
+ throw SwooleException::createFromPhpError();
+ }
+}
+
+
+/**
+ *
+ *
+ * @param string $filename The filename being written.
+ * @param string $content The content writing to the file.
+ * @param callable $callback
+ * @param int $flags
+ * @throws SwooleException
+ *
+ */
+function swoole_async_writefile(string $filename, string $content, callable $callback = null, int $flags = 0): void
+{
+ error_clear_last();
+ if ($flags !== 0) {
+ $result = \swoole_async_writefile($filename, $content, $callback, $flags);
+ } elseif ($callback !== null) {
+ $result = \swoole_async_writefile($filename, $content, $callback);
+ } else {
+ $result = \swoole_async_writefile($filename, $content);
+ }
+ if ($result === false) {
+ throw SwooleException::createFromPhpError();
+ }
+}
+
+
+/**
+ *
+ *
+ * @param callable $callback
+ * @throws SwooleException
+ *
+ */
+function swoole_event_defer(callable $callback): void
+{
+ error_clear_last();
+ $result = \swoole_event_defer($callback);
+ if ($result === false) {
+ throw SwooleException::createFromPhpError();
+ }
+}
+
+
+/**
+ *
+ *
+ * @param int $fd
+ * @throws SwooleException
+ *
+ */
+function swoole_event_del(int $fd): void
+{
+ error_clear_last();
+ $result = \swoole_event_del($fd);
+ if ($result === false) {
+ throw SwooleException::createFromPhpError();
+ }
+}
+
+
+/**
+ *
+ *
+ * @param int $fd
+ * @param string $data
+ * @throws SwooleException
+ *
+ */
+function swoole_event_write(int $fd, string $data): void
+{
+ error_clear_last();
+ $result = \swoole_event_write($fd, $data);
+ if ($result === false) {
+ throw SwooleException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/uodbc.php b/vendor/thecodingmachine/safe/generated/uodbc.php
new file mode 100644
index 000000000..89775c825
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/uodbc.php
@@ -0,0 +1,1009 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\UodbcException;
+
+/**
+ * Toggles autocommit behaviour.
+ *
+ * By default, auto-commit is on for a connection. Disabling
+ * auto-commit is equivalent with starting a transaction.
+ *
+ * @param resource $connection_id The ODBC connection identifier,
+ * see odbc_connect for details.
+ * @param bool $OnOff If OnOff is TRUE, auto-commit is enabled, if
+ * it is FALSE auto-commit is disabled.
+ * @return mixed Without the OnOff parameter, this function returns
+ * auto-commit status for connection_id. Non-zero is
+ * returned if auto-commit is on, 0 if it is off, or FALSE if an error
+ * occurs.
+ *
+ * If OnOff is set, this function returns TRUE on
+ * success.
+ * @throws UodbcException
+ *
+ */
+function odbc_autocommit($connection_id, bool $OnOff = false)
+{
+ error_clear_last();
+ $result = \odbc_autocommit($connection_id, $OnOff);
+ if ($result === false) {
+ throw UodbcException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Controls handling of binary column data. ODBC SQL types affected are
+ * BINARY, VARBINARY, and
+ * LONGVARBINARY.
+ * The default mode can be set using the
+ * uodbc.defaultbinmode php.ini directive.
+ *
+ * When binary SQL data is converted to character C data (ODBC_BINMODE_CONVERT), each byte
+ * (8 bits) of source data is represented as two ASCII characters.
+ * These characters are the ASCII character representation of the
+ * number in its hexadecimal form. For example, a binary
+ * 00000001 is converted to
+ * "01" and a binary 11111111
+ * is converted to "FF".
+ *
+ * While the handling of BINARY and VARBINARY
+ * columns only depend on the binmode, the handling of LONGVARBINARY
+ * columns also depends on the longreadlen as well:
+ *
+ * LONGVARBINARY handling
+ *
+ *
+ *
+ * binmode
+ * longreadlen
+ * result
+ *
+ *
+ *
+ *
+ * ODBC_BINMODE_PASSTHRU
+ * 0
+ * passthru
+ *
+ *
+ * ODBC_BINMODE_RETURN
+ * 0
+ * passthru
+ *
+ *
+ * ODBC_BINMODE_CONVERT
+ * 0
+ * passthru
+ *
+ *
+ * ODBC_BINMODE_PASSTHRU
+ * &gt;0
+ * passthru
+ *
+ *
+ * ODBC_BINMODE_RETURN
+ * &gt;0
+ * return as is
+ *
+ *
+ * ODBC_BINMODE_CONVERT
+ * &gt;0
+ * return as char
+ *
+ *
+ *
+ *
+ *
+ * If odbc_fetch_into is used, passthru means that an
+ * empty string is returned for these columns.
+ * If odbc_result is used, passthru means that the data are
+ * sent directly to the client (i.e. printed).
+ *
+ * @param int $result_id The result identifier.
+ *
+ * If result_id is 0, the
+ * settings apply as default for new results.
+ * @param int $mode Possible values for mode are:
+ *
+ *
+ *
+ * ODBC_BINMODE_PASSTHRU: Passthru BINARY data
+ *
+ *
+ *
+ *
+ * ODBC_BINMODE_RETURN: Return as is
+ *
+ *
+ *
+ *
+ * ODBC_BINMODE_CONVERT: Convert to char and return
+ *
+ *
+ *
+ *
+ *
+ * Handling of binary long
+ * columns is also affected by odbc_longreadlen.
+ *
+ *
+ * @throws UodbcException
+ *
+ */
+function odbc_binmode(int $result_id, int $mode): void
+{
+ error_clear_last();
+ $result = \odbc_binmode($result_id, $mode);
+ if ($result === false) {
+ throw UodbcException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Lists columns and associated privileges for the given table.
+ *
+ * @param resource $connection_id The ODBC connection identifier,
+ * see odbc_connect for details.
+ * @param string $catalog The catalog ('qualifier' in ODBC 2 parlance).
+ * @param string $schema The schema ('owner' in ODBC 2 parlance).
+ * This parameter accepts the following search patterns:
+ * % to match zero or more characters,
+ * and _ to match a single character.
+ * @param string $table_name The table name.
+ * This parameter accepts the following search patterns:
+ * % to match zero or more characters,
+ * and _ to match a single character.
+ * @param string $column_name The column name.
+ * This parameter accepts the following search patterns:
+ * % to match zero or more characters,
+ * and _ to match a single character.
+ * @return resource Returns an ODBC result identifier.
+ * This result identifier can be used to fetch a list of columns and
+ * associated privileges.
+ *
+ * The result set has the following columns:
+ *
+ * TABLE_CAT
+ * TABLE_SCHEM
+ * TABLE_NAME
+ * COLUMN_NAME
+ * GRANTOR
+ * GRANTEE
+ * PRIVILEGE
+ * IS_GRANTABLE
+ *
+ * Drivers can report additional columns.
+ * @throws UodbcException
+ *
+ */
+function odbc_columnprivileges($connection_id, string $catalog, string $schema, string $table_name, string $column_name)
+{
+ error_clear_last();
+ $result = \odbc_columnprivileges($connection_id, $catalog, $schema, $table_name, $column_name);
+ if ($result === false) {
+ throw UodbcException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Lists all columns in the requested range.
+ *
+ * @param resource $connection_id The ODBC connection identifier,
+ * see odbc_connect for details.
+ * @param string $catalog The catalog ('qualifier' in ODBC 2 parlance).
+ * @param string $schema The schema ('owner' in ODBC 2 parlance).
+ * This parameter accepts the following search patterns:
+ * % to match zero or more characters,
+ * and _ to match a single character.
+ * @param string $table_name The table name.
+ * This parameter accepts the following search patterns:
+ * % to match zero or more characters,
+ * and _ to match a single character.
+ * @param string $column_name The column name.
+ * This parameter accepts the following search patterns:
+ * % to match zero or more characters,
+ * and _ to match a single character.
+ * @return resource Returns an ODBC result identifier.
+ *
+ * The result set has the following columns:
+ *
+ * TABLE_CAT
+ * TABLE_SCHEM
+ * TABLE_NAME
+ * COLUMN_NAME
+ * DATA_TYPE
+ * TYPE_NAME
+ * COLUMN_SIZE
+ * BUFFER_LENGTH
+ * DECIMAL_DIGITS
+ * NUM_PREC_RADIX
+ * NULLABLE
+ * REMARKS
+ * COLUMN_DEF
+ * SQL_DATA_TYPE
+ * SQL_DATETIME_SUB
+ * CHAR_OCTET_LENGTH
+ * ORDINAL_POSITION
+ * IS_NULLABLE
+ *
+ * Drivers can report additional columns.
+ * @throws UodbcException
+ *
+ */
+function odbc_columns($connection_id, string $catalog = null, string $schema = null, string $table_name = null, string $column_name = null)
+{
+ error_clear_last();
+ if ($column_name !== null) {
+ $result = \odbc_columns($connection_id, $catalog, $schema, $table_name, $column_name);
+ } elseif ($table_name !== null) {
+ $result = \odbc_columns($connection_id, $catalog, $schema, $table_name);
+ } elseif ($schema !== null) {
+ $result = \odbc_columns($connection_id, $catalog, $schema);
+ } elseif ($catalog !== null) {
+ $result = \odbc_columns($connection_id, $catalog);
+ } else {
+ $result = \odbc_columns($connection_id);
+ }
+ if ($result === false) {
+ throw UodbcException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Commits all pending transactions on the connection.
+ *
+ * @param resource $connection_id The ODBC connection identifier,
+ * see odbc_connect for details.
+ * @throws UodbcException
+ *
+ */
+function odbc_commit($connection_id): void
+{
+ error_clear_last();
+ $result = \odbc_commit($connection_id);
+ if ($result === false) {
+ throw UodbcException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function will return the list of available DSN (after calling it
+ * several times).
+ *
+ * @param resource $connection_id The ODBC connection identifier,
+ * see odbc_connect for details.
+ * @param int $fetch_type The fetch_type can be one of two constant types:
+ * SQL_FETCH_FIRST, SQL_FETCH_NEXT.
+ * Use SQL_FETCH_FIRST the first time this function is
+ * called, thereafter use the SQL_FETCH_NEXT.
+ * @return array Returns FALSE on error, an array upon success, and NULL after fetching
+ * the last available DSN.
+ * @throws UodbcException
+ *
+ */
+function odbc_data_source($connection_id, int $fetch_type): array
+{
+ error_clear_last();
+ $result = \odbc_data_source($connection_id, $fetch_type);
+ if ($result === false) {
+ throw UodbcException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Sends an SQL statement to the database server.
+ *
+ * @param resource $connection_id The ODBC connection identifier,
+ * see odbc_connect for details.
+ * @param string $query_string The SQL statement.
+ * @param int $flags This parameter is currently not used.
+ * @return resource Returns an ODBC result identifier if the SQL command was executed
+ * successfully.
+ * @throws UodbcException
+ *
+ */
+function odbc_exec($connection_id, string $query_string, int $flags = null)
+{
+ error_clear_last();
+ if ($flags !== null) {
+ $result = \odbc_exec($connection_id, $query_string, $flags);
+ } else {
+ $result = \odbc_exec($connection_id, $query_string);
+ }
+ if ($result === false) {
+ throw UodbcException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Executes a statement prepared with odbc_prepare.
+ *
+ * @param resource $result_id The result id resource, from odbc_prepare.
+ * @param array $parameters_array Parameters in parameter_array will be
+ * substituted for placeholders in the prepared statement in order.
+ * Elements of this array will be converted to strings by calling this
+ * function.
+ *
+ * Any parameters in parameter_array which
+ * start and end with single quotes will be taken as the name of a
+ * file to read and send to the database server as the data for the
+ * appropriate placeholder.
+ * @throws UodbcException
+ *
+ */
+function odbc_execute($result_id, array $parameters_array = null): void
+{
+ error_clear_last();
+ if ($parameters_array !== null) {
+ $result = \odbc_execute($result_id, $parameters_array);
+ } else {
+ $result = \odbc_execute($result_id);
+ }
+ if ($result === false) {
+ throw UodbcException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Fetch one result row into array.
+ *
+ * @param resource $result_id The result resource.
+ * @param array|null $result_array The result array
+ * that can be of any type since it will be converted to type
+ * array. The array will contain the column values starting at array
+ * index 0.
+ * @param int $rownumber The row number.
+ * @return int Returns the number of columns in the result;
+ * FALSE on error.
+ * @throws UodbcException
+ *
+ */
+function odbc_fetch_into($result_id, ?array &$result_array, int $rownumber = null): int
+{
+ error_clear_last();
+ if ($rownumber !== null) {
+ $result = \odbc_fetch_into($result_id, $result_array, $rownumber);
+ } else {
+ $result = \odbc_fetch_into($result_id, $result_array);
+ }
+ if ($result === false) {
+ throw UodbcException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Gets the length of the field referenced by number in the given result
+ * identifier.
+ *
+ * @param resource $result_id The result identifier.
+ * @param int $field_number The field number. Field numbering starts at 1.
+ * @return int Returns the field length.
+ * @throws UodbcException
+ *
+ */
+function odbc_field_len($result_id, int $field_number): int
+{
+ error_clear_last();
+ $result = \odbc_field_len($result_id, $field_number);
+ if ($result === false) {
+ throw UodbcException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Gets the name of the field occupying the given column number in the given
+ * result identifier.
+ *
+ * @param resource $result_id The result identifier.
+ * @param int $field_number The field number. Field numbering starts at 1.
+ * @return string Returns the field name as a string.
+ * @throws UodbcException
+ *
+ */
+function odbc_field_name($result_id, int $field_number): string
+{
+ error_clear_last();
+ $result = \odbc_field_name($result_id, $field_number);
+ if ($result === false) {
+ throw UodbcException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Gets the number of the column slot that corresponds to the named field in
+ * the given result identifier.
+ *
+ * @param resource $result_id The result identifier.
+ * @param string $field_name The field name.
+ * @return int Returns the field number as a integer.
+ * Field numbering starts at 1.
+ * @throws UodbcException
+ *
+ */
+function odbc_field_num($result_id, string $field_name): int
+{
+ error_clear_last();
+ $result = \odbc_field_num($result_id, $field_name);
+ if ($result === false) {
+ throw UodbcException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Gets the scale of the field referenced by number in the given result
+ * identifier.
+ *
+ * @param resource $result_id The result identifier.
+ * @param int $field_number The field number. Field numbering starts at 1.
+ * @return int Returns the field scale as a integer.
+ * @throws UodbcException
+ *
+ */
+function odbc_field_scale($result_id, int $field_number): int
+{
+ error_clear_last();
+ $result = \odbc_field_scale($result_id, $field_number);
+ if ($result === false) {
+ throw UodbcException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Gets the SQL type of the field referenced by number in the given result
+ * identifier.
+ *
+ * @param resource $result_id The result identifier.
+ * @param int $field_number The field number. Field numbering starts at 1.
+ * @return string Returns the field type as a string.
+ * @throws UodbcException
+ *
+ */
+function odbc_field_type($result_id, int $field_number): string
+{
+ error_clear_last();
+ $result = \odbc_field_type($result_id, $field_number);
+ if ($result === false) {
+ throw UodbcException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Retrieves a list of foreign keys in the specified table or a list of
+ * foreign keys in other tables that refer to the primary key in the
+ * specified table
+ *
+ * @param resource $connection_id The ODBC connection identifier,
+ * see odbc_connect for details.
+ * @param string $pk_catalog The catalog ('qualifier' in ODBC 2 parlance) of the primary key table.
+ * @param string $pk_schema The schema ('owner' in ODBC 2 parlance) of the primary key table.
+ * @param string $pk_table The primary key table.
+ * @param string $fk_catalog The catalog ('qualifier' in ODBC 2 parlance) of the foreign key table.
+ * @param string $fk_schema The schema ('owner' in ODBC 2 parlance) of the foreign key table.
+ * @param string $fk_table The foreign key table.
+ * @return resource Returns an ODBC result identifier.
+ *
+ * The result set has the following columns:
+ *
+ * PKTABLE_CAT
+ * PKTABLE_SCHEM
+ * PKTABLE_NAME
+ * PKCOLUMN_NAME
+ * FKTABLE_CAT
+ * FKTABLE_SCHEM
+ * FKTABLE_NAME
+ * FKCOLUMN_NAME
+ * KEY_SEQ
+ * UPDATE_RULE
+ * DELETE_RULE
+ * FK_NAME
+ * PK_NAME
+ * DEFERRABILITY
+ *
+ * Drivers can report additional columns.
+ * @throws UodbcException
+ *
+ */
+function odbc_foreignkeys($connection_id, string $pk_catalog, string $pk_schema, string $pk_table, string $fk_catalog, string $fk_schema, string $fk_table)
+{
+ error_clear_last();
+ $result = \odbc_foreignkeys($connection_id, $pk_catalog, $pk_schema, $pk_table, $fk_catalog, $fk_schema, $fk_table);
+ if ($result === false) {
+ throw UodbcException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Retrieves information about data types supported by the data source.
+ *
+ * @param resource $connection_id The ODBC connection identifier,
+ * see odbc_connect for details.
+ * @param int $data_type The data type, which can be used to restrict the information to a
+ * single data type.
+ * @return resource Returns an ODBC result identifier.
+ *
+ * The result set has the following columns:
+ *
+ * TYPE_NAME
+ * DATA_TYPE
+ * PRECISION
+ * LITERAL_PREFIX
+ * LITERAL_SUFFIX
+ * CREATE_PARAMS
+ * NULLABLE
+ * CASE_SENSITIVE
+ * SEARCHABLE
+ * UNSIGNED_ATTRIBUTE
+ * MONEY
+ * AUTO_INCREMENT
+ * LOCAL_TYPE_NAME
+ * MINIMUM_SCALE
+ * MAXIMUM_SCALE
+ *
+ *
+ * The result set is ordered by DATA_TYPE and TYPE_NAME.
+ * @throws UodbcException
+ *
+ */
+function odbc_gettypeinfo($connection_id, int $data_type = null)
+{
+ error_clear_last();
+ if ($data_type !== null) {
+ $result = \odbc_gettypeinfo($connection_id, $data_type);
+ } else {
+ $result = \odbc_gettypeinfo($connection_id);
+ }
+ if ($result === false) {
+ throw UodbcException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Controls handling of LONG, LONGVARCHAR and LONGVARBINARY columns.
+ * The default length can be set using the
+ * uodbc.defaultlrl php.ini directive.
+ *
+ * @param resource $result_id The result identifier.
+ * @param int $length The number of bytes returned to PHP is controlled by the parameter
+ * length. If it is set to 0, long column data is passed through to the
+ * client (i.e. printed) when retrieved with odbc_result.
+ * @throws UodbcException
+ *
+ */
+function odbc_longreadlen($result_id, int $length): void
+{
+ error_clear_last();
+ $result = \odbc_longreadlen($result_id, $length);
+ if ($result === false) {
+ throw UodbcException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Prepares a statement for execution. The result identifier can be used
+ * later to execute the statement with odbc_execute.
+ *
+ * Some databases (such as IBM DB2, MS SQL Server, and Oracle) support
+ * stored procedures that accept parameters of type IN, INOUT, and OUT as
+ * defined by the ODBC specification. However, the Unified ODBC driver
+ * currently only supports parameters of type IN to stored procedures.
+ *
+ * @param resource $connection_id The ODBC connection identifier,
+ * see odbc_connect for details.
+ * @param string $query_string The query string statement being prepared.
+ * @return resource Returns an ODBC result identifier if the SQL command was prepared
+ * successfully.
+ * @throws UodbcException
+ *
+ */
+function odbc_prepare($connection_id, string $query_string)
+{
+ error_clear_last();
+ $result = \odbc_prepare($connection_id, $query_string);
+ if ($result === false) {
+ throw UodbcException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Returns a result identifier that can be used to fetch the column names
+ * that comprise the primary key for a table.
+ *
+ * @param resource $connection_id The ODBC connection identifier,
+ * see odbc_connect for details.
+ * @param string $catalog The catalog ('qualifier' in ODBC 2 parlance).
+ * @param string $schema The schema ('owner' in ODBC 2 parlance).
+ * @param string $table
+ * @return resource Returns an ODBC result identifier.
+ *
+ * The result set has the following columns:
+ *
+ * TABLE_CAT
+ * TABLE_SCHEM
+ * TABLE_NAME
+ * COLUMN_NAME
+ * KEY_SEQ
+ * PK_NAME
+ *
+ * Drivers can report additional columns.
+ * @throws UodbcException
+ *
+ */
+function odbc_primarykeys($connection_id, string $catalog, string $schema, string $table)
+{
+ error_clear_last();
+ $result = \odbc_primarykeys($connection_id, $catalog, $schema, $table);
+ if ($result === false) {
+ throw UodbcException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Prints all rows from a result identifier produced by
+ * odbc_exec. The result is printed in HTML table format.
+ * The data is not escaped.
+ *
+ * This function is not supposed to be used in production environments; it is
+ * merely meant for development purposes, to get a result set quickly rendered.
+ *
+ * @param resource $result_id The result identifier.
+ * @param string $format Additional overall table formatting.
+ * @return int Returns the number of rows in the result.
+ * @throws UodbcException
+ *
+ */
+function odbc_result_all($result_id, string $format = null): int
+{
+ error_clear_last();
+ if ($format !== null) {
+ $result = \odbc_result_all($result_id, $format);
+ } else {
+ $result = \odbc_result_all($result_id);
+ }
+ if ($result === false) {
+ throw UodbcException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Get result data
+ *
+ * @param resource $result_id The ODBC resource.
+ * @param mixed $field The field name being retrieved. It can either be an integer containing
+ * the column number of the field you want; or it can be a string
+ * containing the name of the field.
+ * @return mixed Returns the string contents of the field, FALSE on error, NULL for
+ * NULL data, or TRUE for binary data.
+ * @throws UodbcException
+ *
+ */
+function odbc_result($result_id, $field)
+{
+ error_clear_last();
+ $result = \odbc_result($result_id, $field);
+ if ($result === false) {
+ throw UodbcException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Rolls back all pending statements on the connection.
+ *
+ * @param resource $connection_id The ODBC connection identifier,
+ * see odbc_connect for details.
+ * @throws UodbcException
+ *
+ */
+function odbc_rollback($connection_id): void
+{
+ error_clear_last();
+ $result = \odbc_rollback($connection_id);
+ if ($result === false) {
+ throw UodbcException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function allows fiddling with the ODBC options for a
+ * particular connection or query result. It was written to help
+ * find work around to problems in quirky ODBC drivers. You should
+ * probably only use this function if you are an ODBC programmer and
+ * understand the effects the various options will have. You will
+ * certainly need a good ODBC reference to explain all the different
+ * options and values that can be used. Different driver versions
+ * support different options.
+ *
+ * Because the effects may vary depending on the ODBC driver, use of
+ * this function in scripts to be made publicly available is
+ * strongly discouraged. Also, some ODBC options are not available
+ * to this function because they must be set before the connection
+ * is established or the query is prepared. However, if on a
+ * particular job it can make PHP work so your boss doesn't tell you
+ * to use a commercial product, that's all that really
+ * matters.
+ *
+ * @param resource $id Is a connection id or result id on which to change the settings.
+ * For SQLSetConnectOption(), this is a connection id.
+ * For SQLSetStmtOption(), this is a result id.
+ * @param int $function Is the ODBC function to use. The value should be
+ * 1 for SQLSetConnectOption() and
+ * 2 for SQLSetStmtOption().
+ * @param int $option The option to set.
+ * @param int $param The value for the given option.
+ * @throws UodbcException
+ *
+ */
+function odbc_setoption($id, int $function, int $option, int $param): void
+{
+ error_clear_last();
+ $result = \odbc_setoption($id, $function, $option, $param);
+ if ($result === false) {
+ throw UodbcException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Retrieves either the optimal set of columns that uniquely identifies a
+ * row in the table, or columns that are automatically updated when any
+ * value in the row is updated by a transaction.
+ *
+ * @param resource $connection_id The ODBC connection identifier,
+ * see odbc_connect for details.
+ * @param int $type
+ * @param string $catalog The catalog ('qualifier' in ODBC 2 parlance).
+ * @param string $schema The schema ('owner' in ODBC 2 parlance).
+ * @param string $table The table.
+ * @param int $scope The scope, which orders the result set.
+ * One of SQL_SCOPE_CURROW, SQL_SCOPE_TRANSACTION
+ * or SQL_SCOPE_SESSION.
+ * @param int $nullable Determines whether to return special columns that can have a NULL value.
+ * One of SQL_NO_NULLS or SQL_NULLABLE .
+ * @return resource Returns an ODBC result identifier.
+ *
+ * The result set has the following columns:
+ *
+ * SCOPE
+ * COLUMN_NAME
+ * DATA_TYPE
+ * TYPE_NAME
+ * COLUMN_SIZE
+ * BUFFER_LENGTH
+ * DECIMAL_DIGITS
+ * PSEUDO_COLUMN
+ *
+ * Drivers can report additional columns.
+ * @throws UodbcException
+ *
+ */
+function odbc_specialcolumns($connection_id, int $type, string $catalog, string $schema, string $table, int $scope, int $nullable)
+{
+ error_clear_last();
+ $result = \odbc_specialcolumns($connection_id, $type, $catalog, $schema, $table, $scope, $nullable);
+ if ($result === false) {
+ throw UodbcException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Get statistics about a table and its indexes.
+ *
+ * @param resource $connection_id The ODBC connection identifier,
+ * see odbc_connect for details.
+ * @param string $catalog The catalog ('qualifier' in ODBC 2 parlance).
+ * @param string $schema The schema ('owner' in ODBC 2 parlance).
+ * @param string $table_name The table name.
+ * @param int $unique The type of the index.
+ * One of SQL_INDEX_UNIQUE or SQL_INDEX_ALL.
+ * @param int $accuracy One of SQL_ENSURE or SQL_QUICK.
+ * The latter requests that the driver retrieve the CARDINALITY and
+ * PAGES only if they are readily available from the server.
+ * @return resource Returns an ODBC result identifier.
+ *
+ * The result set has the following columns:
+ *
+ * TABLE_CAT
+ * TABLE_SCHEM
+ * TABLE_NAME
+ * NON_UNIQUE
+ * INDEX_QUALIFIER
+ * INDEX_NAME
+ * TYPE
+ * ORDINAL_POSITION
+ * COLUMN_NAME
+ * ASC_OR_DESC
+ * CARDINALITY
+ * PAGES
+ * FILTER_CONDITION
+ *
+ * Drivers can report additional columns.
+ * @throws UodbcException
+ *
+ */
+function odbc_statistics($connection_id, string $catalog, string $schema, string $table_name, int $unique, int $accuracy)
+{
+ error_clear_last();
+ $result = \odbc_statistics($connection_id, $catalog, $schema, $table_name, $unique, $accuracy);
+ if ($result === false) {
+ throw UodbcException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Lists tables in the requested range and the privileges associated
+ * with each table.
+ *
+ * @param resource $connection_id The ODBC connection identifier,
+ * see odbc_connect for details.
+ * @param string $catalog The catalog ('qualifier' in ODBC 2 parlance).
+ * @param string $schema The schema ('owner' in ODBC 2 parlance).
+ * This parameter accepts the following search patterns:
+ * % to match zero or more characters,
+ * and _ to match a single character.
+ * @param string $name The name.
+ * This parameter accepts the following search patterns:
+ * % to match zero or more characters,
+ * and _ to match a single character.
+ * @return resource An ODBC result identifier.
+ *
+ * The result set has the following columns:
+ *
+ * TABLE_CAT
+ * TABLE_SCHEM
+ * TABLE_NAME
+ * GRANTOR
+ * GRANTEE
+ * PRIVILEGE
+ * IS_GRANTABLE
+ *
+ * Drivers can report additional columns.
+ * @throws UodbcException
+ *
+ */
+function odbc_tableprivileges($connection_id, string $catalog, string $schema, string $name)
+{
+ error_clear_last();
+ $result = \odbc_tableprivileges($connection_id, $catalog, $schema, $name);
+ if ($result === false) {
+ throw UodbcException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Lists all tables in the requested range.
+ *
+ * To support enumeration of qualifiers, owners, and table types,
+ * the following special semantics for the
+ * catalog, schema,
+ * name, and
+ * table_type are available:
+ *
+ *
+ *
+ * If catalog is a single percent
+ * character (%) and schema and
+ * name are empty strings, then the result
+ * set contains a list of valid qualifiers for the data
+ * source. (All columns except the TABLE_QUALIFIER column contain
+ * NULLs.)
+ *
+ *
+ *
+ *
+ * If schema is a single percent character
+ * (%) and catalog and
+ * name are empty strings, then the result
+ * set contains a list of valid owners for the data source. (All
+ * columns except the TABLE_OWNER column contain
+ * NULLs.)
+ *
+ *
+ *
+ *
+ * If table_type is a single percent
+ * character (%) and catalog,
+ * schema and name
+ * are empty strings, then the result set contains a list of
+ * valid table types for the data source. (All columns except the
+ * TABLE_TYPE column contain NULLs.)
+ *
+ *
+ *
+ *
+ * @param resource $connection_id The ODBC connection identifier,
+ * see odbc_connect for details.
+ * @param string $catalog The catalog ('qualifier' in ODBC 2 parlance).
+ * @param string $schema The schema ('owner' in ODBC 2 parlance).
+ * This parameter accepts the following search patterns:
+ * % to match zero or more characters,
+ * and _ to match a single character.
+ * @param string $name The name.
+ * This parameter accepts the following search patterns:
+ * % to match zero or more characters,
+ * and _ to match a single character.
+ * @param string $types If table_type is not an empty string, it
+ * must contain a list of comma-separated values for the types of
+ * interest; each value may be enclosed in single quotes (') or
+ * unquoted. For example, 'TABLE','VIEW' or TABLE, VIEW. If the
+ * data source does not support a specified table type,
+ * odbc_tables does not return any results for
+ * that type.
+ * @return resource Returns an ODBC result identifier containing the information.
+ *
+ * The result set has the following columns:
+ *
+ * TABLE_CAT
+ * TABLE_SCHEM
+ * TABLE_NAME
+ * TABLE_TYPE
+ * REMARKS
+ *
+ * Drivers can report additional columns.
+ * @throws UodbcException
+ *
+ */
+function odbc_tables($connection_id, string $catalog = null, string $schema = null, string $name = null, string $types = null)
+{
+ error_clear_last();
+ if ($types !== null) {
+ $result = \odbc_tables($connection_id, $catalog, $schema, $name, $types);
+ } elseif ($name !== null) {
+ $result = \odbc_tables($connection_id, $catalog, $schema, $name);
+ } elseif ($schema !== null) {
+ $result = \odbc_tables($connection_id, $catalog, $schema);
+ } elseif ($catalog !== null) {
+ $result = \odbc_tables($connection_id, $catalog);
+ } else {
+ $result = \odbc_tables($connection_id);
+ }
+ if ($result === false) {
+ throw UodbcException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/uopz.php b/vendor/thecodingmachine/safe/generated/uopz.php
new file mode 100644
index 000000000..ae0ee8f89
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/uopz.php
@@ -0,0 +1,40 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\UopzException;
+
+/**
+ * Makes class extend parent
+ *
+ * @param string $class The name of the class to extend
+ * @param string $parent The name of the class to inherit
+ * @throws UopzException
+ *
+ */
+function uopz_extend(string $class, string $parent): void
+{
+ error_clear_last();
+ $result = \uopz_extend($class, $parent);
+ if ($result === false) {
+ throw UopzException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Makes class implement interface
+ *
+ * @param string $class
+ * @param string $interface
+ * @throws UopzException
+ *
+ */
+function uopz_implement(string $class, string $interface): void
+{
+ error_clear_last();
+ $result = \uopz_implement($class, $interface);
+ if ($result === false) {
+ throw UopzException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/url.php b/vendor/thecodingmachine/safe/generated/url.php
new file mode 100644
index 000000000..56c08b551
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/url.php
@@ -0,0 +1,144 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\UrlException;
+
+/**
+ * Decodes a base64 encoded data.
+ *
+ * @param string $data The encoded data.
+ * @param bool $strict If the strict parameter is set to TRUE
+ * then the base64_decode function will return
+ * FALSE if the input contains character from outside the base64
+ * alphabet. Otherwise invalid characters will be silently discarded.
+ * @return string Returns the decoded data. The returned data may be
+ * binary.
+ * @throws UrlException
+ *
+ */
+function base64_decode(string $data, bool $strict = false): string
+{
+ error_clear_last();
+ $result = \base64_decode($data, $strict);
+ if ($result === false) {
+ throw UrlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * get_headers returns an array with the headers sent
+ * by the server in response to a HTTP request.
+ *
+ * @param string $url The target URL.
+ * @param int $format If the optional format parameter is set to non-zero,
+ * get_headers parses the response and sets the
+ * array's keys.
+ * @param resource $context A valid context resource created with
+ * stream_context_create.
+ * @return array Returns an indexed or associative array with the headers.
+ * @throws UrlException
+ *
+ */
+function get_headers(string $url, int $format = 0, $context = null): array
+{
+ error_clear_last();
+ if ($context !== null) {
+ $result = \get_headers($url, $format, $context);
+ } else {
+ $result = \get_headers($url, $format);
+ }
+ if ($result === false) {
+ throw UrlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * 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
+ * URLs are also accepted, parse_url tries its best to
+ * parse them correctly.
+ *
+ * @param string $url The URL to parse. Invalid characters are replaced by
+ * _.
+ * @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 integer).
+ * @return mixed 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
+ * integer, 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.
+ * @throws UrlException
+ *
+ */
+function parse_url(string $url, int $component = -1)
+{
+ error_clear_last();
+ $result = \parse_url($url, $component);
+ if ($result === false) {
+ throw UrlException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/var.php b/vendor/thecodingmachine/safe/generated/var.php
new file mode 100644
index 000000000..14609f22d
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/var.php
@@ -0,0 +1,60 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\VarException;
+
+/**
+ * Set the type of variable var to
+ * type.
+ *
+ * @param mixed $var The variable being converted.
+ * @param string $type Possibles values of type are:
+ *
+ *
+ *
+ * "boolean" or "bool"
+ *
+ *
+ *
+ *
+ * "integer" or "int"
+ *
+ *
+ *
+ *
+ * "float" or "double"
+ *
+ *
+ *
+ *
+ * "string"
+ *
+ *
+ *
+ *
+ * "array"
+ *
+ *
+ *
+ *
+ * "object"
+ *
+ *
+ *
+ *
+ * "null"
+ *
+ *
+ *
+ * @throws VarException
+ *
+ */
+function settype(&$var, string $type): void
+{
+ error_clear_last();
+ $result = \settype($var, $type);
+ if ($result === false) {
+ throw VarException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/xdiff.php b/vendor/thecodingmachine/safe/generated/xdiff.php
new file mode 100644
index 000000000..27feef39f
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/xdiff.php
@@ -0,0 +1,236 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\XdiffException;
+
+/**
+ * Makes a binary diff of two files and stores the result in a patch file.
+ * This function works with both text and binary files. Resulting patch
+ * file can be later applied using xdiff_file_bpatch/xdiff_string_bpatch.
+ *
+ * @param string $old_file Path to the first file. This file acts as "old" file.
+ * @param string $new_file Path to the second file. This file acts as "new" file.
+ * @param string $dest Path of the resulting patch file. Resulting file contains differences
+ * between "old" and "new" files. It is in binary format and is human-unreadable.
+ * @throws XdiffException
+ *
+ */
+function xdiff_file_bdiff(string $old_file, string $new_file, string $dest): void
+{
+ error_clear_last();
+ $result = \xdiff_file_bdiff($old_file, $new_file, $dest);
+ if ($result === false) {
+ throw XdiffException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Patches a file with a binary
+ * patch and stores the result in a file dest.
+ * This function accepts patches created both via xdiff_file_bdiff
+ * and xdiff_file_rabdiff functions or their string counterparts.
+ *
+ * @param string $file The original file.
+ * @param string $patch The binary patch file.
+ * @param string $dest Path of the resulting file.
+ * @throws XdiffException
+ *
+ */
+function xdiff_file_bpatch(string $file, string $patch, string $dest): void
+{
+ error_clear_last();
+ $result = \xdiff_file_bpatch($file, $patch, $dest);
+ if ($result === false) {
+ throw XdiffException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Makes a binary diff of two files and stores the result in a patch file.
+ * This function works with both text and binary files. Resulting patch
+ * file can be later applied using xdiff_file_bpatch.
+ *
+ * Starting with version 1.5.0 this function is an alias of xdiff_file_bdiff.
+ *
+ * @param string $old_file Path to the first file. This file acts as "old" file.
+ * @param string $new_file Path to the second file. This file acts as "new" file.
+ * @param string $dest Path of the resulting patch file. Resulting file contains differences
+ * between "old" and "new" files. It is in binary format and is human-unreadable.
+ * @throws XdiffException
+ *
+ */
+function xdiff_file_diff_binary(string $old_file, string $new_file, string $dest): void
+{
+ error_clear_last();
+ $result = \xdiff_file_diff_binary($old_file, $new_file, $dest);
+ if ($result === false) {
+ throw XdiffException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Makes an unified diff containing differences between old_file and
+ * new_file and stores it in dest file. The
+ * resulting file is human-readable. An optional context parameter
+ * specifies how many lines of context should be added around each change.
+ * Setting minimal parameter to true will result in outputting the shortest
+ * patch file possible (can take a long time).
+ *
+ * @param string $old_file Path to the first file. This file acts as "old" file.
+ * @param string $new_file Path to the second file. This file acts as "new" file.
+ * @param string $dest Path of the resulting patch file.
+ * @param int $context Indicates how many lines of context you want to include in diff
+ * result.
+ * @param bool $minimal Set this parameter to TRUE if you want to minimalize size of the result
+ * (can take a long time).
+ * @throws XdiffException
+ *
+ */
+function xdiff_file_diff(string $old_file, string $new_file, string $dest, int $context = 3, bool $minimal = false): void
+{
+ error_clear_last();
+ $result = \xdiff_file_diff($old_file, $new_file, $dest, $context, $minimal);
+ if ($result === false) {
+ throw XdiffException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Patches a file with a binary
+ * patch and stores the result in a file dest.
+ * This function accepts patches created both via xdiff_file_bdiff
+ * or xdiff_file_rabdiff functions or their string counterparts.
+ *
+ * Starting with version 1.5.0 this function is an alias of xdiff_file_bpatch.
+ *
+ * @param string $file The original file.
+ * @param string $patch The binary patch file.
+ * @param string $dest Path of the resulting file.
+ * @throws XdiffException
+ *
+ */
+function xdiff_file_patch_binary(string $file, string $patch, string $dest): void
+{
+ error_clear_last();
+ $result = \xdiff_file_patch_binary($file, $patch, $dest);
+ if ($result === false) {
+ throw XdiffException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Makes a binary diff of two files and stores the result in a patch file.
+ * The difference between this function and xdiff_file_bdiff is different
+ * algorithm used which should result in faster execution and smaller diff produced.
+ * This function works with both text and binary files. Resulting patch
+ * file can be later applied using xdiff_file_bpatch/xdiff_string_bpatch.
+ *
+ * For more details about differences between algorithm used please check libxdiff
+ * website.
+ *
+ * @param string $old_file Path to the first file. This file acts as "old" file.
+ * @param string $new_file Path to the second file. This file acts as "new" file.
+ * @param string $dest Path of the resulting patch file. Resulting file contains differences
+ * between "old" and "new" files. It is in binary format and is human-unreadable.
+ * @throws XdiffException
+ *
+ */
+function xdiff_file_rabdiff(string $old_file, string $new_file, string $dest): void
+{
+ error_clear_last();
+ $result = \xdiff_file_rabdiff($old_file, $new_file, $dest);
+ if ($result === false) {
+ throw XdiffException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Patches a string str with a binary patch.
+ * This function accepts patches created both via xdiff_string_bdiff
+ * and xdiff_string_rabdiff functions or their file counterparts.
+ *
+ * @param string $str The original binary string.
+ * @param string $patch The binary patch string.
+ * @return string Returns the patched string.
+ * @throws XdiffException
+ *
+ */
+function xdiff_string_bpatch(string $str, string $patch): string
+{
+ error_clear_last();
+ $result = \xdiff_string_bpatch($str, $patch);
+ if ($result === false) {
+ throw XdiffException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Patches a string str with a binary patch.
+ * This function accepts patches created both via xdiff_string_bdiff
+ * and xdiff_string_rabdiff functions or their file counterparts.
+ *
+ * Starting with version 1.5.0 this function is an alias of xdiff_string_bpatch.
+ *
+ * @param string $str The original binary string.
+ * @param string $patch The binary patch string.
+ * @return string Returns the patched string.
+ * @throws XdiffException
+ *
+ */
+function xdiff_string_patch_binary(string $str, string $patch): string
+{
+ error_clear_last();
+ $result = \xdiff_string_patch_binary($str, $patch);
+ if ($result === false) {
+ throw XdiffException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Patches a str string with an unified patch in patch parameter
+ * and returns the result. patch has to be an unified diff created by
+ * xdiff_file_diff/xdiff_string_diff function.
+ * An optional flags parameter specifies mode of operation. Any
+ * rejected parts of the patch will be stored inside error variable if
+ * it is provided.
+ *
+ * @param string $str The original string.
+ * @param string $patch The unified patch string. It has to be created using xdiff_string_diff,
+ * xdiff_file_diff functions or compatible tools.
+ * @param int $flags flags can be either
+ * XDIFF_PATCH_NORMAL (default mode, normal patch)
+ * or XDIFF_PATCH_REVERSE (reversed patch).
+ *
+ * Starting from version 1.5.0, you can also use binary OR to enable
+ * XDIFF_PATCH_IGNORESPACE flag.
+ * @param string|null $error If provided then rejected parts are stored inside this variable.
+ * @return string Returns the patched string.
+ * @throws XdiffException
+ *
+ */
+function xdiff_string_patch(string $str, string $patch, int $flags = null, ?string &$error = null): string
+{
+ error_clear_last();
+ if ($error !== null) {
+ $result = \xdiff_string_patch($str, $patch, $flags, $error);
+ } elseif ($flags !== null) {
+ $result = \xdiff_string_patch($str, $patch, $flags);
+ } else {
+ $result = \xdiff_string_patch($str, $patch);
+ }
+ if ($result === false) {
+ throw XdiffException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/xml.php b/vendor/thecodingmachine/safe/generated/xml.php
new file mode 100644
index 000000000..4f9f6606c
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/xml.php
@@ -0,0 +1,95 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\XmlException;
+
+/**
+ * xml_parser_create_ns creates a new XML parser
+ * with XML namespace support and returns a resource handle referencing
+ * it to be used by the other XML functions.
+ *
+ * @param string $encoding The input encoding is automatically detected, so that the
+ * encoding parameter specifies only the output
+ * encoding. In PHP 5.0.0 and 5.0.1, the default output charset is
+ * ISO-8859-1, while in PHP 5.0.2 and upper is UTF-8. The supported
+ * encodings are ISO-8859-1, UTF-8 and
+ * US-ASCII.
+ * @param string $separator With a namespace aware parser tag parameters passed to the various
+ * handler functions will consist of namespace and tag name separated by
+ * the string specified in separator.
+ * @return resource Returns a resource handle for the new XML parser.
+ * @throws XmlException
+ *
+ */
+function xml_parser_create_ns(string $encoding = null, string $separator = ":")
+{
+ error_clear_last();
+ if ($separator !== ":") {
+ $result = \xml_parser_create_ns($encoding, $separator);
+ } elseif ($encoding !== null) {
+ $result = \xml_parser_create_ns($encoding);
+ } else {
+ $result = \xml_parser_create_ns();
+ }
+ if ($result === false) {
+ throw XmlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * xml_parser_create creates a new XML parser
+ * and returns a resource handle referencing it to be used by the
+ * other XML functions.
+ *
+ * @param string $encoding The optional encoding specifies the character
+ * encoding for the input/output in PHP 4. Starting from PHP 5, the input
+ * encoding is automatically detected, so that the
+ * encoding parameter specifies only the output
+ * encoding. In PHP 4, the default output encoding is the same as the
+ * input charset. If empty string is passed, the parser attempts to identify
+ * which encoding the document is encoded in by looking at the heading 3 or
+ * 4 bytes. In PHP 5.0.0 and 5.0.1, the default output charset is
+ * ISO-8859-1, while in PHP 5.0.2 and upper is UTF-8. The supported
+ * encodings are ISO-8859-1, UTF-8 and
+ * US-ASCII.
+ * @return resource Returns a resource handle for the new XML parser.
+ * @throws XmlException
+ *
+ */
+function xml_parser_create(string $encoding = null)
+{
+ error_clear_last();
+ if ($encoding !== null) {
+ $result = \xml_parser_create($encoding);
+ } else {
+ $result = \xml_parser_create();
+ }
+ if ($result === false) {
+ throw XmlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * 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();
+ $result = \xml_set_object($parser, $object);
+ if ($result === false) {
+ throw XmlException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/xmlrpc.php b/vendor/thecodingmachine/safe/generated/xmlrpc.php
new file mode 100644
index 000000000..15364fb4a
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/xmlrpc.php
@@ -0,0 +1,22 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\XmlrpcException;
+
+/**
+ * Sets xmlrpc type, base64 or datetime, for a PHP string value.
+ *
+ * @param string|\DateTime $value Value to set the type
+ * @param string $type 'base64' or 'datetime'
+ * @throws XmlrpcException
+ *
+ */
+function xmlrpc_set_type(&$value, string $type): void
+{
+ error_clear_last();
+ $result = \xmlrpc_set_type($value, $type);
+ if ($result === false) {
+ throw XmlrpcException::createFromPhpError();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/generated/yaml.php b/vendor/thecodingmachine/safe/generated/yaml.php
new file mode 100644
index 000000000..38daaf759
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/yaml.php
@@ -0,0 +1,97 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\YamlException;
+
+/**
+ * Convert all or part of a YAML document stream read from a file to a PHP variable.
+ *
+ * @param string $filename Path to the file.
+ * @param int $pos Document to extract from stream (-1 for all
+ * documents, 0 for first document, ...).
+ * @param int|null $ndocs If ndocs is provided, then it is filled with the
+ * number of documents found in stream.
+ * @param array $callbacks Content handlers for YAML nodes. Associative array of YAML
+ * tag =&gt; callable mappings. See
+ * parse callbacks for more
+ * details.
+ * @return mixed Returns the value encoded in input in appropriate
+ * PHP type. If pos is -1 an
+ * array will be returned with one entry for each document found
+ * in the stream.
+ * @throws YamlException
+ *
+ */
+function yaml_parse_file(string $filename, int $pos = 0, ?int &$ndocs = null, array $callbacks = null)
+{
+ error_clear_last();
+ $result = \yaml_parse_file($filename, $pos, $ndocs, $callbacks);
+ if ($result === false) {
+ throw YamlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Convert all or part of a YAML document stream read from a URL to a PHP variable.
+ *
+ * @param string $url url should be of the form "scheme://...". 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.
+ * @param int $pos Document to extract from stream (-1 for all
+ * documents, 0 for first document, ...).
+ * @param int|null $ndocs If ndocs is provided, then it is filled with the
+ * number of documents found in stream.
+ * @param array $callbacks Content handlers for YAML nodes. Associative array of YAML
+ * tag =&gt; callable mappings. See
+ * parse callbacks for more
+ * @return mixed Returns the value encoded in input in appropriate
+ * PHP type. If pos is
+ * -1 an array will be returned with one entry
+ * for each document found in the stream.
+ * @throws YamlException
+ *
+ */
+function yaml_parse_url(string $url, int $pos = 0, ?int &$ndocs = null, array $callbacks = null)
+{
+ error_clear_last();
+ $result = \yaml_parse_url($url, $pos, $ndocs, $callbacks);
+ if ($result === false) {
+ throw YamlException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Convert all or part of a YAML document stream to a PHP variable.
+ *
+ * @param string $input The string to parse as a YAML document stream.
+ * @param int $pos Document to extract from stream (-1 for all
+ * documents, 0 for first document, ...).
+ * @param int|null $ndocs If ndocs is provided, then it is filled with the
+ * number of documents found in stream.
+ * @param array $callbacks Content handlers for YAML nodes. Associative array of YAML
+ * tag =&gt; callable mappings. See
+ * parse callbacks for more
+ * details.
+ * @return mixed Returns the value encoded in input in appropriate
+ * PHP type. If pos is -1 an
+ * array will be returned with one entry for each document found
+ * in the stream.
+ * @throws YamlException
+ *
+ */
+function yaml_parse(string $input, int $pos = 0, ?int &$ndocs = null, array $callbacks = null)
+{
+ error_clear_last();
+ $result = \yaml_parse($input, $pos, $ndocs, $callbacks);
+ if ($result === false) {
+ throw YamlException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/yaz.php b/vendor/thecodingmachine/safe/generated/yaz.php
new file mode 100644
index 000000000..29c1d33c4
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/yaz.php
@@ -0,0 +1,438 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\YazException;
+
+/**
+ * This function invokes a CCL parser. It converts a given CCL FIND query to
+ * an RPN query which may be passed to the yaz_search
+ * function to perform a search.
+ *
+ * To define a set of valid CCL fields call yaz_ccl_conf
+ * prior to this function.
+ *
+ * @param resource $id The connection resource returned by yaz_connect.
+ * @param string $query The CCL FIND query.
+ * @param array|null $result If the function was executed successfully, this will be an array
+ * containing the valid RPN query under the key rpn.
+ *
+ * Upon failure, three indexes are set in this array to indicate the cause
+ * of failure:
+ *
+ *
+ *
+ * errorcode - the CCL error code (integer)
+ *
+ *
+ *
+ *
+ * errorstring - the CCL error string
+ *
+ *
+ *
+ *
+ * errorpos - approximate position in query of failure
+ * (integer is character position)
+ *
+ *
+ *
+ *
+ * errorcode - the CCL error code (integer)
+ *
+ * errorstring - the CCL error string
+ *
+ * errorpos - approximate position in query of failure
+ * (integer is character position)
+ * @throws YazException
+ *
+ */
+function yaz_ccl_parse($id, string $query, ?array &$result): void
+{
+ error_clear_last();
+ $result = \yaz_ccl_parse($id, $query, $result);
+ if ($result === false) {
+ throw YazException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Closes the connection given by parameter id.
+ *
+ * @param resource $id The connection resource returned by yaz_connect.
+ * @throws YazException
+ *
+ */
+function yaz_close($id): void
+{
+ error_clear_last();
+ $result = \yaz_close($id);
+ if ($result === false) {
+ throw YazException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function returns a connection resource on success, zero on
+ * failure.
+ *
+ * yaz_connect prepares for a connection to a
+ * Z39.50 server.
+ * This function is non-blocking and does not attempt to establish
+ * a connection - it merely prepares a connect to be performed later when
+ * yaz_wait is called.
+ *
+ * @param string $zurl A string that takes the form host[:port][/database].
+ * If port is omitted, port 210 is used. If database is omitted
+ * Default is used.
+ * @param mixed $options If given as a string, it is treated as the Z39.50 V2 authentication
+ * string (OpenAuth).
+ *
+ * If given as an array, the contents of the array serves as options.
+ *
+ *
+ * user
+ *
+ *
+ * Username for authentication.
+ *
+ *
+ *
+ *
+ * group
+ *
+ *
+ * Group for authentication.
+ *
+ *
+ *
+ *
+ * password
+ *
+ *
+ * Password for authentication.
+ *
+ *
+ *
+ *
+ * cookie
+ *
+ *
+ * Cookie for session (YAZ proxy).
+ *
+ *
+ *
+ *
+ * proxy
+ *
+ *
+ * Proxy for connection (YAZ proxy).
+ *
+ *
+ *
+ *
+ * persistent
+ *
+ *
+ * A boolean. If TRUE the connection is persistent; If FALSE the
+ * connection is not persistent. By default connections are persistent.
+ *
+ *
+ *
+ * If you open a persistent connection, you won't be able to close
+ * it later with yaz_close.
+ *
+ *
+ *
+ *
+ *
+ * piggyback
+ *
+ *
+ * A boolean. If TRUE piggyback is enabled for searches; If FALSE
+ * piggyback is disabled. By default piggyback is enabled.
+ *
+ *
+ * Enabling piggyback is more efficient and usually saves a
+ * network-round-trip for first time fetches of records. However, a
+ * few Z39.50 servers do not support piggyback or they ignore element
+ * set names. For those, piggyback should be disabled.
+ *
+ *
+ *
+ *
+ * charset
+ *
+ *
+ * A string that specifies character set to be used in Z39.50
+ * language and character set negotiation. Use strings such as:
+ * ISO-8859-1, UTF-8,
+ * UTF-16.
+ *
+ *
+ * Most Z39.50 servers do not support this feature (and thus, this is
+ * ignored). Many servers use the ISO-8859-1 encoding for queries and
+ * messages. MARC21/USMARC records are not affected by this setting.
+ *
+ *
+ *
+ *
+ *
+ * preferredMessageSize
+ *
+ *
+ * An integer that specifies the maximum byte size of all records
+ * to be returned by a target during retrieval. See the
+ * Z39.50 standard for more
+ * information.
+ *
+ *
+ *
+ * This option is supported in PECL YAZ 1.0.5 or later.
+ *
+ *
+ *
+ *
+ *
+ *
+ * maximumRecordSize
+ *
+ *
+ * An integer that specifies the maximum byte size of a single record
+ * to be returned by a target during retrieval. This
+ * entity is referred to as Exceptional-record-size in the
+ * Z39.50 standard.
+ *
+ *
+ *
+ * This option is supported in PECL YAZ 1.0.5 or later.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * Username for authentication.
+ *
+ * Group for authentication.
+ *
+ * Password for authentication.
+ *
+ * Cookie for session (YAZ proxy).
+ *
+ * Proxy for connection (YAZ proxy).
+ *
+ * A boolean. If TRUE the connection is persistent; If FALSE the
+ * connection is not persistent. By default connections are persistent.
+ *
+ * If you open a persistent connection, you won't be able to close
+ * it later with yaz_close.
+ *
+ * A boolean. If TRUE piggyback is enabled for searches; If FALSE
+ * piggyback is disabled. By default piggyback is enabled.
+ *
+ * Enabling piggyback is more efficient and usually saves a
+ * network-round-trip for first time fetches of records. However, a
+ * few Z39.50 servers do not support piggyback or they ignore element
+ * set names. For those, piggyback should be disabled.
+ *
+ * A string that specifies character set to be used in Z39.50
+ * language and character set negotiation. Use strings such as:
+ * ISO-8859-1, UTF-8,
+ * UTF-16.
+ *
+ * Most Z39.50 servers do not support this feature (and thus, this is
+ * ignored). Many servers use the ISO-8859-1 encoding for queries and
+ * messages. MARC21/USMARC records are not affected by this setting.
+ *
+ * An integer that specifies the maximum byte size of all records
+ * to be returned by a target during retrieval. See the
+ * Z39.50 standard for more
+ * information.
+ *
+ * This option is supported in PECL YAZ 1.0.5 or later.
+ *
+ * An integer that specifies the maximum byte size of a single record
+ * to be returned by a target during retrieval. This
+ * entity is referred to as Exceptional-record-size in the
+ * Z39.50 standard.
+ *
+ * This option is supported in PECL YAZ 1.0.5 or later.
+ * @return mixed A connection resource on success, FALSE on error.
+ * @throws YazException
+ *
+ */
+function yaz_connect(string $zurl, $options = null)
+{
+ error_clear_last();
+ if ($options !== null) {
+ $result = \yaz_connect($zurl, $options);
+ } else {
+ $result = \yaz_connect($zurl);
+ }
+ if ($result === false) {
+ throw YazException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * This function allows you to change databases within a session by
+ * specifying one or more databases to be used in search, retrieval, etc.
+ * - overriding databases specified in call to
+ * yaz_connect.
+ *
+ * @param resource $id The connection resource returned by yaz_connect.
+ * @param string $databases A string containing one or more databases. Multiple databases are
+ * separated by a plus sign +.
+ * @throws YazException
+ *
+ */
+function yaz_database($id, string $databases): void
+{
+ error_clear_last();
+ $result = \yaz_database($id, $databases);
+ if ($result === false) {
+ throw YazException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function sets the element set name for retrieval.
+ *
+ * Call this function before yaz_search or
+ * yaz_present to specify the element set name for
+ * records to be retrieved.
+ *
+ * @param resource $id The connection resource returned by yaz_connect.
+ * @param string $elementset Most servers support F (for full records) and
+ * B (for brief records).
+ * @throws YazException
+ *
+ */
+function yaz_element($id, string $elementset): void
+{
+ error_clear_last();
+ $result = \yaz_element($id, $elementset);
+ if ($result === false) {
+ throw YazException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function prepares for retrieval of records after a successful search.
+ *
+ * The yaz_range function should be called prior to this
+ * function to specify the range of records to be retrieved.
+ *
+ * @param resource $id The connection resource returned by yaz_connect.
+ * @throws YazException
+ *
+ */
+function yaz_present($id): void
+{
+ error_clear_last();
+ $result = \yaz_present($id);
+ if ($result === false) {
+ throw YazException::createFromPhpError();
+ }
+}
+
+
+/**
+ * yaz_search prepares for a search on the given
+ * connection.
+ *
+ * Like yaz_connect this function is non-blocking and
+ * only prepares for a search to be executed later when
+ * yaz_wait is called.
+ *
+ * @param resource $id The connection resource returned by yaz_connect.
+ * @param string $type This parameter represents the query type - only "rpn"
+ * is supported now in which case the third argument specifies a Type-1
+ * query in prefix query notation.
+ * @param string $query The RPN query is a textual representation of the Type-1 query as
+ * defined by the Z39.50 standard. However, in the text representation
+ * as used by YAZ a prefix notation is used, that is the operator
+ * precedes the operands. The query string is a sequence of tokens where
+ * white space is ignored unless surrounded by double quotes. Tokens beginning
+ * with an at-character (@) are considered operators,
+ * otherwise they are treated as search terms.
+ *
+ * You can find information about attributes at the
+ * Z39.50 Maintenance Agency
+ * site.
+ *
+ * If you would like to use a more friendly notation,
+ * use the CCL parser - functions yaz_ccl_conf and
+ * yaz_ccl_parse.
+ * @throws YazException
+ *
+ */
+function yaz_search($id, string $type, string $query): void
+{
+ error_clear_last();
+ $result = \yaz_search($id, $type, $query);
+ if ($result === false) {
+ throw YazException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function carries out networked (blocked) activity for outstanding
+ * requests which have been prepared by the functions
+ * yaz_connect, yaz_search,
+ * yaz_present, yaz_scan and
+ * yaz_itemorder.
+ *
+ * yaz_wait returns when all servers have either
+ * completed all requests or aborted (in case of errors).
+ *
+ * @param array $options An associative array of options:
+ *
+ *
+ * timeout
+ *
+ *
+ * Sets timeout in seconds. If a server has not responded within the
+ * timeout it is considered dead and yaz_wait
+ * returns. The default value for timeout is 15 seconds.
+ *
+ *
+ *
+ *
+ * event
+ *
+ *
+ * A boolean.
+ *
+ *
+ *
+ *
+ *
+ * Sets timeout in seconds. If a server has not responded within the
+ * timeout it is considered dead and yaz_wait
+ * returns. The default value for timeout is 15 seconds.
+ *
+ * A boolean.
+ * @return mixed Returns TRUE on success.
+ * In event mode, returns resource.
+ * @throws YazException
+ *
+ */
+function yaz_wait(array &$options = null)
+{
+ error_clear_last();
+ $result = \yaz_wait($options);
+ if ($result === false) {
+ throw YazException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/zip.php b/vendor/thecodingmachine/safe/generated/zip.php
new file mode 100644
index 000000000..8fd22bb9a
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/zip.php
@@ -0,0 +1,71 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\ZipException;
+
+/**
+ * Closes the specified directory entry.
+ *
+ * @param resource $zip_entry A directory entry previously opened zip_entry_open.
+ * @throws ZipException
+ *
+ */
+function zip_entry_close($zip_entry): void
+{
+ error_clear_last();
+ $result = \zip_entry_close($zip_entry);
+ if ($result === false) {
+ throw ZipException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Opens a directory entry in a zip file for reading.
+ *
+ * @param resource $zip A valid resource handle returned by zip_open.
+ * @param resource $zip_entry A directory entry returned by zip_read.
+ * @param string $mode Any of the modes specified in the documentation of
+ * fopen.
+ *
+ * Currently, mode is ignored and is always
+ * "rb". This is due to the fact that zip support
+ * in PHP is read only access.
+ * @throws ZipException
+ *
+ */
+function zip_entry_open($zip, $zip_entry, string $mode = null): void
+{
+ error_clear_last();
+ if ($mode !== null) {
+ $result = \zip_entry_open($zip, $zip_entry, $mode);
+ } else {
+ $result = \zip_entry_open($zip, $zip_entry);
+ }
+ if ($result === false) {
+ throw ZipException::createFromPhpError();
+ }
+}
+
+
+/**
+ * Reads from an open directory entry.
+ *
+ * @param resource $zip_entry A directory entry returned by zip_read.
+ * @param int $length The number of bytes to return.
+ *
+ * This should be the uncompressed length you wish to read.
+ * @return string Returns the data read, empty string on end of a file.
+ * @throws ZipException
+ *
+ */
+function zip_entry_read($zip_entry, int $length = 1024): string
+{
+ error_clear_last();
+ $result = \zip_entry_read($zip_entry, $length);
+ if ($result === false) {
+ throw ZipException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/generated/zlib.php b/vendor/thecodingmachine/safe/generated/zlib.php
new file mode 100644
index 000000000..4dc3ca94f
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/zlib.php
@@ -0,0 +1,611 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\ZlibException;
+
+/**
+ * Incrementally deflates data in the specified context.
+ *
+ * @param resource $context A context created with deflate_init.
+ * @param string $data A chunk of data to compress.
+ * @param int $flush_mode One of ZLIB_BLOCK,
+ * ZLIB_NO_FLUSH,
+ * ZLIB_PARTIAL_FLUSH,
+ * ZLIB_SYNC_FLUSH (default),
+ * ZLIB_FULL_FLUSH, ZLIB_FINISH.
+ * Normally you will want to set ZLIB_NO_FLUSH to
+ * maximize compression, and ZLIB_FINISH to terminate
+ * with the last chunk of data. See the zlib manual for a
+ * detailed description of these constants.
+ * @return string Returns a chunk of compressed data.
+ * @throws ZlibException
+ *
+ */
+function deflate_add($context, string $data, int $flush_mode = ZLIB_SYNC_FLUSH): string
+{
+ error_clear_last();
+ $result = \deflate_add($context, $data, $flush_mode);
+ if ($result === false) {
+ throw ZlibException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Initializes an incremental deflate context using the specified
+ * encoding.
+ *
+ * Note that the window option here only sets the window size
+ * of the algorithm, differently from the zlib filters where the same parameter
+ * also sets the encoding to use; the encoding must be set with the
+ * encoding parameter.
+ *
+ * Limitation: there is currently no way to set the header information on a GZIP
+ * compressed stream, which are set as follows: GZIP signature
+ * (\x1f\x8B); compression method (\x08
+ * == DEFLATE); 6 zero bytes; the operating system set to the current system
+ * (\x00 = Windows, \x03 = Unix, etc.)
+ *
+ * @param int $encoding One of the ZLIB_ENCODING_* constants.
+ * @param array $options An associative array which may contain the following elements:
+ *
+ *
+ * level
+ *
+ *
+ * The compression level in range -1..9; defaults to -1.
+ *
+ *
+ *
+ *
+ * memory
+ *
+ *
+ * The compression memory level in range 1..9; defaults to 8.
+ *
+ *
+ *
+ *
+ * window
+ *
+ *
+ * The zlib window size (logarithmic) in range 8..15; defaults to 15.
+ *
+ *
+ *
+ *
+ * strategy
+ *
+ *
+ * One of ZLIB_FILTERED,
+ * ZLIB_HUFFMAN_ONLY, ZLIB_RLE,
+ * ZLIB_FIXED or
+ * ZLIB_DEFAULT_STRATEGY (the default).
+ *
+ *
+ *
+ *
+ * dictionary
+ *
+ *
+ * A string or an array of strings
+ * of the preset dictionary (default: no preset dictionary).
+ *
+ *
+ *
+ *
+ *
+ * The compression level in range -1..9; defaults to -1.
+ *
+ * The compression memory level in range 1..9; defaults to 8.
+ *
+ * The zlib window size (logarithmic) in range 8..15; defaults to 15.
+ *
+ * One of ZLIB_FILTERED,
+ * ZLIB_HUFFMAN_ONLY, ZLIB_RLE,
+ * ZLIB_FIXED or
+ * ZLIB_DEFAULT_STRATEGY (the default).
+ *
+ * A string or an array of strings
+ * of the preset dictionary (default: no preset dictionary).
+ * @return resource Returns a deflate context resource (zlib.deflate) on
+ * success.
+ * @throws ZlibException
+ *
+ */
+function deflate_init(int $encoding, array $options = null)
+{
+ error_clear_last();
+ $result = \deflate_init($encoding, $options);
+ if ($result === false) {
+ throw ZlibException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Closes the given gz-file pointer.
+ *
+ * @param resource $zp The gz-file pointer. It must be valid, and must point to a file
+ * successfully opened by gzopen.
+ * @throws ZlibException
+ *
+ */
+function gzclose($zp): void
+{
+ error_clear_last();
+ $result = \gzclose($zp);
+ if ($result === false) {
+ throw ZlibException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function compresses the given string using the ZLIB
+ * data format.
+ *
+ * For details on the ZLIB compression algorithm see the document
+ * "ZLIB Compressed Data Format
+ * Specification version 3.3" (RFC 1950).
+ *
+ * @param string $data The data to compress.
+ * @param int $level The level of compression. Can be given as 0 for no compression up to 9
+ * for maximum compression.
+ *
+ * If -1 is used, the default compression of the zlib library is used which is 6.
+ * @param int $encoding One of ZLIB_ENCODING_* constants.
+ * @return string The compressed string.
+ * @throws ZlibException
+ *
+ */
+function gzcompress(string $data, int $level = -1, int $encoding = ZLIB_ENCODING_DEFLATE): string
+{
+ error_clear_last();
+ $result = \gzcompress($data, $level, $encoding);
+ if ($result === false) {
+ throw ZlibException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * This function returns a decoded version of the input
+ * data.
+ *
+ * @param string $data The data to decode, encoded by gzencode.
+ * @param int $length The maximum length of data to decode.
+ * @return string The decoded string.
+ * @throws ZlibException
+ *
+ */
+function gzdecode(string $data, int $length = null): string
+{
+ error_clear_last();
+ if ($length !== null) {
+ $result = \gzdecode($data, $length);
+ } else {
+ $result = \gzdecode($data);
+ }
+ if ($result === false) {
+ throw ZlibException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * This function compresses the given string using the DEFLATE
+ * data format.
+ *
+ * For details on the DEFLATE compression algorithm see the document
+ * "DEFLATE Compressed Data Format
+ * Specification version 1.3" (RFC 1951).
+ *
+ * @param string $data The data to deflate.
+ * @param int $level The level of compression. Can be given as 0 for no compression up to 9
+ * for maximum compression. If not given, the default compression level will
+ * be the default compression level of the zlib library.
+ * @param int $encoding One of ZLIB_ENCODING_* constants.
+ * @return string The deflated string.
+ * @throws ZlibException
+ *
+ */
+function gzdeflate(string $data, int $level = -1, int $encoding = ZLIB_ENCODING_RAW): string
+{
+ error_clear_last();
+ $result = \gzdeflate($data, $level, $encoding);
+ if ($result === false) {
+ throw ZlibException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * This function returns a compressed version of the input
+ * data compatible with the output of the
+ * gzip program.
+ *
+ * For more information on the GZIP file format, see the document:
+ * GZIP file format specification
+ * version 4.3 (RFC 1952).
+ *
+ * @param string $data The data to encode.
+ * @param int $level The level of compression. Can be given as 0 for no compression up to 9
+ * for maximum compression. If not given, the default compression level will
+ * be the default compression level of the zlib library.
+ * @param int $encoding_mode The encoding mode. Can be FORCE_GZIP (the default)
+ * or FORCE_DEFLATE.
+ *
+ * Prior to PHP 5.4.0, using FORCE_DEFLATE results in
+ * a standard zlib deflated string (inclusive zlib headers) after a gzip
+ * file header but without the trailing crc32 checksum.
+ *
+ * In PHP 5.4.0 and later, FORCE_DEFLATE generates
+ * RFC 1950 compliant output, consisting of a zlib header, the deflated
+ * data, and an Adler checksum.
+ * @return string The encoded string.
+ * @throws ZlibException
+ *
+ */
+function gzencode(string $data, int $level = -1, int $encoding_mode = FORCE_GZIP): string
+{
+ error_clear_last();
+ $result = \gzencode($data, $level, $encoding_mode);
+ if ($result === false) {
+ throw ZlibException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Gets a (uncompressed) string of up to length - 1 bytes read from the given
+ * file pointer. Reading ends when length - 1 bytes have been read, on a
+ * newline, or on EOF (whichever comes first).
+ *
+ * @param resource $zp The gz-file pointer. It must be valid, and must point to a file
+ * successfully opened by gzopen.
+ * @param int $length The length of data to get.
+ * @return string The uncompressed string.
+ * @throws ZlibException
+ *
+ */
+function gzgets($zp, int $length = null): string
+{
+ error_clear_last();
+ if ($length !== null) {
+ $result = \gzgets($zp, $length);
+ } else {
+ $result = \gzgets($zp);
+ }
+ if ($result === false) {
+ throw ZlibException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Identical to gzgets, except that
+ * gzgetss attempts to strip any HTML and PHP
+ * tags from the text it reads.
+ *
+ * @param resource $zp The gz-file pointer. It must be valid, and must point to a file
+ * successfully opened by gzopen.
+ * @param int $length The length of data to get.
+ * @param string $allowable_tags You can use this optional parameter to specify tags which should not
+ * be stripped.
+ * @return string The uncompressed and stripped string.
+ * @throws ZlibException
+ *
+ */
+function gzgetss($zp, int $length, string $allowable_tags = null): string
+{
+ error_clear_last();
+ if ($allowable_tags !== null) {
+ $result = \gzgetss($zp, $length, $allowable_tags);
+ } else {
+ $result = \gzgetss($zp, $length);
+ }
+ if ($result === false) {
+ throw ZlibException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * This function inflates a deflated string.
+ *
+ * @param string $data The data compressed by gzdeflate.
+ * @param int $length The maximum length of data to decode.
+ * @return string The original uncompressed data.
+ *
+ * The function will return an error if the uncompressed data is more than
+ * 32768 times the length of the compressed input data
+ * or more than the optional parameter length.
+ * @throws ZlibException
+ *
+ */
+function gzinflate(string $data, int $length = 0): string
+{
+ error_clear_last();
+ $result = \gzinflate($data, $length);
+ if ($result === false) {
+ throw ZlibException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Reads to EOF on the given gz-file pointer from the current position and
+ * writes the (uncompressed) results to standard output.
+ *
+ * @param resource $zp The gz-file pointer. It must be valid, and must point to a file
+ * successfully opened by gzopen.
+ * @return int The number of uncompressed characters read from gz
+ * and passed through to the input.
+ * @throws ZlibException
+ *
+ */
+function gzpassthru($zp): int
+{
+ error_clear_last();
+ $result = \gzpassthru($zp);
+ if ($result === false) {
+ throw ZlibException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Sets the file position indicator of the given gz-file pointer to the
+ * beginning of the file stream.
+ *
+ * @param resource $zp The gz-file pointer. It must be valid, and must point to a file
+ * successfully opened by gzopen.
+ * @throws ZlibException
+ *
+ */
+function gzrewind($zp): void
+{
+ error_clear_last();
+ $result = \gzrewind($zp);
+ if ($result === false) {
+ throw ZlibException::createFromPhpError();
+ }
+}
+
+
+/**
+ * This function uncompress a compressed string.
+ *
+ * @param string $data The data compressed by gzcompress.
+ * @param int $length The maximum length of data to decode.
+ * @return string The original uncompressed data.
+ *
+ * The function will return an error if the uncompressed data is more than
+ * 32768 times the length of the compressed input data
+ * or more than the optional parameter length.
+ * @throws ZlibException
+ *
+ */
+function gzuncompress(string $data, int $length = 0): string
+{
+ error_clear_last();
+ $result = \gzuncompress($data, $length);
+ if ($result === false) {
+ throw ZlibException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ *
+ *
+ * @param resource $resource
+ * @return int Returns number of bytes read so far.
+ * @throws ZlibException
+ *
+ */
+function inflate_get_read_len($resource): int
+{
+ error_clear_last();
+ $result = \inflate_get_read_len($resource);
+ if ($result === false) {
+ throw ZlibException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Usually returns either ZLIB_OK or ZLIB_STREAM_END.
+ *
+ * @param resource $resource
+ * @return int Returns decompression status.
+ * @throws ZlibException
+ *
+ */
+function inflate_get_status($resource): int
+{
+ error_clear_last();
+ $result = \inflate_get_status($resource);
+ if ($result === false) {
+ throw ZlibException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Incrementally inflates encoded data in the specified context.
+ *
+ * Limitation: header information from GZIP compressed data are not made
+ * available.
+ *
+ * @param resource $context A context created with inflate_init.
+ * @param string $encoded_data A chunk of compressed data.
+ * @param int $flush_mode One of ZLIB_BLOCK,
+ * ZLIB_NO_FLUSH,
+ * ZLIB_PARTIAL_FLUSH,
+ * ZLIB_SYNC_FLUSH (default),
+ * ZLIB_FULL_FLUSH, ZLIB_FINISH.
+ * Normally you will want to set ZLIB_NO_FLUSH to
+ * maximize compression, and ZLIB_FINISH to terminate
+ * with the last chunk of data. See the zlib manual for a
+ * detailed description of these constants.
+ * @return string Returns a chunk of uncompressed data.
+ * @throws ZlibException
+ *
+ */
+function inflate_add($context, string $encoded_data, int $flush_mode = ZLIB_SYNC_FLUSH): string
+{
+ error_clear_last();
+ $result = \inflate_add($context, $encoded_data, $flush_mode);
+ if ($result === false) {
+ throw ZlibException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Initialize an incremental inflate context with the specified
+ * encoding.
+ *
+ * @param int $encoding One of the ZLIB_ENCODING_* constants.
+ * @param array $options An associative array which may contain the following elements:
+ *
+ *
+ * level
+ *
+ *
+ * The compression level in range -1..9; defaults to -1.
+ *
+ *
+ *
+ *
+ * memory
+ *
+ *
+ * The compression memory level in range 1..9; defaults to 8.
+ *
+ *
+ *
+ *
+ * window
+ *
+ *
+ * The zlib window size (logarithmic) in range 8..15; defaults to 15.
+ *
+ *
+ *
+ *
+ * strategy
+ *
+ *
+ * One of ZLIB_FILTERED,
+ * ZLIB_HUFFMAN_ONLY, ZLIB_RLE,
+ * ZLIB_FIXED or
+ * ZLIB_DEFAULT_STRATEGY (the default).
+ *
+ *
+ *
+ *
+ * dictionary
+ *
+ *
+ * A string or an array of strings
+ * of the preset dictionary (default: no preset dictionary).
+ *
+ *
+ *
+ *
+ *
+ * The compression level in range -1..9; defaults to -1.
+ *
+ * The compression memory level in range 1..9; defaults to 8.
+ *
+ * The zlib window size (logarithmic) in range 8..15; defaults to 15.
+ *
+ * One of ZLIB_FILTERED,
+ * ZLIB_HUFFMAN_ONLY, ZLIB_RLE,
+ * ZLIB_FIXED or
+ * ZLIB_DEFAULT_STRATEGY (the default).
+ *
+ * A string or an array of strings
+ * of the preset dictionary (default: no preset dictionary).
+ * @return resource Returns an inflate context resource (zlib.inflate) on
+ * success.
+ * @throws ZlibException
+ *
+ */
+function inflate_init(int $encoding, array $options = null)
+{
+ error_clear_last();
+ $result = \inflate_init($encoding, $options);
+ if ($result === false) {
+ throw ZlibException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Reads a file, decompresses it and writes it to standard output.
+ *
+ * readgzfile can be used to read a file which is not in
+ * gzip format; in this case readgzfile will directly
+ * read from the file without decompression.
+ *
+ * @param string $filename The file name. This file will be opened from the filesystem and its
+ * contents written to standard output.
+ * @param int $use_include_path You can set this optional parameter to 1, if you
+ * want to search for the file in the include_path too.
+ * @return int Returns the number of (uncompressed) bytes read from the file on success
+ * @throws ZlibException
+ *
+ */
+function readgzfile(string $filename, int $use_include_path = 0): int
+{
+ error_clear_last();
+ $result = \readgzfile($filename, $use_include_path);
+ if ($result === false) {
+ throw ZlibException::createFromPhpError();
+ }
+ return $result;
+}
+
+
+/**
+ * Uncompress any raw/gzip/zlib encoded data.
+ *
+ * @param string $data
+ * @param int $max_decoded_len
+ * @return string Returns the uncompressed data.
+ * @throws ZlibException
+ *
+ */
+function zlib_decode(string $data, int $max_decoded_len = null): string
+{
+ error_clear_last();
+ if ($max_decoded_len !== null) {
+ $result = \zlib_decode($data, $max_decoded_len);
+ } else {
+ $result = \zlib_decode($data);
+ }
+ if ($result === false) {
+ throw ZlibException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/lib/DateTime.php b/vendor/thecodingmachine/safe/lib/DateTime.php
new file mode 100644
index 000000000..581ef35c0
--- /dev/null
+++ b/vendor/thecodingmachine/safe/lib/DateTime.php
@@ -0,0 +1,81 @@
+<?php
+
+namespace Safe;
+
+use DateInterval;
+use DateTimeInterface;
+use DateTimeZone;
+use Safe\Exceptions\DatetimeException;
+
+/** this class implements a safe version of the Datetime class */
+class DateTime extends \DateTime
+{
+ //switch from regular datetime to safe version
+ private static function createFromRegular(\DateTime $datetime): self
+ {
+ return new self($datetime->format('Y-m-d H:i:s.u'), $datetime->getTimezone());
+ }
+
+ /**
+ * @param string $format
+ * @param string $time
+ * @param DateTimeZone|null $timezone
+ * @throws DatetimeException
+ */
+ public static function createFromFormat($format, $time, $timezone = null): self
+ {
+ $datetime = parent::createFromFormat($format, $time, $timezone);
+ if ($datetime === false) {
+ throw DatetimeException::createFromPhpError();
+ }
+ return self::createFromRegular($datetime);
+ }
+
+ /**
+ * @param DateTimeInterface $datetime2 The date to compare to.
+ * @param boolean $absolute [optional] Whether to return absolute difference.
+ * @return DateInterval The DateInterval object representing the difference between the two dates.
+ * @throws DatetimeException
+ */
+ public function diff($datetime2, $absolute = false): DateInterval
+ {
+ /** @var \DateInterval|false $result */
+ $result = parent::diff($datetime2, $absolute);
+ if ($result === false) {
+ throw DatetimeException::createFromPhpError();
+ }
+ return $result;
+ }
+
+ /**
+ * @param string $modify A date/time string. Valid formats are explained in <a href="https://secure.php.net/manual/en/datetime.formats.php">Date and Time Formats</a>.
+ * @return DateTime Returns the DateTime object for method chaining.
+ * @throws DatetimeException
+ */
+ public function modify($modify): self
+ {
+ /** @var DateTime|false $result */
+ $result = parent::modify($modify);
+ if ($result === false) {
+ throw DatetimeException::createFromPhpError();
+ }
+ return $result;
+ }
+
+ /**
+ * @param int $year
+ * @param int $month
+ * @param int $day
+ * @return DateTime
+ * @throws DatetimeException
+ */
+ public function setDate($year, $month, $day): self
+ {
+ /** @var DateTime|false $result */
+ $result = parent::setDate($year, $month, $day);
+ if ($result === false) {
+ throw DatetimeException::createFromPhpError();
+ }
+ return $result;
+ }
+}
diff --git a/vendor/thecodingmachine/safe/lib/DateTimeImmutable.php b/vendor/thecodingmachine/safe/lib/DateTimeImmutable.php
new file mode 100644
index 000000000..114ec3a3d
--- /dev/null
+++ b/vendor/thecodingmachine/safe/lib/DateTimeImmutable.php
@@ -0,0 +1,262 @@
+<?php
+
+namespace Safe;
+
+use DateInterval;
+use DateTime;
+use DateTimeInterface;
+use DateTimeZone;
+use Safe\Exceptions\DatetimeException;
+
+/**
+ * This class is used to implement a safe version of the DatetimeImmutable class.
+ * While it technically overloads \DateTimeImmutable for typehint compatibility,
+ * it is actually used as a wrapper of \DateTimeImmutable, mostly to be able to overwrite functions like getTimestamp() while still being able to edit milliseconds via setTime().
+ */
+class DateTimeImmutable extends \DateTimeImmutable
+{
+ /**
+ * @var \DateTimeImmutable
+ */
+ private $innerDateTime;
+
+ /**
+ * DateTimeImmutable constructor.
+ * @param string $time
+ * @param DateTimeZone|null $timezone
+ * @throws \Exception
+ */
+ public function __construct($time = 'now', $timezone = null)
+ {
+ parent::__construct($time, $timezone);
+ $this->innerDateTime = new parent($time, $timezone);
+ }
+
+ //switch between regular datetime and safe version
+ public static function createFromRegular(\DateTimeImmutable $datetime): self
+ {
+ $safeDatetime = new self($datetime->format('Y-m-d H:i:s.u'), $datetime->getTimezone()); //we need to also update the wrapper to not break the operators '<' and '>'
+ $safeDatetime->innerDateTime = $datetime; //to make sure we don't lose information because of the format().
+ return $safeDatetime;
+ }
+
+ //usefull if you need to switch back to regular DateTimeImmutable (for example when using DatePeriod)
+ public function getInnerDateTime(): \DateTimeImmutable
+ {
+ return $this->innerDateTime;
+ }
+
+ /////////////////////////////////////////////////////////////////////////////
+ // overload functions with false errors
+
+ /**
+ * @param string $format
+ * @param string $time
+ * @param DateTimeZone|null $timezone
+ * @throws DatetimeException
+ */
+ public static function createFromFormat($format, $time, $timezone = null): self
+ {
+ $datetime = parent::createFromFormat($format, $time, $timezone);
+ if ($datetime === false) {
+ throw DatetimeException::createFromPhpError();
+ }
+ return self::createFromRegular($datetime);
+ }
+
+ /**
+ * @param string $format
+ * @return string
+ * @throws DatetimeException
+ */
+ public function format($format): string
+ {
+ /** @var string|false $result */
+ $result = $this->innerDateTime->format($format);
+ if ($result === false) {
+ throw DatetimeException::createFromPhpError();
+ }
+ return $result;
+ }
+
+ /**
+ * @param DateTimeInterface $datetime2
+ * @param bool $absolute
+ * @return DateInterval
+ * @throws DatetimeException
+ */
+ public function diff($datetime2, $absolute = false): DateInterval
+ {
+ /** @var \DateInterval|false $result */
+ $result = $this->innerDateTime->diff($datetime2, $absolute);
+ if ($result === false) {
+ throw DatetimeException::createFromPhpError();
+ }
+ return $result;
+ }
+
+ /**
+ * @param string $modify
+ * @return DateTimeImmutable
+ * @throws DatetimeException
+ */
+ public function modify($modify): self
+ {
+ /** @var \DateTimeImmutable|false $result */
+ $result = $this->innerDateTime->modify($modify);
+ if ($result === false) {
+ throw DatetimeException::createFromPhpError();
+ }
+ return self::createFromRegular($result); //we have to recreate a safe datetime because modify create a new instance of \DateTimeImmutable
+ }
+
+ /**
+ * @param int $year
+ * @param int $month
+ * @param int $day
+ * @return DateTimeImmutable
+ * @throws DatetimeException
+ */
+ public function setDate($year, $month, $day): self
+ {
+ /** @var \DateTimeImmutable|false $result */
+ $result = $this->innerDateTime->setDate($year, $month, $day);
+ if ($result === false) {
+ throw DatetimeException::createFromPhpError();
+ }
+ return self::createFromRegular($result); //we have to recreate a safe datetime because modify create a new instance of \DateTimeImmutable
+ }
+
+ /**
+ * @param int $year
+ * @param int $week
+ * @param int $day
+ * @return DateTimeImmutable
+ * @throws DatetimeException
+ */
+ public function setISODate($year, $week, $day = 1): self
+ {
+ /** @var \DateTimeImmutable|false $result */
+ $result = $this->innerDateTime->setISODate($year, $week, $day);
+ if ($result === false) {
+ throw DatetimeException::createFromPhpError();
+ }
+ return self::createFromRegular($result); //we have to recreate a safe datetime because modify create a new instance of \DateTimeImmutable
+ }
+
+ /**
+ * @param int $hour
+ * @param int $minute
+ * @param int $second
+ * @param int $microseconds
+ * @return DateTimeImmutable
+ * @throws DatetimeException
+ */
+ public function setTime($hour, $minute, $second = 0, $microseconds = 0): self
+ {
+ /** @var \DateTimeImmutable|false $result */
+ $result = $this->innerDateTime->setTime($hour, $minute, $second, $microseconds);
+ if ($result === false) {
+ throw DatetimeException::createFromPhpError();
+ }
+ return self::createFromRegular($result);
+ }
+
+ /**
+ * @param int $unixtimestamp
+ * @return DateTimeImmutable
+ * @throws DatetimeException
+ */
+ public function setTimestamp($unixtimestamp): self
+ {
+ /** @var \DateTimeImmutable|false $result */
+ $result = $this->innerDateTime->setTimestamp($unixtimestamp);
+ if ($result === false) {
+ throw DatetimeException::createFromPhpError();
+ }
+ return self::createFromRegular($result);
+ }
+
+ /**
+ * @param DateTimeZone $timezone
+ * @return DateTimeImmutable
+ * @throws DatetimeException
+ */
+ public function setTimezone($timezone): self
+ {
+ /** @var \DateTimeImmutable|false $result */
+ $result = $this->innerDateTime->setTimezone($timezone);
+ if ($result === false) {
+ throw DatetimeException::createFromPhpError();
+ }
+ return self::createFromRegular($result);
+ }
+
+ /**
+ * @param DateInterval $interval
+ * @return DateTimeImmutable
+ * @throws DatetimeException
+ */
+ public function sub($interval): self
+ {
+ /** @var \DateTimeImmutable|false $result */
+ $result = $this->innerDateTime->sub($interval);
+ if ($result === false) {
+ throw DatetimeException::createFromPhpError();
+ }
+ return self::createFromRegular($result);
+ }
+
+ /**
+ * @throws DatetimeException
+ */
+ public function getOffset(): int
+ {
+ /** @var int|false $result */
+ $result = $this->innerDateTime->getOffset();
+ if ($result === false) {
+ throw DatetimeException::createFromPhpError();
+ }
+ return $result;
+ }
+
+ //////////////////////////////////////////////////////////////////////////////////////////
+ //overload getters to use the inner datetime immutable instead of itself
+
+ /**
+ * @param DateInterval $interval
+ * @return DateTimeImmutable
+ */
+ public function add($interval): self
+ {
+ return self::createFromRegular($this->innerDateTime->add($interval));
+ }
+
+ /**
+ * @param DateTime $dateTime
+ * @return DateTimeImmutable
+ */
+ public static function createFromMutable($dateTime): self
+ {
+ return self::createFromRegular(parent::createFromMutable($dateTime));
+ }
+
+ /**
+ * @param mixed[] $array
+ * @return DateTimeImmutable
+ */
+ public static function __set_state($array): self
+ {
+ return self::createFromRegular(parent::__set_state($array));
+ }
+
+ public function getTimezone(): DateTimeZone
+ {
+ return $this->innerDateTime->getTimezone();
+ }
+
+ public function getTimestamp(): int
+ {
+ return $this->innerDateTime->getTimestamp();
+ }
+}
diff --git a/vendor/thecodingmachine/safe/lib/Exceptions/CurlException.php b/vendor/thecodingmachine/safe/lib/Exceptions/CurlException.php
new file mode 100644
index 000000000..2814066b0
--- /dev/null
+++ b/vendor/thecodingmachine/safe/lib/Exceptions/CurlException.php
@@ -0,0 +1,15 @@
+<?php
+
+
+namespace Safe\Exceptions;
+
+class CurlException extends \Exception implements SafeExceptionInterface
+{
+ /**
+ * @param resource $ch
+ */
+ public static function createFromCurlResource($ch): self
+ {
+ return new self(\curl_error($ch), \curl_errno($ch));
+ }
+}
diff --git a/vendor/thecodingmachine/safe/lib/Exceptions/JsonException.php b/vendor/thecodingmachine/safe/lib/Exceptions/JsonException.php
new file mode 100644
index 000000000..4300d29e9
--- /dev/null
+++ b/vendor/thecodingmachine/safe/lib/Exceptions/JsonException.php
@@ -0,0 +1,12 @@
+<?php
+
+
+namespace Safe\Exceptions;
+
+class JsonException extends \Exception implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ return new self(\json_last_error_msg(), \json_last_error());
+ }
+}
diff --git a/vendor/thecodingmachine/safe/lib/Exceptions/OpensslException.php b/vendor/thecodingmachine/safe/lib/Exceptions/OpensslException.php
new file mode 100644
index 000000000..5f424af2d
--- /dev/null
+++ b/vendor/thecodingmachine/safe/lib/Exceptions/OpensslException.php
@@ -0,0 +1,12 @@
+<?php
+
+
+namespace Safe\Exceptions;
+
+class OpensslException extends \Exception implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ return new self(\openssl_error_string() ?: '', 0);
+ }
+}
diff --git a/vendor/thecodingmachine/safe/lib/Exceptions/PcreException.php b/vendor/thecodingmachine/safe/lib/Exceptions/PcreException.php
new file mode 100644
index 000000000..ee6367ef6
--- /dev/null
+++ b/vendor/thecodingmachine/safe/lib/Exceptions/PcreException.php
@@ -0,0 +1,21 @@
+<?php
+
+
+namespace Safe\Exceptions;
+
+class PcreException extends \Exception implements SafeExceptionInterface
+{
+ public static function createFromPhpError(): self
+ {
+ $errorMap = [
+ PREG_INTERNAL_ERROR => 'PREG_INTERNAL_ERROR: Internal error',
+ PREG_BACKTRACK_LIMIT_ERROR => 'PREG_BACKTRACK_LIMIT_ERROR: Backtrack limit reached',
+ PREG_RECURSION_LIMIT_ERROR => 'PREG_RECURSION_LIMIT_ERROR: Recursion limit reached',
+ PREG_BAD_UTF8_ERROR => 'PREG_BAD_UTF8_ERROR: Invalid UTF8 character',
+ PREG_BAD_UTF8_OFFSET_ERROR => 'PREG_BAD_UTF8_OFFSET_ERROR',
+ PREG_JIT_STACKLIMIT_ERROR => 'PREG_JIT_STACKLIMIT_ERROR',
+ ];
+ $errMsg = $errorMap[preg_last_error()] ?? 'Unknown PCRE error: '.preg_last_error();
+ return new self($errMsg, \preg_last_error());
+ }
+}
diff --git a/vendor/thecodingmachine/safe/lib/Exceptions/SafeExceptionInterface.php b/vendor/thecodingmachine/safe/lib/Exceptions/SafeExceptionInterface.php
new file mode 100644
index 000000000..fbea6ad25
--- /dev/null
+++ b/vendor/thecodingmachine/safe/lib/Exceptions/SafeExceptionInterface.php
@@ -0,0 +1,9 @@
+<?php
+
+
+namespace Safe\Exceptions;
+
+interface SafeExceptionInterface extends \Throwable
+{
+
+}
diff --git a/vendor/thecodingmachine/safe/lib/special_cases.php b/vendor/thecodingmachine/safe/lib/special_cases.php
new file mode 100644
index 000000000..d18e2118b
--- /dev/null
+++ b/vendor/thecodingmachine/safe/lib/special_cases.php
@@ -0,0 +1,241 @@
+<?php
+/**
+ * This file contains all the functions that could not be dealt with automatically using the code generator.
+ * If you add a function in this list, do not forget to add it in the generator/config/specialCasesFunctions.php
+ *
+ */
+
+namespace Safe;
+
+use Safe\Exceptions\SocketsException;
+use const PREG_NO_ERROR;
+use Safe\Exceptions\ApcException;
+use Safe\Exceptions\ApcuException;
+use Safe\Exceptions\JsonException;
+use Safe\Exceptions\OpensslException;
+use Safe\Exceptions\PcreException;
+
+/**
+ * Wrapper for json_decode that throws when an error occurs.
+ *
+ * @param string $json JSON data to parse
+ * @param bool $assoc When true, returned objects will be converted
+ * into associative arrays.
+ * @param int $depth User specified recursion depth.
+ * @param int $options Bitmask of JSON decode options.
+ *
+ * @return mixed
+ * @throws JsonException if the JSON cannot be decoded.
+ * @link http://www.php.net/manual/en/function.json-decode.php
+ */
+function json_decode(string $json, bool $assoc = false, int $depth = 512, int $options = 0)
+{
+ $data = \json_decode($json, $assoc, $depth, $options);
+ if (JSON_ERROR_NONE !== json_last_error()) {
+ throw JsonException::createFromPhpError();
+ }
+ return $data;
+}
+
+
+/**
+ * Fetchs a stored variable from the cache.
+ *
+ * @param mixed $key The key used to store the value (with
+ * apc_store). If an array is passed then each
+ * element is fetched and returned.
+ * @return mixed The stored variable or array of variables on success; FALSE on failure
+ * @throws ApcException
+ *
+ */
+function apc_fetch($key)
+{
+ error_clear_last();
+ $result = \apc_fetch($key, $success);
+ if ($success === false) {
+ throw ApcException::createFromPhpError();
+ }
+ return $result;
+}
+
+/**
+ * Fetchs an entry from the cache.
+ *
+ * @param string|string[] $key The key used to store the value (with
+ * apcu_store). If an array is passed then each
+ * element is fetched and returned.
+ * @return mixed The stored variable or array of variables on success
+ * @throws ApcuException
+ *
+ */
+function apcu_fetch($key)
+{
+ error_clear_last();
+ $result = \apcu_fetch($key, $success);
+ if ($success === false) {
+ throw ApcuException::createFromPhpError();
+ }
+ return $result;
+}
+
+/**
+ * Searches subject for matches to
+ * pattern and replaces them with
+ * replacement.
+ *
+ * @param mixed $pattern The pattern to search for. It can be either a string or an array with
+ * strings.
+ *
+ * Several PCRE modifiers
+ * are also available.
+ * @param mixed $replacement The string or an array with strings to replace. If this parameter is a
+ * string and the pattern parameter is an array,
+ * all patterns will be replaced by that string. If both
+ * pattern and replacement
+ * parameters are arrays, each pattern will be
+ * replaced by the replacement counterpart. If
+ * there are fewer elements in the replacement
+ * array than in the pattern array, any extra
+ * patterns will be replaced by an empty string.
+ *
+ * replacement may contain references of the form
+ * \\n or
+ * $n, with the latter form
+ * being the preferred one. Every such reference will be replaced by the text
+ * captured by the n'th parenthesized pattern.
+ * n can be from 0 to 99, and
+ * \\0 or $0 refers to the text matched
+ * by the whole pattern. Opening parentheses are counted from left to right
+ * (starting from 1) to obtain the number of the capturing subpattern.
+ * To use backslash in replacement, it must be doubled
+ * ("\\\\" PHP string).
+ *
+ * When working with a replacement pattern where a backreference is
+ * immediately followed by another number (i.e.: placing a literal number
+ * immediately after a matched pattern), you cannot use the familiar
+ * \\1 notation for your backreference.
+ * \\11, for example, would confuse
+ * preg_replace since it does not know whether you
+ * want the \\1 backreference followed by a literal
+ * 1, or the \\11 backreference
+ * followed by nothing. In this case the solution is to use
+ * ${1}1. This creates an isolated
+ * $1 backreference, leaving the 1
+ * as a literal.
+ *
+ * When using the deprecated e modifier, this function escapes
+ * some characters (namely ', ",
+ * \ and NULL) in the strings that replace the
+ * backreferences. This is done to ensure that no syntax errors arise
+ * from backreference usage with either single or double quotes (e.g.
+ * 'strlen(\'$1\')+strlen("$2")'). Make sure you are
+ * aware of PHP's string
+ * syntax to know exactly how the interpreted string will look.
+ * @param string|array|string[] $subject The string or an array with strings to search and replace.
+ *
+ * If subject is an array, then the search and
+ * replace is performed on every entry of subject,
+ * and the return value is an array as well.
+ * @param int $limit The maximum possible replacements for each pattern in each
+ * subject string. Defaults to
+ * -1 (no limit).
+ * @param int $count If specified, this variable will be filled with the number of
+ * replacements done.
+ * @return string|array|string[] preg_replace returns an array if the
+ * subject parameter is an array, or a string
+ * otherwise.
+ *
+ * If matches are found, the new subject will
+ * be returned, otherwise subject will be
+ * returned unchanged.
+ *
+ * @throws PcreException
+ *
+ */
+function preg_replace($pattern, $replacement, $subject, int $limit = -1, int &$count = null)
+{
+ error_clear_last();
+ $result = \preg_replace($pattern, $replacement, $subject, $limit, $count);
+ if (preg_last_error() !== PREG_NO_ERROR || $result === null) {
+ throw PcreException::createFromPhpError();
+ }
+ return $result;
+}
+
+/**
+ * @param resource|null $dir_handle
+ * @return string|false
+ * @deprecated
+ * This function is only in safe because the php documentation is wrong
+ */
+function readdir($dir_handle = null)
+{
+ if ($dir_handle !== null) {
+ $result = \readdir($dir_handle);
+ } else {
+ $result = \readdir();
+ }
+ return $result;
+}
+
+/**
+ * Encrypts given data with given method and key, returns a raw
+ * or base64 encoded string
+ *
+ * @param string $data The plaintext message data to be encrypted.
+ * @param string $method The cipher method. For a list of available cipher methods, use openssl_get_cipher_methods.
+ * @param string $key The key.
+ * @param int $options options is a bitwise disjunction of the flags
+ * OPENSSL_RAW_DATA and
+ * OPENSSL_ZERO_PADDING.
+ * @param string $iv A non-NULL Initialization Vector.
+ * @param string $tag The authentication tag passed by reference when using AEAD cipher mode (GCM or CCM).
+ * @param string $aad Additional authentication data.
+ * @param int $tag_length The length of the authentication tag. Its value can be between 4 and 16 for GCM mode.
+ * @return string Returns the encrypted string.
+ * @throws OpensslException
+ *
+ */
+function openssl_encrypt(string $data, string $method, string $key, int $options = 0, string $iv = "", string &$tag = "", string $aad = "", int $tag_length = 16): string
+{
+ error_clear_last();
+ // The $tag parameter is handled in a weird way by openssl_encrypt. It cannot be provided unless encoding is AEAD
+ if (func_num_args() <= 5) {
+ $result = \openssl_encrypt($data, $method, $key, $options, $iv);
+ } else {
+ $result = \openssl_encrypt($data, $method, $key, $options, $iv, $tag, $aad, $tag_length);
+ }
+ if ($result === false) {
+ throw OpensslException::createFromPhpError();
+ }
+ return $result;
+}
+
+/**
+ * The function socket_write writes to the
+ * socket from the given
+ * buffer.
+ *
+ * @param resource $socket
+ * @param string $buffer The buffer to be written.
+ * @param int $length The optional parameter length can specify an
+ * alternate length of bytes written to the socket. If this length is
+ * greater than the buffer length, it is silently truncated to the length
+ * of the buffer.
+ * @return int Returns the number of bytes successfully written to the socket.
+ * The error code can be retrieved with
+ * socket_last_error. This code may be passed to
+ * socket_strerror to get a textual explanation of the
+ * error.
+ * @throws SocketsException
+ *
+ */
+function socket_write($socket, string $buffer, int $length = 0): int
+{
+ error_clear_last();
+ $result = $length === 0 ? \socket_write($socket, $buffer) : \socket_write($socket, $buffer, $length);
+ if ($result === false) {
+ throw SocketsException::createFromPhpError();
+ }
+ return $result;
+}
diff --git a/vendor/thecodingmachine/safe/rector-migrate-0.7.php b/vendor/thecodingmachine/safe/rector-migrate-0.7.php
new file mode 100644
index 000000000..d1c599700
--- /dev/null
+++ b/vendor/thecodingmachine/safe/rector-migrate-0.7.php
@@ -0,0 +1,1081 @@
+<?php
+
+declare(strict_types=1);
+
+use Rector\Renaming\Rector\FuncCall\RenameFunctionRector;
+use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
+
+# This file configures rector/rector:~0.7.0 to replace all PHP functions with their equivalent "safe" functions
+return static function (ContainerConfigurator $containerConfigurator): void {
+ $services = $containerConfigurator->services();
+
+ $services->set(RenameFunctionRector::class)
+ ->call('configure', [[ RenameFunctionRector::OLD_FUNCTION_TO_NEW_FUNCTION => [
+ 'apache_getenv' => 'Safe\apache_getenv',
+ 'apache_get_version' => 'Safe\apache_get_version',
+ 'apache_request_headers' => 'Safe\apache_request_headers',
+ 'apache_reset_timeout' => 'Safe\apache_reset_timeout',
+ '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',
+ 'arsort' => 'Safe\arsort',
+ 'asort' => 'Safe\asort',
+ 'base64_decode' => 'Safe\base64_decode',
+ '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_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',
+ 'convert_uuencode' => 'Safe\convert_uuencode',
+ 'copy' => 'Safe\copy',
+ 'create_function' => 'Safe\create_function',
+ 'cubrid_free_result' => 'Safe\cubrid_free_result',
+ 'cubrid_get_charset' => 'Safe\cubrid_get_charset',
+ 'cubrid_get_client_info' => 'Safe\cubrid_get_client_info',
+ 'cubrid_get_db_parameter' => 'Safe\cubrid_get_db_parameter',
+ 'cubrid_get_server_info' => 'Safe\cubrid_get_server_info',
+ 'cubrid_insert_id' => 'Safe\cubrid_insert_id',
+ 'cubrid_lob2_new' => 'Safe\cubrid_lob2_new',
+ '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_set_db_parameter' => 'Safe\cubrid_set_db_parameter',
+ 'curl_escape' => 'Safe\curl_escape',
+ 'curl_exec' => 'Safe\curl_exec',
+ 'curl_getinfo' => 'Safe\curl_getinfo',
+ 'curl_init' => 'Safe\curl_init',
+ 'curl_multi_errno' => 'Safe\curl_multi_errno',
+ 'curl_multi_info_read' => 'Safe\curl_multi_info_read',
+ 'curl_multi_init' => 'Safe\curl_multi_init',
+ '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' => '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_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',
+ 'fastcgi_finish_request' => 'Safe\fastcgi_finish_request',
+ 'fbird_blob_cancel' => 'Safe\fbird_blob_cancel',
+ 'fclose' => 'Safe\fclose',
+ 'fflush' => 'Safe\fflush',
+ 'file' => 'Safe\file',
+ 'fileatime' => 'Safe\fileatime',
+ 'filectime' => 'Safe\filectime',
+ 'fileinode' => 'Safe\fileinode',
+ 'filemtime' => 'Safe\filemtime',
+ 'fileowner' => 'Safe\fileowner',
+ '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',
+ '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_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',
+ 'get_headers' => 'Safe\get_headers',
+ 'glob' => 'Safe\glob',
+ 'gmdate' => 'Safe\gmdate',
+ 'gmp_binomial' => 'Safe\gmp_binomial',
+ 'gmp_export' => 'Safe\gmp_export',
+ 'gmp_import' => 'Safe\gmp_import',
+ 'gmp_random_seed' => 'Safe\gmp_random_seed',
+ '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',
+ 'gzgets' => 'Safe\gzgets',
+ 'gzgetss' => 'Safe\gzgetss',
+ 'gzinflate' => 'Safe\gzinflate',
+ 'gzpassthru' => 'Safe\gzpassthru',
+ 'gzrewind' => 'Safe\gzrewind',
+ 'gzuncompress' => 'Safe\gzuncompress',
+ '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',
+ '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',
+ 'image2wbmp' => 'Safe\image2wbmp',
+ 'imageaffine' => 'Safe\imageaffine',
+ 'imageaffinematrixconcat' => 'Safe\imageaffinematrixconcat',
+ 'imageaffinematrixget' => 'Safe\imageaffinematrixget',
+ 'imagealphablending' => 'Safe\imagealphablending',
+ 'imageantialias' => 'Safe\imageantialias',
+ 'imagearc' => 'Safe\imagearc',
+ 'imagebmp' => 'Safe\imagebmp',
+ 'imagechar' => 'Safe\imagechar',
+ 'imagecharup' => 'Safe\imagecharup',
+ 'imagecolorat' => 'Safe\imagecolorat',
+ 'imagecolordeallocate' => 'Safe\imagecolordeallocate',
+ 'imagecolormatch' => 'Safe\imagecolormatch',
+ 'imageconvolution' => 'Safe\imageconvolution',
+ 'imagecopy' => 'Safe\imagecopy',
+ 'imagecopymerge' => 'Safe\imagecopymerge',
+ 'imagecopymergegray' => 'Safe\imagecopymergegray',
+ 'imagecopyresampled' => 'Safe\imagecopyresampled',
+ 'imagecopyresized' => 'Safe\imagecopyresized',
+ 'imagecreate' => 'Safe\imagecreate',
+ 'imagecreatefrombmp' => 'Safe\imagecreatefrombmp',
+ 'imagecreatefromgd' => 'Safe\imagecreatefromgd',
+ 'imagecreatefromgd2' => 'Safe\imagecreatefromgd2',
+ 'imagecreatefromgd2part' => 'Safe\imagecreatefromgd2part',
+ 'imagecreatefromgif' => 'Safe\imagecreatefromgif',
+ 'imagecreatefromjpeg' => 'Safe\imagecreatefromjpeg',
+ 'imagecreatefrompng' => 'Safe\imagecreatefrompng',
+ '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',
+ 'imagefilledpolygon' => 'Safe\imagefilledpolygon',
+ 'imagefilledrectangle' => 'Safe\imagefilledrectangle',
+ 'imagefilltoborder' => 'Safe\imagefilltoborder',
+ 'imagefilter' => 'Safe\imagefilter',
+ 'imageflip' => 'Safe\imageflip',
+ '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',
+ 'imageopenpolygon' => 'Safe\imageopenpolygon',
+ 'imagepng' => 'Safe\imagepng',
+ 'imagepolygon' => 'Safe\imagepolygon',
+ 'imagerectangle' => 'Safe\imagerectangle',
+ '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',
+ 'imap_append' => 'Safe\imap_append',
+ '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_fetchstructure' => 'Safe\imap_fetchstructure',
+ 'imap_gc' => 'Safe\imap_gc',
+ 'imap_headerinfo' => 'Safe\imap_headerinfo',
+ '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_mutf7_to_utf8' => 'Safe\imap_mutf7_to_utf8',
+ 'imap_num_msg' => 'Safe\imap_num_msg',
+ 'imap_open' => 'Safe\imap_open',
+ 'imap_renamemailbox' => 'Safe\imap_renamemailbox',
+ '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_subscribe' => 'Safe\imap_subscribe',
+ 'imap_thread' => 'Safe\imap_thread',
+ 'imap_timeout' => 'Safe\imap_timeout',
+ 'imap_undelete' => 'Safe\imap_undelete',
+ 'imap_unsubscribe' => 'Safe\imap_unsubscribe',
+ 'imap_utf8_to_mutf7' => 'Safe\imap_utf8_to_mutf7',
+ 'inet_ntop' => 'Safe\inet_ntop',
+ 'inflate_add' => 'Safe\inflate_add',
+ 'inflate_get_read_len' => 'Safe\inflate_get_read_len',
+ 'inflate_get_status' => 'Safe\inflate_get_status',
+ 'inflate_init' => 'Safe\inflate_init',
+ 'ingres_autocommit' => 'Safe\ingres_autocommit',
+ 'ingres_close' => 'Safe\ingres_close',
+ 'ingres_commit' => 'Safe\ingres_commit',
+ 'ingres_connect' => 'Safe\ingres_connect',
+ 'ingres_execute' => 'Safe\ingres_execute',
+ 'ingres_field_name' => 'Safe\ingres_field_name',
+ 'ingres_field_type' => 'Safe\ingres_field_type',
+ 'ingres_free_result' => 'Safe\ingres_free_result',
+ 'ingres_pconnect' => 'Safe\ingres_pconnect',
+ 'ingres_result_seek' => 'Safe\ingres_result_seek',
+ 'ingres_rollback' => 'Safe\ingres_rollback',
+ 'ingres_set_environment' => 'Safe\ingres_set_environment',
+ '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',
+ 'jdtounix' => 'Safe\jdtounix',
+ 'jpeg2wbmp' => 'Safe\jpeg2wbmp',
+ 'json_decode' => 'Safe\json_decode',
+ 'json_encode' => 'Safe\json_encode',
+ 'json_last_error_msg' => 'Safe\json_last_error_msg',
+ 'krsort' => 'Safe\krsort',
+ 'ksort' => 'Safe\ksort',
+ 'lchgrp' => 'Safe\lchgrp',
+ 'lchown' => 'Safe\lchown',
+ 'ldap_add' => 'Safe\ldap_add',
+ 'ldap_add_ext' => 'Safe\ldap_add_ext',
+ 'ldap_bind' => 'Safe\ldap_bind',
+ 'ldap_bind_ext' => 'Safe\ldap_bind_ext',
+ '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_delete_ext' => 'Safe\ldap_delete_ext',
+ '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_list' => 'Safe\ldap_list',
+ 'ldap_modify_batch' => 'Safe\ldap_modify_batch',
+ 'ldap_mod_add' => 'Safe\ldap_mod_add',
+ 'ldap_mod_add_ext' => 'Safe\ldap_mod_add_ext',
+ 'ldap_mod_del' => 'Safe\ldap_mod_del',
+ 'ldap_mod_del_ext' => 'Safe\ldap_mod_del_ext',
+ 'ldap_mod_replace' => 'Safe\ldap_mod_replace',
+ 'ldap_mod_replace_ext' => 'Safe\ldap_mod_replace_ext',
+ 'ldap_next_attribute' => 'Safe\ldap_next_attribute',
+ 'ldap_parse_exop' => 'Safe\ldap_parse_exop',
+ 'ldap_parse_result' => 'Safe\ldap_parse_result',
+ 'ldap_read' => 'Safe\ldap_read',
+ 'ldap_rename' => 'Safe\ldap_rename',
+ 'ldap_rename_ext' => 'Safe\ldap_rename_ext',
+ 'ldap_sasl_bind' => 'Safe\ldap_sasl_bind',
+ 'ldap_search' => 'Safe\ldap_search',
+ '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',
+ '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_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_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',
+ 'mb_str_split' => 'Safe\mb_str_split',
+ 'md5_file' => 'Safe\md5_file',
+ 'metaphone' => 'Safe\metaphone',
+ 'mime_content_type' => 'Safe\mime_content_type',
+ 'mkdir' => 'Safe\mkdir',
+ 'mktime' => 'Safe\mktime',
+ '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',
+ 'msql_affected_rows' => 'Safe\msql_affected_rows',
+ 'msql_close' => 'Safe\msql_close',
+ 'msql_connect' => 'Safe\msql_connect',
+ 'msql_create_db' => 'Safe\msql_create_db',
+ 'msql_data_seek' => 'Safe\msql_data_seek',
+ 'msql_db_query' => 'Safe\msql_db_query',
+ 'msql_drop_db' => 'Safe\msql_drop_db',
+ 'msql_field_len' => 'Safe\msql_field_len',
+ 'msql_field_name' => 'Safe\msql_field_name',
+ 'msql_field_seek' => 'Safe\msql_field_seek',
+ 'msql_field_table' => 'Safe\msql_field_table',
+ 'msql_field_type' => 'Safe\msql_field_type',
+ 'msql_free_result' => 'Safe\msql_free_result',
+ 'msql_pconnect' => 'Safe\msql_pconnect',
+ 'msql_query' => 'Safe\msql_query',
+ 'msql_select_db' => 'Safe\msql_select_db',
+ 'mysqli_get_cache_stats' => 'Safe\mysqli_get_cache_stats',
+ 'mysqli_get_client_stats' => 'Safe\mysqli_get_client_stats',
+ 'mysqlnd_ms_dump_servers' => 'Safe\mysqlnd_ms_dump_servers',
+ 'mysqlnd_ms_fabric_select_global' => 'Safe\mysqlnd_ms_fabric_select_global',
+ 'mysqlnd_ms_fabric_select_shard' => 'Safe\mysqlnd_ms_fabric_select_shard',
+ 'mysqlnd_ms_get_last_used_connection' => 'Safe\mysqlnd_ms_get_last_used_connection',
+ 'mysqlnd_qc_clear_cache' => 'Safe\mysqlnd_qc_clear_cache',
+ 'mysqlnd_qc_set_is_select' => 'Safe\mysqlnd_qc_set_is_select',
+ 'mysqlnd_qc_set_storage_handler' => 'Safe\mysqlnd_qc_set_storage_handler',
+ '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',
+ 'natcasesort' => 'Safe\natcasesort',
+ 'natsort' => 'Safe\natsort',
+ 'ob_end_clean' => 'Safe\ob_end_clean',
+ 'ob_end_flush' => 'Safe\ob_end_flush',
+ '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_close' => 'Safe\oci_close',
+ '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_fetch_all' => 'Safe\oci_fetch_all',
+ '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_fields' => 'Safe\oci_num_fields',
+ 'oci_num_rows' => 'Safe\oci_num_rows',
+ 'oci_parse' => 'Safe\oci_parse',
+ 'oci_pconnect' => 'Safe\oci_pconnect',
+ '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_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_prepare' => 'Safe\odbc_prepare',
+ 'odbc_primarykeys' => 'Safe\odbc_primarykeys',
+ '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_csr_export' => 'Safe\openssl_csr_export',
+ 'openssl_csr_export_to_file' => 'Safe\openssl_csr_export_to_file',
+ '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_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_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_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',
+ 'password_hash' => 'Safe\password_hash',
+ 'pcntl_exec' => 'Safe\pcntl_exec',
+ 'pcntl_getpriority' => 'Safe\pcntl_getpriority',
+ 'pcntl_setpriority' => 'Safe\pcntl_setpriority',
+ 'pcntl_signal_dispatch' => 'Safe\pcntl_signal_dispatch',
+ 'pcntl_sigprocmask' => 'Safe\pcntl_sigprocmask',
+ 'pcntl_strerror' => 'Safe\pcntl_strerror',
+ 'PDF_activate_item' => 'Safe\PDF_activate_item',
+ 'PDF_add_locallink' => 'Safe\PDF_add_locallink',
+ 'PDF_add_nameddest' => 'Safe\PDF_add_nameddest',
+ 'PDF_add_note' => 'Safe\PDF_add_note',
+ 'PDF_add_pdflink' => 'Safe\PDF_add_pdflink',
+ 'PDF_add_thumbnail' => 'Safe\PDF_add_thumbnail',
+ 'PDF_add_weblink' => 'Safe\PDF_add_weblink',
+ 'PDF_attach_file' => 'Safe\PDF_attach_file',
+ 'PDF_begin_layer' => 'Safe\PDF_begin_layer',
+ 'PDF_begin_page' => 'Safe\PDF_begin_page',
+ 'PDF_begin_page_ext' => 'Safe\PDF_begin_page_ext',
+ 'PDF_circle' => 'Safe\PDF_circle',
+ 'PDF_clip' => 'Safe\PDF_clip',
+ 'PDF_close' => 'Safe\PDF_close',
+ 'PDF_closepath' => 'Safe\PDF_closepath',
+ 'PDF_closepath_fill_stroke' => 'Safe\PDF_closepath_fill_stroke',
+ 'PDF_closepath_stroke' => 'Safe\PDF_closepath_stroke',
+ 'PDF_close_pdi' => 'Safe\PDF_close_pdi',
+ 'PDF_close_pdi_page' => 'Safe\PDF_close_pdi_page',
+ 'PDF_concat' => 'Safe\PDF_concat',
+ 'PDF_continue_text' => 'Safe\PDF_continue_text',
+ 'PDF_curveto' => 'Safe\PDF_curveto',
+ 'PDF_delete' => 'Safe\PDF_delete',
+ 'PDF_end_layer' => 'Safe\PDF_end_layer',
+ 'PDF_end_page' => 'Safe\PDF_end_page',
+ 'PDF_end_page_ext' => 'Safe\PDF_end_page_ext',
+ 'PDF_end_pattern' => 'Safe\PDF_end_pattern',
+ 'PDF_end_template' => 'Safe\PDF_end_template',
+ 'PDF_fill' => 'Safe\PDF_fill',
+ 'PDF_fill_stroke' => 'Safe\PDF_fill_stroke',
+ 'PDF_fit_image' => 'Safe\PDF_fit_image',
+ 'PDF_fit_pdi_page' => 'Safe\PDF_fit_pdi_page',
+ 'PDF_fit_textline' => 'Safe\PDF_fit_textline',
+ 'PDF_initgraphics' => 'Safe\PDF_initgraphics',
+ 'PDF_lineto' => 'Safe\PDF_lineto',
+ 'PDF_makespotcolor' => 'Safe\PDF_makespotcolor',
+ 'PDF_moveto' => 'Safe\PDF_moveto',
+ 'PDF_open_file' => 'Safe\PDF_open_file',
+ 'PDF_place_image' => 'Safe\PDF_place_image',
+ 'PDF_place_pdi_page' => 'Safe\PDF_place_pdi_page',
+ 'PDF_rect' => 'Safe\PDF_rect',
+ 'PDF_restore' => 'Safe\PDF_restore',
+ 'PDF_rotate' => 'Safe\PDF_rotate',
+ 'PDF_save' => 'Safe\PDF_save',
+ 'PDF_scale' => 'Safe\PDF_scale',
+ 'PDF_setcolor' => 'Safe\PDF_setcolor',
+ 'PDF_setdash' => 'Safe\PDF_setdash',
+ 'PDF_setdashpattern' => 'Safe\PDF_setdashpattern',
+ 'PDF_setflat' => 'Safe\PDF_setflat',
+ 'PDF_setfont' => 'Safe\PDF_setfont',
+ 'PDF_setgray' => 'Safe\PDF_setgray',
+ 'PDF_setgray_fill' => 'Safe\PDF_setgray_fill',
+ 'PDF_setgray_stroke' => 'Safe\PDF_setgray_stroke',
+ 'PDF_setlinejoin' => 'Safe\PDF_setlinejoin',
+ 'PDF_setlinewidth' => 'Safe\PDF_setlinewidth',
+ 'PDF_setmatrix' => 'Safe\PDF_setmatrix',
+ 'PDF_setmiterlimit' => 'Safe\PDF_setmiterlimit',
+ 'PDF_setrgbcolor' => 'Safe\PDF_setrgbcolor',
+ 'PDF_setrgbcolor_fill' => 'Safe\PDF_setrgbcolor_fill',
+ 'PDF_setrgbcolor_stroke' => 'Safe\PDF_setrgbcolor_stroke',
+ 'PDF_set_border_color' => 'Safe\PDF_set_border_color',
+ 'PDF_set_border_dash' => 'Safe\PDF_set_border_dash',
+ 'PDF_set_border_style' => 'Safe\PDF_set_border_style',
+ 'PDF_set_info' => 'Safe\PDF_set_info',
+ 'PDF_set_layer_dependency' => 'Safe\PDF_set_layer_dependency',
+ 'PDF_set_parameter' => 'Safe\PDF_set_parameter',
+ 'PDF_set_text_pos' => 'Safe\PDF_set_text_pos',
+ 'PDF_set_value' => 'Safe\PDF_set_value',
+ 'PDF_show' => 'Safe\PDF_show',
+ 'PDF_show_xy' => 'Safe\PDF_show_xy',
+ 'PDF_skew' => 'Safe\PDF_skew',
+ 'PDF_stroke' => 'Safe\PDF_stroke',
+ 'pg_cancel_query' => 'Safe\pg_cancel_query',
+ 'pg_client_encoding' => 'Safe\pg_client_encoding',
+ 'pg_close' => 'Safe\pg_close',
+ '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_dbname' => 'Safe\pg_dbname',
+ 'pg_delete' => 'Safe\pg_delete',
+ 'pg_end_copy' => 'Safe\pg_end_copy',
+ 'pg_execute' => 'Safe\pg_execute',
+ 'pg_field_name' => 'Safe\pg_field_name',
+ 'pg_field_table' => 'Safe\pg_field_table',
+ 'pg_field_type' => 'Safe\pg_field_type',
+ 'pg_flush' => 'Safe\pg_flush',
+ 'pg_free_result' => 'Safe\pg_free_result',
+ 'pg_host' => 'Safe\pg_host',
+ 'pg_insert' => 'Safe\pg_insert',
+ 'pg_last_error' => 'Safe\pg_last_error',
+ 'pg_last_notice' => 'Safe\pg_last_notice',
+ '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_read_all' => 'Safe\pg_lo_read_all',
+ '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_options' => 'Safe\pg_options',
+ 'pg_parameter_status' => 'Safe\pg_parameter_status',
+ 'pg_pconnect' => 'Safe\pg_pconnect',
+ 'pg_ping' => 'Safe\pg_ping',
+ 'pg_port' => 'Safe\pg_port',
+ '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_send_execute' => 'Safe\pg_send_execute',
+ 'pg_send_prepare' => 'Safe\pg_send_prepare',
+ 'pg_send_query' => 'Safe\pg_send_query',
+ 'pg_send_query_params' => 'Safe\pg_send_query_params',
+ 'pg_socket' => 'Safe\pg_socket',
+ 'pg_trace' => 'Safe\pg_trace',
+ 'pg_tty' => 'Safe\pg_tty',
+ 'pg_update' => 'Safe\pg_update',
+ 'pg_version' => 'Safe\pg_version',
+ 'phpcredits' => 'Safe\phpcredits',
+ 'phpinfo' => 'Safe\phpinfo',
+ 'png2wbmp' => 'Safe\png2wbmp',
+ 'posix_access' => 'Safe\posix_access',
+ 'posix_getgrnam' => 'Safe\posix_getgrnam',
+ 'posix_getpgid' => 'Safe\posix_getpgid',
+ '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',
+ 'preg_match' => 'Safe\preg_match',
+ 'preg_match_all' => 'Safe\preg_match_all',
+ 'preg_replace' => 'Safe\preg_replace',
+ 'preg_split' => 'Safe\preg_split',
+ 'proc_get_status' => 'Safe\proc_get_status',
+ '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_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',
+ 'rewinddir' => 'Safe\rewinddir',
+ 'rmdir' => 'Safe\rmdir',
+ 'rpmaddtag' => 'Safe\rpmaddtag',
+ 'rrd_create' => 'Safe\rrd_create',
+ 'rsort' => 'Safe\rsort',
+ '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_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_decode' => 'Safe\session_decode',
+ 'session_destroy' => 'Safe\session_destroy',
+ 'session_regenerate_id' => 'Safe\session_regenerate_id',
+ 'session_reset' => 'Safe\session_reset',
+ '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',
+ 'shmop_delete' => 'Safe\shmop_delete',
+ 'shmop_read' => 'Safe\shmop_read',
+ 'shmop_write' => 'Safe\shmop_write',
+ '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_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_pwhash' => 'Safe\sodium_crypto_pwhash',
+ 'sodium_crypto_pwhash_str' => 'Safe\sodium_crypto_pwhash_str',
+ 'solr_get_version' => 'Safe\solr_get_version',
+ 'sort' => 'Safe\sort',
+ 'soundex' => 'Safe\soundex',
+ 'spl_autoload_register' => 'Safe\spl_autoload_register',
+ 'spl_autoload_unregister' => 'Safe\spl_autoload_unregister',
+ 'sprintf' => 'Safe\sprintf',
+ '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_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_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',
+ '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',
+ 'strptime' => 'Safe\strptime',
+ 'strtotime' => 'Safe\strtotime',
+ 'substr' => 'Safe\substr',
+ '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',
+ 'uasort' => 'Safe\uasort',
+ 'uksort' => 'Safe\uksort',
+ 'unlink' => 'Safe\unlink',
+ 'unpack' => 'Safe\unpack',
+ 'uopz_extend' => 'Safe\uopz_extend',
+ 'uopz_implement' => 'Safe\uopz_implement',
+ 'usort' => 'Safe\usort',
+ 'virtual' => 'Safe\virtual',
+ 'vsprintf' => 'Safe\vsprintf',
+ '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_create' => 'Safe\xml_parser_create',
+ 'xml_parser_create_ns' => 'Safe\xml_parser_create_ns',
+ 'xml_set_object' => 'Safe\xml_set_object',
+ '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_open' => 'Safe\zip_entry_open',
+ 'zip_entry_read' => 'Safe\zip_entry_read',
+ 'zlib_decode' => 'Safe\zlib_decode',
+]]]);
+};