Stand: SMTP-Test, Admin-Mail-Tab, Notifiable-Fix, Lazy-Quill
- Fix: Notifiable-Trait zum User-Model hinzugefuegt (behebt notify()-500er) - Installer: SMTP-Verbindungstest mit EsmtpTransport + Ueberspringen-Link - Admin: Neuer E-Mail-Tab mit SMTP-Konfiguration + Verbindungstest - Admin: Lazy Quill-Initialisierung (nur sichtbare Locale wird geladen) - Uebersetzungen: 17 neue Mail-Keys in allen 6 Sprachen Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
21
vendor/thecodingmachine/safe/LICENSE
vendored
Normal file
21
vendor/thecodingmachine/safe/LICENSE
vendored
Normal file
@@ -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.
|
||||
174
vendor/thecodingmachine/safe/README.md
vendored
Normal file
174
vendor/thecodingmachine/safe/README.md
vendored
Normal file
@@ -0,0 +1,174 @@
|
||||
[](https://packagist.org/packages/thecodingmachine/safe)
|
||||
[](https://packagist.org/packages/thecodingmachine/safe)
|
||||
[](https://packagist.org/packages/thecodingmachine/safe)
|
||||
[](https://github.com/thecodingmachine/safe/actions)
|
||||
[](https://codecov.io/gh/thecodingmachine/safe)
|
||||
|
||||
Safe PHP
|
||||
========
|
||||
|
||||
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 exist
|
||||
// "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
|
||||
```
|
||||
|
||||
to install `rector/rector`.
|
||||
|
||||
Run
|
||||
|
||||
```bash
|
||||
vendor/bin/rector process src/ --config vendor/thecodingmachine/safe/rector-migrate.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.
|
||||
111
vendor/thecodingmachine/safe/composer.json
vendored
Normal file
111
vendor/thecodingmachine/safe/composer.json
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
{
|
||||
"name": "thecodingmachine/safe",
|
||||
"description": "PHP core functions that throw exceptions instead of returning FALSE on error",
|
||||
"license": "MIT",
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"lib/DateTime.php",
|
||||
"lib/DateTimeImmutable.php",
|
||||
"lib/Exceptions/",
|
||||
"generated/Exceptions/"
|
||||
],
|
||||
"files": [
|
||||
"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/gettext.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/inotify.php",
|
||||
"generated/json.php",
|
||||
"generated/ldap.php",
|
||||
"generated/libxml.php",
|
||||
"generated/lzf.php",
|
||||
"generated/mailparse.php",
|
||||
"generated/mbstring.php",
|
||||
"generated/misc.php",
|
||||
"generated/mysql.php",
|
||||
"generated/mysqli.php",
|
||||
"generated/network.php",
|
||||
"generated/oci8.php",
|
||||
"generated/opcache.php",
|
||||
"generated/openssl.php",
|
||||
"generated/outcontrol.php",
|
||||
"generated/pcntl.php",
|
||||
"generated/pcre.php",
|
||||
"generated/pgsql.php",
|
||||
"generated/posix.php",
|
||||
"generated/ps.php",
|
||||
"generated/pspell.php",
|
||||
"generated/readline.php",
|
||||
"generated/rnp.php",
|
||||
"generated/rpminfo.php",
|
||||
"generated/rrd.php",
|
||||
"generated/sem.php",
|
||||
"generated/session.php",
|
||||
"generated/shmop.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": "^8.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/phpstan": "^2",
|
||||
"squizlabs/php_codesniffer": "^3.2",
|
||||
"phpunit/phpunit": "^10",
|
||||
"php-parallel-lint/php-parallel-lint": "^1.4"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "parallel-lint lib/ tests/",
|
||||
"test": "phpunit",
|
||||
"phpstan": "phpstan analyse",
|
||||
"cs-fix": "phpcbf",
|
||||
"cs-check": "phpcs"
|
||||
}
|
||||
}
|
||||
135
vendor/thecodingmachine/safe/generated/8.1/apache.php
vendored
Normal file
135
vendor/thecodingmachine/safe/generated/8.1/apache.php
vendored
Normal file
@@ -0,0 +1,135 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\ApacheException;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws ApacheException
|
||||
*
|
||||
*/
|
||||
function apache_get_version(): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \apache_get_version();
|
||||
if ($safeResult === false) {
|
||||
throw ApacheException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $variable
|
||||
* @param bool $walk_to_top
|
||||
* @return string
|
||||
* @throws ApacheException
|
||||
*
|
||||
*/
|
||||
function apache_getenv(string $variable, bool $walk_to_top = false): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \apache_getenv($variable, $walk_to_top);
|
||||
if ($safeResult === false) {
|
||||
throw ApacheException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @return object
|
||||
* @throws ApacheException
|
||||
*
|
||||
*/
|
||||
function apache_lookup_uri(string $filename): object
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \apache_lookup_uri($filename);
|
||||
if ($safeResult === false) {
|
||||
throw ApacheException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @throws ApacheException
|
||||
*
|
||||
*/
|
||||
function apache_request_headers(): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \apache_request_headers();
|
||||
if ($safeResult === false) {
|
||||
throw ApacheException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @throws ApacheException
|
||||
*
|
||||
*/
|
||||
function apache_response_headers(): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \apache_response_headers();
|
||||
if ($safeResult === false) {
|
||||
throw ApacheException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $variable
|
||||
* @param string $value
|
||||
* @param bool $walk_to_top
|
||||
* @throws ApacheException
|
||||
*
|
||||
*/
|
||||
function apache_setenv(string $variable, string $value, bool $walk_to_top = false): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \apache_setenv($variable, $value, $walk_to_top);
|
||||
if ($safeResult === false) {
|
||||
throw ApacheException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @throws ApacheException
|
||||
*
|
||||
*/
|
||||
function getallheaders(): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \getallheaders();
|
||||
if ($safeResult === false) {
|
||||
throw ApacheException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $uri
|
||||
* @throws ApacheException
|
||||
*
|
||||
*/
|
||||
function virtual(string $uri): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \virtual($uri);
|
||||
if ($safeResult === false) {
|
||||
throw ApacheException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
95
vendor/thecodingmachine/safe/generated/8.1/apcu.php
vendored
Normal file
95
vendor/thecodingmachine/safe/generated/8.1/apcu.php
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\ApcuException;
|
||||
|
||||
/**
|
||||
* @param bool $limited
|
||||
* @return array
|
||||
* @throws ApcuException
|
||||
*
|
||||
*/
|
||||
function apcu_cache_info(bool $limited = false): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \apcu_cache_info($limited);
|
||||
if ($safeResult === false) {
|
||||
throw ApcuException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $key
|
||||
* @param int $old
|
||||
* @param int $new
|
||||
* @throws ApcuException
|
||||
*
|
||||
*/
|
||||
function apcu_cas(string $key, int $old, int $new): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \apcu_cas($key, $old, $new);
|
||||
if ($safeResult === false) {
|
||||
throw ApcuException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $key
|
||||
* @param int $step
|
||||
* @param bool|null $success
|
||||
* @param int $ttl
|
||||
* @return int
|
||||
* @throws ApcuException
|
||||
*
|
||||
*/
|
||||
function apcu_dec(string $key, int $step = 1, ?bool &$success = null, int $ttl = 0): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \apcu_dec($key, $step, $success, $ttl);
|
||||
if ($safeResult === false) {
|
||||
throw ApcuException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $key
|
||||
* @param int $step
|
||||
* @param bool|null $success
|
||||
* @param int $ttl
|
||||
* @return int
|
||||
* @throws ApcuException
|
||||
*
|
||||
*/
|
||||
function apcu_inc(string $key, int $step = 1, ?bool &$success = null, int $ttl = 0): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \apcu_inc($key, $step, $success, $ttl);
|
||||
if ($safeResult === false) {
|
||||
throw ApcuException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param bool $limited
|
||||
* @return array
|
||||
* @throws ApcuException
|
||||
*
|
||||
*/
|
||||
function apcu_sma_info(bool $limited = false): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \apcu_sma_info($limited);
|
||||
if ($safeResult === false) {
|
||||
throw ApcuException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
119
vendor/thecodingmachine/safe/generated/8.1/array.php
vendored
Normal file
119
vendor/thecodingmachine/safe/generated/8.1/array.php
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\ArrayException;
|
||||
|
||||
/**
|
||||
* @param array $keys
|
||||
* @param array $values
|
||||
* @return array
|
||||
* @throws ArrayException
|
||||
*
|
||||
*/
|
||||
function array_combine(array $keys, array $values): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \array_combine($keys, $values);
|
||||
if ($safeResult === false) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $array
|
||||
* @return array
|
||||
* @throws ArrayException
|
||||
*
|
||||
*/
|
||||
function array_flip(array $array): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \array_flip($array);
|
||||
if ($safeResult === null) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $array
|
||||
* @param array $replacements
|
||||
* @return array
|
||||
* @throws ArrayException
|
||||
*
|
||||
*/
|
||||
function array_replace_recursive(array $array, array ...$replacements): array
|
||||
{
|
||||
error_clear_last();
|
||||
if ($replacements !== []) {
|
||||
$safeResult = \array_replace_recursive($array, ...$replacements);
|
||||
} else {
|
||||
$safeResult = \array_replace_recursive($array);
|
||||
}
|
||||
if ($safeResult === null) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $array
|
||||
* @param array $replacements
|
||||
* @return array
|
||||
* @throws ArrayException
|
||||
*
|
||||
*/
|
||||
function array_replace(array $array, array ...$replacements): array
|
||||
{
|
||||
error_clear_last();
|
||||
if ($replacements !== []) {
|
||||
$safeResult = \array_replace($array, ...$replacements);
|
||||
} else {
|
||||
$safeResult = \array_replace($array);
|
||||
}
|
||||
if ($safeResult === null) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array|object $array
|
||||
* @param callable $callback
|
||||
* @param mixed $arg
|
||||
* @throws ArrayException
|
||||
*
|
||||
*/
|
||||
function array_walk_recursive(&$array, callable $callback, $arg = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($arg !== null) {
|
||||
$safeResult = \array_walk_recursive($array, $callback, $arg);
|
||||
} else {
|
||||
$safeResult = \array_walk_recursive($array, $callback);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $array
|
||||
* @throws ArrayException
|
||||
*
|
||||
*/
|
||||
function shuffle(array &$array): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \shuffle($array);
|
||||
if ($safeResult === false) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
93
vendor/thecodingmachine/safe/generated/8.1/bzip2.php
vendored
Normal file
93
vendor/thecodingmachine/safe/generated/8.1/bzip2.php
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\Bzip2Exception;
|
||||
|
||||
/**
|
||||
* @param resource $bz
|
||||
* @throws Bzip2Exception
|
||||
*
|
||||
*/
|
||||
function bzclose($bz): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \bzclose($bz);
|
||||
if ($safeResult === false) {
|
||||
throw Bzip2Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $bz
|
||||
* @throws Bzip2Exception
|
||||
*
|
||||
*/
|
||||
function bzflush($bz): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \bzflush($bz);
|
||||
if ($safeResult === false) {
|
||||
throw Bzip2Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource|string $file
|
||||
* @param string $mode
|
||||
* @return resource
|
||||
* @throws Bzip2Exception
|
||||
*
|
||||
*/
|
||||
function bzopen($file, string $mode)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \bzopen($file, $mode);
|
||||
if ($safeResult === false) {
|
||||
throw Bzip2Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $bz
|
||||
* @param int $length
|
||||
* @return string
|
||||
* @throws Bzip2Exception
|
||||
*
|
||||
*/
|
||||
function bzread($bz, int $length = 1024): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \bzread($bz, $length);
|
||||
if ($safeResult === false) {
|
||||
throw Bzip2Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $bz
|
||||
* @param string $data
|
||||
* @param int|null $length
|
||||
* @return int
|
||||
* @throws Bzip2Exception
|
||||
*
|
||||
*/
|
||||
function bzwrite($bz, string $data, ?int $length = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($length !== null) {
|
||||
$safeResult = \bzwrite($bz, $data, $length);
|
||||
} else {
|
||||
$safeResult = \bzwrite($bz, $data);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw Bzip2Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
25
vendor/thecodingmachine/safe/generated/8.1/calendar.php
vendored
Normal file
25
vendor/thecodingmachine/safe/generated/8.1/calendar.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\CalendarException;
|
||||
|
||||
/**
|
||||
* @param int|null $timestamp
|
||||
* @return int
|
||||
* @throws CalendarException
|
||||
*
|
||||
*/
|
||||
function unixtojd(?int $timestamp = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($timestamp !== null) {
|
||||
$safeResult = \unixtojd($timestamp);
|
||||
} else {
|
||||
$safeResult = \unixtojd();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw CalendarException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
21
vendor/thecodingmachine/safe/generated/8.1/classobj.php
vendored
Normal file
21
vendor/thecodingmachine/safe/generated/8.1/classobj.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\ClassobjException;
|
||||
|
||||
/**
|
||||
* @param string $class
|
||||
* @param string $alias
|
||||
* @param bool $autoload
|
||||
* @throws ClassobjException
|
||||
*
|
||||
*/
|
||||
function class_alias(string $class, string $alias, bool $autoload = true): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \class_alias($class, $alias, $autoload);
|
||||
if ($safeResult === false) {
|
||||
throw ClassobjException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
115
vendor/thecodingmachine/safe/generated/8.1/com.php
vendored
Normal file
115
vendor/thecodingmachine/safe/generated/8.1/com.php
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\ComException;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws ComException
|
||||
*
|
||||
*/
|
||||
function com_create_guid(): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \com_create_guid();
|
||||
if ($safeResult === false) {
|
||||
throw ComException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param object $variant
|
||||
* @param object $sink_object
|
||||
* @param mixed $sink_interface
|
||||
* @throws ComException
|
||||
*
|
||||
*/
|
||||
function com_event_sink(object $variant, object $sink_object, $sink_interface = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($sink_interface !== null) {
|
||||
$safeResult = \com_event_sink($variant, $sink_object, $sink_interface);
|
||||
} else {
|
||||
$safeResult = \com_event_sink($variant, $sink_object);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw ComException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $typelib
|
||||
* @param bool $case_insensitive
|
||||
* @throws ComException
|
||||
*
|
||||
*/
|
||||
function com_load_typelib(string $typelib, bool $case_insensitive = true): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \com_load_typelib($typelib, $case_insensitive);
|
||||
if ($safeResult === false) {
|
||||
throw ComException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param object $variant
|
||||
* @param null|string $dispatch_interface
|
||||
* @param bool $display_sink
|
||||
* @throws ComException
|
||||
*
|
||||
*/
|
||||
function com_print_typeinfo(object $variant, ?string $dispatch_interface = null, bool $display_sink = false): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($display_sink !== false) {
|
||||
$safeResult = \com_print_typeinfo($variant, $dispatch_interface, $display_sink);
|
||||
} elseif ($dispatch_interface !== null) {
|
||||
$safeResult = \com_print_typeinfo($variant, $dispatch_interface);
|
||||
} else {
|
||||
$safeResult = \com_print_typeinfo($variant);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw ComException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param object $variant
|
||||
* @return int
|
||||
* @throws ComException
|
||||
*
|
||||
*/
|
||||
function variant_date_to_timestamp(object $variant): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \variant_date_to_timestamp($variant);
|
||||
if ($safeResult === null) {
|
||||
throw ComException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param mixed $value
|
||||
* @param int $decimals
|
||||
* @return mixed
|
||||
* @throws ComException
|
||||
*
|
||||
*/
|
||||
function variant_round($value, int $decimals)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \variant_round($value, $decimals);
|
||||
if ($safeResult === null) {
|
||||
throw ComException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
997
vendor/thecodingmachine/safe/generated/8.1/cubrid.php
vendored
Normal file
997
vendor/thecodingmachine/safe/generated/8.1/cubrid.php
vendored
Normal file
@@ -0,0 +1,997 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\CubridException;
|
||||
|
||||
/**
|
||||
* @param resource $req_identifier
|
||||
* @param int $bind_index
|
||||
* @param mixed $bind_value
|
||||
* @param string $bind_value_type
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_bind($req_identifier, int $bind_index, $bind_value, ?string $bind_value_type = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($bind_value_type !== null) {
|
||||
$safeResult = \cubrid_bind($req_identifier, $bind_index, $bind_value, $bind_value_type);
|
||||
} else {
|
||||
$safeResult = \cubrid_bind($req_identifier, $bind_index, $bind_value);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn_identifier
|
||||
* @param string $oid
|
||||
* @param string $attr_name
|
||||
* @return int
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_col_size($conn_identifier, string $oid, string $attr_name): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_col_size($conn_identifier, $oid, $attr_name);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $req_identifier
|
||||
* @return array
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_column_names($req_identifier): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_column_names($req_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $req_identifier
|
||||
* @return array
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_column_types($req_identifier): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_column_types($req_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn_identifier
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_commit($conn_identifier): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_commit($conn_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $conn_url
|
||||
* @param string $userid
|
||||
* @param string $passwd
|
||||
* @param bool $new_link
|
||||
* @return resource
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_connect_with_url(string $conn_url, ?string $userid = null, ?string $passwd = null, bool $new_link = false)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($new_link !== false) {
|
||||
$safeResult = \cubrid_connect_with_url($conn_url, $userid, $passwd, $new_link);
|
||||
} elseif ($passwd !== null) {
|
||||
$safeResult = \cubrid_connect_with_url($conn_url, $userid, $passwd);
|
||||
} elseif ($userid !== null) {
|
||||
$safeResult = \cubrid_connect_with_url($conn_url, $userid);
|
||||
} else {
|
||||
$safeResult = \cubrid_connect_with_url($conn_url);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $host
|
||||
* @param int $port
|
||||
* @param string $dbname
|
||||
* @param string $userid
|
||||
* @param string $passwd
|
||||
* @param bool $new_link
|
||||
* @return resource
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_connect(string $host, int $port, string $dbname, ?string $userid = null, ?string $passwd = null, bool $new_link = false)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($new_link !== false) {
|
||||
$safeResult = \cubrid_connect($host, $port, $dbname, $userid, $passwd, $new_link);
|
||||
} elseif ($passwd !== null) {
|
||||
$safeResult = \cubrid_connect($host, $port, $dbname, $userid, $passwd);
|
||||
} elseif ($userid !== null) {
|
||||
$safeResult = \cubrid_connect($host, $port, $dbname, $userid);
|
||||
} else {
|
||||
$safeResult = \cubrid_connect($host, $port, $dbname);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $req_identifier
|
||||
* @return string
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_current_oid($req_identifier): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_current_oid($req_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn_identifier
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_disconnect($conn_identifier = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($conn_identifier !== null) {
|
||||
$safeResult = \cubrid_disconnect($conn_identifier);
|
||||
} else {
|
||||
$safeResult = \cubrid_disconnect();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn_identifier
|
||||
* @param string $oid
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_drop($conn_identifier, string $oid): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_drop($conn_identifier, $oid);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $req_identifier
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_free_result($req_identifier): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_free_result($req_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn_identifier
|
||||
* @return string
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_get_charset($conn_identifier): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_get_charset($conn_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn_identifier
|
||||
* @param string $oid
|
||||
* @return string
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_get_class_name($conn_identifier, string $oid): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_get_class_name($conn_identifier, $oid);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_get_client_info(): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_get_client_info();
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn_identifier
|
||||
* @return array
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_get_db_parameter($conn_identifier): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_get_db_parameter($conn_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $req_identifier
|
||||
* @return int
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_get_query_timeout($req_identifier): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_get_query_timeout($req_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn_identifier
|
||||
* @return string
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_get_server_info($conn_identifier): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_get_server_info($conn_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn_identifier
|
||||
* @return string
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_insert_id($conn_identifier = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($conn_identifier !== null) {
|
||||
$safeResult = \cubrid_insert_id($conn_identifier);
|
||||
} else {
|
||||
$safeResult = \cubrid_insert_id();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $lob_identifier_array
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_lob_close(array $lob_identifier_array): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_lob_close($lob_identifier_array);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn_identifier
|
||||
* @param resource $lob_identifier
|
||||
* @param string $path_name
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_lob_export($conn_identifier, $lob_identifier, string $path_name): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_lob_export($conn_identifier, $lob_identifier, $path_name);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn_identifier
|
||||
* @param string $sql
|
||||
* @return array
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_lob_get($conn_identifier, string $sql): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_lob_get($conn_identifier, $sql);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn_identifier
|
||||
* @param resource $lob_identifier
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_lob_send($conn_identifier, $lob_identifier): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_lob_send($conn_identifier, $lob_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $lob_identifier
|
||||
* @return string
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_lob_size($lob_identifier): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_lob_size($lob_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $req_identifier
|
||||
* @param int $bind_index
|
||||
* @param mixed $bind_value
|
||||
* @param string $bind_value_type
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_lob2_bind($req_identifier, int $bind_index, $bind_value, ?string $bind_value_type = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($bind_value_type !== null) {
|
||||
$safeResult = \cubrid_lob2_bind($req_identifier, $bind_index, $bind_value, $bind_value_type);
|
||||
} else {
|
||||
$safeResult = \cubrid_lob2_bind($req_identifier, $bind_index, $bind_value);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $lob_identifier
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_lob2_close($lob_identifier): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_lob2_close($lob_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $lob_identifier
|
||||
* @param string $file_name
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_lob2_export($lob_identifier, string $file_name): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_lob2_export($lob_identifier, $file_name);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $lob_identifier
|
||||
* @param string $file_name
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_lob2_import($lob_identifier, string $file_name): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_lob2_import($lob_identifier, $file_name);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn_identifier
|
||||
* @param string $type
|
||||
* @return resource
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_lob2_new($conn_identifier = null, string $type = "BLOB")
|
||||
{
|
||||
error_clear_last();
|
||||
if ($type !== "BLOB") {
|
||||
$safeResult = \cubrid_lob2_new($conn_identifier, $type);
|
||||
} elseif ($conn_identifier !== null) {
|
||||
$safeResult = \cubrid_lob2_new($conn_identifier);
|
||||
} else {
|
||||
$safeResult = \cubrid_lob2_new();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $lob_identifier
|
||||
* @param int $len
|
||||
* @return string
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_lob2_read($lob_identifier, int $len): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_lob2_read($lob_identifier, $len);
|
||||
if ($safeResult === null) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $lob_identifier
|
||||
* @param int $offset
|
||||
* @param int $origin
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_lob2_seek($lob_identifier, int $offset, int $origin = CUBRID_CURSOR_CURRENT): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_lob2_seek($lob_identifier, $offset, $origin);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $lob_identifier
|
||||
* @param string $offset
|
||||
* @param int $origin
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_lob2_seek64($lob_identifier, string $offset, int $origin = CUBRID_CURSOR_CURRENT): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_lob2_seek64($lob_identifier, $offset, $origin);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $lob_identifier
|
||||
* @return int
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_lob2_size($lob_identifier): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_lob2_size($lob_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $lob_identifier
|
||||
* @return string
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_lob2_size64($lob_identifier): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_lob2_size64($lob_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $lob_identifier
|
||||
* @return int
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_lob2_tell($lob_identifier): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_lob2_tell($lob_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $lob_identifier
|
||||
* @return string
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_lob2_tell64($lob_identifier): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_lob2_tell64($lob_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $lob_identifier
|
||||
* @param string $buf
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_lob2_write($lob_identifier, string $buf): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_lob2_write($lob_identifier, $buf);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn_identifier
|
||||
* @param string $oid
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_lock_read($conn_identifier, string $oid): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_lock_read($conn_identifier, $oid);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn_identifier
|
||||
* @param string $oid
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_lock_write($conn_identifier, string $oid): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_lock_write($conn_identifier, $oid);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $req_identifier
|
||||
* @param int $offset
|
||||
* @param int $origin
|
||||
* @return int
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_move_cursor($req_identifier, int $offset, int $origin = CUBRID_CURSOR_CURRENT): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_move_cursor($req_identifier, $offset, $origin);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $result
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_next_result($result): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_next_result($result);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $conn_url
|
||||
* @param string $userid
|
||||
* @param string $passwd
|
||||
* @return resource
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_pconnect_with_url(string $conn_url, ?string $userid = null, ?string $passwd = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($passwd !== null) {
|
||||
$safeResult = \cubrid_pconnect_with_url($conn_url, $userid, $passwd);
|
||||
} elseif ($userid !== null) {
|
||||
$safeResult = \cubrid_pconnect_with_url($conn_url, $userid);
|
||||
} else {
|
||||
$safeResult = \cubrid_pconnect_with_url($conn_url);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $host
|
||||
* @param int $port
|
||||
* @param string $dbname
|
||||
* @param string $userid
|
||||
* @param string $passwd
|
||||
* @return resource
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_pconnect(string $host, int $port, string $dbname, ?string $userid = null, ?string $passwd = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($passwd !== null) {
|
||||
$safeResult = \cubrid_pconnect($host, $port, $dbname, $userid, $passwd);
|
||||
} elseif ($userid !== null) {
|
||||
$safeResult = \cubrid_pconnect($host, $port, $dbname, $userid);
|
||||
} else {
|
||||
$safeResult = \cubrid_pconnect($host, $port, $dbname);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn_identifier
|
||||
* @param string $prepare_stmt
|
||||
* @param int $option
|
||||
* @return resource
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_prepare($conn_identifier, string $prepare_stmt, int $option = 0)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_prepare($conn_identifier, $prepare_stmt, $option);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn_identifier
|
||||
* @param string $oid
|
||||
* @param string $attr
|
||||
* @param mixed $value
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_put($conn_identifier, string $oid, ?string $attr = null, $value = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($value !== null) {
|
||||
$safeResult = \cubrid_put($conn_identifier, $oid, $attr, $value);
|
||||
} elseif ($attr !== null) {
|
||||
$safeResult = \cubrid_put($conn_identifier, $oid, $attr);
|
||||
} else {
|
||||
$safeResult = \cubrid_put($conn_identifier, $oid);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn_identifier
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_rollback($conn_identifier): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_rollback($conn_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn_identifier
|
||||
* @param int $schema_type
|
||||
* @param string $class_name
|
||||
* @param string $attr_name
|
||||
* @return array
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_schema($conn_identifier, int $schema_type, ?string $class_name = null, ?string $attr_name = null): array
|
||||
{
|
||||
error_clear_last();
|
||||
if ($attr_name !== null) {
|
||||
$safeResult = \cubrid_schema($conn_identifier, $schema_type, $class_name, $attr_name);
|
||||
} elseif ($class_name !== null) {
|
||||
$safeResult = \cubrid_schema($conn_identifier, $schema_type, $class_name);
|
||||
} else {
|
||||
$safeResult = \cubrid_schema($conn_identifier, $schema_type);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn_identifier
|
||||
* @param string $oid
|
||||
* @param string $attr_name
|
||||
* @param int $index
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_seq_drop($conn_identifier, string $oid, string $attr_name, int $index): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_seq_drop($conn_identifier, $oid, $attr_name, $index);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn_identifier
|
||||
* @param string $oid
|
||||
* @param string $attr_name
|
||||
* @param int $index
|
||||
* @param string $seq_element
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_seq_insert($conn_identifier, string $oid, string $attr_name, int $index, string $seq_element): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_seq_insert($conn_identifier, $oid, $attr_name, $index, $seq_element);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn_identifier
|
||||
* @param string $oid
|
||||
* @param string $attr_name
|
||||
* @param int $index
|
||||
* @param string $seq_element
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_seq_put($conn_identifier, string $oid, string $attr_name, int $index, string $seq_element): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_seq_put($conn_identifier, $oid, $attr_name, $index, $seq_element);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn_identifier
|
||||
* @param string $oid
|
||||
* @param string $attr_name
|
||||
* @param string $set_element
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_set_add($conn_identifier, string $oid, string $attr_name, string $set_element): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_set_add($conn_identifier, $oid, $attr_name, $set_element);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn_identifier
|
||||
* @param bool $mode
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_set_autocommit($conn_identifier, bool $mode): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_set_autocommit($conn_identifier, $mode);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn_identifier
|
||||
* @param int $param_type
|
||||
* @param int $param_value
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_set_db_parameter($conn_identifier, int $param_type, int $param_value): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_set_db_parameter($conn_identifier, $param_type, $param_value);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn_identifier
|
||||
* @param string $oid
|
||||
* @param string $attr_name
|
||||
* @param string $set_element
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_set_drop($conn_identifier, string $oid, string $attr_name, string $set_element): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_set_drop($conn_identifier, $oid, $attr_name, $set_element);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $req_identifier
|
||||
* @param int $timeout
|
||||
* @throws CubridException
|
||||
*
|
||||
*/
|
||||
function cubrid_set_query_timeout($req_identifier, int $timeout): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cubrid_set_query_timeout($req_identifier, $timeout);
|
||||
if ($safeResult === false) {
|
||||
throw CubridException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
219
vendor/thecodingmachine/safe/generated/8.1/curl.php
vendored
Normal file
219
vendor/thecodingmachine/safe/generated/8.1/curl.php
vendored
Normal file
@@ -0,0 +1,219 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\CurlException;
|
||||
|
||||
/**
|
||||
* @param \CurlHandle $handle
|
||||
* @return \CurlHandle
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_copy_handle(\CurlHandle $handle): \CurlHandle
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \curl_copy_handle($handle);
|
||||
if ($safeResult === false) {
|
||||
throw CurlException::createFromPhpError($handle);
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \CurlHandle $handle
|
||||
* @param string $string
|
||||
* @return string
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_escape(\CurlHandle $handle, string $string): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \curl_escape($handle, $string);
|
||||
if ($safeResult === false) {
|
||||
throw CurlException::createFromPhpError($handle);
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \CurlHandle $handle
|
||||
* @return bool|string
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_exec(\CurlHandle $handle)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \curl_exec($handle);
|
||||
if ($safeResult === false) {
|
||||
throw CurlException::createFromPhpError($handle);
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \CurlHandle $handle
|
||||
* @param int|null $option
|
||||
* @return mixed
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_getinfo(\CurlHandle $handle, ?int $option = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($option !== null) {
|
||||
$safeResult = \curl_getinfo($handle, $option);
|
||||
} else {
|
||||
$safeResult = \curl_getinfo($handle);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw CurlException::createFromPhpError($handle);
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|string $url
|
||||
* @return \CurlHandle
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_init(?string $url = null): \CurlHandle
|
||||
{
|
||||
error_clear_last();
|
||||
if ($url !== null) {
|
||||
$safeResult = \curl_init($url);
|
||||
} else {
|
||||
$safeResult = \curl_init();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw CurlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \CurlMultiHandle $multi_handle
|
||||
* @param int|null $queued_messages
|
||||
* @return array
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_multi_info_read(\CurlMultiHandle $multi_handle, ?int &$queued_messages = null): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \curl_multi_info_read($multi_handle, $queued_messages);
|
||||
if ($safeResult === false) {
|
||||
throw CurlException::createFromPhpError($multi_handle);
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return \CurlMultiHandle
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_multi_init(): \CurlMultiHandle
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \curl_multi_init();
|
||||
if ($safeResult === false) {
|
||||
throw CurlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \CurlMultiHandle $multi_handle
|
||||
* @param int $option
|
||||
* @param mixed $value
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_multi_setopt(\CurlMultiHandle $multi_handle, int $option, $value): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \curl_multi_setopt($multi_handle, $option, $value);
|
||||
if ($safeResult === false) {
|
||||
throw CurlException::createFromPhpError($multi_handle);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \CurlHandle $handle
|
||||
* @param int $option
|
||||
* @param mixed $value
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_setopt(\CurlHandle $handle, int $option, $value): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \curl_setopt($handle, $option, $value);
|
||||
if ($safeResult === false) {
|
||||
throw CurlException::createFromPhpError($handle);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \CurlShareHandle $share_handle
|
||||
* @return int
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_share_errno(\CurlShareHandle $share_handle): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \curl_share_errno($share_handle);
|
||||
if ($safeResult === false) {
|
||||
throw CurlException::createFromPhpError($share_handle);
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \CurlShareHandle $share_handle
|
||||
* @param int $option
|
||||
* @param mixed $value
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_share_setopt(\CurlShareHandle $share_handle, int $option, $value): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \curl_share_setopt($share_handle, $option, $value);
|
||||
if ($safeResult === false) {
|
||||
throw CurlException::createFromPhpError($share_handle);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \CurlHandle $handle
|
||||
* @param string $string
|
||||
* @return string
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_unescape(\CurlHandle $handle, string $string): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \curl_unescape($handle, $string);
|
||||
if ($safeResult === false) {
|
||||
throw CurlException::createFromPhpError($handle);
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
337
vendor/thecodingmachine/safe/generated/8.1/datetime.php
vendored
Normal file
337
vendor/thecodingmachine/safe/generated/8.1/datetime.php
vendored
Normal file
@@ -0,0 +1,337 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\DatetimeException;
|
||||
|
||||
/**
|
||||
* @param string $format
|
||||
* @param string $datetime
|
||||
* @return array{year: int|false, month: int|false, day: int|false, hour: int|false, minute: int|false, second: int|false, fraction: float|false, warning_count: int, warnings: string[], error_count: int, errors: string[], is_localtime: bool, zone_type: int|bool, zone: int|bool, is_dst: bool, tz_abbr: string, tz_id: string, relative: array{year: int, month: int, day: int, hour: int, minute: int, second: int, weekday: int, weekdays: int, first_day_of_month: bool, last_day_of_month: bool}}|null
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function date_parse_from_format(string $format, string $datetime): ?array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \date_parse_from_format($format, $datetime);
|
||||
if ($safeResult === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $datetime
|
||||
* @return array{year: int|false, month: int|false, day: int|false, hour: int|false, minute: int|false, second: int|false, fraction: float|false, warning_count: int, warnings: string[], error_count: int, errors: string[], is_localtime: bool, zone_type: int|bool, zone: int|bool, is_dst: bool, tz_abbr: string, tz_id: string, relative: array{year: int, month: int, day: int, hour: int, minute: int, second: int, weekday: int, weekdays: int, first_day_of_month: bool, last_day_of_month: bool}}|null
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function date_parse(string $datetime): ?array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \date_parse($datetime);
|
||||
if ($safeResult === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $timestamp
|
||||
* @param float $latitude
|
||||
* @param float $longitude
|
||||
* @return array{sunrise: int|bool,sunset: int|bool,transit: int|bool,civil_twilight_begin: int|bool,civil_twilight_end: int|bool,nautical_twilight_begin: int|bool,nautical_twilight_end: int|bool,astronomical_twilight_begin: int|bool,astronomical_twilight_end: int|bool}
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function date_sun_info(int $timestamp, float $latitude, float $longitude): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \date_sun_info($timestamp, $latitude, $longitude);
|
||||
if ($safeResult === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $timestamp
|
||||
* @param int $returnFormat
|
||||
* @param float|null $latitude
|
||||
* @param float|null $longitude
|
||||
* @param float|null $zenith
|
||||
* @param float|null $utcOffset
|
||||
* @return mixed
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function date_sunrise(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, ?float $latitude = null, ?float $longitude = null, ?float $zenith = null, ?float $utcOffset = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($utcOffset !== null) {
|
||||
$safeResult = \date_sunrise($timestamp, $returnFormat, $latitude, $longitude, $zenith, $utcOffset);
|
||||
} elseif ($zenith !== null) {
|
||||
$safeResult = \date_sunrise($timestamp, $returnFormat, $latitude, $longitude, $zenith);
|
||||
} elseif ($longitude !== null) {
|
||||
$safeResult = \date_sunrise($timestamp, $returnFormat, $latitude, $longitude);
|
||||
} elseif ($latitude !== null) {
|
||||
$safeResult = \date_sunrise($timestamp, $returnFormat, $latitude);
|
||||
} else {
|
||||
$safeResult = \date_sunrise($timestamp, $returnFormat);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $timestamp
|
||||
* @param int $returnFormat
|
||||
* @param float|null $latitude
|
||||
* @param float|null $longitude
|
||||
* @param float|null $zenith
|
||||
* @param float|null $utcOffset
|
||||
* @return mixed
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function date_sunset(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, ?float $latitude = null, ?float $longitude = null, ?float $zenith = null, ?float $utcOffset = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($utcOffset !== null) {
|
||||
$safeResult = \date_sunset($timestamp, $returnFormat, $latitude, $longitude, $zenith, $utcOffset);
|
||||
} elseif ($zenith !== null) {
|
||||
$safeResult = \date_sunset($timestamp, $returnFormat, $latitude, $longitude, $zenith);
|
||||
} elseif ($longitude !== null) {
|
||||
$safeResult = \date_sunset($timestamp, $returnFormat, $latitude, $longitude);
|
||||
} elseif ($latitude !== null) {
|
||||
$safeResult = \date_sunset($timestamp, $returnFormat, $latitude);
|
||||
} else {
|
||||
$safeResult = \date_sunset($timestamp, $returnFormat);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $format
|
||||
* @param int|null $timestamp
|
||||
* @return string
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function date(string $format, ?int $timestamp = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($timestamp !== null) {
|
||||
$safeResult = \date($format, $timestamp);
|
||||
} else {
|
||||
$safeResult = \date($format);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $hour
|
||||
* @param int|null $minute
|
||||
* @param int|null $second
|
||||
* @param int|null $month
|
||||
* @param int|null $day
|
||||
* @param int|null $year
|
||||
* @return int
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function gmmktime(int $hour, ?int $minute = null, ?int $second = null, ?int $month = null, ?int $day = null, ?int $year = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($year !== null) {
|
||||
$safeResult = \gmmktime($hour, $minute, $second, $month, $day, $year);
|
||||
} elseif ($day !== null) {
|
||||
$safeResult = \gmmktime($hour, $minute, $second, $month, $day);
|
||||
} elseif ($month !== null) {
|
||||
$safeResult = \gmmktime($hour, $minute, $second, $month);
|
||||
} elseif ($second !== null) {
|
||||
$safeResult = \gmmktime($hour, $minute, $second);
|
||||
} elseif ($minute !== null) {
|
||||
$safeResult = \gmmktime($hour, $minute);
|
||||
} else {
|
||||
$safeResult = \gmmktime($hour);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $format
|
||||
* @param int|null $timestamp
|
||||
* @return string
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function gmstrftime(string $format, ?int $timestamp = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($timestamp !== null) {
|
||||
$safeResult = \gmstrftime($format, $timestamp);
|
||||
} else {
|
||||
$safeResult = \gmstrftime($format);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $format
|
||||
* @param int|null $timestamp
|
||||
* @return int
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function idate(string $format, ?int $timestamp = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($timestamp !== null) {
|
||||
$safeResult = \idate($format, $timestamp);
|
||||
} else {
|
||||
$safeResult = \idate($format);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $hour
|
||||
* @param int|null $minute
|
||||
* @param int|null $second
|
||||
* @param int|null $month
|
||||
* @param int|null $day
|
||||
* @param int|null $year
|
||||
* @return int
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function mktime(int $hour, ?int $minute = null, ?int $second = null, ?int $month = null, ?int $day = null, ?int $year = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($year !== null) {
|
||||
$safeResult = \mktime($hour, $minute, $second, $month, $day, $year);
|
||||
} elseif ($day !== null) {
|
||||
$safeResult = \mktime($hour, $minute, $second, $month, $day);
|
||||
} elseif ($month !== null) {
|
||||
$safeResult = \mktime($hour, $minute, $second, $month);
|
||||
} elseif ($second !== null) {
|
||||
$safeResult = \mktime($hour, $minute, $second);
|
||||
} elseif ($minute !== null) {
|
||||
$safeResult = \mktime($hour, $minute);
|
||||
} else {
|
||||
$safeResult = \mktime($hour);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $format
|
||||
* @param int|null $timestamp
|
||||
* @return string
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function strftime(string $format, ?int $timestamp = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($timestamp !== null) {
|
||||
$safeResult = \strftime($format, $timestamp);
|
||||
} else {
|
||||
$safeResult = \strftime($format);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $timestamp
|
||||
* @param string $format
|
||||
* @return array
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function strptime(string $timestamp, string $format): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \strptime($timestamp, $format);
|
||||
if ($safeResult === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $datetime
|
||||
* @param int|null $baseTimestamp
|
||||
* @return int
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function strtotime(string $datetime, ?int $baseTimestamp = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($baseTimestamp !== null) {
|
||||
$safeResult = \strtotime($datetime, $baseTimestamp);
|
||||
} else {
|
||||
$safeResult = \strtotime($datetime);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $abbr
|
||||
* @param int $utcOffset
|
||||
* @param int $isDST
|
||||
* @return string
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function timezone_name_from_abbr(string $abbr, int $utcOffset = -1, int $isDST = -1): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \timezone_name_from_abbr($abbr, $utcOffset, $isDST);
|
||||
if ($safeResult === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
117
vendor/thecodingmachine/safe/generated/8.1/dir.php
vendored
Normal file
117
vendor/thecodingmachine/safe/generated/8.1/dir.php
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\DirException;
|
||||
|
||||
/**
|
||||
* @param string $directory
|
||||
* @throws DirException
|
||||
*
|
||||
*/
|
||||
function chdir(string $directory): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \chdir($directory);
|
||||
if ($safeResult === false) {
|
||||
throw DirException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $directory
|
||||
* @throws DirException
|
||||
*
|
||||
*/
|
||||
function chroot(string $directory): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \chroot($directory);
|
||||
if ($safeResult === false) {
|
||||
throw DirException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $directory
|
||||
* @param null|resource $context
|
||||
* @return \Directory
|
||||
* @throws DirException
|
||||
*
|
||||
*/
|
||||
function dir(string $directory, $context = null): \Directory
|
||||
{
|
||||
error_clear_last();
|
||||
if ($context !== null) {
|
||||
$safeResult = \dir($directory, $context);
|
||||
} else {
|
||||
$safeResult = \dir($directory);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw DirException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return non-empty-string
|
||||
* @throws DirException
|
||||
*
|
||||
*/
|
||||
function getcwd(): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \getcwd();
|
||||
if ($safeResult === false) {
|
||||
throw DirException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $directory
|
||||
* @param null|resource $context
|
||||
* @return resource
|
||||
* @throws DirException
|
||||
*
|
||||
*/
|
||||
function opendir(string $directory, $context = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($context !== null) {
|
||||
$safeResult = \opendir($directory, $context);
|
||||
} else {
|
||||
$safeResult = \opendir($directory);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw DirException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $directory
|
||||
* @param SCANDIR_SORT_ASCENDING|SCANDIR_SORT_DESCENDING|SCANDIR_SORT_NONE $sorting_order
|
||||
* @param null|resource $context
|
||||
* @return list
|
||||
* @throws DirException
|
||||
*
|
||||
*/
|
||||
function scandir(string $directory, int $sorting_order = SCANDIR_SORT_ASCENDING, $context = null): array
|
||||
{
|
||||
error_clear_last();
|
||||
if ($context !== null) {
|
||||
$safeResult = \scandir($directory, $sorting_order, $context);
|
||||
} else {
|
||||
$safeResult = \scandir($directory, $sorting_order);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw DirException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
809
vendor/thecodingmachine/safe/generated/8.1/eio.php
vendored
Normal file
809
vendor/thecodingmachine/safe/generated/8.1/eio.php
vendored
Normal file
@@ -0,0 +1,809 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\EioException;
|
||||
|
||||
/**
|
||||
* @param int $delay
|
||||
* @param int $pri
|
||||
* @param callable|null $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_busy(int $delay, int $pri = EIO_PRI_DEFAULT, ?callable $callback = null, $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \eio_busy($delay, $pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @param int $mode
|
||||
* @param int $pri
|
||||
* @param callable|null $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_chmod(string $path, int $mode, int $pri = EIO_PRI_DEFAULT, ?callable $callback = null, $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \eio_chmod($path, $mode, $pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @param int $uid
|
||||
* @param int $gid
|
||||
* @param int $pri
|
||||
* @param callable|null $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @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();
|
||||
$safeResult = \eio_chown($path, $uid, $gid, $pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param mixed $fd
|
||||
* @param int $pri
|
||||
* @param callable|null $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_close($fd, int $pri = EIO_PRI_DEFAULT, ?callable $callback = null, $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \eio_close($fd, $pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param callable $execute
|
||||
* @param int $pri
|
||||
* @param callable $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_custom(callable $execute, int $pri, callable $callback, $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \eio_custom($execute, $pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param mixed $fd
|
||||
* @param mixed $fd2
|
||||
* @param int $pri
|
||||
* @param callable|null $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_dup2($fd, $fd2, int $pri = EIO_PRI_DEFAULT, ?callable $callback = null, $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \eio_dup2($fd, $fd2, $pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_event_loop(): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \eio_event_loop();
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param mixed $fd
|
||||
* @param int $mode
|
||||
* @param int $offset
|
||||
* @param int $length
|
||||
* @param int $pri
|
||||
* @param callable|null $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @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();
|
||||
$safeResult = \eio_fallocate($fd, $mode, $offset, $length, $pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param mixed $fd
|
||||
* @param int $mode
|
||||
* @param int $pri
|
||||
* @param callable|null $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_fchmod($fd, int $mode, int $pri = EIO_PRI_DEFAULT, ?callable $callback = null, $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \eio_fchmod($fd, $mode, $pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param mixed $fd
|
||||
* @param int $uid
|
||||
* @param int $gid
|
||||
* @param int $pri
|
||||
* @param callable|null $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_fchown($fd, int $uid, int $gid = -1, int $pri = EIO_PRI_DEFAULT, ?callable $callback = null, $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \eio_fchown($fd, $uid, $gid, $pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param mixed $fd
|
||||
* @param int $pri
|
||||
* @param callable|null $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_fdatasync($fd, int $pri = EIO_PRI_DEFAULT, ?callable $callback = null, $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \eio_fdatasync($fd, $pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param mixed $fd
|
||||
* @param int $pri
|
||||
* @param callable $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_fstat($fd, int $pri, callable $callback, $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($data !== null) {
|
||||
$safeResult = \eio_fstat($fd, $pri, $callback, $data);
|
||||
} else {
|
||||
$safeResult = \eio_fstat($fd, $pri, $callback);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param mixed $fd
|
||||
* @param int $pri
|
||||
* @param callable $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_fstatvfs($fd, int $pri, callable $callback, $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($data !== null) {
|
||||
$safeResult = \eio_fstatvfs($fd, $pri, $callback, $data);
|
||||
} else {
|
||||
$safeResult = \eio_fstatvfs($fd, $pri, $callback);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param mixed $fd
|
||||
* @param int $pri
|
||||
* @param callable|null $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_fsync($fd, int $pri = EIO_PRI_DEFAULT, ?callable $callback = null, $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \eio_fsync($fd, $pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param mixed $fd
|
||||
* @param int $offset
|
||||
* @param int $pri
|
||||
* @param callable|null $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_ftruncate($fd, int $offset = 0, int $pri = EIO_PRI_DEFAULT, ?callable $callback = null, $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \eio_ftruncate($fd, $offset, $pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param mixed $fd
|
||||
* @param float $atime
|
||||
* @param float $mtime
|
||||
* @param int $pri
|
||||
* @param callable|null $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_futime($fd, float $atime, float $mtime, int $pri = EIO_PRI_DEFAULT, ?callable $callback = null, $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \eio_futime($fd, $atime, $mtime, $pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param callable $callback
|
||||
* @param null|string $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_grp(callable $callback, ?string $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \eio_grp($callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @param int $pri
|
||||
* @param callable $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_lstat(string $path, int $pri, callable $callback, $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \eio_lstat($path, $pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @param int $mode
|
||||
* @param int $pri
|
||||
* @param callable|null $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_mkdir(string $path, int $mode, int $pri = EIO_PRI_DEFAULT, ?callable $callback = null, $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \eio_mkdir($path, $mode, $pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @param int $mode
|
||||
* @param int $dev
|
||||
* @param int $pri
|
||||
* @param callable|null $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_mknod(string $path, int $mode, int $dev, int $pri = EIO_PRI_DEFAULT, ?callable $callback = null, $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \eio_mknod($path, $mode, $dev, $pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $pri
|
||||
* @param callable|null $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_nop(int $pri = EIO_PRI_DEFAULT, ?callable $callback = null, $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \eio_nop($pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param mixed $fd
|
||||
* @param int $offset
|
||||
* @param int $length
|
||||
* @param int $pri
|
||||
* @param callable|null $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_readahead($fd, int $offset, int $length, int $pri = EIO_PRI_DEFAULT, ?callable $callback = null, $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \eio_readahead($fd, $offset, $length, $pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @param int $flags
|
||||
* @param int $pri
|
||||
* @param callable $callback
|
||||
* @param null|string $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_readdir(string $path, int $flags, int $pri, callable $callback, ?string $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \eio_readdir($path, $flags, $pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @param int $pri
|
||||
* @param callable $callback
|
||||
* @param null|string $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_readlink(string $path, int $pri, callable $callback, ?string $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \eio_readlink($path, $pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @param string $new_path
|
||||
* @param int $pri
|
||||
* @param callable|null $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_rename(string $path, string $new_path, int $pri = EIO_PRI_DEFAULT, ?callable $callback = null, $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \eio_rename($path, $new_path, $pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @param int $pri
|
||||
* @param callable|null $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_rmdir(string $path, int $pri = EIO_PRI_DEFAULT, ?callable $callback = null, $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \eio_rmdir($path, $pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param mixed $fd
|
||||
* @param int $offset
|
||||
* @param int $whence
|
||||
* @param int $pri
|
||||
* @param callable|null $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_seek($fd, int $offset, int $whence, int $pri = EIO_PRI_DEFAULT, ?callable $callback = null, $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \eio_seek($fd, $offset, $whence, $pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param mixed $out_fd
|
||||
* @param mixed $in_fd
|
||||
* @param int $offset
|
||||
* @param int $length
|
||||
* @param int $pri
|
||||
* @param callable $callback
|
||||
* @param string $data
|
||||
* @return resource
|
||||
* @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) {
|
||||
$safeResult = \eio_sendfile($out_fd, $in_fd, $offset, $length, $pri, $callback, $data);
|
||||
} elseif ($callback !== null) {
|
||||
$safeResult = \eio_sendfile($out_fd, $in_fd, $offset, $length, $pri, $callback);
|
||||
} elseif ($pri !== null) {
|
||||
$safeResult = \eio_sendfile($out_fd, $in_fd, $offset, $length, $pri);
|
||||
} else {
|
||||
$safeResult = \eio_sendfile($out_fd, $in_fd, $offset, $length);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @param int $pri
|
||||
* @param callable $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_stat(string $path, int $pri, callable $callback, $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \eio_stat($path, $pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @param int $pri
|
||||
* @param callable $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_statvfs(string $path, int $pri, callable $callback, $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($data !== null) {
|
||||
$safeResult = \eio_statvfs($path, $pri, $callback, $data);
|
||||
} else {
|
||||
$safeResult = \eio_statvfs($path, $pri, $callback);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @param string $new_path
|
||||
* @param int $pri
|
||||
* @param callable|null $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_symlink(string $path, string $new_path, int $pri = EIO_PRI_DEFAULT, ?callable $callback = null, $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \eio_symlink($path, $new_path, $pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param mixed $fd
|
||||
* @param int $offset
|
||||
* @param int $nbytes
|
||||
* @param int $flags
|
||||
* @param int $pri
|
||||
* @param callable|null $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @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();
|
||||
$safeResult = \eio_sync_file_range($fd, $offset, $nbytes, $flags, $pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $pri
|
||||
* @param callable|null $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_sync(int $pri = EIO_PRI_DEFAULT, ?callable $callback = null, $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \eio_sync($pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param mixed $fd
|
||||
* @param int $pri
|
||||
* @param callable|null $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_syncfs($fd, int $pri = EIO_PRI_DEFAULT, ?callable $callback = null, $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \eio_syncfs($fd, $pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @param int $offset
|
||||
* @param int $pri
|
||||
* @param callable|null $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_truncate(string $path, int $offset = 0, int $pri = EIO_PRI_DEFAULT, ?callable $callback = null, $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \eio_truncate($path, $offset, $pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @param int $pri
|
||||
* @param callable|null $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_unlink(string $path, int $pri = EIO_PRI_DEFAULT, ?callable $callback = null, $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \eio_unlink($path, $pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @param float $atime
|
||||
* @param float $mtime
|
||||
* @param int $pri
|
||||
* @param callable|null $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_utime(string $path, float $atime, float $mtime, int $pri = EIO_PRI_DEFAULT, ?callable $callback = null, $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \eio_utime($path, $atime, $mtime, $pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param mixed $fd
|
||||
* @param string $str
|
||||
* @param int $length
|
||||
* @param int $offset
|
||||
* @param int $pri
|
||||
* @param callable|null $callback
|
||||
* @param mixed $data
|
||||
* @return resource
|
||||
* @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();
|
||||
$safeResult = \eio_write($fd, $str, $length, $offset, $pri, $callback, $data);
|
||||
if ($safeResult === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
28
vendor/thecodingmachine/safe/generated/8.1/errorfunc.php
vendored
Normal file
28
vendor/thecodingmachine/safe/generated/8.1/errorfunc.php
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\ErrorfuncException;
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
* @param 0|1|2|3|4 $message_type
|
||||
* @param string $destination
|
||||
* @param string $extra_headers
|
||||
* @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) {
|
||||
$safeResult = \error_log($message, $message_type, $destination, $extra_headers);
|
||||
} elseif ($destination !== null) {
|
||||
$safeResult = \error_log($message, $message_type, $destination);
|
||||
} else {
|
||||
$safeResult = \error_log($message, $message_type);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw ErrorfuncException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
120
vendor/thecodingmachine/safe/generated/8.1/exec.php
vendored
Normal file
120
vendor/thecodingmachine/safe/generated/8.1/exec.php
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\ExecException;
|
||||
|
||||
/**
|
||||
* @param string $command
|
||||
* @param array|null $output
|
||||
* @param int|null $result_code
|
||||
* @return string
|
||||
* @throws ExecException
|
||||
*
|
||||
*/
|
||||
function exec(string $command, ?array &$output = null, ?int &$result_code = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \exec($command, $output, $result_code);
|
||||
if ($safeResult === false) {
|
||||
throw ExecException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $process
|
||||
* @return int
|
||||
* @throws ExecException
|
||||
*
|
||||
*/
|
||||
function proc_close($process): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \proc_close($process);
|
||||
if ($safeResult === -1) {
|
||||
throw ExecException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $priority
|
||||
* @throws ExecException
|
||||
*
|
||||
*/
|
||||
function proc_nice(int $priority): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \proc_nice($priority);
|
||||
if ($safeResult === false) {
|
||||
throw ExecException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $cmd
|
||||
* @param array $descriptorspec
|
||||
* @param null|resource[] $pipes
|
||||
* @param null|string $cwd
|
||||
* @param array|null $env
|
||||
* @param array|null $other_options
|
||||
* @return resource
|
||||
* @throws ExecException
|
||||
*
|
||||
*/
|
||||
function proc_open(string $cmd, array $descriptorspec, ?array &$pipes, ?string $cwd = null, ?array $env = null, ?array $other_options = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($other_options !== null) {
|
||||
$safeResult = \proc_open($cmd, $descriptorspec, $pipes, $cwd, $env, $other_options);
|
||||
} elseif ($env !== null) {
|
||||
$safeResult = \proc_open($cmd, $descriptorspec, $pipes, $cwd, $env);
|
||||
} elseif ($cwd !== null) {
|
||||
$safeResult = \proc_open($cmd, $descriptorspec, $pipes, $cwd);
|
||||
} else {
|
||||
$safeResult = \proc_open($cmd, $descriptorspec, $pipes);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw ExecException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $command
|
||||
* @return null|string
|
||||
* @throws ExecException
|
||||
*
|
||||
*/
|
||||
function shell_exec(string $command): ?string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \shell_exec($command);
|
||||
if ($safeResult === false) {
|
||||
throw ExecException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $command
|
||||
* @param int|null $result_code
|
||||
* @return string
|
||||
* @throws ExecException
|
||||
*
|
||||
*/
|
||||
function system(string $command, ?int &$result_code = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \system($command, $result_code);
|
||||
if ($safeResult === false) {
|
||||
throw ExecException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
58
vendor/thecodingmachine/safe/generated/8.1/fileinfo.php
vendored
Normal file
58
vendor/thecodingmachine/safe/generated/8.1/fileinfo.php
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\FileinfoException;
|
||||
|
||||
/**
|
||||
* @param \finfo $finfo
|
||||
* @throws FileinfoException
|
||||
*
|
||||
*/
|
||||
function finfo_close(\finfo $finfo): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \finfo_close($finfo);
|
||||
if ($safeResult === false) {
|
||||
throw FileinfoException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $flags
|
||||
* @param null|string $magic_database
|
||||
* @return \finfo
|
||||
* @throws FileinfoException
|
||||
*
|
||||
*/
|
||||
function finfo_open(int $flags = FILEINFO_NONE, ?string $magic_database = null): \finfo
|
||||
{
|
||||
error_clear_last();
|
||||
if ($magic_database !== null) {
|
||||
$safeResult = \finfo_open($flags, $magic_database);
|
||||
} else {
|
||||
$safeResult = \finfo_open($flags);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw FileinfoException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource|string $filename
|
||||
* @return string
|
||||
* @throws FileinfoException
|
||||
*
|
||||
*/
|
||||
function mime_content_type($filename): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mime_content_type($filename);
|
||||
if ($safeResult === false) {
|
||||
throw FileinfoException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
895
vendor/thecodingmachine/safe/generated/8.1/filesystem.php
vendored
Normal file
895
vendor/thecodingmachine/safe/generated/8.1/filesystem.php
vendored
Normal file
@@ -0,0 +1,895 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\FilesystemException;
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param int|string $group
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function chgrp(string $filename, $group): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \chgrp($filename, $group);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param int $permissions
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function chmod(string $filename, int $permissions): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \chmod($filename, $permissions);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param int|string $user
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function chown(string $filename, $user): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \chown($filename, $user);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $source
|
||||
* @param string $dest
|
||||
* @param resource $context
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function copy(string $source, string $dest, $context = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($context !== null) {
|
||||
$safeResult = \copy($source, $dest, $context);
|
||||
} else {
|
||||
$safeResult = \copy($source, $dest);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $directory
|
||||
* @return float
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function disk_free_space(string $directory): float
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \disk_free_space($directory);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $directory
|
||||
* @return float
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function disk_total_space(string $directory): float
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \disk_total_space($directory);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fclose($stream): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \fclose($stream);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fdatasync($stream): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \fdatasync($stream);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fflush($stream): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \fflush($stream);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param bool $use_include_path
|
||||
* @param null|resource $context
|
||||
* @param int $offset
|
||||
* @param 0|positive-int $length
|
||||
* @return string
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function file_get_contents(string $filename, bool $use_include_path = false, $context = null, int $offset = 0, ?int $length = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($length !== null) {
|
||||
$safeResult = \file_get_contents($filename, $use_include_path, $context, $offset, $length);
|
||||
} elseif ($offset !== 0) {
|
||||
$safeResult = \file_get_contents($filename, $use_include_path, $context, $offset);
|
||||
} elseif ($context !== null) {
|
||||
$safeResult = \file_get_contents($filename, $use_include_path, $context);
|
||||
} else {
|
||||
$safeResult = \file_get_contents($filename, $use_include_path);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param mixed $data
|
||||
* @param int $flags
|
||||
* @param null|resource $context
|
||||
* @return 0|positive-int
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function file_put_contents(string $filename, $data, int $flags = 0, $context = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($context !== null) {
|
||||
$safeResult = \file_put_contents($filename, $data, $flags, $context);
|
||||
} else {
|
||||
$safeResult = \file_put_contents($filename, $data, $flags);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param int-mask $flags
|
||||
* @param resource $context
|
||||
* @return list
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function file(string $filename, int $flags = 0, $context = null): array
|
||||
{
|
||||
error_clear_last();
|
||||
if ($context !== null) {
|
||||
$safeResult = \file($filename, $flags, $context);
|
||||
} else {
|
||||
$safeResult = \file($filename, $flags);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @return int
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fileatime(string $filename): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \fileatime($filename);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @return int
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function filectime(string $filename): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \filectime($filename);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @return int
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fileinode(string $filename): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \fileinode($filename);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @return int
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function filemtime(string $filename): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \filemtime($filename);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @return int
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fileowner(string $filename): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \fileowner($filename);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @return int
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fileperms(string $filename): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \fileperms($filename);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @return 0|positive-int
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function filesize(string $filename): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \filesize($filename);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @return string
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function filetype(string $filename): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \filetype($filename);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @param int-mask $operation
|
||||
* @param 0|1|null $would_block
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function flock($stream, int $operation, ?int &$would_block = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \flock($stream, $operation, $would_block);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param string $mode
|
||||
* @param bool $use_include_path
|
||||
* @param null|resource $context
|
||||
* @return resource
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fopen(string $filename, string $mode, bool $use_include_path = false, $context = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($context !== null) {
|
||||
$safeResult = \fopen($filename, $mode, $use_include_path, $context);
|
||||
} else {
|
||||
$safeResult = \fopen($filename, $mode, $use_include_path);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @param positive-int $length
|
||||
* @return string
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fread($stream, int $length): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \fread($stream, $length);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @return array
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fstat($stream): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \fstat($stream);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fsync($stream): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \fsync($stream);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @return int
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function ftell($stream): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ftell($stream);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @param 0|positive-int $size
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function ftruncate($stream, int $size): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ftruncate($stream, $size);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $handle
|
||||
* @param string $string
|
||||
* @param 0|positive-int $length
|
||||
* @return 0|positive-int
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fwrite($handle, string $string, ?int $length = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($length !== null) {
|
||||
$safeResult = \fwrite($handle, $string, $length);
|
||||
} else {
|
||||
$safeResult = \fwrite($handle, $string);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $pattern
|
||||
* @param int $flags
|
||||
* @return list
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function glob(string $pattern, int $flags = 0): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \glob($pattern, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param int|string $group
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function lchgrp(string $filename, $group): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \lchgrp($filename, $group);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param int|string $user
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function lchown(string $filename, $user): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \lchown($filename, $user);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $target
|
||||
* @param string $link
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function link(string $target, string $link): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \link($target, $link);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @return array
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function lstat(string $filename): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \lstat($filename);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $directory
|
||||
* @param int $permissions
|
||||
* @param bool $recursive
|
||||
* @param resource $context
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function mkdir(string $directory, int $permissions = 0777, bool $recursive = false, $context = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($context !== null) {
|
||||
$safeResult = \mkdir($directory, $permissions, $recursive, $context);
|
||||
} else {
|
||||
$safeResult = \mkdir($directory, $permissions, $recursive);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param bool $process_sections
|
||||
* @param int $scanner_mode
|
||||
* @return array
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function parse_ini_file(string $filename, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \parse_ini_file($filename, $process_sections, $scanner_mode);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $ini_string
|
||||
* @param bool $process_sections
|
||||
* @param int $scanner_mode
|
||||
* @return array
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function parse_ini_string(string $ini_string, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \parse_ini_string($ini_string, $process_sections, $scanner_mode);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $handle
|
||||
* @return int
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function pclose($handle): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pclose($handle);
|
||||
if ($safeResult === -1) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $command
|
||||
* @param string $mode
|
||||
* @return resource
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function popen(string $command, string $mode)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \popen($command, $mode);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param bool $use_include_path
|
||||
* @param resource $context
|
||||
* @return 0|positive-int
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function readfile(string $filename, bool $use_include_path = false, $context = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($context !== null) {
|
||||
$safeResult = \readfile($filename, $use_include_path, $context);
|
||||
} else {
|
||||
$safeResult = \readfile($filename, $use_include_path);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @return string
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function readlink(string $path): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \readlink($path);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @return non-empty-string
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function realpath(string $path): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \realpath($path);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $oldname
|
||||
* @param string $newname
|
||||
* @param resource $context
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function rename(string $oldname, string $newname, $context = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($context !== null) {
|
||||
$safeResult = \rename($oldname, $newname, $context);
|
||||
} else {
|
||||
$safeResult = \rename($oldname, $newname);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function rewind($stream): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \rewind($stream);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $directory
|
||||
* @param resource $context
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function rmdir(string $directory, $context = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($context !== null) {
|
||||
$safeResult = \rmdir($directory, $context);
|
||||
} else {
|
||||
$safeResult = \rmdir($directory);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $target
|
||||
* @param string $link
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function symlink(string $target, string $link): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \symlink($target, $link);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $directory
|
||||
* @param string $prefix
|
||||
* @return non-falsy-string
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function tempnam(string $directory, string $prefix): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \tempnam($directory, $prefix);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return resource
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function tmpfile()
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \tmpfile();
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param int $time
|
||||
* @param int $atime
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function touch(string $filename, ?int $time = null, ?int $atime = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($atime !== null) {
|
||||
$safeResult = \touch($filename, $time, $atime);
|
||||
} elseif ($time !== null) {
|
||||
$safeResult = \touch($filename, $time);
|
||||
} else {
|
||||
$safeResult = \touch($filename);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param resource $context
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function unlink(string $filename, $context = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($context !== null) {
|
||||
$safeResult = \unlink($filename, $context);
|
||||
} else {
|
||||
$safeResult = \unlink($filename);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
42
vendor/thecodingmachine/safe/generated/8.1/filter.php
vendored
Normal file
42
vendor/thecodingmachine/safe/generated/8.1/filter.php
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\FilterException;
|
||||
|
||||
/**
|
||||
* @param int $type
|
||||
* @param array|int $options
|
||||
* @param bool $add_empty
|
||||
* @return array|null
|
||||
* @throws FilterException
|
||||
*
|
||||
*/
|
||||
function filter_input_array(int $type, $options = FILTER_DEFAULT, bool $add_empty = true): ?array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \filter_input_array($type, $options, $add_empty);
|
||||
if ($safeResult === false) {
|
||||
throw FilterException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $array
|
||||
* @param mixed $options
|
||||
* @param bool $add_empty
|
||||
* @return array|null
|
||||
* @throws FilterException
|
||||
*
|
||||
*/
|
||||
function filter_var_array(array $array, $options = FILTER_DEFAULT, bool $add_empty = true): ?array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \filter_var_array($array, $options, $add_empty);
|
||||
if ($safeResult === false) {
|
||||
throw FilterException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
18
vendor/thecodingmachine/safe/generated/8.1/fpm.php
vendored
Normal file
18
vendor/thecodingmachine/safe/generated/8.1/fpm.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\FpmException;
|
||||
|
||||
/**
|
||||
* @throws FpmException
|
||||
*
|
||||
*/
|
||||
function fastcgi_finish_request(): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \fastcgi_finish_request();
|
||||
if ($safeResult === false) {
|
||||
throw FpmException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
443
vendor/thecodingmachine/safe/generated/8.1/ftp.php
vendored
Normal file
443
vendor/thecodingmachine/safe/generated/8.1/ftp.php
vendored
Normal file
@@ -0,0 +1,443 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\FtpException;
|
||||
|
||||
/**
|
||||
* @param \FTP\Connection $ftp
|
||||
* @param int $size
|
||||
* @param null|string $response
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_alloc(\FTP\Connection $ftp, int $size, ?string &$response = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ftp_alloc($ftp, $size, $response);
|
||||
if ($safeResult === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \FTP\Connection $ftp
|
||||
* @param string $remote_filename
|
||||
* @param string $local_filename
|
||||
* @param FTP_ASCII|FTP_BINARY $mode
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_append(\FTP\Connection $ftp, string $remote_filename, string $local_filename, int $mode = FTP_BINARY): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ftp_append($ftp, $remote_filename, $local_filename, $mode);
|
||||
if ($safeResult === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \FTP\Connection $ftp
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_cdup(\FTP\Connection $ftp): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ftp_cdup($ftp);
|
||||
if ($safeResult === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \FTP\Connection $ftp
|
||||
* @param string $directory
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_chdir(\FTP\Connection $ftp, string $directory): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ftp_chdir($ftp, $directory);
|
||||
if ($safeResult === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \FTP\Connection $ftp
|
||||
* @param int $permissions
|
||||
* @param string $filename
|
||||
* @return int
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_chmod(\FTP\Connection $ftp, int $permissions, string $filename): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ftp_chmod($ftp, $permissions, $filename);
|
||||
if ($safeResult === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \FTP\Connection $ftp
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_close(\FTP\Connection $ftp): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ftp_close($ftp);
|
||||
if ($safeResult === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $hostname
|
||||
* @param int $port
|
||||
* @param int $timeout
|
||||
* @return \FTP\Connection
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_connect(string $hostname, int $port = 21, int $timeout = 90): \FTP\Connection
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ftp_connect($hostname, $port, $timeout);
|
||||
if ($safeResult === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \FTP\Connection $ftp
|
||||
* @param string $filename
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_delete(\FTP\Connection $ftp, string $filename): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ftp_delete($ftp, $filename);
|
||||
if ($safeResult === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \FTP\Connection $ftp
|
||||
* @param resource $stream
|
||||
* @param string $remote_filename
|
||||
* @param FTP_ASCII|FTP_BINARY $mode
|
||||
* @param int $offset
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_fget(\FTP\Connection $ftp, $stream, string $remote_filename, int $mode = FTP_BINARY, int $offset = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ftp_fget($ftp, $stream, $remote_filename, $mode, $offset);
|
||||
if ($safeResult === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \FTP\Connection $ftp
|
||||
* @param string $remote_filename
|
||||
* @param resource $stream
|
||||
* @param FTP_ASCII|FTP_BINARY $mode
|
||||
* @param int $offset
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_fput(\FTP\Connection $ftp, string $remote_filename, $stream, int $mode = FTP_BINARY, int $offset = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ftp_fput($ftp, $remote_filename, $stream, $mode, $offset);
|
||||
if ($safeResult === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \FTP\Connection $ftp
|
||||
* @param string $local_filename
|
||||
* @param string $remote_filename
|
||||
* @param FTP_ASCII|FTP_BINARY $mode
|
||||
* @param int $offset
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_get(\FTP\Connection $ftp, string $local_filename, string $remote_filename, int $mode = FTP_BINARY, int $offset = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ftp_get($ftp, $local_filename, $remote_filename, $mode, $offset);
|
||||
if ($safeResult === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \FTP\Connection $ftp
|
||||
* @param string $username
|
||||
* @param string $password
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_login(\FTP\Connection $ftp, string $username, string $password): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ftp_login($ftp, $username, $password);
|
||||
if ($safeResult === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \FTP\Connection $ftp
|
||||
* @param string $directory
|
||||
* @return string
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_mkdir(\FTP\Connection $ftp, string $directory): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ftp_mkdir($ftp, $directory);
|
||||
if ($safeResult === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \FTP\Connection $ftp
|
||||
* @param string $directory
|
||||
* @return array
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_mlsd(\FTP\Connection $ftp, string $directory): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ftp_mlsd($ftp, $directory);
|
||||
if ($safeResult === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \FTP\Connection $ftp
|
||||
* @param string $remote_filename
|
||||
* @param string $local_filename
|
||||
* @param FTP_ASCII|FTP_BINARY $mode
|
||||
* @param int $offset
|
||||
* @return int
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_nb_put(\FTP\Connection $ftp, string $remote_filename, string $local_filename, int $mode = FTP_BINARY, int $offset = 0): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ftp_nb_put($ftp, $remote_filename, $local_filename, $mode, $offset);
|
||||
if ($safeResult === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \FTP\Connection $ftp
|
||||
* @param string $directory
|
||||
* @return array
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_nlist(\FTP\Connection $ftp, string $directory): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ftp_nlist($ftp, $directory);
|
||||
if ($safeResult === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \FTP\Connection $ftp
|
||||
* @param bool $enable
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_pasv(\FTP\Connection $ftp, bool $enable): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ftp_pasv($ftp, $enable);
|
||||
if ($safeResult === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \FTP\Connection $ftp
|
||||
* @param string $remote_filename
|
||||
* @param string $local_filename
|
||||
* @param FTP_ASCII|FTP_BINARY $mode
|
||||
* @param int $offset
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_put(\FTP\Connection $ftp, string $remote_filename, string $local_filename, int $mode = FTP_BINARY, int $offset = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ftp_put($ftp, $remote_filename, $local_filename, $mode, $offset);
|
||||
if ($safeResult === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \FTP\Connection $ftp
|
||||
* @return string
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_pwd(\FTP\Connection $ftp): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ftp_pwd($ftp);
|
||||
if ($safeResult === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \FTP\Connection $ftp
|
||||
* @param string $from
|
||||
* @param string $to
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_rename(\FTP\Connection $ftp, string $from, string $to): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ftp_rename($ftp, $from, $to);
|
||||
if ($safeResult === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \FTP\Connection $ftp
|
||||
* @param string $directory
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_rmdir(\FTP\Connection $ftp, string $directory): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ftp_rmdir($ftp, $directory);
|
||||
if ($safeResult === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \FTP\Connection $ftp
|
||||
* @param string $command
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_site(\FTP\Connection $ftp, string $command): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ftp_site($ftp, $command);
|
||||
if ($safeResult === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \FTP\Connection $ftp
|
||||
* @param string $filename
|
||||
* @return int
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_size(\FTP\Connection $ftp, string $filename): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ftp_size($ftp, $filename);
|
||||
if ($safeResult === -1) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $hostname
|
||||
* @param int $port
|
||||
* @param int $timeout
|
||||
* @return \FTP\Connection
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_ssl_connect(string $hostname, int $port = 21, int $timeout = 90): \FTP\Connection
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ftp_ssl_connect($hostname, $port, $timeout);
|
||||
if ($safeResult === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \FTP\Connection $ftp
|
||||
* @return string
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_systype(\FTP\Connection $ftp): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ftp_systype($ftp);
|
||||
if ($safeResult === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
24
vendor/thecodingmachine/safe/generated/8.1/funchand.php
vendored
Normal file
24
vendor/thecodingmachine/safe/generated/8.1/funchand.php
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\FunchandException;
|
||||
|
||||
/**
|
||||
* @param callable(): void $callback
|
||||
* @param mixed $args
|
||||
* @throws FunchandException
|
||||
*
|
||||
*/
|
||||
function register_tick_function(callable $callback, ...$args): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($args !== []) {
|
||||
$safeResult = \register_tick_function($callback, ...$args);
|
||||
} else {
|
||||
$safeResult = \register_tick_function($callback);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw FunchandException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
1101
vendor/thecodingmachine/safe/generated/8.1/functionsList.php
vendored
Normal file
1101
vendor/thecodingmachine/safe/generated/8.1/functionsList.php
vendored
Normal file
File diff suppressed because it is too large
Load Diff
22
vendor/thecodingmachine/safe/generated/8.1/gettext.php
vendored
Normal file
22
vendor/thecodingmachine/safe/generated/8.1/gettext.php
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\GettextException;
|
||||
|
||||
/**
|
||||
* @param string $domain
|
||||
* @param string $directory
|
||||
* @return string
|
||||
* @throws GettextException
|
||||
*
|
||||
*/
|
||||
function bindtextdomain(string $domain, string $directory): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \bindtextdomain($domain, $directory);
|
||||
if ($safeResult === false) {
|
||||
throw GettextException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
19
vendor/thecodingmachine/safe/generated/8.1/gmp.php
vendored
Normal file
19
vendor/thecodingmachine/safe/generated/8.1/gmp.php
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\GmpException;
|
||||
|
||||
/**
|
||||
* @param \GMP|int|string $seed
|
||||
* @throws GmpException
|
||||
*
|
||||
*/
|
||||
function gmp_random_seed($seed): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gmp_random_seed($seed);
|
||||
if ($safeResult === false) {
|
||||
throw GmpException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
135
vendor/thecodingmachine/safe/generated/8.1/gnupg.php
vendored
Normal file
135
vendor/thecodingmachine/safe/generated/8.1/gnupg.php
vendored
Normal file
@@ -0,0 +1,135 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\GnupgException;
|
||||
|
||||
/**
|
||||
* @param resource $identifier
|
||||
* @param string $fingerprint
|
||||
* @param string $passphrase
|
||||
* @throws GnupgException
|
||||
*
|
||||
*/
|
||||
function gnupg_adddecryptkey($identifier, string $fingerprint, string $passphrase): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gnupg_adddecryptkey($identifier, $fingerprint, $passphrase);
|
||||
if ($safeResult === false) {
|
||||
throw GnupgException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $identifier
|
||||
* @param string $fingerprint
|
||||
* @throws GnupgException
|
||||
*
|
||||
*/
|
||||
function gnupg_addencryptkey($identifier, string $fingerprint): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gnupg_addencryptkey($identifier, $fingerprint);
|
||||
if ($safeResult === false) {
|
||||
throw GnupgException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $identifier
|
||||
* @param string $fingerprint
|
||||
* @param string $passphrase
|
||||
* @throws GnupgException
|
||||
*
|
||||
*/
|
||||
function gnupg_addsignkey($identifier, string $fingerprint, ?string $passphrase = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($passphrase !== null) {
|
||||
$safeResult = \gnupg_addsignkey($identifier, $fingerprint, $passphrase);
|
||||
} else {
|
||||
$safeResult = \gnupg_addsignkey($identifier, $fingerprint);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw GnupgException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $identifier
|
||||
* @throws GnupgException
|
||||
*
|
||||
*/
|
||||
function gnupg_cleardecryptkeys($identifier): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gnupg_cleardecryptkeys($identifier);
|
||||
if ($safeResult === false) {
|
||||
throw GnupgException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $identifier
|
||||
* @throws GnupgException
|
||||
*
|
||||
*/
|
||||
function gnupg_clearencryptkeys($identifier): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gnupg_clearencryptkeys($identifier);
|
||||
if ($safeResult === false) {
|
||||
throw GnupgException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $identifier
|
||||
* @throws GnupgException
|
||||
*
|
||||
*/
|
||||
function gnupg_clearsignkeys($identifier): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gnupg_clearsignkeys($identifier);
|
||||
if ($safeResult === false) {
|
||||
throw GnupgException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $identifier
|
||||
* @param int $armor
|
||||
* @throws GnupgException
|
||||
*
|
||||
*/
|
||||
function gnupg_setarmor($identifier, int $armor): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gnupg_setarmor($identifier, $armor);
|
||||
if ($safeResult === false) {
|
||||
throw GnupgException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $identifier
|
||||
* @param int $signmode
|
||||
* @throws GnupgException
|
||||
*
|
||||
*/
|
||||
function gnupg_setsignmode($identifier, int $signmode): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gnupg_setsignmode($identifier, $signmode);
|
||||
if ($safeResult === false) {
|
||||
throw GnupgException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
46
vendor/thecodingmachine/safe/generated/8.1/hash.php
vendored
Normal file
46
vendor/thecodingmachine/safe/generated/8.1/hash.php
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\HashException;
|
||||
|
||||
/**
|
||||
* @param string $algo
|
||||
* @param string $key
|
||||
* @param int $length
|
||||
* @param string $info
|
||||
* @param string $salt
|
||||
* @return non-falsy-string
|
||||
* @throws HashException
|
||||
*
|
||||
*/
|
||||
function hash_hkdf(string $algo, string $key, int $length = 0, string $info = "", string $salt = ""): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \hash_hkdf($algo, $key, $length, $info, $salt);
|
||||
if ($safeResult === false) {
|
||||
throw HashException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \HashContext $context
|
||||
* @param string $filename
|
||||
* @param \HashContext|null $stream_context
|
||||
* @throws HashException
|
||||
*
|
||||
*/
|
||||
function hash_update_file(\HashContext $context, string $filename, ?\HashContext $stream_context = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($stream_context !== null) {
|
||||
$safeResult = \hash_update_file($context, $filename, $stream_context);
|
||||
} else {
|
||||
$safeResult = \hash_update_file($context, $filename);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw HashException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
498
vendor/thecodingmachine/safe/generated/8.1/ibase.php
vendored
Normal file
498
vendor/thecodingmachine/safe/generated/8.1/ibase.php
vendored
Normal file
@@ -0,0 +1,498 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\IbaseException;
|
||||
|
||||
/**
|
||||
* @param resource $blob_handle
|
||||
* @throws IbaseException
|
||||
*
|
||||
*/
|
||||
function fbird_blob_cancel($blob_handle): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \fbird_blob_cancel($blob_handle);
|
||||
if ($safeResult === false) {
|
||||
throw IbaseException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $service_handle
|
||||
* @param string $user_name
|
||||
* @param string $password
|
||||
* @param string $first_name
|
||||
* @param string $middle_name
|
||||
* @param string $last_name
|
||||
* @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) {
|
||||
$safeResult = \ibase_add_user($service_handle, $user_name, $password, $first_name, $middle_name, $last_name);
|
||||
} elseif ($middle_name !== null) {
|
||||
$safeResult = \ibase_add_user($service_handle, $user_name, $password, $first_name, $middle_name);
|
||||
} elseif ($first_name !== null) {
|
||||
$safeResult = \ibase_add_user($service_handle, $user_name, $password, $first_name);
|
||||
} else {
|
||||
$safeResult = \ibase_add_user($service_handle, $user_name, $password);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw IbaseException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $service_handle
|
||||
* @param string $source_db
|
||||
* @param string $dest_file
|
||||
* @param int $options
|
||||
* @param bool $verbose
|
||||
* @return mixed
|
||||
* @throws IbaseException
|
||||
*
|
||||
*/
|
||||
function ibase_backup($service_handle, string $source_db, string $dest_file, int $options = 0, bool $verbose = false)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ibase_backup($service_handle, $source_db, $dest_file, $options, $verbose);
|
||||
if ($safeResult === false) {
|
||||
throw IbaseException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $blob_handle
|
||||
* @throws IbaseException
|
||||
*
|
||||
*/
|
||||
function ibase_blob_cancel($blob_handle): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ibase_blob_cancel($blob_handle);
|
||||
if ($safeResult === false) {
|
||||
throw IbaseException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|resource $link_identifier
|
||||
* @return resource
|
||||
* @throws IbaseException
|
||||
*
|
||||
*/
|
||||
function ibase_blob_create($link_identifier = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($link_identifier !== null) {
|
||||
$safeResult = \ibase_blob_create($link_identifier);
|
||||
} else {
|
||||
$safeResult = \ibase_blob_create();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw IbaseException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $blob_handle
|
||||
* @param int $len
|
||||
* @return string
|
||||
* @throws IbaseException
|
||||
*
|
||||
*/
|
||||
function ibase_blob_get($blob_handle, int $len): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ibase_blob_get($blob_handle, $len);
|
||||
if ($safeResult === false) {
|
||||
throw IbaseException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|resource $connection_id
|
||||
* @throws IbaseException
|
||||
*
|
||||
*/
|
||||
function ibase_close($connection_id = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($connection_id !== null) {
|
||||
$safeResult = \ibase_close($connection_id);
|
||||
} else {
|
||||
$safeResult = \ibase_close();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw IbaseException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|resource $link_or_trans_identifier
|
||||
* @throws IbaseException
|
||||
*
|
||||
*/
|
||||
function ibase_commit_ret($link_or_trans_identifier = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($link_or_trans_identifier !== null) {
|
||||
$safeResult = \ibase_commit_ret($link_or_trans_identifier);
|
||||
} else {
|
||||
$safeResult = \ibase_commit_ret();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw IbaseException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|resource $link_or_trans_identifier
|
||||
* @throws IbaseException
|
||||
*
|
||||
*/
|
||||
function ibase_commit($link_or_trans_identifier = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($link_or_trans_identifier !== null) {
|
||||
$safeResult = \ibase_commit($link_or_trans_identifier);
|
||||
} else {
|
||||
$safeResult = \ibase_commit();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw IbaseException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $database
|
||||
* @param string $username
|
||||
* @param string $password
|
||||
* @param string $charset
|
||||
* @param int $buffers
|
||||
* @param int $dialect
|
||||
* @param string $role
|
||||
* @param int $sync
|
||||
* @return resource
|
||||
* @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) {
|
||||
$safeResult = \ibase_connect($database, $username, $password, $charset, $buffers, $dialect, $role, $sync);
|
||||
} elseif ($role !== null) {
|
||||
$safeResult = \ibase_connect($database, $username, $password, $charset, $buffers, $dialect, $role);
|
||||
} elseif ($dialect !== null) {
|
||||
$safeResult = \ibase_connect($database, $username, $password, $charset, $buffers, $dialect);
|
||||
} elseif ($buffers !== null) {
|
||||
$safeResult = \ibase_connect($database, $username, $password, $charset, $buffers);
|
||||
} elseif ($charset !== null) {
|
||||
$safeResult = \ibase_connect($database, $username, $password, $charset);
|
||||
} elseif ($password !== null) {
|
||||
$safeResult = \ibase_connect($database, $username, $password);
|
||||
} elseif ($username !== null) {
|
||||
$safeResult = \ibase_connect($database, $username);
|
||||
} elseif ($database !== null) {
|
||||
$safeResult = \ibase_connect($database);
|
||||
} else {
|
||||
$safeResult = \ibase_connect();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw IbaseException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $service_handle
|
||||
* @param string $user_name
|
||||
* @throws IbaseException
|
||||
*
|
||||
*/
|
||||
function ibase_delete_user($service_handle, string $user_name): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ibase_delete_user($service_handle, $user_name);
|
||||
if ($safeResult === false) {
|
||||
throw IbaseException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|resource $connection
|
||||
* @throws IbaseException
|
||||
*
|
||||
*/
|
||||
function ibase_drop_db($connection = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($connection !== null) {
|
||||
$safeResult = \ibase_drop_db($connection);
|
||||
} else {
|
||||
$safeResult = \ibase_drop_db();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw IbaseException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $event
|
||||
* @throws IbaseException
|
||||
*
|
||||
*/
|
||||
function ibase_free_event_handler($event): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ibase_free_event_handler($event);
|
||||
if ($safeResult === false) {
|
||||
throw IbaseException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $query
|
||||
* @throws IbaseException
|
||||
*
|
||||
*/
|
||||
function ibase_free_query($query): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ibase_free_query($query);
|
||||
if ($safeResult === false) {
|
||||
throw IbaseException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $result_identifier
|
||||
* @throws IbaseException
|
||||
*
|
||||
*/
|
||||
function ibase_free_result($result_identifier): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ibase_free_result($result_identifier);
|
||||
if ($safeResult === 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();
|
||||
$safeResult = \ibase_maintain_db($service_handle, $db, $action, $argument);
|
||||
if ($safeResult === false) {
|
||||
throw IbaseException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $service_handle
|
||||
* @param string $user_name
|
||||
* @param string $password
|
||||
* @param string $first_name
|
||||
* @param string $middle_name
|
||||
* @param string $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) {
|
||||
$safeResult = \ibase_modify_user($service_handle, $user_name, $password, $first_name, $middle_name, $last_name);
|
||||
} elseif ($middle_name !== null) {
|
||||
$safeResult = \ibase_modify_user($service_handle, $user_name, $password, $first_name, $middle_name);
|
||||
} elseif ($first_name !== null) {
|
||||
$safeResult = \ibase_modify_user($service_handle, $user_name, $password, $first_name);
|
||||
} else {
|
||||
$safeResult = \ibase_modify_user($service_handle, $user_name, $password);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw IbaseException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $result
|
||||
* @param string $name
|
||||
* @throws IbaseException
|
||||
*
|
||||
*/
|
||||
function ibase_name_result($result, string $name): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ibase_name_result($result, $name);
|
||||
if ($safeResult === false) {
|
||||
throw IbaseException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $database
|
||||
* @param string $username
|
||||
* @param string $password
|
||||
* @param string $charset
|
||||
* @param int $buffers
|
||||
* @param int $dialect
|
||||
* @param string $role
|
||||
* @param int $sync
|
||||
* @return resource
|
||||
* @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) {
|
||||
$safeResult = \ibase_pconnect($database, $username, $password, $charset, $buffers, $dialect, $role, $sync);
|
||||
} elseif ($role !== null) {
|
||||
$safeResult = \ibase_pconnect($database, $username, $password, $charset, $buffers, $dialect, $role);
|
||||
} elseif ($dialect !== null) {
|
||||
$safeResult = \ibase_pconnect($database, $username, $password, $charset, $buffers, $dialect);
|
||||
} elseif ($buffers !== null) {
|
||||
$safeResult = \ibase_pconnect($database, $username, $password, $charset, $buffers);
|
||||
} elseif ($charset !== null) {
|
||||
$safeResult = \ibase_pconnect($database, $username, $password, $charset);
|
||||
} elseif ($password !== null) {
|
||||
$safeResult = \ibase_pconnect($database, $username, $password);
|
||||
} elseif ($username !== null) {
|
||||
$safeResult = \ibase_pconnect($database, $username);
|
||||
} elseif ($database !== null) {
|
||||
$safeResult = \ibase_pconnect($database);
|
||||
} else {
|
||||
$safeResult = \ibase_pconnect();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw IbaseException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $service_handle
|
||||
* @param string $source_file
|
||||
* @param string $dest_db
|
||||
* @param int $options
|
||||
* @param bool $verbose
|
||||
* @return mixed
|
||||
* @throws IbaseException
|
||||
*
|
||||
*/
|
||||
function ibase_restore($service_handle, string $source_file, string $dest_db, int $options = 0, bool $verbose = false)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ibase_restore($service_handle, $source_file, $dest_db, $options, $verbose);
|
||||
if ($safeResult === false) {
|
||||
throw IbaseException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|resource $link_or_trans_identifier
|
||||
* @throws IbaseException
|
||||
*
|
||||
*/
|
||||
function ibase_rollback_ret($link_or_trans_identifier = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($link_or_trans_identifier !== null) {
|
||||
$safeResult = \ibase_rollback_ret($link_or_trans_identifier);
|
||||
} else {
|
||||
$safeResult = \ibase_rollback_ret();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw IbaseException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|resource $link_or_trans_identifier
|
||||
* @throws IbaseException
|
||||
*
|
||||
*/
|
||||
function ibase_rollback($link_or_trans_identifier = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($link_or_trans_identifier !== null) {
|
||||
$safeResult = \ibase_rollback($link_or_trans_identifier);
|
||||
} else {
|
||||
$safeResult = \ibase_rollback();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw IbaseException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $host
|
||||
* @param string $dba_username
|
||||
* @param string $dba_password
|
||||
* @return resource
|
||||
* @throws IbaseException
|
||||
*
|
||||
*/
|
||||
function ibase_service_attach(string $host, string $dba_username, string $dba_password)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ibase_service_attach($host, $dba_username, $dba_password);
|
||||
if ($safeResult === false) {
|
||||
throw IbaseException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $service_handle
|
||||
* @throws IbaseException
|
||||
*
|
||||
*/
|
||||
function ibase_service_detach($service_handle): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ibase_service_detach($service_handle);
|
||||
if ($safeResult === false) {
|
||||
throw IbaseException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
236
vendor/thecodingmachine/safe/generated/8.1/ibmDb2.php
vendored
Normal file
236
vendor/thecodingmachine/safe/generated/8.1/ibmDb2.php
vendored
Normal file
@@ -0,0 +1,236 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\IbmDb2Exception;
|
||||
|
||||
/**
|
||||
* @param resource $connection
|
||||
* @param \DB2_AUTOCOMMIT_OFF|\DB2_AUTOCOMMIT_ON $value
|
||||
* @return \DB2_AUTOCOMMIT_OFF|\DB2_AUTOCOMMIT_ON|bool
|
||||
* @throws IbmDb2Exception
|
||||
*
|
||||
*/
|
||||
function db2_autocommit($connection, $value = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($value !== null) {
|
||||
$safeResult = \db2_autocommit($connection, $value);
|
||||
} else {
|
||||
$safeResult = \db2_autocommit($connection);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw IbmDb2Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stmt
|
||||
* @param int $parameter_number
|
||||
* @param string $variable_name
|
||||
* @param int $parameter_type
|
||||
* @param int $data_type
|
||||
* @param int $precision
|
||||
* @param int $scale
|
||||
* @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) {
|
||||
$safeResult = \db2_bind_param($stmt, $parameter_number, $variable_name, $parameter_type, $data_type, $precision, $scale);
|
||||
} elseif ($precision !== -1) {
|
||||
$safeResult = \db2_bind_param($stmt, $parameter_number, $variable_name, $parameter_type, $data_type, $precision);
|
||||
} elseif ($data_type !== 0) {
|
||||
$safeResult = \db2_bind_param($stmt, $parameter_number, $variable_name, $parameter_type, $data_type);
|
||||
} elseif ($parameter_type !== null) {
|
||||
$safeResult = \db2_bind_param($stmt, $parameter_number, $variable_name, $parameter_type);
|
||||
} else {
|
||||
$safeResult = \db2_bind_param($stmt, $parameter_number, $variable_name);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw IbmDb2Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $connection
|
||||
* @return \stdClass
|
||||
* @throws IbmDb2Exception
|
||||
*
|
||||
*/
|
||||
function db2_client_info($connection): \stdClass
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \db2_client_info($connection);
|
||||
if ($safeResult === false) {
|
||||
throw IbmDb2Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $connection
|
||||
* @throws IbmDb2Exception
|
||||
*
|
||||
*/
|
||||
function db2_close($connection): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \db2_close($connection);
|
||||
if ($safeResult === false) {
|
||||
throw IbmDb2Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $connection
|
||||
* @throws IbmDb2Exception
|
||||
*
|
||||
*/
|
||||
function db2_commit($connection): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \db2_commit($connection);
|
||||
if ($safeResult === false) {
|
||||
throw IbmDb2Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stmt
|
||||
* @param array $parameters
|
||||
* @throws IbmDb2Exception
|
||||
*
|
||||
*/
|
||||
function db2_execute($stmt, ?array $parameters = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($parameters !== null) {
|
||||
$safeResult = \db2_execute($stmt, $parameters);
|
||||
} else {
|
||||
$safeResult = \db2_execute($stmt);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw IbmDb2Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stmt
|
||||
* @throws IbmDb2Exception
|
||||
*
|
||||
*/
|
||||
function db2_free_result($stmt): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \db2_free_result($stmt);
|
||||
if ($safeResult === false) {
|
||||
throw IbmDb2Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stmt
|
||||
* @throws IbmDb2Exception
|
||||
*
|
||||
*/
|
||||
function db2_free_stmt($stmt): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \db2_free_stmt($stmt);
|
||||
if ($safeResult === false) {
|
||||
throw IbmDb2Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $resource
|
||||
* @param string $option
|
||||
* @return string
|
||||
* @throws IbmDb2Exception
|
||||
*
|
||||
*/
|
||||
function db2_get_option($resource, string $option): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \db2_get_option($resource, $option);
|
||||
if ($safeResult === false) {
|
||||
throw IbmDb2Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $resource
|
||||
* @throws IbmDb2Exception
|
||||
*
|
||||
*/
|
||||
function db2_pclose($resource): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \db2_pclose($resource);
|
||||
if ($safeResult === false) {
|
||||
throw IbmDb2Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $connection
|
||||
* @throws IbmDb2Exception
|
||||
*
|
||||
*/
|
||||
function db2_rollback($connection): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \db2_rollback($connection);
|
||||
if ($safeResult === false) {
|
||||
throw IbmDb2Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $connection
|
||||
* @return \stdClass
|
||||
* @throws IbmDb2Exception
|
||||
*
|
||||
*/
|
||||
function db2_server_info($connection): \stdClass
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \db2_server_info($connection);
|
||||
if ($safeResult === false) {
|
||||
throw IbmDb2Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $resource
|
||||
* @param array $options
|
||||
* @param int $type
|
||||
* @throws IbmDb2Exception
|
||||
*
|
||||
*/
|
||||
function db2_set_option($resource, array $options, int $type): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \db2_set_option($resource, $options, $type);
|
||||
if ($safeResult === false) {
|
||||
throw IbmDb2Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
120
vendor/thecodingmachine/safe/generated/8.1/iconv.php
vendored
Normal file
120
vendor/thecodingmachine/safe/generated/8.1/iconv.php
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\IconvException;
|
||||
|
||||
/**
|
||||
* @param string $type
|
||||
* @return mixed
|
||||
* @throws IconvException
|
||||
*
|
||||
*/
|
||||
function iconv_get_encoding(string $type = "all")
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \iconv_get_encoding($type);
|
||||
if ($safeResult === false) {
|
||||
throw IconvException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $string
|
||||
* @param int $mode
|
||||
* @param null|string $encoding
|
||||
* @return string
|
||||
* @throws IconvException
|
||||
*
|
||||
*/
|
||||
function iconv_mime_decode(string $string, int $mode = 0, ?string $encoding = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($encoding !== null) {
|
||||
$safeResult = \iconv_mime_decode($string, $mode, $encoding);
|
||||
} else {
|
||||
$safeResult = \iconv_mime_decode($string, $mode);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw IconvException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $field_name
|
||||
* @param string $field_value
|
||||
* @param array $options
|
||||
* @return string
|
||||
* @throws IconvException
|
||||
*
|
||||
*/
|
||||
function iconv_mime_encode(string $field_name, string $field_value, array $options = []): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \iconv_mime_encode($field_name, $field_value, $options);
|
||||
if ($safeResult === false) {
|
||||
throw IconvException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $type
|
||||
* @param string $encoding
|
||||
* @throws IconvException
|
||||
*
|
||||
*/
|
||||
function iconv_set_encoding(string $type, string $encoding): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \iconv_set_encoding($type, $encoding);
|
||||
if ($safeResult === false) {
|
||||
throw IconvException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $string
|
||||
* @param null|string $encoding
|
||||
* @return 0|positive-int
|
||||
* @throws IconvException
|
||||
*
|
||||
*/
|
||||
function iconv_strlen(string $string, ?string $encoding = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($encoding !== null) {
|
||||
$safeResult = \iconv_strlen($string, $encoding);
|
||||
} else {
|
||||
$safeResult = \iconv_strlen($string);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw IconvException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $from_encoding
|
||||
* @param string $to_encoding
|
||||
* @param string $string
|
||||
* @return string
|
||||
* @throws IconvException
|
||||
*
|
||||
*/
|
||||
function iconv(string $from_encoding, string $to_encoding, string $string): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \iconv($from_encoding, $to_encoding, $string);
|
||||
if ($safeResult === false) {
|
||||
throw IconvException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
1696
vendor/thecodingmachine/safe/generated/8.1/image.php
vendored
Normal file
1696
vendor/thecodingmachine/safe/generated/8.1/image.php
vendored
Normal file
File diff suppressed because it is too large
Load Diff
895
vendor/thecodingmachine/safe/generated/8.1/imap.php
vendored
Normal file
895
vendor/thecodingmachine/safe/generated/8.1/imap.php
vendored
Normal file
@@ -0,0 +1,895 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\ImapException;
|
||||
|
||||
/**
|
||||
* @param string $string
|
||||
* @return string
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_8bit(string $string): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_8bit($string);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $folder
|
||||
* @param string $message
|
||||
* @param null|string $options
|
||||
* @param null|string $internal_date
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_append(\IMAP\Connection $imap, string $folder, string $message, ?string $options = null, ?string $internal_date = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($internal_date !== null) {
|
||||
$safeResult = \imap_append($imap, $folder, $message, $options, $internal_date);
|
||||
} elseif ($options !== null) {
|
||||
$safeResult = \imap_append($imap, $folder, $message, $options);
|
||||
} else {
|
||||
$safeResult = \imap_append($imap, $folder, $message);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $string
|
||||
* @return string
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_base64(string $string): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_base64($string);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $string
|
||||
* @return string
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_binary(string $string): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_binary($string);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param int $message_num
|
||||
* @param int $flags
|
||||
* @return string
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_body(\IMAP\Connection $imap, int $message_num, int $flags = 0): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_body($imap, $message_num, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param int $message_num
|
||||
* @param string $section
|
||||
* @return \stdClass
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_bodystruct(\IMAP\Connection $imap, int $message_num, string $section): \stdClass
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_bodystruct($imap, $message_num, $section);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @return \stdClass
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_check(\IMAP\Connection $imap): \stdClass
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_check($imap);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $sequence
|
||||
* @param string $flag
|
||||
* @param int $options
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_clearflag_full(\IMAP\Connection $imap, string $sequence, string $flag, int $options = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_clearflag_full($imap, $sequence, $flag, $options);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param int $flags
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_close(\IMAP\Connection $imap, int $flags = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_close($imap, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $mailbox
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_createmailbox(\IMAP\Connection $imap, string $mailbox): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_createmailbox($imap, $mailbox);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $mailbox
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_deletemailbox(\IMAP\Connection $imap, string $mailbox): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_deletemailbox($imap, $mailbox);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $sequence
|
||||
* @param int $flags
|
||||
* @return array
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_fetch_overview(\IMAP\Connection $imap, string $sequence, int $flags = 0): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_fetch_overview($imap, $sequence, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param int $message_num
|
||||
* @param string $section
|
||||
* @param int $flags
|
||||
* @return string
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_fetchbody(\IMAP\Connection $imap, int $message_num, string $section, int $flags = 0): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_fetchbody($imap, $message_num, $section, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param int $message_num
|
||||
* @param int $flags
|
||||
* @return string
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_fetchheader(\IMAP\Connection $imap, int $message_num, int $flags = 0): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_fetchheader($imap, $message_num, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param int $message_num
|
||||
* @param string $section
|
||||
* @param int $flags
|
||||
* @return string
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_fetchmime(\IMAP\Connection $imap, int $message_num, string $section, int $flags = 0): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_fetchmime($imap, $message_num, $section, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param int $message_num
|
||||
* @param int $flags
|
||||
* @return \stdClass
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_fetchstructure(\IMAP\Connection $imap, int $message_num, int $flags = 0): \stdClass
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_fetchstructure($imap, $message_num, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param int $flags
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_gc(\IMAP\Connection $imap, int $flags): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_gc($imap, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $mailbox
|
||||
* @return array
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_getacl(\IMAP\Connection $imap, string $mailbox): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_getacl($imap, $mailbox);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $reference
|
||||
* @param string $pattern
|
||||
* @return array
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_getmailboxes(\IMAP\Connection $imap, string $reference, string $pattern): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_getmailboxes($imap, $reference, $pattern);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $reference
|
||||
* @param string $pattern
|
||||
* @return array
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_getsubscribed(\IMAP\Connection $imap, string $reference, string $pattern): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_getsubscribed($imap, $reference, $pattern);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param int $message_num
|
||||
* @param int $from_length
|
||||
* @param int $subject_length
|
||||
* @return \stdClass
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_headerinfo(\IMAP\Connection $imap, int $message_num, int $from_length = 0, int $subject_length = 0): \stdClass
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_headerinfo($imap, $message_num, $from_length, $subject_length);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @return array
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_headers(\IMAP\Connection $imap): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_headers($imap);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $reference
|
||||
* @param string $pattern
|
||||
* @param string $content
|
||||
* @return array
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_listscan(\IMAP\Connection $imap, string $reference, string $pattern, string $content): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_listscan($imap, $reference, $pattern, $content);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $reference
|
||||
* @param string $pattern
|
||||
* @return array
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_lsub(\IMAP\Connection $imap, string $reference, string $pattern): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_lsub($imap, $reference, $pattern);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $envelope
|
||||
* @param array $bodies
|
||||
* @return string
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_mail_compose(array $envelope, array $bodies): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_mail_compose($envelope, $bodies);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $message_nums
|
||||
* @param string $mailbox
|
||||
* @param int $flags
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_mail_copy(\IMAP\Connection $imap, string $message_nums, string $mailbox, int $flags = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_mail_copy($imap, $message_nums, $mailbox, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $message_nums
|
||||
* @param string $mailbox
|
||||
* @param int $flags
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_mail_move(\IMAP\Connection $imap, string $message_nums, string $mailbox, int $flags = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_mail_move($imap, $message_nums, $mailbox, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $to
|
||||
* @param string $subject
|
||||
* @param string $message
|
||||
* @param null|string $additional_headers
|
||||
* @param null|string $cc
|
||||
* @param null|string $bcc
|
||||
* @param null|string $return_path
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_mail(string $to, string $subject, string $message, ?string $additional_headers = null, ?string $cc = null, ?string $bcc = null, ?string $return_path = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($return_path !== null) {
|
||||
$safeResult = \imap_mail($to, $subject, $message, $additional_headers, $cc, $bcc, $return_path);
|
||||
} elseif ($bcc !== null) {
|
||||
$safeResult = \imap_mail($to, $subject, $message, $additional_headers, $cc, $bcc);
|
||||
} elseif ($cc !== null) {
|
||||
$safeResult = \imap_mail($to, $subject, $message, $additional_headers, $cc);
|
||||
} elseif ($additional_headers !== null) {
|
||||
$safeResult = \imap_mail($to, $subject, $message, $additional_headers);
|
||||
} else {
|
||||
$safeResult = \imap_mail($to, $subject, $message);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @return \stdClass
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_mailboxmsginfo(\IMAP\Connection $imap): \stdClass
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_mailboxmsginfo($imap);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $string
|
||||
* @return array
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_mime_header_decode(string $string): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_mime_header_decode($string);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $string
|
||||
* @return string
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_mutf7_to_utf8(string $string): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_mutf7_to_utf8($string);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @return int
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_num_msg(\IMAP\Connection $imap): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_num_msg($imap);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $mailbox
|
||||
* @param string $user
|
||||
* @param string $password
|
||||
* @param int $flags
|
||||
* @param int $retries
|
||||
* @param array $options
|
||||
* @return \IMAP\Connection
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_open(string $mailbox, string $user, string $password, int $flags = 0, int $retries = 0, array $options = []): \IMAP\Connection
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_open($mailbox, $user, $password, $flags, $retries, $options);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $string
|
||||
* @return string
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_qprint(string $string): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_qprint($string);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $from
|
||||
* @param string $to
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_renamemailbox(\IMAP\Connection $imap, string $from, string $to): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_renamemailbox($imap, $from, $to);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|string $mailbox
|
||||
* @param null|string $hostname
|
||||
* @param null|string $personal
|
||||
* @return string
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_rfc822_write_address(?string $mailbox, ?string $hostname, ?string $personal): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_rfc822_write_address($mailbox, $hostname, $personal);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param int|resource|string $file
|
||||
* @param int $message_num
|
||||
* @param string $section
|
||||
* @param int $flags
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_savebody(\IMAP\Connection $imap, $file, int $message_num, string $section = "", int $flags = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_savebody($imap, $file, $message_num, $section, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $quota_root
|
||||
* @param int $mailbox_size
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_set_quota(\IMAP\Connection $imap, string $quota_root, int $mailbox_size): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_set_quota($imap, $quota_root, $mailbox_size);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $mailbox
|
||||
* @param string $user_id
|
||||
* @param string $rights
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_setacl(\IMAP\Connection $imap, string $mailbox, string $user_id, string $rights): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_setacl($imap, $mailbox, $user_id, $rights);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $sequence
|
||||
* @param string $flag
|
||||
* @param int $options
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_setflag_full(\IMAP\Connection $imap, string $sequence, string $flag, int $options = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_setflag_full($imap, $sequence, $flag, $options);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param int $criteria
|
||||
* @param int $reverse
|
||||
* @param int $flags
|
||||
* @param null|string $search_criteria
|
||||
* @param null|string $charset
|
||||
* @return array
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_sort(\IMAP\Connection $imap, int $criteria, int $reverse, int $flags = 0, ?string $search_criteria = null, ?string $charset = null): array
|
||||
{
|
||||
error_clear_last();
|
||||
if ($charset !== null) {
|
||||
$safeResult = \imap_sort($imap, $criteria, $reverse, $flags, $search_criteria, $charset);
|
||||
} elseif ($search_criteria !== null) {
|
||||
$safeResult = \imap_sort($imap, $criteria, $reverse, $flags, $search_criteria);
|
||||
} else {
|
||||
$safeResult = \imap_sort($imap, $criteria, $reverse, $flags);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $mailbox
|
||||
* @param int $flags
|
||||
* @return \stdClass
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_status(\IMAP\Connection $imap, string $mailbox, int $flags): \stdClass
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_status($imap, $mailbox, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $mailbox
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_subscribe(\IMAP\Connection $imap, string $mailbox): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_subscribe($imap, $mailbox);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param int $flags
|
||||
* @return array
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_thread(\IMAP\Connection $imap, int $flags = SE_FREE): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_thread($imap, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $timeout_type
|
||||
* @param int $timeout
|
||||
* @return mixed
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_timeout(int $timeout_type, int $timeout = -1)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_timeout($timeout_type, $timeout);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $message_num
|
||||
* @param int $flags
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_undelete(\IMAP\Connection $imap, string $message_num, int $flags = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_undelete($imap, $message_num, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $mailbox
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_unsubscribe(\IMAP\Connection $imap, string $mailbox): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_unsubscribe($imap, $mailbox);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $string
|
||||
* @return string
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_utf8_to_mutf7(string $string): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_utf8_to_mutf7($string);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
333
vendor/thecodingmachine/safe/generated/8.1/info.php
vendored
Normal file
333
vendor/thecodingmachine/safe/generated/8.1/info.php
vendored
Normal file
@@ -0,0 +1,333 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\InfoException;
|
||||
|
||||
/**
|
||||
* @param int $what
|
||||
* @param mixed $value
|
||||
* @return mixed
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function assert_options(int $what, $value = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($value !== null) {
|
||||
$safeResult = \assert_options($what, $value);
|
||||
} else {
|
||||
$safeResult = \assert_options($what);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $title
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function cli_set_process_title(string $title): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \cli_set_process_title($title);
|
||||
if ($safeResult === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $extension_filename
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function dl(string $extension_filename): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \dl($extension_filename);
|
||||
if ($safeResult === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $option
|
||||
* @return mixed
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function get_cfg_var(string $option)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \get_cfg_var($option);
|
||||
if ($safeResult === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function get_include_path(): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \get_include_path();
|
||||
if ($safeResult === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function getlastmod(): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \getlastmod();
|
||||
if ($safeResult === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function getmygid(): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \getmygid();
|
||||
if ($safeResult === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function getmyinode(): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \getmyinode();
|
||||
if ($safeResult === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function getmypid(): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \getmypid();
|
||||
if ($safeResult === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function getmyuid(): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \getmyuid();
|
||||
if ($safeResult === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $short_options
|
||||
* @param array $long_options
|
||||
* @param int|null $rest_index
|
||||
* @return array|array|array
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function getopt(string $short_options, array $long_options = [], ?int &$rest_index = null): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \getopt($short_options, $long_options, $rest_index);
|
||||
if ($safeResult === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $mode
|
||||
* @return array
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function getrusage(int $mode = 0): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \getrusage($mode);
|
||||
if ($safeResult === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $option
|
||||
* @return string
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function ini_get(string $option): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ini_get($option);
|
||||
if ($safeResult === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $option
|
||||
* @param bool|float|int|null|string $value
|
||||
* @return string
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function ini_set(string $option, $value): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ini_set($option, $value);
|
||||
if ($safeResult === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return non-empty-string
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function php_sapi_name(): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \php_sapi_name();
|
||||
if ($safeResult === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $flags
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function phpcredits(int $flags = CREDITS_ALL): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \phpcredits($flags);
|
||||
if ($safeResult === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $flags
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function phpinfo(int $flags = INFO_ALL): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \phpinfo($flags);
|
||||
if ($safeResult === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $assignment
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function putenv(string $assignment): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \putenv($assignment);
|
||||
if ($safeResult === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $include_path
|
||||
* @return string
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function set_include_path(string $include_path): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \set_include_path($include_path);
|
||||
if ($safeResult === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $seconds
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function set_time_limit(int $seconds): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \set_time_limit($seconds);
|
||||
if ($safeResult === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
36
vendor/thecodingmachine/safe/generated/8.1/inotify.php
vendored
Normal file
36
vendor/thecodingmachine/safe/generated/8.1/inotify.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\InotifyException;
|
||||
|
||||
/**
|
||||
* @return resource
|
||||
* @throws InotifyException
|
||||
*
|
||||
*/
|
||||
function inotify_init()
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \inotify_init();
|
||||
if ($safeResult === false) {
|
||||
throw InotifyException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $inotify_instance
|
||||
* @param int $watch_descriptor
|
||||
* @throws InotifyException
|
||||
*
|
||||
*/
|
||||
function inotify_rm_watch($inotify_instance, int $watch_descriptor): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \inotify_rm_watch($inotify_instance, $watch_descriptor);
|
||||
if ($safeResult === false) {
|
||||
throw InotifyException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
23
vendor/thecodingmachine/safe/generated/8.1/json.php
vendored
Normal file
23
vendor/thecodingmachine/safe/generated/8.1/json.php
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\JsonException;
|
||||
|
||||
/**
|
||||
* @param mixed $value
|
||||
* @param int $flags
|
||||
* @param positive-int $depth
|
||||
* @return non-empty-string
|
||||
* @throws JsonException
|
||||
*
|
||||
*/
|
||||
function json_encode($value, int $flags = 0, int $depth = 512): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \json_encode($value, $flags, $depth);
|
||||
if ($safeResult === false) {
|
||||
throw JsonException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
670
vendor/thecodingmachine/safe/generated/8.1/ldap.php
vendored
Normal file
670
vendor/thecodingmachine/safe/generated/8.1/ldap.php
vendored
Normal file
@@ -0,0 +1,670 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\LdapException;
|
||||
|
||||
/**
|
||||
* @param string $value
|
||||
* @return string
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_8859_to_t61(string $value): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_8859_to_t61($value);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param string $dn
|
||||
* @param array $entry
|
||||
* @param array|null $controls
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_add(\LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($controls !== null) {
|
||||
$safeResult = \ldap_add($ldap, $dn, $entry, $controls);
|
||||
} else {
|
||||
$safeResult = \ldap_add($ldap, $dn, $entry);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param null|string $dn
|
||||
* @param null|string $password
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_bind(\LDAP\Connection $ldap, ?string $dn = null, ?string $password = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($password !== null) {
|
||||
$safeResult = \ldap_bind($ldap, $dn, $password);
|
||||
} elseif ($dn !== null) {
|
||||
$safeResult = \ldap_bind($ldap, $dn);
|
||||
} else {
|
||||
$safeResult = \ldap_bind($ldap);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param string $dn
|
||||
* @param string $attribute
|
||||
* @param string $value
|
||||
* @param array|null $controls
|
||||
* @return bool
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_compare(\LDAP\Connection $ldap, string $dn, string $attribute, string $value, ?array $controls = null): bool
|
||||
{
|
||||
error_clear_last();
|
||||
if ($controls !== null) {
|
||||
$safeResult = \ldap_compare($ldap, $dn, $attribute, $value, $controls);
|
||||
} else {
|
||||
$safeResult = \ldap_compare($ldap, $dn, $attribute, $value);
|
||||
}
|
||||
if ($safeResult === -1) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $link
|
||||
* @param resource $result
|
||||
* @param null|string $cookie
|
||||
* @param int|null $estimated
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_control_paged_result_response($link, $result, ?string &$cookie = null, ?int &$estimated = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_control_paged_result_response($link, $result, $cookie, $estimated);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $link
|
||||
* @param int $pagesize
|
||||
* @param bool $iscritical
|
||||
* @param string $cookie
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_control_paged_result($link, int $pagesize, bool $iscritical = false, string $cookie = ""): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_control_paged_result($link, $pagesize, $iscritical, $cookie);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param \LDAP\Result $result
|
||||
* @return int
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_count_entries(\LDAP\Connection $ldap, \LDAP\Result $result): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_count_entries($ldap, $result);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param string $dn
|
||||
* @param array|null $controls
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_delete(\LDAP\Connection $ldap, string $dn, ?array $controls = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($controls !== null) {
|
||||
$safeResult = \ldap_delete($ldap, $dn, $controls);
|
||||
} else {
|
||||
$safeResult = \ldap_delete($ldap, $dn);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $dn
|
||||
* @return string
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_dn2ufn(string $dn): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_dn2ufn($dn);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param string $user
|
||||
* @param string $old_password
|
||||
* @param string $new_password
|
||||
* @param array|null $controls
|
||||
* @return bool|string
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_exop_passwd(\LDAP\Connection $ldap, string $user = "", string $old_password = "", string $new_password = "", ?array &$controls = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_exop_passwd($ldap, $user, $old_password, $new_password, $controls);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @return bool|string
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_exop_whoami(\LDAP\Connection $ldap)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_exop_whoami($ldap);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param string $reqoid
|
||||
* @param null|string $reqdata
|
||||
* @param array|null $serverctrls
|
||||
* @param null|string $retdata
|
||||
* @param null|string $retoid
|
||||
* @return bool|resource
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_exop(\LDAP\Connection $ldap, string $reqoid, ?string $reqdata = null, ?array $serverctrls = null, ?string &$retdata = null, ?string &$retoid = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($retoid !== null) {
|
||||
$safeResult = \ldap_exop($ldap, $reqoid, $reqdata, $serverctrls, $retdata, $retoid);
|
||||
} elseif ($retdata !== null) {
|
||||
$safeResult = \ldap_exop($ldap, $reqoid, $reqdata, $serverctrls, $retdata);
|
||||
} elseif ($serverctrls !== null) {
|
||||
$safeResult = \ldap_exop($ldap, $reqoid, $reqdata, $serverctrls);
|
||||
} elseif ($reqdata !== null) {
|
||||
$safeResult = \ldap_exop($ldap, $reqoid, $reqdata);
|
||||
} else {
|
||||
$safeResult = \ldap_exop($ldap, $reqoid);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $dn
|
||||
* @param int $with_attrib
|
||||
* @return array
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_explode_dn(string $dn, int $with_attrib): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_explode_dn($dn, $with_attrib);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param \LDAP\ResultEntry $entry
|
||||
* @return string
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_first_attribute(\LDAP\Connection $ldap, \LDAP\ResultEntry $entry): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_first_attribute($ldap, $entry);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param \LDAP\Result $result
|
||||
* @return \LDAP\ResultEntry
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_first_entry(\LDAP\Connection $ldap, \LDAP\Result $result): \LDAP\ResultEntry
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_first_entry($ldap, $result);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Result $result
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_free_result(\LDAP\Result $result): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_free_result($result);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param \LDAP\ResultEntry $entry
|
||||
* @return array
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_get_attributes(\LDAP\Connection $ldap, \LDAP\ResultEntry $entry): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_get_attributes($ldap, $entry);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param \LDAP\ResultEntry $entry
|
||||
* @return string
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_get_dn(\LDAP\Connection $ldap, \LDAP\ResultEntry $entry): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_get_dn($ldap, $entry);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param \LDAP\Result $result
|
||||
* @return array
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_get_entries(\LDAP\Connection $ldap, \LDAP\Result $result): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_get_entries($ldap, $result);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param int $option
|
||||
* @param mixed $value
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_get_option(\LDAP\Connection $ldap, int $option, &$value = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_get_option($ldap, $option, $value);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param \LDAP\ResultEntry $entry
|
||||
* @param string $attribute
|
||||
* @return array
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_get_values_len(\LDAP\Connection $ldap, \LDAP\ResultEntry $entry, string $attribute): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_get_values_len($ldap, $entry, $attribute);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param \LDAP\ResultEntry $entry
|
||||
* @param string $attribute
|
||||
* @return array
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_get_values(\LDAP\Connection $ldap, \LDAP\ResultEntry $entry, string $attribute): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_get_values($ldap, $entry, $attribute);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param string $dn
|
||||
* @param array $entry
|
||||
* @param array|null $controls
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_mod_add(\LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($controls !== null) {
|
||||
$safeResult = \ldap_mod_add($ldap, $dn, $entry, $controls);
|
||||
} else {
|
||||
$safeResult = \ldap_mod_add($ldap, $dn, $entry);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param string $dn
|
||||
* @param array $entry
|
||||
* @param array|null $controls
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_mod_del(\LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($controls !== null) {
|
||||
$safeResult = \ldap_mod_del($ldap, $dn, $entry, $controls);
|
||||
} else {
|
||||
$safeResult = \ldap_mod_del($ldap, $dn, $entry);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param string $dn
|
||||
* @param array $entry
|
||||
* @param array|null $controls
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_mod_replace(\LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($controls !== null) {
|
||||
$safeResult = \ldap_mod_replace($ldap, $dn, $entry, $controls);
|
||||
} else {
|
||||
$safeResult = \ldap_mod_replace($ldap, $dn, $entry);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param string $dn
|
||||
* @param array $modifications_info
|
||||
* @param array|null $controls
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_modify_batch(\LDAP\Connection $ldap, string $dn, array $modifications_info, ?array $controls = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($controls !== null) {
|
||||
$safeResult = \ldap_modify_batch($ldap, $dn, $modifications_info, $controls);
|
||||
} else {
|
||||
$safeResult = \ldap_modify_batch($ldap, $dn, $modifications_info);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param \LDAP\ResultEntry $entry
|
||||
* @return string
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_next_attribute(\LDAP\Connection $ldap, \LDAP\ResultEntry $entry): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_next_attribute($ldap, $entry);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param \LDAP\Result $result
|
||||
* @param null|string $response_data
|
||||
* @param null|string $response_oid
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_parse_exop(\LDAP\Connection $ldap, \LDAP\Result $result, ?string &$response_data = null, ?string &$response_oid = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_parse_exop($ldap, $result, $response_data, $response_oid);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param \LDAP\Result $result
|
||||
* @param int|null $error_code
|
||||
* @param null|string $matched_dn
|
||||
* @param null|string $error_message
|
||||
* @param array|null $referrals
|
||||
* @param array|null $controls
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_parse_result(\LDAP\Connection $ldap, \LDAP\Result $result, ?int &$error_code, ?string &$matched_dn = null, ?string &$error_message = null, ?array &$referrals = null, ?array &$controls = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_parse_result($ldap, $result, $error_code, $matched_dn, $error_message, $referrals, $controls);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param string $dn
|
||||
* @param string $new_rdn
|
||||
* @param string $new_parent
|
||||
* @param bool $delete_old_rdn
|
||||
* @param array|null $controls
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_rename(\LDAP\Connection $ldap, string $dn, string $new_rdn, string $new_parent, bool $delete_old_rdn, ?array $controls = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($controls !== null) {
|
||||
$safeResult = \ldap_rename($ldap, $dn, $new_rdn, $new_parent, $delete_old_rdn, $controls);
|
||||
} else {
|
||||
$safeResult = \ldap_rename($ldap, $dn, $new_rdn, $new_parent, $delete_old_rdn);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param null|string $dn
|
||||
* @param null|string $password
|
||||
* @param null|string $mech
|
||||
* @param null|string $realm
|
||||
* @param null|string $authc_id
|
||||
* @param null|string $authz_id
|
||||
* @param null|string $props
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_sasl_bind(\LDAP\Connection $ldap, ?string $dn = null, ?string $password = null, ?string $mech = null, ?string $realm = null, ?string $authc_id = null, ?string $authz_id = null, ?string $props = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($props !== null) {
|
||||
$safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm, $authc_id, $authz_id, $props);
|
||||
} elseif ($authz_id !== null) {
|
||||
$safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm, $authc_id, $authz_id);
|
||||
} elseif ($authc_id !== null) {
|
||||
$safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm, $authc_id);
|
||||
} elseif ($realm !== null) {
|
||||
$safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm);
|
||||
} elseif ($mech !== null) {
|
||||
$safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech);
|
||||
} elseif ($password !== null) {
|
||||
$safeResult = \ldap_sasl_bind($ldap, $dn, $password);
|
||||
} elseif ($dn !== null) {
|
||||
$safeResult = \ldap_sasl_bind($ldap, $dn);
|
||||
} else {
|
||||
$safeResult = \ldap_sasl_bind($ldap);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|resource $ldap
|
||||
* @param int $option
|
||||
* @param mixed $value
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_set_option($ldap, int $option, $value): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_set_option($ldap, $option, $value);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_unbind(\LDAP\Connection $ldap): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_unbind($ldap);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
19
vendor/thecodingmachine/safe/generated/8.1/libxml.php
vendored
Normal file
19
vendor/thecodingmachine/safe/generated/8.1/libxml.php
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\LibxmlException;
|
||||
|
||||
/**
|
||||
* @param callable $resolver_function
|
||||
* @throws LibxmlException
|
||||
*
|
||||
*/
|
||||
function libxml_set_external_entity_loader(callable $resolver_function): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \libxml_set_external_entity_loader($resolver_function);
|
||||
if ($safeResult === false) {
|
||||
throw LibxmlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
38
vendor/thecodingmachine/safe/generated/8.1/lzf.php
vendored
Normal file
38
vendor/thecodingmachine/safe/generated/8.1/lzf.php
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\LzfException;
|
||||
|
||||
/**
|
||||
* @param string $data
|
||||
* @return string
|
||||
* @throws LzfException
|
||||
*
|
||||
*/
|
||||
function lzf_compress(string $data): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \lzf_compress($data);
|
||||
if ($safeResult === false) {
|
||||
throw LzfException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $data
|
||||
* @return string
|
||||
* @throws LzfException
|
||||
*
|
||||
*/
|
||||
function lzf_decompress(string $data): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \lzf_decompress($data);
|
||||
if ($safeResult === false) {
|
||||
throw LzfException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
92
vendor/thecodingmachine/safe/generated/8.1/mailparse.php
vendored
Normal file
92
vendor/thecodingmachine/safe/generated/8.1/mailparse.php
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\MailparseException;
|
||||
|
||||
/**
|
||||
* @param resource $mimemail
|
||||
* @param mixed $filename
|
||||
* @param callable $callbackfunc
|
||||
* @return string
|
||||
* @throws MailparseException
|
||||
*
|
||||
*/
|
||||
function mailparse_msg_extract_part_file($mimemail, $filename, ?callable $callbackfunc = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($callbackfunc !== null) {
|
||||
$safeResult = \mailparse_msg_extract_part_file($mimemail, $filename, $callbackfunc);
|
||||
} else {
|
||||
$safeResult = \mailparse_msg_extract_part_file($mimemail, $filename);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw MailparseException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $mimemail
|
||||
* @throws MailparseException
|
||||
*
|
||||
*/
|
||||
function mailparse_msg_free($mimemail): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mailparse_msg_free($mimemail);
|
||||
if ($safeResult === false) {
|
||||
throw MailparseException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @return resource
|
||||
* @throws MailparseException
|
||||
*
|
||||
*/
|
||||
function mailparse_msg_parse_file(string $filename)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mailparse_msg_parse_file($filename);
|
||||
if ($safeResult === false) {
|
||||
throw MailparseException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $mimemail
|
||||
* @param string $data
|
||||
* @throws MailparseException
|
||||
*
|
||||
*/
|
||||
function mailparse_msg_parse($mimemail, string $data): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mailparse_msg_parse($mimemail, $data);
|
||||
if ($safeResult === false) {
|
||||
throw MailparseException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $sourcefp
|
||||
* @param resource $destfp
|
||||
* @param string $encoding
|
||||
* @throws MailparseException
|
||||
*
|
||||
*/
|
||||
function mailparse_stream_encode($sourcefp, $destfp, string $encoding): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mailparse_stream_encode($sourcefp, $destfp, $encoding);
|
||||
if ($safeResult === false) {
|
||||
throw MailparseException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
417
vendor/thecodingmachine/safe/generated/8.1/mbstring.php
vendored
Normal file
417
vendor/thecodingmachine/safe/generated/8.1/mbstring.php
vendored
Normal file
@@ -0,0 +1,417 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\MbstringException;
|
||||
|
||||
/**
|
||||
* @param int $codepoint
|
||||
* @param null|string $encoding
|
||||
* @return string
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_chr(int $codepoint, ?string $encoding = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($encoding !== null) {
|
||||
$safeResult = \mb_chr($codepoint, $encoding);
|
||||
} else {
|
||||
$safeResult = \mb_chr($codepoint);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array|string $string
|
||||
* @param string $to_encoding
|
||||
* @param mixed $from_encoding
|
||||
* @return array|string
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_convert_encoding($string, string $to_encoding, $from_encoding = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($from_encoding !== null) {
|
||||
$safeResult = \mb_convert_encoding($string, $to_encoding, $from_encoding);
|
||||
} else {
|
||||
$safeResult = \mb_convert_encoding($string, $to_encoding);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $to_encoding
|
||||
* @param array|string $from_encoding
|
||||
* @param array|object|string $var
|
||||
* @param array|object|string $vars
|
||||
* @return string
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_convert_variables(string $to_encoding, $from_encoding, &$var, ...$vars): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mb_convert_variables($to_encoding, $from_encoding, $var, ...$vars);
|
||||
if ($safeResult === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param non-empty-list|non-falsy-string|null $encoding
|
||||
* @return bool|list
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_detect_order($encoding = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($encoding !== null) {
|
||||
$safeResult = \mb_detect_order($encoding);
|
||||
} else {
|
||||
$safeResult = \mb_detect_order();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $encoding
|
||||
* @return list
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_encoding_aliases(string $encoding): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mb_encoding_aliases($encoding);
|
||||
if ($safeResult === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $pattern
|
||||
* @param callable(array):string $callback
|
||||
* @param string $string
|
||||
* @param null|string $options
|
||||
* @return null|string
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_ereg_replace_callback(string $pattern, callable $callback, string $string, ?string $options = null): ?string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($options !== null) {
|
||||
$safeResult = \mb_ereg_replace_callback($pattern, $callback, $string, $options);
|
||||
} else {
|
||||
$safeResult = \mb_ereg_replace_callback($pattern, $callback, $string);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $pattern
|
||||
* @param string $replacement
|
||||
* @param string $string
|
||||
* @param null|string $options
|
||||
* @return null|string
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_ereg_replace(string $pattern, string $replacement, string $string, ?string $options = null): ?string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($options !== null) {
|
||||
$safeResult = \mb_ereg_replace($pattern, $replacement, $string, $options);
|
||||
} else {
|
||||
$safeResult = \mb_ereg_replace($pattern, $replacement, $string);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_ereg_search_getregs(): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mb_ereg_search_getregs();
|
||||
if ($safeResult === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $string
|
||||
* @param null|string $pattern
|
||||
* @param null|string $options
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_ereg_search_init(string $string, ?string $pattern = null, ?string $options = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($options !== null) {
|
||||
$safeResult = \mb_ereg_search_init($string, $pattern, $options);
|
||||
} elseif ($pattern !== null) {
|
||||
$safeResult = \mb_ereg_search_init($string, $pattern);
|
||||
} else {
|
||||
$safeResult = \mb_ereg_search_init($string);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|string $pattern
|
||||
* @param null|string $options
|
||||
* @return array
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_ereg_search_regs(?string $pattern = null, ?string $options = null): array
|
||||
{
|
||||
error_clear_last();
|
||||
if ($options !== null) {
|
||||
$safeResult = \mb_ereg_search_regs($pattern, $options);
|
||||
} elseif ($pattern !== null) {
|
||||
$safeResult = \mb_ereg_search_regs($pattern);
|
||||
} else {
|
||||
$safeResult = \mb_ereg_search_regs();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $offset
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_ereg_search_setpos(int $offset): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mb_ereg_search_setpos($offset);
|
||||
if ($safeResult === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $pattern
|
||||
* @param string $replacement
|
||||
* @param string $string
|
||||
* @param null|string $options
|
||||
* @return string
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_eregi_replace(string $pattern, string $replacement, string $string, ?string $options = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($options !== null) {
|
||||
$safeResult = \mb_eregi_replace($pattern, $replacement, $string, $options);
|
||||
} else {
|
||||
$safeResult = \mb_eregi_replace($pattern, $replacement, $string);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $type
|
||||
* @return mixed
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_get_info(string $type = "all")
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mb_get_info($type);
|
||||
if ($safeResult === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|string $encoding
|
||||
* @return bool|string
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_http_output(?string $encoding = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($encoding !== null) {
|
||||
$safeResult = \mb_http_output($encoding);
|
||||
} else {
|
||||
$safeResult = \mb_http_output();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|string $encoding
|
||||
* @return bool|string
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_internal_encoding(?string $encoding = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($encoding !== null) {
|
||||
$safeResult = \mb_internal_encoding($encoding);
|
||||
} else {
|
||||
$safeResult = \mb_internal_encoding();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $string
|
||||
* @param null|string $encoding
|
||||
* @return int
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_ord(string $string, ?string $encoding = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($encoding !== null) {
|
||||
$safeResult = \mb_ord($string, $encoding);
|
||||
} else {
|
||||
$safeResult = \mb_ord($string);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $string
|
||||
* @param array|null $result
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_parse_str(string $string, ?array &$result): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mb_parse_str($string, $result);
|
||||
if ($safeResult === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|string $encoding
|
||||
* @return bool|string
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_regex_encoding(?string $encoding = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($encoding !== null) {
|
||||
$safeResult = \mb_regex_encoding($encoding);
|
||||
} else {
|
||||
$safeResult = \mb_regex_encoding();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $to
|
||||
* @param string $subject
|
||||
* @param string $message
|
||||
* @param array|null|string $additional_headers
|
||||
* @param null|string $additional_params
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_send_mail(string $to, string $subject, string $message, $additional_headers = [], ?string $additional_params = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($additional_params !== null) {
|
||||
$safeResult = \mb_send_mail($to, $subject, $message, $additional_headers, $additional_params);
|
||||
} else {
|
||||
$safeResult = \mb_send_mail($to, $subject, $message, $additional_headers);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $pattern
|
||||
* @param string $string
|
||||
* @param int $limit
|
||||
* @return list
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_split(string $pattern, string $string, int $limit = -1): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mb_split($pattern, $string, $limit);
|
||||
if ($safeResult === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
251
vendor/thecodingmachine/safe/generated/8.1/misc.php
vendored
Normal file
251
vendor/thecodingmachine/safe/generated/8.1/misc.php
vendored
Normal file
@@ -0,0 +1,251 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\MiscException;
|
||||
|
||||
/**
|
||||
* @param string $constant_name
|
||||
* @param mixed $value
|
||||
* @param bool $case_insensitive
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function define(string $constant_name, $value, bool $case_insensitive = false): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \define($constant_name, $value, $case_insensitive);
|
||||
if ($safeResult === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param bool $return
|
||||
* @return bool|string
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function highlight_file(string $filename, bool $return = false)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \highlight_file($filename, $return);
|
||||
if ($safeResult === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $string
|
||||
* @param bool $return
|
||||
* @return bool|string
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function highlight_string(string $string, bool $return = false)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \highlight_string($string, $return);
|
||||
if ($safeResult === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param bool $as_number
|
||||
* @return array{0:int,1:int}|float|int
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function hrtime(bool $as_number = false)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \hrtime($as_number);
|
||||
if ($safeResult === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $format
|
||||
* @param mixed $values
|
||||
* @return string
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function pack(string $format, ...$values): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($values !== []) {
|
||||
$safeResult = \pack($format, ...$values);
|
||||
} else {
|
||||
$safeResult = \pack($format);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int|string $in_codepage
|
||||
* @param int|string $out_codepage
|
||||
* @param string $subject
|
||||
* @return string
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function sapi_windows_cp_conv($in_codepage, $out_codepage, string $subject): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sapi_windows_cp_conv($in_codepage, $out_codepage, $subject);
|
||||
if ($safeResult === null) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $codepage
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function sapi_windows_cp_set(int $codepage): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sapi_windows_cp_set($codepage);
|
||||
if ($safeResult === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $event
|
||||
* @param int $pid
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function sapi_windows_generate_ctrl_event(int $event, int $pid = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sapi_windows_generate_ctrl_event($event, $pid);
|
||||
if ($safeResult === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param callable|null $handler
|
||||
* @param bool $add
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function sapi_windows_set_ctrl_handler(?callable $handler, bool $add = true): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sapi_windows_set_ctrl_handler($handler, $add);
|
||||
if ($safeResult === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @param bool|null $enable
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function sapi_windows_vt100_support($stream, ?bool $enable = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($enable !== null) {
|
||||
$safeResult = \sapi_windows_vt100_support($stream, $enable);
|
||||
} else {
|
||||
$safeResult = \sapi_windows_vt100_support($stream);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $seconds
|
||||
* @return int
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function sleep(int $seconds): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sleep($seconds);
|
||||
if ($safeResult === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $seconds
|
||||
* @param int $nanoseconds
|
||||
* @return array{seconds:0|positive-int,nanoseconds:0|positive-int}|bool
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function time_nanosleep(int $seconds, int $nanoseconds)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \time_nanosleep($seconds, $nanoseconds);
|
||||
if ($safeResult === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param float $timestamp
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function time_sleep_until(float $timestamp): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \time_sleep_until($timestamp);
|
||||
if ($safeResult === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $format
|
||||
* @param string $string
|
||||
* @param int $offset
|
||||
* @return array
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function unpack(string $format, string $string, int $offset = 0): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \unpack($format, $string, $offset);
|
||||
if ($safeResult === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
553
vendor/thecodingmachine/safe/generated/8.1/mysql.php
vendored
Normal file
553
vendor/thecodingmachine/safe/generated/8.1/mysql.php
vendored
Normal file
@@ -0,0 +1,553 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\MysqlException;
|
||||
|
||||
/**
|
||||
* @param null|resource $link_identifier
|
||||
* @throws MysqlException
|
||||
*
|
||||
*/
|
||||
function mysql_close($link_identifier = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysql_close($link_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $server
|
||||
* @param string $username
|
||||
* @param string $password
|
||||
* @param bool $new_link
|
||||
* @param int $client_flags
|
||||
* @return resource
|
||||
* @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) {
|
||||
$safeResult = \mysql_connect($server, $username, $password, $new_link, $client_flags);
|
||||
} elseif ($new_link !== false) {
|
||||
$safeResult = \mysql_connect($server, $username, $password, $new_link);
|
||||
} elseif ($password !== null) {
|
||||
$safeResult = \mysql_connect($server, $username, $password);
|
||||
} elseif ($username !== null) {
|
||||
$safeResult = \mysql_connect($server, $username);
|
||||
} elseif ($server !== null) {
|
||||
$safeResult = \mysql_connect($server);
|
||||
} else {
|
||||
$safeResult = \mysql_connect();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $database_name
|
||||
* @param null|resource $link_identifier
|
||||
* @throws MysqlException
|
||||
*
|
||||
*/
|
||||
function mysql_create_db(string $database_name, $link_identifier = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysql_create_db($database_name, $link_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $result
|
||||
* @param int $row_number
|
||||
* @throws MysqlException
|
||||
*
|
||||
*/
|
||||
function mysql_data_seek($result, int $row_number): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysql_data_seek($result, $row_number);
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $result
|
||||
* @param int $row
|
||||
* @param mixed $field
|
||||
* @return string
|
||||
* @throws MysqlException
|
||||
*
|
||||
*/
|
||||
function mysql_db_name($result, int $row, $field = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysql_db_name($result, $row, $field);
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $database
|
||||
* @param string $query
|
||||
* @param null|resource $link_identifier
|
||||
* @return bool|resource
|
||||
* @throws MysqlException
|
||||
*
|
||||
*/
|
||||
function mysql_db_query(string $database, string $query, $link_identifier = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysql_db_query($database, $query, $link_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $database_name
|
||||
* @param null|resource $link_identifier
|
||||
* @throws MysqlException
|
||||
*
|
||||
*/
|
||||
function mysql_drop_db(string $database_name, $link_identifier = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysql_drop_db($database_name, $link_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $result
|
||||
* @return array
|
||||
* @throws MysqlException
|
||||
*
|
||||
*/
|
||||
function mysql_fetch_lengths($result): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysql_fetch_lengths($result);
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $result
|
||||
* @param int $field_offset
|
||||
* @return string
|
||||
* @throws MysqlException
|
||||
*
|
||||
*/
|
||||
function mysql_field_flags($result, int $field_offset): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysql_field_flags($result, $field_offset);
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $result
|
||||
* @param int $field_offset
|
||||
* @return int
|
||||
* @throws MysqlException
|
||||
*
|
||||
*/
|
||||
function mysql_field_len($result, int $field_offset): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysql_field_len($result, $field_offset);
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $result
|
||||
* @param int $field_offset
|
||||
* @return string
|
||||
* @throws MysqlException
|
||||
*
|
||||
*/
|
||||
function mysql_field_name($result, int $field_offset): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysql_field_name($result, $field_offset);
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $result
|
||||
* @param int $field_offset
|
||||
* @throws MysqlException
|
||||
*
|
||||
*/
|
||||
function mysql_field_seek($result, int $field_offset): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysql_field_seek($result, $field_offset);
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $result
|
||||
* @throws MysqlException
|
||||
*
|
||||
*/
|
||||
function mysql_free_result($result): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysql_free_result($result);
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|resource $link_identifier
|
||||
* @return string
|
||||
* @throws MysqlException
|
||||
*
|
||||
*/
|
||||
function mysql_get_host_info($link_identifier = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysql_get_host_info($link_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|resource $link_identifier
|
||||
* @return int
|
||||
* @throws MysqlException
|
||||
*
|
||||
*/
|
||||
function mysql_get_proto_info($link_identifier = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysql_get_proto_info($link_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|resource $link_identifier
|
||||
* @return string
|
||||
* @throws MysqlException
|
||||
*
|
||||
*/
|
||||
function mysql_get_server_info($link_identifier = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysql_get_server_info($link_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|resource $link_identifier
|
||||
* @return string
|
||||
* @throws MysqlException
|
||||
*
|
||||
*/
|
||||
function mysql_info($link_identifier = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysql_info($link_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|resource $link_identifier
|
||||
* @return resource
|
||||
* @throws MysqlException
|
||||
*
|
||||
*/
|
||||
function mysql_list_dbs($link_identifier = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysql_list_dbs($link_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $database_name
|
||||
* @param string $table_name
|
||||
* @param null|resource $link_identifier
|
||||
* @return resource
|
||||
* @throws MysqlException
|
||||
*
|
||||
*/
|
||||
function mysql_list_fields(string $database_name, string $table_name, $link_identifier = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysql_list_fields($database_name, $table_name, $link_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|resource $link_identifier
|
||||
* @return resource
|
||||
* @throws MysqlException
|
||||
*
|
||||
*/
|
||||
function mysql_list_processes($link_identifier = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysql_list_processes($link_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $database
|
||||
* @param null|resource $link_identifier
|
||||
* @return resource
|
||||
* @throws MysqlException
|
||||
*
|
||||
*/
|
||||
function mysql_list_tables(string $database, $link_identifier = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysql_list_tables($database, $link_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $result
|
||||
* @return int
|
||||
* @throws MysqlException
|
||||
*
|
||||
*/
|
||||
function mysql_num_fields($result): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysql_num_fields($result);
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $result
|
||||
* @return int
|
||||
* @throws MysqlException
|
||||
*
|
||||
*/
|
||||
function mysql_num_rows($result): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysql_num_rows($result);
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $query
|
||||
* @param null|resource $link_identifier
|
||||
* @return bool|resource
|
||||
* @throws MysqlException
|
||||
*
|
||||
*/
|
||||
function mysql_query(string $query, $link_identifier = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysql_query($query, $link_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $unescaped_string
|
||||
* @param null|resource $link_identifier
|
||||
* @return string
|
||||
* @throws MysqlException
|
||||
*
|
||||
*/
|
||||
function mysql_real_escape_string(string $unescaped_string, $link_identifier = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysql_real_escape_string($unescaped_string, $link_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $result
|
||||
* @param int $row
|
||||
* @param mixed $field
|
||||
* @return string
|
||||
* @throws MysqlException
|
||||
*
|
||||
*/
|
||||
function mysql_result($result, int $row, $field = 0): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysql_result($result, $row, $field);
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $database_name
|
||||
* @param null|resource $link_identifier
|
||||
* @throws MysqlException
|
||||
*
|
||||
*/
|
||||
function mysql_select_db(string $database_name, $link_identifier = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysql_select_db($database_name, $link_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $charset
|
||||
* @param null|resource $link_identifier
|
||||
* @throws MysqlException
|
||||
*
|
||||
*/
|
||||
function mysql_set_charset(string $charset, $link_identifier = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysql_set_charset($charset, $link_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $result
|
||||
* @param int $i
|
||||
* @return string
|
||||
* @throws MysqlException
|
||||
*
|
||||
*/
|
||||
function mysql_tablename($result, int $i): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysql_tablename($result, $i);
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|resource $link_identifier
|
||||
* @return int
|
||||
* @throws MysqlException
|
||||
*
|
||||
*/
|
||||
function mysql_thread_id($link_identifier = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysql_thread_id($link_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $query
|
||||
* @param null|resource $link_identifier
|
||||
* @return bool|resource
|
||||
* @throws MysqlException
|
||||
*
|
||||
*/
|
||||
function mysql_unbuffered_query(string $query, $link_identifier = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysql_unbuffered_query($query, $link_identifier);
|
||||
if ($safeResult === false) {
|
||||
throw MysqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
20
vendor/thecodingmachine/safe/generated/8.1/mysqli.php
vendored
Normal file
20
vendor/thecodingmachine/safe/generated/8.1/mysqli.php
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\MysqliException;
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @throws MysqliException
|
||||
*
|
||||
*/
|
||||
function mysqli_get_client_stats(): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysqli_get_client_stats();
|
||||
if ($safeResult === false) {
|
||||
throw MysqliException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
256
vendor/thecodingmachine/safe/generated/8.1/network.php
vendored
Normal file
256
vendor/thecodingmachine/safe/generated/8.1/network.php
vendored
Normal file
@@ -0,0 +1,256 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\NetworkException;
|
||||
|
||||
/**
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function closelog(): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \closelog();
|
||||
if ($safeResult === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $hostname
|
||||
* @param int $type
|
||||
* @param array|null $authoritative_name_servers
|
||||
* @param array|null $additional_records
|
||||
* @param bool $raw
|
||||
* @return list
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function dns_get_record(string $hostname, int $type = DNS_ANY, ?array &$authoritative_name_servers = null, ?array &$additional_records = null, bool $raw = false): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \dns_get_record($hostname, $type, $authoritative_name_servers, $additional_records, $raw);
|
||||
if ($safeResult === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $hostname
|
||||
* @param int $port
|
||||
* @param int|null $error_code
|
||||
* @param null|string $error_message
|
||||
* @param float|null $timeout
|
||||
* @return resource
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function fsockopen(string $hostname, int $port = -1, ?int &$error_code = null, ?string &$error_message = null, ?float $timeout = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($timeout !== null) {
|
||||
$safeResult = \fsockopen($hostname, $port, $error_code, $error_message, $timeout);
|
||||
} else {
|
||||
$safeResult = \fsockopen($hostname, $port, $error_code, $error_message);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function gethostname(): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gethostname();
|
||||
if ($safeResult === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $protocol
|
||||
* @return int
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function getprotobyname(string $protocol): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \getprotobyname($protocol);
|
||||
if ($safeResult === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $protocol
|
||||
* @return string
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function getprotobynumber(int $protocol): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \getprotobynumber($protocol);
|
||||
if ($safeResult === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $port
|
||||
* @param string $protocol
|
||||
* @return string
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function getservbyport(int $port, string $protocol): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \getservbyport($port, $protocol);
|
||||
if ($safeResult === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param callable $callback
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function header_register_callback(callable $callback): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \header_register_callback($callback);
|
||||
if ($safeResult === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $ip
|
||||
* @return string
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function inet_ntop(string $ip): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \inet_ntop($ip);
|
||||
if ($safeResult === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $ip
|
||||
* @return string
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function inet_pton(string $ip): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \inet_pton($ip);
|
||||
if ($safeResult === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $ip
|
||||
* @return string
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function long2ip(int $ip): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \long2ip($ip);
|
||||
if ($safeResult === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $prefix
|
||||
* @param int $flags
|
||||
* @param int $facility
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function openlog(string $prefix, int $flags, int $facility): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openlog($prefix, $flags, $facility);
|
||||
if ($safeResult === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $hostname
|
||||
* @param int $port
|
||||
* @param int|null $error_code
|
||||
* @param null|string $error_message
|
||||
* @param float|null $timeout
|
||||
* @return resource
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function pfsockopen(string $hostname, int $port = -1, ?int &$error_code = null, ?string &$error_message = null, ?float $timeout = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($timeout !== null) {
|
||||
$safeResult = \pfsockopen($hostname, $port, $error_code, $error_message, $timeout);
|
||||
} else {
|
||||
$safeResult = \pfsockopen($hostname, $port, $error_code, $error_message);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $priority
|
||||
* @param string $message
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function syslog(int $priority, string $message): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \syslog($priority, $message);
|
||||
if ($safeResult === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
650
vendor/thecodingmachine/safe/generated/8.1/oci8.php
vendored
Normal file
650
vendor/thecodingmachine/safe/generated/8.1/oci8.php
vendored
Normal file
@@ -0,0 +1,650 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\Oci8Exception;
|
||||
|
||||
/**
|
||||
* @param resource $statement
|
||||
* @param string $param
|
||||
* @param array $var
|
||||
* @param int $max_array_length
|
||||
* @param int $max_item_length
|
||||
* @param int $type
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_bind_array_by_name($statement, string $param, array &$var, int $max_array_length, int $max_item_length = -1, int $type = SQLT_AFC): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_bind_array_by_name($statement, $param, $var, $max_array_length, $max_item_length, $type);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $statement
|
||||
* @param string $param
|
||||
* @param mixed $var
|
||||
* @param int $max_length
|
||||
* @param int $type
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_bind_by_name($statement, string $param, &$var, int $max_length = -1, int $type = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_bind_by_name($statement, $param, $var, $max_length, $type);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $statement
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_cancel($statement): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_cancel($statement);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $connection
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_commit($connection): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_commit($connection);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $username
|
||||
* @param string $password
|
||||
* @param null|string $connection_string
|
||||
* @param string $encoding
|
||||
* @param int $session_mode
|
||||
* @return resource
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_connect(string $username, string $password, ?string $connection_string = null, string $encoding = "", int $session_mode = OCI_DEFAULT)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($session_mode !== OCI_DEFAULT) {
|
||||
$safeResult = \oci_connect($username, $password, $connection_string, $encoding, $session_mode);
|
||||
} elseif ($encoding !== "") {
|
||||
$safeResult = \oci_connect($username, $password, $connection_string, $encoding);
|
||||
} elseif ($connection_string !== null) {
|
||||
$safeResult = \oci_connect($username, $password, $connection_string);
|
||||
} else {
|
||||
$safeResult = \oci_connect($username, $password);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $statement
|
||||
* @param string $column
|
||||
* @param mixed $var
|
||||
* @param int $type
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_define_by_name($statement, string $column, &$var, int $type = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_define_by_name($statement, $column, $var, $type);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $statement
|
||||
* @param int $mode
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_execute($statement, int $mode = OCI_COMMIT_ON_SUCCESS): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_execute($statement, $mode);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $statement
|
||||
* @param mixed $column
|
||||
* @return string
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_field_name($statement, $column): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_field_name($statement, $column);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $statement
|
||||
* @param mixed $column
|
||||
* @return int
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_field_precision($statement, $column): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_field_precision($statement, $column);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $statement
|
||||
* @param mixed $column
|
||||
* @return int
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_field_scale($statement, $column): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_field_scale($statement, $column);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $statement
|
||||
* @param mixed $column
|
||||
* @return int
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_field_size($statement, $column): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_field_size($statement, $column);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $statement
|
||||
* @param mixed $column
|
||||
* @return int
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_field_type_raw($statement, $column): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_field_type_raw($statement, $column);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $statement
|
||||
* @param mixed $column
|
||||
* @return mixed
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_field_type($statement, $column)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_field_type($statement, $column);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \OCILob $lob
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_free_descriptor(\OCILob $lob): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_free_descriptor($lob);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $statement
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_free_statement($statement): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_free_statement($statement);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $connection
|
||||
* @param string $type_name
|
||||
* @param null|string $schema
|
||||
* @return \OCI-Collection
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_new_collection($connection, string $type_name, ?string $schema = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($schema !== null) {
|
||||
$safeResult = \oci_new_collection($connection, $type_name, $schema);
|
||||
} else {
|
||||
$safeResult = \oci_new_collection($connection, $type_name);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $username
|
||||
* @param string $password
|
||||
* @param null|string $connection_string
|
||||
* @param string $encoding
|
||||
* @param int $session_mode
|
||||
* @return resource
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_new_connect(string $username, string $password, ?string $connection_string = null, string $encoding = "", int $session_mode = OCI_DEFAULT)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($session_mode !== OCI_DEFAULT) {
|
||||
$safeResult = \oci_new_connect($username, $password, $connection_string, $encoding, $session_mode);
|
||||
} elseif ($encoding !== "") {
|
||||
$safeResult = \oci_new_connect($username, $password, $connection_string, $encoding);
|
||||
} elseif ($connection_string !== null) {
|
||||
$safeResult = \oci_new_connect($username, $password, $connection_string);
|
||||
} else {
|
||||
$safeResult = \oci_new_connect($username, $password);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $connection
|
||||
* @return resource
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_new_cursor($connection)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_new_cursor($connection);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $connection
|
||||
* @param int $type
|
||||
* @return \OCI-Lob|false
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_new_descriptor($connection, int $type = OCI_DTYPE_LOB)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_new_descriptor($connection, $type);
|
||||
if ($safeResult === null) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $statement
|
||||
* @return 0|positive-int
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_num_rows($statement): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_num_rows($statement);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $connection
|
||||
* @param string $sql
|
||||
* @return resource
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_parse($connection, string $sql)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_parse($connection, $sql);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $username
|
||||
* @param string $password
|
||||
* @param null|string $connection_string
|
||||
* @param string $encoding
|
||||
* @param int $session_mode
|
||||
* @return resource
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_pconnect(string $username, string $password, ?string $connection_string = null, string $encoding = "", int $session_mode = OCI_DEFAULT)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($session_mode !== OCI_DEFAULT) {
|
||||
$safeResult = \oci_pconnect($username, $password, $connection_string, $encoding, $session_mode);
|
||||
} elseif ($encoding !== "") {
|
||||
$safeResult = \oci_pconnect($username, $password, $connection_string, $encoding);
|
||||
} elseif ($connection_string !== null) {
|
||||
$safeResult = \oci_pconnect($username, $password, $connection_string);
|
||||
} else {
|
||||
$safeResult = \oci_pconnect($username, $password);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $connection
|
||||
* @param callable $callback
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_register_taf_callback($connection, callable $callback): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_register_taf_callback($connection, $callback);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $statement
|
||||
* @param mixed $column
|
||||
* @return string
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_result($statement, $column): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_result($statement, $column);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $connection
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_rollback($connection): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_rollback($connection);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $connection
|
||||
* @return string
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_server_version($connection): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_server_version($connection);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $connection
|
||||
* @param string $action
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_set_action($connection, string $action): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_set_action($connection, $action);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $connection
|
||||
* @param int $timeout
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_set_call_timeout($connection, int $timeout): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_set_call_timeout($connection, $timeout);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $connection
|
||||
* @param string $client_id
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_set_client_identifier($connection, string $client_id): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_set_client_identifier($connection, $client_id);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $connection
|
||||
* @param string $client_info
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_set_client_info($connection, string $client_info): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_set_client_info($connection, $client_info);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $connection
|
||||
* @param string $action
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_set_db_operation($connection, string $action): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_set_db_operation($connection, $action);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $edition
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_set_edition(string $edition): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_set_edition($edition);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $connection
|
||||
* @param string $name
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_set_module_name($connection, string $name): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_set_module_name($connection, $name);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $statement
|
||||
* @param int $rows
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_set_prefetch($statement, int $rows): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_set_prefetch($statement, $rows);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $statement
|
||||
* @return string
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_statement_type($statement): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_statement_type($statement);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $connection
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_unregister_taf_callback($connection): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \oci_unregister_taf_callback($connection);
|
||||
if ($safeResult === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
36
vendor/thecodingmachine/safe/generated/8.1/opcache.php
vendored
Normal file
36
vendor/thecodingmachine/safe/generated/8.1/opcache.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\OpcacheException;
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @throws OpcacheException
|
||||
*
|
||||
*/
|
||||
function opcache_compile_file(string $filename): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \opcache_compile_file($filename);
|
||||
if ($safeResult === false) {
|
||||
throw OpcacheException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param bool $include_scripts
|
||||
* @return array
|
||||
* @throws OpcacheException
|
||||
*
|
||||
*/
|
||||
function opcache_get_status(bool $include_scripts = true): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \opcache_get_status($include_scripts);
|
||||
if ($safeResult === false) {
|
||||
throw OpcacheException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
987
vendor/thecodingmachine/safe/generated/8.1/openssl.php
vendored
Normal file
987
vendor/thecodingmachine/safe/generated/8.1/openssl.php
vendored
Normal file
@@ -0,0 +1,987 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\OpensslException;
|
||||
|
||||
/**
|
||||
* @param string $cipher_algo
|
||||
* @return int
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_cipher_iv_length(string $cipher_algo): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_cipher_iv_length($cipher_algo);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $input_filename
|
||||
* @param string $output_filename
|
||||
* @param \OpenSSLCertificate|string $certificate
|
||||
* @param \OpenSSLAsymmetricKey|\OpenSSLCertificate|array|null|string $private_key
|
||||
* @param int $encoding
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_cms_decrypt(string $input_filename, string $output_filename, $certificate, $private_key = null, int $encoding = OPENSSL_ENCODING_SMIME): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($encoding !== OPENSSL_ENCODING_SMIME) {
|
||||
$safeResult = \openssl_cms_decrypt($input_filename, $output_filename, $certificate, $private_key, $encoding);
|
||||
} elseif ($private_key !== null) {
|
||||
$safeResult = \openssl_cms_decrypt($input_filename, $output_filename, $certificate, $private_key);
|
||||
} else {
|
||||
$safeResult = \openssl_cms_decrypt($input_filename, $output_filename, $certificate);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $input_filename
|
||||
* @param string $output_filename
|
||||
* @param \OpenSSLCertificate|array|string $certificate
|
||||
* @param array|null $headers
|
||||
* @param int $flags
|
||||
* @param int $encoding
|
||||
* @param int $cipher_algo
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_cms_encrypt(string $input_filename, string $output_filename, $certificate, ?array $headers, int $flags = 0, int $encoding = OPENSSL_ENCODING_SMIME, int $cipher_algo = OPENSSL_CIPHER_RC2_40): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_cms_encrypt($input_filename, $output_filename, $certificate, $headers, $flags, $encoding, $cipher_algo);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $input_filename
|
||||
* @param array $certificates
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_cms_read(string $input_filename, array &$certificates): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_cms_read($input_filename, $certificates);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $input_filename
|
||||
* @param string $output_filename
|
||||
* @param \OpenSSLCertificate|string $certificate
|
||||
* @param \OpenSSLAsymmetricKey|\OpenSSLCertificate|array|string $private_key
|
||||
* @param array|null $headers
|
||||
* @param int $flags
|
||||
* @param int $encoding
|
||||
* @param null|string $untrusted_certificates_filename
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_cms_sign(string $input_filename, string $output_filename, $certificate, $private_key, ?array $headers, int $flags = 0, int $encoding = OPENSSL_ENCODING_SMIME, ?string $untrusted_certificates_filename = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($untrusted_certificates_filename !== null) {
|
||||
$safeResult = \openssl_cms_sign($input_filename, $output_filename, $certificate, $private_key, $headers, $flags, $encoding, $untrusted_certificates_filename);
|
||||
} else {
|
||||
$safeResult = \openssl_cms_sign($input_filename, $output_filename, $certificate, $private_key, $headers, $flags, $encoding);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $input_filename
|
||||
* @param int $flags
|
||||
* @param null|string $certificates
|
||||
* @param array $ca_info
|
||||
* @param null|string $untrusted_certificates_filename
|
||||
* @param null|string $content
|
||||
* @param null|string $pk7
|
||||
* @param null|string $sigfile
|
||||
* @param int $encoding
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_cms_verify(string $input_filename, int $flags = 0, ?string $certificates = null, array $ca_info = [], ?string $untrusted_certificates_filename = null, ?string $content = null, ?string $pk7 = null, ?string $sigfile = null, int $encoding = OPENSSL_ENCODING_SMIME): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($encoding !== OPENSSL_ENCODING_SMIME) {
|
||||
$safeResult = \openssl_cms_verify($input_filename, $flags, $certificates, $ca_info, $untrusted_certificates_filename, $content, $pk7, $sigfile, $encoding);
|
||||
} elseif ($sigfile !== null) {
|
||||
$safeResult = \openssl_cms_verify($input_filename, $flags, $certificates, $ca_info, $untrusted_certificates_filename, $content, $pk7, $sigfile);
|
||||
} elseif ($pk7 !== null) {
|
||||
$safeResult = \openssl_cms_verify($input_filename, $flags, $certificates, $ca_info, $untrusted_certificates_filename, $content, $pk7);
|
||||
} elseif ($content !== null) {
|
||||
$safeResult = \openssl_cms_verify($input_filename, $flags, $certificates, $ca_info, $untrusted_certificates_filename, $content);
|
||||
} elseif ($untrusted_certificates_filename !== null) {
|
||||
$safeResult = \openssl_cms_verify($input_filename, $flags, $certificates, $ca_info, $untrusted_certificates_filename);
|
||||
} elseif ($ca_info !== []) {
|
||||
$safeResult = \openssl_cms_verify($input_filename, $flags, $certificates, $ca_info);
|
||||
} elseif ($certificates !== null) {
|
||||
$safeResult = \openssl_cms_verify($input_filename, $flags, $certificates);
|
||||
} else {
|
||||
$safeResult = \openssl_cms_verify($input_filename, $flags);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \OpenSSLCertificateSigningRequest|string $csr
|
||||
* @param string $output_filename
|
||||
* @param bool $no_text
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_csr_export_to_file($csr, string $output_filename, bool $no_text = true): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_csr_export_to_file($csr, $output_filename, $no_text);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \OpenSSLCertificateSigningRequest|string $csr
|
||||
* @param null|string $output
|
||||
* @param bool $no_text
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_csr_export($csr, ?string &$output, bool $no_text = true): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_csr_export($csr, $output, $no_text);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \OpenSSLCertificateSigningRequest|string $csr
|
||||
* @param bool $short_names
|
||||
* @return \OpenSSLAsymmetricKey
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_csr_get_public_key($csr, bool $short_names = true): \OpenSSLAsymmetricKey
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_csr_get_public_key($csr, $short_names);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \OpenSSLCertificateSigningRequest|string $csr
|
||||
* @param bool $short_names
|
||||
* @return array
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_csr_get_subject($csr, bool $short_names = true): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_csr_get_subject($csr, $short_names);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $distinguished_names
|
||||
* @param \OpenSSLAsymmetricKey $private_key
|
||||
* @param array|null $options
|
||||
* @param array|null $extra_attributes
|
||||
* @return \OpenSSLCertificateSigningRequest
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_csr_new(array $distinguished_names, \OpenSSLAsymmetricKey &$private_key, ?array $options = null, ?array $extra_attributes = null): \OpenSSLCertificateSigningRequest
|
||||
{
|
||||
error_clear_last();
|
||||
if ($extra_attributes !== null) {
|
||||
$safeResult = \openssl_csr_new($distinguished_names, $private_key, $options, $extra_attributes);
|
||||
} elseif ($options !== null) {
|
||||
$safeResult = \openssl_csr_new($distinguished_names, $private_key, $options);
|
||||
} else {
|
||||
$safeResult = \openssl_csr_new($distinguished_names, $private_key);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \OpenSSLCertificateSigningRequest|string $csr
|
||||
* @param \OpenSSLCertificate|null|string $ca_certificate
|
||||
* @param \OpenSSLAsymmetricKey|\OpenSSLCertificate|array|string $private_key
|
||||
* @param int $days
|
||||
* @param array|null $options
|
||||
* @param int $serial
|
||||
* @return \OpenSSLCertificate
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_csr_sign($csr, $ca_certificate, $private_key, int $days, ?array $options = null, int $serial = 0): \OpenSSLCertificate
|
||||
{
|
||||
error_clear_last();
|
||||
if ($serial !== 0) {
|
||||
$safeResult = \openssl_csr_sign($csr, $ca_certificate, $private_key, $days, $options, $serial);
|
||||
} elseif ($options !== null) {
|
||||
$safeResult = \openssl_csr_sign($csr, $ca_certificate, $private_key, $days, $options);
|
||||
} else {
|
||||
$safeResult = \openssl_csr_sign($csr, $ca_certificate, $private_key, $days);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $data
|
||||
* @param string $cipher_algo
|
||||
* @param string $passphrase
|
||||
* @param int $options
|
||||
* @param string $iv
|
||||
* @param string $tag
|
||||
* @param string $aad
|
||||
* @return string
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_decrypt(string $data, string $cipher_algo, string $passphrase, int $options = 0, string $iv = "", string $tag = "", string $aad = ""): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_decrypt($data, $cipher_algo, $passphrase, $options, $iv, $tag, $aad);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $public_key
|
||||
* @param \OpenSSLAsymmetricKey $private_key
|
||||
* @return string
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_dh_compute_key(string $public_key, \OpenSSLAsymmetricKey $private_key): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_dh_compute_key($public_key, $private_key);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $data
|
||||
* @param string $digest_algo
|
||||
* @param bool $binary
|
||||
* @return string
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_digest(string $data, string $digest_algo, bool $binary = false): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_digest($data, $digest_algo, $binary);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return list
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_get_curve_names(): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_get_curve_names();
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $data
|
||||
* @param null|string $output
|
||||
* @param string $encrypted_key
|
||||
* @param \OpenSSLAsymmetricKey|\OpenSSLCertificate|array|string $private_key
|
||||
* @param string $cipher_algo
|
||||
* @param null|string $iv
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_open(string $data, ?string &$output, string $encrypted_key, $private_key, string $cipher_algo, ?string $iv = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($iv !== null) {
|
||||
$safeResult = \openssl_open($data, $output, $encrypted_key, $private_key, $cipher_algo, $iv);
|
||||
} else {
|
||||
$safeResult = \openssl_open($data, $output, $encrypted_key, $private_key, $cipher_algo);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $password
|
||||
* @param string $salt
|
||||
* @param int $key_length
|
||||
* @param int $iterations
|
||||
* @param string $digest_algo
|
||||
* @return string
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_pbkdf2(string $password, string $salt, int $key_length, int $iterations, string $digest_algo = "sha1"): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_pbkdf2($password, $salt, $key_length, $iterations, $digest_algo);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \OpenSSLCertificate|string $certificate
|
||||
* @param string $output_filename
|
||||
* @param \OpenSSLAsymmetricKey|\OpenSSLCertificate|array|string $private_key
|
||||
* @param string $passphrase
|
||||
* @param array $options
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_pkcs12_export_to_file($certificate, string $output_filename, $private_key, string $passphrase, array $options = []): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_pkcs12_export_to_file($certificate, $output_filename, $private_key, $passphrase, $options);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \OpenSSLCertificate|string $certificate
|
||||
* @param null|string $output
|
||||
* @param \OpenSSLAsymmetricKey|\OpenSSLCertificate|array|string $private_key
|
||||
* @param string $passphrase
|
||||
* @param array $options
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_pkcs12_export($certificate, ?string &$output, $private_key, string $passphrase, array $options = []): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_pkcs12_export($certificate, $output, $private_key, $passphrase, $options);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $pkcs12
|
||||
* @param array|null $certificates
|
||||
* @param string $passphrase
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_pkcs12_read(string $pkcs12, ?array &$certificates, string $passphrase): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_pkcs12_read($pkcs12, $certificates, $passphrase);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $input_filename
|
||||
* @param string $output_filename
|
||||
* @param \OpenSSLCertificate|string $certificate
|
||||
* @param \OpenSSLAsymmetricKey|\OpenSSLCertificate|array|null|string $private_key
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_pkcs7_decrypt(string $input_filename, string $output_filename, $certificate, $private_key = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($private_key !== null) {
|
||||
$safeResult = \openssl_pkcs7_decrypt($input_filename, $output_filename, $certificate, $private_key);
|
||||
} else {
|
||||
$safeResult = \openssl_pkcs7_decrypt($input_filename, $output_filename, $certificate);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $input_filename
|
||||
* @param string $output_filename
|
||||
* @param \OpenSSLCertificate|array|string $certificate
|
||||
* @param array $headers
|
||||
* @param int $flags
|
||||
* @param int $cipher_algo
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_pkcs7_encrypt(string $input_filename, string $output_filename, $certificate, array $headers, int $flags = 0, int $cipher_algo = OPENSSL_CIPHER_RC2_40): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_pkcs7_encrypt($input_filename, $output_filename, $certificate, $headers, $flags, $cipher_algo);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $data
|
||||
* @param array|null $certificates
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_pkcs7_read(string $data, ?array &$certificates): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_pkcs7_read($data, $certificates);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $input_filename
|
||||
* @param string $output_filename
|
||||
* @param \OpenSSLCertificate|string $certificate
|
||||
* @param \OpenSSLAsymmetricKey|\OpenSSLCertificate|array|string $private_key
|
||||
* @param array $headers
|
||||
* @param int $flags
|
||||
* @param null|string $untrusted_certificates_filename
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_pkcs7_sign(string $input_filename, string $output_filename, $certificate, $private_key, array $headers, int $flags = PKCS7_DETACHED, ?string $untrusted_certificates_filename = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($untrusted_certificates_filename !== null) {
|
||||
$safeResult = \openssl_pkcs7_sign($input_filename, $output_filename, $certificate, $private_key, $headers, $flags, $untrusted_certificates_filename);
|
||||
} else {
|
||||
$safeResult = \openssl_pkcs7_sign($input_filename, $output_filename, $certificate, $private_key, $headers, $flags);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \OpenSSLAsymmetricKey|\OpenSSLCertificate|array|string $public_key
|
||||
* @param \OpenSSLAsymmetricKey|\OpenSSLCertificate|array|string $private_key
|
||||
* @param int $key_length
|
||||
* @return string
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_pkey_derive($public_key, $private_key, int $key_length = 0): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_pkey_derive($public_key, $private_key, $key_length);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \OpenSSLAsymmetricKey|\OpenSSLCertificate|array|string $key
|
||||
* @param string $output_filename
|
||||
* @param null|string $passphrase
|
||||
* @param array|null $options
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_pkey_export_to_file($key, string $output_filename, ?string $passphrase = null, ?array $options = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($options !== null) {
|
||||
$safeResult = \openssl_pkey_export_to_file($key, $output_filename, $passphrase, $options);
|
||||
} elseif ($passphrase !== null) {
|
||||
$safeResult = \openssl_pkey_export_to_file($key, $output_filename, $passphrase);
|
||||
} else {
|
||||
$safeResult = \openssl_pkey_export_to_file($key, $output_filename);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \OpenSSLAsymmetricKey|\OpenSSLCertificate|array|string $key
|
||||
* @param null|string $output
|
||||
* @param null|string $passphrase
|
||||
* @param array|null $options
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_pkey_export($key, ?string &$output, ?string $passphrase = null, ?array $options = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($options !== null) {
|
||||
$safeResult = \openssl_pkey_export($key, $output, $passphrase, $options);
|
||||
} elseif ($passphrase !== null) {
|
||||
$safeResult = \openssl_pkey_export($key, $output, $passphrase);
|
||||
} else {
|
||||
$safeResult = \openssl_pkey_export($key, $output);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \OpenSSLAsymmetricKey $key
|
||||
* @return array
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_pkey_get_details(\OpenSSLAsymmetricKey $key): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_pkey_get_details($key);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \OpenSSLAsymmetricKey|\OpenSSLCertificate|array|string $private_key
|
||||
* @param null|string $passphrase
|
||||
* @return \OpenSSLAsymmetricKey
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_pkey_get_private($private_key, ?string $passphrase = null): \OpenSSLAsymmetricKey
|
||||
{
|
||||
error_clear_last();
|
||||
if ($passphrase !== null) {
|
||||
$safeResult = \openssl_pkey_get_private($private_key, $passphrase);
|
||||
} else {
|
||||
$safeResult = \openssl_pkey_get_private($private_key);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \OpenSSLAsymmetricKey|\OpenSSLCertificate|array|string $public_key
|
||||
* @return \OpenSSLAsymmetricKey
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_pkey_get_public($public_key): \OpenSSLAsymmetricKey
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_pkey_get_public($public_key);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array|null $options
|
||||
* @return \OpenSSLAsymmetricKey
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_pkey_new(?array $options = null): \OpenSSLAsymmetricKey
|
||||
{
|
||||
error_clear_last();
|
||||
if ($options !== null) {
|
||||
$safeResult = \openssl_pkey_new($options);
|
||||
} else {
|
||||
$safeResult = \openssl_pkey_new();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $data
|
||||
* @param null|string $decrypted_data
|
||||
* @param \OpenSSLAsymmetricKey|\OpenSSLCertificate|array|string $private_key
|
||||
* @param int $padding
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_private_decrypt(string $data, ?string &$decrypted_data, $private_key, int $padding = OPENSSL_PKCS1_PADDING): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_private_decrypt($data, $decrypted_data, $private_key, $padding);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $data
|
||||
* @param null|string $encrypted_data
|
||||
* @param \OpenSSLAsymmetricKey|\OpenSSLCertificate|array|string $private_key
|
||||
* @param int $padding
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_private_encrypt(string $data, ?string &$encrypted_data, $private_key, int $padding = OPENSSL_PKCS1_PADDING): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_private_encrypt($data, $encrypted_data, $private_key, $padding);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $data
|
||||
* @param null|string $decrypted_data
|
||||
* @param \OpenSSLAsymmetricKey|\OpenSSLCertificate|array|string $public_key
|
||||
* @param int $padding
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_public_decrypt(string $data, ?string &$decrypted_data, $public_key, int $padding = OPENSSL_PKCS1_PADDING): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_public_decrypt($data, $decrypted_data, $public_key, $padding);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $data
|
||||
* @param null|string $encrypted_data
|
||||
* @param \OpenSSLAsymmetricKey|\OpenSSLCertificate|array|string $public_key
|
||||
* @param int $padding
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_public_encrypt(string $data, ?string &$encrypted_data, $public_key, int $padding = OPENSSL_PKCS1_PADDING): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_public_encrypt($data, $encrypted_data, $public_key, $padding);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $length
|
||||
* @param bool|null $strong_result
|
||||
* @return string
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_random_pseudo_bytes(int $length, ?bool &$strong_result = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_random_pseudo_bytes($length, $strong_result);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $data
|
||||
* @param null|string $sealed_data
|
||||
* @param array|null $encrypted_keys
|
||||
* @param array $public_key
|
||||
* @param string $cipher_algo
|
||||
* @param null|string $iv
|
||||
* @return int
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_seal(string $data, ?string &$sealed_data, ?array &$encrypted_keys, array $public_key, string $cipher_algo, ?string &$iv = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_seal($data, $sealed_data, $encrypted_keys, $public_key, $cipher_algo, $iv);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $data
|
||||
* @param null|string $signature
|
||||
* @param \OpenSSLAsymmetricKey|\OpenSSLCertificate|array|string $private_key
|
||||
* @param int|string $algorithm
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_sign(string $data, ?string &$signature, $private_key, $algorithm = OPENSSL_ALGO_SHA1): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_sign($data, $signature, $private_key, $algorithm);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $spki
|
||||
* @return null|string
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_spki_export_challenge(string $spki): ?string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_spki_export_challenge($spki);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $spki
|
||||
* @return null|string
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_spki_export(string $spki): ?string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_spki_export($spki);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \OpenSSLAsymmetricKey $private_key
|
||||
* @param string $challenge
|
||||
* @param int $digest_algo
|
||||
* @return null|string
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_spki_new(\OpenSSLAsymmetricKey $private_key, string $challenge, int $digest_algo = OPENSSL_ALGO_MD5): ?string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_spki_new($private_key, $challenge, $digest_algo);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $spki
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_spki_verify(string $spki): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_spki_verify($spki);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $data
|
||||
* @param string $signature
|
||||
* @param \OpenSSLAsymmetricKey|\OpenSSLCertificate|array|string $public_key
|
||||
* @param int|string $algorithm
|
||||
* @return -1|0|1
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_verify(string $data, string $signature, $public_key, $algorithm = OPENSSL_ALGO_SHA1): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_verify($data, $signature, $public_key, $algorithm);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \OpenSSLCertificate|string $certificate
|
||||
* @param int $purpose
|
||||
* @param array $ca_info
|
||||
* @param null|string $untrusted_certificates_file
|
||||
* @return bool|int
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_x509_checkpurpose($certificate, int $purpose, array $ca_info = [], ?string $untrusted_certificates_file = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($untrusted_certificates_file !== null) {
|
||||
$safeResult = \openssl_x509_checkpurpose($certificate, $purpose, $ca_info, $untrusted_certificates_file);
|
||||
} else {
|
||||
$safeResult = \openssl_x509_checkpurpose($certificate, $purpose, $ca_info);
|
||||
}
|
||||
if ($safeResult === -1) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \OpenSSLCertificate|string $certificate
|
||||
* @param string $output_filename
|
||||
* @param bool $no_text
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_x509_export_to_file($certificate, string $output_filename, bool $no_text = true): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_x509_export_to_file($certificate, $output_filename, $no_text);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \OpenSSLCertificate|string $certificate
|
||||
* @param null|string $output
|
||||
* @param bool $no_text
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_x509_export($certificate, ?string &$output, bool $no_text = true): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_x509_export($certificate, $output, $no_text);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \OpenSSLCertificate|string $certificate
|
||||
* @param string $digest_algo
|
||||
* @param bool $binary
|
||||
* @return string
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_x509_fingerprint($certificate, string $digest_algo = "sha1", bool $binary = false): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_x509_fingerprint($certificate, $digest_algo, $binary);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \OpenSSLCertificate|string $certificate
|
||||
* @return \OpenSSLCertificate
|
||||
* @throws OpensslException
|
||||
*
|
||||
*/
|
||||
function openssl_x509_read($certificate): \OpenSSLCertificate
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openssl_x509_read($certificate);
|
||||
if ($safeResult === false) {
|
||||
throw OpensslException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
131
vendor/thecodingmachine/safe/generated/8.1/outcontrol.php
vendored
Normal file
131
vendor/thecodingmachine/safe/generated/8.1/outcontrol.php
vendored
Normal file
@@ -0,0 +1,131 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\OutcontrolException;
|
||||
|
||||
/**
|
||||
* @throws OutcontrolException
|
||||
*
|
||||
*/
|
||||
function ob_clean(): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ob_clean();
|
||||
if ($safeResult === false) {
|
||||
throw OutcontrolException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @throws OutcontrolException
|
||||
*
|
||||
*/
|
||||
function ob_end_clean(): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ob_end_clean();
|
||||
if ($safeResult === false) {
|
||||
throw OutcontrolException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @throws OutcontrolException
|
||||
*
|
||||
*/
|
||||
function ob_end_flush(): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ob_end_flush();
|
||||
if ($safeResult === false) {
|
||||
throw OutcontrolException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @throws OutcontrolException
|
||||
*
|
||||
*/
|
||||
function ob_flush(): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ob_flush();
|
||||
if ($safeResult === false) {
|
||||
throw OutcontrolException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws OutcontrolException
|
||||
*
|
||||
*/
|
||||
function ob_get_clean(): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ob_get_clean();
|
||||
if ($safeResult === false) {
|
||||
throw OutcontrolException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array|callable|null|string $callback
|
||||
* @param int $chunk_size
|
||||
* @param int $flags
|
||||
* @throws OutcontrolException
|
||||
*
|
||||
*/
|
||||
function ob_start($callback = null, int $chunk_size = 0, int $flags = PHP_OUTPUT_HANDLER_STDFLAGS): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($flags !== PHP_OUTPUT_HANDLER_STDFLAGS) {
|
||||
$safeResult = \ob_start($callback, $chunk_size, $flags);
|
||||
} elseif ($chunk_size !== 0) {
|
||||
$safeResult = \ob_start($callback, $chunk_size);
|
||||
} elseif ($callback !== null) {
|
||||
$safeResult = \ob_start($callback);
|
||||
} else {
|
||||
$safeResult = \ob_start();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw OutcontrolException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @param string $value
|
||||
* @throws OutcontrolException
|
||||
*
|
||||
*/
|
||||
function output_add_rewrite_var(string $name, string $value): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \output_add_rewrite_var($name, $value);
|
||||
if ($safeResult === false) {
|
||||
throw OutcontrolException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @throws OutcontrolException
|
||||
*
|
||||
*/
|
||||
function output_reset_rewrite_vars(): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \output_reset_rewrite_vars();
|
||||
if ($safeResult === false) {
|
||||
throw OutcontrolException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
137
vendor/thecodingmachine/safe/generated/8.1/pcntl.php
vendored
Normal file
137
vendor/thecodingmachine/safe/generated/8.1/pcntl.php
vendored
Normal file
@@ -0,0 +1,137 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\PcntlException;
|
||||
|
||||
/**
|
||||
* @param int|null $process_id
|
||||
* @param int $mode
|
||||
* @return int
|
||||
* @throws PcntlException
|
||||
*
|
||||
*/
|
||||
function pcntl_getpriority(?int $process_id = null, int $mode = PRIO_PROCESS): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($mode !== PRIO_PROCESS) {
|
||||
$safeResult = \pcntl_getpriority($process_id, $mode);
|
||||
} elseif ($process_id !== null) {
|
||||
$safeResult = \pcntl_getpriority($process_id);
|
||||
} else {
|
||||
$safeResult = \pcntl_getpriority();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw PcntlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $priority
|
||||
* @param int|null $process_id
|
||||
* @param int $mode
|
||||
* @throws PcntlException
|
||||
*
|
||||
*/
|
||||
function pcntl_setpriority(int $priority, ?int $process_id = null, int $mode = PRIO_PROCESS): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($mode !== PRIO_PROCESS) {
|
||||
$safeResult = \pcntl_setpriority($priority, $process_id, $mode);
|
||||
} elseif ($process_id !== null) {
|
||||
$safeResult = \pcntl_setpriority($priority, $process_id);
|
||||
} else {
|
||||
$safeResult = \pcntl_setpriority($priority);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw PcntlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @throws PcntlException
|
||||
*
|
||||
*/
|
||||
function pcntl_signal_dispatch(): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pcntl_signal_dispatch();
|
||||
if ($safeResult === false) {
|
||||
throw PcntlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $signal
|
||||
* @param callable|int $handler
|
||||
* @param bool $restart_syscalls
|
||||
* @throws PcntlException
|
||||
*
|
||||
*/
|
||||
function pcntl_signal(int $signal, $handler, bool $restart_syscalls = true): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pcntl_signal($signal, $handler, $restart_syscalls);
|
||||
if ($safeResult === false) {
|
||||
throw PcntlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $mode
|
||||
* @param array $signals
|
||||
* @param array|null $old_signals
|
||||
* @throws PcntlException
|
||||
*
|
||||
*/
|
||||
function pcntl_sigprocmask(int $mode, array $signals, ?array &$old_signals = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pcntl_sigprocmask($mode, $signals, $old_signals);
|
||||
if ($safeResult === false) {
|
||||
throw PcntlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $signals
|
||||
* @param array|null $info
|
||||
* @param int $seconds
|
||||
* @param int $nanoseconds
|
||||
* @return int
|
||||
* @throws PcntlException
|
||||
*
|
||||
*/
|
||||
function pcntl_sigtimedwait(array $signals, ?array &$info = [], int $seconds = 0, int $nanoseconds = 0): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pcntl_sigtimedwait($signals, $info, $seconds, $nanoseconds);
|
||||
if ($safeResult === false) {
|
||||
throw PcntlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $signals
|
||||
* @param array|null $info
|
||||
* @return int
|
||||
* @throws PcntlException
|
||||
*
|
||||
*/
|
||||
function pcntl_sigwaitinfo(array $signals, ?array &$info = []): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pcntl_sigwaitinfo($signals, $info);
|
||||
if ($safeResult === false) {
|
||||
throw PcntlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
128
vendor/thecodingmachine/safe/generated/8.1/pcre.php
vendored
Normal file
128
vendor/thecodingmachine/safe/generated/8.1/pcre.php
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\PcreException;
|
||||
|
||||
/**
|
||||
* @param string $pattern
|
||||
* @param array $array
|
||||
* @param int $flags
|
||||
* @return array
|
||||
* @throws PcreException
|
||||
*
|
||||
*/
|
||||
function preg_grep(string $pattern, array $array, int $flags = 0): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \preg_grep($pattern, $array, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw PcreException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $pattern
|
||||
* @param string $subject
|
||||
* @param array|null $matches
|
||||
* @param int $flags
|
||||
* @param int $offset
|
||||
* @return 0|positive-int
|
||||
* @throws PcreException
|
||||
*
|
||||
*/
|
||||
function preg_match_all(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \preg_match_all($pattern, $subject, $matches, $flags, $offset);
|
||||
if ($safeResult === false) {
|
||||
throw PcreException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $pattern
|
||||
* @param string $subject
|
||||
* @param null|string[] $matches
|
||||
* @param int $flags
|
||||
* @param int $offset
|
||||
* @return 0|1
|
||||
* @throws PcreException
|
||||
*
|
||||
*/
|
||||
function preg_match(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \preg_match($pattern, $subject, $matches, $flags, $offset);
|
||||
if ($safeResult === false) {
|
||||
throw PcreException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $pattern
|
||||
* @param array|string $subject
|
||||
* @param int $limit
|
||||
* @param int|null $count
|
||||
* @param int $flags
|
||||
* @return array|string
|
||||
* @throws PcreException
|
||||
*
|
||||
*/
|
||||
function preg_replace_callback_array(array $pattern, $subject, int $limit = -1, ?int &$count = null, int $flags = 0)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \preg_replace_callback_array($pattern, $subject, $limit, $count, $flags);
|
||||
if ($safeResult === null) {
|
||||
throw PcreException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array|string $pattern
|
||||
* @param callable(array):string $callback
|
||||
* @param array|string $subject
|
||||
* @param int $limit
|
||||
* @param int|null $count
|
||||
* @param int $flags
|
||||
* @return array|string
|
||||
* @throws PcreException
|
||||
*
|
||||
*/
|
||||
function preg_replace_callback($pattern, callable $callback, $subject, int $limit = -1, ?int &$count = null, int $flags = 0)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \preg_replace_callback($pattern, $callback, $subject, $limit, $count, $flags);
|
||||
if ($safeResult === null) {
|
||||
throw PcreException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $pattern
|
||||
* @param string $subject
|
||||
* @param int|null $limit
|
||||
* @param int $flags
|
||||
* @return list
|
||||
* @throws PcreException
|
||||
*
|
||||
*/
|
||||
function preg_split(string $pattern, string $subject, ?int $limit = -1, int $flags = 0): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \preg_split($pattern, $subject, $limit, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw PcreException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
774
vendor/thecodingmachine/safe/generated/8.1/pgsql.php
vendored
Normal file
774
vendor/thecodingmachine/safe/generated/8.1/pgsql.php
vendored
Normal file
@@ -0,0 +1,774 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\PgsqlException;
|
||||
|
||||
/**
|
||||
* @param \PgSql\Connection $connection
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_cancel_query(\PgSql\Connection $connection): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pg_cancel_query($connection);
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $connection_string
|
||||
* @param int $flags
|
||||
* @return \PgSql\Connection
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_connect(string $connection_string, int $flags = 0): \PgSql\Connection
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pg_connect($connection_string, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Connection $connection
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_connection_reset(\PgSql\Connection $connection): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pg_connection_reset($connection);
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Connection $connection
|
||||
* @param string $table_name
|
||||
* @param array $values
|
||||
* @param int $flags
|
||||
* @return array
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_convert(\PgSql\Connection $connection, string $table_name, array $values, int $flags = 0): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pg_convert($connection, $table_name, $values, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Connection $connection
|
||||
* @param string $table_name
|
||||
* @param array $rows
|
||||
* @param string $separator
|
||||
* @param string $null_as
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_copy_from(\PgSql\Connection $connection, string $table_name, array $rows, string $separator = "\t", string $null_as = "\\\\N"): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pg_copy_from($connection, $table_name, $rows, $separator, $null_as);
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Connection $connection
|
||||
* @param string $table_name
|
||||
* @param string $separator
|
||||
* @param string $null_as
|
||||
* @return array
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_copy_to(\PgSql\Connection $connection, string $table_name, string $separator = "\t", string $null_as = "\\\\N"): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pg_copy_to($connection, $table_name, $separator, $null_as);
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Connection $connection
|
||||
* @param string $table_name
|
||||
* @param array $conditions
|
||||
* @param int $flags
|
||||
* @return mixed
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_delete(\PgSql\Connection $connection, string $table_name, array $conditions, int $flags = PGSQL_DML_EXEC)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pg_delete($connection, $table_name, $conditions, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Connection|null $connection
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_end_copy(?\PgSql\Connection $connection = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($connection !== null) {
|
||||
$safeResult = \pg_end_copy($connection);
|
||||
} else {
|
||||
$safeResult = \pg_end_copy();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Connection $connection
|
||||
* @param string $stmtname
|
||||
* @param array $params
|
||||
* @return \PgSql\Result
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_execute(?\PgSql\Connection $connection = null, ?string $stmtname = null, ?array $params = null): \PgSql\Result
|
||||
{
|
||||
error_clear_last();
|
||||
if ($params !== null) {
|
||||
$safeResult = \pg_execute($connection, $stmtname, $params);
|
||||
} elseif ($stmtname !== null) {
|
||||
$safeResult = \pg_execute($connection, $stmtname);
|
||||
} elseif ($connection !== null) {
|
||||
$safeResult = \pg_execute($connection);
|
||||
} else {
|
||||
$safeResult = \pg_execute();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Result $result
|
||||
* @param string $field
|
||||
* @return int
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_field_num(\PgSql\Result $result, string $field): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pg_field_num($result, $field);
|
||||
if ($safeResult === -1) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Result $result
|
||||
* @param int $field
|
||||
* @param bool $oid_only
|
||||
* @return mixed
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_field_table(\PgSql\Result $result, int $field, bool $oid_only = false)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pg_field_table($result, $field, $oid_only);
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Connection $connection
|
||||
* @return mixed
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_flush(\PgSql\Connection $connection)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pg_flush($connection);
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Result $result
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_free_result(\PgSql\Result $result): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pg_free_result($result);
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Connection|null $connection
|
||||
* @return string
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_host(?\PgSql\Connection $connection = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($connection !== null) {
|
||||
$safeResult = \pg_host($connection);
|
||||
} else {
|
||||
$safeResult = \pg_host();
|
||||
}
|
||||
if ($safeResult === '') {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Connection $connection
|
||||
* @param string $table_name
|
||||
* @param array $values
|
||||
* @param int $flags
|
||||
* @return mixed
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_insert(\PgSql\Connection $connection, string $table_name, array $values, int $flags = PGSQL_DML_EXEC)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pg_insert($connection, $table_name, $values, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Result $result
|
||||
* @return string
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_last_oid(\PgSql\Result $result): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pg_last_oid($result);
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Lob $lob
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_lo_close(\PgSql\Lob $lob): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pg_lo_close($lob);
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Connection $connection
|
||||
* @param int $oid
|
||||
* @param string $pathname
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_lo_export(?\PgSql\Connection $connection = null, ?int $oid = null, ?string $pathname = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($pathname !== null) {
|
||||
$safeResult = \pg_lo_export($connection, $oid, $pathname);
|
||||
} elseif ($oid !== null) {
|
||||
$safeResult = \pg_lo_export($connection, $oid);
|
||||
} elseif ($connection !== null) {
|
||||
$safeResult = \pg_lo_export($connection);
|
||||
} else {
|
||||
$safeResult = \pg_lo_export();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Connection $connection
|
||||
* @param string $pathname
|
||||
* @param $object_id
|
||||
* @return int
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_lo_import(?\PgSql\Connection $connection = null, ?string $pathname = null, $object_id = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($object_id !== null) {
|
||||
$safeResult = \pg_lo_import($connection, $pathname, $object_id);
|
||||
} elseif ($pathname !== null) {
|
||||
$safeResult = \pg_lo_import($connection, $pathname);
|
||||
} elseif ($connection !== null) {
|
||||
$safeResult = \pg_lo_import($connection);
|
||||
} else {
|
||||
$safeResult = \pg_lo_import();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Connection $connection
|
||||
* @param int $oid
|
||||
* @param string $mode
|
||||
* @return \PgSql\Lob
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_lo_open(\PgSql\Connection $connection, int $oid, string $mode): \PgSql\Lob
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pg_lo_open($connection, $oid, $mode);
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Lob $lob
|
||||
* @param int $length
|
||||
* @return string
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_lo_read(\PgSql\Lob $lob, int $length = 8192): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pg_lo_read($lob, $length);
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Lob $lob
|
||||
* @param int $offset
|
||||
* @param int $whence
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_lo_seek(\PgSql\Lob $lob, int $offset, int $whence = SEEK_CUR): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pg_lo_seek($lob, $offset, $whence);
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Lob $lob
|
||||
* @param int $size
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_lo_truncate(\PgSql\Lob $lob, int $size): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pg_lo_truncate($lob, $size);
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Connection $connection
|
||||
* @param int $oid
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_lo_unlink(\PgSql\Connection $connection, int $oid): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pg_lo_unlink($connection, $oid);
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Lob $lob
|
||||
* @param string $data
|
||||
* @param int|null $length
|
||||
* @return int
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_lo_write(\PgSql\Lob $lob, string $data, ?int $length = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($length !== null) {
|
||||
$safeResult = \pg_lo_write($lob, $data, $length);
|
||||
} else {
|
||||
$safeResult = \pg_lo_write($lob, $data);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Connection $connection
|
||||
* @param string $table_name
|
||||
* @param bool $extended
|
||||
* @return array
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_meta_data(\PgSql\Connection $connection, string $table_name, bool $extended = false): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pg_meta_data($connection, $table_name, $extended);
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Connection $connection
|
||||
* @param string $param_name
|
||||
* @return string
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_parameter_status(?\PgSql\Connection $connection = null, ?string $param_name = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($param_name !== null) {
|
||||
$safeResult = \pg_parameter_status($connection, $param_name);
|
||||
} elseif ($connection !== null) {
|
||||
$safeResult = \pg_parameter_status($connection);
|
||||
} else {
|
||||
$safeResult = \pg_parameter_status();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $connection_string
|
||||
* @param int $flags
|
||||
* @return \PgSql\Connection
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_pconnect(string $connection_string, int $flags = 0): \PgSql\Connection
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pg_pconnect($connection_string, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Connection|null $connection
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_ping(?\PgSql\Connection $connection = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($connection !== null) {
|
||||
$safeResult = \pg_ping($connection);
|
||||
} else {
|
||||
$safeResult = \pg_ping();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Connection $connection
|
||||
* @param string $stmtname
|
||||
* @param string $query
|
||||
* @return \PgSql\Result
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_prepare(?\PgSql\Connection $connection = null, ?string $stmtname = null, ?string $query = null): \PgSql\Result
|
||||
{
|
||||
error_clear_last();
|
||||
if ($query !== null) {
|
||||
$safeResult = \pg_prepare($connection, $stmtname, $query);
|
||||
} elseif ($stmtname !== null) {
|
||||
$safeResult = \pg_prepare($connection, $stmtname);
|
||||
} elseif ($connection !== null) {
|
||||
$safeResult = \pg_prepare($connection);
|
||||
} else {
|
||||
$safeResult = \pg_prepare();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Connection $connection
|
||||
* @param string $data
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_put_line(?\PgSql\Connection $connection = null, ?string $data = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($data !== null) {
|
||||
$safeResult = \pg_put_line($connection, $data);
|
||||
} elseif ($connection !== null) {
|
||||
$safeResult = \pg_put_line($connection);
|
||||
} else {
|
||||
$safeResult = \pg_put_line();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Connection $connection
|
||||
* @param string $query
|
||||
* @param array $params
|
||||
* @return \PgSql\Result
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_query_params(?\PgSql\Connection $connection = null, ?string $query = null, ?array $params = null): \PgSql\Result
|
||||
{
|
||||
error_clear_last();
|
||||
if ($params !== null) {
|
||||
$safeResult = \pg_query_params($connection, $query, $params);
|
||||
} elseif ($query !== null) {
|
||||
$safeResult = \pg_query_params($connection, $query);
|
||||
} elseif ($connection !== null) {
|
||||
$safeResult = \pg_query_params($connection);
|
||||
} else {
|
||||
$safeResult = \pg_query_params();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Connection $connection
|
||||
* @param string $query
|
||||
* @return \PgSql\Result
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_query(?\PgSql\Connection $connection = null, ?string $query = null): \PgSql\Result
|
||||
{
|
||||
error_clear_last();
|
||||
if ($query !== null) {
|
||||
$safeResult = \pg_query($connection, $query);
|
||||
} elseif ($connection !== null) {
|
||||
$safeResult = \pg_query($connection);
|
||||
} else {
|
||||
$safeResult = \pg_query();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Result $result
|
||||
* @param int $field_code
|
||||
* @return null|string
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_result_error_field(\PgSql\Result $result, int $field_code): ?string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pg_result_error_field($result, $field_code);
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Result $result
|
||||
* @param int $row
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_result_seek(\PgSql\Result $result, int $row): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pg_result_seek($result, $row);
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Connection $connection
|
||||
* @param string $table_name
|
||||
* @param array $conditions
|
||||
* @param int $flags
|
||||
* @param int $mode
|
||||
* @return mixed
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_select(\PgSql\Connection $connection, string $table_name, array $conditions, int $flags = PGSQL_DML_EXEC, int $mode = PGSQL_ASSOC)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pg_select($connection, $table_name, $conditions, $flags, $mode);
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Connection $connection
|
||||
* @return resource
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_socket(\PgSql\Connection $connection)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pg_socket($connection);
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param string $mode
|
||||
* @param \PgSql\Connection|null $connection
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_trace(string $filename, string $mode = "w", ?\PgSql\Connection $connection = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($connection !== null) {
|
||||
$safeResult = \pg_trace($filename, $mode, $connection);
|
||||
} else {
|
||||
$safeResult = \pg_trace($filename, $mode);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \PgSql\Connection $connection
|
||||
* @param string $table_name
|
||||
* @param array $values
|
||||
* @param array $conditions
|
||||
* @param int $flags
|
||||
* @return mixed
|
||||
* @throws PgsqlException
|
||||
*
|
||||
*/
|
||||
function pg_update(\PgSql\Connection $connection, string $table_name, array $values, array $conditions, int $flags = PGSQL_DML_EXEC)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pg_update($connection, $table_name, $values, $conditions, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw PgsqlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
343
vendor/thecodingmachine/safe/generated/8.1/posix.php
vendored
Normal file
343
vendor/thecodingmachine/safe/generated/8.1/posix.php
vendored
Normal file
@@ -0,0 +1,343 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\PosixException;
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param int $flags
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_access(string $filename, int $flags = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \posix_access($filename, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $group_id
|
||||
* @return array{name: string, passwd: string, gid: int, members: list}
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_getgrgid(int $group_id): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \posix_getgrgid($group_id);
|
||||
if ($safeResult === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @return array{name: string, passwd: string, gid: int, members: list}
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_getgrnam(string $name): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \posix_getgrnam($name);
|
||||
if ($safeResult === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return list
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_getgroups(): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \posix_getgroups();
|
||||
if ($safeResult === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_getlogin(): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \posix_getlogin();
|
||||
if ($safeResult === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $user_id
|
||||
* @return array{name: string, passwd: string, uid: int, gid: int, gecos: string, dir: string, shell: string}
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_getpwuid(int $user_id): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \posix_getpwuid($user_id);
|
||||
if ($safeResult === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_getrlimit(): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \posix_getrlimit();
|
||||
if ($safeResult === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $process_id
|
||||
* @return int
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_getsid(int $process_id): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \posix_getsid($process_id);
|
||||
if ($safeResult === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $username
|
||||
* @param int $group_id
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_initgroups(string $username, int $group_id): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \posix_initgroups($username, $group_id);
|
||||
if ($safeResult === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $process_id
|
||||
* @param int $signal
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_kill(int $process_id, int $signal): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \posix_kill($process_id, $signal);
|
||||
if ($safeResult === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param int $permissions
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_mkfifo(string $filename, int $permissions): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \posix_mkfifo($filename, $permissions);
|
||||
if ($safeResult === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param int $flags
|
||||
* @param int $major
|
||||
* @param int $minor
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_mknod(string $filename, int $flags, int $major = 0, int $minor = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \posix_mknod($filename, $flags, $major, $minor);
|
||||
if ($safeResult === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $group_id
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_setegid(int $group_id): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \posix_setegid($group_id);
|
||||
if ($safeResult === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $user_id
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_seteuid(int $user_id): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \posix_seteuid($user_id);
|
||||
if ($safeResult === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $group_id
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_setgid(int $group_id): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \posix_setgid($group_id);
|
||||
if ($safeResult === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $process_id
|
||||
* @param int $process_group_id
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_setpgid(int $process_id, int $process_group_id): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \posix_setpgid($process_id, $process_group_id);
|
||||
if ($safeResult === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $resource
|
||||
* @param int $soft_limit
|
||||
* @param int $hard_limit
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_setrlimit(int $resource, int $soft_limit, int $hard_limit): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \posix_setrlimit($resource, $soft_limit, $hard_limit);
|
||||
if ($safeResult === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_setsid(): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \posix_setsid();
|
||||
if ($safeResult === -1) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $user_id
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_setuid(int $user_id): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \posix_setuid($user_id);
|
||||
if ($safeResult === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_times(): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \posix_times();
|
||||
if ($safeResult === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_uname(): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \posix_uname();
|
||||
if ($safeResult === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
1140
vendor/thecodingmachine/safe/generated/8.1/ps.php
vendored
Normal file
1140
vendor/thecodingmachine/safe/generated/8.1/ps.php
vendored
Normal file
File diff suppressed because it is too large
Load Diff
291
vendor/thecodingmachine/safe/generated/8.1/pspell.php
vendored
Normal file
291
vendor/thecodingmachine/safe/generated/8.1/pspell.php
vendored
Normal file
@@ -0,0 +1,291 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\PspellException;
|
||||
|
||||
/**
|
||||
* @param int $dictionary
|
||||
* @param string $word
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_add_to_personal(int $dictionary, string $word): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pspell_add_to_personal($dictionary, $word);
|
||||
if ($safeResult === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $dictionary
|
||||
* @param string $word
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_add_to_session(int $dictionary, string $word): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pspell_add_to_session($dictionary, $word);
|
||||
if ($safeResult === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $dictionary
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_clear_session(int $dictionary): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pspell_clear_session($dictionary);
|
||||
if ($safeResult === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $language
|
||||
* @param string $spelling
|
||||
* @param string $jargon
|
||||
* @param string $encoding
|
||||
* @return int
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_config_create(string $language, string $spelling = "", string $jargon = "", string $encoding = ""): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pspell_config_create($language, $spelling, $jargon, $encoding);
|
||||
if ($safeResult === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $config
|
||||
* @param string $directory
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_config_data_dir(int $config, string $directory): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pspell_config_data_dir($config, $directory);
|
||||
if ($safeResult === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $config
|
||||
* @param string $directory
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_config_dict_dir(int $config, string $directory): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pspell_config_dict_dir($config, $directory);
|
||||
if ($safeResult === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $config
|
||||
* @param int $min_length
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_config_ignore(int $config, int $min_length): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pspell_config_ignore($config, $min_length);
|
||||
if ($safeResult === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $config
|
||||
* @param int $mode
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_config_mode(int $config, int $mode): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pspell_config_mode($config, $mode);
|
||||
if ($safeResult === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $config
|
||||
* @param string $filename
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_config_personal(int $config, string $filename): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pspell_config_personal($config, $filename);
|
||||
if ($safeResult === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $config
|
||||
* @param string $filename
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_config_repl(int $config, string $filename): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pspell_config_repl($config, $filename);
|
||||
if ($safeResult === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $config
|
||||
* @param bool $allow
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_config_runtogether(int $config, bool $allow): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pspell_config_runtogether($config, $allow);
|
||||
if ($safeResult === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $config
|
||||
* @param bool $save
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_config_save_repl(int $config, bool $save): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pspell_config_save_repl($config, $save);
|
||||
if ($safeResult === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $config
|
||||
* @return int
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_new_config(int $config): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pspell_new_config($config);
|
||||
if ($safeResult === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param string $language
|
||||
* @param string $spelling
|
||||
* @param string $jargon
|
||||
* @param string $encoding
|
||||
* @param int $mode
|
||||
* @return int
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_new_personal(string $filename, string $language, string $spelling = "", string $jargon = "", string $encoding = "", int $mode = 0): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pspell_new_personal($filename, $language, $spelling, $jargon, $encoding, $mode);
|
||||
if ($safeResult === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $language
|
||||
* @param string $spelling
|
||||
* @param string $jargon
|
||||
* @param string $encoding
|
||||
* @param int $mode
|
||||
* @return int
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_new(string $language, string $spelling = "", string $jargon = "", string $encoding = "", int $mode = 0): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pspell_new($language, $spelling, $jargon, $encoding, $mode);
|
||||
if ($safeResult === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $dictionary
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_save_wordlist(int $dictionary): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pspell_save_wordlist($dictionary);
|
||||
if ($safeResult === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $dictionary
|
||||
* @param string $misspelled
|
||||
* @param string $correct
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_store_replacement(int $dictionary, string $misspelled, string $correct): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pspell_store_replacement($dictionary, $misspelled, $correct);
|
||||
if ($safeResult === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
102
vendor/thecodingmachine/safe/generated/8.1/readline.php
vendored
Normal file
102
vendor/thecodingmachine/safe/generated/8.1/readline.php
vendored
Normal file
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\ReadlineException;
|
||||
|
||||
/**
|
||||
* @param string $prompt
|
||||
* @throws ReadlineException
|
||||
*
|
||||
*/
|
||||
function readline_add_history(string $prompt): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \readline_add_history($prompt);
|
||||
if ($safeResult === false) {
|
||||
throw ReadlineException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $prompt
|
||||
* @param callable $callback
|
||||
* @throws ReadlineException
|
||||
*
|
||||
*/
|
||||
function readline_callback_handler_install(string $prompt, callable $callback): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \readline_callback_handler_install($prompt, $callback);
|
||||
if ($safeResult === false) {
|
||||
throw ReadlineException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @throws ReadlineException
|
||||
*
|
||||
*/
|
||||
function readline_clear_history(): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \readline_clear_history();
|
||||
if ($safeResult === false) {
|
||||
throw ReadlineException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param callable $callback
|
||||
* @throws ReadlineException
|
||||
*
|
||||
*/
|
||||
function readline_completion_function(callable $callback): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \readline_completion_function($callback);
|
||||
if ($safeResult === false) {
|
||||
throw ReadlineException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|string $filename
|
||||
* @throws ReadlineException
|
||||
*
|
||||
*/
|
||||
function readline_read_history(?string $filename = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($filename !== null) {
|
||||
$safeResult = \readline_read_history($filename);
|
||||
} else {
|
||||
$safeResult = \readline_read_history();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw ReadlineException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|string $filename
|
||||
* @throws ReadlineException
|
||||
*
|
||||
*/
|
||||
function readline_write_history(?string $filename = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($filename !== null) {
|
||||
$safeResult = \readline_write_history($filename);
|
||||
} else {
|
||||
$safeResult = \readline_write_history();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw ReadlineException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
1111
vendor/thecodingmachine/safe/generated/8.1/rector-migrate.php
vendored
Normal file
1111
vendor/thecodingmachine/safe/generated/8.1/rector-migrate.php
vendored
Normal file
File diff suppressed because it is too large
Load Diff
19
vendor/thecodingmachine/safe/generated/8.1/rpminfo.php
vendored
Normal file
19
vendor/thecodingmachine/safe/generated/8.1/rpminfo.php
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\RpminfoException;
|
||||
|
||||
/**
|
||||
* @param int $tag
|
||||
* @throws RpminfoException
|
||||
*
|
||||
*/
|
||||
function rpmaddtag(int $tag): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \rpmaddtag($tag);
|
||||
if ($safeResult === false) {
|
||||
throw RpminfoException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
160
vendor/thecodingmachine/safe/generated/8.1/rrd.php
vendored
Normal file
160
vendor/thecodingmachine/safe/generated/8.1/rrd.php
vendored
Normal file
@@ -0,0 +1,160 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\RrdException;
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param array $options
|
||||
* @throws RrdException
|
||||
*
|
||||
*/
|
||||
function rrd_create(string $filename, array $options): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \rrd_create($filename, $options);
|
||||
if ($safeResult === false) {
|
||||
throw RrdException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $file
|
||||
* @param int $raaindex
|
||||
* @return int
|
||||
* @throws RrdException
|
||||
*
|
||||
*/
|
||||
function rrd_first(string $file, int $raaindex = 0): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \rrd_first($file, $raaindex);
|
||||
if ($safeResult === false) {
|
||||
throw RrdException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param array $options
|
||||
* @return array
|
||||
* @throws RrdException
|
||||
*
|
||||
*/
|
||||
function rrd_graph(string $filename, array $options): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \rrd_graph($filename, $options);
|
||||
if ($safeResult === false) {
|
||||
throw RrdException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @return array
|
||||
* @throws RrdException
|
||||
*
|
||||
*/
|
||||
function rrd_info(string $filename): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \rrd_info($filename);
|
||||
if ($safeResult === false) {
|
||||
throw RrdException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @return array
|
||||
* @throws RrdException
|
||||
*
|
||||
*/
|
||||
function rrd_lastupdate(string $filename): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \rrd_lastupdate($filename);
|
||||
if ($safeResult === false) {
|
||||
throw RrdException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $xml_file
|
||||
* @param string $rrd_file
|
||||
* @param array $options
|
||||
* @throws RrdException
|
||||
*
|
||||
*/
|
||||
function rrd_restore(string $xml_file, string $rrd_file, ?array $options = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($options !== null) {
|
||||
$safeResult = \rrd_restore($xml_file, $rrd_file, $options);
|
||||
} else {
|
||||
$safeResult = \rrd_restore($xml_file, $rrd_file);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw RrdException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param array $options
|
||||
* @throws RrdException
|
||||
*
|
||||
*/
|
||||
function rrd_tune(string $filename, array $options): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \rrd_tune($filename, $options);
|
||||
if ($safeResult === false) {
|
||||
throw RrdException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param array $options
|
||||
* @throws RrdException
|
||||
*
|
||||
*/
|
||||
function rrd_update(string $filename, array $options): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \rrd_update($filename, $options);
|
||||
if ($safeResult === false) {
|
||||
throw RrdException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $options
|
||||
* @return array
|
||||
* @throws RrdException
|
||||
*
|
||||
*/
|
||||
function rrd_xport(array $options): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \rrd_xport($options);
|
||||
if ($safeResult === false) {
|
||||
throw RrdException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
281
vendor/thecodingmachine/safe/generated/8.1/sem.php
vendored
Normal file
281
vendor/thecodingmachine/safe/generated/8.1/sem.php
vendored
Normal file
@@ -0,0 +1,281 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\SemException;
|
||||
|
||||
/**
|
||||
* @param int $key
|
||||
* @param int $permissions
|
||||
* @return \SysvMessageQueue
|
||||
* @throws SemException
|
||||
*
|
||||
*/
|
||||
function msg_get_queue(int $key, int $permissions = 0666): \SysvMessageQueue
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \msg_get_queue($key, $permissions);
|
||||
if ($safeResult === false) {
|
||||
throw SemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $key
|
||||
* @throws SemException
|
||||
*
|
||||
*/
|
||||
function msg_queue_exists(int $key): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \msg_queue_exists($key);
|
||||
if ($safeResult === false) {
|
||||
throw SemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \SysvMessageQueue $queue
|
||||
* @param int $desired_message_type
|
||||
* @param int|null $received_message_type
|
||||
* @param int $max_message_size
|
||||
* @param mixed $message
|
||||
* @param bool $unserialize
|
||||
* @param int $flags
|
||||
* @param int|null $error_code
|
||||
* @throws SemException
|
||||
*
|
||||
*/
|
||||
function msg_receive(\SysvMessageQueue $queue, int $desired_message_type, ?int &$received_message_type, int $max_message_size, &$message, bool $unserialize = true, int $flags = 0, ?int &$error_code = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \msg_receive($queue, $desired_message_type, $received_message_type, $max_message_size, $message, $unserialize, $flags, $error_code);
|
||||
if ($safeResult === false) {
|
||||
throw SemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \SysvMessageQueue $queue
|
||||
* @throws SemException
|
||||
*
|
||||
*/
|
||||
function msg_remove_queue(\SysvMessageQueue $queue): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \msg_remove_queue($queue);
|
||||
if ($safeResult === false) {
|
||||
throw SemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \SysvMessageQueue $queue
|
||||
* @param int $message_type
|
||||
* @param mixed $message
|
||||
* @param bool $serialize
|
||||
* @param bool $blocking
|
||||
* @param int|null $error_code
|
||||
* @throws SemException
|
||||
*
|
||||
*/
|
||||
function msg_send(\SysvMessageQueue $queue, int $message_type, $message, bool $serialize = true, bool $blocking = true, ?int &$error_code = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \msg_send($queue, $message_type, $message, $serialize, $blocking, $error_code);
|
||||
if ($safeResult === false) {
|
||||
throw SemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \SysvMessageQueue $queue
|
||||
* @param array $data
|
||||
* @throws SemException
|
||||
*
|
||||
*/
|
||||
function msg_set_queue(\SysvMessageQueue $queue, array $data): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \msg_set_queue($queue, $data);
|
||||
if ($safeResult === false) {
|
||||
throw SemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \SysvMessageQueue $queue
|
||||
* @return array
|
||||
* @throws SemException
|
||||
*
|
||||
*/
|
||||
function msg_stat_queue(\SysvMessageQueue $queue): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \msg_stat_queue($queue);
|
||||
if ($safeResult === false) {
|
||||
throw SemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \SysvSemaphore $semaphore
|
||||
* @param bool $non_blocking
|
||||
* @throws SemException
|
||||
*
|
||||
*/
|
||||
function sem_acquire(\SysvSemaphore $semaphore, bool $non_blocking = false): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sem_acquire($semaphore, $non_blocking);
|
||||
if ($safeResult === false) {
|
||||
throw SemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $key
|
||||
* @param int $max_acquire
|
||||
* @param int $permissions
|
||||
* @param bool $auto_release
|
||||
* @return \SysvSemaphore
|
||||
* @throws SemException
|
||||
*
|
||||
*/
|
||||
function sem_get(int $key, int $max_acquire = 1, int $permissions = 0666, bool $auto_release = true): \SysvSemaphore
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sem_get($key, $max_acquire, $permissions, $auto_release);
|
||||
if ($safeResult === false) {
|
||||
throw SemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \SysvSemaphore $semaphore
|
||||
* @throws SemException
|
||||
*
|
||||
*/
|
||||
function sem_release(\SysvSemaphore $semaphore): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sem_release($semaphore);
|
||||
if ($safeResult === false) {
|
||||
throw SemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \SysvSemaphore $semaphore
|
||||
* @throws SemException
|
||||
*
|
||||
*/
|
||||
function sem_remove(\SysvSemaphore $semaphore): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sem_remove($semaphore);
|
||||
if ($safeResult === false) {
|
||||
throw SemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $key
|
||||
* @param int|null $size
|
||||
* @param int $permissions
|
||||
* @return \SysvSharedMemory
|
||||
* @throws SemException
|
||||
*
|
||||
*/
|
||||
function shm_attach(int $key, ?int $size = null, int $permissions = 0666): \SysvSharedMemory
|
||||
{
|
||||
error_clear_last();
|
||||
if ($permissions !== 0666) {
|
||||
$safeResult = \shm_attach($key, $size, $permissions);
|
||||
} elseif ($size !== null) {
|
||||
$safeResult = \shm_attach($key, $size);
|
||||
} else {
|
||||
$safeResult = \shm_attach($key);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw SemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \SysvSharedMemory $shm
|
||||
* @throws SemException
|
||||
*
|
||||
*/
|
||||
function shm_detach(\SysvSharedMemory $shm): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \shm_detach($shm);
|
||||
if ($safeResult === false) {
|
||||
throw SemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \SysvSharedMemory $shm
|
||||
* @param int $key
|
||||
* @param mixed $value
|
||||
* @throws SemException
|
||||
*
|
||||
*/
|
||||
function shm_put_var(\SysvSharedMemory $shm, int $key, $value): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \shm_put_var($shm, $key, $value);
|
||||
if ($safeResult === false) {
|
||||
throw SemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \SysvSharedMemory $shm
|
||||
* @param int $key
|
||||
* @throws SemException
|
||||
*
|
||||
*/
|
||||
function shm_remove_var(\SysvSharedMemory $shm, int $key): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \shm_remove_var($shm, $key);
|
||||
if ($safeResult === false) {
|
||||
throw SemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \SysvSharedMemory $shm
|
||||
* @throws SemException
|
||||
*
|
||||
*/
|
||||
function shm_remove(\SysvSharedMemory $shm): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \shm_remove($shm);
|
||||
if ($safeResult === false) {
|
||||
throw SemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
294
vendor/thecodingmachine/safe/generated/8.1/session.php
vendored
Normal file
294
vendor/thecodingmachine/safe/generated/8.1/session.php
vendored
Normal file
@@ -0,0 +1,294 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\SessionException;
|
||||
|
||||
/**
|
||||
* @throws SessionException
|
||||
*
|
||||
*/
|
||||
function session_abort(): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \session_abort();
|
||||
if ($safeResult === false) {
|
||||
throw SessionException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int|null $value
|
||||
* @return int
|
||||
* @throws SessionException
|
||||
*
|
||||
*/
|
||||
function session_cache_expire(?int $value = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($value !== null) {
|
||||
$safeResult = \session_cache_expire($value);
|
||||
} else {
|
||||
$safeResult = \session_cache_expire();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw SessionException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|string $value
|
||||
* @return string
|
||||
* @throws SessionException
|
||||
*
|
||||
*/
|
||||
function session_cache_limiter(?string $value = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($value !== null) {
|
||||
$safeResult = \session_cache_limiter($value);
|
||||
} else {
|
||||
$safeResult = \session_cache_limiter();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw SessionException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $prefix
|
||||
* @return string
|
||||
* @throws SessionException
|
||||
*
|
||||
*/
|
||||
function session_create_id(string $prefix = ""): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \session_create_id($prefix);
|
||||
if ($safeResult === false) {
|
||||
throw SessionException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $data
|
||||
* @throws SessionException
|
||||
*
|
||||
*/
|
||||
function session_decode(string $data): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \session_decode($data);
|
||||
if ($safeResult === false) {
|
||||
throw SessionException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @throws SessionException
|
||||
*
|
||||
*/
|
||||
function session_destroy(): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \session_destroy();
|
||||
if ($safeResult === false) {
|
||||
throw SessionException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws SessionException
|
||||
*
|
||||
*/
|
||||
function session_encode(): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \session_encode();
|
||||
if ($safeResult === false) {
|
||||
throw SessionException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @throws SessionException
|
||||
*
|
||||
*/
|
||||
function session_gc(): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \session_gc();
|
||||
if ($safeResult === false) {
|
||||
throw SessionException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|string $id
|
||||
* @return string
|
||||
* @throws SessionException
|
||||
*
|
||||
*/
|
||||
function session_id(?string $id = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($id !== null) {
|
||||
$safeResult = \session_id($id);
|
||||
} else {
|
||||
$safeResult = \session_id();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw SessionException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|string $module
|
||||
* @return string
|
||||
* @throws SessionException
|
||||
*
|
||||
*/
|
||||
function session_module_name(?string $module = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($module !== null) {
|
||||
$safeResult = \session_module_name($module);
|
||||
} else {
|
||||
$safeResult = \session_module_name();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw SessionException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|string $name
|
||||
* @return non-falsy-string
|
||||
* @throws SessionException
|
||||
*
|
||||
*/
|
||||
function session_name(?string $name = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($name !== null) {
|
||||
$safeResult = \session_name($name);
|
||||
} else {
|
||||
$safeResult = \session_name();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw SessionException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param bool $delete_old_session
|
||||
* @throws SessionException
|
||||
*
|
||||
*/
|
||||
function session_regenerate_id(bool $delete_old_session = false): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \session_regenerate_id($delete_old_session);
|
||||
if ($safeResult === false) {
|
||||
throw SessionException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @throws SessionException
|
||||
*
|
||||
*/
|
||||
function session_reset(): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \session_reset();
|
||||
if ($safeResult === false) {
|
||||
throw SessionException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|string $path
|
||||
* @return string
|
||||
* @throws SessionException
|
||||
*
|
||||
*/
|
||||
function session_save_path(?string $path = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($path !== null) {
|
||||
$safeResult = \session_save_path($path);
|
||||
} else {
|
||||
$safeResult = \session_save_path();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw SessionException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $options
|
||||
* @throws SessionException
|
||||
*
|
||||
*/
|
||||
function session_start(array $options = []): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \session_start($options);
|
||||
if ($safeResult === false) {
|
||||
throw SessionException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @throws SessionException
|
||||
*
|
||||
*/
|
||||
function session_unset(): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \session_unset();
|
||||
if ($safeResult === false) {
|
||||
throw SessionException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @throws SessionException
|
||||
*
|
||||
*/
|
||||
function session_write_close(): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \session_write_close();
|
||||
if ($safeResult === false) {
|
||||
throw SessionException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
38
vendor/thecodingmachine/safe/generated/8.1/shmop.php
vendored
Normal file
38
vendor/thecodingmachine/safe/generated/8.1/shmop.php
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\ShmopException;
|
||||
|
||||
/**
|
||||
* @param \Shmop $shmop
|
||||
* @throws ShmopException
|
||||
*
|
||||
*/
|
||||
function shmop_delete(\Shmop $shmop): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \shmop_delete($shmop);
|
||||
if ($safeResult === false) {
|
||||
throw ShmopException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \Shmop $shmop
|
||||
* @param int $offset
|
||||
* @param int $size
|
||||
* @return string
|
||||
* @throws ShmopException
|
||||
*
|
||||
*/
|
||||
function shmop_read(\Shmop $shmop, int $offset, int $size): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \shmop_read($shmop, $offset, $size);
|
||||
if ($safeResult === false) {
|
||||
throw ShmopException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
474
vendor/thecodingmachine/safe/generated/8.1/sockets.php
vendored
Normal file
474
vendor/thecodingmachine/safe/generated/8.1/sockets.php
vendored
Normal file
@@ -0,0 +1,474 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\SocketsException;
|
||||
|
||||
/**
|
||||
* @param \Socket $socket
|
||||
* @return \Socket
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_accept(\Socket $socket): \Socket
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \socket_accept($socket);
|
||||
if ($safeResult === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \AddressInfo $address
|
||||
* @return \Socket
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_addrinfo_bind(\AddressInfo $address): \Socket
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \socket_addrinfo_bind($address);
|
||||
if ($safeResult === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \AddressInfo $address
|
||||
* @return \Socket
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_addrinfo_connect(\AddressInfo $address): \Socket
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \socket_addrinfo_connect($address);
|
||||
if ($safeResult === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $host
|
||||
* @param mixed $service
|
||||
* @param array $hints
|
||||
* @return \AddressInfo[]
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_addrinfo_lookup(string $host, $service = null, array $hints = []): array
|
||||
{
|
||||
error_clear_last();
|
||||
if ($hints !== []) {
|
||||
$safeResult = \socket_addrinfo_lookup($host, $service, $hints);
|
||||
} elseif ($service !== null) {
|
||||
$safeResult = \socket_addrinfo_lookup($host, $service);
|
||||
} else {
|
||||
$safeResult = \socket_addrinfo_lookup($host);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \Socket $socket
|
||||
* @param string $address
|
||||
* @param int $port
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_bind(\Socket $socket, string $address, int $port = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \socket_bind($socket, $address, $port);
|
||||
if ($safeResult === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \Socket $socket
|
||||
* @param string $address
|
||||
* @param int|null $port
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_connect(\Socket $socket, string $address, ?int $port = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($port !== null) {
|
||||
$safeResult = \socket_connect($socket, $address, $port);
|
||||
} else {
|
||||
$safeResult = \socket_connect($socket, $address);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $port
|
||||
* @param int $backlog
|
||||
* @return \Socket
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_create_listen(int $port, int $backlog = 128): \Socket
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \socket_create_listen($port, $backlog);
|
||||
if ($safeResult === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $domain
|
||||
* @param int $type
|
||||
* @param int $protocol
|
||||
* @param \Socket[]|null $pair
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_create_pair(int $domain, int $type, int $protocol, ?array &$pair): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \socket_create_pair($domain, $type, $protocol, $pair);
|
||||
if ($safeResult === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $domain
|
||||
* @param int $type
|
||||
* @param int $protocol
|
||||
* @return \Socket
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_create(int $domain, int $type, int $protocol): \Socket
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \socket_create($domain, $type, $protocol);
|
||||
if ($safeResult === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \Socket $socket
|
||||
* @return resource
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_export_stream(\Socket $socket)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \socket_export_stream($socket);
|
||||
if ($safeResult === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \Socket $socket
|
||||
* @param int $level
|
||||
* @param int $option
|
||||
* @return mixed
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_get_option(\Socket $socket, int $level, int $option)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \socket_get_option($socket, $level, $option);
|
||||
if ($safeResult === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \Socket $socket
|
||||
* @param null|string $address
|
||||
* @param int|null $port
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_getpeername(\Socket $socket, ?string &$address, ?int &$port = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \socket_getpeername($socket, $address, $port);
|
||||
if ($safeResult === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \Socket $socket
|
||||
* @param null|string $address
|
||||
* @param int|null $port
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_getsockname(\Socket $socket, ?string &$address, ?int &$port = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \socket_getsockname($socket, $address, $port);
|
||||
if ($safeResult === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @return \Socket
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_import_stream($stream): \Socket
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \socket_import_stream($stream);
|
||||
if ($safeResult === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \Socket $socket
|
||||
* @param int $backlog
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_listen(\Socket $socket, int $backlog = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \socket_listen($socket, $backlog);
|
||||
if ($safeResult === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \Socket $socket
|
||||
* @param int $length
|
||||
* @param int $mode
|
||||
* @return string
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_read(\Socket $socket, int $length, int $mode = PHP_BINARY_READ): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \socket_read($socket, $length, $mode);
|
||||
if ($safeResult === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \Socket $socket
|
||||
* @param string $data
|
||||
* @param int $length
|
||||
* @param int $flags
|
||||
* @return int
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_send(\Socket $socket, string $data, int $length, int $flags): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \socket_send($socket, $data, $length, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \Socket $socket
|
||||
* @param array $message
|
||||
* @param int $flags
|
||||
* @return int
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_sendmsg(\Socket $socket, array $message, int $flags = 0): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \socket_sendmsg($socket, $message, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \Socket $socket
|
||||
* @param string $data
|
||||
* @param int $length
|
||||
* @param int $flags
|
||||
* @param string $address
|
||||
* @param int|null $port
|
||||
* @return int
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_sendto(\Socket $socket, string $data, int $length, int $flags, string $address, ?int $port = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($port !== null) {
|
||||
$safeResult = \socket_sendto($socket, $data, $length, $flags, $address, $port);
|
||||
} else {
|
||||
$safeResult = \socket_sendto($socket, $data, $length, $flags, $address);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \Socket $socket
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_set_block(\Socket $socket): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \socket_set_block($socket);
|
||||
if ($safeResult === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \Socket $socket
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_set_nonblock(\Socket $socket): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \socket_set_nonblock($socket);
|
||||
if ($safeResult === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \Socket $socket
|
||||
* @param int $level
|
||||
* @param int $option
|
||||
* @param array|int|string $value
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_set_option(\Socket $socket, int $level, int $option, $value): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \socket_set_option($socket, $level, $option, $value);
|
||||
if ($safeResult === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \Socket $socket
|
||||
* @param int $mode
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_shutdown(\Socket $socket, int $mode = 2): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \socket_shutdown($socket, $mode);
|
||||
if ($safeResult === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \Socket $socket
|
||||
* @param int $process_id
|
||||
* @return string
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_wsaprotocol_info_export(\Socket $socket, int $process_id): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \socket_wsaprotocol_info_export($socket, $process_id);
|
||||
if ($safeResult === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $info_id
|
||||
* @return \Socket
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_wsaprotocol_info_import(string $info_id): \Socket
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \socket_wsaprotocol_info_import($info_id);
|
||||
if ($safeResult === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $info_id
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_wsaprotocol_info_release(string $info_id): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \socket_wsaprotocol_info_release($info_id);
|
||||
if ($safeResult === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
268
vendor/thecodingmachine/safe/generated/8.1/sodium.php
vendored
Normal file
268
vendor/thecodingmachine/safe/generated/8.1/sodium.php
vendored
Normal file
@@ -0,0 +1,268 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\SodiumException;
|
||||
|
||||
/**
|
||||
* @param string $ciphertext
|
||||
* @param string $additional_data
|
||||
* @param string $nonce
|
||||
* @param string $key
|
||||
* @return string
|
||||
* @throws SodiumException
|
||||
*
|
||||
*/
|
||||
function sodium_crypto_aead_aes256gcm_decrypt(string $ciphertext, string $additional_data, string $nonce, string $key): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sodium_crypto_aead_aes256gcm_decrypt($ciphertext, $additional_data, $nonce, $key);
|
||||
if ($safeResult === false) {
|
||||
throw SodiumException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $ciphertext
|
||||
* @param string $additional_data
|
||||
* @param string $nonce
|
||||
* @param string $key
|
||||
* @return string
|
||||
* @throws SodiumException
|
||||
*
|
||||
*/
|
||||
function sodium_crypto_aead_chacha20poly1305_decrypt(string $ciphertext, string $additional_data, string $nonce, string $key): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sodium_crypto_aead_chacha20poly1305_decrypt($ciphertext, $additional_data, $nonce, $key);
|
||||
if ($safeResult === false) {
|
||||
throw SodiumException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
* @param string $additional_data
|
||||
* @param string $nonce
|
||||
* @param string $key
|
||||
* @return string
|
||||
* @throws SodiumException
|
||||
*
|
||||
*/
|
||||
function sodium_crypto_aead_chacha20poly1305_encrypt(string $message, string $additional_data, string $nonce, string $key): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sodium_crypto_aead_chacha20poly1305_encrypt($message, $additional_data, $nonce, $key);
|
||||
if ($safeResult === false) {
|
||||
throw SodiumException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $ciphertext
|
||||
* @param string $additional_data
|
||||
* @param string $nonce
|
||||
* @param string $key
|
||||
* @return string
|
||||
* @throws SodiumException
|
||||
*
|
||||
*/
|
||||
function sodium_crypto_aead_chacha20poly1305_ietf_decrypt(string $ciphertext, string $additional_data, string $nonce, string $key): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sodium_crypto_aead_chacha20poly1305_ietf_decrypt($ciphertext, $additional_data, $nonce, $key);
|
||||
if ($safeResult === false) {
|
||||
throw SodiumException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
* @param string $additional_data
|
||||
* @param string $nonce
|
||||
* @param string $key
|
||||
* @return string
|
||||
* @throws SodiumException
|
||||
*
|
||||
*/
|
||||
function sodium_crypto_aead_chacha20poly1305_ietf_encrypt(string $message, string $additional_data, string $nonce, string $key): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sodium_crypto_aead_chacha20poly1305_ietf_encrypt($message, $additional_data, $nonce, $key);
|
||||
if ($safeResult === false) {
|
||||
throw SodiumException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $ciphertext
|
||||
* @param string $additional_data
|
||||
* @param string $nonce
|
||||
* @param string $key
|
||||
* @return string
|
||||
* @throws SodiumException
|
||||
*
|
||||
*/
|
||||
function sodium_crypto_aead_xchacha20poly1305_ietf_decrypt(string $ciphertext, string $additional_data, string $nonce, string $key): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sodium_crypto_aead_xchacha20poly1305_ietf_decrypt($ciphertext, $additional_data, $nonce, $key);
|
||||
if ($safeResult === false) {
|
||||
throw SodiumException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
* @param string $additional_data
|
||||
* @param string $nonce
|
||||
* @param string $key
|
||||
* @return string
|
||||
* @throws SodiumException
|
||||
*
|
||||
*/
|
||||
function sodium_crypto_aead_xchacha20poly1305_ietf_encrypt(string $message, string $additional_data, string $nonce, string $key): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sodium_crypto_aead_xchacha20poly1305_ietf_encrypt($message, $additional_data, $nonce, $key);
|
||||
if ($safeResult === false) {
|
||||
throw SodiumException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $mac
|
||||
* @param string $message
|
||||
* @param string $key
|
||||
* @throws SodiumException
|
||||
*
|
||||
*/
|
||||
function sodium_crypto_auth_verify(string $mac, string $message, string $key): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sodium_crypto_auth_verify($mac, $message, $key);
|
||||
if ($safeResult === false) {
|
||||
throw SodiumException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $ciphertext
|
||||
* @param string $nonce
|
||||
* @param string $key_pair
|
||||
* @return string
|
||||
* @throws SodiumException
|
||||
*
|
||||
*/
|
||||
function sodium_crypto_box_open(string $ciphertext, string $nonce, string $key_pair): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sodium_crypto_box_open($ciphertext, $nonce, $key_pair);
|
||||
if ($safeResult === false) {
|
||||
throw SodiumException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $ciphertext
|
||||
* @param string $key_pair
|
||||
* @return string
|
||||
* @throws SodiumException
|
||||
*
|
||||
*/
|
||||
function sodium_crypto_box_seal_open(string $ciphertext, string $key_pair): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sodium_crypto_box_seal_open($ciphertext, $key_pair);
|
||||
if ($safeResult === false) {
|
||||
throw SodiumException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param non-empty-string $state
|
||||
* @param string $message
|
||||
* @throws SodiumException
|
||||
*
|
||||
*/
|
||||
function sodium_crypto_generichash_update(string &$state, string $message): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sodium_crypto_generichash_update($state, $message);
|
||||
if ($safeResult === false) {
|
||||
throw SodiumException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $ciphertext
|
||||
* @param string $nonce
|
||||
* @param string $key
|
||||
* @return string
|
||||
* @throws SodiumException
|
||||
*
|
||||
*/
|
||||
function sodium_crypto_secretbox_open(string $ciphertext, string $nonce, string $key): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sodium_crypto_secretbox_open($ciphertext, $nonce, $key);
|
||||
if ($safeResult === false) {
|
||||
throw SodiumException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $signed_message
|
||||
* @param non-empty-string $public_key
|
||||
* @return string
|
||||
* @throws SodiumException
|
||||
*
|
||||
*/
|
||||
function sodium_crypto_sign_open(string $signed_message, string $public_key): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sodium_crypto_sign_open($signed_message, $public_key);
|
||||
if ($safeResult === false) {
|
||||
throw SodiumException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param non-empty-string $signature
|
||||
* @param string $message
|
||||
* @param non-empty-string $public_key
|
||||
* @throws SodiumException
|
||||
*
|
||||
*/
|
||||
function sodium_crypto_sign_verify_detached(string $signature, string $message, string $public_key): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sodium_crypto_sign_verify_detached($signature, $message, $public_key);
|
||||
if ($safeResult === false) {
|
||||
throw SodiumException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
20
vendor/thecodingmachine/safe/generated/8.1/solr.php
vendored
Normal file
20
vendor/thecodingmachine/safe/generated/8.1/solr.php
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\SolrException;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws SolrException
|
||||
*
|
||||
*/
|
||||
function solr_get_version(): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \solr_get_version();
|
||||
if ($safeResult === false) {
|
||||
throw SolrException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
98
vendor/thecodingmachine/safe/generated/8.1/spl.php
vendored
Normal file
98
vendor/thecodingmachine/safe/generated/8.1/spl.php
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\SplException;
|
||||
|
||||
/**
|
||||
* @param object|string $object_or_class
|
||||
* @param bool $autoload
|
||||
* @return array
|
||||
* @throws SplException
|
||||
*
|
||||
*/
|
||||
function class_implements($object_or_class, bool $autoload = true): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \class_implements($object_or_class, $autoload);
|
||||
if ($safeResult === false) {
|
||||
throw SplException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param object|string $object_or_class
|
||||
* @param bool $autoload
|
||||
* @return array
|
||||
* @throws SplException
|
||||
*
|
||||
*/
|
||||
function class_parents($object_or_class, bool $autoload = true): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \class_parents($object_or_class, $autoload);
|
||||
if ($safeResult === false) {
|
||||
throw SplException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param object|string $object_or_class
|
||||
* @param bool $autoload
|
||||
* @return array
|
||||
* @throws SplException
|
||||
*
|
||||
*/
|
||||
function class_uses($object_or_class, bool $autoload = true): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \class_uses($object_or_class, $autoload);
|
||||
if ($safeResult === false) {
|
||||
throw SplException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param callable(string):void|null $callback
|
||||
* @param bool $throw
|
||||
* @param bool $prepend
|
||||
* @throws SplException
|
||||
*
|
||||
*/
|
||||
function spl_autoload_register(?callable $callback = null, bool $throw = true, bool $prepend = false): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($prepend !== false) {
|
||||
$safeResult = \spl_autoload_register($callback, $throw, $prepend);
|
||||
} elseif ($throw !== true) {
|
||||
$safeResult = \spl_autoload_register($callback, $throw);
|
||||
} elseif ($callback !== null) {
|
||||
$safeResult = \spl_autoload_register($callback);
|
||||
} else {
|
||||
$safeResult = \spl_autoload_register();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw SplException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param mixed $callback
|
||||
* @throws SplException
|
||||
*
|
||||
*/
|
||||
function spl_autoload_unregister($callback): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \spl_autoload_unregister($callback);
|
||||
if ($safeResult === false) {
|
||||
throw SplException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
352
vendor/thecodingmachine/safe/generated/8.1/sqlsrv.php
vendored
Normal file
352
vendor/thecodingmachine/safe/generated/8.1/sqlsrv.php
vendored
Normal file
@@ -0,0 +1,352 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\SqlsrvException;
|
||||
|
||||
/**
|
||||
* @param resource $conn
|
||||
* @throws SqlsrvException
|
||||
*
|
||||
*/
|
||||
function sqlsrv_begin_transaction($conn): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sqlsrv_begin_transaction($conn);
|
||||
if ($safeResult === false) {
|
||||
throw SqlsrvException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stmt
|
||||
* @throws SqlsrvException
|
||||
*
|
||||
*/
|
||||
function sqlsrv_cancel($stmt): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sqlsrv_cancel($stmt);
|
||||
if ($safeResult === false) {
|
||||
throw SqlsrvException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn
|
||||
* @return array
|
||||
* @throws SqlsrvException
|
||||
*
|
||||
*/
|
||||
function sqlsrv_client_info($conn): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sqlsrv_client_info($conn);
|
||||
if ($safeResult === false) {
|
||||
throw SqlsrvException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn
|
||||
* @throws SqlsrvException
|
||||
*
|
||||
*/
|
||||
function sqlsrv_close($conn): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sqlsrv_close($conn);
|
||||
if ($safeResult === false) {
|
||||
throw SqlsrvException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn
|
||||
* @throws SqlsrvException
|
||||
*
|
||||
*/
|
||||
function sqlsrv_commit($conn): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sqlsrv_commit($conn);
|
||||
if ($safeResult === false) {
|
||||
throw SqlsrvException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $setting
|
||||
* @param mixed $value
|
||||
* @throws SqlsrvException
|
||||
*
|
||||
*/
|
||||
function sqlsrv_configure(string $setting, $value): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sqlsrv_configure($setting, $value);
|
||||
if ($safeResult === false) {
|
||||
throw SqlsrvException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stmt
|
||||
* @throws SqlsrvException
|
||||
*
|
||||
*/
|
||||
function sqlsrv_execute($stmt): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sqlsrv_execute($stmt);
|
||||
if ($safeResult === false) {
|
||||
throw SqlsrvException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stmt
|
||||
* @param int $fetchType
|
||||
* @param int $row
|
||||
* @param int $offset
|
||||
* @return array|null
|
||||
* @throws SqlsrvException
|
||||
*
|
||||
*/
|
||||
function sqlsrv_fetch_array($stmt, ?int $fetchType = null, ?int $row = null, ?int $offset = null): ?array
|
||||
{
|
||||
error_clear_last();
|
||||
if ($offset !== null) {
|
||||
$safeResult = \sqlsrv_fetch_array($stmt, $fetchType, $row, $offset);
|
||||
} elseif ($row !== null) {
|
||||
$safeResult = \sqlsrv_fetch_array($stmt, $fetchType, $row);
|
||||
} elseif ($fetchType !== null) {
|
||||
$safeResult = \sqlsrv_fetch_array($stmt, $fetchType);
|
||||
} else {
|
||||
$safeResult = \sqlsrv_fetch_array($stmt);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw SqlsrvException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stmt
|
||||
* @param string $className
|
||||
* @param array $ctorParams
|
||||
* @param int $row
|
||||
* @param int $offset
|
||||
* @return null|object
|
||||
* @throws SqlsrvException
|
||||
*
|
||||
*/
|
||||
function sqlsrv_fetch_object($stmt, ?string $className = null, ?array $ctorParams = null, ?int $row = null, ?int $offset = null): ?object
|
||||
{
|
||||
error_clear_last();
|
||||
if ($offset !== null) {
|
||||
$safeResult = \sqlsrv_fetch_object($stmt, $className, $ctorParams, $row, $offset);
|
||||
} elseif ($row !== null) {
|
||||
$safeResult = \sqlsrv_fetch_object($stmt, $className, $ctorParams, $row);
|
||||
} elseif ($ctorParams !== null) {
|
||||
$safeResult = \sqlsrv_fetch_object($stmt, $className, $ctorParams);
|
||||
} elseif ($className !== null) {
|
||||
$safeResult = \sqlsrv_fetch_object($stmt, $className);
|
||||
} else {
|
||||
$safeResult = \sqlsrv_fetch_object($stmt);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw SqlsrvException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stmt
|
||||
* @param int $row
|
||||
* @param int $offset
|
||||
* @return bool|null
|
||||
* @throws SqlsrvException
|
||||
*
|
||||
*/
|
||||
function sqlsrv_fetch($stmt, ?int $row = null, ?int $offset = null): ?bool
|
||||
{
|
||||
error_clear_last();
|
||||
if ($offset !== null) {
|
||||
$safeResult = \sqlsrv_fetch($stmt, $row, $offset);
|
||||
} elseif ($row !== null) {
|
||||
$safeResult = \sqlsrv_fetch($stmt, $row);
|
||||
} else {
|
||||
$safeResult = \sqlsrv_fetch($stmt);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw SqlsrvException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stmt
|
||||
* @throws SqlsrvException
|
||||
*
|
||||
*/
|
||||
function sqlsrv_free_stmt($stmt): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sqlsrv_free_stmt($stmt);
|
||||
if ($safeResult === false) {
|
||||
throw SqlsrvException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stmt
|
||||
* @param int $fieldIndex
|
||||
* @param int $getAsType
|
||||
* @return mixed
|
||||
* @throws SqlsrvException
|
||||
*
|
||||
*/
|
||||
function sqlsrv_get_field($stmt, int $fieldIndex, ?int $getAsType = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($getAsType !== null) {
|
||||
$safeResult = \sqlsrv_get_field($stmt, $fieldIndex, $getAsType);
|
||||
} else {
|
||||
$safeResult = \sqlsrv_get_field($stmt, $fieldIndex);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw SqlsrvException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stmt
|
||||
* @return bool|null
|
||||
* @throws SqlsrvException
|
||||
*
|
||||
*/
|
||||
function sqlsrv_next_result($stmt): ?bool
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sqlsrv_next_result($stmt);
|
||||
if ($safeResult === false) {
|
||||
throw SqlsrvException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stmt
|
||||
* @return int
|
||||
* @throws SqlsrvException
|
||||
*
|
||||
*/
|
||||
function sqlsrv_num_fields($stmt): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sqlsrv_num_fields($stmt);
|
||||
if ($safeResult === false) {
|
||||
throw SqlsrvException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stmt
|
||||
* @return int
|
||||
* @throws SqlsrvException
|
||||
*
|
||||
*/
|
||||
function sqlsrv_num_rows($stmt): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sqlsrv_num_rows($stmt);
|
||||
if ($safeResult === false) {
|
||||
throw SqlsrvException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn
|
||||
* @param string $sql
|
||||
* @param array $params
|
||||
* @param array $options
|
||||
* @return mixed
|
||||
* @throws SqlsrvException
|
||||
*
|
||||
*/
|
||||
function sqlsrv_prepare($conn, string $sql, ?array $params = null, ?array $options = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($options !== null) {
|
||||
$safeResult = \sqlsrv_prepare($conn, $sql, $params, $options);
|
||||
} elseif ($params !== null) {
|
||||
$safeResult = \sqlsrv_prepare($conn, $sql, $params);
|
||||
} else {
|
||||
$safeResult = \sqlsrv_prepare($conn, $sql);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw SqlsrvException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn
|
||||
* @param string $sql
|
||||
* @param array $params
|
||||
* @param array $options
|
||||
* @return mixed
|
||||
* @throws SqlsrvException
|
||||
*
|
||||
*/
|
||||
function sqlsrv_query($conn, string $sql, ?array $params = null, ?array $options = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($options !== null) {
|
||||
$safeResult = \sqlsrv_query($conn, $sql, $params, $options);
|
||||
} elseif ($params !== null) {
|
||||
$safeResult = \sqlsrv_query($conn, $sql, $params);
|
||||
} else {
|
||||
$safeResult = \sqlsrv_query($conn, $sql);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw SqlsrvException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $conn
|
||||
* @throws SqlsrvException
|
||||
*
|
||||
*/
|
||||
function sqlsrv_rollback($conn): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sqlsrv_rollback($conn);
|
||||
if ($safeResult === false) {
|
||||
throw SqlsrvException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
56
vendor/thecodingmachine/safe/generated/8.1/ssdeep.php
vendored
Normal file
56
vendor/thecodingmachine/safe/generated/8.1/ssdeep.php
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\SsdeepException;
|
||||
|
||||
/**
|
||||
* @param string $signature1
|
||||
* @param string $signature2
|
||||
* @return int
|
||||
* @throws SsdeepException
|
||||
*
|
||||
*/
|
||||
function ssdeep_fuzzy_compare(string $signature1, string $signature2): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ssdeep_fuzzy_compare($signature1, $signature2);
|
||||
if ($safeResult === false) {
|
||||
throw SsdeepException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $file_name
|
||||
* @return string
|
||||
* @throws SsdeepException
|
||||
*
|
||||
*/
|
||||
function ssdeep_fuzzy_hash_filename(string $file_name): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ssdeep_fuzzy_hash_filename($file_name);
|
||||
if ($safeResult === false) {
|
||||
throw SsdeepException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $to_hash
|
||||
* @return string
|
||||
* @throws SsdeepException
|
||||
*
|
||||
*/
|
||||
function ssdeep_fuzzy_hash(string $to_hash): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ssdeep_fuzzy_hash($to_hash);
|
||||
if ($safeResult === false) {
|
||||
throw SsdeepException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
463
vendor/thecodingmachine/safe/generated/8.1/ssh2.php
vendored
Normal file
463
vendor/thecodingmachine/safe/generated/8.1/ssh2.php
vendored
Normal file
@@ -0,0 +1,463 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\Ssh2Exception;
|
||||
|
||||
/**
|
||||
* @param resource $session
|
||||
* @param string $username
|
||||
* @throws Ssh2Exception
|
||||
*
|
||||
*/
|
||||
function ssh2_auth_agent($session, string $username): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ssh2_auth_agent($session, $username);
|
||||
if ($safeResult === false) {
|
||||
throw Ssh2Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $session
|
||||
* @param string $username
|
||||
* @param string $hostname
|
||||
* @param string $pubkeyfile
|
||||
* @param string $privkeyfile
|
||||
* @param string $passphrase
|
||||
* @param string $local_username
|
||||
* @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) {
|
||||
$safeResult = \ssh2_auth_hostbased_file($session, $username, $hostname, $pubkeyfile, $privkeyfile, $passphrase, $local_username);
|
||||
} elseif ($passphrase !== null) {
|
||||
$safeResult = \ssh2_auth_hostbased_file($session, $username, $hostname, $pubkeyfile, $privkeyfile, $passphrase);
|
||||
} else {
|
||||
$safeResult = \ssh2_auth_hostbased_file($session, $username, $hostname, $pubkeyfile, $privkeyfile);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw Ssh2Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $session
|
||||
* @param string $username
|
||||
* @param string $password
|
||||
* @throws Ssh2Exception
|
||||
*
|
||||
*/
|
||||
function ssh2_auth_password($session, string $username, string $password): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ssh2_auth_password($session, $username, $password);
|
||||
if ($safeResult === false) {
|
||||
throw Ssh2Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $session
|
||||
* @param string $username
|
||||
* @param string $pubkeyfile
|
||||
* @param string $privkeyfile
|
||||
* @param string $passphrase
|
||||
* @throws Ssh2Exception
|
||||
*
|
||||
*/
|
||||
function ssh2_auth_pubkey_file($session, string $username, string $pubkeyfile, string $privkeyfile, ?string $passphrase = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($passphrase !== null) {
|
||||
$safeResult = \ssh2_auth_pubkey_file($session, $username, $pubkeyfile, $privkeyfile, $passphrase);
|
||||
} else {
|
||||
$safeResult = \ssh2_auth_pubkey_file($session, $username, $pubkeyfile, $privkeyfile);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw Ssh2Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $host
|
||||
* @param int $port
|
||||
* @param array $methods
|
||||
* @param array $callbacks
|
||||
* @return resource
|
||||
* @throws Ssh2Exception
|
||||
*
|
||||
*/
|
||||
function ssh2_connect(string $host, int $port = 22, ?array $methods = null, ?array $callbacks = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($callbacks !== null) {
|
||||
$safeResult = \ssh2_connect($host, $port, $methods, $callbacks);
|
||||
} elseif ($methods !== null) {
|
||||
$safeResult = \ssh2_connect($host, $port, $methods);
|
||||
} else {
|
||||
$safeResult = \ssh2_connect($host, $port);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw Ssh2Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $session
|
||||
* @throws Ssh2Exception
|
||||
*
|
||||
*/
|
||||
function ssh2_disconnect($session): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ssh2_disconnect($session);
|
||||
if ($safeResult === false) {
|
||||
throw Ssh2Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $session
|
||||
* @param string $command
|
||||
* @param string $pty
|
||||
* @param array $env
|
||||
* @param int $width
|
||||
* @param int $height
|
||||
* @param int $width_height_type
|
||||
* @return resource
|
||||
* @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) {
|
||||
$safeResult = \ssh2_exec($session, $command, $pty, $env, $width, $height, $width_height_type);
|
||||
} elseif ($height !== 25) {
|
||||
$safeResult = \ssh2_exec($session, $command, $pty, $env, $width, $height);
|
||||
} elseif ($width !== 80) {
|
||||
$safeResult = \ssh2_exec($session, $command, $pty, $env, $width);
|
||||
} elseif ($env !== null) {
|
||||
$safeResult = \ssh2_exec($session, $command, $pty, $env);
|
||||
} elseif ($pty !== null) {
|
||||
$safeResult = \ssh2_exec($session, $command, $pty);
|
||||
} else {
|
||||
$safeResult = \ssh2_exec($session, $command);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw Ssh2Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $listener
|
||||
* @return resource
|
||||
* @throws Ssh2Exception
|
||||
*
|
||||
*/
|
||||
function ssh2_forward_accept($listener)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ssh2_forward_accept($listener);
|
||||
if ($safeResult === false) {
|
||||
throw Ssh2Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $session
|
||||
* @param int $port
|
||||
* @param string $host
|
||||
* @param int $max_connections
|
||||
* @return resource
|
||||
* @throws Ssh2Exception
|
||||
*
|
||||
*/
|
||||
function ssh2_forward_listen($session, int $port, ?string $host = null, int $max_connections = 16)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($max_connections !== 16) {
|
||||
$safeResult = \ssh2_forward_listen($session, $port, $host, $max_connections);
|
||||
} elseif ($host !== null) {
|
||||
$safeResult = \ssh2_forward_listen($session, $port, $host);
|
||||
} else {
|
||||
$safeResult = \ssh2_forward_listen($session, $port);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw Ssh2Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $pkey
|
||||
* @param string $algoname
|
||||
* @param string $blob
|
||||
* @param bool $overwrite
|
||||
* @param array $attributes
|
||||
* @throws Ssh2Exception
|
||||
*
|
||||
*/
|
||||
function ssh2_publickey_add($pkey, string $algoname, string $blob, bool $overwrite = false, ?array $attributes = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($attributes !== null) {
|
||||
$safeResult = \ssh2_publickey_add($pkey, $algoname, $blob, $overwrite, $attributes);
|
||||
} else {
|
||||
$safeResult = \ssh2_publickey_add($pkey, $algoname, $blob, $overwrite);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw Ssh2Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $session
|
||||
* @return resource
|
||||
* @throws Ssh2Exception
|
||||
*
|
||||
*/
|
||||
function ssh2_publickey_init($session)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ssh2_publickey_init($session);
|
||||
if ($safeResult === false) {
|
||||
throw Ssh2Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $pkey
|
||||
* @param string $algoname
|
||||
* @param string $blob
|
||||
* @throws Ssh2Exception
|
||||
*
|
||||
*/
|
||||
function ssh2_publickey_remove($pkey, string $algoname, string $blob): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ssh2_publickey_remove($pkey, $algoname, $blob);
|
||||
if ($safeResult === false) {
|
||||
throw Ssh2Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $session
|
||||
* @param string $remote_file
|
||||
* @param string $local_file
|
||||
* @throws Ssh2Exception
|
||||
*
|
||||
*/
|
||||
function ssh2_scp_recv($session, string $remote_file, string $local_file): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ssh2_scp_recv($session, $remote_file, $local_file);
|
||||
if ($safeResult === false) {
|
||||
throw Ssh2Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $session
|
||||
* @param string $local_file
|
||||
* @param string $remote_file
|
||||
* @param int $create_mode
|
||||
* @throws Ssh2Exception
|
||||
*
|
||||
*/
|
||||
function ssh2_scp_send($session, string $local_file, string $remote_file, int $create_mode = 0644): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ssh2_scp_send($session, $local_file, $remote_file, $create_mode);
|
||||
if ($safeResult === false) {
|
||||
throw Ssh2Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $channel
|
||||
* @throws Ssh2Exception
|
||||
*
|
||||
*/
|
||||
function ssh2_send_eof($channel): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ssh2_send_eof($channel);
|
||||
if ($safeResult === false) {
|
||||
throw Ssh2Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $sftp
|
||||
* @param string $filename
|
||||
* @param int $mode
|
||||
* @throws Ssh2Exception
|
||||
*
|
||||
*/
|
||||
function ssh2_sftp_chmod($sftp, string $filename, int $mode): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ssh2_sftp_chmod($sftp, $filename, $mode);
|
||||
if ($safeResult === false) {
|
||||
throw Ssh2Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $sftp
|
||||
* @param string $dirname
|
||||
* @param int $mode
|
||||
* @param bool $recursive
|
||||
* @throws Ssh2Exception
|
||||
*
|
||||
*/
|
||||
function ssh2_sftp_mkdir($sftp, string $dirname, int $mode = 0777, bool $recursive = false): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ssh2_sftp_mkdir($sftp, $dirname, $mode, $recursive);
|
||||
if ($safeResult === false) {
|
||||
throw Ssh2Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $sftp
|
||||
* @param string $from
|
||||
* @param string $to
|
||||
* @throws Ssh2Exception
|
||||
*
|
||||
*/
|
||||
function ssh2_sftp_rename($sftp, string $from, string $to): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ssh2_sftp_rename($sftp, $from, $to);
|
||||
if ($safeResult === false) {
|
||||
throw Ssh2Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $sftp
|
||||
* @param string $dirname
|
||||
* @throws Ssh2Exception
|
||||
*
|
||||
*/
|
||||
function ssh2_sftp_rmdir($sftp, string $dirname): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ssh2_sftp_rmdir($sftp, $dirname);
|
||||
if ($safeResult === false) {
|
||||
throw Ssh2Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $sftp
|
||||
* @param string $target
|
||||
* @param string $link
|
||||
* @throws Ssh2Exception
|
||||
*
|
||||
*/
|
||||
function ssh2_sftp_symlink($sftp, string $target, string $link): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ssh2_sftp_symlink($sftp, $target, $link);
|
||||
if ($safeResult === false) {
|
||||
throw Ssh2Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $sftp
|
||||
* @param string $filename
|
||||
* @throws Ssh2Exception
|
||||
*
|
||||
*/
|
||||
function ssh2_sftp_unlink($sftp, string $filename): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ssh2_sftp_unlink($sftp, $filename);
|
||||
if ($safeResult === false) {
|
||||
throw Ssh2Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $session
|
||||
* @return resource
|
||||
* @throws Ssh2Exception
|
||||
*
|
||||
*/
|
||||
function ssh2_sftp($session)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ssh2_sftp($session);
|
||||
if ($safeResult === false) {
|
||||
throw Ssh2Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $session
|
||||
* @param string $term_type
|
||||
* @param array|null $env
|
||||
* @param int $width
|
||||
* @param int $height
|
||||
* @param int $width_height_type
|
||||
* @return resource
|
||||
* @throws Ssh2Exception
|
||||
*
|
||||
*/
|
||||
function ssh2_shell($session, string $term_type = "vanilla", ?array $env = null, int $width = 80, int $height = 25, int $width_height_type = SSH2_TERM_UNIT_CHARS)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($width_height_type !== SSH2_TERM_UNIT_CHARS) {
|
||||
$safeResult = \ssh2_shell($session, $term_type, $env, $width, $height, $width_height_type);
|
||||
} elseif ($height !== 25) {
|
||||
$safeResult = \ssh2_shell($session, $term_type, $env, $width, $height);
|
||||
} elseif ($width !== 80) {
|
||||
$safeResult = \ssh2_shell($session, $term_type, $env, $width);
|
||||
} elseif ($env !== null) {
|
||||
$safeResult = \ssh2_shell($session, $term_type, $env);
|
||||
} else {
|
||||
$safeResult = \ssh2_shell($session, $term_type);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw Ssh2Exception::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
427
vendor/thecodingmachine/safe/generated/8.1/stream.php
vendored
Normal file
427
vendor/thecodingmachine/safe/generated/8.1/stream.php
vendored
Normal file
@@ -0,0 +1,427 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\StreamException;
|
||||
|
||||
/**
|
||||
* @param resource $context
|
||||
* @param array $params
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_context_set_params($context, array $params): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \stream_context_set_params($context, $params);
|
||||
if ($safeResult === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $from
|
||||
* @param resource $to
|
||||
* @param int|null $length
|
||||
* @param int $offset
|
||||
* @return int
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_copy_to_stream($from, $to, ?int $length = null, int $offset = 0): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($offset !== 0) {
|
||||
$safeResult = \stream_copy_to_stream($from, $to, $length, $offset);
|
||||
} elseif ($length !== null) {
|
||||
$safeResult = \stream_copy_to_stream($from, $to, $length);
|
||||
} else {
|
||||
$safeResult = \stream_copy_to_stream($from, $to);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @param string $filtername
|
||||
* @param int $read_write
|
||||
* @param mixed $params
|
||||
* @return resource
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_filter_append($stream, string $filtername, ?int $read_write = null, $params = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($params !== null) {
|
||||
$safeResult = \stream_filter_append($stream, $filtername, $read_write, $params);
|
||||
} elseif ($read_write !== null) {
|
||||
$safeResult = \stream_filter_append($stream, $filtername, $read_write);
|
||||
} else {
|
||||
$safeResult = \stream_filter_append($stream, $filtername);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @param string $filtername
|
||||
* @param int $read_write
|
||||
* @param mixed $params
|
||||
* @return resource
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_filter_prepend($stream, string $filtername, ?int $read_write = null, $params = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($params !== null) {
|
||||
$safeResult = \stream_filter_prepend($stream, $filtername, $read_write, $params);
|
||||
} elseif ($read_write !== null) {
|
||||
$safeResult = \stream_filter_prepend($stream, $filtername, $read_write);
|
||||
} else {
|
||||
$safeResult = \stream_filter_prepend($stream, $filtername);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filter_name
|
||||
* @param string $class
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_filter_register(string $filter_name, string $class): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \stream_filter_register($filter_name, $class);
|
||||
if ($safeResult === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream_filter
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_filter_remove($stream_filter): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \stream_filter_remove($stream_filter);
|
||||
if ($safeResult === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $handle
|
||||
* @param int $maxlength
|
||||
* @param int $offset
|
||||
* @return string
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_get_contents($handle, int $maxlength = -1, int $offset = -1): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \stream_get_contents($handle, $maxlength, $offset);
|
||||
if ($safeResult === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $handle
|
||||
* @param int $length
|
||||
* @param string $ending
|
||||
* @return string
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_get_line($handle, int $length, string $ending = ""): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \stream_get_line($handle, $length, $ending);
|
||||
if ($safeResult === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_isatty($stream): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \stream_isatty($stream);
|
||||
if ($safeResult === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @return string
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_resolve_include_path(string $filename): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \stream_resolve_include_path($filename);
|
||||
if ($safeResult === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @param bool $enable
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_set_blocking($stream, bool $enable): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \stream_set_blocking($stream, $enable);
|
||||
if ($safeResult === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @param int $seconds
|
||||
* @param int $microseconds
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_set_timeout($stream, int $seconds, int $microseconds = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \stream_set_timeout($stream, $seconds, $microseconds);
|
||||
if ($safeResult === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $server_socket
|
||||
* @param float $timeout
|
||||
* @param null|string $peername
|
||||
* @return resource
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_socket_accept($server_socket, ?float $timeout = null, ?string &$peername = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($peername !== null) {
|
||||
$safeResult = \stream_socket_accept($server_socket, $timeout, $peername);
|
||||
} elseif ($timeout !== null) {
|
||||
$safeResult = \stream_socket_accept($server_socket, $timeout);
|
||||
} else {
|
||||
$safeResult = \stream_socket_accept($server_socket);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $remote_socket
|
||||
* @param int|null $errno
|
||||
* @param null|string $errstr
|
||||
* @param float $timeout
|
||||
* @param int-mask $flags
|
||||
* @param resource $context
|
||||
* @return resource
|
||||
* @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) {
|
||||
$safeResult = \stream_socket_client($remote_socket, $errno, $errstr, $timeout, $flags, $context);
|
||||
} elseif ($flags !== STREAM_CLIENT_CONNECT) {
|
||||
$safeResult = \stream_socket_client($remote_socket, $errno, $errstr, $timeout, $flags);
|
||||
} elseif ($timeout !== null) {
|
||||
$safeResult = \stream_socket_client($remote_socket, $errno, $errstr, $timeout);
|
||||
} else {
|
||||
$safeResult = \stream_socket_client($remote_socket, $errno, $errstr);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $handle
|
||||
* @param bool $want_peer
|
||||
* @return string
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_socket_get_name($handle, bool $want_peer): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \stream_socket_get_name($handle, $want_peer);
|
||||
if ($safeResult === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $domain
|
||||
* @param int $type
|
||||
* @param int $protocol
|
||||
* @return resource[]
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_socket_pair(int $domain, int $type, int $protocol): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \stream_socket_pair($domain, $type, $protocol);
|
||||
if ($safeResult === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $local_socket
|
||||
* @param int|null $errno
|
||||
* @param null|string $errstr
|
||||
* @param int $flags
|
||||
* @param resource $context
|
||||
* @return resource
|
||||
* @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) {
|
||||
$safeResult = \stream_socket_server($local_socket, $errno, $errstr, $flags, $context);
|
||||
} else {
|
||||
$safeResult = \stream_socket_server($local_socket, $errno, $errstr, $flags);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @param int $mode
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_socket_shutdown($stream, int $mode): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \stream_socket_shutdown($stream, $mode);
|
||||
if ($safeResult === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_supports_lock($stream): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \stream_supports_lock($stream);
|
||||
if ($safeResult === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $protocol
|
||||
* @param string $class
|
||||
* @param int $flags
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_wrapper_register(string $protocol, string $class, int $flags = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \stream_wrapper_register($protocol, $class, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $protocol
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_wrapper_restore(string $protocol): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \stream_wrapper_restore($protocol);
|
||||
if ($safeResult === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $protocol
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_wrapper_unregister(string $protocol): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \stream_wrapper_unregister($protocol);
|
||||
if ($safeResult === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
74
vendor/thecodingmachine/safe/generated/8.1/strings.php
vendored
Normal file
74
vendor/thecodingmachine/safe/generated/8.1/strings.php
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\StringsException;
|
||||
|
||||
/**
|
||||
* @param string $string
|
||||
* @return string
|
||||
* @throws StringsException
|
||||
*
|
||||
*/
|
||||
function convert_uudecode(string $string): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \convert_uudecode($string);
|
||||
if ($safeResult === false) {
|
||||
throw StringsException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $string
|
||||
* @return string
|
||||
* @throws StringsException
|
||||
*
|
||||
*/
|
||||
function hex2bin(string $string): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \hex2bin($string);
|
||||
if ($safeResult === false) {
|
||||
throw StringsException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param bool $binary
|
||||
* @return non-falsy-string&lowercase-string
|
||||
* @throws StringsException
|
||||
*
|
||||
*/
|
||||
function md5_file(string $filename, bool $binary = false): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \md5_file($filename, $binary);
|
||||
if ($safeResult === false) {
|
||||
throw StringsException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param bool $binary
|
||||
* @return non-falsy-string&lowercase-string
|
||||
* @throws StringsException
|
||||
*
|
||||
*/
|
||||
function sha1_file(string $filename, bool $binary = false): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sha1_file($filename, $binary);
|
||||
if ($safeResult === false) {
|
||||
throw StringsException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
130
vendor/thecodingmachine/safe/generated/8.1/swoole.php
vendored
Normal file
130
vendor/thecodingmachine/safe/generated/8.1/swoole.php
vendored
Normal file
@@ -0,0 +1,130 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\SwooleException;
|
||||
|
||||
/**
|
||||
* @param string $hostname
|
||||
* @param callable $callback
|
||||
* @throws SwooleException
|
||||
*
|
||||
*/
|
||||
function swoole_async_dns_lookup(string $hostname, callable $callback): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \swoole_async_dns_lookup($hostname, $callback);
|
||||
if ($safeResult === false) {
|
||||
throw SwooleException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param string $callback
|
||||
* @throws SwooleException
|
||||
*
|
||||
*/
|
||||
function swoole_async_readfile(string $filename, string $callback): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \swoole_async_readfile($filename, $callback);
|
||||
if ($safeResult === false) {
|
||||
throw SwooleException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param string $content
|
||||
* @param int $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) {
|
||||
$safeResult = \swoole_async_write($filename, $content, $offset, $callback);
|
||||
} elseif ($offset !== null) {
|
||||
$safeResult = \swoole_async_write($filename, $content, $offset);
|
||||
} else {
|
||||
$safeResult = \swoole_async_write($filename, $content);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw SwooleException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param string $content
|
||||
* @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) {
|
||||
$safeResult = \swoole_async_writefile($filename, $content, $callback, $flags);
|
||||
} elseif ($callback !== null) {
|
||||
$safeResult = \swoole_async_writefile($filename, $content, $callback);
|
||||
} else {
|
||||
$safeResult = \swoole_async_writefile($filename, $content);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw SwooleException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param callable $callback
|
||||
* @throws SwooleException
|
||||
*
|
||||
*/
|
||||
function swoole_event_defer(callable $callback): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \swoole_event_defer($callback);
|
||||
if ($safeResult === false) {
|
||||
throw SwooleException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $fd
|
||||
* @throws SwooleException
|
||||
*
|
||||
*/
|
||||
function swoole_event_del(int $fd): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \swoole_event_del($fd);
|
||||
if ($safeResult === false) {
|
||||
throw SwooleException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $fd
|
||||
* @param string $data
|
||||
* @throws SwooleException
|
||||
*
|
||||
*/
|
||||
function swoole_event_write(int $fd, string $data): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \swoole_event_write($fd, $data);
|
||||
if ($safeResult === false) {
|
||||
throw SwooleException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
659
vendor/thecodingmachine/safe/generated/8.1/uodbc.php
vendored
Normal file
659
vendor/thecodingmachine/safe/generated/8.1/uodbc.php
vendored
Normal file
@@ -0,0 +1,659 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\UodbcException;
|
||||
|
||||
/**
|
||||
* @param resource $odbc
|
||||
* @param bool $enable
|
||||
* @return mixed
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_autocommit($odbc, bool $enable = false)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \odbc_autocommit($odbc, $enable);
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $statement
|
||||
* @param int $mode
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_binmode(int $statement, int $mode): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \odbc_binmode($statement, $mode);
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $odbc
|
||||
* @param string $catalog
|
||||
* @param string $schema
|
||||
* @param string $table
|
||||
* @param string $column
|
||||
* @return resource
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_columnprivileges($odbc, string $catalog, string $schema, string $table, string $column)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \odbc_columnprivileges($odbc, $catalog, $schema, $table, $column);
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $odbc
|
||||
* @param null|string $catalog
|
||||
* @param null|string $schema
|
||||
* @param null|string $table
|
||||
* @param null|string $column
|
||||
* @return resource
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_columns($odbc, ?string $catalog = null, ?string $schema = null, ?string $table = null, ?string $column = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($column !== null) {
|
||||
$safeResult = \odbc_columns($odbc, $catalog, $schema, $table, $column);
|
||||
} elseif ($table !== null) {
|
||||
$safeResult = \odbc_columns($odbc, $catalog, $schema, $table);
|
||||
} elseif ($schema !== null) {
|
||||
$safeResult = \odbc_columns($odbc, $catalog, $schema);
|
||||
} elseif ($catalog !== null) {
|
||||
$safeResult = \odbc_columns($odbc, $catalog);
|
||||
} else {
|
||||
$safeResult = \odbc_columns($odbc);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $odbc
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_commit($odbc): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \odbc_commit($odbc);
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $dsn
|
||||
* @param string $user
|
||||
* @param string $password
|
||||
* @param int $cursor_option
|
||||
* @return resource
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_connect(string $dsn, string $user, string $password, int $cursor_option = SQL_CUR_USE_DRIVER)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \odbc_connect($dsn, $user, $password, $cursor_option);
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $statement
|
||||
* @return string
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_cursor($statement): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \odbc_cursor($statement);
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $odbc
|
||||
* @param int $fetch_type
|
||||
* @return array
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_data_source($odbc, int $fetch_type): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \odbc_data_source($odbc, $fetch_type);
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $odbc
|
||||
* @param string $query
|
||||
* @return resource
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_exec($odbc, string $query)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \odbc_exec($odbc, $query);
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $statement
|
||||
* @param array $params
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_execute($statement, array $params = []): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \odbc_execute($statement, $params);
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $statement
|
||||
* @param array|null $array
|
||||
* @param int $row
|
||||
* @return int
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_fetch_into($statement, ?array &$array, int $row = 0): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \odbc_fetch_into($statement, $array, $row);
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $statement
|
||||
* @param int $field
|
||||
* @return int
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_field_len($statement, int $field): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \odbc_field_len($statement, $field);
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $statement
|
||||
* @param int $field
|
||||
* @return string
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_field_name($statement, int $field): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \odbc_field_name($statement, $field);
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $statement
|
||||
* @param string $field
|
||||
* @return int
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_field_num($statement, string $field): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \odbc_field_num($statement, $field);
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $statement
|
||||
* @param int $field
|
||||
* @return int
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_field_scale($statement, int $field): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \odbc_field_scale($statement, $field);
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $statement
|
||||
* @param int $field
|
||||
* @return string
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_field_type($statement, int $field): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \odbc_field_type($statement, $field);
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $odbc
|
||||
* @param string $pk_catalog
|
||||
* @param string $pk_schema
|
||||
* @param string $pk_table
|
||||
* @param string $fk_catalog
|
||||
* @param string $fk_schema
|
||||
* @param string $fk_table
|
||||
* @return resource
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_foreignkeys($odbc, string $pk_catalog, string $pk_schema, string $pk_table, string $fk_catalog, string $fk_schema, string $fk_table)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \odbc_foreignkeys($odbc, $pk_catalog, $pk_schema, $pk_table, $fk_catalog, $fk_schema, $fk_table);
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $odbc
|
||||
* @param int $data_type
|
||||
* @return resource
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_gettypeinfo($odbc, int $data_type = 0)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \odbc_gettypeinfo($odbc, $data_type);
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $statement
|
||||
* @param int $length
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_longreadlen($statement, int $length): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \odbc_longreadlen($statement, $length);
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $statement
|
||||
* @return int
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_num_fields($statement): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \odbc_num_fields($statement);
|
||||
if ($safeResult === -1) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $dsn
|
||||
* @param string $user
|
||||
* @param string $password
|
||||
* @param int $cursor_option
|
||||
* @return resource
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_pconnect(string $dsn, string $user, string $password, int $cursor_option = SQL_CUR_USE_DRIVER)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \odbc_pconnect($dsn, $user, $password, $cursor_option);
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $odbc
|
||||
* @param string $query
|
||||
* @return resource
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_prepare($odbc, string $query)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \odbc_prepare($odbc, $query);
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $odbc
|
||||
* @param string $catalog
|
||||
* @param string $schema
|
||||
* @param string $table
|
||||
* @return resource
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_primarykeys($odbc, string $catalog, string $schema, string $table)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \odbc_primarykeys($odbc, $catalog, $schema, $table);
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $odbc
|
||||
* @param null|string $catalog
|
||||
* @param null|string $schema
|
||||
* @param null|string $procedure
|
||||
* @param null|string $column
|
||||
* @return resource
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_procedurecolumns($odbc, ?string $catalog = null, ?string $schema = null, ?string $procedure = null, ?string $column = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($column !== null) {
|
||||
$safeResult = \odbc_procedurecolumns($odbc, $catalog, $schema, $procedure, $column);
|
||||
} elseif ($procedure !== null) {
|
||||
$safeResult = \odbc_procedurecolumns($odbc, $catalog, $schema, $procedure);
|
||||
} elseif ($schema !== null) {
|
||||
$safeResult = \odbc_procedurecolumns($odbc, $catalog, $schema);
|
||||
} elseif ($catalog !== null) {
|
||||
$safeResult = \odbc_procedurecolumns($odbc, $catalog);
|
||||
} else {
|
||||
$safeResult = \odbc_procedurecolumns($odbc);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $odbc
|
||||
* @param null|string $catalog
|
||||
* @param null|string $schema
|
||||
* @param null|string $procedure
|
||||
* @return resource
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_procedures($odbc, ?string $catalog = null, ?string $schema = null, ?string $procedure = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($procedure !== null) {
|
||||
$safeResult = \odbc_procedures($odbc, $catalog, $schema, $procedure);
|
||||
} elseif ($schema !== null) {
|
||||
$safeResult = \odbc_procedures($odbc, $catalog, $schema);
|
||||
} elseif ($catalog !== null) {
|
||||
$safeResult = \odbc_procedures($odbc, $catalog);
|
||||
} else {
|
||||
$safeResult = \odbc_procedures($odbc);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $statement
|
||||
* @param string $format
|
||||
* @return int
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_result_all($statement, string $format = ""): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \odbc_result_all($statement, $format);
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $statement
|
||||
* @param mixed $field
|
||||
* @return mixed
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_result($statement, $field)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \odbc_result($statement, $field);
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $odbc
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_rollback($odbc): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \odbc_rollback($odbc);
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $odbc
|
||||
* @param int $which
|
||||
* @param int $option
|
||||
* @param int $value
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_setoption($odbc, int $which, int $option, int $value): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \odbc_setoption($odbc, $which, $option, $value);
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $odbc
|
||||
* @param int $type
|
||||
* @param string $catalog
|
||||
* @param string $schema
|
||||
* @param string $table
|
||||
* @param int $scope
|
||||
* @param int $nullable
|
||||
* @return resource
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_specialcolumns($odbc, int $type, string $catalog, string $schema, string $table, int $scope, int $nullable)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \odbc_specialcolumns($odbc, $type, $catalog, $schema, $table, $scope, $nullable);
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $odbc
|
||||
* @param string $catalog
|
||||
* @param string $schema
|
||||
* @param string $table
|
||||
* @param int $unique
|
||||
* @param int $accuracy
|
||||
* @return resource
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_statistics($odbc, string $catalog, string $schema, string $table, int $unique, int $accuracy)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \odbc_statistics($odbc, $catalog, $schema, $table, $unique, $accuracy);
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $odbc
|
||||
* @param string $catalog
|
||||
* @param string $schema
|
||||
* @param string $table
|
||||
* @return resource
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_tableprivileges($odbc, string $catalog, string $schema, string $table)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \odbc_tableprivileges($odbc, $catalog, $schema, $table);
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $odbc
|
||||
* @param null|string $catalog
|
||||
* @param null|string $schema
|
||||
* @param null|string $table
|
||||
* @param null|string $types
|
||||
* @return resource
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_tables($odbc, ?string $catalog = null, ?string $schema = null, ?string $table = null, ?string $types = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($types !== null) {
|
||||
$safeResult = \odbc_tables($odbc, $catalog, $schema, $table, $types);
|
||||
} elseif ($table !== null) {
|
||||
$safeResult = \odbc_tables($odbc, $catalog, $schema, $table);
|
||||
} elseif ($schema !== null) {
|
||||
$safeResult = \odbc_tables($odbc, $catalog, $schema);
|
||||
} elseif ($catalog !== null) {
|
||||
$safeResult = \odbc_tables($odbc, $catalog);
|
||||
} else {
|
||||
$safeResult = \odbc_tables($odbc);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
36
vendor/thecodingmachine/safe/generated/8.1/uopz.php
vendored
Normal file
36
vendor/thecodingmachine/safe/generated/8.1/uopz.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\UopzException;
|
||||
|
||||
/**
|
||||
* @param string $class
|
||||
* @param string $parent
|
||||
* @throws UopzException
|
||||
*
|
||||
*/
|
||||
function uopz_extend(string $class, string $parent): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \uopz_extend($class, $parent);
|
||||
if ($safeResult === false) {
|
||||
throw UopzException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $class
|
||||
* @param string $interface
|
||||
* @throws UopzException
|
||||
*
|
||||
*/
|
||||
function uopz_implement(string $class, string $interface): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \uopz_implement($class, $interface);
|
||||
if ($safeResult === false) {
|
||||
throw UopzException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
81
vendor/thecodingmachine/safe/generated/8.1/url.php
vendored
Normal file
81
vendor/thecodingmachine/safe/generated/8.1/url.php
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\UrlException;
|
||||
|
||||
/**
|
||||
* @param string $string
|
||||
* @param bool $strict
|
||||
* @return string
|
||||
* @throws UrlException
|
||||
*
|
||||
*/
|
||||
function base64_decode(string $string, bool $strict = false): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \base64_decode($string, $strict);
|
||||
if ($safeResult === false) {
|
||||
throw UrlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
* @param bool $associative
|
||||
* @param null|resource $context
|
||||
* @return array
|
||||
* @throws UrlException
|
||||
*
|
||||
*/
|
||||
function get_headers(string $url, bool $associative = false, $context = null): array
|
||||
{
|
||||
error_clear_last();
|
||||
if ($context !== null) {
|
||||
$safeResult = \get_headers($url, $associative, $context);
|
||||
} else {
|
||||
$safeResult = \get_headers($url, $associative);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw UrlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param bool $use_include_path
|
||||
* @return array
|
||||
* @throws UrlException
|
||||
*
|
||||
*/
|
||||
function get_meta_tags(string $filename, bool $use_include_path = false): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \get_meta_tags($filename, $use_include_path);
|
||||
if ($safeResult === false) {
|
||||
throw UrlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
* @param int $component
|
||||
* @return array|int|null|string
|
||||
* @throws UrlException
|
||||
*
|
||||
*/
|
||||
function parse_url(string $url, int $component = -1)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \parse_url($url, $component);
|
||||
if ($safeResult === false) {
|
||||
throw UrlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
20
vendor/thecodingmachine/safe/generated/8.1/var.php
vendored
Normal file
20
vendor/thecodingmachine/safe/generated/8.1/var.php
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\VarException;
|
||||
|
||||
/**
|
||||
* @param mixed $var
|
||||
* @param string $type
|
||||
* @throws VarException
|
||||
*
|
||||
*/
|
||||
function settype(&$var, string $type): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \settype($var, $type);
|
||||
if ($safeResult === false) {
|
||||
throw VarException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
170
vendor/thecodingmachine/safe/generated/8.1/xdiff.php
vendored
Normal file
170
vendor/thecodingmachine/safe/generated/8.1/xdiff.php
vendored
Normal file
@@ -0,0 +1,170 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\XdiffException;
|
||||
|
||||
/**
|
||||
* @param string $old_file
|
||||
* @param string $new_file
|
||||
* @param string $dest
|
||||
* @throws XdiffException
|
||||
*
|
||||
*/
|
||||
function xdiff_file_bdiff(string $old_file, string $new_file, string $dest): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \xdiff_file_bdiff($old_file, $new_file, $dest);
|
||||
if ($safeResult === false) {
|
||||
throw XdiffException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $file
|
||||
* @param string $patch
|
||||
* @param string $dest
|
||||
* @throws XdiffException
|
||||
*
|
||||
*/
|
||||
function xdiff_file_bpatch(string $file, string $patch, string $dest): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \xdiff_file_bpatch($file, $patch, $dest);
|
||||
if ($safeResult === false) {
|
||||
throw XdiffException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $old_file
|
||||
* @param string $new_file
|
||||
* @param string $dest
|
||||
* @throws XdiffException
|
||||
*
|
||||
*/
|
||||
function xdiff_file_diff_binary(string $old_file, string $new_file, string $dest): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \xdiff_file_diff_binary($old_file, $new_file, $dest);
|
||||
if ($safeResult === false) {
|
||||
throw XdiffException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $old_file
|
||||
* @param string $new_file
|
||||
* @param string $dest
|
||||
* @param int $context
|
||||
* @param bool $minimal
|
||||
* @throws XdiffException
|
||||
*
|
||||
*/
|
||||
function xdiff_file_diff(string $old_file, string $new_file, string $dest, int $context = 3, bool $minimal = false): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \xdiff_file_diff($old_file, $new_file, $dest, $context, $minimal);
|
||||
if ($safeResult === false) {
|
||||
throw XdiffException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $file
|
||||
* @param string $patch
|
||||
* @param string $dest
|
||||
* @throws XdiffException
|
||||
*
|
||||
*/
|
||||
function xdiff_file_patch_binary(string $file, string $patch, string $dest): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \xdiff_file_patch_binary($file, $patch, $dest);
|
||||
if ($safeResult === false) {
|
||||
throw XdiffException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $old_file
|
||||
* @param string $new_file
|
||||
* @param string $dest
|
||||
* @throws XdiffException
|
||||
*
|
||||
*/
|
||||
function xdiff_file_rabdiff(string $old_file, string $new_file, string $dest): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \xdiff_file_rabdiff($old_file, $new_file, $dest);
|
||||
if ($safeResult === false) {
|
||||
throw XdiffException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $str
|
||||
* @param string $patch
|
||||
* @return string
|
||||
* @throws XdiffException
|
||||
*
|
||||
*/
|
||||
function xdiff_string_bpatch(string $str, string $patch): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \xdiff_string_bpatch($str, $patch);
|
||||
if ($safeResult === false) {
|
||||
throw XdiffException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $str
|
||||
* @param string $patch
|
||||
* @return string
|
||||
* @throws XdiffException
|
||||
*
|
||||
*/
|
||||
function xdiff_string_patch_binary(string $str, string $patch): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \xdiff_string_patch_binary($str, $patch);
|
||||
if ($safeResult === false) {
|
||||
throw XdiffException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $str
|
||||
* @param string $patch
|
||||
* @param int $flags
|
||||
* @param null|string $error
|
||||
* @return string
|
||||
* @throws XdiffException
|
||||
*
|
||||
*/
|
||||
function xdiff_string_patch(string $str, string $patch, ?int $flags = null, ?string &$error = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($error !== null) {
|
||||
$safeResult = \xdiff_string_patch($str, $patch, $flags, $error);
|
||||
} elseif ($flags !== null) {
|
||||
$safeResult = \xdiff_string_patch($str, $patch, $flags);
|
||||
} else {
|
||||
$safeResult = \xdiff_string_patch($str, $patch);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw XdiffException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
180
vendor/thecodingmachine/safe/generated/8.1/xml.php
vendored
Normal file
180
vendor/thecodingmachine/safe/generated/8.1/xml.php
vendored
Normal file
@@ -0,0 +1,180 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\XmlException;
|
||||
|
||||
/**
|
||||
* @param \XMLParser $parser
|
||||
* @throws XmlException
|
||||
*
|
||||
*/
|
||||
function xml_parser_free(\XMLParser $parser): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \xml_parser_free($parser);
|
||||
if ($safeResult === false) {
|
||||
throw XmlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \XMLParser $parser
|
||||
* @param callable $handler
|
||||
* @throws XmlException
|
||||
*
|
||||
*/
|
||||
function xml_set_character_data_handler(\XMLParser $parser, callable $handler): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \xml_set_character_data_handler($parser, $handler);
|
||||
if ($safeResult === false) {
|
||||
throw XmlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \XMLParser $parser
|
||||
* @param callable $handler
|
||||
* @throws XmlException
|
||||
*
|
||||
*/
|
||||
function xml_set_default_handler(\XMLParser $parser, callable $handler): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \xml_set_default_handler($parser, $handler);
|
||||
if ($safeResult === false) {
|
||||
throw XmlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \XMLParser $parser
|
||||
* @param callable $start_handler
|
||||
* @param callable $end_handler
|
||||
* @throws XmlException
|
||||
*
|
||||
*/
|
||||
function xml_set_element_handler(\XMLParser $parser, callable $start_handler, callable $end_handler): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \xml_set_element_handler($parser, $start_handler, $end_handler);
|
||||
if ($safeResult === false) {
|
||||
throw XmlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \XMLParser $parser
|
||||
* @param callable $handler
|
||||
* @throws XmlException
|
||||
*
|
||||
*/
|
||||
function xml_set_end_namespace_decl_handler(\XMLParser $parser, callable $handler): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \xml_set_end_namespace_decl_handler($parser, $handler);
|
||||
if ($safeResult === false) {
|
||||
throw XmlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \XMLParser $parser
|
||||
* @param callable $handler
|
||||
* @throws XmlException
|
||||
*
|
||||
*/
|
||||
function xml_set_external_entity_ref_handler(\XMLParser $parser, callable $handler): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \xml_set_external_entity_ref_handler($parser, $handler);
|
||||
if ($safeResult === false) {
|
||||
throw XmlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \XMLParser $parser
|
||||
* @param callable $handler
|
||||
* @throws XmlException
|
||||
*
|
||||
*/
|
||||
function xml_set_notation_decl_handler(\XMLParser $parser, callable $handler): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \xml_set_notation_decl_handler($parser, $handler);
|
||||
if ($safeResult === false) {
|
||||
throw XmlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \XMLParser $parser
|
||||
* @param object $object
|
||||
* @throws XmlException
|
||||
*
|
||||
*/
|
||||
function xml_set_object(\XMLParser $parser, object $object): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \xml_set_object($parser, $object);
|
||||
if ($safeResult === false) {
|
||||
throw XmlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \XMLParser $parser
|
||||
* @param callable $handler
|
||||
* @throws XmlException
|
||||
*
|
||||
*/
|
||||
function xml_set_processing_instruction_handler(\XMLParser $parser, callable $handler): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \xml_set_processing_instruction_handler($parser, $handler);
|
||||
if ($safeResult === false) {
|
||||
throw XmlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \XMLParser $parser
|
||||
* @param callable $handler
|
||||
* @throws XmlException
|
||||
*
|
||||
*/
|
||||
function xml_set_start_namespace_decl_handler(\XMLParser $parser, callable $handler): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \xml_set_start_namespace_decl_handler($parser, $handler);
|
||||
if ($safeResult === false) {
|
||||
throw XmlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \XMLParser $parser
|
||||
* @param callable $handler
|
||||
* @throws XmlException
|
||||
*
|
||||
*/
|
||||
function xml_set_unparsed_entity_decl_handler(\XMLParser $parser, callable $handler): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \xml_set_unparsed_entity_decl_handler($parser, $handler);
|
||||
if ($safeResult === false) {
|
||||
throw XmlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
20
vendor/thecodingmachine/safe/generated/8.1/xmlrpc.php
vendored
Normal file
20
vendor/thecodingmachine/safe/generated/8.1/xmlrpc.php
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\XmlrpcException;
|
||||
|
||||
/**
|
||||
* @param \DateTime|string $value
|
||||
* @param string $type
|
||||
* @throws XmlrpcException
|
||||
*
|
||||
*/
|
||||
function xmlrpc_set_type(&$value, string $type): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \xmlrpc_set_type($value, $type);
|
||||
if ($safeResult === false) {
|
||||
throw XmlrpcException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
76
vendor/thecodingmachine/safe/generated/8.1/yaml.php
vendored
Normal file
76
vendor/thecodingmachine/safe/generated/8.1/yaml.php
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\YamlException;
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param int $pos
|
||||
* @param int|null $ndocs
|
||||
* @param array|null $callbacks
|
||||
* @return mixed
|
||||
* @throws YamlException
|
||||
*
|
||||
*/
|
||||
function yaml_parse_file(string $filename, int $pos = 0, ?int &$ndocs = null, ?array $callbacks = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($callbacks !== null) {
|
||||
$safeResult = \yaml_parse_file($filename, $pos, $ndocs, $callbacks);
|
||||
} else {
|
||||
$safeResult = \yaml_parse_file($filename, $pos, $ndocs);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw YamlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
* @param int $pos
|
||||
* @param int|null $ndocs
|
||||
* @param array|null $callbacks
|
||||
* @return mixed
|
||||
* @throws YamlException
|
||||
*
|
||||
*/
|
||||
function yaml_parse_url(string $url, int $pos = 0, ?int &$ndocs = null, ?array $callbacks = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($callbacks !== null) {
|
||||
$safeResult = \yaml_parse_url($url, $pos, $ndocs, $callbacks);
|
||||
} else {
|
||||
$safeResult = \yaml_parse_url($url, $pos, $ndocs);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw YamlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $input
|
||||
* @param int $pos
|
||||
* @param int|null $ndocs
|
||||
* @param array|null $callbacks
|
||||
* @return mixed
|
||||
* @throws YamlException
|
||||
*
|
||||
*/
|
||||
function yaml_parse(string $input, int $pos = 0, ?int &$ndocs = null, ?array $callbacks = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($callbacks !== null) {
|
||||
$safeResult = \yaml_parse($input, $pos, $ndocs, $callbacks);
|
||||
} else {
|
||||
$safeResult = \yaml_parse($input, $pos, $ndocs);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw YamlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
139
vendor/thecodingmachine/safe/generated/8.1/yaz.php
vendored
Normal file
139
vendor/thecodingmachine/safe/generated/8.1/yaz.php
vendored
Normal file
@@ -0,0 +1,139 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\YazException;
|
||||
|
||||
/**
|
||||
* @param resource $id
|
||||
* @param string $query
|
||||
* @param array|null $result
|
||||
* @throws YazException
|
||||
*
|
||||
*/
|
||||
function yaz_ccl_parse($id, string $query, ?array &$result): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \yaz_ccl_parse($id, $query, $result);
|
||||
if ($safeResult === false) {
|
||||
throw YazException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $id
|
||||
* @throws YazException
|
||||
*
|
||||
*/
|
||||
function yaz_close($id): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \yaz_close($id);
|
||||
if ($safeResult === false) {
|
||||
throw YazException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $zurl
|
||||
* @param mixed $options
|
||||
* @return mixed
|
||||
* @throws YazException
|
||||
*
|
||||
*/
|
||||
function yaz_connect(string $zurl, $options = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($options !== null) {
|
||||
$safeResult = \yaz_connect($zurl, $options);
|
||||
} else {
|
||||
$safeResult = \yaz_connect($zurl);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw YazException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $id
|
||||
* @param string $databases
|
||||
* @throws YazException
|
||||
*
|
||||
*/
|
||||
function yaz_database($id, string $databases): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \yaz_database($id, $databases);
|
||||
if ($safeResult === false) {
|
||||
throw YazException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $id
|
||||
* @param string $elementset
|
||||
* @throws YazException
|
||||
*
|
||||
*/
|
||||
function yaz_element($id, string $elementset): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \yaz_element($id, $elementset);
|
||||
if ($safeResult === false) {
|
||||
throw YazException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $id
|
||||
* @throws YazException
|
||||
*
|
||||
*/
|
||||
function yaz_present($id): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \yaz_present($id);
|
||||
if ($safeResult === false) {
|
||||
throw YazException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $id
|
||||
* @param string $type
|
||||
* @param string $query
|
||||
* @throws YazException
|
||||
*
|
||||
*/
|
||||
function yaz_search($id, string $type, string $query): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \yaz_search($id, $type, $query);
|
||||
if ($safeResult === false) {
|
||||
throw YazException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $options
|
||||
* @return mixed
|
||||
* @throws YazException
|
||||
*
|
||||
*/
|
||||
function yaz_wait(?array &$options = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \yaz_wait($options);
|
||||
if ($safeResult === false) {
|
||||
throw YazException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
122
vendor/thecodingmachine/safe/generated/8.1/zip.php
vendored
Normal file
122
vendor/thecodingmachine/safe/generated/8.1/zip.php
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\ZipException;
|
||||
|
||||
/**
|
||||
* @param resource $zip_entry
|
||||
* @throws ZipException
|
||||
*
|
||||
*/
|
||||
function zip_entry_close($zip_entry): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \zip_entry_close($zip_entry);
|
||||
if ($safeResult === false) {
|
||||
throw ZipException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $zip_entry
|
||||
* @return int
|
||||
* @throws ZipException
|
||||
*
|
||||
*/
|
||||
function zip_entry_compressedsize($zip_entry): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \zip_entry_compressedsize($zip_entry);
|
||||
if ($safeResult === false) {
|
||||
throw ZipException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $zip_entry
|
||||
* @return string
|
||||
* @throws ZipException
|
||||
*
|
||||
*/
|
||||
function zip_entry_compressionmethod($zip_entry): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \zip_entry_compressionmethod($zip_entry);
|
||||
if ($safeResult === false) {
|
||||
throw ZipException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $zip_entry
|
||||
* @return int
|
||||
* @throws ZipException
|
||||
*
|
||||
*/
|
||||
function zip_entry_filesize($zip_entry): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \zip_entry_filesize($zip_entry);
|
||||
if ($safeResult === false) {
|
||||
throw ZipException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $zip_entry
|
||||
* @return string
|
||||
* @throws ZipException
|
||||
*
|
||||
*/
|
||||
function zip_entry_name($zip_entry): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \zip_entry_name($zip_entry);
|
||||
if ($safeResult === false) {
|
||||
throw ZipException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $zip_dp
|
||||
* @param resource $zip_entry
|
||||
* @param string $mode
|
||||
* @throws ZipException
|
||||
*
|
||||
*/
|
||||
function zip_entry_open($zip_dp, $zip_entry, string $mode = "rb"): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \zip_entry_open($zip_dp, $zip_entry, $mode);
|
||||
if ($safeResult === false) {
|
||||
throw ZipException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $zip_entry
|
||||
* @param int $len
|
||||
* @return string
|
||||
* @throws ZipException
|
||||
*
|
||||
*/
|
||||
function zip_entry_read($zip_entry, int $len = 1024): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \zip_entry_read($zip_entry, $len);
|
||||
if ($safeResult === false) {
|
||||
throw ZipException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
423
vendor/thecodingmachine/safe/generated/8.1/zlib.php
vendored
Normal file
423
vendor/thecodingmachine/safe/generated/8.1/zlib.php
vendored
Normal file
@@ -0,0 +1,423 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\ZlibException;
|
||||
|
||||
/**
|
||||
* @param \DeflateContext $context
|
||||
* @param string $data
|
||||
* @param int $flush_mode
|
||||
* @return string
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function deflate_add(\DeflateContext $context, string $data, int $flush_mode = ZLIB_SYNC_FLUSH): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \deflate_add($context, $data, $flush_mode);
|
||||
if ($safeResult === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $encoding
|
||||
* @param array $options
|
||||
* @return \DeflateContext
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function deflate_init(int $encoding, array $options = []): \DeflateContext
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \deflate_init($encoding, $options);
|
||||
if ($safeResult === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function gzclose($stream): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gzclose($stream);
|
||||
if ($safeResult === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $data
|
||||
* @param int $level
|
||||
* @param int $encoding
|
||||
* @return string
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function gzcompress(string $data, int $level = -1, int $encoding = ZLIB_ENCODING_DEFLATE): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gzcompress($data, $level, $encoding);
|
||||
if ($safeResult === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $data
|
||||
* @param int $max_length
|
||||
* @return string
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function gzdecode(string $data, int $max_length = 0): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gzdecode($data, $max_length);
|
||||
if ($safeResult === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $data
|
||||
* @param int $level
|
||||
* @param int $encoding
|
||||
* @return string
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function gzdeflate(string $data, int $level = -1, int $encoding = ZLIB_ENCODING_RAW): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gzdeflate($data, $level, $encoding);
|
||||
if ($safeResult === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $data
|
||||
* @param int $level
|
||||
* @param int $encoding
|
||||
* @return string
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function gzencode(string $data, int $level = -1, int $encoding = ZLIB_ENCODING_GZIP): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gzencode($data, $level, $encoding);
|
||||
if ($safeResult === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param $use_include_path
|
||||
* @return list
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function gzfile(string $filename, $use_include_path = 0): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gzfile($filename, $use_include_path);
|
||||
if ($safeResult === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @param int|null $length
|
||||
* @return string
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function gzgets($stream, ?int $length = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($length !== null) {
|
||||
$safeResult = \gzgets($stream, $length);
|
||||
} else {
|
||||
$safeResult = \gzgets($stream);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $data
|
||||
* @param int $max_length
|
||||
* @return string
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function gzinflate(string $data, int $max_length = 0): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gzinflate($data, $max_length);
|
||||
if ($safeResult === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param string $mode
|
||||
* @param $use_include_path
|
||||
* @return resource
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function gzopen(string $filename, string $mode, $use_include_path = 0)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gzopen($filename, $mode, $use_include_path);
|
||||
if ($safeResult === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @return int
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function gzpassthru($stream): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gzpassthru($stream);
|
||||
if ($safeResult === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @param int $length
|
||||
* @return string
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function gzread($stream, int $length): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gzread($stream, $length);
|
||||
if ($safeResult === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function gzrewind($stream): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gzrewind($stream);
|
||||
if ($safeResult === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @return int
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function gztell($stream): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gztell($stream);
|
||||
if ($safeResult === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $data
|
||||
* @param int $max_length
|
||||
* @return string
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function gzuncompress(string $data, int $max_length = 0): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gzuncompress($data, $max_length);
|
||||
if ($safeResult === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @param string $data
|
||||
* @param int|null $length
|
||||
* @return int
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function gzwrite($stream, string $data, ?int $length = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($length !== null) {
|
||||
$safeResult = \gzwrite($stream, $data, $length);
|
||||
} else {
|
||||
$safeResult = \gzwrite($stream, $data);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \InflateContext $context
|
||||
* @return int
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function inflate_get_read_len(\InflateContext $context): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \inflate_get_read_len($context);
|
||||
if ($safeResult === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \InflateContext $context
|
||||
* @return int
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function inflate_get_status(\InflateContext $context): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \inflate_get_status($context);
|
||||
if ($safeResult === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \InflateContext $context
|
||||
* @param string $data
|
||||
* @param int $flush_mode
|
||||
* @return string
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function inflate_add(\InflateContext $context, string $data, int $flush_mode = ZLIB_SYNC_FLUSH): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \inflate_add($context, $data, $flush_mode);
|
||||
if ($safeResult === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $encoding
|
||||
* @param array $options
|
||||
* @return \InflateContext
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function inflate_init(int $encoding, array $options = []): \InflateContext
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \inflate_init($encoding, $options);
|
||||
if ($safeResult === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param $use_include_path
|
||||
* @return 0|positive-int
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function readgzfile(string $filename, $use_include_path = 0): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \readgzfile($filename, $use_include_path);
|
||||
if ($safeResult === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $data
|
||||
* @param int $max_length
|
||||
* @return string
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function zlib_decode(string $data, int $max_length = 0): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \zlib_decode($data, $max_length);
|
||||
if ($safeResult === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
103
vendor/thecodingmachine/safe/generated/8.2/array.php
vendored
Normal file
103
vendor/thecodingmachine/safe/generated/8.2/array.php
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\ArrayException;
|
||||
|
||||
/**
|
||||
* @param array $keys
|
||||
* @param array $values
|
||||
* @return array
|
||||
*
|
||||
*/
|
||||
function array_combine(array $keys, array $values): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \array_combine($keys, $values);
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $array
|
||||
* @return array
|
||||
*
|
||||
*/
|
||||
function array_flip(array $array): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \array_flip($array);
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $array
|
||||
* @param array $replacements
|
||||
* @return array
|
||||
*
|
||||
*/
|
||||
function array_replace_recursive(array $array, array ...$replacements): array
|
||||
{
|
||||
error_clear_last();
|
||||
if ($replacements !== []) {
|
||||
$safeResult = \array_replace_recursive($array, ...$replacements);
|
||||
} else {
|
||||
$safeResult = \array_replace_recursive($array);
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $array
|
||||
* @param array $replacements
|
||||
* @return array
|
||||
*
|
||||
*/
|
||||
function array_replace(array $array, array ...$replacements): array
|
||||
{
|
||||
error_clear_last();
|
||||
if ($replacements !== []) {
|
||||
$safeResult = \array_replace($array, ...$replacements);
|
||||
} else {
|
||||
$safeResult = \array_replace($array);
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array|object $array
|
||||
* @param callable $callback
|
||||
* @param mixed $arg
|
||||
* @throws ArrayException
|
||||
*
|
||||
*/
|
||||
function array_walk_recursive(&$array, callable $callback, $arg = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($arg !== null) {
|
||||
$safeResult = \array_walk_recursive($array, $callback, $arg);
|
||||
} else {
|
||||
$safeResult = \array_walk_recursive($array, $callback);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $array
|
||||
* @throws ArrayException
|
||||
*
|
||||
*/
|
||||
function shuffle(array &$array): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \shuffle($array);
|
||||
if ($safeResult === false) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
234
vendor/thecodingmachine/safe/generated/8.2/curl.php
vendored
Normal file
234
vendor/thecodingmachine/safe/generated/8.2/curl.php
vendored
Normal file
@@ -0,0 +1,234 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\CurlException;
|
||||
|
||||
/**
|
||||
* @param \CurlHandle $handle
|
||||
* @return \CurlHandle
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_copy_handle(\CurlHandle $handle): \CurlHandle
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \curl_copy_handle($handle);
|
||||
if ($safeResult === false) {
|
||||
throw CurlException::createFromPhpError($handle);
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \CurlHandle $handle
|
||||
* @param string $string
|
||||
* @return string
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_escape(\CurlHandle $handle, string $string): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \curl_escape($handle, $string);
|
||||
if ($safeResult === false) {
|
||||
throw CurlException::createFromPhpError($handle);
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \CurlHandle $handle
|
||||
* @return bool|string
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_exec(\CurlHandle $handle)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \curl_exec($handle);
|
||||
if ($safeResult === false) {
|
||||
throw CurlException::createFromPhpError($handle);
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \CurlHandle $handle
|
||||
* @param int|null $option
|
||||
* @return mixed
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_getinfo(\CurlHandle $handle, ?int $option = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($option !== null) {
|
||||
$safeResult = \curl_getinfo($handle, $option);
|
||||
} else {
|
||||
$safeResult = \curl_getinfo($handle);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw CurlException::createFromPhpError($handle);
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|string $url
|
||||
* @return \CurlHandle
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_init(?string $url = null): \CurlHandle
|
||||
{
|
||||
error_clear_last();
|
||||
if ($url !== null) {
|
||||
$safeResult = \curl_init($url);
|
||||
} else {
|
||||
$safeResult = \curl_init();
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw CurlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \CurlMultiHandle $multi_handle
|
||||
* @param int|null $queued_messages
|
||||
* @return array
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_multi_info_read(\CurlMultiHandle $multi_handle, ?int &$queued_messages = null): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \curl_multi_info_read($multi_handle, $queued_messages);
|
||||
if ($safeResult === false) {
|
||||
throw CurlException::createFromPhpError($multi_handle);
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return \CurlMultiHandle
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_multi_init(): \CurlMultiHandle
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \curl_multi_init();
|
||||
if ($safeResult === false) {
|
||||
throw CurlException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \CurlMultiHandle $multi_handle
|
||||
* @param int $option
|
||||
* @param mixed $value
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_multi_setopt(\CurlMultiHandle $multi_handle, int $option, $value): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \curl_multi_setopt($multi_handle, $option, $value);
|
||||
if ($safeResult === false) {
|
||||
throw CurlException::createFromPhpError($multi_handle);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \CurlHandle $handle
|
||||
* @param int $option
|
||||
* @param mixed $value
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_setopt(\CurlHandle $handle, int $option, $value): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \curl_setopt($handle, $option, $value);
|
||||
if ($safeResult === false) {
|
||||
throw CurlException::createFromPhpError($handle);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \CurlShareHandle $share_handle
|
||||
* @return int
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_share_errno(\CurlShareHandle $share_handle): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \curl_share_errno($share_handle);
|
||||
if ($safeResult === false) {
|
||||
throw CurlException::createFromPhpError($share_handle);
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \CurlShareHandle $share_handle
|
||||
* @param int $option
|
||||
* @param mixed $value
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_share_setopt(\CurlShareHandle $share_handle, int $option, $value): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \curl_share_setopt($share_handle, $option, $value);
|
||||
if ($safeResult === false) {
|
||||
throw CurlException::createFromPhpError($share_handle);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \CurlHandle $handle
|
||||
* @param string $string
|
||||
* @return string
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_unescape(\CurlHandle $handle, string $string): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \curl_unescape($handle, $string);
|
||||
if ($safeResult === false) {
|
||||
throw CurlException::createFromPhpError($handle);
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \CurlHandle $handle
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_upkeep(\CurlHandle $handle): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \curl_upkeep($handle);
|
||||
if ($safeResult === false) {
|
||||
throw CurlException::createFromPhpError($handle);
|
||||
}
|
||||
}
|
||||
359
vendor/thecodingmachine/safe/generated/8.2/datetime.php
vendored
Normal file
359
vendor/thecodingmachine/safe/generated/8.2/datetime.php
vendored
Normal file
@@ -0,0 +1,359 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\DatetimeException;
|
||||
|
||||
/**
|
||||
* @param null|string $datetime
|
||||
* @param \DateTimeZone|null $timezone
|
||||
* @return \DateTime
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function date_create(?string $datetime = "now", ?\DateTimeZone $timezone = null): \DateTime
|
||||
{
|
||||
error_clear_last();
|
||||
if ($timezone !== null) {
|
||||
$safeResult = \date_create($datetime, $timezone);
|
||||
} else {
|
||||
$safeResult = \date_create($datetime);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $format
|
||||
* @param string $datetime
|
||||
* @return array{year: int|false, month: int|false, day: int|false, hour: int|false, minute: int|false, second: int|false, fraction: float|false, warning_count: int, warnings: string[], error_count: int, errors: string[], is_localtime: bool, zone_type: int|bool, zone: int|bool, is_dst: bool, tz_abbr: string, tz_id: string, relative: array{year: int, month: int, day: int, hour: int, minute: int, second: int, weekday: int, weekdays: int, first_day_of_month: bool, last_day_of_month: bool}}|null
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function date_parse_from_format(string $format, string $datetime): ?array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \date_parse_from_format($format, $datetime);
|
||||
if ($safeResult === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $datetime
|
||||
* @return array{year: int|false, month: int|false, day: int|false, hour: int|false, minute: int|false, second: int|false, fraction: float|false, warning_count: int, warnings: string[], error_count: int, errors: string[], is_localtime: bool, zone_type: int|bool, zone: int|bool, is_dst: bool, tz_abbr: string, tz_id: string, relative: array{year: int, month: int, day: int, hour: int, minute: int, second: int, weekday: int, weekdays: int, first_day_of_month: bool, last_day_of_month: bool}}|null
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function date_parse(string $datetime): ?array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \date_parse($datetime);
|
||||
if ($safeResult === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $timestamp
|
||||
* @param float $latitude
|
||||
* @param float $longitude
|
||||
* @return array{sunrise: int|bool,sunset: int|bool,transit: int|bool,civil_twilight_begin: int|bool,civil_twilight_end: int|bool,nautical_twilight_begin: int|bool,nautical_twilight_end: int|bool,astronomical_twilight_begin: int|bool,astronomical_twilight_end: int|bool}
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function date_sun_info(int $timestamp, float $latitude, float $longitude): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \date_sun_info($timestamp, $latitude, $longitude);
|
||||
if ($safeResult === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $timestamp
|
||||
* @param int $returnFormat
|
||||
* @param float|null $latitude
|
||||
* @param float|null $longitude
|
||||
* @param float|null $zenith
|
||||
* @param float|null $utcOffset
|
||||
* @return mixed
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function date_sunrise(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, ?float $latitude = null, ?float $longitude = null, ?float $zenith = null, ?float $utcOffset = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($utcOffset !== null) {
|
||||
$safeResult = \date_sunrise($timestamp, $returnFormat, $latitude, $longitude, $zenith, $utcOffset);
|
||||
} elseif ($zenith !== null) {
|
||||
$safeResult = \date_sunrise($timestamp, $returnFormat, $latitude, $longitude, $zenith);
|
||||
} elseif ($longitude !== null) {
|
||||
$safeResult = \date_sunrise($timestamp, $returnFormat, $latitude, $longitude);
|
||||
} elseif ($latitude !== null) {
|
||||
$safeResult = \date_sunrise($timestamp, $returnFormat, $latitude);
|
||||
} else {
|
||||
$safeResult = \date_sunrise($timestamp, $returnFormat);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $timestamp
|
||||
* @param int $returnFormat
|
||||
* @param float|null $latitude
|
||||
* @param float|null $longitude
|
||||
* @param float|null $zenith
|
||||
* @param float|null $utcOffset
|
||||
* @return mixed
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function date_sunset(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, ?float $latitude = null, ?float $longitude = null, ?float $zenith = null, ?float $utcOffset = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($utcOffset !== null) {
|
||||
$safeResult = \date_sunset($timestamp, $returnFormat, $latitude, $longitude, $zenith, $utcOffset);
|
||||
} elseif ($zenith !== null) {
|
||||
$safeResult = \date_sunset($timestamp, $returnFormat, $latitude, $longitude, $zenith);
|
||||
} elseif ($longitude !== null) {
|
||||
$safeResult = \date_sunset($timestamp, $returnFormat, $latitude, $longitude);
|
||||
} elseif ($latitude !== null) {
|
||||
$safeResult = \date_sunset($timestamp, $returnFormat, $latitude);
|
||||
} else {
|
||||
$safeResult = \date_sunset($timestamp, $returnFormat);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $format
|
||||
* @param int|null $timestamp
|
||||
* @return string
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function date(string $format, ?int $timestamp = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($timestamp !== null) {
|
||||
$safeResult = \date($format, $timestamp);
|
||||
} else {
|
||||
$safeResult = \date($format);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $hour
|
||||
* @param int|null $minute
|
||||
* @param int|null $second
|
||||
* @param int|null $month
|
||||
* @param int|null $day
|
||||
* @param int|null $year
|
||||
* @return int
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function gmmktime(int $hour, ?int $minute = null, ?int $second = null, ?int $month = null, ?int $day = null, ?int $year = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($year !== null) {
|
||||
$safeResult = \gmmktime($hour, $minute, $second, $month, $day, $year);
|
||||
} elseif ($day !== null) {
|
||||
$safeResult = \gmmktime($hour, $minute, $second, $month, $day);
|
||||
} elseif ($month !== null) {
|
||||
$safeResult = \gmmktime($hour, $minute, $second, $month);
|
||||
} elseif ($second !== null) {
|
||||
$safeResult = \gmmktime($hour, $minute, $second);
|
||||
} elseif ($minute !== null) {
|
||||
$safeResult = \gmmktime($hour, $minute);
|
||||
} else {
|
||||
$safeResult = \gmmktime($hour);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $format
|
||||
* @param int|null $timestamp
|
||||
* @return string
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function gmstrftime(string $format, ?int $timestamp = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($timestamp !== null) {
|
||||
$safeResult = \gmstrftime($format, $timestamp);
|
||||
} else {
|
||||
$safeResult = \gmstrftime($format);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $format
|
||||
* @param int|null $timestamp
|
||||
* @return int
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function idate(string $format, ?int $timestamp = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($timestamp !== null) {
|
||||
$safeResult = \idate($format, $timestamp);
|
||||
} else {
|
||||
$safeResult = \idate($format);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $hour
|
||||
* @param int|null $minute
|
||||
* @param int|null $second
|
||||
* @param int|null $month
|
||||
* @param int|null $day
|
||||
* @param int|null $year
|
||||
* @return int
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function mktime(int $hour, ?int $minute = null, ?int $second = null, ?int $month = null, ?int $day = null, ?int $year = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($year !== null) {
|
||||
$safeResult = \mktime($hour, $minute, $second, $month, $day, $year);
|
||||
} elseif ($day !== null) {
|
||||
$safeResult = \mktime($hour, $minute, $second, $month, $day);
|
||||
} elseif ($month !== null) {
|
||||
$safeResult = \mktime($hour, $minute, $second, $month);
|
||||
} elseif ($second !== null) {
|
||||
$safeResult = \mktime($hour, $minute, $second);
|
||||
} elseif ($minute !== null) {
|
||||
$safeResult = \mktime($hour, $minute);
|
||||
} else {
|
||||
$safeResult = \mktime($hour);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $format
|
||||
* @param int|null $timestamp
|
||||
* @return string
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function strftime(string $format, ?int $timestamp = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($timestamp !== null) {
|
||||
$safeResult = \strftime($format, $timestamp);
|
||||
} else {
|
||||
$safeResult = \strftime($format);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $timestamp
|
||||
* @param string $format
|
||||
* @return array
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function strptime(string $timestamp, string $format): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \strptime($timestamp, $format);
|
||||
if ($safeResult === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $datetime
|
||||
* @param int|null $baseTimestamp
|
||||
* @return int
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function strtotime(string $datetime, ?int $baseTimestamp = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($baseTimestamp !== null) {
|
||||
$safeResult = \strtotime($datetime, $baseTimestamp);
|
||||
} else {
|
||||
$safeResult = \strtotime($datetime);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $abbr
|
||||
* @param int $utcOffset
|
||||
* @param int $isDST
|
||||
* @return string
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function timezone_name_from_abbr(string $abbr, int $utcOffset = -1, int $isDST = -1): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \timezone_name_from_abbr($abbr, $utcOffset, $isDST);
|
||||
if ($safeResult === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
28
vendor/thecodingmachine/safe/generated/8.2/errorfunc.php
vendored
Normal file
28
vendor/thecodingmachine/safe/generated/8.2/errorfunc.php
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\ErrorfuncException;
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
* @param 0|1|2|3|4 $message_type
|
||||
* @param null|string $destination
|
||||
* @param null|string $additional_headers
|
||||
* @throws ErrorfuncException
|
||||
*
|
||||
*/
|
||||
function error_log(string $message, int $message_type = 0, ?string $destination = null, ?string $additional_headers = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($additional_headers !== null) {
|
||||
$safeResult = \error_log($message, $message_type, $destination, $additional_headers);
|
||||
} elseif ($destination !== null) {
|
||||
$safeResult = \error_log($message, $message_type, $destination);
|
||||
} else {
|
||||
$safeResult = \error_log($message, $message_type);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw ErrorfuncException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
120
vendor/thecodingmachine/safe/generated/8.2/exec.php
vendored
Normal file
120
vendor/thecodingmachine/safe/generated/8.2/exec.php
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\ExecException;
|
||||
|
||||
/**
|
||||
* @param string $command
|
||||
* @param array|null $output
|
||||
* @param int|null $result_code
|
||||
* @return string
|
||||
* @throws ExecException
|
||||
*
|
||||
*/
|
||||
function exec(string $command, ?array &$output = null, ?int &$result_code = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \exec($command, $output, $result_code);
|
||||
if ($safeResult === false) {
|
||||
throw ExecException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $process
|
||||
* @return int
|
||||
* @throws ExecException
|
||||
*
|
||||
*/
|
||||
function proc_close($process): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \proc_close($process);
|
||||
if ($safeResult === -1) {
|
||||
throw ExecException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $priority
|
||||
* @throws ExecException
|
||||
*
|
||||
*/
|
||||
function proc_nice(int $priority): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \proc_nice($priority);
|
||||
if ($safeResult === false) {
|
||||
throw ExecException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $command
|
||||
* @param array $descriptor_spec
|
||||
* @param null|resource[] $pipes
|
||||
* @param null|string $cwd
|
||||
* @param array|null $env_vars
|
||||
* @param array|null $options
|
||||
* @return resource
|
||||
* @throws ExecException
|
||||
*
|
||||
*/
|
||||
function proc_open(string $command, array $descriptor_spec, ?array &$pipes, ?string $cwd = null, ?array $env_vars = null, ?array $options = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($options !== null) {
|
||||
$safeResult = \proc_open($command, $descriptor_spec, $pipes, $cwd, $env_vars, $options);
|
||||
} elseif ($env_vars !== null) {
|
||||
$safeResult = \proc_open($command, $descriptor_spec, $pipes, $cwd, $env_vars);
|
||||
} elseif ($cwd !== null) {
|
||||
$safeResult = \proc_open($command, $descriptor_spec, $pipes, $cwd);
|
||||
} else {
|
||||
$safeResult = \proc_open($command, $descriptor_spec, $pipes);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw ExecException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $command
|
||||
* @return null|string
|
||||
* @throws ExecException
|
||||
*
|
||||
*/
|
||||
function shell_exec(string $command): ?string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \shell_exec($command);
|
||||
if ($safeResult === false) {
|
||||
throw ExecException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $command
|
||||
* @param int|null $result_code
|
||||
* @return string
|
||||
* @throws ExecException
|
||||
*
|
||||
*/
|
||||
function system(string $command, ?int &$result_code = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \system($command, $result_code);
|
||||
if ($safeResult === false) {
|
||||
throw ExecException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
895
vendor/thecodingmachine/safe/generated/8.2/filesystem.php
vendored
Normal file
895
vendor/thecodingmachine/safe/generated/8.2/filesystem.php
vendored
Normal file
@@ -0,0 +1,895 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\FilesystemException;
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param int|string $group
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function chgrp(string $filename, $group): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \chgrp($filename, $group);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param int $permissions
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function chmod(string $filename, int $permissions): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \chmod($filename, $permissions);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param int|string $user
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function chown(string $filename, $user): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \chown($filename, $user);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $from
|
||||
* @param string $to
|
||||
* @param null|resource $context
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function copy(string $from, string $to, $context = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($context !== null) {
|
||||
$safeResult = \copy($from, $to, $context);
|
||||
} else {
|
||||
$safeResult = \copy($from, $to);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $directory
|
||||
* @return float
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function disk_free_space(string $directory): float
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \disk_free_space($directory);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $directory
|
||||
* @return float
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function disk_total_space(string $directory): float
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \disk_total_space($directory);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fclose($stream): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \fclose($stream);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fdatasync($stream): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \fdatasync($stream);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fflush($stream): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \fflush($stream);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param bool $use_include_path
|
||||
* @param null|resource $context
|
||||
* @param int $offset
|
||||
* @param 0|null|positive-int $length
|
||||
* @return string
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function file_get_contents(string $filename, bool $use_include_path = false, $context = null, int $offset = 0, ?int $length = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($length !== null) {
|
||||
$safeResult = \file_get_contents($filename, $use_include_path, $context, $offset, $length);
|
||||
} elseif ($offset !== 0) {
|
||||
$safeResult = \file_get_contents($filename, $use_include_path, $context, $offset);
|
||||
} elseif ($context !== null) {
|
||||
$safeResult = \file_get_contents($filename, $use_include_path, $context);
|
||||
} else {
|
||||
$safeResult = \file_get_contents($filename, $use_include_path);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param mixed $data
|
||||
* @param int $flags
|
||||
* @param null|resource $context
|
||||
* @return 0|positive-int
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function file_put_contents(string $filename, $data, int $flags = 0, $context = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($context !== null) {
|
||||
$safeResult = \file_put_contents($filename, $data, $flags, $context);
|
||||
} else {
|
||||
$safeResult = \file_put_contents($filename, $data, $flags);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param int-mask $flags
|
||||
* @param null|resource $context
|
||||
* @return list
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function file(string $filename, int $flags = 0, $context = null): array
|
||||
{
|
||||
error_clear_last();
|
||||
if ($context !== null) {
|
||||
$safeResult = \file($filename, $flags, $context);
|
||||
} else {
|
||||
$safeResult = \file($filename, $flags);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @return int
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fileatime(string $filename): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \fileatime($filename);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @return int
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function filectime(string $filename): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \filectime($filename);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @return int
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fileinode(string $filename): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \fileinode($filename);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @return int
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function filemtime(string $filename): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \filemtime($filename);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @return int
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fileowner(string $filename): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \fileowner($filename);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @return int
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fileperms(string $filename): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \fileperms($filename);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @return 0|positive-int
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function filesize(string $filename): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \filesize($filename);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @return string
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function filetype(string $filename): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \filetype($filename);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @param int-mask $operation
|
||||
* @param 0|1|null $would_block
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function flock($stream, int $operation, ?int &$would_block = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \flock($stream, $operation, $would_block);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param string $mode
|
||||
* @param bool $use_include_path
|
||||
* @param null|resource $context
|
||||
* @return resource
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fopen(string $filename, string $mode, bool $use_include_path = false, $context = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($context !== null) {
|
||||
$safeResult = \fopen($filename, $mode, $use_include_path, $context);
|
||||
} else {
|
||||
$safeResult = \fopen($filename, $mode, $use_include_path);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @param positive-int $length
|
||||
* @return string
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fread($stream, int $length): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \fread($stream, $length);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @return array
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fstat($stream): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \fstat($stream);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fsync($stream): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \fsync($stream);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @return int
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function ftell($stream): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ftell($stream);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @param 0|positive-int $size
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function ftruncate($stream, int $size): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ftruncate($stream, $size);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @param string $data
|
||||
* @param 0|null|positive-int $length
|
||||
* @return 0|positive-int
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fwrite($stream, string $data, ?int $length = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($length !== null) {
|
||||
$safeResult = \fwrite($stream, $data, $length);
|
||||
} else {
|
||||
$safeResult = \fwrite($stream, $data);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $pattern
|
||||
* @param int $flags
|
||||
* @return list
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function glob(string $pattern, int $flags = 0): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \glob($pattern, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param int|string $group
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function lchgrp(string $filename, $group): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \lchgrp($filename, $group);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param int|string $user
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function lchown(string $filename, $user): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \lchown($filename, $user);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $target
|
||||
* @param string $link
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function link(string $target, string $link): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \link($target, $link);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @return array
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function lstat(string $filename): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \lstat($filename);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $directory
|
||||
* @param int $permissions
|
||||
* @param bool $recursive
|
||||
* @param null|resource $context
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function mkdir(string $directory, int $permissions = 0777, bool $recursive = false, $context = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($context !== null) {
|
||||
$safeResult = \mkdir($directory, $permissions, $recursive, $context);
|
||||
} else {
|
||||
$safeResult = \mkdir($directory, $permissions, $recursive);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param bool $process_sections
|
||||
* @param int $scanner_mode
|
||||
* @return array
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function parse_ini_file(string $filename, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \parse_ini_file($filename, $process_sections, $scanner_mode);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $ini_string
|
||||
* @param bool $process_sections
|
||||
* @param int $scanner_mode
|
||||
* @return array
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function parse_ini_string(string $ini_string, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \parse_ini_string($ini_string, $process_sections, $scanner_mode);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $handle
|
||||
* @return int
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function pclose($handle): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \pclose($handle);
|
||||
if ($safeResult === -1) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $command
|
||||
* @param string $mode
|
||||
* @return resource
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function popen(string $command, string $mode)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \popen($command, $mode);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param bool $use_include_path
|
||||
* @param null|resource $context
|
||||
* @return 0|positive-int
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function readfile(string $filename, bool $use_include_path = false, $context = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($context !== null) {
|
||||
$safeResult = \readfile($filename, $use_include_path, $context);
|
||||
} else {
|
||||
$safeResult = \readfile($filename, $use_include_path);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @return string
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function readlink(string $path): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \readlink($path);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @return non-empty-string
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function realpath(string $path): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \realpath($path);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $from
|
||||
* @param string $to
|
||||
* @param null|resource $context
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function rename(string $from, string $to, $context = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($context !== null) {
|
||||
$safeResult = \rename($from, $to, $context);
|
||||
} else {
|
||||
$safeResult = \rename($from, $to);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function rewind($stream): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \rewind($stream);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $directory
|
||||
* @param null|resource $context
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function rmdir(string $directory, $context = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($context !== null) {
|
||||
$safeResult = \rmdir($directory, $context);
|
||||
} else {
|
||||
$safeResult = \rmdir($directory);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $target
|
||||
* @param string $link
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function symlink(string $target, string $link): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \symlink($target, $link);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $directory
|
||||
* @param string $prefix
|
||||
* @return non-falsy-string
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function tempnam(string $directory, string $prefix): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \tempnam($directory, $prefix);
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return resource
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function tmpfile()
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \tmpfile();
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param int|null $mtime
|
||||
* @param int|null $atime
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function touch(string $filename, ?int $mtime = null, ?int $atime = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($atime !== null) {
|
||||
$safeResult = \touch($filename, $mtime, $atime);
|
||||
} elseif ($mtime !== null) {
|
||||
$safeResult = \touch($filename, $mtime);
|
||||
} else {
|
||||
$safeResult = \touch($filename);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param null|resource $context
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function unlink(string $filename, $context = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($context !== null) {
|
||||
$safeResult = \unlink($filename, $context);
|
||||
} else {
|
||||
$safeResult = \unlink($filename);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
34
vendor/thecodingmachine/safe/generated/8.2/fpm.php
vendored
Normal file
34
vendor/thecodingmachine/safe/generated/8.2/fpm.php
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\FpmException;
|
||||
|
||||
/**
|
||||
* @throws FpmException
|
||||
*
|
||||
*/
|
||||
function fastcgi_finish_request(): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \fastcgi_finish_request();
|
||||
if ($safeResult === false) {
|
||||
throw FpmException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array{pool: string, process-manager: 'dynamic'|'ondemand'|'static', start-time: int, start-since: int, accepted-conn: int, listen-queue: int, max-listen-queue: int, listen-queue-len: int, idle-processes: int, active-processes: int, total-processes: int, max-active-processes: int, max-children-reached: 0|1, slow-requests: int, procs: array}
|
||||
* @throws FpmException
|
||||
*
|
||||
*/
|
||||
function fpm_get_status(): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \fpm_get_status();
|
||||
if ($safeResult === false) {
|
||||
throw FpmException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
1138
vendor/thecodingmachine/safe/generated/8.2/functionsList.php
vendored
Normal file
1138
vendor/thecodingmachine/safe/generated/8.2/functionsList.php
vendored
Normal file
File diff suppressed because it is too large
Load Diff
15
vendor/thecodingmachine/safe/generated/8.2/gmp.php
vendored
Normal file
15
vendor/thecodingmachine/safe/generated/8.2/gmp.php
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\GmpException;
|
||||
|
||||
/**
|
||||
* @param \GMP|int|string $seed
|
||||
*
|
||||
*/
|
||||
function gmp_random_seed($seed): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gmp_random_seed($seed);
|
||||
}
|
||||
152
vendor/thecodingmachine/safe/generated/8.2/gnupg.php
vendored
Normal file
152
vendor/thecodingmachine/safe/generated/8.2/gnupg.php
vendored
Normal file
@@ -0,0 +1,152 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\GnupgException;
|
||||
|
||||
/**
|
||||
* @param resource $identifier
|
||||
* @param string $fingerprint
|
||||
* @param string $passphrase
|
||||
* @throws GnupgException
|
||||
*
|
||||
*/
|
||||
function gnupg_adddecryptkey($identifier, string $fingerprint, string $passphrase): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gnupg_adddecryptkey($identifier, $fingerprint, $passphrase);
|
||||
if ($safeResult === false) {
|
||||
throw GnupgException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $identifier
|
||||
* @param string $fingerprint
|
||||
* @throws GnupgException
|
||||
*
|
||||
*/
|
||||
function gnupg_addencryptkey($identifier, string $fingerprint): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gnupg_addencryptkey($identifier, $fingerprint);
|
||||
if ($safeResult === false) {
|
||||
throw GnupgException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $identifier
|
||||
* @param string $fingerprint
|
||||
* @param string $passphrase
|
||||
* @throws GnupgException
|
||||
*
|
||||
*/
|
||||
function gnupg_addsignkey($identifier, string $fingerprint, ?string $passphrase = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($passphrase !== null) {
|
||||
$safeResult = \gnupg_addsignkey($identifier, $fingerprint, $passphrase);
|
||||
} else {
|
||||
$safeResult = \gnupg_addsignkey($identifier, $fingerprint);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw GnupgException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $identifier
|
||||
* @throws GnupgException
|
||||
*
|
||||
*/
|
||||
function gnupg_cleardecryptkeys($identifier): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gnupg_cleardecryptkeys($identifier);
|
||||
if ($safeResult === false) {
|
||||
throw GnupgException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $identifier
|
||||
* @throws GnupgException
|
||||
*
|
||||
*/
|
||||
function gnupg_clearencryptkeys($identifier): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gnupg_clearencryptkeys($identifier);
|
||||
if ($safeResult === false) {
|
||||
throw GnupgException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $identifier
|
||||
* @throws GnupgException
|
||||
*
|
||||
*/
|
||||
function gnupg_clearsignkeys($identifier): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gnupg_clearsignkeys($identifier);
|
||||
if ($safeResult === false) {
|
||||
throw GnupgException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $identifier
|
||||
* @param string $key
|
||||
* @param bool $allow_secret
|
||||
* @throws GnupgException
|
||||
*
|
||||
*/
|
||||
function gnupg_deletekey($identifier, string $key, bool $allow_secret): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gnupg_deletekey($identifier, $key, $allow_secret);
|
||||
if ($safeResult === false) {
|
||||
throw GnupgException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $identifier
|
||||
* @param int $armor
|
||||
* @throws GnupgException
|
||||
*
|
||||
*/
|
||||
function gnupg_setarmor($identifier, int $armor): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gnupg_setarmor($identifier, $armor);
|
||||
if ($safeResult === false) {
|
||||
throw GnupgException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $identifier
|
||||
* @param int $signmode
|
||||
* @throws GnupgException
|
||||
*
|
||||
*/
|
||||
function gnupg_setsignmode($identifier, int $signmode): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gnupg_setsignmode($identifier, $signmode);
|
||||
if ($safeResult === false) {
|
||||
throw GnupgException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
42
vendor/thecodingmachine/safe/generated/8.2/hash.php
vendored
Normal file
42
vendor/thecodingmachine/safe/generated/8.2/hash.php
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\HashException;
|
||||
|
||||
/**
|
||||
* @param string $algo
|
||||
* @param string $key
|
||||
* @param int $length
|
||||
* @param string $info
|
||||
* @param string $salt
|
||||
* @return false|non-falsy-string
|
||||
*
|
||||
*/
|
||||
function hash_hkdf(string $algo, string $key, int $length = 0, string $info = "", string $salt = "")
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \hash_hkdf($algo, $key, $length, $info, $salt);
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \HashContext $context
|
||||
* @param string $filename
|
||||
* @param \HashContext|null $stream_context
|
||||
* @throws HashException
|
||||
*
|
||||
*/
|
||||
function hash_update_file(\HashContext $context, string $filename, ?\HashContext $stream_context = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($stream_context !== null) {
|
||||
$safeResult = \hash_update_file($context, $filename, $stream_context);
|
||||
} else {
|
||||
$safeResult = \hash_update_file($context, $filename);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw HashException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
1692
vendor/thecodingmachine/safe/generated/8.2/image.php
vendored
Normal file
1692
vendor/thecodingmachine/safe/generated/8.2/image.php
vendored
Normal file
File diff suppressed because it is too large
Load Diff
895
vendor/thecodingmachine/safe/generated/8.2/imap.php
vendored
Normal file
895
vendor/thecodingmachine/safe/generated/8.2/imap.php
vendored
Normal file
@@ -0,0 +1,895 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\ImapException;
|
||||
|
||||
/**
|
||||
* @param string $string
|
||||
* @return string
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_8bit(string $string): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_8bit($string);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $folder
|
||||
* @param string $message
|
||||
* @param null|string $options
|
||||
* @param null|string $internal_date
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_append(\IMAP\Connection $imap, string $folder, string $message, ?string $options = null, ?string $internal_date = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($internal_date !== null) {
|
||||
$safeResult = \imap_append($imap, $folder, $message, $options, $internal_date);
|
||||
} elseif ($options !== null) {
|
||||
$safeResult = \imap_append($imap, $folder, $message, $options);
|
||||
} else {
|
||||
$safeResult = \imap_append($imap, $folder, $message);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $string
|
||||
* @return string
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_base64(string $string): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_base64($string);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $string
|
||||
* @return string
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_binary(string $string): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_binary($string);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param int $message_num
|
||||
* @param int $flags
|
||||
* @return string
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_body(\IMAP\Connection $imap, int $message_num, int $flags = 0): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_body($imap, $message_num, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param int $message_num
|
||||
* @param string $section
|
||||
* @return \stdClass
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_bodystruct(\IMAP\Connection $imap, int $message_num, string $section): \stdClass
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_bodystruct($imap, $message_num, $section);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @return \stdClass
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_check(\IMAP\Connection $imap): \stdClass
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_check($imap);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $sequence
|
||||
* @param string $flag
|
||||
* @param int $options
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_clearflag_full(\IMAP\Connection $imap, string $sequence, string $flag, int $options = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_clearflag_full($imap, $sequence, $flag, $options);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param int $flags
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_close(\IMAP\Connection $imap, int $flags = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_close($imap, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $mailbox
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_createmailbox(\IMAP\Connection $imap, string $mailbox): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_createmailbox($imap, $mailbox);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $mailbox
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_deletemailbox(\IMAP\Connection $imap, string $mailbox): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_deletemailbox($imap, $mailbox);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $sequence
|
||||
* @param int $flags
|
||||
* @return array
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_fetch_overview(\IMAP\Connection $imap, string $sequence, int $flags = 0): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_fetch_overview($imap, $sequence, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param int $message_num
|
||||
* @param string $section
|
||||
* @param int $flags
|
||||
* @return string
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_fetchbody(\IMAP\Connection $imap, int $message_num, string $section, int $flags = 0): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_fetchbody($imap, $message_num, $section, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param int $message_num
|
||||
* @param int $flags
|
||||
* @return string
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_fetchheader(\IMAP\Connection $imap, int $message_num, int $flags = 0): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_fetchheader($imap, $message_num, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param int $message_num
|
||||
* @param string $section
|
||||
* @param int $flags
|
||||
* @return string
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_fetchmime(\IMAP\Connection $imap, int $message_num, string $section, int $flags = 0): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_fetchmime($imap, $message_num, $section, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param int $message_num
|
||||
* @param int $flags
|
||||
* @return \stdClass
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_fetchstructure(\IMAP\Connection $imap, int $message_num, int $flags = 0): \stdClass
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_fetchstructure($imap, $message_num, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param int $flags
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_gc(\IMAP\Connection $imap, int $flags): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_gc($imap, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $mailbox
|
||||
* @return array
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_getacl(\IMAP\Connection $imap, string $mailbox): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_getacl($imap, $mailbox);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $reference
|
||||
* @param string $pattern
|
||||
* @return array
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_getmailboxes(\IMAP\Connection $imap, string $reference, string $pattern): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_getmailboxes($imap, $reference, $pattern);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $reference
|
||||
* @param string $pattern
|
||||
* @return array
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_getsubscribed(\IMAP\Connection $imap, string $reference, string $pattern): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_getsubscribed($imap, $reference, $pattern);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param int $message_num
|
||||
* @param int $from_length
|
||||
* @param int $subject_length
|
||||
* @return \stdClass
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_headerinfo(\IMAP\Connection $imap, int $message_num, int $from_length = 0, int $subject_length = 0): \stdClass
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_headerinfo($imap, $message_num, $from_length, $subject_length);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @return array
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_headers(\IMAP\Connection $imap): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_headers($imap);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $reference
|
||||
* @param string $pattern
|
||||
* @param string $content
|
||||
* @return array
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_listscan(\IMAP\Connection $imap, string $reference, string $pattern, string $content): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_listscan($imap, $reference, $pattern, $content);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $reference
|
||||
* @param string $pattern
|
||||
* @return array
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_lsub(\IMAP\Connection $imap, string $reference, string $pattern): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_lsub($imap, $reference, $pattern);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $envelope
|
||||
* @param array $bodies
|
||||
* @return string
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_mail_compose(array $envelope, array $bodies): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_mail_compose($envelope, $bodies);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $message_nums
|
||||
* @param string $mailbox
|
||||
* @param int $flags
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_mail_copy(\IMAP\Connection $imap, string $message_nums, string $mailbox, int $flags = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_mail_copy($imap, $message_nums, $mailbox, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $message_nums
|
||||
* @param string $mailbox
|
||||
* @param int $flags
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_mail_move(\IMAP\Connection $imap, string $message_nums, string $mailbox, int $flags = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_mail_move($imap, $message_nums, $mailbox, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $to
|
||||
* @param string $subject
|
||||
* @param string $message
|
||||
* @param null|string $additional_headers
|
||||
* @param null|string $cc
|
||||
* @param null|string $bcc
|
||||
* @param null|string $return_path
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_mail(string $to, string $subject, string $message, ?string $additional_headers = null, ?string $cc = null, ?string $bcc = null, ?string $return_path = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($return_path !== null) {
|
||||
$safeResult = \imap_mail($to, $subject, $message, $additional_headers, $cc, $bcc, $return_path);
|
||||
} elseif ($bcc !== null) {
|
||||
$safeResult = \imap_mail($to, $subject, $message, $additional_headers, $cc, $bcc);
|
||||
} elseif ($cc !== null) {
|
||||
$safeResult = \imap_mail($to, $subject, $message, $additional_headers, $cc);
|
||||
} elseif ($additional_headers !== null) {
|
||||
$safeResult = \imap_mail($to, $subject, $message, $additional_headers);
|
||||
} else {
|
||||
$safeResult = \imap_mail($to, $subject, $message);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @return \stdClass
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_mailboxmsginfo(\IMAP\Connection $imap): \stdClass
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_mailboxmsginfo($imap);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $string
|
||||
* @return array
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_mime_header_decode(string $string): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_mime_header_decode($string);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $string
|
||||
* @return string
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_mutf7_to_utf8(string $string): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_mutf7_to_utf8($string);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @return int
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_num_msg(\IMAP\Connection $imap): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_num_msg($imap);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $mailbox
|
||||
* @param string $user
|
||||
* @param string $password
|
||||
* @param int $flags
|
||||
* @param int $retries
|
||||
* @param array $options
|
||||
* @return \IMAP\Connection
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_open(string $mailbox, string $user, string $password, int $flags = 0, int $retries = 0, array $options = []): \IMAP\Connection
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_open($mailbox, $user, $password, $flags, $retries, $options);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $string
|
||||
* @return string
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_qprint(string $string): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_qprint($string);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $from
|
||||
* @param string $to
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_renamemailbox(\IMAP\Connection $imap, string $from, string $to): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_renamemailbox($imap, $from, $to);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|string $mailbox
|
||||
* @param null|string $hostname
|
||||
* @param null|string $personal
|
||||
* @return string
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_rfc822_write_address(?string $mailbox, ?string $hostname, ?string $personal): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_rfc822_write_address($mailbox, $hostname, $personal);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param int|resource|string $file
|
||||
* @param int $message_num
|
||||
* @param string $section
|
||||
* @param int $flags
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_savebody(\IMAP\Connection $imap, $file, int $message_num, string $section = "", int $flags = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_savebody($imap, $file, $message_num, $section, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $quota_root
|
||||
* @param int $mailbox_size
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_set_quota(\IMAP\Connection $imap, string $quota_root, int $mailbox_size): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_set_quota($imap, $quota_root, $mailbox_size);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $mailbox
|
||||
* @param string $user_id
|
||||
* @param string $rights
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_setacl(\IMAP\Connection $imap, string $mailbox, string $user_id, string $rights): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_setacl($imap, $mailbox, $user_id, $rights);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $sequence
|
||||
* @param string $flag
|
||||
* @param int $options
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_setflag_full(\IMAP\Connection $imap, string $sequence, string $flag, int $options = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_setflag_full($imap, $sequence, $flag, $options);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param int $criteria
|
||||
* @param int $reverse
|
||||
* @param int $flags
|
||||
* @param null|string $search_criteria
|
||||
* @param null|string $charset
|
||||
* @return array
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_sort(\IMAP\Connection $imap, int $criteria, int $reverse, int $flags = 0, ?string $search_criteria = null, ?string $charset = null): array
|
||||
{
|
||||
error_clear_last();
|
||||
if ($charset !== null) {
|
||||
$safeResult = \imap_sort($imap, $criteria, $reverse, $flags, $search_criteria, $charset);
|
||||
} elseif ($search_criteria !== null) {
|
||||
$safeResult = \imap_sort($imap, $criteria, $reverse, $flags, $search_criteria);
|
||||
} else {
|
||||
$safeResult = \imap_sort($imap, $criteria, $reverse, $flags);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $mailbox
|
||||
* @param int $flags
|
||||
* @return \stdClass
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_status(\IMAP\Connection $imap, string $mailbox, int $flags): \stdClass
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_status($imap, $mailbox, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $mailbox
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_subscribe(\IMAP\Connection $imap, string $mailbox): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_subscribe($imap, $mailbox);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param int $flags
|
||||
* @return array
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_thread(\IMAP\Connection $imap, int $flags = SE_FREE): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_thread($imap, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $timeout_type
|
||||
* @param int $timeout
|
||||
* @return mixed
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_timeout(int $timeout_type, int $timeout = -1)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_timeout($timeout_type, $timeout);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $message_nums
|
||||
* @param int $flags
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_undelete(\IMAP\Connection $imap, string $message_nums, int $flags = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_undelete($imap, $message_nums, $flags);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \IMAP\Connection $imap
|
||||
* @param string $mailbox
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_unsubscribe(\IMAP\Connection $imap, string $mailbox): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_unsubscribe($imap, $mailbox);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $string
|
||||
* @return string
|
||||
* @throws ImapException
|
||||
*
|
||||
*/
|
||||
function imap_utf8_to_mutf7(string $string): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \imap_utf8_to_mutf7($string);
|
||||
if ($safeResult === false) {
|
||||
throw ImapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
670
vendor/thecodingmachine/safe/generated/8.2/ldap.php
vendored
Normal file
670
vendor/thecodingmachine/safe/generated/8.2/ldap.php
vendored
Normal file
@@ -0,0 +1,670 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\LdapException;
|
||||
|
||||
/**
|
||||
* @param string $value
|
||||
* @return string
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_8859_to_t61(string $value): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_8859_to_t61($value);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param string $dn
|
||||
* @param array $entry
|
||||
* @param array|null $controls
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_add(\LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($controls !== null) {
|
||||
$safeResult = \ldap_add($ldap, $dn, $entry, $controls);
|
||||
} else {
|
||||
$safeResult = \ldap_add($ldap, $dn, $entry);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param null|string $dn
|
||||
* @param null|string $password
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_bind(\LDAP\Connection $ldap, ?string $dn = null, ?string $password = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($password !== null) {
|
||||
$safeResult = \ldap_bind($ldap, $dn, $password);
|
||||
} elseif ($dn !== null) {
|
||||
$safeResult = \ldap_bind($ldap, $dn);
|
||||
} else {
|
||||
$safeResult = \ldap_bind($ldap);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param string $dn
|
||||
* @param string $attribute
|
||||
* @param string $value
|
||||
* @param array|null $controls
|
||||
* @return bool
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_compare(\LDAP\Connection $ldap, string $dn, string $attribute, string $value, ?array $controls = null): bool
|
||||
{
|
||||
error_clear_last();
|
||||
if ($controls !== null) {
|
||||
$safeResult = \ldap_compare($ldap, $dn, $attribute, $value, $controls);
|
||||
} else {
|
||||
$safeResult = \ldap_compare($ldap, $dn, $attribute, $value);
|
||||
}
|
||||
if ($safeResult === -1) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $link
|
||||
* @param resource $result
|
||||
* @param null|string $cookie
|
||||
* @param int|null $estimated
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_control_paged_result_response($link, $result, ?string &$cookie = null, ?int &$estimated = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_control_paged_result_response($link, $result, $cookie, $estimated);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $link
|
||||
* @param int $pagesize
|
||||
* @param bool $iscritical
|
||||
* @param string $cookie
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_control_paged_result($link, int $pagesize, bool $iscritical = false, string $cookie = ""): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_control_paged_result($link, $pagesize, $iscritical, $cookie);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param \LDAP\Result $result
|
||||
* @return int
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_count_entries(\LDAP\Connection $ldap, \LDAP\Result $result): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_count_entries($ldap, $result);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param string $dn
|
||||
* @param array|null $controls
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_delete(\LDAP\Connection $ldap, string $dn, ?array $controls = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($controls !== null) {
|
||||
$safeResult = \ldap_delete($ldap, $dn, $controls);
|
||||
} else {
|
||||
$safeResult = \ldap_delete($ldap, $dn);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $dn
|
||||
* @return string
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_dn2ufn(string $dn): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_dn2ufn($dn);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param string $user
|
||||
* @param string $old_password
|
||||
* @param string $new_password
|
||||
* @param array|null $controls
|
||||
* @return bool|string
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_exop_passwd(\LDAP\Connection $ldap, string $user = "", string $old_password = "", string $new_password = "", ?array &$controls = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_exop_passwd($ldap, $user, $old_password, $new_password, $controls);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @return bool|string
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_exop_whoami(\LDAP\Connection $ldap)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_exop_whoami($ldap);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param string $request_oid
|
||||
* @param null|string $request_data
|
||||
* @param array|null $controls
|
||||
* @param null|string $response_data
|
||||
* @param null|string $response_oid
|
||||
* @return bool|resource
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_exop(\LDAP\Connection $ldap, string $request_oid, ?string $request_data = null, ?array $controls = null, ?string &$response_data = null, ?string &$response_oid = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($response_oid !== null) {
|
||||
$safeResult = \ldap_exop($ldap, $request_oid, $request_data, $controls, $response_data, $response_oid);
|
||||
} elseif ($response_data !== null) {
|
||||
$safeResult = \ldap_exop($ldap, $request_oid, $request_data, $controls, $response_data);
|
||||
} elseif ($controls !== null) {
|
||||
$safeResult = \ldap_exop($ldap, $request_oid, $request_data, $controls);
|
||||
} elseif ($request_data !== null) {
|
||||
$safeResult = \ldap_exop($ldap, $request_oid, $request_data);
|
||||
} else {
|
||||
$safeResult = \ldap_exop($ldap, $request_oid);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $dn
|
||||
* @param int $with_attrib
|
||||
* @return array
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_explode_dn(string $dn, int $with_attrib): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_explode_dn($dn, $with_attrib);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param \LDAP\ResultEntry $entry
|
||||
* @return string
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_first_attribute(\LDAP\Connection $ldap, \LDAP\ResultEntry $entry): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_first_attribute($ldap, $entry);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param \LDAP\Result $result
|
||||
* @return \LDAP\ResultEntry
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_first_entry(\LDAP\Connection $ldap, \LDAP\Result $result): \LDAP\ResultEntry
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_first_entry($ldap, $result);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Result $result
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_free_result(\LDAP\Result $result): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_free_result($result);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param \LDAP\ResultEntry $entry
|
||||
* @return array
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_get_attributes(\LDAP\Connection $ldap, \LDAP\ResultEntry $entry): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_get_attributes($ldap, $entry);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param \LDAP\ResultEntry $entry
|
||||
* @return string
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_get_dn(\LDAP\Connection $ldap, \LDAP\ResultEntry $entry): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_get_dn($ldap, $entry);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param \LDAP\Result $result
|
||||
* @return array
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_get_entries(\LDAP\Connection $ldap, \LDAP\Result $result): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_get_entries($ldap, $result);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param int $option
|
||||
* @param mixed $value
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_get_option(\LDAP\Connection $ldap, int $option, &$value = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_get_option($ldap, $option, $value);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param \LDAP\ResultEntry $entry
|
||||
* @param string $attribute
|
||||
* @return array
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_get_values_len(\LDAP\Connection $ldap, \LDAP\ResultEntry $entry, string $attribute): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_get_values_len($ldap, $entry, $attribute);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param \LDAP\ResultEntry $entry
|
||||
* @param string $attribute
|
||||
* @return array
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_get_values(\LDAP\Connection $ldap, \LDAP\ResultEntry $entry, string $attribute): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_get_values($ldap, $entry, $attribute);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param string $dn
|
||||
* @param array $entry
|
||||
* @param array|null $controls
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_mod_add(\LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($controls !== null) {
|
||||
$safeResult = \ldap_mod_add($ldap, $dn, $entry, $controls);
|
||||
} else {
|
||||
$safeResult = \ldap_mod_add($ldap, $dn, $entry);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param string $dn
|
||||
* @param array $entry
|
||||
* @param array|null $controls
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_mod_del(\LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($controls !== null) {
|
||||
$safeResult = \ldap_mod_del($ldap, $dn, $entry, $controls);
|
||||
} else {
|
||||
$safeResult = \ldap_mod_del($ldap, $dn, $entry);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param string $dn
|
||||
* @param array $entry
|
||||
* @param array|null $controls
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_mod_replace(\LDAP\Connection $ldap, string $dn, array $entry, ?array $controls = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($controls !== null) {
|
||||
$safeResult = \ldap_mod_replace($ldap, $dn, $entry, $controls);
|
||||
} else {
|
||||
$safeResult = \ldap_mod_replace($ldap, $dn, $entry);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param string $dn
|
||||
* @param array $modifications_info
|
||||
* @param array|null $controls
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_modify_batch(\LDAP\Connection $ldap, string $dn, array $modifications_info, ?array $controls = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($controls !== null) {
|
||||
$safeResult = \ldap_modify_batch($ldap, $dn, $modifications_info, $controls);
|
||||
} else {
|
||||
$safeResult = \ldap_modify_batch($ldap, $dn, $modifications_info);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param \LDAP\ResultEntry $entry
|
||||
* @return string
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_next_attribute(\LDAP\Connection $ldap, \LDAP\ResultEntry $entry): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_next_attribute($ldap, $entry);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param \LDAP\Result $result
|
||||
* @param null|string $response_data
|
||||
* @param null|string $response_oid
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_parse_exop(\LDAP\Connection $ldap, \LDAP\Result $result, ?string &$response_data = null, ?string &$response_oid = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_parse_exop($ldap, $result, $response_data, $response_oid);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param \LDAP\Result $result
|
||||
* @param int|null $error_code
|
||||
* @param null|string $matched_dn
|
||||
* @param null|string $error_message
|
||||
* @param array|null $referrals
|
||||
* @param array|null $controls
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_parse_result(\LDAP\Connection $ldap, \LDAP\Result $result, ?int &$error_code, ?string &$matched_dn = null, ?string &$error_message = null, ?array &$referrals = null, ?array &$controls = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_parse_result($ldap, $result, $error_code, $matched_dn, $error_message, $referrals, $controls);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param string $dn
|
||||
* @param string $new_rdn
|
||||
* @param string $new_parent
|
||||
* @param bool $delete_old_rdn
|
||||
* @param array|null $controls
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_rename(\LDAP\Connection $ldap, string $dn, string $new_rdn, string $new_parent, bool $delete_old_rdn, ?array $controls = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($controls !== null) {
|
||||
$safeResult = \ldap_rename($ldap, $dn, $new_rdn, $new_parent, $delete_old_rdn, $controls);
|
||||
} else {
|
||||
$safeResult = \ldap_rename($ldap, $dn, $new_rdn, $new_parent, $delete_old_rdn);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @param null|string $dn
|
||||
* @param null|string $password
|
||||
* @param null|string $mech
|
||||
* @param null|string $realm
|
||||
* @param null|string $authc_id
|
||||
* @param null|string $authz_id
|
||||
* @param null|string $props
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_sasl_bind(\LDAP\Connection $ldap, ?string $dn = null, ?string $password = null, ?string $mech = null, ?string $realm = null, ?string $authc_id = null, ?string $authz_id = null, ?string $props = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($props !== null) {
|
||||
$safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm, $authc_id, $authz_id, $props);
|
||||
} elseif ($authz_id !== null) {
|
||||
$safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm, $authc_id, $authz_id);
|
||||
} elseif ($authc_id !== null) {
|
||||
$safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm, $authc_id);
|
||||
} elseif ($realm !== null) {
|
||||
$safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech, $realm);
|
||||
} elseif ($mech !== null) {
|
||||
$safeResult = \ldap_sasl_bind($ldap, $dn, $password, $mech);
|
||||
} elseif ($password !== null) {
|
||||
$safeResult = \ldap_sasl_bind($ldap, $dn, $password);
|
||||
} elseif ($dn !== null) {
|
||||
$safeResult = \ldap_sasl_bind($ldap, $dn);
|
||||
} else {
|
||||
$safeResult = \ldap_sasl_bind($ldap);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param null|resource $ldap
|
||||
* @param int $option
|
||||
* @param mixed $value
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_set_option($ldap, int $option, $value): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_set_option($ldap, $option, $value);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \LDAP\Connection $ldap
|
||||
* @throws LdapException
|
||||
*
|
||||
*/
|
||||
function ldap_unbind(\LDAP\Connection $ldap): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \ldap_unbind($ldap);
|
||||
if ($safeResult === false) {
|
||||
throw LdapException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
247
vendor/thecodingmachine/safe/generated/8.2/misc.php
vendored
Normal file
247
vendor/thecodingmachine/safe/generated/8.2/misc.php
vendored
Normal file
@@ -0,0 +1,247 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\MiscException;
|
||||
|
||||
/**
|
||||
* @param string $constant_name
|
||||
* @param mixed $value
|
||||
* @param bool $case_insensitive
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function define(string $constant_name, $value, bool $case_insensitive = false): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \define($constant_name, $value, $case_insensitive);
|
||||
if ($safeResult === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param bool $return
|
||||
* @return bool|string
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function highlight_file(string $filename, bool $return = false)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \highlight_file($filename, $return);
|
||||
if ($safeResult === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $string
|
||||
* @param bool $return
|
||||
* @return bool|string
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function highlight_string(string $string, bool $return = false)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \highlight_string($string, $return);
|
||||
if ($safeResult === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param bool $as_number
|
||||
* @return array{0:int,1:int}|float|int
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function hrtime(bool $as_number = false)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \hrtime($as_number);
|
||||
if ($safeResult === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $format
|
||||
* @param mixed $values
|
||||
* @return string
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function pack(string $format, ...$values): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($values !== []) {
|
||||
$safeResult = \pack($format, ...$values);
|
||||
} else {
|
||||
$safeResult = \pack($format);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int|string $in_codepage
|
||||
* @param int|string $out_codepage
|
||||
* @param string $subject
|
||||
* @return string
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function sapi_windows_cp_conv($in_codepage, $out_codepage, string $subject): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sapi_windows_cp_conv($in_codepage, $out_codepage, $subject);
|
||||
if ($safeResult === null) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $codepage
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function sapi_windows_cp_set(int $codepage): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sapi_windows_cp_set($codepage);
|
||||
if ($safeResult === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $event
|
||||
* @param int $pid
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function sapi_windows_generate_ctrl_event(int $event, int $pid = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sapi_windows_generate_ctrl_event($event, $pid);
|
||||
if ($safeResult === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param callable|null $handler
|
||||
* @param bool $add
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function sapi_windows_set_ctrl_handler(?callable $handler, bool $add = true): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sapi_windows_set_ctrl_handler($handler, $add);
|
||||
if ($safeResult === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
* @param bool|null $enable
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function sapi_windows_vt100_support($stream, ?bool $enable = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($enable !== null) {
|
||||
$safeResult = \sapi_windows_vt100_support($stream, $enable);
|
||||
} else {
|
||||
$safeResult = \sapi_windows_vt100_support($stream);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $seconds
|
||||
* @return false|int
|
||||
*
|
||||
*/
|
||||
function sleep(int $seconds)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \sleep($seconds);
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $seconds
|
||||
* @param int $nanoseconds
|
||||
* @return array{seconds:0|positive-int,nanoseconds:0|positive-int}|bool
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function time_nanosleep(int $seconds, int $nanoseconds)
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \time_nanosleep($seconds, $nanoseconds);
|
||||
if ($safeResult === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param float $timestamp
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function time_sleep_until(float $timestamp): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \time_sleep_until($timestamp);
|
||||
if ($safeResult === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $format
|
||||
* @param string $string
|
||||
* @param int $offset
|
||||
* @return array
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function unpack(string $format, string $string, int $offset = 0): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \unpack($format, $string, $offset);
|
||||
if ($safeResult === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
16
vendor/thecodingmachine/safe/generated/8.2/mysqli.php
vendored
Normal file
16
vendor/thecodingmachine/safe/generated/8.2/mysqli.php
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\MysqliException;
|
||||
|
||||
/**
|
||||
* @return array|false
|
||||
*
|
||||
*/
|
||||
function mysqli_get_client_stats()
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \mysqli_get_client_stats();
|
||||
return $safeResult;
|
||||
}
|
||||
272
vendor/thecodingmachine/safe/generated/8.2/network.php
vendored
Normal file
272
vendor/thecodingmachine/safe/generated/8.2/network.php
vendored
Normal file
@@ -0,0 +1,272 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\NetworkException;
|
||||
|
||||
/**
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function closelog(): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \closelog();
|
||||
if ($safeResult === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $hostname
|
||||
* @param int $type
|
||||
* @param array|null $authoritative_name_servers
|
||||
* @param array|null $additional_records
|
||||
* @param bool $raw
|
||||
* @return list
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function dns_get_record(string $hostname, int $type = DNS_ANY, ?array &$authoritative_name_servers = null, ?array &$additional_records = null, bool $raw = false): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \dns_get_record($hostname, $type, $authoritative_name_servers, $additional_records, $raw);
|
||||
if ($safeResult === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $hostname
|
||||
* @param int $port
|
||||
* @param int|null $error_code
|
||||
* @param null|string $error_message
|
||||
* @param float|null $timeout
|
||||
* @return resource
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function fsockopen(string $hostname, int $port = -1, ?int &$error_code = null, ?string &$error_message = null, ?float $timeout = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($timeout !== null) {
|
||||
$safeResult = \fsockopen($hostname, $port, $error_code, $error_message, $timeout);
|
||||
} else {
|
||||
$safeResult = \fsockopen($hostname, $port, $error_code, $error_message);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function gethostname(): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \gethostname();
|
||||
if ($safeResult === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $protocol
|
||||
* @return int
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function getprotobyname(string $protocol): int
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \getprotobyname($protocol);
|
||||
if ($safeResult === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $protocol
|
||||
* @return string
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function getprotobynumber(int $protocol): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \getprotobynumber($protocol);
|
||||
if ($safeResult === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $port
|
||||
* @param string $protocol
|
||||
* @return string
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function getservbyport(int $port, string $protocol): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \getservbyport($port, $protocol);
|
||||
if ($safeResult === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param callable $callback
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function header_register_callback(callable $callback): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \header_register_callback($callback);
|
||||
if ($safeResult === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $ip
|
||||
* @return string
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function inet_ntop(string $ip): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \inet_ntop($ip);
|
||||
if ($safeResult === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $ip
|
||||
* @return string
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function inet_pton(string $ip): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \inet_pton($ip);
|
||||
if ($safeResult === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $ip
|
||||
* @return string
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function long2ip(int $ip): string
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \long2ip($ip);
|
||||
if ($safeResult === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function net_get_interfaces(): array
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \net_get_interfaces();
|
||||
if ($safeResult === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $prefix
|
||||
* @param int $flags
|
||||
* @param int $facility
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function openlog(string $prefix, int $flags, int $facility): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \openlog($prefix, $flags, $facility);
|
||||
if ($safeResult === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $hostname
|
||||
* @param int $port
|
||||
* @param int|null $error_code
|
||||
* @param null|string $error_message
|
||||
* @param float|null $timeout
|
||||
* @return resource
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function pfsockopen(string $hostname, int $port = -1, ?int &$error_code = null, ?string &$error_message = null, ?float $timeout = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($timeout !== null) {
|
||||
$safeResult = \pfsockopen($hostname, $port, $error_code, $error_message, $timeout);
|
||||
} else {
|
||||
$safeResult = \pfsockopen($hostname, $port, $error_code, $error_message);
|
||||
}
|
||||
if ($safeResult === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
return $safeResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $priority
|
||||
* @param string $message
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function syslog(int $priority, string $message): void
|
||||
{
|
||||
error_clear_last();
|
||||
$safeResult = \syslog($priority, $message);
|
||||
if ($safeResult === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user