upgrade idiorm to php8.1-patched version (aaronpk/idiorm)
This commit is contained in:
6
vendor/thecodingmachine/safe/README.md
vendored
6
vendor/thecodingmachine/safe/README.md
vendored
@@ -9,8 +9,6 @@
|
||||
Safe PHP
|
||||
========
|
||||
|
||||
**Work in progress**
|
||||
|
||||
A set of core PHP functions rewritten to throw exceptions instead of returning `false` when an error is encountered.
|
||||
|
||||
## The problem
|
||||
@@ -115,7 +113,7 @@ tool that performs instant refactoring of your application.
|
||||
Run
|
||||
|
||||
```bash
|
||||
$ composer require --dev rector/rector:^0.7
|
||||
$ composer require --dev rector/rector
|
||||
```
|
||||
|
||||
to install `rector/rector`.
|
||||
@@ -123,7 +121,7 @@ to install `rector/rector`.
|
||||
Run
|
||||
|
||||
```bash
|
||||
vendor/bin/rector process src/ --config vendor/thecodingmachine/safe/rector-migrate-0.7.php
|
||||
vendor/bin/rector process src/ --config vendor/thecodingmachine/safe/rector-migrate.php
|
||||
```
|
||||
|
||||
to run `rector/rector`.
|
||||
|
||||
39
vendor/thecodingmachine/safe/composer.json
vendored
39
vendor/thecodingmachine/safe/composer.json
vendored
@@ -3,19 +3,24 @@
|
||||
"description": "PHP core functions that throw exceptions instead of returning FALSE on error",
|
||||
"license": "MIT",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Safe\\": [
|
||||
"lib/",
|
||||
"deprecated/",
|
||||
"generated/"
|
||||
]
|
||||
},
|
||||
"classmap": [
|
||||
"lib/DateTime.php",
|
||||
"lib/DateTimeImmutable.php",
|
||||
"lib/Exceptions/",
|
||||
"deprecated/Exceptions/",
|
||||
"generated/Exceptions/"
|
||||
],
|
||||
"files": [
|
||||
"deprecated/apc.php",
|
||||
"deprecated/array.php",
|
||||
"deprecated/datetime.php",
|
||||
"deprecated/libevent.php",
|
||||
"deprecated/password.php",
|
||||
"deprecated/mssql.php",
|
||||
"deprecated/stats.php",
|
||||
"deprecated/strings.php",
|
||||
"lib/special_cases.php",
|
||||
"deprecated/mysqli.php",
|
||||
"generated/apache.php",
|
||||
"generated/apcu.php",
|
||||
"generated/array.php",
|
||||
@@ -36,6 +41,7 @@
|
||||
"generated/fpm.php",
|
||||
"generated/ftp.php",
|
||||
"generated/funchand.php",
|
||||
"generated/gettext.php",
|
||||
"generated/gmp.php",
|
||||
"generated/gnupg.php",
|
||||
"generated/hash.php",
|
||||
@@ -45,7 +51,6 @@
|
||||
"generated/image.php",
|
||||
"generated/imap.php",
|
||||
"generated/info.php",
|
||||
"generated/ingres-ii.php",
|
||||
"generated/inotify.php",
|
||||
"generated/json.php",
|
||||
"generated/ldap.php",
|
||||
@@ -54,20 +59,14 @@
|
||||
"generated/mailparse.php",
|
||||
"generated/mbstring.php",
|
||||
"generated/misc.php",
|
||||
"generated/msql.php",
|
||||
"generated/mysql.php",
|
||||
"generated/mysqli.php",
|
||||
"generated/mysqlndMs.php",
|
||||
"generated/mysqlndQc.php",
|
||||
"generated/network.php",
|
||||
"generated/oci8.php",
|
||||
"generated/opcache.php",
|
||||
"generated/openssl.php",
|
||||
"generated/outcontrol.php",
|
||||
"generated/password.php",
|
||||
"generated/pcntl.php",
|
||||
"generated/pcre.php",
|
||||
"generated/pdf.php",
|
||||
"generated/pgsql.php",
|
||||
"generated/posix.php",
|
||||
"generated/ps.php",
|
||||
@@ -78,7 +77,6 @@
|
||||
"generated/sem.php",
|
||||
"generated/session.php",
|
||||
"generated/shmop.php",
|
||||
"generated/simplexml.php",
|
||||
"generated/sockets.php",
|
||||
"generated/sodium.php",
|
||||
"generated/solr.php",
|
||||
@@ -103,12 +101,13 @@
|
||||
]
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2"
|
||||
"php": "^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/phpstan": "^0.12",
|
||||
"thecodingmachine/phpstan-strict-rules": "^0.12",
|
||||
"squizlabs/php_codesniffer": "^3.2"
|
||||
"phpstan/phpstan": "^1.5",
|
||||
"thecodingmachine/phpstan-strict-rules": "^1.0",
|
||||
"squizlabs/php_codesniffer": "^3.2",
|
||||
"phpunit/phpunit": "^9.5"
|
||||
},
|
||||
"scripts": {
|
||||
"phpstan": "phpstan analyse lib -c phpstan.neon --level=max --no-progress -vvv",
|
||||
@@ -117,7 +116,7 @@
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "0.1-dev"
|
||||
"dev-master": "2.2.x-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Safe\Exceptions;
|
||||
|
||||
/**
|
||||
* @deprecated This exception is deprecated
|
||||
*/
|
||||
class PasswordException extends \ErrorException implements SafeExceptionInterface
|
||||
{
|
||||
public static function createFromPhpError(): self
|
||||
228
vendor/thecodingmachine/safe/deprecated/array.php
vendored
Normal file
228
vendor/thecodingmachine/safe/deprecated/array.php
vendored
Normal file
@@ -0,0 +1,228 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\ArrayException;
|
||||
|
||||
/**
|
||||
* array_flip returns an array in flip
|
||||
* order, i.e. keys from array become values and values
|
||||
* from array become keys.
|
||||
*
|
||||
* Note that the values of array need to be valid
|
||||
* keys, i.e. they need to be either integer or
|
||||
* string. A warning will be emitted if a value has the wrong
|
||||
* type, and the key/value pair in question will not be included
|
||||
* in the result.
|
||||
*
|
||||
* If a value has several occurrences, the latest key will be
|
||||
* used as its value, and all others will be lost.
|
||||
*
|
||||
* @param array $array An array of key/value pairs to be flipped.
|
||||
* @return array Returns the flipped array on success.
|
||||
* @throws ArrayException
|
||||
* @deprecated The Safe version of this function is no longer needed in PHP 8.0+
|
||||
*
|
||||
*/
|
||||
function array_flip(array $array): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \array_flip($array);
|
||||
if ($result === null) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function sorts an array such that array indices maintain their
|
||||
* correlation with the array elements they are associated with.
|
||||
*
|
||||
* This is used mainly when sorting associative arrays where the actual
|
||||
* element order is significant.
|
||||
*
|
||||
* @param array $array The input array.
|
||||
* @param int $sort_flags You may modify the behavior of the sort using the optional parameter
|
||||
* sort_flags, for details see
|
||||
* sort.
|
||||
* @throws ArrayException
|
||||
* @deprecated The Safe version of this function is no longer needed in PHP 8.0+
|
||||
*
|
||||
*/
|
||||
function arsort(array &$array, int $sort_flags = SORT_REGULAR): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \arsort($array, $sort_flags);
|
||||
if ($result === false) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function sorts an array such that array indices maintain
|
||||
* their correlation with the array elements they are associated
|
||||
* with. This is used mainly when sorting associative arrays where
|
||||
* the actual element order is significant.
|
||||
*
|
||||
* @param array $array The input array.
|
||||
* @param int $sort_flags You may modify the behavior of the sort using the optional
|
||||
* parameter sort_flags, for details
|
||||
* see sort.
|
||||
* @throws ArrayException
|
||||
* @deprecated The Safe version of this function is no longer needed in PHP 8.0+
|
||||
*/
|
||||
function asort(array &$array, int $sort_flags = SORT_REGULAR): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \asort($array, $sort_flags);
|
||||
if ($result === false) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sorts an array by key in reverse order, maintaining key to data
|
||||
* correlations. This is useful mainly for associative arrays.
|
||||
*
|
||||
* @param array $array The input array.
|
||||
* @param int $sort_flags You may modify the behavior of the sort using the optional parameter
|
||||
* sort_flags, for details see
|
||||
* sort.
|
||||
* @throws ArrayException
|
||||
* @deprecated The Safe version of this function is no longer needed in PHP 8.0+
|
||||
*
|
||||
*/
|
||||
function krsort(array &$array, int $sort_flags = SORT_REGULAR): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \krsort($array, $sort_flags);
|
||||
if ($result === false) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sorts an array by key, maintaining key to data correlations. This is
|
||||
* useful mainly for associative arrays.
|
||||
*
|
||||
* @param array $array The input array.
|
||||
* @param int $sort_flags You may modify the behavior of the sort using the optional
|
||||
* parameter sort_flags, for details
|
||||
* see sort.
|
||||
* @throws ArrayException
|
||||
* @deprecated The Safe version of this function is no longer needed in PHP 8.0+
|
||||
*
|
||||
*/
|
||||
function ksort(array &$array, int $sort_flags = SORT_REGULAR): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ksort($array, $sort_flags);
|
||||
if ($result === false) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function sorts an array. Elements will be arranged from
|
||||
* lowest to highest when this function has completed.
|
||||
*
|
||||
* @param array $array The input array.
|
||||
* @param int $sort_flags The optional second parameter sort_flags
|
||||
* may be used to modify the sorting behavior using these values:
|
||||
*
|
||||
* Sorting type flags:
|
||||
*
|
||||
*
|
||||
* SORT_REGULAR - compare items normally;
|
||||
* the details are described in the comparison operators section
|
||||
*
|
||||
*
|
||||
* SORT_NUMERIC - compare items numerically
|
||||
*
|
||||
*
|
||||
* SORT_STRING - compare items as strings
|
||||
*
|
||||
*
|
||||
*
|
||||
* SORT_LOCALE_STRING - compare items as
|
||||
* strings, based on the current locale. It uses the locale,
|
||||
* which can be changed using setlocale
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* SORT_NATURAL - compare items as strings
|
||||
* using "natural ordering" like natsort
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* SORT_FLAG_CASE - can be combined
|
||||
* (bitwise OR) with
|
||||
* SORT_STRING or
|
||||
* SORT_NATURAL to sort strings case-insensitively
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ArrayException
|
||||
* @deprecated The Safe version of this function is no longer needed in PHP 8.0+
|
||||
*/
|
||||
function sort(array &$array, int $sort_flags = SORT_REGULAR): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \sort($array, $sort_flags);
|
||||
if ($result === false) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will sort an array by its values using a user-supplied
|
||||
* comparison function. If the array you wish to sort needs to be sorted by
|
||||
* some non-trivial criteria, you should use this function.
|
||||
*
|
||||
* @param array $array The input array.
|
||||
* @param callable $value_compare_func The comparison function must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
|
||||
* Note that before PHP 7.0.0 this integer had to be in the range from -2147483648 to 2147483647.
|
||||
*
|
||||
* Returning non-integer values from the comparison
|
||||
* function, such as float, will result in an internal cast to
|
||||
* integer of the callback's return value. So values such as
|
||||
* 0.99 and 0.1 will both be cast to an integer value of 0, which will
|
||||
* compare such values as equal.
|
||||
* @throws ArrayException
|
||||
* @deprecated The Safe version of this function is no longer needed in PHP 8.0+
|
||||
*
|
||||
*/
|
||||
function usort(array &$array, callable $value_compare_func): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \usort($array, $value_compare_func);
|
||||
if ($result === false) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an array by using the values from the
|
||||
* keys array as keys and the values from the
|
||||
* values array as the corresponding values.
|
||||
*
|
||||
* @param array $keys Array of keys to be used. Illegal values for key will be
|
||||
* converted to string.
|
||||
* @param array $values Array of values to be used
|
||||
* @return array Returns the combined array, FALSE if the number of elements
|
||||
* for each array isn't equal.
|
||||
* @throws ArrayException
|
||||
* @deprecated
|
||||
*
|
||||
*/
|
||||
function array_combine(array $keys, array $values): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \array_combine($keys, $values);
|
||||
if ($result === false) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
36
vendor/thecodingmachine/safe/deprecated/datetime.php
vendored
Normal file
36
vendor/thecodingmachine/safe/deprecated/datetime.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\DatetimeException;
|
||||
|
||||
/**
|
||||
* Identical to the date function except that
|
||||
* the time returned is Greenwich Mean Time (GMT).
|
||||
*
|
||||
* @param string $format The format of the outputted date string. See the formatting
|
||||
* options for the date function.
|
||||
* @param int $timestamp The optional timestamp parameter is an
|
||||
* integer Unix timestamp that defaults to the current
|
||||
* local time if a timestamp is not given. In other
|
||||
* words, it defaults to the value of time.
|
||||
* @return string Returns a formatted date string. If a non-numeric value is used for
|
||||
* timestamp, FALSE is returned and an
|
||||
* E_WARNING level error is emitted.
|
||||
* @throws DatetimeException
|
||||
* @deprecated The Safe version of this function is no longer needed in PHP 8.0+
|
||||
*
|
||||
*/
|
||||
function gmdate(string $format, int $timestamp = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($timestamp !== null) {
|
||||
$result = \gmdate($format, $timestamp);
|
||||
} else {
|
||||
$result = \gmdate($format);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@@ -11,6 +11,10 @@ return [
|
||||
'apc_inc',
|
||||
'apc_load_constants',
|
||||
'apc_sma_info',
|
||||
'arsort',
|
||||
'array_combine',
|
||||
'array_flip',
|
||||
'asort',
|
||||
'event_add',
|
||||
'event_base_loopbreak',
|
||||
'event_base_loopexit',
|
||||
@@ -30,10 +34,13 @@ return [
|
||||
'event_priority_set',
|
||||
'event_set',
|
||||
'event_timer_set',
|
||||
'gmdate',
|
||||
'imagepsencodefont',
|
||||
'imagepsextendfont',
|
||||
'imagepsfreefont',
|
||||
'imagepsslantfont',
|
||||
'krsort',
|
||||
'ksort',
|
||||
'mssql_bind',
|
||||
'mssql_close',
|
||||
'mssql_connect',
|
||||
@@ -48,9 +55,15 @@ return [
|
||||
'mssql_pconnect',
|
||||
'mssql_query',
|
||||
'mssql_select_db',
|
||||
'mysqli_get_client_stats',
|
||||
'password_hash',
|
||||
'sort',
|
||||
'stats_covariance',
|
||||
'stats_standard_deviation',
|
||||
'stats_stat_correlation',
|
||||
'stats_stat_innerproduct',
|
||||
'stats_variance',
|
||||
'substr',
|
||||
'usort',
|
||||
'vsprintf',
|
||||
];
|
||||
|
||||
@@ -4,28 +4,8 @@ namespace Safe;
|
||||
|
||||
use Safe\Exceptions\MysqliException;
|
||||
|
||||
/**
|
||||
* Returns an empty array.
|
||||
* Available only with mysqlnd.
|
||||
*
|
||||
* @return array Returns an empty array on success, FALSE otherwise.
|
||||
* @throws MysqliException
|
||||
*
|
||||
*/
|
||||
function mysqli_get_cache_stats(): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \mysqli_get_cache_stats();
|
||||
if ($result === false) {
|
||||
throw MysqliException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns client per-process statistics.
|
||||
* Available only with mysqlnd.
|
||||
*
|
||||
* @return array Returns an array with client stats if success, FALSE otherwise.
|
||||
* @throws MysqliException
|
||||
@@ -109,6 +109,7 @@ use Safe\Exceptions\PasswordException;
|
||||
* the password_verify function to verify the hash without
|
||||
* needing separate storage for the salt or algorithm information.
|
||||
* @throws PasswordException
|
||||
* @deprecated The Safe version of this function is no longer needed in PHP 8.0+
|
||||
*
|
||||
*/
|
||||
function password_hash(string $password, $algo, array $options = null): string
|
||||
677
vendor/thecodingmachine/safe/deprecated/strings.php
vendored
Normal file
677
vendor/thecodingmachine/safe/deprecated/strings.php
vendored
Normal file
@@ -0,0 +1,677 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\StringsException;
|
||||
|
||||
/**
|
||||
* Returns a string produced according to the formatting string
|
||||
* format.
|
||||
*
|
||||
* @param string $format The format string is composed of zero or more directives:
|
||||
* ordinary characters (excluding %) that are
|
||||
* copied directly to the result and conversion
|
||||
* specifications, each of which results in fetching its
|
||||
* own parameter.
|
||||
*
|
||||
* A conversion specification follows this prototype:
|
||||
* %[argnum$][flags][width][.precision]specifier.
|
||||
*
|
||||
* An integer followed by a dollar sign $,
|
||||
* to specify which number argument to treat in the conversion.
|
||||
*
|
||||
*
|
||||
* Flags
|
||||
*
|
||||
*
|
||||
*
|
||||
* Flag
|
||||
* Description
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* -
|
||||
*
|
||||
* Left-justify within the given field width;
|
||||
* Right justification is the default
|
||||
*
|
||||
*
|
||||
*
|
||||
* +
|
||||
*
|
||||
* Prefix positive numbers with a plus sign
|
||||
* +; Default only negative
|
||||
* are prefixed with a negative sign.
|
||||
*
|
||||
*
|
||||
*
|
||||
* (space)
|
||||
*
|
||||
* Pads the result with spaces.
|
||||
* This is the default.
|
||||
*
|
||||
*
|
||||
*
|
||||
* 0
|
||||
*
|
||||
* Only left-pads numbers with zeros.
|
||||
* With s specifiers this can
|
||||
* also right-pad with zeros.
|
||||
*
|
||||
*
|
||||
*
|
||||
* '(char)
|
||||
*
|
||||
* Pads the result with the character (char).
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* An integer that says how many characters (minimum)
|
||||
* this conversion should result in.
|
||||
*
|
||||
* A period . followed by an integer
|
||||
* who's meaning depends on the specifier:
|
||||
*
|
||||
*
|
||||
*
|
||||
* For e, E,
|
||||
* f and F
|
||||
* specifiers: this is the number of digits to be printed
|
||||
* after the decimal point (by default, this is 6).
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* For g and G
|
||||
* specifiers: this is the maximum number of significant
|
||||
* digits to be printed.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* For s specifier: it acts as a cutoff point,
|
||||
* setting a maximum character limit to the string.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* If the period is specified without an explicit value for precision,
|
||||
* 0 is assumed.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Specifiers
|
||||
*
|
||||
*
|
||||
*
|
||||
* Specifier
|
||||
* Description
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* %
|
||||
*
|
||||
* A literal percent character. No argument is required.
|
||||
*
|
||||
*
|
||||
*
|
||||
* b
|
||||
*
|
||||
* The argument is treated as an integer and presented
|
||||
* as a binary number.
|
||||
*
|
||||
*
|
||||
*
|
||||
* c
|
||||
*
|
||||
* The argument is treated as an integer and presented
|
||||
* as the character with that ASCII.
|
||||
*
|
||||
*
|
||||
*
|
||||
* d
|
||||
*
|
||||
* The argument is treated as an integer and presented
|
||||
* as a (signed) decimal number.
|
||||
*
|
||||
*
|
||||
*
|
||||
* e
|
||||
*
|
||||
* The argument is treated as scientific notation (e.g. 1.2e+2).
|
||||
* The precision specifier stands for the number of digits after the
|
||||
* decimal point since PHP 5.2.1. In earlier versions, it was taken as
|
||||
* number of significant digits (one less).
|
||||
*
|
||||
*
|
||||
*
|
||||
* E
|
||||
*
|
||||
* Like the e specifier but uses
|
||||
* uppercase letter (e.g. 1.2E+2).
|
||||
*
|
||||
*
|
||||
*
|
||||
* f
|
||||
*
|
||||
* The argument is treated as a float and presented
|
||||
* as a floating-point number (locale aware).
|
||||
*
|
||||
*
|
||||
*
|
||||
* F
|
||||
*
|
||||
* The argument is treated as a float and presented
|
||||
* as a floating-point number (non-locale aware).
|
||||
* Available as of PHP 5.0.3.
|
||||
*
|
||||
*
|
||||
*
|
||||
* g
|
||||
*
|
||||
*
|
||||
* General format.
|
||||
*
|
||||
*
|
||||
* Let P equal the precision if nonzero, 6 if the precision is omitted,
|
||||
* or 1 if the precision is zero.
|
||||
* Then, if a conversion with style E would have an exponent of X:
|
||||
*
|
||||
*
|
||||
* If P > X ≥ −4, the conversion is with style f and precision P − (X + 1).
|
||||
* Otherwise, the conversion is with style e and precision P − 1.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* G
|
||||
*
|
||||
* Like the g specifier but uses
|
||||
* E and f.
|
||||
*
|
||||
*
|
||||
*
|
||||
* o
|
||||
*
|
||||
* The argument is treated as an integer and presented
|
||||
* as an octal number.
|
||||
*
|
||||
*
|
||||
*
|
||||
* s
|
||||
*
|
||||
* The argument is treated and presented as a string.
|
||||
*
|
||||
*
|
||||
*
|
||||
* u
|
||||
*
|
||||
* The argument is treated as an integer and presented
|
||||
* as an unsigned decimal number.
|
||||
*
|
||||
*
|
||||
*
|
||||
* x
|
||||
*
|
||||
* The argument is treated as an integer and presented
|
||||
* as a hexadecimal number (with lowercase letters).
|
||||
*
|
||||
*
|
||||
*
|
||||
* X
|
||||
*
|
||||
* The argument is treated as an integer and presented
|
||||
* as a hexadecimal number (with uppercase letters).
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* General format.
|
||||
*
|
||||
* Let P equal the precision if nonzero, 6 if the precision is omitted,
|
||||
* or 1 if the precision is zero.
|
||||
* Then, if a conversion with style E would have an exponent of X:
|
||||
*
|
||||
* If P > X ≥ −4, the conversion is with style f and precision P − (X + 1).
|
||||
* Otherwise, the conversion is with style e and precision P − 1.
|
||||
*
|
||||
* The c type specifier ignores padding and width
|
||||
*
|
||||
* Attempting to use a combination of the string and width specifiers with character sets that require more than one byte per character may result in unexpected results
|
||||
*
|
||||
* Variables will be co-erced to a suitable type for the specifier:
|
||||
*
|
||||
* Type Handling
|
||||
*
|
||||
*
|
||||
*
|
||||
* Type
|
||||
* Specifiers
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* string
|
||||
* s
|
||||
*
|
||||
*
|
||||
* integer
|
||||
*
|
||||
* d,
|
||||
* u,
|
||||
* c,
|
||||
* o,
|
||||
* x,
|
||||
* X,
|
||||
* b
|
||||
*
|
||||
*
|
||||
*
|
||||
* double
|
||||
*
|
||||
* g,
|
||||
* G,
|
||||
* e,
|
||||
* E,
|
||||
* f,
|
||||
* F
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param mixed $params
|
||||
* @return string Returns a string produced according to the formatting string
|
||||
* format.
|
||||
* @throws StringsException
|
||||
* @deprecated The Safe version of this function is no longer needed in PHP 8.0+
|
||||
*
|
||||
*/
|
||||
function sprintf(string $format, ...$params): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($params !== []) {
|
||||
$result = \sprintf($format, ...$params);
|
||||
} else {
|
||||
$result = \sprintf($format);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw StringsException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the portion of string specified by the
|
||||
* start and length parameters.
|
||||
*
|
||||
* @param string $string The input string.
|
||||
* @param int $start If start is non-negative, the returned string
|
||||
* will start at the start'th position in
|
||||
* string, counting from zero. For instance,
|
||||
* in the string 'abcdef', the character at
|
||||
* position 0 is 'a', the
|
||||
* character at position 2 is
|
||||
* 'c', and so forth.
|
||||
*
|
||||
* If start is negative, the returned string
|
||||
* will start at the start'th character
|
||||
* from the end of string.
|
||||
*
|
||||
* If string is less than
|
||||
* start characters long, FALSE will be returned.
|
||||
*
|
||||
*
|
||||
* Using a negative start
|
||||
*
|
||||
*
|
||||
* ]]>
|
||||
*
|
||||
*
|
||||
* @param int $length If length is given and is positive, the string
|
||||
* returned will contain at most length characters
|
||||
* beginning from start (depending on the length of
|
||||
* string).
|
||||
*
|
||||
* If length is given and is negative, then that many
|
||||
* characters will be omitted from the end of string
|
||||
* (after the start position has been calculated when a
|
||||
* start is negative). If
|
||||
* start denotes the position of this truncation or
|
||||
* beyond, FALSE will be returned.
|
||||
*
|
||||
* If length is given and is 0,
|
||||
* FALSE or NULL, an empty string will be returned.
|
||||
*
|
||||
* If length is omitted, the substring starting from
|
||||
* start until the end of the string will be
|
||||
* returned.
|
||||
* @return string Returns the extracted part of string;, or
|
||||
* an empty string.
|
||||
* @throws StringsException
|
||||
* @deprecated The Safe version of this function is no longer needed in PHP 8.0+
|
||||
*
|
||||
*/
|
||||
function substr(string $string, int $start, int $length = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($length !== null) {
|
||||
$result = \substr($string, $start, $length);
|
||||
} else {
|
||||
$result = \substr($string, $start);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw StringsException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Operates as sprintf but accepts an array of
|
||||
* arguments, rather than a variable number of arguments.
|
||||
*
|
||||
* @param string $format The format string is composed of zero or more directives:
|
||||
* ordinary characters (excluding %) that are
|
||||
* copied directly to the result and conversion
|
||||
* specifications, each of which results in fetching its
|
||||
* own parameter.
|
||||
*
|
||||
* A conversion specification follows this prototype:
|
||||
* %[argnum$][flags][width][.precision]specifier.
|
||||
*
|
||||
* An integer followed by a dollar sign $,
|
||||
* to specify which number argument to treat in the conversion.
|
||||
*
|
||||
*
|
||||
* Flags
|
||||
*
|
||||
*
|
||||
*
|
||||
* Flag
|
||||
* Description
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* -
|
||||
*
|
||||
* Left-justify within the given field width;
|
||||
* Right justification is the default
|
||||
*
|
||||
*
|
||||
*
|
||||
* +
|
||||
*
|
||||
* Prefix positive numbers with a plus sign
|
||||
* +; Default only negative
|
||||
* are prefixed with a negative sign.
|
||||
*
|
||||
*
|
||||
*
|
||||
* (space)
|
||||
*
|
||||
* Pads the result with spaces.
|
||||
* This is the default.
|
||||
*
|
||||
*
|
||||
*
|
||||
* 0
|
||||
*
|
||||
* Only left-pads numbers with zeros.
|
||||
* With s specifiers this can
|
||||
* also right-pad with zeros.
|
||||
*
|
||||
*
|
||||
*
|
||||
* '(char)
|
||||
*
|
||||
* Pads the result with the character (char).
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* An integer that says how many characters (minimum)
|
||||
* this conversion should result in.
|
||||
*
|
||||
* A period . followed by an integer
|
||||
* who's meaning depends on the specifier:
|
||||
*
|
||||
*
|
||||
*
|
||||
* For e, E,
|
||||
* f and F
|
||||
* specifiers: this is the number of digits to be printed
|
||||
* after the decimal point (by default, this is 6).
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* For g and G
|
||||
* specifiers: this is the maximum number of significant
|
||||
* digits to be printed.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* For s specifier: it acts as a cutoff point,
|
||||
* setting a maximum character limit to the string.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* If the period is specified without an explicit value for precision,
|
||||
* 0 is assumed.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Specifiers
|
||||
*
|
||||
*
|
||||
*
|
||||
* Specifier
|
||||
* Description
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* %
|
||||
*
|
||||
* A literal percent character. No argument is required.
|
||||
*
|
||||
*
|
||||
*
|
||||
* b
|
||||
*
|
||||
* The argument is treated as an integer and presented
|
||||
* as a binary number.
|
||||
*
|
||||
*
|
||||
*
|
||||
* c
|
||||
*
|
||||
* The argument is treated as an integer and presented
|
||||
* as the character with that ASCII.
|
||||
*
|
||||
*
|
||||
*
|
||||
* d
|
||||
*
|
||||
* The argument is treated as an integer and presented
|
||||
* as a (signed) decimal number.
|
||||
*
|
||||
*
|
||||
*
|
||||
* e
|
||||
*
|
||||
* The argument is treated as scientific notation (e.g. 1.2e+2).
|
||||
* The precision specifier stands for the number of digits after the
|
||||
* decimal point since PHP 5.2.1. In earlier versions, it was taken as
|
||||
* number of significant digits (one less).
|
||||
*
|
||||
*
|
||||
*
|
||||
* E
|
||||
*
|
||||
* Like the e specifier but uses
|
||||
* uppercase letter (e.g. 1.2E+2).
|
||||
*
|
||||
*
|
||||
*
|
||||
* f
|
||||
*
|
||||
* The argument is treated as a float and presented
|
||||
* as a floating-point number (locale aware).
|
||||
*
|
||||
*
|
||||
*
|
||||
* F
|
||||
*
|
||||
* The argument is treated as a float and presented
|
||||
* as a floating-point number (non-locale aware).
|
||||
* Available as of PHP 5.0.3.
|
||||
*
|
||||
*
|
||||
*
|
||||
* g
|
||||
*
|
||||
*
|
||||
* General format.
|
||||
*
|
||||
*
|
||||
* Let P equal the precision if nonzero, 6 if the precision is omitted,
|
||||
* or 1 if the precision is zero.
|
||||
* Then, if a conversion with style E would have an exponent of X:
|
||||
*
|
||||
*
|
||||
* If P > X ≥ −4, the conversion is with style f and precision P − (X + 1).
|
||||
* Otherwise, the conversion is with style e and precision P − 1.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* G
|
||||
*
|
||||
* Like the g specifier but uses
|
||||
* E and f.
|
||||
*
|
||||
*
|
||||
*
|
||||
* o
|
||||
*
|
||||
* The argument is treated as an integer and presented
|
||||
* as an octal number.
|
||||
*
|
||||
*
|
||||
*
|
||||
* s
|
||||
*
|
||||
* The argument is treated and presented as a string.
|
||||
*
|
||||
*
|
||||
*
|
||||
* u
|
||||
*
|
||||
* The argument is treated as an integer and presented
|
||||
* as an unsigned decimal number.
|
||||
*
|
||||
*
|
||||
*
|
||||
* x
|
||||
*
|
||||
* The argument is treated as an integer and presented
|
||||
* as a hexadecimal number (with lowercase letters).
|
||||
*
|
||||
*
|
||||
*
|
||||
* X
|
||||
*
|
||||
* The argument is treated as an integer and presented
|
||||
* as a hexadecimal number (with uppercase letters).
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* General format.
|
||||
*
|
||||
* Let P equal the precision if nonzero, 6 if the precision is omitted,
|
||||
* or 1 if the precision is zero.
|
||||
* Then, if a conversion with style E would have an exponent of X:
|
||||
*
|
||||
* If P > X ≥ −4, the conversion is with style f and precision P − (X + 1).
|
||||
* Otherwise, the conversion is with style e and precision P − 1.
|
||||
*
|
||||
* The c type specifier ignores padding and width
|
||||
*
|
||||
* Attempting to use a combination of the string and width specifiers with character sets that require more than one byte per character may result in unexpected results
|
||||
*
|
||||
* Variables will be co-erced to a suitable type for the specifier:
|
||||
*
|
||||
* Type Handling
|
||||
*
|
||||
*
|
||||
*
|
||||
* Type
|
||||
* Specifiers
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* string
|
||||
* s
|
||||
*
|
||||
*
|
||||
* integer
|
||||
*
|
||||
* d,
|
||||
* u,
|
||||
* c,
|
||||
* o,
|
||||
* x,
|
||||
* X,
|
||||
* b
|
||||
*
|
||||
*
|
||||
*
|
||||
* double
|
||||
*
|
||||
* g,
|
||||
* G,
|
||||
* e,
|
||||
* E,
|
||||
* f,
|
||||
* F
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param array $args
|
||||
* @return string Return array values as a formatted string according to
|
||||
* format.
|
||||
* @throws StringsException
|
||||
* @deprecated The Safe version of this function is no longer needed in PHP 8.0+
|
||||
*/
|
||||
function vsprintf(string $format, array $args): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \vsprintf($format, $args);
|
||||
if ($result === false) {
|
||||
throw StringsException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
7
vendor/thecodingmachine/safe/docker-compose.yml
vendored
Normal file
7
vendor/thecodingmachine/safe/docker-compose.yml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
version: '3.7'
|
||||
services:
|
||||
|
||||
app:
|
||||
image: thecodingmachine/php:8.1-v4-apache
|
||||
volumes:
|
||||
- ./:/var/www/html
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Safe\Exceptions;
|
||||
|
||||
class MsqlException extends \ErrorException implements SafeExceptionInterface
|
||||
class GettextException extends \ErrorException implements SafeExceptionInterface
|
||||
{
|
||||
public static function createFromPhpError(): self
|
||||
{
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
namespace Safe\Exceptions;
|
||||
|
||||
class IngresiiException extends \ErrorException implements SafeExceptionInterface
|
||||
{
|
||||
public static function createFromPhpError(): self
|
||||
{
|
||||
$error = error_get_last();
|
||||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
namespace Safe\Exceptions;
|
||||
|
||||
class MysqlndMsException extends \ErrorException implements SafeExceptionInterface
|
||||
{
|
||||
public static function createFromPhpError(): self
|
||||
{
|
||||
$error = error_get_last();
|
||||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
namespace Safe\Exceptions;
|
||||
|
||||
class MysqlndQcException extends \ErrorException implements SafeExceptionInterface
|
||||
{
|
||||
public static function createFromPhpError(): self
|
||||
{
|
||||
$error = error_get_last();
|
||||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
namespace Safe\Exceptions;
|
||||
|
||||
class PdfException extends \ErrorException implements SafeExceptionInterface
|
||||
{
|
||||
public static function createFromPhpError(): self
|
||||
{
|
||||
$error = error_get_last();
|
||||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
|
||||
}
|
||||
}
|
||||
@@ -26,8 +26,6 @@ function apache_get_version(): string
|
||||
* Retrieve an Apache environment variable specified by
|
||||
* variable.
|
||||
*
|
||||
* This function requires Apache 2 otherwise it's undefined.
|
||||
*
|
||||
* @param string $variable The Apache environment variable
|
||||
* @param bool $walk_to_top Whether to get the top-level variable available to all Apache layers.
|
||||
* @return string The value of the Apache environment variable on success
|
||||
@@ -45,10 +43,57 @@ function apache_getenv(string $variable, bool $walk_to_top = false): string
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This performs a partial request for a URI. It goes just far
|
||||
* enough to obtain all the important information about the given
|
||||
* resource.
|
||||
*
|
||||
* @param string $filename The filename (URI) that's being requested.
|
||||
* @return object An object of related URI information. The properties of
|
||||
* this object are:
|
||||
*
|
||||
*
|
||||
* status
|
||||
* the_request
|
||||
* status_line
|
||||
* method
|
||||
* content_type
|
||||
* handler
|
||||
* uri
|
||||
* filename
|
||||
* path_info
|
||||
* args
|
||||
* boundary
|
||||
* no_cache
|
||||
* no_local_copy
|
||||
* allowed
|
||||
* send_bodyct
|
||||
* bytes_sent
|
||||
* byterange
|
||||
* clength
|
||||
* unparsed_uri
|
||||
* mtime
|
||||
* request_time
|
||||
*
|
||||
*
|
||||
* Returns FALSE on failure.
|
||||
* @throws ApacheException
|
||||
*
|
||||
*/
|
||||
function apache_lookup_uri(string $filename): object
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \apache_lookup_uri($filename);
|
||||
if ($result === false) {
|
||||
throw ApacheException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fetches all HTTP request headers from the current request. Works in the
|
||||
* Apache, FastCGI, CLI, FPM and NSAPI server module
|
||||
* in Netscape/iPlanet/SunONE webservers.
|
||||
* Apache, FastCGI, CLI, and FPM webservers.
|
||||
*
|
||||
* @return array An associative array of all the HTTP headers in the current request.
|
||||
* @throws ApacheException
|
||||
@@ -65,32 +110,9 @@ function apache_request_headers(): array
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* apache_reset_timeout resets the Apache write timer,
|
||||
* which defaults to 300 seconds. With set_time_limit(0);
|
||||
* ignore_user_abort(true) and periodic
|
||||
* apache_reset_timeout calls, Apache can theoretically
|
||||
* run forever.
|
||||
*
|
||||
* This function requires Apache 1.
|
||||
*
|
||||
* @throws ApacheException
|
||||
*
|
||||
*/
|
||||
function apache_reset_timeout(): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \apache_reset_timeout();
|
||||
if ($result === false) {
|
||||
throw ApacheException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fetch all HTTP response headers. Works in the
|
||||
* Apache, FastCGI, CLI, FPM and NSAPI server module
|
||||
* in Netscape/iPlanet/SunONE webservers.
|
||||
* Apache, FastCGI, CLI, and FPM webservers.
|
||||
*
|
||||
* @return array An array of all Apache response headers on success.
|
||||
* @throws ApacheException
|
||||
@@ -163,14 +185,14 @@ function getallheaders(): array
|
||||
* To run the sub-request, all buffers are terminated and flushed to the
|
||||
* browser, pending headers are sent too.
|
||||
*
|
||||
* @param string $filename The file that the virtual command will be performed on.
|
||||
* @param string $uri The file that the virtual command will be performed on.
|
||||
* @throws ApacheException
|
||||
*
|
||||
*/
|
||||
function virtual(string $filename): void
|
||||
function virtual(string $uri): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \virtual($filename);
|
||||
$result = \virtual($uri);
|
||||
if ($result === false) {
|
||||
throw ApacheException::createFromPhpError();
|
||||
}
|
||||
|
||||
372
vendor/thecodingmachine/safe/generated/array.php
vendored
372
vendor/thecodingmachine/safe/generated/array.php
vendored
@@ -4,63 +4,9 @@ namespace Safe;
|
||||
|
||||
use Safe\Exceptions\ArrayException;
|
||||
|
||||
/**
|
||||
* Creates an array by using the values from the
|
||||
* keys array as keys and the values from the
|
||||
* values array as the corresponding values.
|
||||
*
|
||||
* @param array $keys Array of keys to be used. Illegal values for key will be
|
||||
* converted to string.
|
||||
* @param array $values Array of values to be used
|
||||
* @return array Returns the combined array, FALSE if the number of elements
|
||||
* for each array isn't equal.
|
||||
* @throws ArrayException
|
||||
*
|
||||
*/
|
||||
function array_combine(array $keys, array $values): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \array_combine($keys, $values);
|
||||
if ($result === false) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* array_flip returns an array in flip
|
||||
* order, i.e. keys from array become values and values
|
||||
* from array become keys.
|
||||
*
|
||||
* Note that the values of array need to be valid
|
||||
* keys, i.e. they need to be either integer or
|
||||
* string. A warning will be emitted if a value has the wrong
|
||||
* type, and the key/value pair in question will not be included
|
||||
* in the result.
|
||||
*
|
||||
* If a value has several occurrences, the latest key will be
|
||||
* used as its value, and all others will be lost.
|
||||
*
|
||||
* @param array $array An array of key/value pairs to be flipped.
|
||||
* @return array Returns the flipped array on success.
|
||||
* @throws ArrayException
|
||||
*
|
||||
*/
|
||||
function array_flip(array $array): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \array_flip($array);
|
||||
if ($result === null) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* array_replace_recursive replaces the values of
|
||||
* array1 with the same values from all the following
|
||||
* array with the same values from all the following
|
||||
* arrays. If a key from the first array exists in the second array, its value
|
||||
* will be replaced by the value from the second array. If the key exists in the
|
||||
* second array, and not the first, it will be created in the first array.
|
||||
@@ -77,19 +23,19 @@ function array_flip(array $array): array
|
||||
* are both arrays, array_replace_recursive will replace
|
||||
* their respective value recursively.
|
||||
*
|
||||
* @param array $array1 The array in which elements are replaced.
|
||||
* @param array $params Optional. Arrays from which elements will be extracted.
|
||||
* @param array $array The array in which elements are replaced.
|
||||
* @param array $replacements Arrays from which elements will be extracted.
|
||||
* @return array Returns an array.
|
||||
* @throws ArrayException
|
||||
*
|
||||
*/
|
||||
function array_replace_recursive(array $array1, array ...$params): array
|
||||
function array_replace_recursive(array $array, array ...$replacements): array
|
||||
{
|
||||
error_clear_last();
|
||||
if ($params !== []) {
|
||||
$result = \array_replace_recursive($array1, ...$params);
|
||||
if ($replacements !== []) {
|
||||
$result = \array_replace_recursive($array, ...$replacements);
|
||||
} else {
|
||||
$result = \array_replace_recursive($array1);
|
||||
$result = \array_replace_recursive($array);
|
||||
}
|
||||
if ($result === null) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
@@ -100,7 +46,7 @@ function array_replace_recursive(array $array1, array ...$params): array
|
||||
|
||||
/**
|
||||
* array_replace replaces the values of
|
||||
* array1 with values having the same keys in each of the following
|
||||
* array with values having the same keys in each of the following
|
||||
* arrays. If a key from the first array exists in the second array, its value
|
||||
* will be replaced by the value from the second array. If the key exists in the
|
||||
* second array, and not the first, it will be created in the first array.
|
||||
@@ -111,20 +57,20 @@ function array_replace_recursive(array $array1, array ...$params): array
|
||||
* array_replace is not recursive : it will replace
|
||||
* values in the first array by whatever type is in the second array.
|
||||
*
|
||||
* @param array $array1 The array in which elements are replaced.
|
||||
* @param array $params Arrays from which elements will be extracted.
|
||||
* @param array $array The array in which elements are replaced.
|
||||
* @param array $replacements Arrays from which elements will be extracted.
|
||||
* Values from later arrays overwrite the previous values.
|
||||
* @return array Returns an array.
|
||||
* @throws ArrayException
|
||||
*
|
||||
*/
|
||||
function array_replace(array $array1, array ...$params): array
|
||||
function array_replace(array $array, array ...$replacements): array
|
||||
{
|
||||
error_clear_last();
|
||||
if ($params !== []) {
|
||||
$result = \array_replace($array1, ...$params);
|
||||
if ($replacements !== []) {
|
||||
$result = \array_replace($array, ...$replacements);
|
||||
} else {
|
||||
$result = \array_replace($array1);
|
||||
$result = \array_replace($array);
|
||||
}
|
||||
if ($result === null) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
@@ -138,7 +84,7 @@ function array_replace(array $array1, array ...$params): array
|
||||
* element of the array. This function will recurse
|
||||
* into deeper arrays.
|
||||
*
|
||||
* @param array $array The input array.
|
||||
* @param array|object $array The input array.
|
||||
* @param callable $callback Typically, callback takes on two parameters.
|
||||
* The array parameter's value being the first, and
|
||||
* the key/index second.
|
||||
@@ -149,168 +95,20 @@ function array_replace(array $array1, array ...$params): array
|
||||
* reference. Then,
|
||||
* any changes made to those elements will be made in the
|
||||
* original array itself.
|
||||
* @param mixed $userdata If the optional userdata parameter is supplied,
|
||||
* @param mixed $arg If the optional arg parameter is supplied,
|
||||
* it will be passed as the third parameter to the
|
||||
* callback.
|
||||
* @throws ArrayException
|
||||
*
|
||||
*/
|
||||
function array_walk_recursive(array &$array, callable $callback, $userdata = null): void
|
||||
function array_walk_recursive(&$array, callable $callback, $arg = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \array_walk_recursive($array, $callback, $userdata);
|
||||
if ($result === false) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
if ($arg !== null) {
|
||||
$result = \array_walk_recursive($array, $callback, $arg);
|
||||
} else {
|
||||
$result = \array_walk_recursive($array, $callback);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function sorts an array such that array indices maintain their
|
||||
* correlation with the array elements they are associated with.
|
||||
*
|
||||
* This is used mainly when sorting associative arrays where the actual
|
||||
* element order is significant.
|
||||
*
|
||||
* @param array $array The input array.
|
||||
* @param int $sort_flags You may modify the behavior of the sort using the optional parameter
|
||||
* sort_flags, for details see
|
||||
* sort.
|
||||
* @throws ArrayException
|
||||
*
|
||||
*/
|
||||
function arsort(array &$array, int $sort_flags = SORT_REGULAR): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \arsort($array, $sort_flags);
|
||||
if ($result === false) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function sorts an array such that array indices maintain
|
||||
* their correlation with the array elements they are associated
|
||||
* with. This is used mainly when sorting associative arrays where
|
||||
* the actual element order is significant.
|
||||
*
|
||||
* @param array $array The input array.
|
||||
* @param int $sort_flags You may modify the behavior of the sort using the optional
|
||||
* parameter sort_flags, for details
|
||||
* see sort.
|
||||
* @throws ArrayException
|
||||
*
|
||||
*/
|
||||
function asort(array &$array, int $sort_flags = SORT_REGULAR): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \asort($array, $sort_flags);
|
||||
if ($result === false) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sorts an array by key in reverse order, maintaining key to data
|
||||
* correlations. This is useful mainly for associative arrays.
|
||||
*
|
||||
* @param array $array The input array.
|
||||
* @param int $sort_flags You may modify the behavior of the sort using the optional parameter
|
||||
* sort_flags, for details see
|
||||
* sort.
|
||||
* @throws ArrayException
|
||||
*
|
||||
*/
|
||||
function krsort(array &$array, int $sort_flags = SORT_REGULAR): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \krsort($array, $sort_flags);
|
||||
if ($result === false) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sorts an array by key, maintaining key to data correlations. This is
|
||||
* useful mainly for associative arrays.
|
||||
*
|
||||
* @param array $array The input array.
|
||||
* @param int $sort_flags You may modify the behavior of the sort using the optional
|
||||
* parameter sort_flags, for details
|
||||
* see sort.
|
||||
* @throws ArrayException
|
||||
*
|
||||
*/
|
||||
function ksort(array &$array, int $sort_flags = SORT_REGULAR): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ksort($array, $sort_flags);
|
||||
if ($result === false) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* natcasesort is a case insensitive version of
|
||||
* natsort.
|
||||
*
|
||||
* This function implements a sort algorithm that orders
|
||||
* alphanumeric strings in the way a human being would while maintaining
|
||||
* key/value associations. This is described as a "natural ordering".
|
||||
*
|
||||
* @param array $array The input array.
|
||||
* @throws ArrayException
|
||||
*
|
||||
*/
|
||||
function natcasesort(array &$array): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \natcasesort($array);
|
||||
if ($result === false) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function implements a sort algorithm that orders alphanumeric strings
|
||||
* in the way a human being would while maintaining key/value associations.
|
||||
* This is described as a "natural ordering". An example of the difference
|
||||
* between this algorithm and the regular computer string sorting algorithms
|
||||
* (used in sort) can be seen in the example below.
|
||||
*
|
||||
* @param array $array The input array.
|
||||
* @throws ArrayException
|
||||
*
|
||||
*/
|
||||
function natsort(array &$array): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \natsort($array);
|
||||
if ($result === false) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function sorts an array in reverse order (highest to lowest).
|
||||
*
|
||||
* @param array $array The input array.
|
||||
* @param int $sort_flags You may modify the behavior of the sort using the optional
|
||||
* parameter sort_flags, for details see
|
||||
* sort.
|
||||
* @throws ArrayException
|
||||
*
|
||||
*/
|
||||
function rsort(array &$array, int $sort_flags = SORT_REGULAR): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \rsort($array, $sort_flags);
|
||||
if ($result === false) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
}
|
||||
@@ -334,131 +132,3 @@ function shuffle(array &$array): void
|
||||
throw ArrayException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function sorts an array. Elements will be arranged from
|
||||
* lowest to highest when this function has completed.
|
||||
*
|
||||
* @param array $array The input array.
|
||||
* @param int $sort_flags The optional second parameter sort_flags
|
||||
* may be used to modify the sorting behavior using these values:
|
||||
*
|
||||
* Sorting type flags:
|
||||
*
|
||||
*
|
||||
* SORT_REGULAR - compare items normally;
|
||||
* the details are described in the comparison operators section
|
||||
*
|
||||
*
|
||||
* SORT_NUMERIC - compare items numerically
|
||||
*
|
||||
*
|
||||
* SORT_STRING - compare items as strings
|
||||
*
|
||||
*
|
||||
*
|
||||
* SORT_LOCALE_STRING - compare items as
|
||||
* strings, based on the current locale. It uses the locale,
|
||||
* which can be changed using setlocale
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* SORT_NATURAL - compare items as strings
|
||||
* using "natural ordering" like natsort
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* SORT_FLAG_CASE - can be combined
|
||||
* (bitwise OR) with
|
||||
* SORT_STRING or
|
||||
* SORT_NATURAL to sort strings case-insensitively
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ArrayException
|
||||
*
|
||||
*/
|
||||
function sort(array &$array, int $sort_flags = SORT_REGULAR): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \sort($array, $sort_flags);
|
||||
if ($result === false) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function sorts an array such that array indices maintain their
|
||||
* correlation with the array elements they are associated with, using a
|
||||
* user-defined comparison function.
|
||||
*
|
||||
* This is used mainly when sorting associative arrays where the actual
|
||||
* element order is significant.
|
||||
*
|
||||
* @param array $array The input array.
|
||||
* @param callable $value_compare_func See usort and uksort for
|
||||
* examples of user-defined comparison functions.
|
||||
* @throws ArrayException
|
||||
*
|
||||
*/
|
||||
function uasort(array &$array, callable $value_compare_func): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \uasort($array, $value_compare_func);
|
||||
if ($result === false) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* uksort will sort the keys of an array using a
|
||||
* user-supplied comparison function. If the array you wish to sort
|
||||
* needs to be sorted by some non-trivial criteria, you should use
|
||||
* this function.
|
||||
*
|
||||
* @param array $array The input array.
|
||||
* @param callable $key_compare_func The comparison function must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
|
||||
* Note that before PHP 7.0.0 this integer had to be in the range from -2147483648 to 2147483647.
|
||||
* @throws ArrayException
|
||||
*
|
||||
*/
|
||||
function uksort(array &$array, callable $key_compare_func): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \uksort($array, $key_compare_func);
|
||||
if ($result === false) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function will sort an array by its values using a user-supplied
|
||||
* comparison function. If the array you wish to sort needs to be sorted by
|
||||
* some non-trivial criteria, you should use this function.
|
||||
*
|
||||
* @param array $array The input array.
|
||||
* @param callable $value_compare_func The comparison function must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
|
||||
* Note that before PHP 7.0.0 this integer had to be in the range from -2147483648 to 2147483647.
|
||||
*
|
||||
* Returning non-integer values from the comparison
|
||||
* function, such as float, will result in an internal cast to
|
||||
* integer of the callback's return value. So values such as
|
||||
* 0.99 and 0.1 will both be cast to an integer value of 0, which will
|
||||
* compare such values as equal.
|
||||
* @throws ArrayException
|
||||
*
|
||||
*/
|
||||
function usort(array &$array, callable $value_compare_func): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \usort($array, $value_compare_func);
|
||||
if ($result === false) {
|
||||
throw ArrayException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,8 +23,9 @@ function bzclose($bz): void
|
||||
|
||||
|
||||
/**
|
||||
* Forces a write of all buffered bzip2 data for the file pointer
|
||||
* bz.
|
||||
* This function is supposed to force a write of all buffered bzip2 data for the file pointer
|
||||
* bz,
|
||||
* but is implemented as null function in libbz2, and as such does nothing.
|
||||
*
|
||||
* @param resource $bz The file pointer. It must be valid and must point to a file
|
||||
* successfully opened by bzopen.
|
||||
|
||||
@@ -5,21 +5,24 @@ namespace Safe;
|
||||
use Safe\Exceptions\CalendarException;
|
||||
|
||||
/**
|
||||
* This function will return a Unix timestamp corresponding to the
|
||||
* Julian Day given in jday or FALSE if
|
||||
* jday is outside of the allowed range. The time returned is
|
||||
* UTC.
|
||||
* Return the Julian Day for a Unix timestamp
|
||||
* (seconds since 1.1.1970), or for the current day if no
|
||||
* timestamp is given. Either way, the time is regarded
|
||||
* as local time (not UTC).
|
||||
*
|
||||
* @param int $jday A julian day number between 2440588 and 106751993607888
|
||||
* on 64bit systems, or between 2440588 and 2465443 on 32bit systems.
|
||||
* @return int The unix timestamp for the start (midnight, not noon) of the given Julian day.
|
||||
* @param int $timestamp A unix timestamp to convert.
|
||||
* @return int A julian day number as integer.
|
||||
* @throws CalendarException
|
||||
*
|
||||
*/
|
||||
function jdtounix(int $jday): int
|
||||
function unixtojd(int $timestamp = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \jdtounix($jday);
|
||||
if ($timestamp !== null) {
|
||||
$result = \unixtojd($timestamp);
|
||||
} else {
|
||||
$result = \unixtojd();
|
||||
}
|
||||
if ($result === false) {
|
||||
throw CalendarException::createFromPhpError();
|
||||
}
|
||||
|
||||
@@ -6,19 +6,19 @@ use Safe\Exceptions\ClassobjException;
|
||||
|
||||
/**
|
||||
* Creates an alias named alias
|
||||
* based on the user defined class original.
|
||||
* based on the user defined class class.
|
||||
* The aliased class is exactly the same as the original class.
|
||||
*
|
||||
* @param string $original The original class.
|
||||
* @param string $class The original class.
|
||||
* @param string $alias The alias name for the class.
|
||||
* @param bool $autoload Whether to autoload if the original class is not found.
|
||||
* @throws ClassobjException
|
||||
*
|
||||
*/
|
||||
function class_alias(string $original, string $alias, bool $autoload = true): void
|
||||
function class_alias(string $class, string $alias, bool $autoload = true): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \class_alias($original, $alias, $autoload);
|
||||
$result = \class_alias($class, $alias, $autoload);
|
||||
if ($result === false) {
|
||||
throw ClassobjException::createFromPhpError();
|
||||
}
|
||||
|
||||
113
vendor/thecodingmachine/safe/generated/com.php
vendored
113
vendor/thecodingmachine/safe/generated/com.php
vendored
@@ -4,35 +4,56 @@ namespace Safe;
|
||||
|
||||
use Safe\Exceptions\ComException;
|
||||
|
||||
/**
|
||||
* Generates a Globally Unique Identifier (GUID).
|
||||
*
|
||||
* A GUID is generated in the same way as DCE UUID's, except that the
|
||||
* Microsoft convention is to enclose a GUID in curly braces.
|
||||
*
|
||||
* @return string Returns the GUID as a string.
|
||||
* @throws ComException
|
||||
*
|
||||
*/
|
||||
function com_create_guid(): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \com_create_guid();
|
||||
if ($result === false) {
|
||||
throw ComException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Instructs COM to sink events generated by
|
||||
* comobject into the PHP object
|
||||
* sinkobject.
|
||||
* variant into the PHP object
|
||||
* sink_object.
|
||||
*
|
||||
* Be careful how you use this feature; if you are doing something similar
|
||||
* to the example below, then it doesn't really make sense to run it in a
|
||||
* web server context.
|
||||
*
|
||||
* @param object $comobject
|
||||
* @param object $sinkobject sinkobject should be an instance of a class with
|
||||
* @param object $variant
|
||||
* @param object $sink_object sink_object should be an instance of a class with
|
||||
* methods named after those of the desired dispinterface; you may use
|
||||
* com_print_typeinfo to help generate a template class
|
||||
* for this purpose.
|
||||
* @param mixed $sinkinterface PHP will attempt to use the default dispinterface type specified by
|
||||
* the typelibrary associated with comobject, but
|
||||
* @param mixed $sink_interface PHP will attempt to use the default dispinterface type specified by
|
||||
* the typelibrary associated with variant, but
|
||||
* you may override this choice by setting
|
||||
* sinkinterface to the name of the dispinterface
|
||||
* sink_interface to the name of the dispinterface
|
||||
* that you want to use.
|
||||
* @throws ComException
|
||||
*
|
||||
*/
|
||||
function com_event_sink(object $comobject, object $sinkobject, $sinkinterface = null): void
|
||||
function com_event_sink(object $variant, object $sink_object, $sink_interface = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($sinkinterface !== null) {
|
||||
$result = \com_event_sink($comobject, $sinkobject, $sinkinterface);
|
||||
if ($sink_interface !== null) {
|
||||
$result = \com_event_sink($variant, $sink_object, $sink_interface);
|
||||
} else {
|
||||
$result = \com_event_sink($comobject, $sinkobject);
|
||||
$result = \com_event_sink($variant, $sink_object);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw ComException::createFromPhpError();
|
||||
@@ -44,15 +65,15 @@ function com_event_sink(object $comobject, object $sinkobject, $sinkinterface =
|
||||
* Loads a type-library and registers its constants in the engine, as though
|
||||
* they were defined using define.
|
||||
*
|
||||
* Note that it is much more efficient to use the configuration setting to pre-load and
|
||||
* Note that it is much more efficient to use the com.typelib-file php.ini setting to pre-load and
|
||||
* register the constants, although not so flexible.
|
||||
*
|
||||
* If you have turned on , then
|
||||
* If com.autoregister-typelib is turned on, then
|
||||
* PHP will attempt to automatically register the constants associated with a
|
||||
* COM object when you instantiate it. This depends on the interfaces
|
||||
* provided by the COM object itself, and may not always be possible.
|
||||
*
|
||||
* @param string $typelib_name typelib_name can be one of the following:
|
||||
* @param string $typelib typelib can be one of the following:
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -86,16 +107,16 @@ function com_event_sink(object $comobject, object $sinkobject, $sinkinterface =
|
||||
*
|
||||
* The type library name, e.g. Microsoft OLE DB ActiveX Data
|
||||
* Objects 1.0 Library.
|
||||
* @param bool $case_sensitive The case_sensitive behaves inversely to
|
||||
* @param bool $case_insensitive The case_insensitive behaves inversely to
|
||||
* the parameter $case_insensitive in the define
|
||||
* function.
|
||||
* @throws ComException
|
||||
*
|
||||
*/
|
||||
function com_load_typelib(string $typelib_name, bool $case_sensitive = true): void
|
||||
function com_load_typelib(string $typelib, bool $case_insensitive = true): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \com_load_typelib($typelib_name, $case_sensitive);
|
||||
$result = \com_load_typelib($typelib, $case_insensitive);
|
||||
if ($result === false) {
|
||||
throw ComException::createFromPhpError();
|
||||
}
|
||||
@@ -108,20 +129,68 @@ function com_load_typelib(string $typelib_name, bool $case_sensitive = true): vo
|
||||
* object, provided that it supports enough of the introspection interfaces,
|
||||
* and that you know the name of the interface you want to display.
|
||||
*
|
||||
* @param object $comobject comobject should be either an instance of a COM
|
||||
* @param object $variant variant should be either an instance of a COM
|
||||
* object, or be the name of a typelibrary (which will be resolved according
|
||||
* to the rules set out in com_load_typelib).
|
||||
* @param string $dispinterface The name of an IDispatch descendant interface that you want to display.
|
||||
* @param bool $wantsink If set to TRUE, the corresponding sink interface will be displayed
|
||||
* @param string $dispatch_interface The name of an IDispatch descendant interface that you want to display.
|
||||
* @param bool $display_sink If set to TRUE, the corresponding sink interface will be displayed
|
||||
* instead.
|
||||
* @throws ComException
|
||||
*
|
||||
*/
|
||||
function com_print_typeinfo(object $comobject, string $dispinterface = null, bool $wantsink = false): void
|
||||
function com_print_typeinfo(object $variant, string $dispatch_interface = null, bool $display_sink = false): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \com_print_typeinfo($comobject, $dispinterface, $wantsink);
|
||||
if ($display_sink !== false) {
|
||||
$result = \com_print_typeinfo($variant, $dispatch_interface, $display_sink);
|
||||
} elseif ($dispatch_interface !== null) {
|
||||
$result = \com_print_typeinfo($variant, $dispatch_interface);
|
||||
} else {
|
||||
$result = \com_print_typeinfo($variant);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw ComException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Converts variant from a VT_DATE
|
||||
* (or similar) value into a Unix timestamp. This allows easier
|
||||
* interopability between the Unix-ish parts of PHP and COM.
|
||||
*
|
||||
* @param object $variant The variant.
|
||||
* @return int Returns a unix timestamp.
|
||||
* @throws ComException
|
||||
*
|
||||
*/
|
||||
function variant_date_to_timestamp(object $variant): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \variant_date_to_timestamp($variant);
|
||||
if ($result === null) {
|
||||
throw ComException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the value of value rounded to
|
||||
* decimals decimal places.
|
||||
*
|
||||
* @param mixed $value The variant.
|
||||
* @param int $decimals Number of decimal places.
|
||||
* @return mixed Returns the rounded value.
|
||||
* @throws ComException
|
||||
*
|
||||
*/
|
||||
function variant_round($value, int $decimals)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \variant_round($value, $decimals);
|
||||
if ($result === null) {
|
||||
throw ComException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
1691
vendor/thecodingmachine/safe/generated/cubrid.php
vendored
1691
vendor/thecodingmachine/safe/generated/cubrid.php
vendored
File diff suppressed because it is too large
Load Diff
410
vendor/thecodingmachine/safe/generated/curl.php
vendored
410
vendor/thecodingmachine/safe/generated/curl.php
vendored
@@ -4,22 +4,42 @@ namespace Safe;
|
||||
|
||||
use Safe\Exceptions\CurlException;
|
||||
|
||||
/**
|
||||
* Copies a cURL handle keeping the same preferences.
|
||||
*
|
||||
* @param \CurlHandle $handle A cURL handle returned by
|
||||
* curl_init.
|
||||
* @return \CurlHandle Returns a new cURL handle.
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_copy_handle(\CurlHandle $handle): \CurlHandle
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \curl_copy_handle($handle);
|
||||
if ($result === false) {
|
||||
throw CurlException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function URL encodes the given string according to RFC 3986.
|
||||
*
|
||||
* @param resource $ch A cURL handle returned by
|
||||
* @param \CurlHandle $handle A cURL handle returned by
|
||||
* curl_init.
|
||||
* @param string $str The string to be encoded.
|
||||
* @param string $string The string to be encoded.
|
||||
* @return string Returns escaped string.
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_escape($ch, string $str): string
|
||||
function curl_escape(\CurlHandle $handle, string $string): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \curl_escape($ch, $str);
|
||||
$result = \curl_escape($handle, $string);
|
||||
if ($result === false) {
|
||||
throw CurlException::createFromCurlResource($ch);
|
||||
throw CurlException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@@ -31,7 +51,7 @@ function curl_escape($ch, string $str): string
|
||||
* This function should be called after initializing a cURL session and all
|
||||
* the options for the session are set.
|
||||
*
|
||||
* @param resource $ch A cURL handle returned by
|
||||
* @param \CurlHandle $handle A cURL handle returned by
|
||||
* curl_init.
|
||||
* @return bool|string Returns TRUE on success. However, if the CURLOPT_RETURNTRANSFER
|
||||
* option is set, it will return
|
||||
@@ -39,12 +59,12 @@ function curl_escape($ch, string $str): string
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_exec($ch)
|
||||
function curl_exec(\CurlHandle $handle)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \curl_exec($ch);
|
||||
$result = \curl_exec($handle);
|
||||
if ($result === false) {
|
||||
throw CurlException::createFromCurlResource($ch);
|
||||
throw CurlException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@@ -53,9 +73,9 @@ function curl_exec($ch)
|
||||
/**
|
||||
* Gets information about the last transfer.
|
||||
*
|
||||
* @param resource $ch A cURL handle returned by
|
||||
* @param \CurlHandle $handle A cURL handle returned by
|
||||
* curl_init.
|
||||
* @param int $opt This may be one of the following constants:
|
||||
* @param int $option This may be one of the following constants:
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -65,7 +85,7 @@ function curl_exec($ch)
|
||||
*
|
||||
*
|
||||
* CURLINFO_HTTP_CODE - The last response code.
|
||||
* As of PHP 5.5.0 and cURL 7.10.8, this is a legacy alias of
|
||||
* As of cURL 7.10.8, this is a legacy alias of
|
||||
* CURLINFO_RESPONSE_CODE
|
||||
*
|
||||
*
|
||||
@@ -367,9 +387,9 @@ function curl_exec($ch)
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return mixed If opt is given, returns its value.
|
||||
* @return mixed If option is given, returns its value.
|
||||
* Otherwise, returns an associative array with the following elements
|
||||
* (which correspond to opt):
|
||||
* (which correspond to option):
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -512,16 +532,16 @@ function curl_exec($ch)
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_getinfo($ch, int $opt = null)
|
||||
function curl_getinfo(\CurlHandle $handle, int $option = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($opt !== null) {
|
||||
$result = \curl_getinfo($ch, $opt);
|
||||
if ($option !== null) {
|
||||
$result = \curl_getinfo($handle, $option);
|
||||
} else {
|
||||
$result = \curl_getinfo($ch);
|
||||
$result = \curl_getinfo($handle);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw CurlException::createFromCurlResource($ch);
|
||||
throw CurlException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@@ -538,34 +558,18 @@ function curl_getinfo($ch, int $opt = null)
|
||||
*
|
||||
* The file protocol is disabled by cURL if
|
||||
* open_basedir is set.
|
||||
* @return resource Returns a cURL handle on success, FALSE on errors.
|
||||
* @return \CurlHandle Returns a cURL handle on success, FALSE on errors.
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_init(string $url = null)
|
||||
function curl_init(string $url = null): \CurlHandle
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \curl_init($url);
|
||||
if ($result === false) {
|
||||
throw CurlException::createFromPhpError();
|
||||
if ($url !== null) {
|
||||
$result = \curl_init($url);
|
||||
} else {
|
||||
$result = \curl_init();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return an integer containing the last multi curl error number.
|
||||
*
|
||||
* @param resource $mh A cURL multi handle returned by
|
||||
* curl_multi_init.
|
||||
* @return int Return an integer containing the last multi curl error number.
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_multi_errno($mh): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \curl_multi_errno($mh);
|
||||
if ($result === false) {
|
||||
throw CurlException::createFromPhpError();
|
||||
}
|
||||
@@ -580,12 +584,12 @@ function curl_multi_errno($mh): int
|
||||
*
|
||||
* Repeated calls to this function will return a new result each time, until a FALSE is returned
|
||||
* as a signal that there is no more to get at this point. The integer pointed to with
|
||||
* msgs_in_queue will contain the number of remaining messages after this
|
||||
* queued_messages will contain the number of remaining messages after this
|
||||
* function was called.
|
||||
*
|
||||
* @param resource $mh A cURL multi handle returned by
|
||||
* @param \CurlMultiHandle $multi_handle A cURL multi handle returned by
|
||||
* curl_multi_init.
|
||||
* @param int|null $msgs_in_queue Number of messages that are still in the queue
|
||||
* @param int|null $queued_messages Number of messages that are still in the queue
|
||||
* @return array On success, returns an associative array for the message, FALSE on failure.
|
||||
*
|
||||
*
|
||||
@@ -618,10 +622,10 @@ function curl_multi_errno($mh): int
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_multi_info_read($mh, ?int &$msgs_in_queue = null): array
|
||||
function curl_multi_info_read(\CurlMultiHandle $multi_handle, ?int &$queued_messages = null): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \curl_multi_info_read($mh, $msgs_in_queue);
|
||||
$result = \curl_multi_info_read($multi_handle, $queued_messages);
|
||||
if ($result === false) {
|
||||
throw CurlException::createFromPhpError();
|
||||
}
|
||||
@@ -632,11 +636,11 @@ function curl_multi_info_read($mh, ?int &$msgs_in_queue = null): array
|
||||
/**
|
||||
* Allows the processing of multiple cURL handles asynchronously.
|
||||
*
|
||||
* @return resource Returns a cURL multi handle resource on success, FALSE on failure.
|
||||
* @return \CurlMultiHandle Returns a cURL multi handle on success, FALSE on failure.
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_multi_init()
|
||||
function curl_multi_init(): \CurlMultiHandle
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \curl_multi_init();
|
||||
@@ -647,10 +651,155 @@ function curl_multi_init()
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param \CurlMultiHandle $multi_handle
|
||||
* @param int $option One of the CURLMOPT_* constants.
|
||||
* @param mixed $value The value to be set on option.
|
||||
*
|
||||
* value should be an int for the
|
||||
* following values of the option parameter:
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Option
|
||||
* Set value to
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* CURLMOPT_PIPELINING
|
||||
*
|
||||
* Pass 1 to enable or 0 to disable. Enabling pipelining on a multi
|
||||
* handle will make it attempt to perform HTTP Pipelining as far as
|
||||
* possible for transfers using this handle. This means that if you add
|
||||
* a second request that can use an already existing connection, the
|
||||
* second request will be "piped" on the same connection.
|
||||
* As of cURL 7.43.0, the value is a bitmask, and you can also pass 2 to try to multiplex the new
|
||||
* transfer over an existing HTTP/2 connection if possible.
|
||||
* Passing 3 instructs cURL to ask for pipelining and multiplexing
|
||||
* independently of each other.
|
||||
* As of cURL 7.62.0, setting the pipelining bit has no effect.
|
||||
* Instead of integer literals, you can also use the CURLPIPE_*
|
||||
* constants if available.
|
||||
*
|
||||
*
|
||||
*
|
||||
* CURLMOPT_MAXCONNECTS
|
||||
*
|
||||
* Pass a number that will be used as the maximum amount of
|
||||
* simultaneously open connections that libcurl may cache.
|
||||
* By default the size will be enlarged to fit four times the number
|
||||
* of handles added via curl_multi_add_handle.
|
||||
* When the cache is full, curl closes the oldest one in the cache
|
||||
* to prevent the number of open connections from increasing.
|
||||
*
|
||||
*
|
||||
*
|
||||
* CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE
|
||||
*
|
||||
* Pass a number that specifies the chunk length threshold for pipelining
|
||||
* in bytes.
|
||||
*
|
||||
*
|
||||
*
|
||||
* CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE
|
||||
*
|
||||
* Pass a number that specifies the size threshold for pipelining
|
||||
* penalty in bytes.
|
||||
*
|
||||
*
|
||||
*
|
||||
* CURLMOPT_MAX_HOST_CONNECTIONS
|
||||
*
|
||||
* Pass a number that specifies the maximum number of connections to a
|
||||
* single host.
|
||||
*
|
||||
*
|
||||
*
|
||||
* CURLMOPT_MAX_PIPELINE_LENGTH
|
||||
*
|
||||
* Pass a number that specifies the maximum number of requests in a
|
||||
* pipeline.
|
||||
*
|
||||
*
|
||||
*
|
||||
* CURLMOPT_MAX_TOTAL_CONNECTIONS
|
||||
*
|
||||
* Pass a number that specifies the maximum number of simultaneously
|
||||
* open connections.
|
||||
*
|
||||
*
|
||||
*
|
||||
* CURLMOPT_PUSHFUNCTION
|
||||
*
|
||||
* Pass a callable that will be registered to handle server
|
||||
* pushes and should have the following signature:
|
||||
*
|
||||
* intpushfunction
|
||||
* resourceparent_ch
|
||||
* resourcepushed_ch
|
||||
* arrayheaders
|
||||
*
|
||||
*
|
||||
*
|
||||
* parent_ch
|
||||
*
|
||||
*
|
||||
* The parent cURL handle (the request the client made).
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* pushed_ch
|
||||
*
|
||||
*
|
||||
* A new cURL handle for the pushed request.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* headers
|
||||
*
|
||||
*
|
||||
* The push promise headers.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* The push function is supposed to return either
|
||||
* CURL_PUSH_OK if it can handle the push, or
|
||||
* CURL_PUSH_DENY to reject it.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* The parent cURL handle (the request the client made).
|
||||
*
|
||||
* A new cURL handle for the pushed request.
|
||||
*
|
||||
* The push promise headers.
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_multi_setopt(\CurlMultiHandle $multi_handle, int $option, $value): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \curl_multi_setopt($multi_handle, $option, $value);
|
||||
if ($result === false) {
|
||||
throw CurlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets an option on the given cURL session handle.
|
||||
*
|
||||
* @param resource $ch A cURL handle returned by
|
||||
* @param \CurlHandle $handle A cURL handle returned by
|
||||
* curl_init.
|
||||
* @param int $option The CURLOPT_XXX option to set.
|
||||
* @param mixed $value The value to be set on option.
|
||||
@@ -677,18 +826,6 @@ function curl_multi_init()
|
||||
*
|
||||
*
|
||||
*
|
||||
* CURLOPT_BINARYTRANSFER
|
||||
*
|
||||
* TRUE to return the raw output when
|
||||
* CURLOPT_RETURNTRANSFER is used.
|
||||
*
|
||||
*
|
||||
* From PHP 5.1.3, this option has no effect: the raw output will
|
||||
* always be returned when
|
||||
* CURLOPT_RETURNTRANSFER is used.
|
||||
*
|
||||
*
|
||||
*
|
||||
* CURLOPT_COOKIESESSION
|
||||
*
|
||||
* TRUE to mark this as a new cookie "session". It will force libcurl
|
||||
@@ -709,7 +846,6 @@ function curl_multi_init()
|
||||
*
|
||||
*
|
||||
* Added in cURL 7.19.1.
|
||||
* Available since PHP 5.3.2.
|
||||
* Requires CURLOPT_VERBOSE to be on to have an effect.
|
||||
*
|
||||
*
|
||||
@@ -722,7 +858,6 @@ function curl_multi_init()
|
||||
*
|
||||
*
|
||||
* Added in 7.15.2.
|
||||
* Available since PHP 5.5.0.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -819,9 +954,8 @@ function curl_multi_init()
|
||||
*
|
||||
* TRUE to follow any
|
||||
* "Location: " header that the server sends as
|
||||
* part of the HTTP header (note this is recursive, PHP will follow as
|
||||
* many "Location: " headers that it is sent,
|
||||
* unless CURLOPT_MAXREDIRS is set).
|
||||
* part of the HTTP header.
|
||||
* See also CURLOPT_MAXREDIRS.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -889,7 +1023,7 @@ function curl_multi_init()
|
||||
* the number of small packets on the network.
|
||||
*
|
||||
*
|
||||
* Available since PHP 5.2.1 for versions compiled with libcurl 7.11.2 or
|
||||
* Available for versions compiled with libcurl 7.11.2 or
|
||||
* greater.
|
||||
*
|
||||
*
|
||||
@@ -925,7 +1059,7 @@ function curl_multi_init()
|
||||
* TRUE to track the handle's request string.
|
||||
*
|
||||
*
|
||||
* Available since PHP 5.1.3. The CURLINFO_
|
||||
* The CURLINFO_
|
||||
* prefix is intentional.
|
||||
*
|
||||
*
|
||||
@@ -963,7 +1097,7 @@ function curl_multi_init()
|
||||
* FALSE to get the raw HTTP response body.
|
||||
*
|
||||
*
|
||||
* Available as of PHP 5.5.0 if built against libcurl >= 7.16.2.
|
||||
* Available if built against libcurl >= 7.16.2.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1082,21 +1216,6 @@ function curl_multi_init()
|
||||
*
|
||||
*
|
||||
*
|
||||
* CURLOPT_SAFE_UPLOAD
|
||||
*
|
||||
* TRUE to disable support for the @ prefix for
|
||||
* uploading files in CURLOPT_POSTFIELDS, which
|
||||
* means that values starting with @ can be safely
|
||||
* passed as fields. CURLFile may be used for
|
||||
* uploads instead.
|
||||
*
|
||||
*
|
||||
* Added in PHP 5.5.0 with FALSE as the default value. PHP 5.6.0
|
||||
* changes the default value to TRUE. PHP 7 removes this option;
|
||||
* the CURLFile interface must be used to upload files.
|
||||
*
|
||||
*
|
||||
*
|
||||
* CURLOPT_SASL_IR
|
||||
*
|
||||
* TRUE to enable sending the initial response in the first packet.
|
||||
@@ -1248,7 +1367,7 @@ function curl_multi_init()
|
||||
* PHP automatically sets this option to TRUE, this should only be
|
||||
* changed for debugging purposes.
|
||||
*
|
||||
* value should be an integer for the
|
||||
* value should be an int for the
|
||||
* following values of the option parameter:
|
||||
*
|
||||
*
|
||||
@@ -1271,21 +1390,6 @@ function curl_multi_init()
|
||||
*
|
||||
*
|
||||
*
|
||||
* CURLOPT_CLOSEPOLICY
|
||||
*
|
||||
* One of the CURLCLOSEPOLICY_* values.
|
||||
*
|
||||
*
|
||||
* This option is deprecated, as it was never implemented in cURL and
|
||||
* never had any effect.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Removed in PHP 5.6.0.
|
||||
*
|
||||
*
|
||||
*
|
||||
* CURLOPT_CONNECTTIMEOUT
|
||||
*
|
||||
* The number of seconds to wait while trying to connect. Use 0 to
|
||||
@@ -1305,7 +1409,7 @@ function curl_multi_init()
|
||||
* timeouts with a minimum timeout allowed of one second.
|
||||
*
|
||||
*
|
||||
* Added in cURL 7.16.2. Available since PHP 5.2.3.
|
||||
* Added in cURL 7.16.2.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1472,6 +1576,9 @@ function curl_multi_init()
|
||||
*
|
||||
* The maximum amount of HTTP redirections to follow. Use this option
|
||||
* alongside CURLOPT_FOLLOWLOCATION.
|
||||
* Default value of 20 is set to prevent infinite redirects.
|
||||
* Setting to -1 allows inifinite redirects, and 0
|
||||
* refuses all redirects.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1493,7 +1600,7 @@ function curl_multi_init()
|
||||
* specific type of redirect occurs.
|
||||
*
|
||||
*
|
||||
* Added in cURL 7.19.1. Available since PHP 5.3.2.
|
||||
* Added in cURL 7.19.1.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1640,10 +1747,11 @@ function curl_multi_init()
|
||||
*
|
||||
* CURLOPT_SSL_VERIFYHOST
|
||||
*
|
||||
* 1 to check the existence of a common name in the
|
||||
* SSL peer certificate. 2 to check the existence of
|
||||
* a common name and also verify that it matches the hostname
|
||||
* provided. 0 to not check the names. In production environments the value of this option
|
||||
* 2 to verify that a Common Name field or a Subject Alternate Name
|
||||
* field in the SSL peer certificate matches the provided hostname.
|
||||
* 0 to not check the names.
|
||||
* 1 should not be used.
|
||||
* In production environments the value of this option
|
||||
* should be kept at 2 (default value).
|
||||
*
|
||||
*
|
||||
@@ -1760,7 +1868,7 @@ function curl_multi_init()
|
||||
* supports them. If set to 0 (default) keepalive probes are disabled.
|
||||
*
|
||||
*
|
||||
* Added in cURL 7.25.0. Available since PHP 5.5.0.
|
||||
* Added in cURL 7.25.0.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1772,7 +1880,7 @@ function curl_multi_init()
|
||||
* The default is 60.
|
||||
*
|
||||
*
|
||||
* Added in cURL 7.25.0. Available since PHP 5.5.0.
|
||||
* Added in cURL 7.25.0.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1784,7 +1892,7 @@ function curl_multi_init()
|
||||
* The default is 60.
|
||||
*
|
||||
*
|
||||
* Added in cURL 7.25.0. Available since PHP 5.5.0.
|
||||
* Added in cURL 7.25.0.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1797,10 +1905,13 @@ function curl_multi_init()
|
||||
* a "304 Not Modified" header will be returned
|
||||
* assuming CURLOPT_HEADER is TRUE.
|
||||
* Use CURL_TIMECOND_IFUNMODSINCE for the reverse
|
||||
* effect. CURL_TIMECOND_IFMODSINCE is the
|
||||
* default.
|
||||
* effect. Use CURL_TIMECOND_NONE to ignore
|
||||
* CURLOPT_TIMEVALUE and always return the page.
|
||||
* CURL_TIMECOND_NONE is the default.
|
||||
*
|
||||
*
|
||||
* Before cURL 7.46.0 the default was
|
||||
* CURL_TIMECOND_IFMODSINCE.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1822,15 +1933,14 @@ function curl_multi_init()
|
||||
* timeouts with a minimum timeout allowed of one second.
|
||||
*
|
||||
*
|
||||
* Added in cURL 7.16.2. Available since PHP 5.2.3.
|
||||
* Added in cURL 7.16.2.
|
||||
*
|
||||
*
|
||||
*
|
||||
* CURLOPT_TIMEVALUE
|
||||
*
|
||||
* The time in seconds since January 1st, 1970. The time will be used
|
||||
* by CURLOPT_TIMECONDITION. By default,
|
||||
* CURL_TIMECOND_IFMODSINCE is used.
|
||||
* by CURLOPT_TIMECONDITION.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1857,7 +1967,7 @@ function curl_multi_init()
|
||||
* Defaults to unlimited speed.
|
||||
*
|
||||
*
|
||||
* Added in cURL 7.15.5. Available since PHP 5.4.0.
|
||||
* Added in cURL 7.15.5.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1869,7 +1979,7 @@ function curl_multi_init()
|
||||
* Defaults to unlimited speed.
|
||||
*
|
||||
*
|
||||
* Added in cURL 7.15.5. Available since PHP 5.4.0.
|
||||
* Added in cURL 7.15.5.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1910,16 +2020,13 @@ function curl_multi_init()
|
||||
* CURLFTPMETHOD_SINGLECWD.
|
||||
*
|
||||
*
|
||||
* Added in cURL 7.15.1. Available since PHP 5.3.0.
|
||||
* Added in cURL 7.15.1.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* This option is deprecated, as it was never implemented in cURL and
|
||||
* never had any effect.
|
||||
*
|
||||
* The HTTP authentication method(s) to use. The options are:
|
||||
* CURLAUTH_BASIC,
|
||||
* CURLAUTH_DIGEST,
|
||||
@@ -2074,7 +2181,7 @@ function curl_multi_init()
|
||||
* "RELOAD" loads all cookies from the files specified by CURLOPT_COOKIEFILE.
|
||||
*
|
||||
*
|
||||
* Available since PHP 5.5.0 and cURL 7.14.1.
|
||||
* Available since cURL 7.14.1.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -2239,10 +2346,7 @@ function curl_multi_init()
|
||||
*
|
||||
*
|
||||
* The full data to post in a HTTP "POST" operation.
|
||||
* To post a file, prepend a filename with @ and
|
||||
* use the full path. The filetype can be explicitly specified by
|
||||
* following the filename with the type in the format
|
||||
* ';type=mimetype'. This parameter can either be
|
||||
* This parameter can either be
|
||||
* passed as a urlencoded string like 'para1=val1&para2=val2&...'
|
||||
* or as an array with the field name as key and field data as value.
|
||||
* If value is an array, the
|
||||
@@ -2250,15 +2354,8 @@ function curl_multi_init()
|
||||
* multipart/form-data.
|
||||
*
|
||||
*
|
||||
* As of PHP 5.2.0, value must be an array if
|
||||
* files are passed to this option with the @ prefix.
|
||||
*
|
||||
*
|
||||
* As of PHP 5.5.0, the @ prefix is deprecated and
|
||||
* files can be sent using CURLFile. The
|
||||
* @ prefix can be disabled for safe passing of
|
||||
* values beginning with @ by setting the
|
||||
* CURLOPT_SAFE_UPLOAD option to TRUE.
|
||||
* Files can be sent using CURLFile or CURLStringFile,
|
||||
* in which case value must be an array.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -2709,7 +2806,16 @@ function curl_multi_init()
|
||||
* The user name to use in authentication.
|
||||
*
|
||||
*
|
||||
* Added in cURL 7.19.1. Available since PHP 5.5.0.
|
||||
* Added in cURL 7.19.1.
|
||||
*
|
||||
*
|
||||
*
|
||||
* CURLOPT_PASSWORD
|
||||
*
|
||||
* The password to use in authentication.
|
||||
*
|
||||
*
|
||||
* Added in cURL 7.19.1.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -2864,7 +2970,7 @@ function curl_multi_init()
|
||||
*
|
||||
*
|
||||
*
|
||||
* Added in cURL 7.21.3. Available since PHP 5.5.0.
|
||||
* Added in cURL 7.21.3.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -3031,12 +3137,12 @@ function curl_multi_init()
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_setopt($ch, int $option, $value): void
|
||||
function curl_setopt(\CurlHandle $handle, int $option, $value): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \curl_setopt($ch, $option, $value);
|
||||
$result = \curl_setopt($handle, $option, $value);
|
||||
if ($result === false) {
|
||||
throw CurlException::createFromCurlResource($ch);
|
||||
throw CurlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3044,15 +3150,16 @@ function curl_setopt($ch, int $option, $value): void
|
||||
/**
|
||||
* Return an integer containing the last share curl error number.
|
||||
*
|
||||
* @param resource $sh A cURL share handle returned by curl_share_init.
|
||||
* @param \CurlShareHandle $share_handle A cURL share handle returned by
|
||||
* curl_share_init.
|
||||
* @return int Returns an integer containing the last share curl error number.
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_share_errno($sh): int
|
||||
function curl_share_errno(\CurlShareHandle $share_handle): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \curl_share_errno($sh);
|
||||
$result = \curl_share_errno($share_handle);
|
||||
if ($result === false) {
|
||||
throw CurlException::createFromPhpError();
|
||||
}
|
||||
@@ -3063,7 +3170,8 @@ function curl_share_errno($sh): int
|
||||
/**
|
||||
* Sets an option on the given cURL share handle.
|
||||
*
|
||||
* @param resource $sh A cURL share handle returned by curl_share_init.
|
||||
* @param \CurlShareHandle $share_handle A cURL share handle returned by
|
||||
* curl_share_init.
|
||||
* @param int $option
|
||||
*
|
||||
*
|
||||
@@ -3088,7 +3196,7 @@ function curl_share_errno($sh): int
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param string $value
|
||||
* @param mixed $value
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -3125,10 +3233,10 @@ function curl_share_errno($sh): int
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_share_setopt($sh, int $option, string $value): void
|
||||
function curl_share_setopt(\CurlShareHandle $share_handle, int $option, $value): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \curl_share_setopt($sh, $option, $value);
|
||||
$result = \curl_share_setopt($share_handle, $option, $value);
|
||||
if ($result === false) {
|
||||
throw CurlException::createFromPhpError();
|
||||
}
|
||||
@@ -3138,19 +3246,19 @@ function curl_share_setopt($sh, int $option, string $value): void
|
||||
/**
|
||||
* This function decodes the given URL encoded string.
|
||||
*
|
||||
* @param resource $ch A cURL handle returned by
|
||||
* @param \CurlHandle $handle A cURL handle returned by
|
||||
* curl_init.
|
||||
* @param string $str The URL encoded string to be decoded.
|
||||
* @param string $string The URL encoded string to be decoded.
|
||||
* @return string Returns decoded string.
|
||||
* @throws CurlException
|
||||
*
|
||||
*/
|
||||
function curl_unescape($ch, string $str): string
|
||||
function curl_unescape(\CurlHandle $handle, string $string): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \curl_unescape($ch, $str);
|
||||
$result = \curl_unescape($handle, $string);
|
||||
if ($result === false) {
|
||||
throw CurlException::createFromCurlResource($ch);
|
||||
throw CurlException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
629
vendor/thecodingmachine/safe/generated/datetime.php
vendored
629
vendor/thecodingmachine/safe/generated/datetime.php
vendored
@@ -9,11 +9,11 @@ use Safe\Exceptions\DatetimeException;
|
||||
*
|
||||
* @param string $format Format accepted by DateTime::createFromFormat.
|
||||
* @param string $datetime String representing the date/time.
|
||||
* @return array Returns associative array with detailed info about given date/time.
|
||||
* @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 Returns associative array with detailed info about given date/time.
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function date_parse_from_format(string $format, string $datetime): array
|
||||
function date_parse_from_format(string $format, string $datetime): ?array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \date_parse_from_format($format, $datetime);
|
||||
@@ -25,16 +25,30 @@ function date_parse_from_format(string $format, string $datetime): array
|
||||
|
||||
|
||||
/**
|
||||
* date_parse parses the given
|
||||
* datetime string according to the same rules as
|
||||
* strtotime and
|
||||
* DateTimeImmutable::__construct. Instead of returning a
|
||||
* Unix timestamp (with strtotime) or a
|
||||
* DateTimeImmutable object (with
|
||||
* DateTimeImmutable::__construct, it returns an
|
||||
* associative array with the information that it could detect in the given
|
||||
* datetime string.
|
||||
*
|
||||
* If no information about a certain group of elements can be found, these
|
||||
* array elements will be set to FALSE or are missing. If needed for
|
||||
* constructing a timestamp or DateTimeImmutable object from
|
||||
* the same datetime string, more fields can be set to
|
||||
* a non-FALSE value. See the examples for cases where that happens.
|
||||
*
|
||||
* @param string $datetime Date/time in format accepted by
|
||||
* DateTimeImmutable::__construct.
|
||||
* @return array Returns array with information about the parsed date/time
|
||||
* @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 Returns array with information about the parsed date/time
|
||||
* on success.
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function date_parse(string $datetime): array
|
||||
function date_parse(string $datetime): ?array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \date_parse($datetime);
|
||||
@@ -180,7 +194,7 @@ function date_sun_info(int $timestamp, float $latitude, float $longitude): array
|
||||
*
|
||||
*
|
||||
* SUNFUNCS_RET_TIMESTAMP
|
||||
* returns the result as integer (timestamp)
|
||||
* returns the result as int (timestamp)
|
||||
* 1095034606
|
||||
*
|
||||
*
|
||||
@@ -233,10 +247,10 @@ function date_sun_info(int $timestamp, float $latitude, float $longitude): array
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function date_sunrise(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, float $latitude = null, float $longitude = null, float $zenith = null, float $utcOffset = 0)
|
||||
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 !== 0) {
|
||||
if ($utcOffset !== null) {
|
||||
$result = \date_sunrise($timestamp, $returnFormat, $latitude, $longitude, $zenith, $utcOffset);
|
||||
} elseif ($zenith !== null) {
|
||||
$result = \date_sunrise($timestamp, $returnFormat, $latitude, $longitude, $zenith);
|
||||
@@ -283,7 +297,7 @@ function date_sunrise(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, f
|
||||
*
|
||||
*
|
||||
* SUNFUNCS_RET_TIMESTAMP
|
||||
* returns the result as integer (timestamp)
|
||||
* returns the result as int (timestamp)
|
||||
* 1095034606
|
||||
*
|
||||
*
|
||||
@@ -336,10 +350,10 @@ function date_sunrise(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, f
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function date_sunset(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, float $latitude = null, float $longitude = null, float $zenith = null, float $utcOffset = 0)
|
||||
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 !== 0) {
|
||||
if ($utcOffset !== null) {
|
||||
$result = \date_sunset($timestamp, $returnFormat, $latitude, $longitude, $zenith, $utcOffset);
|
||||
} elseif ($zenith !== null) {
|
||||
$result = \date_sunset($timestamp, $returnFormat, $latitude, $longitude, $zenith);
|
||||
@@ -359,14 +373,19 @@ function date_sunset(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, fl
|
||||
|
||||
/**
|
||||
* Returns a string formatted according to the given format string using the
|
||||
* given integer timestamp or the current time
|
||||
* if no timestamp is given. In other words, timestamp
|
||||
* given integer timestamp (Unix timestamp) or the current time
|
||||
* if no timestamp is given. In other words, timestamp
|
||||
* is optional and defaults to the value of time.
|
||||
*
|
||||
* Unix timestamps do not handle timezones. Use the
|
||||
* DateTimeImmutable class, and its
|
||||
* DateTimeInterface::format formatting method to
|
||||
* format date/time information with a timezone attached.
|
||||
*
|
||||
* @param string $format Format accepted by DateTimeInterface::format.
|
||||
* @param int $timestamp The optional timestamp parameter is an
|
||||
* integer Unix timestamp that defaults to the current
|
||||
* local time if a timestamp is not given. In other
|
||||
* int Unix timestamp that defaults to the current
|
||||
* local time if timestamp is omitted or NULL. In other
|
||||
* words, it defaults to the value of time.
|
||||
* @return string Returns a formatted date string. If a non-numeric value is used for
|
||||
* timestamp, FALSE is returned and an
|
||||
@@ -390,28 +409,219 @@ function date(string $format, int $timestamp = null): string
|
||||
|
||||
|
||||
/**
|
||||
* Identical to the date function except that
|
||||
* the time returned is Greenwich Mean Time (GMT).
|
||||
* Identical to mktime except the passed parameters represents a
|
||||
* GMT date. gmmktime internally uses mktime
|
||||
* so only times valid in derived local time can be used.
|
||||
*
|
||||
* @param string $format The format of the outputted date string. See the formatting
|
||||
* options for the date function.
|
||||
* @param int $timestamp The optional timestamp parameter is an
|
||||
* integer Unix timestamp that defaults to the current
|
||||
* local time if a timestamp is not given. In other
|
||||
* words, it defaults to the value of time.
|
||||
* @return string Returns a formatted date string. If a non-numeric value is used for
|
||||
* timestamp, FALSE is returned and an
|
||||
* E_WARNING level error is emitted.
|
||||
* Like mktime, arguments may be left out in order
|
||||
* from right to left, with any omitted arguments being set to the
|
||||
* current corresponding GMT value.
|
||||
*
|
||||
* @param int $hour The number of the hour relative to the start of the day determined by
|
||||
* month, day and year.
|
||||
* Negative values reference the hour before midnight of the day in question.
|
||||
* Values greater than 23 reference the appropriate hour in the following day(s).
|
||||
* @param int $minute The number of the minute relative to the start of the hour.
|
||||
* Negative values reference the minute in the previous hour.
|
||||
* Values greater than 59 reference the appropriate minute in the following hour(s).
|
||||
* @param int $second The number of seconds relative to the start of the minute.
|
||||
* Negative values reference the second in the previous minute.
|
||||
* Values greater than 59 reference the appropriate second in the following minute(s).
|
||||
* @param int $month The number of the month relative to the end of the previous year.
|
||||
* Values 1 to 12 reference the normal calendar months of the year in question.
|
||||
* Values less than 1 (including negative values) reference the months in the previous year in reverse order, so 0 is December, -1 is November, etc.
|
||||
* Values greater than 12 reference the appropriate month in the following year(s).
|
||||
* @param int $day The number of the day relative to the end of the previous month.
|
||||
* Values 1 to 28, 29, 30 or 31 (depending upon the month) reference the normal days in the relevant month.
|
||||
* Values less than 1 (including negative values) reference the days in the previous month, so 0 is the last day of the previous month, -1 is the day before that, etc.
|
||||
* Values greater than the number of days in the relevant month reference the appropriate day in the following month(s).
|
||||
* @param int $year The year
|
||||
* @return int Returns a int Unix timestamp on success.
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function gmdate(string $format, int $timestamp = null): string
|
||||
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) {
|
||||
$result = \gmmktime($hour, $minute, $second, $month, $day, $year);
|
||||
} elseif ($day !== null) {
|
||||
$result = \gmmktime($hour, $minute, $second, $month, $day);
|
||||
} elseif ($month !== null) {
|
||||
$result = \gmmktime($hour, $minute, $second, $month);
|
||||
} elseif ($second !== null) {
|
||||
$result = \gmmktime($hour, $minute, $second);
|
||||
} elseif ($minute !== null) {
|
||||
$result = \gmmktime($hour, $minute);
|
||||
} else {
|
||||
$result = \gmmktime($hour);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Behaves the same as strftime except that the
|
||||
* time returned is Greenwich Mean Time (GMT). For example, when run
|
||||
* in Eastern Standard Time (GMT -0500), the first line below prints
|
||||
* "Dec 31 1998 20:00:00", while the second prints "Jan 01 1999
|
||||
* 01:00:00".
|
||||
*
|
||||
* @param string $format See description in strftime.
|
||||
* @param int $timestamp The optional timestamp parameter is an
|
||||
* int Unix timestamp that defaults to the current
|
||||
* local time if timestamp is omitted or NULL. In other
|
||||
* words, it defaults to the value of time.
|
||||
* @return string Returns a string formatted according to the given format string
|
||||
* using the given timestamp or the current
|
||||
* local time if no timestamp is given. Month and weekday names and
|
||||
* other language dependent strings respect the current locale set
|
||||
* with setlocale.
|
||||
* On failure, FALSE is returned.
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function gmstrftime(string $format, int $timestamp = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($timestamp !== null) {
|
||||
$result = \gmdate($format, $timestamp);
|
||||
$result = \gmstrftime($format, $timestamp);
|
||||
} else {
|
||||
$result = \gmdate($format);
|
||||
$result = \gmstrftime($format);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a number formatted according to the given format string using the
|
||||
* given integer timestamp or the current local time
|
||||
* if no timestamp is given. In other words, timestamp
|
||||
* is optional and defaults to the value of time.
|
||||
*
|
||||
* Unlike the function date, idate
|
||||
* accepts just one char in the format parameter.
|
||||
*
|
||||
* @param string $format
|
||||
* The following characters are recognized in the
|
||||
* format parameter string
|
||||
*
|
||||
*
|
||||
*
|
||||
* format character
|
||||
* Description
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* B
|
||||
* Swatch Beat/Internet Time
|
||||
*
|
||||
*
|
||||
* d
|
||||
* Day of the month
|
||||
*
|
||||
*
|
||||
* h
|
||||
* Hour (12 hour format)
|
||||
*
|
||||
*
|
||||
* H
|
||||
* Hour (24 hour format)
|
||||
*
|
||||
*
|
||||
* i
|
||||
* Minutes
|
||||
*
|
||||
*
|
||||
* I (uppercase i)
|
||||
* returns 1 if DST is activated,
|
||||
* 0 otherwise
|
||||
*
|
||||
*
|
||||
* L (uppercase l)
|
||||
* returns 1 for leap year,
|
||||
* 0 otherwise
|
||||
*
|
||||
*
|
||||
* m
|
||||
* Month number
|
||||
*
|
||||
*
|
||||
* N
|
||||
* ISO-8601 day of the week (1 for Monday
|
||||
* through 7 for Sunday)
|
||||
*
|
||||
*
|
||||
* o
|
||||
* ISO-8601 year (4 digits)
|
||||
*
|
||||
*
|
||||
* s
|
||||
* Seconds
|
||||
*
|
||||
*
|
||||
* t
|
||||
* Days in current month
|
||||
*
|
||||
*
|
||||
* U
|
||||
* Seconds since the Unix Epoch - January 1 1970 00:00:00 UTC -
|
||||
* this is the same as time
|
||||
*
|
||||
*
|
||||
* w
|
||||
* Day of the week (0 on Sunday)
|
||||
*
|
||||
*
|
||||
* W
|
||||
* ISO-8601 week number of year, weeks starting on
|
||||
* Monday
|
||||
*
|
||||
*
|
||||
* y
|
||||
* Year (1 or 2 digits - check note below)
|
||||
*
|
||||
*
|
||||
* Y
|
||||
* Year (4 digits)
|
||||
*
|
||||
*
|
||||
* z
|
||||
* Day of the year
|
||||
*
|
||||
*
|
||||
* Z
|
||||
* Timezone offset in seconds
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param int $timestamp The optional timestamp parameter is an
|
||||
* int Unix timestamp that defaults to the current
|
||||
* local time if timestamp is omitted or NULL. In other
|
||||
* words, it defaults to the value of time.
|
||||
* @return int Returns an int on success.
|
||||
*
|
||||
* As idate always returns an int and
|
||||
* as they can't start with a "0", idate may return
|
||||
* fewer digits than you would expect. See the example below.
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function idate(string $format, int $timestamp = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($timestamp !== null) {
|
||||
$result = \idate($format, $timestamp);
|
||||
} else {
|
||||
$result = \idate($format);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
@@ -452,16 +662,14 @@ function gmdate(string $format, int $timestamp = null): string
|
||||
* with values between 0-69 mapping to 2000-2069 and 70-100 to
|
||||
* 1970-2000. On systems where time_t is a 32bit signed integer, as
|
||||
* most common today, the valid range for year
|
||||
* is somewhere between 1901 and 2038. However, before PHP 5.1.0 this
|
||||
* range was limited from 1970 to 2038 on some systems (e.g. Windows).
|
||||
* is somewhere between 1901 and 2038.
|
||||
* @return int mktime returns the Unix timestamp of the arguments
|
||||
* given.
|
||||
* If the arguments are invalid, the function returns FALSE (before PHP 5.1
|
||||
* it returned -1).
|
||||
* If the arguments are invalid, the function returns FALSE.
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function mktime(int $hour = null, int $minute = null, int $second = null, int $month = null, int $day = null, int $year = null): int
|
||||
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) {
|
||||
@@ -474,10 +682,336 @@ function mktime(int $hour = null, int $minute = null, int $second = null, int $m
|
||||
$result = \mktime($hour, $minute, $second);
|
||||
} elseif ($minute !== null) {
|
||||
$result = \mktime($hour, $minute);
|
||||
} elseif ($hour !== null) {
|
||||
$result = \mktime($hour);
|
||||
} else {
|
||||
$result = \mktime();
|
||||
$result = \mktime($hour);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Format the time and/or date according to locale settings. Month and weekday
|
||||
* names and other language-dependent strings respect the current locale set
|
||||
* with setlocale.
|
||||
*
|
||||
* Not all conversion specifiers may be supported by your C library, in which
|
||||
* case they will not be supported by PHP's strftime.
|
||||
* Additionally, not all platforms support negative timestamps, so your
|
||||
* date range may be limited to no earlier than the Unix epoch. This means that
|
||||
* %e, %T, %R and, %D (and possibly others) - as well as dates prior to
|
||||
* Jan 1, 1970 - will not work on Windows, some Linux
|
||||
* distributions, and a few other operating systems. For Windows systems, a
|
||||
* complete overview of supported conversion specifiers can be found at
|
||||
* MSDN.
|
||||
*
|
||||
* @param string $format
|
||||
* The following characters are recognized in the
|
||||
* format parameter string
|
||||
*
|
||||
*
|
||||
*
|
||||
* format
|
||||
* Description
|
||||
* Example returned values
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Day
|
||||
* ---
|
||||
* ---
|
||||
*
|
||||
*
|
||||
* %a
|
||||
* An abbreviated textual representation of the day
|
||||
* Sun through Sat
|
||||
*
|
||||
*
|
||||
* %A
|
||||
* A full textual representation of the day
|
||||
* Sunday through Saturday
|
||||
*
|
||||
*
|
||||
* %d
|
||||
* Two-digit day of the month (with leading zeros)
|
||||
* 01 to 31
|
||||
*
|
||||
*
|
||||
* %e
|
||||
*
|
||||
* Day of the month, with a space preceding single digits. Not
|
||||
* implemented as described on Windows. See below for more information.
|
||||
*
|
||||
* 1 to 31
|
||||
*
|
||||
*
|
||||
* %j
|
||||
* Day of the year, 3 digits with leading zeros
|
||||
* 001 to 366
|
||||
*
|
||||
*
|
||||
* %u
|
||||
* ISO-8601 numeric representation of the day of the week
|
||||
* 1 (for Monday) through 7 (for Sunday)
|
||||
*
|
||||
*
|
||||
* %w
|
||||
* Numeric representation of the day of the week
|
||||
* 0 (for Sunday) through 6 (for Saturday)
|
||||
*
|
||||
*
|
||||
* Week
|
||||
* ---
|
||||
* ---
|
||||
*
|
||||
*
|
||||
* %U
|
||||
* Week number of the given year, starting with the first
|
||||
* Sunday as the first week
|
||||
* 13 (for the 13th full week of the year)
|
||||
*
|
||||
*
|
||||
* %V
|
||||
* ISO-8601:1988 week number of the given year, starting with
|
||||
* the first week of the year with at least 4 weekdays, with Monday
|
||||
* being the start of the week
|
||||
* 01 through 53 (where 53
|
||||
* accounts for an overlapping week)
|
||||
*
|
||||
*
|
||||
* %W
|
||||
* A numeric representation of the week of the year, starting
|
||||
* with the first Monday as the first week
|
||||
* 46 (for the 46th week of the year beginning
|
||||
* with a Monday)
|
||||
*
|
||||
*
|
||||
* Month
|
||||
* ---
|
||||
* ---
|
||||
*
|
||||
*
|
||||
* %b
|
||||
* Abbreviated month name, based on the locale
|
||||
* Jan through Dec
|
||||
*
|
||||
*
|
||||
* %B
|
||||
* Full month name, based on the locale
|
||||
* January through December
|
||||
*
|
||||
*
|
||||
* %h
|
||||
* Abbreviated month name, based on the locale (an alias of %b)
|
||||
* Jan through Dec
|
||||
*
|
||||
*
|
||||
* %m
|
||||
* Two digit representation of the month
|
||||
* 01 (for January) through 12 (for December)
|
||||
*
|
||||
*
|
||||
* Year
|
||||
* ---
|
||||
* ---
|
||||
*
|
||||
*
|
||||
* %C
|
||||
* Two digit representation of the century (year divided by 100, truncated to an integer)
|
||||
* 19 for the 20th Century
|
||||
*
|
||||
*
|
||||
* %g
|
||||
* Two digit representation of the year going by ISO-8601:1988 standards (see %V)
|
||||
* Example: 09 for the week of January 6, 2009
|
||||
*
|
||||
*
|
||||
* %G
|
||||
* The full four-digit version of %g
|
||||
* Example: 2008 for the week of January 3, 2009
|
||||
*
|
||||
*
|
||||
* %y
|
||||
* Two digit representation of the year
|
||||
* Example: 09 for 2009, 79 for 1979
|
||||
*
|
||||
*
|
||||
* %Y
|
||||
* Four digit representation for the year
|
||||
* Example: 2038
|
||||
*
|
||||
*
|
||||
* Time
|
||||
* ---
|
||||
* ---
|
||||
*
|
||||
*
|
||||
* %H
|
||||
* Two digit representation of the hour in 24-hour format
|
||||
* 00 through 23
|
||||
*
|
||||
*
|
||||
* %k
|
||||
* Hour in 24-hour format, with a space preceding single digits
|
||||
* 0 through 23
|
||||
*
|
||||
*
|
||||
* %I
|
||||
* Two digit representation of the hour in 12-hour format
|
||||
* 01 through 12
|
||||
*
|
||||
*
|
||||
* %l (lower-case 'L')
|
||||
* Hour in 12-hour format, with a space preceding single digits
|
||||
* 1 through 12
|
||||
*
|
||||
*
|
||||
* %M
|
||||
* Two digit representation of the minute
|
||||
* 00 through 59
|
||||
*
|
||||
*
|
||||
* %p
|
||||
* UPPER-CASE 'AM' or 'PM' based on the given time
|
||||
* Example: AM for 00:31,
|
||||
* PM for 22:23. The exact result depends on the
|
||||
* Operating System, and they can also return lower-case variants, or
|
||||
* variants with dots (such as a.m.).
|
||||
*
|
||||
*
|
||||
* %P
|
||||
* lower-case 'am' or 'pm' based on the given time
|
||||
* Example: am for 00:31,
|
||||
* pm for 22:23. Not supported by all Operating
|
||||
* Systems.
|
||||
*
|
||||
*
|
||||
* %r
|
||||
* Same as "%I:%M:%S %p"
|
||||
* Example: 09:34:17 PM for 21:34:17
|
||||
*
|
||||
*
|
||||
* %R
|
||||
* Same as "%H:%M"
|
||||
* Example: 00:35 for 12:35 AM, 16:44 for 4:44 PM
|
||||
*
|
||||
*
|
||||
* %S
|
||||
* Two digit representation of the second
|
||||
* 00 through 59
|
||||
*
|
||||
*
|
||||
* %T
|
||||
* Same as "%H:%M:%S"
|
||||
* Example: 21:34:17 for 09:34:17 PM
|
||||
*
|
||||
*
|
||||
* %X
|
||||
* Preferred time representation based on locale, without the date
|
||||
* Example: 03:59:16 or 15:59:16
|
||||
*
|
||||
*
|
||||
* %z
|
||||
* The time zone offset. Not implemented as described on
|
||||
* Windows. See below for more information.
|
||||
* Example: -0500 for US Eastern Time
|
||||
*
|
||||
*
|
||||
* %Z
|
||||
* The time zone abbreviation. Not implemented as described on
|
||||
* Windows. See below for more information.
|
||||
* Example: EST for Eastern Time
|
||||
*
|
||||
*
|
||||
* Time and Date Stamps
|
||||
* ---
|
||||
* ---
|
||||
*
|
||||
*
|
||||
* %c
|
||||
* Preferred date and time stamp based on locale
|
||||
* Example: Tue Feb 5 00:45:10 2009 for
|
||||
* February 5, 2009 at 12:45:10 AM
|
||||
*
|
||||
*
|
||||
* %D
|
||||
* Same as "%m/%d/%y"
|
||||
* Example: 02/05/09 for February 5, 2009
|
||||
*
|
||||
*
|
||||
* %F
|
||||
* Same as "%Y-%m-%d" (commonly used in database datestamps)
|
||||
* Example: 2009-02-05 for February 5, 2009
|
||||
*
|
||||
*
|
||||
* %s
|
||||
* Unix Epoch Time timestamp (same as the time
|
||||
* function)
|
||||
* Example: 305815200 for September 10, 1979 08:40:00 AM
|
||||
*
|
||||
*
|
||||
* %x
|
||||
* Preferred date representation based on locale, without the time
|
||||
* Example: 02/05/09 for February 5, 2009
|
||||
*
|
||||
*
|
||||
* Miscellaneous
|
||||
* ---
|
||||
* ---
|
||||
*
|
||||
*
|
||||
* %n
|
||||
* A newline character ("\n")
|
||||
* ---
|
||||
*
|
||||
*
|
||||
* %t
|
||||
* A Tab character ("\t")
|
||||
* ---
|
||||
*
|
||||
*
|
||||
* %%
|
||||
* A literal percentage character ("%")
|
||||
* ---
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Windows only:
|
||||
*
|
||||
* The %e modifier is not supported in the Windows
|
||||
* implementation of this function. To achieve this value, the
|
||||
* %#d modifier can be used instead. The example below
|
||||
* illustrates how to write a cross platform compatible function.
|
||||
*
|
||||
* The %z and %Z modifiers both
|
||||
* return the time zone name instead of the offset or abbreviation.
|
||||
* @param int $timestamp The optional timestamp parameter is an
|
||||
* int Unix timestamp that defaults to the current
|
||||
* local time if timestamp is omitted or NULL. In other
|
||||
* words, it defaults to the value of time.
|
||||
* @return string Returns a string formatted according format
|
||||
* using the given timestamp or the current
|
||||
* local time if no timestamp is given. Month and weekday names and
|
||||
* other language-dependent strings respect the current locale set
|
||||
* with setlocale.
|
||||
* The function returns FALSE if format is empty, contains unsupported
|
||||
* conversion specifiers, or if the length of the returned string would be greater than
|
||||
* 4095.
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function strftime(string $format, int $timestamp = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($timestamp !== null) {
|
||||
$result = \strftime($format, $timestamp);
|
||||
} else {
|
||||
$result = \strftime($format);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
@@ -488,13 +1022,13 @@ function mktime(int $hour = null, int $minute = null, int $second = null, int $m
|
||||
|
||||
/**
|
||||
* strptime returns an array with the
|
||||
* date parsed.
|
||||
* timestamp parsed.
|
||||
*
|
||||
* Month and weekday names and other language dependent strings respect the
|
||||
* current locale set with setlocale (LC_TIME).
|
||||
*
|
||||
* @param string $date The string to parse (e.g. returned from strftime).
|
||||
* @param string $format The format used in date (e.g. the same as
|
||||
* @param string $timestamp The string to parse (e.g. returned from strftime).
|
||||
* @param string $format The format used in timestamp (e.g. the same as
|
||||
* used in strftime). Note that some of the format
|
||||
* options available to strftime may not have any
|
||||
* effect within strptime; the exact subset that are
|
||||
@@ -549,7 +1083,7 @@ function mktime(int $hour = null, int $minute = null, int $second = null, int $m
|
||||
*
|
||||
*
|
||||
* "unparsed"
|
||||
* the date part which was not
|
||||
* the timestamp part which was not
|
||||
* recognized using the specified format
|
||||
*
|
||||
*
|
||||
@@ -558,10 +1092,10 @@ function mktime(int $hour = null, int $minute = null, int $second = null, int $m
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function strptime(string $date, string $format): array
|
||||
function strptime(string $timestamp, string $format): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \strptime($date, $format);
|
||||
$result = \strptime($timestamp, $format);
|
||||
if ($result === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
@@ -577,18 +1111,17 @@ function strptime(string $date, string $format): array
|
||||
* ways to define the default time zone.
|
||||
*
|
||||
* @param string $datetime A date/time string. Valid formats are explained in Date and Time Formats.
|
||||
* @param int $now The timestamp which is used as a base for the calculation of relative
|
||||
* @param int $baseTimestamp The timestamp which is used as a base for the calculation of relative
|
||||
* dates.
|
||||
* @return int Returns a timestamp on success, FALSE otherwise. Previous to PHP 5.1.0,
|
||||
* this function would return -1 on failure.
|
||||
* @return int Returns a timestamp on success, FALSE otherwise.
|
||||
* @throws DatetimeException
|
||||
*
|
||||
*/
|
||||
function strtotime(string $datetime, int $now = null): int
|
||||
function strtotime(string $datetime, int $baseTimestamp = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($now !== null) {
|
||||
$result = \strtotime($datetime, $now);
|
||||
if ($baseTimestamp !== null) {
|
||||
$result = \strtotime($datetime, $baseTimestamp);
|
||||
} else {
|
||||
$result = \strtotime($datetime);
|
||||
}
|
||||
|
||||
37
vendor/thecodingmachine/safe/generated/dir.php
vendored
37
vendor/thecodingmachine/safe/generated/dir.php
vendored
@@ -31,6 +31,9 @@ function chdir(string $directory): void
|
||||
* only when using the CLI, CGI or Embed SAPI. Also, this function
|
||||
* requires root privileges.
|
||||
*
|
||||
* Calling this function does not change the values of the __DIR__
|
||||
* and __FILE__ magic constants.
|
||||
*
|
||||
* @param string $directory The path to change the root directory to.
|
||||
* @throws DirException
|
||||
*
|
||||
@@ -74,7 +77,7 @@ function getcwd(): string
|
||||
* closedir, readdir, and
|
||||
* rewinddir calls.
|
||||
*
|
||||
* @param string $path The directory path that is to be opened
|
||||
* @param string $directory The directory path that is to be opened
|
||||
* @param resource $context For a description of the context parameter,
|
||||
* refer to the streams section of
|
||||
* the manual.
|
||||
@@ -82,13 +85,13 @@ function getcwd(): string
|
||||
* @throws DirException
|
||||
*
|
||||
*/
|
||||
function opendir(string $path, $context = null)
|
||||
function opendir(string $directory, $context = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($context !== null) {
|
||||
$result = \opendir($path, $context);
|
||||
$result = \opendir($directory, $context);
|
||||
} else {
|
||||
$result = \opendir($path);
|
||||
$result = \opendir($directory);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw DirException::createFromPhpError();
|
||||
@@ -97,32 +100,6 @@ function opendir(string $path, $context = null)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Resets the directory stream indicated by
|
||||
* dir_handle to the beginning of the
|
||||
* directory.
|
||||
*
|
||||
* @param resource $dir_handle The directory handle resource previously opened
|
||||
* with opendir. If the directory handle is
|
||||
* not specified, the last link opened by opendir
|
||||
* is assumed.
|
||||
* @throws DirException
|
||||
*
|
||||
*/
|
||||
function rewinddir($dir_handle = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($dir_handle !== null) {
|
||||
$result = \rewinddir($dir_handle);
|
||||
} else {
|
||||
$result = \rewinddir();
|
||||
}
|
||||
if ($result === false) {
|
||||
throw DirException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns an array of files and directories from the
|
||||
* directory.
|
||||
|
||||
97
vendor/thecodingmachine/safe/generated/eio.php
vendored
97
vendor/thecodingmachine/safe/generated/eio.php
vendored
@@ -413,6 +413,57 @@ function eio_fchmod($fd, int $mode, int $pri = EIO_PRI_DEFAULT, callable $callba
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* eio_fchown changes ownership of the file specified by
|
||||
* fd file descriptor.
|
||||
*
|
||||
* @param mixed $fd Stream, Socket resource, or numeric file descriptor.
|
||||
* @param int $uid User ID. Is ignored when equal to -1.
|
||||
* @param int $gid Group ID. Is ignored when equal to -1.
|
||||
* @param int $pri The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL.
|
||||
* If NULL passed, pri internally is set to
|
||||
* EIO_PRI_DEFAULT.
|
||||
* @param callable $callback
|
||||
* callback function is called when the request is done.
|
||||
* It should match the following prototype:
|
||||
*
|
||||
*
|
||||
* data
|
||||
* is custom data passed to the request.
|
||||
*
|
||||
*
|
||||
* result
|
||||
* request-specific result value; basically, the value returned by corresponding
|
||||
* system call.
|
||||
*
|
||||
*
|
||||
* req
|
||||
* is optional request resource which can be used with functions like eio_get_last_error
|
||||
*
|
||||
*
|
||||
*
|
||||
* is custom data passed to the request.
|
||||
*
|
||||
* request-specific result value; basically, the value returned by corresponding
|
||||
* system call.
|
||||
*
|
||||
* is optional request resource which can be used with functions like eio_get_last_error
|
||||
* @param mixed $data is custom data passed to the request.
|
||||
* @return resource eio_chmod returns request resource on success.
|
||||
* @throws EioException
|
||||
*
|
||||
*/
|
||||
function eio_fchown($fd, int $uid, int $gid = -1, int $pri = EIO_PRI_DEFAULT, callable $callback = null, $data = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \eio_fchown($fd, $uid, $gid, $pri, $callback, $data);
|
||||
if ($result === false) {
|
||||
throw EioException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* eio_fdatasync synchronizes a file's in-core state with storage device.
|
||||
*
|
||||
@@ -1061,7 +1112,8 @@ function eio_readahead($fd, int $offset, int $length, int $pri = EIO_PRI_DEFAULT
|
||||
*
|
||||
* is optional request resource which can be used with functions like eio_get_last_error
|
||||
* @param string $data is custom data passed to the request.
|
||||
* @return resource eio_readdir returns request resource on success. Sets result argument of
|
||||
* @return resource eio_readdir returns request resource on success.
|
||||
* Sets result argument of
|
||||
* callback function according to
|
||||
* flags:
|
||||
*
|
||||
@@ -1071,7 +1123,7 @@ function eio_readahead($fd, int $offset, int $length, int $pri = EIO_PRI_DEFAULT
|
||||
*
|
||||
*
|
||||
* EIO_READDIR_DENTS
|
||||
* (integer)
|
||||
* (int)
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1091,7 +1143,7 @@ function eio_readahead($fd, int $offset, int $length, int $pri = EIO_PRI_DEFAULT
|
||||
*
|
||||
*
|
||||
* EIO_READDIR_DIRS_FIRST
|
||||
* (integer)
|
||||
* (int)
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1103,7 +1155,7 @@ function eio_readahead($fd, int $offset, int $length, int $pri = EIO_PRI_DEFAULT
|
||||
*
|
||||
*
|
||||
* EIO_READDIR_STAT_ORDER
|
||||
* (integer)
|
||||
* (int)
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1118,7 +1170,7 @@ function eio_readahead($fd, int $offset, int $length, int $pri = EIO_PRI_DEFAULT
|
||||
*
|
||||
*
|
||||
* EIO_READDIR_FOUND_UNKNOWN
|
||||
* (integer)
|
||||
* (int)
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1137,7 +1189,7 @@ function eio_readahead($fd, int $offset, int $length, int $pri = EIO_PRI_DEFAULT
|
||||
*
|
||||
*
|
||||
* EIO_DT_UNKNOWN
|
||||
* (integer)
|
||||
* (int)
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1148,7 +1200,7 @@ function eio_readahead($fd, int $offset, int $length, int $pri = EIO_PRI_DEFAULT
|
||||
*
|
||||
*
|
||||
* EIO_DT_FIFO
|
||||
* (integer)
|
||||
* (int)
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1159,7 +1211,7 @@ function eio_readahead($fd, int $offset, int $length, int $pri = EIO_PRI_DEFAULT
|
||||
*
|
||||
*
|
||||
* EIO_DT_CHR
|
||||
* (integer)
|
||||
* (int)
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1170,7 +1222,7 @@ function eio_readahead($fd, int $offset, int $length, int $pri = EIO_PRI_DEFAULT
|
||||
*
|
||||
*
|
||||
* EIO_DT_MPC
|
||||
* (integer)
|
||||
* (int)
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1181,7 +1233,7 @@ function eio_readahead($fd, int $offset, int $length, int $pri = EIO_PRI_DEFAULT
|
||||
*
|
||||
*
|
||||
* EIO_DT_DIR
|
||||
* (integer)
|
||||
* (int)
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1192,7 +1244,7 @@ function eio_readahead($fd, int $offset, int $length, int $pri = EIO_PRI_DEFAULT
|
||||
*
|
||||
*
|
||||
* EIO_DT_NAM
|
||||
* (integer)
|
||||
* (int)
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1203,7 +1255,7 @@ function eio_readahead($fd, int $offset, int $length, int $pri = EIO_PRI_DEFAULT
|
||||
*
|
||||
*
|
||||
* EIO_DT_BLK
|
||||
* (integer)
|
||||
* (int)
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1214,7 +1266,7 @@ function eio_readahead($fd, int $offset, int $length, int $pri = EIO_PRI_DEFAULT
|
||||
*
|
||||
*
|
||||
* EIO_DT_MPB
|
||||
* (integer)
|
||||
* (int)
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1225,7 +1277,7 @@ function eio_readahead($fd, int $offset, int $length, int $pri = EIO_PRI_DEFAULT
|
||||
*
|
||||
*
|
||||
* EIO_DT_REG
|
||||
* (integer)
|
||||
* (int)
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1236,7 +1288,7 @@ function eio_readahead($fd, int $offset, int $length, int $pri = EIO_PRI_DEFAULT
|
||||
*
|
||||
*
|
||||
* EIO_DT_NWK
|
||||
* (integer)
|
||||
* (int)
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1246,7 +1298,7 @@ function eio_readahead($fd, int $offset, int $length, int $pri = EIO_PRI_DEFAULT
|
||||
*
|
||||
*
|
||||
* EIO_DT_CMP
|
||||
* (integer)
|
||||
* (int)
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1257,7 +1309,7 @@ function eio_readahead($fd, int $offset, int $length, int $pri = EIO_PRI_DEFAULT
|
||||
*
|
||||
*
|
||||
* EIO_DT_LNK
|
||||
* (integer)
|
||||
* (int)
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1268,7 +1320,7 @@ function eio_readahead($fd, int $offset, int $length, int $pri = EIO_PRI_DEFAULT
|
||||
*
|
||||
*
|
||||
* EIO_DT_SOCK
|
||||
* (integer)
|
||||
* (int)
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1279,7 +1331,7 @@ function eio_readahead($fd, int $offset, int $length, int $pri = EIO_PRI_DEFAULT
|
||||
*
|
||||
*
|
||||
* EIO_DT_DOOR
|
||||
* (integer)
|
||||
* (int)
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1290,7 +1342,7 @@ function eio_readahead($fd, int $offset, int $length, int $pri = EIO_PRI_DEFAULT
|
||||
*
|
||||
*
|
||||
* EIO_DT_WHT
|
||||
* (integer)
|
||||
* (int)
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1301,7 +1353,7 @@ function eio_readahead($fd, int $offset, int $length, int $pri = EIO_PRI_DEFAULT
|
||||
*
|
||||
*
|
||||
* EIO_DT_MAX
|
||||
* (integer)
|
||||
* (int)
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -1672,7 +1724,8 @@ function eio_stat(string $path, int $pri, callable $callback, $data = null)
|
||||
*
|
||||
* is optional request resource which can be used with functions like eio_get_last_error
|
||||
* @param mixed $data is custom data passed to the request.
|
||||
* @return resource eio_statvfs returns request resource on success. On success assigns result argument of
|
||||
* @return resource eio_statvfs returns request resource on success.
|
||||
* On success assigns result argument of
|
||||
* callback to an array.
|
||||
* @throws EioException
|
||||
*
|
||||
|
||||
@@ -30,7 +30,7 @@ use Safe\Exceptions\ErrorfuncException;
|
||||
* message is sent by email to the address in
|
||||
* the destination parameter. This is the only
|
||||
* message type where the fourth parameter,
|
||||
* extra_headers is used.
|
||||
* additional_headers is used.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -59,18 +59,18 @@ use Safe\Exceptions\ErrorfuncException;
|
||||
*
|
||||
* @param string $destination The destination. Its meaning depends on the
|
||||
* message_type parameter as described above.
|
||||
* @param string $extra_headers The extra headers. It's used when the message_type
|
||||
* @param string $additional_headers The extra headers. It's used when the message_type
|
||||
* parameter is set to 1.
|
||||
* This message type uses the same internal function as
|
||||
* mail does.
|
||||
* @throws ErrorfuncException
|
||||
*
|
||||
*/
|
||||
function error_log(string $message, int $message_type = 0, string $destination = null, string $extra_headers = null): void
|
||||
function error_log(string $message, int $message_type = 0, string $destination = null, string $additional_headers = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($extra_headers !== null) {
|
||||
$result = \error_log($message, $message_type, $destination, $extra_headers);
|
||||
if ($additional_headers !== null) {
|
||||
$result = \error_log($message, $message_type, $destination, $additional_headers);
|
||||
} elseif ($destination !== null) {
|
||||
$result = \error_log($message, $message_type, $destination);
|
||||
} else {
|
||||
|
||||
169
vendor/thecodingmachine/safe/generated/exec.php
vendored
169
vendor/thecodingmachine/safe/generated/exec.php
vendored
@@ -5,91 +5,37 @@ namespace Safe;
|
||||
use Safe\Exceptions\ExecException;
|
||||
|
||||
/**
|
||||
* proc_get_status fetches data about a
|
||||
* process opened using proc_open.
|
||||
*
|
||||
* @param resource $process The proc_open resource that will
|
||||
* be evaluated.
|
||||
* @return array An array of collected information on success. The returned array contains the following elements:
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* elementtypedescription
|
||||
*
|
||||
*
|
||||
*
|
||||
* command
|
||||
* string
|
||||
*
|
||||
* The command string that was passed to proc_open.
|
||||
*
|
||||
*
|
||||
*
|
||||
* pid
|
||||
* int
|
||||
* process id
|
||||
*
|
||||
*
|
||||
* running
|
||||
* bool
|
||||
*
|
||||
* TRUE if the process is still running, FALSE if it has
|
||||
* terminated.
|
||||
*
|
||||
*
|
||||
*
|
||||
* signaled
|
||||
* bool
|
||||
*
|
||||
* TRUE if the child process has been terminated by
|
||||
* an uncaught signal. Always set to FALSE on Windows.
|
||||
*
|
||||
*
|
||||
*
|
||||
* stopped
|
||||
* bool
|
||||
*
|
||||
* TRUE if the child process has been stopped by a
|
||||
* signal. Always set to FALSE on Windows.
|
||||
*
|
||||
*
|
||||
*
|
||||
* exitcode
|
||||
* int
|
||||
*
|
||||
* The exit code returned by the process (which is only
|
||||
* meaningful if running is FALSE).
|
||||
* Only first call of this function return real value, next calls return
|
||||
* -1.
|
||||
*
|
||||
*
|
||||
*
|
||||
* termsig
|
||||
* int
|
||||
*
|
||||
* The number of the signal that caused the child process to terminate
|
||||
* its execution (only meaningful if signaled is TRUE).
|
||||
*
|
||||
*
|
||||
*
|
||||
* stopsig
|
||||
* int
|
||||
*
|
||||
* The number of the signal that caused the child process to stop its
|
||||
* execution (only meaningful if stopped is TRUE).
|
||||
*
|
||||
*
|
||||
* exec executes the given
|
||||
* command.
|
||||
*
|
||||
* @param string $command The command that will be executed.
|
||||
* @param array|null $output If the output argument is present, then the
|
||||
* specified array will be filled with every line of output from the
|
||||
* command. Trailing whitespace, such as \n, is not
|
||||
* included in this array. Note that if the array already contains some
|
||||
* elements, exec will append to the end of the array.
|
||||
* If you do not want the function to append elements, call
|
||||
* unset on the array before passing it to
|
||||
* exec.
|
||||
* @param int|null $result_code If the result_code argument is present
|
||||
* along with the output argument, then the
|
||||
* return status of the executed command will be written to this
|
||||
* variable.
|
||||
* @return string The last line from the result of the command. If you need to execute a
|
||||
* command and have all the data from the command passed directly back without
|
||||
* any interference, use the passthru function.
|
||||
*
|
||||
* Returns FALSE on failure.
|
||||
*
|
||||
* To get the output of the executed command, be sure to set and use the
|
||||
* output parameter.
|
||||
* @throws ExecException
|
||||
*
|
||||
*/
|
||||
function proc_get_status($process): array
|
||||
function exec(string $command, ?array &$output = null, ?int &$result_code = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \proc_get_status($process);
|
||||
$result = \exec($command, $output, $result_code);
|
||||
if ($result === false) {
|
||||
throw ExecException::createFromPhpError();
|
||||
}
|
||||
@@ -97,36 +43,85 @@ function proc_get_status($process): array
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The passthru function is similar to the
|
||||
* exec function in that it executes a
|
||||
* command. This function
|
||||
* should be used in place of exec or
|
||||
* system when the output from the Unix command
|
||||
* is binary data which needs to be passed directly back to the
|
||||
* browser. A common use for this is to execute something like the
|
||||
* pbmplus utilities that can output an image stream directly. By
|
||||
* setting the Content-type to image/gif and
|
||||
* then calling a pbmplus program to output a gif, you can create
|
||||
* PHP scripts that output images directly.
|
||||
*
|
||||
* @param string $command The command that will be executed.
|
||||
* @param int|null $result_code If the result_code argument is present, the
|
||||
* return status of the Unix command will be placed here.
|
||||
* @throws ExecException
|
||||
*
|
||||
*/
|
||||
function passthru(string $command, ?int &$result_code = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \passthru($command, $result_code);
|
||||
if ($result === false) {
|
||||
throw ExecException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* proc_nice changes the priority of the current
|
||||
* process by the amount specified in increment. A
|
||||
* positive increment will lower the priority of the
|
||||
* current process, whereas a negative increment
|
||||
* process by the amount specified in priority. A
|
||||
* positive priority will lower the priority of the
|
||||
* current process, whereas a negative priority
|
||||
* will raise the priority.
|
||||
*
|
||||
* proc_nice is not related to
|
||||
* proc_open and its associated functions in any way.
|
||||
*
|
||||
* @param int $increment The new priority value, the value of this may differ on platforms.
|
||||
* @param int $priority The new priority value, the value of this may differ on platforms.
|
||||
*
|
||||
* On Unix, a low value, such as -20 means high priority
|
||||
* wheras a positive value have a lower priority.
|
||||
*
|
||||
* For Windows the increment parameter have the
|
||||
* For Windows the priority parameter have the
|
||||
* following meanings:
|
||||
* @throws ExecException
|
||||
*
|
||||
*/
|
||||
function proc_nice(int $increment): void
|
||||
function proc_nice(int $priority): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \proc_nice($increment);
|
||||
$result = \proc_nice($priority);
|
||||
if ($result === false) {
|
||||
throw ExecException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function is identical to the backtick operator.
|
||||
*
|
||||
* @param string $command The command that will be executed.
|
||||
* @return string A string containing the output from the executed command, FALSE if the pipe
|
||||
* cannot be established or NULL if an error occurs or the command produces no output.
|
||||
* @throws ExecException
|
||||
*
|
||||
*/
|
||||
function shell_exec(string $command): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \shell_exec($command);
|
||||
if ($result === null) {
|
||||
throw ExecException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* system is just like the C version of the
|
||||
* function in that it executes the given
|
||||
@@ -141,17 +136,17 @@ function proc_nice(int $increment): void
|
||||
* passthru function.
|
||||
*
|
||||
* @param string $command The command that will be executed.
|
||||
* @param int $return_var If the return_var argument is present, then the
|
||||
* @param int|null $result_code If the result_code argument is present, then the
|
||||
* return status of the executed command will be written to this
|
||||
* variable.
|
||||
* @return string Returns the last line of the command output on success.
|
||||
* @throws ExecException
|
||||
*
|
||||
*/
|
||||
function system(string $command, int &$return_var = null): string
|
||||
function system(string $command, ?int &$result_code = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \system($command, $return_var);
|
||||
$result = \system($command, $result_code);
|
||||
if ($result === false) {
|
||||
throw ExecException::createFromPhpError();
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@ namespace Safe;
|
||||
use Safe\Exceptions\FileinfoException;
|
||||
|
||||
/**
|
||||
* This function closes the resource opened by finfo_open.
|
||||
* This function closes the instance opened by finfo_open.
|
||||
*
|
||||
* @param resource $finfo Fileinfo resource returned by finfo_open.
|
||||
* @param resource $finfo An finfo instance, returned by finfo_open.
|
||||
* @throws FileinfoException
|
||||
*
|
||||
*/
|
||||
@@ -24,13 +24,13 @@ function finfo_close($finfo): void
|
||||
/**
|
||||
* Procedural style
|
||||
*
|
||||
* Object oriented style (constructor):
|
||||
* Object-oriented style (constructor):
|
||||
*
|
||||
* This function opens a magic database and returns its resource.
|
||||
* This function opens a magic database and returns its instance.
|
||||
*
|
||||
* @param int $options One or disjunction of more Fileinfo
|
||||
* @param int $flags One or disjunction of more Fileinfo
|
||||
* constants.
|
||||
* @param string $magic_file Name of a magic database file, usually something like
|
||||
* @param string $magic_database Name of a magic database file, usually something like
|
||||
* /path/to/magic.mime. If not specified, the
|
||||
* MAGIC environment variable is used. If the
|
||||
* environment variable isn't set, then PHP's bundled magic database will
|
||||
@@ -39,14 +39,18 @@ function finfo_close($finfo): void
|
||||
* Passing NULL or an empty string will be equivalent to the default
|
||||
* value.
|
||||
* @return resource (Procedural style only)
|
||||
* Returns a magic database resource on success.
|
||||
* Returns an finfo instance on success.
|
||||
* @throws FileinfoException
|
||||
*
|
||||
*/
|
||||
function finfo_open(int $options = FILEINFO_NONE, string $magic_file = "")
|
||||
function finfo_open(int $flags = FILEINFO_NONE, string $magic_database = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \finfo_open($options, $magic_file);
|
||||
if ($magic_database !== null) {
|
||||
$result = \finfo_open($flags, $magic_database);
|
||||
} else {
|
||||
$result = \finfo_open($flags);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw FileinfoException::createFromPhpError();
|
||||
}
|
||||
@@ -58,13 +62,13 @@ function finfo_open(int $options = FILEINFO_NONE, string $magic_file = "")
|
||||
* Returns the MIME content type for a file as determined by using
|
||||
* information from the magic.mime file.
|
||||
*
|
||||
* @param string $filename Path to the tested file.
|
||||
* @param string|resource $filename Path to the tested file.
|
||||
* @return string Returns the content type in MIME format, like
|
||||
* text/plain or application/octet-stream.
|
||||
* @throws FileinfoException
|
||||
*
|
||||
*/
|
||||
function mime_content_type(string $filename): string
|
||||
function mime_content_type($filename): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \mime_content_type($filename);
|
||||
|
||||
@@ -28,12 +28,12 @@ function chgrp(string $filename, $group): void
|
||||
|
||||
/**
|
||||
* Attempts to change the mode of the specified file to that given in
|
||||
* mode.
|
||||
* permissions.
|
||||
*
|
||||
* @param string $filename Path to the file.
|
||||
* @param int $mode Note that mode is not automatically
|
||||
* @param int $permissions Note that permissions is not automatically
|
||||
* assumed to be an octal value, so to ensure the expected operation,
|
||||
* you need to prefix mode with a zero (0).
|
||||
* you need to prefix permissions with a zero (0).
|
||||
* Strings such as "g+w" will not work properly.
|
||||
*
|
||||
*
|
||||
@@ -43,7 +43,7 @@ function chgrp(string $filename, $group): void
|
||||
*
|
||||
*
|
||||
*
|
||||
* The mode parameter consists of three octal
|
||||
* The permissions parameter consists of three octal
|
||||
* number components specifying access restrictions for the owner,
|
||||
* the user group in which the owner is in, and to everybody else in
|
||||
* this order. One component can be computed by adding up the needed
|
||||
@@ -58,10 +58,10 @@ function chgrp(string $filename, $group): void
|
||||
*
|
||||
*
|
||||
*/
|
||||
function chmod(string $filename, int $mode): void
|
||||
function chmod(string $filename, int $permissions): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \chmod($filename, $mode);
|
||||
$result = \chmod($filename, $permissions);
|
||||
if ($result === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
@@ -89,13 +89,13 @@ function chown(string $filename, $user): void
|
||||
|
||||
|
||||
/**
|
||||
* Makes a copy of the file source to
|
||||
* dest.
|
||||
* Makes a copy of the file from to
|
||||
* to.
|
||||
*
|
||||
* If you wish to move a file, use the rename function.
|
||||
*
|
||||
* @param string $source Path to the source file.
|
||||
* @param string $dest The destination path. If dest is a URL, the
|
||||
* @param string $from Path to the source file.
|
||||
* @param string $to The destination path. If to is a URL, the
|
||||
* copy operation may fail if the wrapper does not support overwriting of
|
||||
* existing files.
|
||||
*
|
||||
@@ -105,13 +105,13 @@ function chown(string $filename, $user): void
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function copy(string $source, string $dest, $context = null): void
|
||||
function copy(string $from, string $to, $context = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($context !== null) {
|
||||
$result = \copy($source, $dest, $context);
|
||||
$result = \copy($from, $to, $context);
|
||||
} else {
|
||||
$result = \copy($source, $dest);
|
||||
$result = \copy($from, $to);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
@@ -165,17 +165,40 @@ function disk_total_space(string $directory): float
|
||||
|
||||
|
||||
/**
|
||||
* The file pointed to by handle is closed.
|
||||
* The file pointed to by stream is closed.
|
||||
*
|
||||
* @param resource $handle The file pointer must be valid, and must point to a file successfully
|
||||
* @param resource $stream The file pointer must be valid, and must point to a file successfully
|
||||
* opened by fopen or fsockopen.
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fclose($handle): void
|
||||
function fclose($stream): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \fclose($handle);
|
||||
$result = \fclose($stream);
|
||||
if ($result === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function synchronizes stream contents to storage media, just like fsync does,
|
||||
* but it does not synchronize file meta-data.
|
||||
* Note that this function is only effectively different in POSIX systems.
|
||||
* In Windows, this function is aliased to fsync.
|
||||
*
|
||||
* @param resource $stream The file pointer must be valid, and must point to
|
||||
* a file successfully opened by fopen or
|
||||
* fsockopen (and not yet closed by
|
||||
* fclose).
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fdatasync($stream): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \fdatasync($stream);
|
||||
if ($result === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
@@ -184,30 +207,76 @@ function fclose($handle): void
|
||||
|
||||
/**
|
||||
* This function forces a write of all buffered output to the resource
|
||||
* pointed to by the file handle.
|
||||
* pointed to by the file stream.
|
||||
*
|
||||
* @param resource $handle The file pointer must be valid, and must point to
|
||||
* @param resource $stream The file pointer must be valid, and must point to
|
||||
* a file successfully opened by fopen or
|
||||
* fsockopen (and not yet closed by
|
||||
* fclose).
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fflush($handle): void
|
||||
function fflush($stream): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \fflush($handle);
|
||||
$result = \fflush($stream);
|
||||
if ($result === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Similar to fgets except that
|
||||
* fgetcsv parses the line it reads for fields in
|
||||
* CSV format and returns an array containing the fields
|
||||
* read.
|
||||
*
|
||||
* @param resource $stream A valid file pointer to a file successfully opened by
|
||||
* fopen, popen, or
|
||||
* fsockopen.
|
||||
* @param int $length Must be greater than the longest line (in characters) to be found in
|
||||
* the CSV file (allowing for trailing line-end characters). Otherwise the
|
||||
* line is split in chunks of length characters,
|
||||
* unless the split would occur inside an enclosure.
|
||||
*
|
||||
* Omitting this parameter (or setting it to 0,
|
||||
* or NULL in PHP 8.0.0 or later) the maximum line length is not limited,
|
||||
* which is slightly slower.
|
||||
* @param string $separator The optional separator parameter sets the field separator (one single-byte character only).
|
||||
* @param string $enclosure The optional enclosure parameter sets the field enclosure character (one single-byte character only).
|
||||
* @param string $escape The optional escape parameter sets the escape character (at most one single-byte character).
|
||||
* An empty string ("") disables the proprietary escape mechanism.
|
||||
* @return array|null Returns an indexed array containing the fields read on success.
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fgetcsv($stream, int $length = null, string $separator = ",", string $enclosure = "\"", string $escape = "\\"): ?array
|
||||
{
|
||||
error_clear_last();
|
||||
if ($escape !== "\\") {
|
||||
$result = \fgetcsv($stream, $length, $separator, $enclosure, $escape);
|
||||
} elseif ($enclosure !== "\"") {
|
||||
$result = \fgetcsv($stream, $length, $separator, $enclosure);
|
||||
} elseif ($separator !== ",") {
|
||||
$result = \fgetcsv($stream, $length, $separator);
|
||||
} elseif ($length !== null) {
|
||||
$result = \fgetcsv($stream, $length);
|
||||
} else {
|
||||
$result = \fgetcsv($stream);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function is similar to file, except that
|
||||
* file_get_contents returns the file in a
|
||||
* string, starting at the specified offset
|
||||
* up to maxlen bytes. On failure,
|
||||
* up to length bytes. On failure,
|
||||
* file_get_contents will return FALSE.
|
||||
*
|
||||
* file_get_contents is the preferred way to read the
|
||||
@@ -230,18 +299,18 @@ function fflush($handle): void
|
||||
* Seeking (offset) is not supported with remote files.
|
||||
* Attempting to seek on non-local files may work with small offsets, but this
|
||||
* is unpredictable because it works on the buffered stream.
|
||||
* @param int $maxlen Maximum length of data read. The default is to read until end
|
||||
* @param int $length Maximum length of data read. The default is to read until end
|
||||
* of file is reached. Note that this parameter is applied to the
|
||||
* stream processed by the filters.
|
||||
* @return string The function returns the read data.
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function file_get_contents(string $filename, bool $use_include_path = false, $context = null, int $offset = 0, int $maxlen = null): string
|
||||
function file_get_contents(string $filename, bool $use_include_path = false, $context = null, int $offset = 0, int $length = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($maxlen !== null) {
|
||||
$result = \file_get_contents($filename, $use_include_path, $context, $offset, $maxlen);
|
||||
if ($length !== null) {
|
||||
$result = \file_get_contents($filename, $use_include_path, $context, $offset, $length);
|
||||
} elseif ($offset !== 0) {
|
||||
$result = \file_get_contents($filename, $use_include_path, $context, $offset);
|
||||
} elseif ($context !== null) {
|
||||
@@ -324,7 +393,7 @@ function file_get_contents(string $filename, bool $use_include_path = false, $co
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param resource $context A valid context resource created with
|
||||
* @param resource|null $context A valid context resource created with
|
||||
* stream_context_create.
|
||||
* @return int This function returns the number of bytes that were written to the file.
|
||||
* @throws FilesystemException
|
||||
@@ -507,6 +576,39 @@ function fileowner(string $filename): int
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets permissions for the given file.
|
||||
*
|
||||
* @param string $filename Path to the file.
|
||||
* @return int Returns the file's permissions as a numeric mode. Lower bits of this mode
|
||||
* are the same as the permissions expected by chmod,
|
||||
* however on most platforms the return value will also include information on
|
||||
* the type of file given as filename. The examples
|
||||
* below demonstrate how to test the return value for specific permissions and
|
||||
* file types on POSIX systems, including Linux and macOS.
|
||||
*
|
||||
* For local files, the specific return value is that of the
|
||||
* st_mode member of the structure returned by the C
|
||||
* library's stat function. Exactly which bits are set
|
||||
* can vary from platform to platform, and looking up your specific platform's
|
||||
* documentation is recommended if parsing the non-permission bits of the
|
||||
* return value is required.
|
||||
*
|
||||
* Returns FALSE on failure.
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fileperms(string $filename): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \fileperms($filename);
|
||||
if ($result === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the size for the given file.
|
||||
*
|
||||
@@ -532,16 +634,15 @@ function filesize(string $filename): int
|
||||
* model which can be used on virtually every platform (including most Unix
|
||||
* derivatives and even Windows).
|
||||
*
|
||||
* On versions of PHP before 5.3.2, the lock is released also by
|
||||
* fclose (which is also called automatically when script
|
||||
* finished).
|
||||
* The lock is released also by fclose,
|
||||
* or when stream is garbage collected.
|
||||
*
|
||||
* PHP supports a portable way of locking complete files in an advisory way
|
||||
* (which means all accessing programs have to use the same way of locking
|
||||
* or it will not work). By default, this function will block until the
|
||||
* requested lock is acquired; this may be controlled with the LOCK_NB option documented below.
|
||||
*
|
||||
* @param resource $handle A file system pointer resource
|
||||
* @param resource $stream A file system pointer resource
|
||||
* that is typically created using fopen.
|
||||
* @param int $operation operation is one of the following:
|
||||
*
|
||||
@@ -565,15 +666,15 @@ function filesize(string $filename): int
|
||||
* It is also possible to add LOCK_NB as a bitmask to one
|
||||
* of the above operations, if flock should not
|
||||
* block during the locking attempt.
|
||||
* @param int|null $wouldblock The optional third argument is set to 1 if the lock would block
|
||||
* @param int|null $would_block The optional third argument is set to 1 if the lock would block
|
||||
* (EWOULDBLOCK errno condition).
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function flock($handle, int $operation, ?int &$wouldblock = null): void
|
||||
function flock($stream, int $operation, ?int &$would_block = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \flock($handle, $operation, $wouldblock);
|
||||
$result = \flock($stream, $operation, $would_block);
|
||||
if ($result === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
@@ -661,9 +762,8 @@ function flock($handle, int $operation, ?int &$wouldblock = null): void
|
||||
*
|
||||
* 'w+'
|
||||
*
|
||||
* Open for reading and writing; place the file pointer at
|
||||
* the beginning of the file and truncate the file to zero
|
||||
* length. If the file does not exist, attempt to create it.
|
||||
* Open for reading and writing; otherwise it has the
|
||||
* same behavior as 'w'.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -774,7 +874,8 @@ function flock($handle, int $operation, ?int &$wouldblock = null): void
|
||||
* @param bool $use_include_path The optional third use_include_path parameter
|
||||
* can be set to '1' or TRUE if you want to search for the file in the
|
||||
* include_path, too.
|
||||
* @param resource $context
|
||||
* @param resource|null $context A context stream
|
||||
* resource.
|
||||
* @return resource Returns a file pointer resource on success
|
||||
* @throws FilesystemException
|
||||
*
|
||||
@@ -794,42 +895,10 @@ function fopen(string $filename, string $mode, bool $use_include_path = false, $
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* fputcsv formats a line (passed as a
|
||||
* fields array) as CSV and writes it (terminated by a
|
||||
* newline) to the specified file handle.
|
||||
*
|
||||
* @param resource $handle The file pointer must be valid, and must point to
|
||||
* a file successfully opened by fopen or
|
||||
* fsockopen (and not yet closed by
|
||||
* fclose).
|
||||
* @param array $fields An array of strings.
|
||||
* @param string $delimiter The optional delimiter parameter sets the field
|
||||
* delimiter (one character only).
|
||||
* @param string $enclosure The optional enclosure parameter sets the field
|
||||
* enclosure (one character only).
|
||||
* @param string $escape_char The optional escape_char parameter sets the
|
||||
* escape character (at most one character).
|
||||
* An empty string ("") disables the proprietary escape mechanism.
|
||||
* @return int Returns the length of the written string.
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fputcsv($handle, array $fields, string $delimiter = ",", string $enclosure = '"', string $escape_char = "\\"): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \fputcsv($handle, $fields, $delimiter, $enclosure, $escape_char);
|
||||
if ($result === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* fread reads up to
|
||||
* length bytes from the file pointer
|
||||
* referenced by handle. Reading stops as soon as one
|
||||
* referenced by stream. Reading stops as soon as one
|
||||
* of the following conditions is met:
|
||||
*
|
||||
*
|
||||
@@ -858,17 +927,17 @@ function fputcsv($handle, array $fields, string $delimiter = ",", string $enclos
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param resource $handle A file system pointer resource
|
||||
* @param resource $stream A file system pointer resource
|
||||
* that is typically created using fopen.
|
||||
* @param int $length Up to length number of bytes read.
|
||||
* @return string Returns the read string.
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fread($handle, int $length): string
|
||||
function fread($stream, int $length): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \fread($handle, $length);
|
||||
$result = \fread($stream, $length);
|
||||
if ($result === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
@@ -877,12 +946,58 @@ function fread($handle, int $length): string
|
||||
|
||||
|
||||
/**
|
||||
* Takes the filepointer, handle, and truncates the file to
|
||||
* Gathers the statistics of the file opened by the file
|
||||
* pointer stream. This function is similar to the
|
||||
* stat function except that it operates
|
||||
* on an open file pointer instead of a filename.
|
||||
*
|
||||
* @param resource $stream A file system pointer resource
|
||||
* that is typically created using fopen.
|
||||
* @return array Returns an array with the statistics of the file; the format of the array
|
||||
* is described in detail on the stat manual page.
|
||||
* Returns FALSE on failure.
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fstat($stream): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \fstat($stream);
|
||||
if ($result === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function synchronizes changes to the file, including its meta-data. This is similar to fflush,
|
||||
* but it also instructs the operating system to write to the storage media.
|
||||
*
|
||||
* @param resource $stream The file pointer must be valid, and must point to
|
||||
* a file successfully opened by fopen or
|
||||
* fsockopen (and not yet closed by
|
||||
* fclose).
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fsync($stream): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \fsync($stream);
|
||||
if ($result === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Takes the filepointer, stream, and truncates the file to
|
||||
* length, size.
|
||||
*
|
||||
* @param resource $handle The file pointer.
|
||||
* @param resource $stream The file pointer.
|
||||
*
|
||||
* The handle must be open for writing.
|
||||
* The stream must be open for writing.
|
||||
* @param int $size The size to truncate to.
|
||||
*
|
||||
* If size is larger than the file then the file
|
||||
@@ -893,10 +1008,10 @@ function fread($handle, int $length): string
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function ftruncate($handle, int $size): void
|
||||
function ftruncate($stream, int $size): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ftruncate($handle, $size);
|
||||
$result = \ftruncate($stream, $size);
|
||||
if ($result === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
@@ -906,29 +1021,23 @@ function ftruncate($handle, int $size): void
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param resource $handle A file system pointer resource
|
||||
* @param resource $stream A file system pointer resource
|
||||
* that is typically created using fopen.
|
||||
* @param string $string The string that is to be written.
|
||||
* @param int $length If the length argument is given, writing will
|
||||
* stop after length bytes have been written or
|
||||
* the end of string is reached, whichever comes
|
||||
* first.
|
||||
*
|
||||
* Note that if the length argument is given,
|
||||
* then the magic_quotes_runtime
|
||||
* configuration option will be ignored and no slashes will be
|
||||
* stripped from string.
|
||||
* @param string $data The string that is to be written.
|
||||
* @param int $length If length is an integer, writing will stop
|
||||
* after length bytes have been written or the
|
||||
* end of data is reached, whichever comes first.
|
||||
* @return int
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fwrite($handle, string $string, int $length = null): int
|
||||
function fwrite($stream, string $data, int $length = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($length !== null) {
|
||||
$result = \fwrite($handle, $string, $length);
|
||||
$result = \fwrite($stream, $data, $length);
|
||||
} else {
|
||||
$result = \fwrite($handle, $string);
|
||||
$result = \fwrite($stream, $data);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
@@ -1016,6 +1125,12 @@ function fwrite($handle, string $string, int $length = null): int
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* The GLOB_BRACE flag is not available on some non GNU
|
||||
* systems, like Solaris or Alpine Linux.
|
||||
*
|
||||
*
|
||||
* @return array Returns an array containing the matched files/directories, an empty array
|
||||
* if no file matched.
|
||||
* @throws FilesystemException
|
||||
@@ -1095,32 +1210,60 @@ function link(string $target, string $link): void
|
||||
|
||||
|
||||
/**
|
||||
* Attempts to create the directory specified by pathname.
|
||||
* Gathers the statistics of the file or symbolic link named by
|
||||
* filename.
|
||||
*
|
||||
* @param string $pathname The directory path.
|
||||
* @param int $mode The mode is 0777 by default, which means the widest possible
|
||||
* access. For more information on modes, read the details
|
||||
* on the chmod page.
|
||||
* @param string $filename Path to a file or a symbolic link.
|
||||
* @return array See the manual page for stat for information on
|
||||
* the structure of the array that lstat returns.
|
||||
* This function is identical to the stat function
|
||||
* except that if the filename parameter is a symbolic
|
||||
* link, the status of the symbolic link is returned, not the status of the
|
||||
* file pointed to by the symbolic link.
|
||||
*
|
||||
* mode is ignored on Windows.
|
||||
*
|
||||
* Note that you probably want to specify the mode as an octal number,
|
||||
* which means it should have a leading zero. The mode is also modified
|
||||
* by the current umask, which you can change using
|
||||
* umask.
|
||||
* @param bool $recursive Allows the creation of nested directories specified in the
|
||||
* pathname.
|
||||
* @param resource $context
|
||||
* On failure, FALSE is returned.
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function mkdir(string $pathname, int $mode = 0777, bool $recursive = false, $context = null): void
|
||||
function lstat(string $filename): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \lstat($filename);
|
||||
if ($result === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Attempts to create the directory specified by directory.
|
||||
*
|
||||
* @param string $directory The directory path.
|
||||
* @param int $permissions The permissions are 0777 by default, which means the widest possible
|
||||
* access. For more information on permissions, read the details
|
||||
* on the chmod page.
|
||||
*
|
||||
* permissions is ignored on Windows.
|
||||
*
|
||||
* Note that you probably want to specify the permissions as an octal number,
|
||||
* which means it should have a leading zero. The permissions is also modified
|
||||
* by the current umask, which you can change using
|
||||
* umask.
|
||||
* @param bool $recursive Allows the creation of nested directories specified in the
|
||||
* directory.
|
||||
* @param resource $context A context stream
|
||||
* resource.
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function mkdir(string $directory, int $permissions = 0777, bool $recursive = false, $context = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($context !== null) {
|
||||
$result = \mkdir($pathname, $mode, $recursive, $context);
|
||||
$result = \mkdir($directory, $permissions, $recursive, $context);
|
||||
} else {
|
||||
$result = \mkdir($pathname, $mode, $recursive);
|
||||
$result = \mkdir($directory, $permissions, $recursive);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
@@ -1170,11 +1313,11 @@ function parse_ini_file(string $filename, bool $process_sections = false, int $s
|
||||
|
||||
/**
|
||||
* parse_ini_string returns the settings in string
|
||||
* ini in an associative array.
|
||||
* ini_string in an associative array.
|
||||
*
|
||||
* The structure of the ini string is the same as the php.ini's.
|
||||
*
|
||||
* @param string $ini The contents of the ini file being parsed.
|
||||
* @param string $ini_string The contents of the ini file being parsed.
|
||||
* @param bool $process_sections By setting the process_sections
|
||||
* parameter to TRUE, you get a multidimensional array, with
|
||||
* the section names and settings included. The default
|
||||
@@ -1194,10 +1337,10 @@ function parse_ini_file(string $filename, bool $process_sections = false, int $s
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function parse_ini_string(string $ini, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array
|
||||
function parse_ini_string(string $ini_string, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \parse_ini_string($ini, $process_sections, $scanner_mode);
|
||||
$result = \parse_ini_string($ini_string, $process_sections, $scanner_mode);
|
||||
if ($result === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
@@ -1211,7 +1354,8 @@ function parse_ini_string(string $ini, bool $process_sections = false, int $scan
|
||||
* @param string $filename The filename being read.
|
||||
* @param bool $use_include_path You can use the optional second parameter and set it to TRUE, if
|
||||
* you want to search for the file in the include_path, too.
|
||||
* @param resource $context A context stream resource.
|
||||
* @param resource $context A context stream
|
||||
* resource.
|
||||
* @return int Returns the number of bytes read from the file on success
|
||||
* @throws FilesystemException
|
||||
*
|
||||
@@ -1287,30 +1431,37 @@ function realpath(string $path): string
|
||||
|
||||
|
||||
/**
|
||||
* Attempts to rename oldname to
|
||||
* newname, moving it between directories if necessary.
|
||||
* If renaming a file and newname exists,
|
||||
* Attempts to rename from to
|
||||
* to, moving it between directories if necessary.
|
||||
* If renaming a file and to exists,
|
||||
* it will be overwritten. If renaming a directory and
|
||||
* newname exists,
|
||||
* to exists,
|
||||
* this function will emit a warning.
|
||||
*
|
||||
* @param string $oldname The old name.
|
||||
* @param string $from The old name.
|
||||
*
|
||||
* The wrapper used in oldname
|
||||
* The wrapper used in from
|
||||
* must match the wrapper used in
|
||||
* newname.
|
||||
* @param string $newname The new name.
|
||||
* @param resource $context
|
||||
* to.
|
||||
* @param string $to The new name.
|
||||
*
|
||||
*
|
||||
* On Windows, if to already exists, it must be writable.
|
||||
* Otherwise rename fails and issues E_WARNING.
|
||||
*
|
||||
*
|
||||
* @param resource $context A context stream
|
||||
* resource.
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function rename(string $oldname, string $newname, $context = null): void
|
||||
function rename(string $from, string $to, $context = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($context !== null) {
|
||||
$result = \rename($oldname, $newname, $context);
|
||||
$result = \rename($from, $to, $context);
|
||||
} else {
|
||||
$result = \rename($oldname, $newname);
|
||||
$result = \rename($from, $to);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
@@ -1319,18 +1470,18 @@ function rename(string $oldname, string $newname, $context = null): void
|
||||
|
||||
|
||||
/**
|
||||
* Sets the file position indicator for handle
|
||||
* Sets the file position indicator for stream
|
||||
* to the beginning of the file stream.
|
||||
*
|
||||
* @param resource $handle The file pointer must be valid, and must point to a file
|
||||
* @param resource $stream The file pointer must be valid, and must point to a file
|
||||
* successfully opened by fopen.
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function rewind($handle): void
|
||||
function rewind($stream): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \rewind($handle);
|
||||
$result = \rewind($stream);
|
||||
if ($result === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
@@ -1338,22 +1489,23 @@ function rewind($handle): void
|
||||
|
||||
|
||||
/**
|
||||
* Attempts to remove the directory named by dirname.
|
||||
* Attempts to remove the directory named by directory.
|
||||
* The directory must be empty, and the relevant permissions must permit this.
|
||||
* A E_WARNING level error will be generated on failure.
|
||||
*
|
||||
* @param string $dirname Path to the directory.
|
||||
* @param resource $context
|
||||
* @param string $directory Path to the directory.
|
||||
* @param resource $context A context stream
|
||||
* resource.
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function rmdir(string $dirname, $context = null): void
|
||||
function rmdir(string $directory, $context = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($context !== null) {
|
||||
$result = \rmdir($dirname, $context);
|
||||
$result = \rmdir($directory, $context);
|
||||
} else {
|
||||
$result = \rmdir($dirname);
|
||||
$result = \rmdir($directory);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
@@ -1387,16 +1539,16 @@ function symlink(string $target, string $link): void
|
||||
* generate a file in the system's temporary directory, and return
|
||||
* the full path to that file, including its name.
|
||||
*
|
||||
* @param string $dir The directory where the temporary filename will be created.
|
||||
* @param string $directory The directory where the temporary filename will be created.
|
||||
* @param string $prefix The prefix of the generated temporary filename.
|
||||
* @return string Returns the new temporary filename (with path).
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function tempnam(string $dir, string $prefix): string
|
||||
function tempnam(string $directory, string $prefix): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \tempnam($dir, $prefix);
|
||||
$result = \tempnam($directory, $prefix);
|
||||
if ($result === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
@@ -1432,29 +1584,29 @@ function tmpfile()
|
||||
/**
|
||||
* Attempts to set the access and modification times of the file named in the
|
||||
* filename parameter to the value given in
|
||||
* time.
|
||||
* mtime.
|
||||
* Note that the access time is always modified, regardless of the number
|
||||
* of parameters.
|
||||
*
|
||||
* If the file does not exist, it will be created.
|
||||
*
|
||||
* @param string $filename The name of the file being touched.
|
||||
* @param int $time The touch time. If time is not supplied,
|
||||
* @param int $mtime The touch time. If mtime is NULL,
|
||||
* the current system time is used.
|
||||
* @param int $atime If present, the access time of the given filename is set to
|
||||
* @param int $atime If not NULL, the access time of the given filename is set to
|
||||
* the value of atime. Otherwise, it is set to
|
||||
* the value passed to the time parameter.
|
||||
* If neither are present, the current system time is used.
|
||||
* the value passed to the mtime parameter.
|
||||
* If both are NULL, the current system time is used.
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function touch(string $filename, int $time = null, int $atime = null): void
|
||||
function touch(string $filename, int $mtime = null, int $atime = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($atime !== null) {
|
||||
$result = \touch($filename, $time, $atime);
|
||||
} elseif ($time !== null) {
|
||||
$result = \touch($filename, $time);
|
||||
$result = \touch($filename, $mtime, $atime);
|
||||
} elseif ($mtime !== null) {
|
||||
$result = \touch($filename, $mtime);
|
||||
} else {
|
||||
$result = \touch($filename);
|
||||
}
|
||||
@@ -1470,7 +1622,11 @@ function touch(string $filename, int $time = null, int $atime = null): void
|
||||
* failure.
|
||||
*
|
||||
* @param string $filename Path to the file.
|
||||
* @param resource $context
|
||||
*
|
||||
* If the file is a symlink, the symlink will be deleted. On Windows, to delete
|
||||
* a symlink to a directory, rmdir has to be used instead.
|
||||
* @param resource $context A context stream
|
||||
* resource.
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -11,7 +11,7 @@ use Safe\Exceptions\FilterException;
|
||||
* @param int $type One of INPUT_GET, INPUT_POST,
|
||||
* INPUT_COOKIE, INPUT_SERVER, or
|
||||
* INPUT_ENV.
|
||||
* @param int|array $definition An array defining the arguments. A valid key is a string
|
||||
* @param int|array $options An array defining the arguments. A valid key is a string
|
||||
* containing a variable name and a valid value is either a filter type, or an array
|
||||
* optionally specifying the filter, flags and options. If the value is an
|
||||
* array, valid keys are filter which specifies the
|
||||
@@ -23,7 +23,7 @@ use Safe\Exceptions\FilterException;
|
||||
* This parameter can be also an integer holding a filter constant. Then all values in the
|
||||
* input array are filtered by this filter.
|
||||
* @param bool $add_empty Add missing keys as NULL to the return value.
|
||||
* @return mixed An array containing the values of the requested variables on success.
|
||||
* @return array|null An array containing the values of the requested variables on success.
|
||||
* If the input array designated by type is not populated,
|
||||
* the function returns NULL if the FILTER_NULL_ON_FAILURE
|
||||
* flag is not given, or FALSE otherwise. For other failures, FALSE is returned.
|
||||
@@ -36,16 +36,10 @@ use Safe\Exceptions\FilterException;
|
||||
* @throws FilterException
|
||||
*
|
||||
*/
|
||||
function filter_input_array(int $type, $definition = null, bool $add_empty = true)
|
||||
function filter_input_array(int $type, $options = FILTER_DEFAULT, bool $add_empty = true): ?array
|
||||
{
|
||||
error_clear_last();
|
||||
if ($add_empty !== true) {
|
||||
$result = \filter_input_array($type, $definition, $add_empty);
|
||||
} elseif ($definition !== null) {
|
||||
$result = \filter_input_array($type, $definition);
|
||||
} else {
|
||||
$result = \filter_input_array($type);
|
||||
}
|
||||
$result = \filter_input_array($type, $options, $add_empty);
|
||||
if ($result === false) {
|
||||
throw FilterException::createFromPhpError();
|
||||
}
|
||||
@@ -57,8 +51,8 @@ function filter_input_array(int $type, $definition = null, bool $add_empty = tru
|
||||
* This function is useful for retrieving many values without
|
||||
* repetitively calling filter_var.
|
||||
*
|
||||
* @param array $data An array with string keys containing the data to filter.
|
||||
* @param mixed $definition An array defining the arguments. A valid key is a string
|
||||
* @param array $array An array with string keys containing the data to filter.
|
||||
* @param mixed $options An array defining the arguments. A valid key is a string
|
||||
* containing a variable name and a valid value is either a
|
||||
* filter type, or an
|
||||
* array optionally specifying the filter, flags and options.
|
||||
@@ -71,21 +65,15 @@ function filter_input_array(int $type, $definition = null, bool $add_empty = tru
|
||||
* This parameter can be also an integer holding a filter constant. Then all values in the
|
||||
* input array are filtered by this filter.
|
||||
* @param bool $add_empty Add missing keys as NULL to the return value.
|
||||
* @return mixed An array containing the values of the requested variables on success. An array value will be FALSE if the filter fails, or NULL if
|
||||
* @return array|null An array containing the values of the requested variables on success. An array value will be FALSE if the filter fails, or NULL if
|
||||
* the variable is not set.
|
||||
* @throws FilterException
|
||||
*
|
||||
*/
|
||||
function filter_var_array(array $data, $definition = null, bool $add_empty = true)
|
||||
function filter_var_array(array $array, $options = FILTER_DEFAULT, bool $add_empty = true): ?array
|
||||
{
|
||||
error_clear_last();
|
||||
if ($add_empty !== true) {
|
||||
$result = \filter_var_array($data, $definition, $add_empty);
|
||||
} elseif ($definition !== null) {
|
||||
$result = \filter_var_array($data, $definition);
|
||||
} else {
|
||||
$result = \filter_var_array($data);
|
||||
}
|
||||
$result = \filter_var_array($array, $options, $add_empty);
|
||||
if ($result === false) {
|
||||
throw FilterException::createFromPhpError();
|
||||
}
|
||||
|
||||
251
vendor/thecodingmachine/safe/generated/ftp.php
vendored
251
vendor/thecodingmachine/safe/generated/ftp.php
vendored
@@ -8,17 +8,17 @@ use Safe\Exceptions\FtpException;
|
||||
* Sends an ALLO command to the remote FTP server to
|
||||
* allocate space for a file to be uploaded.
|
||||
*
|
||||
* @param resource $ftp_stream The link identifier of the FTP connection.
|
||||
* @param int $filesize The number of bytes to allocate.
|
||||
* @param string $result A textual representation of the servers response will be returned by
|
||||
* reference in result if a variable is provided.
|
||||
* @param resource $ftp An FTP\Connection instance.
|
||||
* @param int $size The number of bytes to allocate.
|
||||
* @param string|null $response A textual representation of the servers response will be returned by
|
||||
* reference in response if a variable is provided.
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_alloc($ftp_stream, int $filesize, string &$result = null): void
|
||||
function ftp_alloc($ftp, int $size, ?string &$response = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ftp_alloc($ftp_stream, $filesize, $result);
|
||||
$result = \ftp_alloc($ftp, $size, $response);
|
||||
if ($result === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
@@ -28,17 +28,17 @@ function ftp_alloc($ftp_stream, int $filesize, string &$result = null): void
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param resource $ftp
|
||||
* @param string $remote_file
|
||||
* @param string $local_file
|
||||
* @param resource $ftp An FTP\Connection instance.
|
||||
* @param string $remote_filename
|
||||
* @param string $local_filename
|
||||
* @param int $mode
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_append($ftp, string $remote_file, string $local_file, int $mode = FTP_BINARY): void
|
||||
function ftp_append($ftp, string $remote_filename, string $local_filename, int $mode = FTP_BINARY): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ftp_append($ftp, $remote_file, $local_file, $mode);
|
||||
$result = \ftp_append($ftp, $remote_filename, $local_filename, $mode);
|
||||
if ($result === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
@@ -48,14 +48,14 @@ function ftp_append($ftp, string $remote_file, string $local_file, int $mode = F
|
||||
/**
|
||||
* Changes to the parent directory.
|
||||
*
|
||||
* @param resource $ftp_stream The link identifier of the FTP connection.
|
||||
* @param resource $ftp An FTP\Connection instance.
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_cdup($ftp_stream): void
|
||||
function ftp_cdup($ftp): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ftp_cdup($ftp_stream);
|
||||
$result = \ftp_cdup($ftp);
|
||||
if ($result === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
@@ -65,15 +65,15 @@ function ftp_cdup($ftp_stream): void
|
||||
/**
|
||||
* Changes the current directory to the specified one.
|
||||
*
|
||||
* @param resource $ftp_stream The link identifier of the FTP connection.
|
||||
* @param resource $ftp An FTP\Connection instance.
|
||||
* @param string $directory The target directory.
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_chdir($ftp_stream, string $directory): void
|
||||
function ftp_chdir($ftp, string $directory): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ftp_chdir($ftp_stream, $directory);
|
||||
$result = \ftp_chdir($ftp, $directory);
|
||||
if ($result === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
@@ -82,19 +82,19 @@ function ftp_chdir($ftp_stream, string $directory): void
|
||||
|
||||
/**
|
||||
* Sets the permissions on the specified remote file to
|
||||
* mode.
|
||||
* permissions.
|
||||
*
|
||||
* @param resource $ftp_stream The link identifier of the FTP connection.
|
||||
* @param int $mode The new permissions, given as an octal value.
|
||||
* @param resource $ftp An FTP\Connection instance.
|
||||
* @param int $permissions The new permissions, given as an octal value.
|
||||
* @param string $filename The remote file.
|
||||
* @return int Returns the new file permissions on success.
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_chmod($ftp_stream, int $mode, string $filename): int
|
||||
function ftp_chmod($ftp, int $permissions, string $filename): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ftp_chmod($ftp_stream, $mode, $filename);
|
||||
$result = \ftp_chmod($ftp, $permissions, $filename);
|
||||
if ($result === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
@@ -106,14 +106,14 @@ function ftp_chmod($ftp_stream, int $mode, string $filename): int
|
||||
* ftp_close closes the given link identifier
|
||||
* and releases the resource.
|
||||
*
|
||||
* @param resource $ftp_stream The link identifier of the FTP connection.
|
||||
* @param resource $ftp An FTP\Connection instance.
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_close($ftp_stream): void
|
||||
function ftp_close($ftp): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ftp_close($ftp_stream);
|
||||
$result = \ftp_close($ftp);
|
||||
if ($result === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
@@ -122,9 +122,9 @@ function ftp_close($ftp_stream): void
|
||||
|
||||
/**
|
||||
* ftp_connect opens an FTP connection to the
|
||||
* specified host.
|
||||
* specified hostname.
|
||||
*
|
||||
* @param string $host The FTP server address. This parameter shouldn't have any trailing
|
||||
* @param string $hostname The FTP server address. This parameter shouldn't have any trailing
|
||||
* slashes and shouldn't be prefixed with ftp://.
|
||||
* @param int $port This parameter specifies an alternate port to connect to. If it is
|
||||
* omitted or set to zero, then the default FTP port, 21, will be used.
|
||||
@@ -132,14 +132,14 @@ function ftp_close($ftp_stream): void
|
||||
* If omitted, the default value is 90 seconds. The timeout can be changed and
|
||||
* queried at any time with ftp_set_option and
|
||||
* ftp_get_option.
|
||||
* @return resource Returns a FTP stream on success.
|
||||
* @return resource Returns an FTP\Connection instance on success.
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_connect(string $host, int $port = 21, int $timeout = 90)
|
||||
function ftp_connect(string $hostname, int $port = 21, int $timeout = 90)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ftp_connect($host, $port, $timeout);
|
||||
$result = \ftp_connect($hostname, $port, $timeout);
|
||||
if ($result === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
@@ -149,17 +149,17 @@ function ftp_connect(string $host, int $port = 21, int $timeout = 90)
|
||||
|
||||
/**
|
||||
* ftp_delete deletes the file specified by
|
||||
* path from the FTP server.
|
||||
* filename from the FTP server.
|
||||
*
|
||||
* @param resource $ftp_stream The link identifier of the FTP connection.
|
||||
* @param string $path The file to delete.
|
||||
* @param resource $ftp An FTP\Connection instance.
|
||||
* @param string $filename The file to delete.
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_delete($ftp_stream, string $path): void
|
||||
function ftp_delete($ftp, string $filename): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ftp_delete($ftp_stream, $path);
|
||||
$result = \ftp_delete($ftp, $filename);
|
||||
if ($result === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
@@ -167,22 +167,22 @@ function ftp_delete($ftp_stream, string $path): void
|
||||
|
||||
|
||||
/**
|
||||
* ftp_fget retrieves remote_file
|
||||
* ftp_fget retrieves remote_filename
|
||||
* from the FTP server, and writes it to the given file pointer.
|
||||
*
|
||||
* @param resource $ftp_stream The link identifier of the FTP connection.
|
||||
* @param resource $handle An open file pointer in which we store the data.
|
||||
* @param string $remote_file The remote file path.
|
||||
* @param resource $ftp An FTP\Connection instance.
|
||||
* @param resource $stream An open file pointer in which we store the data.
|
||||
* @param string $remote_filename The remote file path.
|
||||
* @param int $mode The transfer mode. Must be either FTP_ASCII or
|
||||
* FTP_BINARY.
|
||||
* @param int $resumepos The position in the remote file to start downloading from.
|
||||
* @param int $offset The position in the remote file to start downloading from.
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_fget($ftp_stream, $handle, string $remote_file, int $mode = FTP_BINARY, int $resumepos = 0): void
|
||||
function ftp_fget($ftp, $stream, string $remote_filename, int $mode = FTP_BINARY, int $offset = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ftp_fget($ftp_stream, $handle, $remote_file, $mode, $resumepos);
|
||||
$result = \ftp_fget($ftp, $stream, $remote_filename, $mode, $offset);
|
||||
if ($result === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
@@ -193,19 +193,19 @@ function ftp_fget($ftp_stream, $handle, string $remote_file, int $mode = FTP_BIN
|
||||
* ftp_fput uploads the data from a file pointer
|
||||
* to a remote file on the FTP server.
|
||||
*
|
||||
* @param resource $ftp_stream The link identifier of the FTP connection.
|
||||
* @param string $remote_file The remote file path.
|
||||
* @param resource $handle An open file pointer on the local file. Reading stops at end of file.
|
||||
* @param resource $ftp An FTP\Connection instance.
|
||||
* @param string $remote_filename The remote file path.
|
||||
* @param resource $stream An open file pointer on the local file. Reading stops at end of file.
|
||||
* @param int $mode The transfer mode. Must be either FTP_ASCII or
|
||||
* FTP_BINARY.
|
||||
* @param int $startpos The position in the remote file to start uploading to.
|
||||
* @param int $offset The position in the remote file to start uploading to.
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_fput($ftp_stream, string $remote_file, $handle, int $mode = FTP_BINARY, int $startpos = 0): void
|
||||
function ftp_fput($ftp, string $remote_filename, $stream, int $mode = FTP_BINARY, int $offset = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ftp_fput($ftp_stream, $remote_file, $handle, $mode, $startpos);
|
||||
$result = \ftp_fput($ftp, $remote_filename, $stream, $mode, $offset);
|
||||
if ($result === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
@@ -216,19 +216,19 @@ function ftp_fput($ftp_stream, string $remote_file, $handle, int $mode = FTP_BIN
|
||||
* ftp_get retrieves a remote file from the FTP server,
|
||||
* and saves it into a local file.
|
||||
*
|
||||
* @param resource $ftp_stream The link identifier of the FTP connection.
|
||||
* @param string $local_file The local file path (will be overwritten if the file already exists).
|
||||
* @param string $remote_file The remote file path.
|
||||
* @param resource $ftp An FTP\Connection instance.
|
||||
* @param string $local_filename The local file path (will be overwritten if the file already exists).
|
||||
* @param string $remote_filename The remote file path.
|
||||
* @param int $mode The transfer mode. Must be either FTP_ASCII or
|
||||
* FTP_BINARY.
|
||||
* @param int $resumepos The position in the remote file to start downloading from.
|
||||
* @param int $offset The position in the remote file to start downloading from.
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_get($ftp_stream, string $local_file, string $remote_file, int $mode = FTP_BINARY, int $resumepos = 0): void
|
||||
function ftp_get($ftp, string $local_filename, string $remote_filename, int $mode = FTP_BINARY, int $offset = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ftp_get($ftp_stream, $local_file, $remote_file, $mode, $resumepos);
|
||||
$result = \ftp_get($ftp, $local_filename, $remote_filename, $mode, $offset);
|
||||
if ($result === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
@@ -236,18 +236,18 @@ function ftp_get($ftp_stream, string $local_file, string $remote_file, int $mode
|
||||
|
||||
|
||||
/**
|
||||
* Logs in to the given FTP stream.
|
||||
* Logs in to the given FTP connection.
|
||||
*
|
||||
* @param resource $ftp_stream The link identifier of the FTP connection.
|
||||
* @param resource $ftp An FTP\Connection instance.
|
||||
* @param string $username The username (USER).
|
||||
* @param string $password The password (PASS).
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_login($ftp_stream, string $username, string $password): void
|
||||
function ftp_login($ftp, string $username, string $password): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ftp_login($ftp_stream, $username, $password);
|
||||
$result = \ftp_login($ftp, $username, $password);
|
||||
if ($result === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
@@ -257,16 +257,16 @@ function ftp_login($ftp_stream, string $username, string $password): void
|
||||
/**
|
||||
* Creates the specified directory on the FTP server.
|
||||
*
|
||||
* @param resource $ftp_stream The link identifier of the FTP connection.
|
||||
* @param resource $ftp An FTP\Connection instance.
|
||||
* @param string $directory The name of the directory that will be created.
|
||||
* @return string Returns the newly created directory name on success.
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_mkdir($ftp_stream, string $directory): string
|
||||
function ftp_mkdir($ftp, string $directory): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ftp_mkdir($ftp_stream, $directory);
|
||||
$result = \ftp_mkdir($ftp, $directory);
|
||||
if ($result === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
@@ -277,16 +277,45 @@ function ftp_mkdir($ftp_stream, string $directory): string
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param resource $ftp_stream The link identifier of the FTP connection.
|
||||
* @param resource $ftp An FTP\Connection instance.
|
||||
* @param string $directory The directory to be listed.
|
||||
* @return array Returns an array of arrays with file infos from the specified directory on success.
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_mlsd($ftp_stream, string $directory): array
|
||||
function ftp_mlsd($ftp, string $directory): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ftp_mlsd($ftp_stream, $directory);
|
||||
$result = \ftp_mlsd($ftp, $directory);
|
||||
if ($result === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ftp_nb_put stores a local file on the FTP server.
|
||||
*
|
||||
* The difference between this function and the ftp_put
|
||||
* is that this function uploads the file asynchronously, so your program can
|
||||
* perform other operations while the file is being uploaded.
|
||||
*
|
||||
* @param resource $ftp An FTP\Connection instance.
|
||||
* @param string $remote_filename The remote file path.
|
||||
* @param string $local_filename The local file path.
|
||||
* @param int $mode The transfer mode. Must be either FTP_ASCII or
|
||||
* FTP_BINARY.
|
||||
* @param int $offset The position in the remote file to start uploading to.
|
||||
* @return int Returns FTP_FAILED or FTP_FINISHED
|
||||
* or FTP_MOREDATA to open the local file.
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_nb_put($ftp, string $remote_filename, string $local_filename, int $mode = FTP_BINARY, int $offset = 0): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ftp_nb_put($ftp, $remote_filename, $local_filename, $mode, $offset);
|
||||
if ($result === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
@@ -297,19 +326,19 @@ function ftp_mlsd($ftp_stream, string $directory): array
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param resource $ftp_stream The link identifier of the FTP connection.
|
||||
* @param resource $ftp An FTP\Connection instance.
|
||||
* @param string $directory The directory to be listed. This parameter can also include arguments, eg.
|
||||
* ftp_nlist($conn_id, "-la /your/dir");
|
||||
* ftp_nlist($ftp, "-la /your/dir");.
|
||||
* Note that this parameter isn't escaped so there may be some issues with
|
||||
* filenames containing spaces and other characters.
|
||||
* @return array Returns an array of filenames from the specified directory on success.
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_nlist($ftp_stream, string $directory): array
|
||||
function ftp_nlist($ftp, string $directory): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ftp_nlist($ftp_stream, $directory);
|
||||
$result = \ftp_nlist($ftp, $directory);
|
||||
if ($result === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
@@ -326,15 +355,15 @@ function ftp_nlist($ftp_stream, string $directory): array
|
||||
* Please note that ftp_pasv can only be called after a
|
||||
* successful login or otherwise it will fail.
|
||||
*
|
||||
* @param resource $ftp_stream The link identifier of the FTP connection.
|
||||
* @param bool $pasv If TRUE, the passive mode is turned on, else it's turned off.
|
||||
* @param resource $ftp An FTP\Connection instance.
|
||||
* @param bool $enable If TRUE, the passive mode is turned on, else it's turned off.
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_pasv($ftp_stream, bool $pasv): void
|
||||
function ftp_pasv($ftp, bool $enable): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ftp_pasv($ftp_stream, $pasv);
|
||||
$result = \ftp_pasv($ftp, $enable);
|
||||
if ($result === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
@@ -344,19 +373,19 @@ function ftp_pasv($ftp_stream, bool $pasv): void
|
||||
/**
|
||||
* ftp_put stores a local file on the FTP server.
|
||||
*
|
||||
* @param resource $ftp_stream The link identifier of the FTP connection.
|
||||
* @param string $remote_file The remote file path.
|
||||
* @param string $local_file The local file path.
|
||||
* @param resource $ftp An FTP\Connection instance.
|
||||
* @param string $remote_filename The remote file path.
|
||||
* @param string $local_filename The local file path.
|
||||
* @param int $mode The transfer mode. Must be either FTP_ASCII or
|
||||
* FTP_BINARY.
|
||||
* @param int $startpos The position in the remote file to start uploading to.
|
||||
* @param int $offset The position in the remote file to start uploading to.
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_put($ftp_stream, string $remote_file, string $local_file, int $mode = FTP_BINARY, int $startpos = 0): void
|
||||
function ftp_put($ftp, string $remote_filename, string $local_filename, int $mode = FTP_BINARY, int $offset = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ftp_put($ftp_stream, $remote_file, $local_file, $mode, $startpos);
|
||||
$result = \ftp_put($ftp, $remote_filename, $local_filename, $mode, $offset);
|
||||
if ($result === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
@@ -366,15 +395,15 @@ function ftp_put($ftp_stream, string $remote_file, string $local_file, int $mode
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param resource $ftp_stream The link identifier of the FTP connection.
|
||||
* @param resource $ftp An FTP\Connection instance.
|
||||
* @return string Returns the current directory name.
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_pwd($ftp_stream): string
|
||||
function ftp_pwd($ftp): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ftp_pwd($ftp_stream);
|
||||
$result = \ftp_pwd($ftp);
|
||||
if ($result === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
@@ -382,20 +411,42 @@ function ftp_pwd($ftp_stream): string
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sends an arbitrary command to the FTP server.
|
||||
*
|
||||
* @param resource $ftp An FTP\Connection instance.
|
||||
* @param string $command The command to execute.
|
||||
* @return array Returns the server's response as an array of strings.
|
||||
* No parsing is performed on the response string, nor does
|
||||
* ftp_raw determine if the command succeeded.
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_raw($ftp, string $command): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ftp_raw($ftp, $command);
|
||||
if ($result === null) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ftp_rename renames a file or a directory on the FTP
|
||||
* server.
|
||||
*
|
||||
* @param resource $ftp_stream The link identifier of the FTP connection.
|
||||
* @param string $oldname The old file/directory name.
|
||||
* @param string $newname The new name.
|
||||
* @param resource $ftp An FTP\Connection instance.
|
||||
* @param string $from The old file/directory name.
|
||||
* @param string $to The new name.
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_rename($ftp_stream, string $oldname, string $newname): void
|
||||
function ftp_rename($ftp, string $from, string $to): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ftp_rename($ftp_stream, $oldname, $newname);
|
||||
$result = \ftp_rename($ftp, $from, $to);
|
||||
if ($result === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
@@ -405,16 +456,16 @@ function ftp_rename($ftp_stream, string $oldname, string $newname): void
|
||||
/**
|
||||
* Removes the specified directory on the FTP server.
|
||||
*
|
||||
* @param resource $ftp_stream The link identifier of the FTP connection.
|
||||
* @param resource $ftp An FTP\Connection instance.
|
||||
* @param string $directory The directory to delete. This must be either an absolute or relative
|
||||
* path to an empty directory.
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_rmdir($ftp_stream, string $directory): void
|
||||
function ftp_rmdir($ftp, string $directory): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ftp_rmdir($ftp_stream, $directory);
|
||||
$result = \ftp_rmdir($ftp, $directory);
|
||||
if ($result === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
@@ -429,16 +480,16 @@ function ftp_rmdir($ftp_stream, string $directory): void
|
||||
* to server. They are useful for handling such things as file permissions and
|
||||
* group membership.
|
||||
*
|
||||
* @param resource $ftp_stream The link identifier of the FTP connection.
|
||||
* @param resource $ftp An FTP\Connection instance.
|
||||
* @param string $command The SITE command. Note that this parameter isn't escaped so there may
|
||||
* be some issues with filenames containing spaces and other characters.
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_site($ftp_stream, string $command): void
|
||||
function ftp_site($ftp, string $command): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ftp_site($ftp_stream, $command);
|
||||
$result = \ftp_site($ftp, $command);
|
||||
if ($result === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
@@ -447,14 +498,14 @@ function ftp_site($ftp_stream, string $command): void
|
||||
|
||||
/**
|
||||
* ftp_ssl_connect opens an explicit SSL-FTP connection to the
|
||||
* specified host. That implies that
|
||||
* specified hostname. That implies that
|
||||
* ftp_ssl_connect will succeed even if the server is not
|
||||
* configured for SSL-FTP, or its certificate is invalid. Only when
|
||||
* ftp_login is called, the client will send the
|
||||
* appropriate AUTH FTP command, so ftp_login will fail in
|
||||
* the mentioned cases.
|
||||
*
|
||||
* @param string $host The FTP server address. This parameter shouldn't have any trailing
|
||||
* @param string $hostname The FTP server address. This parameter shouldn't have any trailing
|
||||
* slashes and shouldn't be prefixed with ftp://.
|
||||
* @param int $port This parameter specifies an alternate port to connect to. If it is
|
||||
* omitted or set to zero, then the default FTP port, 21, will be used.
|
||||
@@ -462,14 +513,14 @@ function ftp_site($ftp_stream, string $command): void
|
||||
* If omitted, the default value is 90 seconds. The timeout can be changed and
|
||||
* queried at any time with ftp_set_option and
|
||||
* ftp_get_option.
|
||||
* @return resource Returns a SSL-FTP stream on success.
|
||||
* @return resource Returns an FTP\Connection instance on success.
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_ssl_connect(string $host, int $port = 21, int $timeout = 90)
|
||||
function ftp_ssl_connect(string $hostname, int $port = 21, int $timeout = 90)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ftp_ssl_connect($host, $port, $timeout);
|
||||
$result = \ftp_ssl_connect($hostname, $port, $timeout);
|
||||
if ($result === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
@@ -480,15 +531,15 @@ function ftp_ssl_connect(string $host, int $port = 21, int $timeout = 90)
|
||||
/**
|
||||
* Returns the system type identifier of the remote FTP server.
|
||||
*
|
||||
* @param resource $ftp_stream The link identifier of the FTP connection.
|
||||
* @param resource $ftp An FTP\Connection instance.
|
||||
* @return string Returns the remote system type.
|
||||
* @throws FtpException
|
||||
*
|
||||
*/
|
||||
function ftp_systype($ftp_stream): string
|
||||
function ftp_systype($ftp): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ftp_systype($ftp_stream);
|
||||
$result = \ftp_systype($ftp);
|
||||
if ($result === false) {
|
||||
throw FtpException::createFromPhpError();
|
||||
}
|
||||
|
||||
@@ -5,12 +5,14 @@ namespace Safe;
|
||||
use Safe\Exceptions\FunchandException;
|
||||
|
||||
/**
|
||||
* Creates an anonymous function from the parameters passed, and
|
||||
* returns a unique name for it.
|
||||
* Creates a function dynamically from the parameters passed, and returns a unique name for it.
|
||||
*
|
||||
* @param string $args The function arguments.
|
||||
* @param string $args The function arguments, as a single comma-separated string.
|
||||
* @param string $code The function code.
|
||||
* @return string Returns a unique function name as a string.
|
||||
* Note that the name contains a non-printable character ("\0"),
|
||||
* so care should be taken when printing the name or incorporating it in any other
|
||||
* string.
|
||||
* @throws FunchandException
|
||||
*
|
||||
*/
|
||||
@@ -28,18 +30,18 @@ function create_function(string $args, string $code): string
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param callable(): void $function The function to register.
|
||||
* @param mixed $params
|
||||
* @param callable(): void $callback The function to register.
|
||||
* @param mixed $args
|
||||
* @throws FunchandException
|
||||
*
|
||||
*/
|
||||
function register_tick_function(callable $function, ...$params): void
|
||||
function register_tick_function(callable $callback, ...$args): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($params !== []) {
|
||||
$result = \register_tick_function($function, ...$params);
|
||||
if ($args !== []) {
|
||||
$result = \register_tick_function($callback, ...$args);
|
||||
} else {
|
||||
$result = \register_tick_function($function);
|
||||
$result = \register_tick_function($callback);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw FunchandException::createFromPhpError();
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
return [
|
||||
'apache_getenv',
|
||||
'apache_get_version',
|
||||
'apache_lookup_uri',
|
||||
'apache_request_headers',
|
||||
'apache_reset_timeout',
|
||||
'apache_response_headers',
|
||||
'apache_setenv',
|
||||
'apcu_cache_info',
|
||||
@@ -14,14 +14,12 @@ return [
|
||||
'apcu_inc',
|
||||
'apcu_sma_info',
|
||||
'apc_fetch',
|
||||
'array_combine',
|
||||
'array_flip',
|
||||
'array_replace',
|
||||
'array_replace_recursive',
|
||||
'array_walk_recursive',
|
||||
'arsort',
|
||||
'asort',
|
||||
'assert_options',
|
||||
'base64_decode',
|
||||
'bindtextdomain',
|
||||
'bzclose',
|
||||
'bzflush',
|
||||
'bzread',
|
||||
@@ -37,32 +35,75 @@ return [
|
||||
'class_uses',
|
||||
'cli_set_process_title',
|
||||
'closelog',
|
||||
'com_create_guid',
|
||||
'com_event_sink',
|
||||
'com_load_typelib',
|
||||
'com_print_typeinfo',
|
||||
'convert_uudecode',
|
||||
'convert_uuencode',
|
||||
'copy',
|
||||
'create_function',
|
||||
'cubrid_bind',
|
||||
'cubrid_column_names',
|
||||
'cubrid_column_types',
|
||||
'cubrid_col_size',
|
||||
'cubrid_commit',
|
||||
'cubrid_connect',
|
||||
'cubrid_connect_with_url',
|
||||
'cubrid_current_oid',
|
||||
'cubrid_disconnect',
|
||||
'cubrid_drop',
|
||||
'cubrid_free_result',
|
||||
'cubrid_get_charset',
|
||||
'cubrid_get_class_name',
|
||||
'cubrid_get_client_info',
|
||||
'cubrid_get_db_parameter',
|
||||
'cubrid_get_query_timeout',
|
||||
'cubrid_get_server_info',
|
||||
'cubrid_insert_id',
|
||||
'cubrid_lob2_bind',
|
||||
'cubrid_lob2_close',
|
||||
'cubrid_lob2_export',
|
||||
'cubrid_lob2_import',
|
||||
'cubrid_lob2_new',
|
||||
'cubrid_lob2_read',
|
||||
'cubrid_lob2_seek',
|
||||
'cubrid_lob2_seek64',
|
||||
'cubrid_lob2_size',
|
||||
'cubrid_lob2_size64',
|
||||
'cubrid_lob2_tell',
|
||||
'cubrid_lob2_tell64',
|
||||
'cubrid_lob2_write',
|
||||
'cubrid_lob_close',
|
||||
'cubrid_lob_export',
|
||||
'cubrid_lob_get',
|
||||
'cubrid_lob_send',
|
||||
'cubrid_lob_size',
|
||||
'cubrid_lock_read',
|
||||
'cubrid_lock_write',
|
||||
'cubrid_move_cursor',
|
||||
'cubrid_next_result',
|
||||
'cubrid_pconnect',
|
||||
'cubrid_pconnect_with_url',
|
||||
'cubrid_prepare',
|
||||
'cubrid_put',
|
||||
'cubrid_rollback',
|
||||
'cubrid_schema',
|
||||
'cubrid_seq_drop',
|
||||
'cubrid_seq_insert',
|
||||
'cubrid_seq_put',
|
||||
'cubrid_set_add',
|
||||
'cubrid_set_autocommit',
|
||||
'cubrid_set_db_parameter',
|
||||
'cubrid_set_drop',
|
||||
'cubrid_set_query_timeout',
|
||||
'curl_copy_handle',
|
||||
'curl_escape',
|
||||
'curl_exec',
|
||||
'curl_getinfo',
|
||||
'curl_init',
|
||||
'curl_multi_errno',
|
||||
'curl_multi_info_read',
|
||||
'curl_multi_init',
|
||||
'curl_multi_setopt',
|
||||
'curl_setopt',
|
||||
'curl_share_errno',
|
||||
'curl_share_setopt',
|
||||
@@ -102,6 +143,7 @@ return [
|
||||
'eio_event_loop',
|
||||
'eio_fallocate',
|
||||
'eio_fchmod',
|
||||
'eio_fchown',
|
||||
'eio_fdatasync',
|
||||
'eio_fstat',
|
||||
'eio_fstatvfs',
|
||||
@@ -131,16 +173,20 @@ return [
|
||||
'eio_utime',
|
||||
'eio_write',
|
||||
'error_log',
|
||||
'exec',
|
||||
'fastcgi_finish_request',
|
||||
'fbird_blob_cancel',
|
||||
'fclose',
|
||||
'fdatasync',
|
||||
'fflush',
|
||||
'fgetcsv',
|
||||
'file',
|
||||
'fileatime',
|
||||
'filectime',
|
||||
'fileinode',
|
||||
'filemtime',
|
||||
'fileowner',
|
||||
'fileperms',
|
||||
'filesize',
|
||||
'file_get_contents',
|
||||
'file_put_contents',
|
||||
@@ -153,6 +199,8 @@ return [
|
||||
'fputcsv',
|
||||
'fread',
|
||||
'fsockopen',
|
||||
'fstat',
|
||||
'fsync',
|
||||
'ftp_alloc',
|
||||
'ftp_append',
|
||||
'ftp_cdup',
|
||||
@@ -167,10 +215,12 @@ return [
|
||||
'ftp_login',
|
||||
'ftp_mkdir',
|
||||
'ftp_mlsd',
|
||||
'ftp_nb_put',
|
||||
'ftp_nlist',
|
||||
'ftp_pasv',
|
||||
'ftp_put',
|
||||
'ftp_pwd',
|
||||
'ftp_raw',
|
||||
'ftp_rename',
|
||||
'ftp_rmdir',
|
||||
'ftp_site',
|
||||
@@ -190,19 +240,22 @@ return [
|
||||
'getopt',
|
||||
'getprotobyname',
|
||||
'getprotobynumber',
|
||||
'getrusage',
|
||||
'getservbyport',
|
||||
'get_headers',
|
||||
'get_include_path',
|
||||
'get_meta_tags',
|
||||
'glob',
|
||||
'gmdate',
|
||||
'gmp_binomial',
|
||||
'gmp_export',
|
||||
'gmp_import',
|
||||
'gmmktime',
|
||||
'gmp_random_seed',
|
||||
'gmstrftime',
|
||||
'gnupg_adddecryptkey',
|
||||
'gnupg_addencryptkey',
|
||||
'gnupg_addsignkey',
|
||||
'gnupg_cleardecryptkeys',
|
||||
'gnupg_clearencryptkeys',
|
||||
'gnupg_clearsignkeys',
|
||||
'gnupg_deletekey',
|
||||
'gnupg_setarmor',
|
||||
'gnupg_setsignmode',
|
||||
'gzclose',
|
||||
@@ -210,18 +263,23 @@ return [
|
||||
'gzdecode',
|
||||
'gzdeflate',
|
||||
'gzencode',
|
||||
'gzfile',
|
||||
'gzgets',
|
||||
'gzgetss',
|
||||
'gzinflate',
|
||||
'gzopen',
|
||||
'gzpassthru',
|
||||
'gzread',
|
||||
'gzrewind',
|
||||
'gzuncompress',
|
||||
'gzwrite',
|
||||
'hash_hkdf',
|
||||
'hash_update_file',
|
||||
'header_register_callback',
|
||||
'hex2bin',
|
||||
'highlight_file',
|
||||
'highlight_string',
|
||||
'hrtime',
|
||||
'ibase_add_user',
|
||||
'ibase_backup',
|
||||
'ibase_blob_cancel',
|
||||
@@ -248,6 +306,7 @@ return [
|
||||
'iconv',
|
||||
'iconv_get_encoding',
|
||||
'iconv_set_encoding',
|
||||
'idate',
|
||||
'image2wbmp',
|
||||
'imageaffine',
|
||||
'imageaffinematrixconcat',
|
||||
@@ -255,12 +314,14 @@ return [
|
||||
'imagealphablending',
|
||||
'imageantialias',
|
||||
'imagearc',
|
||||
'imageavif',
|
||||
'imagebmp',
|
||||
'imagechar',
|
||||
'imagecharup',
|
||||
'imagecolorat',
|
||||
'imagecolordeallocate',
|
||||
'imagecolormatch',
|
||||
'imagecolorset',
|
||||
'imageconvolution',
|
||||
'imagecopy',
|
||||
'imagecopymerge',
|
||||
@@ -268,6 +329,7 @@ return [
|
||||
'imagecopyresampled',
|
||||
'imagecopyresized',
|
||||
'imagecreate',
|
||||
'imagecreatefromavif',
|
||||
'imagecreatefrombmp',
|
||||
'imagecreatefromgd',
|
||||
'imagecreatefromgd2',
|
||||
@@ -275,6 +337,8 @@ return [
|
||||
'imagecreatefromgif',
|
||||
'imagecreatefromjpeg',
|
||||
'imagecreatefrompng',
|
||||
'imagecreatefromstring',
|
||||
'imagecreatefromtga',
|
||||
'imagecreatefromwbmp',
|
||||
'imagecreatefromwebp',
|
||||
'imagecreatefromxbm',
|
||||
@@ -288,11 +352,12 @@ return [
|
||||
'imagefill',
|
||||
'imagefilledarc',
|
||||
'imagefilledellipse',
|
||||
'imagefilledpolygon',
|
||||
'imagefilledrectangle',
|
||||
'imagefilltoborder',
|
||||
'imagefilter',
|
||||
'imageflip',
|
||||
'imageftbbox',
|
||||
'imagefttext',
|
||||
'imagegammacorrect',
|
||||
'imagegd',
|
||||
'imagegd2',
|
||||
@@ -303,10 +368,9 @@ return [
|
||||
'imagelayereffect',
|
||||
'imageline',
|
||||
'imageloadfont',
|
||||
'imageopenpolygon',
|
||||
'imagepng',
|
||||
'imagepolygon',
|
||||
'imagerectangle',
|
||||
'imageresolution',
|
||||
'imagerotate',
|
||||
'imagesavealpha',
|
||||
'imagescale',
|
||||
@@ -327,29 +391,49 @@ return [
|
||||
'imagewbmp',
|
||||
'imagewebp',
|
||||
'imagexbm',
|
||||
'image_type_to_extension',
|
||||
'imap_8bit',
|
||||
'imap_append',
|
||||
'imap_base64',
|
||||
'imap_binary',
|
||||
'imap_body',
|
||||
'imap_bodystruct',
|
||||
'imap_check',
|
||||
'imap_clearflag_full',
|
||||
'imap_close',
|
||||
'imap_createmailbox',
|
||||
'imap_deletemailbox',
|
||||
'imap_fetchbody',
|
||||
'imap_fetchheader',
|
||||
'imap_fetchmime',
|
||||
'imap_fetchstructure',
|
||||
'imap_fetch_overview',
|
||||
'imap_gc',
|
||||
'imap_getacl',
|
||||
'imap_getmailboxes',
|
||||
'imap_getsubscribed',
|
||||
'imap_headerinfo',
|
||||
'imap_headers',
|
||||
'imap_listscan',
|
||||
'imap_lsub',
|
||||
'imap_mail',
|
||||
'imap_mailboxmsginfo',
|
||||
'imap_mail_compose',
|
||||
'imap_mail_copy',
|
||||
'imap_mail_move',
|
||||
'imap_mime_header_decode',
|
||||
'imap_mutf7_to_utf8',
|
||||
'imap_num_msg',
|
||||
'imap_open',
|
||||
'imap_qprint',
|
||||
'imap_renamemailbox',
|
||||
'imap_rfc822_write_address',
|
||||
'imap_savebody',
|
||||
'imap_setacl',
|
||||
'imap_setflag_full',
|
||||
'imap_set_quota',
|
||||
'imap_sort',
|
||||
'imap_status',
|
||||
'imap_subscribe',
|
||||
'imap_thread',
|
||||
'imap_timeout',
|
||||
@@ -361,42 +445,25 @@ return [
|
||||
'inflate_get_read_len',
|
||||
'inflate_get_status',
|
||||
'inflate_init',
|
||||
'ingres_autocommit',
|
||||
'ingres_close',
|
||||
'ingres_commit',
|
||||
'ingres_connect',
|
||||
'ingres_execute',
|
||||
'ingres_field_name',
|
||||
'ingres_field_type',
|
||||
'ingres_free_result',
|
||||
'ingres_pconnect',
|
||||
'ingres_result_seek',
|
||||
'ingres_rollback',
|
||||
'ingres_set_environment',
|
||||
'ini_get',
|
||||
'ini_set',
|
||||
'inotify_init',
|
||||
'inotify_rm_watch',
|
||||
'iptcembed',
|
||||
'iptcparse',
|
||||
'jdtounix',
|
||||
'jpeg2wbmp',
|
||||
'json_decode',
|
||||
'json_encode',
|
||||
'json_last_error_msg',
|
||||
'krsort',
|
||||
'ksort',
|
||||
'lchgrp',
|
||||
'lchown',
|
||||
'ldap_8859_to_t61',
|
||||
'ldap_add',
|
||||
'ldap_add_ext',
|
||||
'ldap_bind',
|
||||
'ldap_bind_ext',
|
||||
'ldap_control_paged_result',
|
||||
'ldap_control_paged_result_response',
|
||||
'ldap_count_entries',
|
||||
'ldap_delete',
|
||||
'ldap_delete_ext',
|
||||
'ldap_dn2ufn',
|
||||
'ldap_exop',
|
||||
'ldap_exop_passwd',
|
||||
'ldap_exop_whoami',
|
||||
@@ -410,27 +477,22 @@ return [
|
||||
'ldap_get_option',
|
||||
'ldap_get_values',
|
||||
'ldap_get_values_len',
|
||||
'ldap_list',
|
||||
'ldap_modify_batch',
|
||||
'ldap_mod_add',
|
||||
'ldap_mod_add_ext',
|
||||
'ldap_mod_del',
|
||||
'ldap_mod_del_ext',
|
||||
'ldap_mod_replace',
|
||||
'ldap_mod_replace_ext',
|
||||
'ldap_next_attribute',
|
||||
'ldap_parse_exop',
|
||||
'ldap_parse_result',
|
||||
'ldap_read',
|
||||
'ldap_rename',
|
||||
'ldap_rename_ext',
|
||||
'ldap_sasl_bind',
|
||||
'ldap_search',
|
||||
'ldap_set_option',
|
||||
'ldap_unbind',
|
||||
'libxml_get_last_error',
|
||||
'libxml_set_external_entity_loader',
|
||||
'link',
|
||||
'long2ip',
|
||||
'lstat',
|
||||
'lzf_compress',
|
||||
'lzf_decompress',
|
||||
'mailparse_msg_extract_part_file',
|
||||
@@ -439,6 +501,7 @@ return [
|
||||
'mailparse_msg_parse_file',
|
||||
'mailparse_stream_encode',
|
||||
'mb_chr',
|
||||
'mb_convert_encoding',
|
||||
'mb_detect_order',
|
||||
'mb_encoding_aliases',
|
||||
'mb_eregi_replace',
|
||||
@@ -448,6 +511,7 @@ return [
|
||||
'mb_ereg_search_init',
|
||||
'mb_ereg_search_regs',
|
||||
'mb_ereg_search_setpos',
|
||||
'mb_get_info',
|
||||
'mb_http_output',
|
||||
'mb_internal_encoding',
|
||||
'mb_ord',
|
||||
@@ -455,42 +519,17 @@ return [
|
||||
'mb_regex_encoding',
|
||||
'mb_send_mail',
|
||||
'mb_split',
|
||||
'mb_str_split',
|
||||
'md5_file',
|
||||
'metaphone',
|
||||
'mime_content_type',
|
||||
'mkdir',
|
||||
'mktime',
|
||||
'msg_get_queue',
|
||||
'msg_queue_exists',
|
||||
'msg_receive',
|
||||
'msg_remove_queue',
|
||||
'msg_send',
|
||||
'msg_set_queue',
|
||||
'msql_affected_rows',
|
||||
'msql_close',
|
||||
'msql_connect',
|
||||
'msql_create_db',
|
||||
'msql_data_seek',
|
||||
'msql_db_query',
|
||||
'msql_drop_db',
|
||||
'msql_field_len',
|
||||
'msql_field_name',
|
||||
'msql_field_seek',
|
||||
'msql_field_table',
|
||||
'msql_field_type',
|
||||
'msql_free_result',
|
||||
'msql_pconnect',
|
||||
'msql_query',
|
||||
'msql_select_db',
|
||||
'mysqli_get_cache_stats',
|
||||
'mysqli_get_client_stats',
|
||||
'mysqlnd_ms_dump_servers',
|
||||
'mysqlnd_ms_fabric_select_global',
|
||||
'mysqlnd_ms_fabric_select_shard',
|
||||
'mysqlnd_ms_get_last_used_connection',
|
||||
'mysqlnd_qc_clear_cache',
|
||||
'mysqlnd_qc_set_is_select',
|
||||
'mysqlnd_qc_set_storage_handler',
|
||||
'msg_stat_queue',
|
||||
'mysql_close',
|
||||
'mysql_connect',
|
||||
'mysql_create_db',
|
||||
@@ -522,19 +561,19 @@ return [
|
||||
'mysql_tablename',
|
||||
'mysql_thread_id',
|
||||
'mysql_unbuffered_query',
|
||||
'natcasesort',
|
||||
'natsort',
|
||||
'net_get_interfaces',
|
||||
'ob_clean',
|
||||
'ob_end_clean',
|
||||
'ob_end_flush',
|
||||
'ob_flush',
|
||||
'ob_start',
|
||||
'oci_bind_array_by_name',
|
||||
'oci_bind_by_name',
|
||||
'oci_cancel',
|
||||
'oci_close',
|
||||
'oci_commit',
|
||||
'oci_connect',
|
||||
'oci_define_by_name',
|
||||
'oci_execute',
|
||||
'oci_fetch_all',
|
||||
'oci_field_name',
|
||||
'oci_field_precision',
|
||||
'oci_field_scale',
|
||||
@@ -547,10 +586,10 @@ return [
|
||||
'oci_new_connect',
|
||||
'oci_new_cursor',
|
||||
'oci_new_descriptor',
|
||||
'oci_num_fields',
|
||||
'oci_num_rows',
|
||||
'oci_parse',
|
||||
'oci_pconnect',
|
||||
'oci_register_taf_callback',
|
||||
'oci_result',
|
||||
'oci_rollback',
|
||||
'oci_server_version',
|
||||
@@ -562,6 +601,7 @@ return [
|
||||
'oci_set_edition',
|
||||
'oci_set_module_name',
|
||||
'oci_set_prefetch',
|
||||
'oci_set_prefetch_lob',
|
||||
'oci_statement_type',
|
||||
'oci_unregister_taf_callback',
|
||||
'odbc_autocommit',
|
||||
@@ -569,6 +609,8 @@ return [
|
||||
'odbc_columnprivileges',
|
||||
'odbc_columns',
|
||||
'odbc_commit',
|
||||
'odbc_connect',
|
||||
'odbc_cursor',
|
||||
'odbc_data_source',
|
||||
'odbc_exec',
|
||||
'odbc_execute',
|
||||
@@ -581,8 +623,11 @@ return [
|
||||
'odbc_foreignkeys',
|
||||
'odbc_gettypeinfo',
|
||||
'odbc_longreadlen',
|
||||
'odbc_pconnect',
|
||||
'odbc_prepare',
|
||||
'odbc_primarykeys',
|
||||
'odbc_procedurecolumns',
|
||||
'odbc_procedures',
|
||||
'odbc_result',
|
||||
'odbc_result_all',
|
||||
'odbc_rollback',
|
||||
@@ -596,8 +641,14 @@ return [
|
||||
'opendir',
|
||||
'openlog',
|
||||
'openssl_cipher_iv_length',
|
||||
'openssl_cms_decrypt',
|
||||
'openssl_cms_encrypt',
|
||||
'openssl_cms_read',
|
||||
'openssl_cms_sign',
|
||||
'openssl_cms_verify',
|
||||
'openssl_csr_export',
|
||||
'openssl_csr_export_to_file',
|
||||
'openssl_csr_get_public_key',
|
||||
'openssl_csr_get_subject',
|
||||
'openssl_csr_new',
|
||||
'openssl_csr_sign',
|
||||
@@ -605,6 +656,7 @@ return [
|
||||
'openssl_dh_compute_key',
|
||||
'openssl_digest',
|
||||
'openssl_encrypt',
|
||||
'openssl_get_curve_names',
|
||||
'openssl_open',
|
||||
'openssl_pbkdf2',
|
||||
'openssl_pkcs7_decrypt',
|
||||
@@ -614,6 +666,7 @@ return [
|
||||
'openssl_pkcs12_export',
|
||||
'openssl_pkcs12_export_to_file',
|
||||
'openssl_pkcs12_read',
|
||||
'openssl_pkey_derive',
|
||||
'openssl_pkey_export',
|
||||
'openssl_pkey_export_to_file',
|
||||
'openssl_pkey_get_private',
|
||||
@@ -626,6 +679,11 @@ return [
|
||||
'openssl_random_pseudo_bytes',
|
||||
'openssl_seal',
|
||||
'openssl_sign',
|
||||
'openssl_spki_export',
|
||||
'openssl_spki_export_challenge',
|
||||
'openssl_spki_new',
|
||||
'openssl_spki_verify',
|
||||
'openssl_verify',
|
||||
'openssl_x509_export',
|
||||
'openssl_x509_export_to_file',
|
||||
'openssl_x509_fingerprint',
|
||||
@@ -636,123 +694,43 @@ return [
|
||||
'parse_ini_file',
|
||||
'parse_ini_string',
|
||||
'parse_url',
|
||||
'password_hash',
|
||||
'pcntl_exec',
|
||||
'passthru',
|
||||
'pcntl_getpriority',
|
||||
'pcntl_setpriority',
|
||||
'pcntl_signal',
|
||||
'pcntl_signal_dispatch',
|
||||
'pcntl_sigprocmask',
|
||||
'pcntl_strerror',
|
||||
'PDF_activate_item',
|
||||
'PDF_add_locallink',
|
||||
'PDF_add_nameddest',
|
||||
'PDF_add_note',
|
||||
'PDF_add_pdflink',
|
||||
'PDF_add_thumbnail',
|
||||
'PDF_add_weblink',
|
||||
'PDF_attach_file',
|
||||
'PDF_begin_layer',
|
||||
'PDF_begin_page',
|
||||
'PDF_begin_page_ext',
|
||||
'PDF_circle',
|
||||
'PDF_clip',
|
||||
'PDF_close',
|
||||
'PDF_closepath',
|
||||
'PDF_closepath_fill_stroke',
|
||||
'PDF_closepath_stroke',
|
||||
'PDF_close_pdi',
|
||||
'PDF_close_pdi_page',
|
||||
'PDF_concat',
|
||||
'PDF_continue_text',
|
||||
'PDF_curveto',
|
||||
'PDF_delete',
|
||||
'PDF_end_layer',
|
||||
'PDF_end_page',
|
||||
'PDF_end_page_ext',
|
||||
'PDF_end_pattern',
|
||||
'PDF_end_template',
|
||||
'PDF_fill',
|
||||
'PDF_fill_stroke',
|
||||
'PDF_fit_image',
|
||||
'PDF_fit_pdi_page',
|
||||
'PDF_fit_textline',
|
||||
'PDF_initgraphics',
|
||||
'PDF_lineto',
|
||||
'PDF_makespotcolor',
|
||||
'PDF_moveto',
|
||||
'PDF_open_file',
|
||||
'PDF_place_image',
|
||||
'PDF_place_pdi_page',
|
||||
'PDF_rect',
|
||||
'PDF_restore',
|
||||
'PDF_rotate',
|
||||
'PDF_save',
|
||||
'PDF_scale',
|
||||
'PDF_setcolor',
|
||||
'PDF_setdash',
|
||||
'PDF_setdashpattern',
|
||||
'PDF_setflat',
|
||||
'PDF_setfont',
|
||||
'PDF_setgray',
|
||||
'PDF_setgray_fill',
|
||||
'PDF_setgray_stroke',
|
||||
'PDF_setlinejoin',
|
||||
'PDF_setlinewidth',
|
||||
'PDF_setmatrix',
|
||||
'PDF_setmiterlimit',
|
||||
'PDF_setrgbcolor',
|
||||
'PDF_setrgbcolor_fill',
|
||||
'PDF_setrgbcolor_stroke',
|
||||
'PDF_set_border_color',
|
||||
'PDF_set_border_dash',
|
||||
'PDF_set_border_style',
|
||||
'PDF_set_info',
|
||||
'PDF_set_layer_dependency',
|
||||
'PDF_set_parameter',
|
||||
'PDF_set_text_pos',
|
||||
'PDF_set_value',
|
||||
'PDF_show',
|
||||
'PDF_show_xy',
|
||||
'PDF_skew',
|
||||
'PDF_stroke',
|
||||
'pcntl_sigtimedwait',
|
||||
'pcntl_sigwaitinfo',
|
||||
'pfsockopen',
|
||||
'pg_cancel_query',
|
||||
'pg_client_encoding',
|
||||
'pg_close',
|
||||
'pg_connect',
|
||||
'pg_connection_reset',
|
||||
'pg_convert',
|
||||
'pg_copy_from',
|
||||
'pg_copy_to',
|
||||
'pg_dbname',
|
||||
'pg_delete',
|
||||
'pg_end_copy',
|
||||
'pg_execute',
|
||||
'pg_field_name',
|
||||
'pg_field_table',
|
||||
'pg_field_type',
|
||||
'pg_flush',
|
||||
'pg_free_result',
|
||||
'pg_host',
|
||||
'pg_insert',
|
||||
'pg_last_error',
|
||||
'pg_last_notice',
|
||||
'pg_last_oid',
|
||||
'pg_lo_close',
|
||||
'pg_lo_export',
|
||||
'pg_lo_import',
|
||||
'pg_lo_open',
|
||||
'pg_lo_read',
|
||||
'pg_lo_read_all',
|
||||
'pg_lo_seek',
|
||||
'pg_lo_truncate',
|
||||
'pg_lo_unlink',
|
||||
'pg_lo_write',
|
||||
'pg_meta_data',
|
||||
'pg_options',
|
||||
'pg_parameter_status',
|
||||
'pg_pconnect',
|
||||
'pg_ping',
|
||||
'pg_port',
|
||||
'pg_prepare',
|
||||
'pg_put_line',
|
||||
'pg_query',
|
||||
@@ -760,21 +738,21 @@ return [
|
||||
'pg_result_error_field',
|
||||
'pg_result_seek',
|
||||
'pg_select',
|
||||
'pg_send_execute',
|
||||
'pg_send_prepare',
|
||||
'pg_send_query',
|
||||
'pg_send_query_params',
|
||||
'pg_socket',
|
||||
'pg_trace',
|
||||
'pg_tty',
|
||||
'pg_update',
|
||||
'pg_version',
|
||||
'phpcredits',
|
||||
'phpinfo',
|
||||
'php_sapi_name',
|
||||
'png2wbmp',
|
||||
'posix_access',
|
||||
'posix_getgrgid',
|
||||
'posix_getgrnam',
|
||||
'posix_getpgid',
|
||||
'posix_getgroups',
|
||||
'posix_getlogin',
|
||||
'posix_getpwuid',
|
||||
'posix_getrlimit',
|
||||
'posix_getsid',
|
||||
'posix_initgroups',
|
||||
'posix_kill',
|
||||
'posix_mkfifo',
|
||||
@@ -785,11 +763,13 @@ return [
|
||||
'posix_setpgid',
|
||||
'posix_setrlimit',
|
||||
'posix_setuid',
|
||||
'posix_times',
|
||||
'posix_uname',
|
||||
'preg_grep',
|
||||
'preg_match',
|
||||
'preg_match_all',
|
||||
'preg_replace',
|
||||
'preg_split',
|
||||
'proc_get_status',
|
||||
'proc_nice',
|
||||
'pspell_add_to_personal',
|
||||
'pspell_add_to_session',
|
||||
@@ -805,6 +785,7 @@ return [
|
||||
'pspell_config_save_repl',
|
||||
'pspell_new',
|
||||
'pspell_new_config',
|
||||
'pspell_new_personal',
|
||||
'pspell_save_wordlist',
|
||||
'pspell_store_replacement',
|
||||
'ps_add_launchlink',
|
||||
@@ -886,14 +867,21 @@ return [
|
||||
'register_tick_function',
|
||||
'rename',
|
||||
'rewind',
|
||||
'rewinddir',
|
||||
'rmdir',
|
||||
'rpmaddtag',
|
||||
'rrd_create',
|
||||
'rsort',
|
||||
'rrd_first',
|
||||
'rrd_graph',
|
||||
'rrd_info',
|
||||
'rrd_lastupdate',
|
||||
'rrd_restore',
|
||||
'rrd_tune',
|
||||
'rrd_update',
|
||||
'rrd_xport',
|
||||
'sapi_windows_cp_conv',
|
||||
'sapi_windows_cp_set',
|
||||
'sapi_windows_generate_ctrl_event',
|
||||
'sapi_windows_set_ctrl_handler',
|
||||
'sapi_windows_vt100_support',
|
||||
'scandir',
|
||||
'sem_acquire',
|
||||
@@ -901,19 +889,27 @@ return [
|
||||
'sem_release',
|
||||
'sem_remove',
|
||||
'session_abort',
|
||||
'session_create_id',
|
||||
'session_decode',
|
||||
'session_destroy',
|
||||
'session_encode',
|
||||
'session_id',
|
||||
'session_module_name',
|
||||
'session_name',
|
||||
'session_regenerate_id',
|
||||
'session_reset',
|
||||
'session_save_path',
|
||||
'session_unset',
|
||||
'session_write_close',
|
||||
'settype',
|
||||
'set_include_path',
|
||||
'set_time_limit',
|
||||
'sha1_file',
|
||||
'shell_exec',
|
||||
'shmop_delete',
|
||||
'shmop_read',
|
||||
'shmop_write',
|
||||
'shm_attach',
|
||||
'shm_detach',
|
||||
'shm_put_var',
|
||||
'shm_remove',
|
||||
'shm_remove_var',
|
||||
@@ -925,6 +921,7 @@ return [
|
||||
'socket_accept',
|
||||
'socket_addrinfo_bind',
|
||||
'socket_addrinfo_connect',
|
||||
'socket_addrinfo_lookup',
|
||||
'socket_bind',
|
||||
'socket_connect',
|
||||
'socket_create',
|
||||
@@ -948,14 +945,23 @@ return [
|
||||
'socket_wsaprotocol_info_export',
|
||||
'socket_wsaprotocol_info_import',
|
||||
'socket_wsaprotocol_info_release',
|
||||
'sodium_crypto_pwhash',
|
||||
'sodium_crypto_pwhash_str',
|
||||
'sodium_crypto_aead_aes256gcm_decrypt',
|
||||
'sodium_crypto_aead_chacha20poly1305_decrypt',
|
||||
'sodium_crypto_aead_chacha20poly1305_encrypt',
|
||||
'sodium_crypto_aead_chacha20poly1305_ietf_decrypt',
|
||||
'sodium_crypto_aead_chacha20poly1305_ietf_encrypt',
|
||||
'sodium_crypto_aead_xchacha20poly1305_ietf_decrypt',
|
||||
'sodium_crypto_aead_xchacha20poly1305_ietf_encrypt',
|
||||
'sodium_crypto_auth_verify',
|
||||
'sodium_crypto_box_open',
|
||||
'sodium_crypto_box_seal_open',
|
||||
'sodium_crypto_generichash_update',
|
||||
'sodium_crypto_secretbox_open',
|
||||
'sodium_crypto_sign_open',
|
||||
'sodium_crypto_sign_verify_detached',
|
||||
'solr_get_version',
|
||||
'sort',
|
||||
'soundex',
|
||||
'spl_autoload_register',
|
||||
'spl_autoload_unregister',
|
||||
'sprintf',
|
||||
'sqlsrv_begin_transaction',
|
||||
'sqlsrv_cancel',
|
||||
'sqlsrv_client_info',
|
||||
@@ -981,11 +987,14 @@ return [
|
||||
'ssh2_connect',
|
||||
'ssh2_disconnect',
|
||||
'ssh2_exec',
|
||||
'ssh2_forward_accept',
|
||||
'ssh2_forward_listen',
|
||||
'ssh2_publickey_add',
|
||||
'ssh2_publickey_init',
|
||||
'ssh2_publickey_remove',
|
||||
'ssh2_scp_recv',
|
||||
'ssh2_scp_send',
|
||||
'ssh2_send_eof',
|
||||
'ssh2_sftp',
|
||||
'ssh2_sftp_chmod',
|
||||
'ssh2_sftp_mkdir',
|
||||
@@ -993,6 +1002,7 @@ return [
|
||||
'ssh2_sftp_rmdir',
|
||||
'ssh2_sftp_symlink',
|
||||
'ssh2_sftp_unlink',
|
||||
'ssh2_shell',
|
||||
'stream_context_set_params',
|
||||
'stream_copy_to_stream',
|
||||
'stream_filter_append',
|
||||
@@ -1000,22 +1010,28 @@ return [
|
||||
'stream_filter_register',
|
||||
'stream_filter_remove',
|
||||
'stream_get_contents',
|
||||
'stream_get_line',
|
||||
'stream_isatty',
|
||||
'stream_resolve_include_path',
|
||||
'stream_set_blocking',
|
||||
'stream_set_timeout',
|
||||
'stream_socket_accept',
|
||||
'stream_socket_client',
|
||||
'stream_socket_get_name',
|
||||
'stream_socket_pair',
|
||||
'stream_socket_recvfrom',
|
||||
'stream_socket_sendto',
|
||||
'stream_socket_server',
|
||||
'stream_socket_shutdown',
|
||||
'stream_supports_lock',
|
||||
'stream_wrapper_register',
|
||||
'stream_wrapper_restore',
|
||||
'stream_wrapper_unregister',
|
||||
'strftime',
|
||||
'strptime',
|
||||
'strtotime',
|
||||
'substr',
|
||||
'swoole_async_dns_lookup',
|
||||
'swoole_async_readfile',
|
||||
'swoole_async_write',
|
||||
'swoole_async_writefile',
|
||||
'swoole_event_defer',
|
||||
@@ -1030,15 +1046,14 @@ return [
|
||||
'time_sleep_until',
|
||||
'tmpfile',
|
||||
'touch',
|
||||
'uasort',
|
||||
'uksort',
|
||||
'unixtojd',
|
||||
'unlink',
|
||||
'unpack',
|
||||
'uopz_extend',
|
||||
'uopz_implement',
|
||||
'usort',
|
||||
'variant_date_to_timestamp',
|
||||
'variant_round',
|
||||
'virtual',
|
||||
'vsprintf',
|
||||
'xdiff_file_bdiff',
|
||||
'xdiff_file_bpatch',
|
||||
'xdiff_file_diff',
|
||||
@@ -1049,9 +1064,17 @@ return [
|
||||
'xdiff_string_patch',
|
||||
'xdiff_string_patch_binary',
|
||||
'xmlrpc_set_type',
|
||||
'xml_parser_create',
|
||||
'xml_parser_create_ns',
|
||||
'xml_parser_free',
|
||||
'xml_set_character_data_handler',
|
||||
'xml_set_default_handler',
|
||||
'xml_set_element_handler',
|
||||
'xml_set_end_namespace_decl_handler',
|
||||
'xml_set_external_entity_ref_handler',
|
||||
'xml_set_notation_decl_handler',
|
||||
'xml_set_object',
|
||||
'xml_set_processing_instruction_handler',
|
||||
'xml_set_start_namespace_decl_handler',
|
||||
'xml_set_unparsed_entity_decl_handler',
|
||||
'yaml_parse',
|
||||
'yaml_parse_file',
|
||||
'yaml_parse_url',
|
||||
@@ -1064,6 +1087,10 @@ return [
|
||||
'yaz_search',
|
||||
'yaz_wait',
|
||||
'zip_entry_close',
|
||||
'zip_entry_compressedsize',
|
||||
'zip_entry_compressionmethod',
|
||||
'zip_entry_filesize',
|
||||
'zip_entry_name',
|
||||
'zip_entry_open',
|
||||
'zip_entry_read',
|
||||
'zlib_decode',
|
||||
|
||||
27
vendor/thecodingmachine/safe/generated/gettext.php
vendored
Normal file
27
vendor/thecodingmachine/safe/generated/gettext.php
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\GettextException;
|
||||
|
||||
/**
|
||||
* The bindtextdomain function sets or gets the path
|
||||
* for a domain.
|
||||
*
|
||||
* @param string $domain The domain.
|
||||
* @param string $directory The directory path.
|
||||
* An empty string means the current directory.
|
||||
* If NULL, the currently set directory is returned.
|
||||
* @return string The full pathname for the domain currently being set.
|
||||
* @throws GettextException
|
||||
*
|
||||
*/
|
||||
function bindtextdomain(string $domain, string $directory): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \bindtextdomain($domain, $directory);
|
||||
if ($result === false) {
|
||||
throw GettextException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
64
vendor/thecodingmachine/safe/generated/gmp.php
vendored
64
vendor/thecodingmachine/safe/generated/gmp.php
vendored
@@ -4,68 +4,6 @@ namespace Safe;
|
||||
|
||||
use Safe\Exceptions\GmpException;
|
||||
|
||||
/**
|
||||
* Calculates the binomial coefficient C(n, k).
|
||||
*
|
||||
* @param \GMP|string|int $n Either a GMP number resource in PHP 5.5 and earlier, a GMP object in PHP 5.6 and later, or a numeric string provided that it is possible to convert the latter to a number.
|
||||
* @param int $k
|
||||
* @return \GMP Returns the binomial coefficient C(n, k).
|
||||
* @throws GmpException
|
||||
*
|
||||
*/
|
||||
function gmp_binomial($n, int $k): \GMP
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \gmp_binomial($n, $k);
|
||||
if ($result === false) {
|
||||
throw GmpException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Export a GMP number to a binary string
|
||||
*
|
||||
* @param \GMP|string|int $gmpnumber The GMP number being exported
|
||||
* @param int $word_size Default value is 1. The number of bytes in each chunk of binary data. This is mainly used in conjunction with the options parameter.
|
||||
* @param int $options Default value is GMP_MSW_FIRST | GMP_NATIVE_ENDIAN.
|
||||
* @return string Returns a string.
|
||||
* @throws GmpException
|
||||
*
|
||||
*/
|
||||
function gmp_export($gmpnumber, int $word_size = 1, int $options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \gmp_export($gmpnumber, $word_size, $options);
|
||||
if ($result === false) {
|
||||
throw GmpException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Import a GMP number from a binary string
|
||||
*
|
||||
* @param string $data The binary string being imported
|
||||
* @param int $word_size Default value is 1. The number of bytes in each chunk of binary data. This is mainly used in conjunction with the options parameter.
|
||||
* @param int $options Default value is GMP_MSW_FIRST | GMP_NATIVE_ENDIAN.
|
||||
* @return \GMP Returns a GMP number.
|
||||
* @throws GmpException
|
||||
*
|
||||
*/
|
||||
function gmp_import(string $data, int $word_size = 1, int $options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN): \GMP
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \gmp_import($data, $word_size, $options);
|
||||
if ($result === false) {
|
||||
throw GmpException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
@@ -73,7 +11,7 @@ function gmp_import(string $data, int $word_size = 1, int $options = GMP_MSW_FIR
|
||||
* gmp_random_bits, and
|
||||
* gmp_random_range functions.
|
||||
*
|
||||
* Either a GMP number resource in PHP 5.5 and earlier, a GMP object in PHP 5.6 and later, or a numeric string provided that it is possible to convert the latter to a number.
|
||||
* A GMP object, an integer or a numeric string.
|
||||
* @throws GmpException
|
||||
*
|
||||
*/
|
||||
|
||||
20
vendor/thecodingmachine/safe/generated/gnupg.php
vendored
20
vendor/thecodingmachine/safe/generated/gnupg.php
vendored
@@ -121,6 +121,26 @@ function gnupg_clearsignkeys($identifier): void
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param resource $identifier The gnupg identifier, from a call to
|
||||
* gnupg_init or gnupg.
|
||||
* @param string $key The key to delete.
|
||||
* @param bool $allow_secret It specifies whether to delete secret keys as well.
|
||||
* @throws GnupgException
|
||||
*
|
||||
*/
|
||||
function gnupg_deletekey($identifier, string $key, bool $allow_secret): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \gnupg_deletekey($identifier, $key, $allow_secret);
|
||||
if ($result === false) {
|
||||
throw GnupgException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Toggle the armored output.
|
||||
*
|
||||
|
||||
18
vendor/thecodingmachine/safe/generated/hash.php
vendored
18
vendor/thecodingmachine/safe/generated/hash.php
vendored
@@ -16,7 +16,7 @@ use Safe\Exceptions\HashException;
|
||||
*
|
||||
*
|
||||
* Non-cryptographic hash functions are not allowed.
|
||||
* @param string $ikm Input keying material (raw binary). Cannot be empty.
|
||||
* @param string $key Input keying material (raw binary). Cannot be empty.
|
||||
* @param int $length Desired output length in bytes.
|
||||
* Cannot be greater than 255 times the chosen hash function size.
|
||||
*
|
||||
@@ -31,10 +31,10 @@ use Safe\Exceptions\HashException;
|
||||
* @throws HashException
|
||||
*
|
||||
*/
|
||||
function hash_hkdf(string $algo, string $ikm, int $length = 0, string $info = '', string $salt = ''): string
|
||||
function hash_hkdf(string $algo, string $key, int $length = 0, string $info = "", string $salt = ""): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \hash_hkdf($algo, $ikm, $length, $info, $salt);
|
||||
$result = \hash_hkdf($algo, $key, $length, $info, $salt);
|
||||
if ($result === false) {
|
||||
throw HashException::createFromPhpError();
|
||||
}
|
||||
@@ -45,16 +45,20 @@ function hash_hkdf(string $algo, string $ikm, int $length = 0, string $info = ''
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param \HashContext $hcontext Hashing context returned by hash_init.
|
||||
* @param \HashContext $context Hashing context returned by hash_init.
|
||||
* @param string $filename URL describing location of file to be hashed; Supports fopen wrappers.
|
||||
* @param \HashContext|null $scontext Stream context as returned by stream_context_create.
|
||||
* @param \HashContext|null $stream_context Stream context as returned by stream_context_create.
|
||||
* @throws HashException
|
||||
*
|
||||
*/
|
||||
function hash_update_file(\HashContext $hcontext, string $filename, ?\HashContext $scontext = null): void
|
||||
function hash_update_file(\HashContext $context, string $filename, ?\HashContext $stream_context = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \hash_update_file($hcontext, $filename, $scontext);
|
||||
if ($stream_context !== null) {
|
||||
$result = \hash_update_file($context, $filename, $stream_context);
|
||||
} else {
|
||||
$result = \hash_update_file($context, $filename);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw HashException::createFromPhpError();
|
||||
}
|
||||
|
||||
42
vendor/thecodingmachine/safe/generated/ibase.php
vendored
42
vendor/thecodingmachine/safe/generated/ibase.php
vendored
@@ -122,7 +122,11 @@ function ibase_blob_cancel($blob_handle): void
|
||||
function ibase_blob_create($link_identifier = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ibase_blob_create($link_identifier);
|
||||
if ($link_identifier !== null) {
|
||||
$result = \ibase_blob_create($link_identifier);
|
||||
} else {
|
||||
$result = \ibase_blob_create();
|
||||
}
|
||||
if ($result === false) {
|
||||
throw IbaseException::createFromPhpError();
|
||||
}
|
||||
@@ -166,7 +170,11 @@ function ibase_blob_get($blob_handle, int $len): string
|
||||
function ibase_close($connection_id = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ibase_close($connection_id);
|
||||
if ($connection_id !== null) {
|
||||
$result = \ibase_close($connection_id);
|
||||
} else {
|
||||
$result = \ibase_close();
|
||||
}
|
||||
if ($result === false) {
|
||||
throw IbaseException::createFromPhpError();
|
||||
}
|
||||
@@ -189,7 +197,11 @@ function ibase_close($connection_id = null): void
|
||||
function ibase_commit_ret($link_or_trans_identifier = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ibase_commit_ret($link_or_trans_identifier);
|
||||
if ($link_or_trans_identifier !== null) {
|
||||
$result = \ibase_commit_ret($link_or_trans_identifier);
|
||||
} else {
|
||||
$result = \ibase_commit_ret();
|
||||
}
|
||||
if ($result === false) {
|
||||
throw IbaseException::createFromPhpError();
|
||||
}
|
||||
@@ -210,7 +222,11 @@ function ibase_commit_ret($link_or_trans_identifier = null): void
|
||||
function ibase_commit($link_or_trans_identifier = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ibase_commit($link_or_trans_identifier);
|
||||
if ($link_or_trans_identifier !== null) {
|
||||
$result = \ibase_commit($link_or_trans_identifier);
|
||||
} else {
|
||||
$result = \ibase_commit();
|
||||
}
|
||||
if ($result === false) {
|
||||
throw IbaseException::createFromPhpError();
|
||||
}
|
||||
@@ -309,7 +325,11 @@ function ibase_delete_user($service_handle, string $user_name): void
|
||||
function ibase_drop_db($connection = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ibase_drop_db($connection);
|
||||
if ($connection !== null) {
|
||||
$result = \ibase_drop_db($connection);
|
||||
} else {
|
||||
$result = \ibase_drop_db();
|
||||
}
|
||||
if ($result === false) {
|
||||
throw IbaseException::createFromPhpError();
|
||||
}
|
||||
@@ -566,7 +586,11 @@ function ibase_restore($service_handle, string $source_file, string $dest_db, in
|
||||
function ibase_rollback_ret($link_or_trans_identifier = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ibase_rollback_ret($link_or_trans_identifier);
|
||||
if ($link_or_trans_identifier !== null) {
|
||||
$result = \ibase_rollback_ret($link_or_trans_identifier);
|
||||
} else {
|
||||
$result = \ibase_rollback_ret();
|
||||
}
|
||||
if ($result === false) {
|
||||
throw IbaseException::createFromPhpError();
|
||||
}
|
||||
@@ -587,7 +611,11 @@ function ibase_rollback_ret($link_or_trans_identifier = null): void
|
||||
function ibase_rollback($link_or_trans_identifier = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ibase_rollback($link_or_trans_identifier);
|
||||
if ($link_or_trans_identifier !== null) {
|
||||
$result = \ibase_rollback($link_or_trans_identifier);
|
||||
} else {
|
||||
$result = \ibase_rollback();
|
||||
}
|
||||
if ($result === false) {
|
||||
throw IbaseException::createFromPhpError();
|
||||
}
|
||||
|
||||
33
vendor/thecodingmachine/safe/generated/iconv.php
vendored
33
vendor/thecodingmachine/safe/generated/iconv.php
vendored
@@ -36,7 +36,7 @@ function iconv_get_encoding(string $type = "all")
|
||||
|
||||
/**
|
||||
* Changes the value of the internal configuration variable specified by
|
||||
* type to charset.
|
||||
* type to encoding.
|
||||
*
|
||||
* @param string $type The value of type can be any one of these:
|
||||
*
|
||||
@@ -44,14 +44,14 @@ function iconv_get_encoding(string $type = "all")
|
||||
* output_encoding
|
||||
* internal_encoding
|
||||
*
|
||||
* @param string $charset The character set.
|
||||
* @param string $encoding The character set.
|
||||
* @throws IconvException
|
||||
*
|
||||
*/
|
||||
function iconv_set_encoding(string $type, string $charset): void
|
||||
function iconv_set_encoding(string $type, string $encoding): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \iconv_set_encoding($type, $charset);
|
||||
$result = \iconv_set_encoding($type, $encoding);
|
||||
if ($result === false) {
|
||||
throw IconvException::createFromPhpError();
|
||||
}
|
||||
@@ -59,18 +59,17 @@ function iconv_set_encoding(string $type, string $charset): void
|
||||
|
||||
|
||||
/**
|
||||
* Performs a character set conversion on the string
|
||||
* str from in_charset
|
||||
* to out_charset.
|
||||
* Converts string from from_encoding
|
||||
* to to_encoding.
|
||||
*
|
||||
* @param string $in_charset The input charset.
|
||||
* @param string $out_charset The output charset.
|
||||
* @param string $from_encoding The current encoding used to interpret string.
|
||||
* @param string $to_encoding The desired encoding of the result.
|
||||
*
|
||||
* If you append the string //TRANSLIT to
|
||||
* out_charset transliteration is activated. This
|
||||
* If the string //TRANSLIT is appended to
|
||||
* to_encoding, then transliteration is activated. This
|
||||
* means that when a character can't be represented in the target charset,
|
||||
* it can be approximated through one or several similarly looking
|
||||
* characters. If you append the string //IGNORE,
|
||||
* it may be approximated through one or several similarly looking
|
||||
* characters. If the string //IGNORE is appended,
|
||||
* characters that cannot be represented in the target charset are silently
|
||||
* discarded. Otherwise, E_NOTICE is generated and the function
|
||||
* will return FALSE.
|
||||
@@ -79,16 +78,16 @@ function iconv_set_encoding(string $type, string $charset): void
|
||||
* system's iconv() implementation (cf. ICONV_IMPL).
|
||||
* Some implementations are known to ignore //TRANSLIT,
|
||||
* so the conversion is likely to fail for characters which are illegal for
|
||||
* the out_charset.
|
||||
* @param string $str The string to be converted.
|
||||
* the to_encoding.
|
||||
* @param string $string The string to be converted.
|
||||
* @return string Returns the converted string.
|
||||
* @throws IconvException
|
||||
*
|
||||
*/
|
||||
function iconv(string $in_charset, string $out_charset, string $str): string
|
||||
function iconv(string $from_encoding, string $to_encoding, string $string): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \iconv($in_charset, $out_charset, $str);
|
||||
$result = \iconv($from_encoding, $to_encoding, $string);
|
||||
if ($result === false) {
|
||||
throw IconvException::createFromPhpError();
|
||||
}
|
||||
|
||||
1167
vendor/thecodingmachine/safe/generated/image.php
vendored
1167
vendor/thecodingmachine/safe/generated/image.php
vendored
File diff suppressed because it is too large
Load Diff
1104
vendor/thecodingmachine/safe/generated/imap.php
vendored
1104
vendor/thecodingmachine/safe/generated/imap.php
vendored
File diff suppressed because it is too large
Load Diff
253
vendor/thecodingmachine/safe/generated/info.php
vendored
253
vendor/thecodingmachine/safe/generated/info.php
vendored
@@ -4,6 +4,123 @@ namespace Safe;
|
||||
|
||||
use Safe\Exceptions\InfoException;
|
||||
|
||||
/**
|
||||
* Set the various assert control options or just query
|
||||
* their current settings.
|
||||
*
|
||||
* @param int $what
|
||||
* Assert Options
|
||||
*
|
||||
*
|
||||
*
|
||||
* Option
|
||||
* INI Setting
|
||||
* Default value
|
||||
* Description
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* ASSERT_ACTIVE
|
||||
* assert.active
|
||||
* 1
|
||||
* enable assert evaluation
|
||||
*
|
||||
*
|
||||
* ASSERT_WARNING
|
||||
* assert.warning
|
||||
* 1
|
||||
* issue a PHP warning for each failed assertion
|
||||
*
|
||||
*
|
||||
* ASSERT_BAIL
|
||||
* assert.bail
|
||||
* 0
|
||||
* terminate execution on failed assertions
|
||||
*
|
||||
*
|
||||
* ASSERT_QUIET_EVAL
|
||||
* assert.quiet_eval
|
||||
* 0
|
||||
*
|
||||
* disable error_reporting during assertion expression
|
||||
* evaluation
|
||||
*
|
||||
*
|
||||
*
|
||||
* ASSERT_CALLBACK
|
||||
* assert.callback
|
||||
* (NULL)
|
||||
* Callback to call on failed assertions
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param mixed $value An optional new value for the option.
|
||||
*
|
||||
* The callback function set via ASSERT_CALLBACK or assert.callback should
|
||||
* have the following signature:
|
||||
*
|
||||
* voidassert_callback
|
||||
* stringfile
|
||||
* intline
|
||||
* stringassertion
|
||||
* stringdescription
|
||||
*
|
||||
*
|
||||
*
|
||||
* file
|
||||
*
|
||||
*
|
||||
* The file where assert has been called.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* line
|
||||
*
|
||||
*
|
||||
* The line where assert has been called.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* assertion
|
||||
*
|
||||
*
|
||||
* The assertion that has been passed to assert,
|
||||
* converted to a string.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* description
|
||||
*
|
||||
*
|
||||
* The description that has been passed to assert.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return mixed Returns the original setting of any options.
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function assert_options(int $what, $value = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($value !== null) {
|
||||
$result = \assert_options($what, $value);
|
||||
} else {
|
||||
$result = \assert_options($what);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the process title visible in tools such as top and
|
||||
* ps. This function is available only in
|
||||
@@ -25,14 +142,14 @@ function cli_set_process_title(string $title): void
|
||||
|
||||
/**
|
||||
* Loads the PHP extension given by the parameter
|
||||
* library.
|
||||
* extension_filename.
|
||||
*
|
||||
* Use extension_loaded to test whether a given
|
||||
* extension is already available or not. This works on both built-in
|
||||
* extensions and dynamically loaded ones (either through php.ini or
|
||||
* dl).
|
||||
*
|
||||
* @param string $library This parameter is only the filename of the
|
||||
* @param string $extension_filename This parameter is only the filename of the
|
||||
* extension to load which also depends on your platform. For example,
|
||||
* the sockets extension (if compiled
|
||||
* as a shared module, not the default!) would be called
|
||||
@@ -77,16 +194,34 @@ function cli_set_process_title(string $title): void
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function dl(string $library): void
|
||||
function dl(string $extension_filename): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \dl($library);
|
||||
$result = \dl($extension_filename);
|
||||
if ($result === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @return string Returns the path, as a string.
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function get_include_path(): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \get_include_path();
|
||||
if ($result === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the time of the last modification of the main script of execution.
|
||||
*
|
||||
@@ -185,23 +320,40 @@ function getmyuid(): int
|
||||
/**
|
||||
* Parses options passed to the script.
|
||||
*
|
||||
* @param string $options
|
||||
* @param array $longopts
|
||||
* @param int|null $optind
|
||||
* @return array|array|array This function will return an array of option / argument pairs.
|
||||
* @param string $short_options
|
||||
* @param array $long_options
|
||||
* @param int|null $rest_index
|
||||
* @return \__benevolent This function will return an array of option / argument pairs.
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function getopt(string $options, array $longopts = null, ?int &$optind = null): array
|
||||
function getopt(string $short_options, array $long_options = [], ?int &$rest_index = null): array
|
||||
{
|
||||
error_clear_last();
|
||||
if ($optind !== null) {
|
||||
$result = \getopt($options, $longopts, $optind);
|
||||
} elseif ($longopts !== null) {
|
||||
$result = \getopt($options, $longopts);
|
||||
} else {
|
||||
$result = \getopt($options);
|
||||
$result = \getopt($short_options, $long_options, $rest_index);
|
||||
if ($result === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This is an interface to getrusage(2). It gets data returned
|
||||
* from the system call.
|
||||
*
|
||||
* @param int $mode If mode is 1, getrusage will be called with
|
||||
* RUSAGE_CHILDREN.
|
||||
* @return array Returns an associative array containing the data returned from the system
|
||||
* call. All entries are accessible by using their documented field names.
|
||||
* Returns FALSE on failure.
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function getrusage(int $mode = 0): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \getrusage($mode);
|
||||
if ($result === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
@@ -212,17 +364,17 @@ function getopt(string $options, array $longopts = null, ?int &$optind = null):
|
||||
/**
|
||||
* Returns the value of the configuration option on success.
|
||||
*
|
||||
* @param string $varname The configuration option name.
|
||||
* @param string $option The configuration option name.
|
||||
* @return string Returns the value of the configuration option as a string on success, or an
|
||||
* empty string for null values. Returns FALSE if the
|
||||
* configuration option doesn't exist.
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function ini_get(string $varname): string
|
||||
function ini_get(string $option): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ini_get($varname);
|
||||
$result = \ini_get($option);
|
||||
if ($result === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
@@ -235,18 +387,45 @@ function ini_get(string $varname): string
|
||||
* will keep this new value during the script's execution, and will be restored
|
||||
* at the script's ending.
|
||||
*
|
||||
* @param string $varname Not all the available options can be changed using
|
||||
* @param string $option Not all the available options can be changed using
|
||||
* ini_set. There is a list of all available options
|
||||
* in the appendix.
|
||||
* @param string|int|float|bool $newvalue The new value for the option.
|
||||
* @param string $value The new value for the option.
|
||||
* @return string Returns the old value on success, FALSE on failure.
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function ini_set(string $varname, $newvalue): string
|
||||
function ini_set(string $option, string $value): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ini_set($varname, $newvalue);
|
||||
$result = \ini_set($option, $value);
|
||||
if ($result === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @return string Returns the interface type, as a lowercase string.
|
||||
*
|
||||
* Although not exhaustive, the possible return values include
|
||||
* apache,
|
||||
* apache2handler,
|
||||
* cgi (until PHP 5.3),
|
||||
* cgi-fcgi, cli, cli-server,
|
||||
* embed, fpm-fcgi,
|
||||
* litespeed,
|
||||
* phpdbg.
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function php_sapi_name(): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \php_sapi_name();
|
||||
if ($result === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
@@ -259,8 +438,8 @@ function ini_set(string $varname, $newvalue): string
|
||||
* modules, etc. It generates the appropriate HTML codes to insert
|
||||
* the information in a page.
|
||||
*
|
||||
* @param int $flag To generate a custom credits page, you may want to use the
|
||||
* flag parameter.
|
||||
* @param int $flags To generate a custom credits page, you may want to use the
|
||||
* flags parameter.
|
||||
*
|
||||
*
|
||||
* Pre-defined phpcredits flags
|
||||
@@ -323,10 +502,10 @@ function ini_set(string $varname, $newvalue): string
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function phpcredits(int $flag = CREDITS_ALL): void
|
||||
function phpcredits(int $flags = CREDITS_ALL): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \phpcredits($flag);
|
||||
$result = \phpcredits($flags);
|
||||
if ($result === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
@@ -348,9 +527,9 @@ function phpcredits(int $flag = CREDITS_ALL): void
|
||||
* phpinfo is also a valuable debugging tool as it
|
||||
* contains all EGPCS (Environment, GET, POST, Cookie, Server) data.
|
||||
*
|
||||
* @param int $what The output may be customized by passing one or more of the
|
||||
* @param int $flags The output may be customized by passing one or more of the
|
||||
* following constants bitwise values summed
|
||||
* together in the optional what parameter.
|
||||
* together in the optional flags parameter.
|
||||
* One can also combine the respective constants or bitwise values
|
||||
* together with the bitwise or operator.
|
||||
*
|
||||
@@ -433,10 +612,10 @@ function phpcredits(int $flag = CREDITS_ALL): void
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function phpinfo(int $what = INFO_ALL): void
|
||||
function phpinfo(int $flags = INFO_ALL): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \phpinfo($what);
|
||||
$result = \phpinfo($flags);
|
||||
if ($result === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
@@ -444,19 +623,19 @@ function phpinfo(int $what = INFO_ALL): void
|
||||
|
||||
|
||||
/**
|
||||
* Adds setting to the server environment. The
|
||||
* Adds assignment to the server environment. The
|
||||
* environment variable will only exist for the duration of the current
|
||||
* request. At the end of the request the environment is restored to its
|
||||
* original state.
|
||||
*
|
||||
* @param string $setting The setting, like "FOO=BAR"
|
||||
* @param string $assignment The setting, like "FOO=BAR"
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function putenv(string $setting): void
|
||||
function putenv(string $assignment): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \putenv($setting);
|
||||
$result = \putenv($assignment);
|
||||
if ($result === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
@@ -467,16 +646,16 @@ function putenv(string $setting): void
|
||||
* Sets the include_path
|
||||
* configuration option for the duration of the script.
|
||||
*
|
||||
* @param string $new_include_path The new value for the include_path
|
||||
* @param string $include_path The new value for the include_path
|
||||
* @return string Returns the old include_path on
|
||||
* success.
|
||||
* @throws InfoException
|
||||
*
|
||||
*/
|
||||
function set_include_path(string $new_include_path): string
|
||||
function set_include_path(string $include_path): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \set_include_path($new_include_path);
|
||||
$result = \set_include_path($include_path);
|
||||
if ($result === false) {
|
||||
throw InfoException::createFromPhpError();
|
||||
}
|
||||
|
||||
720
vendor/thecodingmachine/safe/generated/ingres-ii.php
vendored
720
vendor/thecodingmachine/safe/generated/ingres-ii.php
vendored
@@ -1,720 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\IngresiiException;
|
||||
|
||||
/**
|
||||
* ingres_autocommit is called before opening a
|
||||
* transaction (before the first call to
|
||||
* ingres_query or just after a call to
|
||||
* ingres_rollback or
|
||||
* ingres_commit) to switch the
|
||||
* autocommit mode of the server on or off (when the script begins
|
||||
* the autocommit mode is off).
|
||||
*
|
||||
* When autocommit mode is on, every query is automatically
|
||||
* committed by the server, as if ingres_commit
|
||||
* was called after every call to ingres_query.
|
||||
* To see if autocommit is enabled use,
|
||||
* ingres_autocommit_state.
|
||||
*
|
||||
* By default Ingres will rollback any uncommitted transactions at the end of
|
||||
* a request. Use this function or ingres_commit to
|
||||
* ensure your data is committed to the database.
|
||||
*
|
||||
* @param resource $link The connection link identifier
|
||||
* @throws IngresiiException
|
||||
*
|
||||
*/
|
||||
function ingres_autocommit($link): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ingres_autocommit($link);
|
||||
if ($result === false) {
|
||||
throw IngresiiException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ingres_close closes the connection to
|
||||
* the Ingres server that is associated with the specified link.
|
||||
*
|
||||
* ingres_close is usually unnecessary, as it
|
||||
* will not close persistent connections and all non-persistent connections
|
||||
* are automatically closed at the end of the script.
|
||||
*
|
||||
* @param resource $link The connection link identifier
|
||||
* @throws IngresiiException
|
||||
*
|
||||
*/
|
||||
function ingres_close($link): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ingres_close($link);
|
||||
if ($result === false) {
|
||||
throw IngresiiException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ingres_commit commits the currently open
|
||||
* transaction, making all changes made to the database permanent.
|
||||
*
|
||||
* This closes the transaction. A new transaction can be opened by sending a
|
||||
* query with ingres_query.
|
||||
*
|
||||
* You can also have the server commit automatically after every
|
||||
* query by calling ingres_autocommit before
|
||||
* opening the transaction.
|
||||
*
|
||||
* By default Ingres will roll back any uncommitted transactions at the end of
|
||||
* a request. Use this function or ingres_autocommit to
|
||||
* ensure your that data is committed to the database.
|
||||
*
|
||||
* @param resource $link The connection link identifier
|
||||
* @throws IngresiiException
|
||||
*
|
||||
*/
|
||||
function ingres_commit($link): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ingres_commit($link);
|
||||
if ($result === false) {
|
||||
throw IngresiiException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ingres_connect opens a connection with the
|
||||
* given Ingres database.
|
||||
*
|
||||
* The connection is closed when the script ends or when
|
||||
* ingres_close is called on this link.
|
||||
*
|
||||
* @param string $database The database name. Must follow the syntax:
|
||||
*
|
||||
* [vnode::]dbname[/svr_class]
|
||||
* @param string $username The Ingres user name
|
||||
* @param string $password The password associated with username
|
||||
* @param array $options ingres_connect options
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Option name
|
||||
* Option type
|
||||
* Description
|
||||
* Example
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* date_century_boundary
|
||||
* integer
|
||||
* The threshold by which a 2-digit year is determined to be in
|
||||
* the current century or in the next century. Equivalent to II_DATE_CENTURY_BOUNDARY.
|
||||
* 50
|
||||
*
|
||||
*
|
||||
* group
|
||||
* string
|
||||
* Specifies the group ID of the user, equivalent to the "-G"
|
||||
* flag
|
||||
* payroll
|
||||
*
|
||||
*
|
||||
* role
|
||||
* string
|
||||
* The role ID of the application. If a role password is
|
||||
* required, the parameter value should be specified as "role/password"
|
||||
*
|
||||
*
|
||||
* effective_user
|
||||
* string
|
||||
* The ingres user account being impersonated, equivalent to the "-u" flag
|
||||
* another_user
|
||||
*
|
||||
*
|
||||
* dbms_password
|
||||
* string
|
||||
* The internal database password for the user connecting to Ingres
|
||||
* s3cr3t
|
||||
*
|
||||
*
|
||||
* table_structure
|
||||
* string
|
||||
*
|
||||
* The default structure for new tables.
|
||||
* Valid values for table_structure are:
|
||||
*
|
||||
* INGRES_STRUCTURE_BTREE
|
||||
* INGRES_STRUCTURE_HASH
|
||||
* INGRES_STRUCTURE_HEAP
|
||||
* INGRES_STRUCTURE_ISAM
|
||||
* INGRES_STRUCTURE_CBTREE
|
||||
* INGRES_STRUCTURE_CISAM
|
||||
* INGRES_STRUCTURE_CHASH
|
||||
* INGRES_STRUCTURE_CHEAP
|
||||
*
|
||||
*
|
||||
*
|
||||
* INGRES_STRUCTURE_BTREE
|
||||
*
|
||||
*
|
||||
* index_structure
|
||||
* string
|
||||
*
|
||||
* The default structure for new secondary indexes. Valid values
|
||||
* for index_structure are:
|
||||
*
|
||||
* INGRES_STRUCTURE_CBTREE
|
||||
* INGRES_STRUCTURE_CISAM
|
||||
* INGRES_STRUCTURE_CHASH
|
||||
* INGRES_STRUCTURE_BTREE
|
||||
* INGRES_STRUCTURE_HASH
|
||||
* INGRES_STRUCTURE_ISAM
|
||||
*
|
||||
*
|
||||
*
|
||||
* INGRES_STRUCTURE_HASH
|
||||
*
|
||||
*
|
||||
* login_local
|
||||
* boolean
|
||||
* Determines how the connection user ID and password are
|
||||
* used when a VNODE is included in the target database string.
|
||||
* If set to TRUE, the user ID and password are used to locally access
|
||||
* the VNODE, and the VNODE login information is used to establish the DBMS
|
||||
* connection. If set to FALSE, the process user ID is used to access
|
||||
* the VNODE, and the connection user ID and password are used in place
|
||||
* of the VNODE login information to establish the DBMS connection.
|
||||
* This parameter is ignored if no VNODE is included in the target
|
||||
* database string. The default is FALSE.
|
||||
* TRUE
|
||||
*
|
||||
*
|
||||
* timezone
|
||||
* string
|
||||
* Controls the timezone of the session. If not set it will
|
||||
* default to the value defined by II_TIMEZONE_NAME. If
|
||||
* II_TIMEZONE_NAME is not defined, NA-PACIFIC (GMT-8 with Daylight
|
||||
* Savings) is used.
|
||||
*
|
||||
*
|
||||
* date_format
|
||||
* integer
|
||||
* Sets the allowable input and output format for Ingres dates.
|
||||
* Defaults to the value defined by II_DATE_FORMAT. If II_DATE_FORMAT is
|
||||
* not set the default date format is US, e.g. mm/dd/yy. Valid values
|
||||
* for date_format are:
|
||||
*
|
||||
* INGRES_DATE_DMY
|
||||
* INGRES_DATE_FINISH
|
||||
* INGRES_DATE_GERMAN
|
||||
* INGRES_DATE_ISO
|
||||
* INGRES_DATE_ISO4
|
||||
* INGRES_DATE_MDY
|
||||
* INGRES_DATE_MULTINATIONAL
|
||||
* INGRES_DATE_MULTINATIONAL4
|
||||
* INGRES_DATE_YMD
|
||||
* INGRES_DATE_US
|
||||
*
|
||||
*
|
||||
*
|
||||
* INGRES_DATE_MULTINATIONAL4
|
||||
*
|
||||
*
|
||||
* decimal_separator
|
||||
* string
|
||||
* The character identifier for decimal data
|
||||
* ","
|
||||
*
|
||||
*
|
||||
* money_lort
|
||||
* integer
|
||||
* Leading or trailing currency sign. Valid values for money_lort
|
||||
* are:
|
||||
*
|
||||
* INGRES_MONEY_LEADING
|
||||
* INGRES_MONEY_TRAILING
|
||||
*
|
||||
*
|
||||
*
|
||||
* INGRES_MONEY_TRAILING
|
||||
*
|
||||
*
|
||||
* money_sign
|
||||
* string
|
||||
* The currency symbol to be used with the MONEY datatype
|
||||
* €
|
||||
*
|
||||
*
|
||||
* money_precision
|
||||
* integer
|
||||
* The precision of the MONEY datatype
|
||||
* 3
|
||||
*
|
||||
*
|
||||
* float4_precision
|
||||
* integer
|
||||
* Precision of the FLOAT4 datatype
|
||||
* 10
|
||||
*
|
||||
*
|
||||
* float8_precision
|
||||
* integer
|
||||
* Precision of the FLOAT8 data
|
||||
* 10
|
||||
*
|
||||
*
|
||||
* blob_segment_length
|
||||
* integer
|
||||
* The amount of data in bytes to fetch at a time when retrieving
|
||||
* BLOB or CLOB data, defaults to 4096 bytes when not explicitly set
|
||||
* 8192
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* The default structure for new tables.
|
||||
* Valid values for table_structure are:
|
||||
*
|
||||
* INGRES_STRUCTURE_BTREE
|
||||
* INGRES_STRUCTURE_HASH
|
||||
* INGRES_STRUCTURE_HEAP
|
||||
* INGRES_STRUCTURE_ISAM
|
||||
* INGRES_STRUCTURE_CBTREE
|
||||
* INGRES_STRUCTURE_CISAM
|
||||
* INGRES_STRUCTURE_CHASH
|
||||
* INGRES_STRUCTURE_CHEAP
|
||||
*
|
||||
*
|
||||
* The default structure for new secondary indexes. Valid values
|
||||
* for index_structure are:
|
||||
*
|
||||
* INGRES_STRUCTURE_CBTREE
|
||||
* INGRES_STRUCTURE_CISAM
|
||||
* INGRES_STRUCTURE_CHASH
|
||||
* INGRES_STRUCTURE_BTREE
|
||||
* INGRES_STRUCTURE_HASH
|
||||
* INGRES_STRUCTURE_ISAM
|
||||
*
|
||||
*
|
||||
* Sets the allowable input and output format for Ingres dates.
|
||||
* Defaults to the value defined by II_DATE_FORMAT. If II_DATE_FORMAT is
|
||||
* not set the default date format is US, e.g. mm/dd/yy. Valid values
|
||||
* for date_format are:
|
||||
*
|
||||
* INGRES_DATE_DMY
|
||||
* INGRES_DATE_FINISH
|
||||
* INGRES_DATE_GERMAN
|
||||
* INGRES_DATE_ISO
|
||||
* INGRES_DATE_ISO4
|
||||
* INGRES_DATE_MDY
|
||||
* INGRES_DATE_MULTINATIONAL
|
||||
* INGRES_DATE_MULTINATIONAL4
|
||||
* INGRES_DATE_YMD
|
||||
* INGRES_DATE_US
|
||||
*
|
||||
*
|
||||
* Leading or trailing currency sign. Valid values for money_lort
|
||||
* are:
|
||||
*
|
||||
* INGRES_MONEY_LEADING
|
||||
* INGRES_MONEY_TRAILING
|
||||
*
|
||||
* @return resource Returns a Ingres link resource on success
|
||||
* @throws IngresiiException
|
||||
*
|
||||
*/
|
||||
function ingres_connect(string $database = null, string $username = null, string $password = null, array $options = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($options !== null) {
|
||||
$result = \ingres_connect($database, $username, $password, $options);
|
||||
} elseif ($password !== null) {
|
||||
$result = \ingres_connect($database, $username, $password);
|
||||
} elseif ($username !== null) {
|
||||
$result = \ingres_connect($database, $username);
|
||||
} elseif ($database !== null) {
|
||||
$result = \ingres_connect($database);
|
||||
} else {
|
||||
$result = \ingres_connect();
|
||||
}
|
||||
if ($result === false) {
|
||||
throw IngresiiException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Execute a query prepared using ingres_prepare.
|
||||
*
|
||||
* @param resource $result The result query identifier
|
||||
* @param array $params An array of parameter values to be used with the query
|
||||
* @param string $types A string containing a sequence of types for the parameter values
|
||||
* passed. See the types parameter in
|
||||
* ingres_query for the list of type codes.
|
||||
* @throws IngresiiException
|
||||
*
|
||||
*/
|
||||
function ingres_execute($result, array $params = null, string $types = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($types !== null) {
|
||||
$result = \ingres_execute($result, $params, $types);
|
||||
} elseif ($params !== null) {
|
||||
$result = \ingres_execute($result, $params);
|
||||
} else {
|
||||
$result = \ingres_execute($result);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw IngresiiException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ingres_field_name returns the name of a field
|
||||
* in a query result.
|
||||
*
|
||||
* @param resource $result The query result identifier
|
||||
* @param int $index index is the field whose name will be
|
||||
* retrieved.
|
||||
*
|
||||
* The possible values of index depend upon
|
||||
* the value
|
||||
* of ingres.array_index_start.
|
||||
* If ingres.array_index_start
|
||||
* is 1 (the default)
|
||||
* then index must be
|
||||
* between 1 and the value returned
|
||||
* by ingres_num_fields. If ingres.array_index_start
|
||||
* is 0 then index must
|
||||
* be between 0
|
||||
* and ingres_num_fields -
|
||||
* 1.
|
||||
* @return string Returns the name of a field
|
||||
* in a query result
|
||||
* @throws IngresiiException
|
||||
*
|
||||
*/
|
||||
function ingres_field_name($result, int $index): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ingres_field_name($result, $index);
|
||||
if ($result === false) {
|
||||
throw IngresiiException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the type of a field in a query result.
|
||||
*
|
||||
* @param resource $result The query result identifier
|
||||
* @param int $index index is the field whose type will be
|
||||
* retrieved.
|
||||
*
|
||||
* The possible values of index depend upon
|
||||
* the value
|
||||
* of ingres.array_index_start.
|
||||
* If ingres.array_index_start
|
||||
* is 1 (the default)
|
||||
* then index must be
|
||||
* between 1 and the value returned
|
||||
* by ingres_num_fields. If ingres.array_index_start
|
||||
* is 0 then index must
|
||||
* be between 0
|
||||
* and ingres_num_fields -
|
||||
* 1.
|
||||
* @return string ingres_field_type returns the type of a
|
||||
* field in a query result. Examples of
|
||||
* types returned are IIAPI_BYTE_TYPE,
|
||||
* IIAPI_CHA_TYPE, IIAPI_DTE_TYPE,
|
||||
* IIAPI_FLT_TYPE, IIAPI_INT_TYPE,
|
||||
* IIAPI_VCH_TYPE. Some of these types can map to more
|
||||
* than one SQL type depending on the length of the field (see
|
||||
* ingres_field_length). For example
|
||||
* IIAPI_FLT_TYPE can be a float4 or a float8. For detailed
|
||||
* information, see the Ingres OpenAPI User Guide, Appendix
|
||||
* "Data Types" in the Ingres documentation.
|
||||
* @throws IngresiiException
|
||||
*
|
||||
*/
|
||||
function ingres_field_type($result, int $index): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ingres_field_type($result, $index);
|
||||
if ($result === false) {
|
||||
throw IngresiiException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param resource $result The query result identifier
|
||||
* @throws IngresiiException
|
||||
*
|
||||
*/
|
||||
function ingres_free_result($result): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ingres_free_result($result);
|
||||
if ($result === false) {
|
||||
throw IngresiiException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Open a persistent connection to an Ingres database.
|
||||
*
|
||||
* There are only two differences between this function and
|
||||
* ingres_connect: First, when connecting, the
|
||||
* function will initially try to find a (persistent) link that is
|
||||
* already opened with the same parameters. If one is found, an
|
||||
* identifier for it will be returned instead of opening a new
|
||||
* connection. Second, the connection to the Ingres server will not
|
||||
* be closed when the execution of the script ends. Instead, the
|
||||
* link will remain open for future use
|
||||
* (ingres_close will not close links
|
||||
* established by ingres_pconnect). This type
|
||||
* of link is therefore called "persistent".
|
||||
*
|
||||
* @param string $database The database name. Must follow the syntax:
|
||||
*
|
||||
* [vnode::]dbname[/svr_class]
|
||||
* @param string $username The Ingres user name
|
||||
* @param string $password The password associated with username
|
||||
* @param array $options See ingres_connect for the list of options that
|
||||
* can be passed
|
||||
* @return resource Returns an Ingres link resource on success
|
||||
* @throws IngresiiException
|
||||
*
|
||||
*/
|
||||
function ingres_pconnect(string $database = null, string $username = null, string $password = null, array $options = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($options !== null) {
|
||||
$result = \ingres_pconnect($database, $username, $password, $options);
|
||||
} elseif ($password !== null) {
|
||||
$result = \ingres_pconnect($database, $username, $password);
|
||||
} elseif ($username !== null) {
|
||||
$result = \ingres_pconnect($database, $username);
|
||||
} elseif ($database !== null) {
|
||||
$result = \ingres_pconnect($database);
|
||||
} else {
|
||||
$result = \ingres_pconnect();
|
||||
}
|
||||
if ($result === false) {
|
||||
throw IngresiiException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function is used to position the cursor associated with the result
|
||||
* resource before issuing a fetch. If ingres.array_index_start
|
||||
* is set to 0 then the first row is 0 else it is 1.
|
||||
* ingres_result_seek can be used only with queries that
|
||||
* make use of scrollable
|
||||
* cursors. It cannot be used with
|
||||
* ingres_unbuffered_query.
|
||||
*
|
||||
* @param resource $result The result identifier for a query
|
||||
* @param int $position The row to position the cursor on. If ingres.array_index_start
|
||||
* is set to 0, then the first row is 0, else it is 1
|
||||
* @throws IngresiiException
|
||||
*
|
||||
*/
|
||||
function ingres_result_seek($result, int $position): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ingres_result_seek($result, $position);
|
||||
if ($result === false) {
|
||||
throw IngresiiException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ingres_rollback rolls back the currently
|
||||
* open transaction, actually cancelling all changes made to the
|
||||
* database during the transaction.
|
||||
*
|
||||
* This closes the transaction. A new transaction can be opened by sending a
|
||||
* query with ingres_query.
|
||||
*
|
||||
* @param resource $link The connection link identifier
|
||||
* @throws IngresiiException
|
||||
*
|
||||
*/
|
||||
function ingres_rollback($link): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ingres_rollback($link);
|
||||
if ($result === false) {
|
||||
throw IngresiiException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ingres_set_environment is called to set environmental
|
||||
* options that affect the output of certain values from Ingres, such as the
|
||||
* timezone, date format, decimal character separator, and float precision.
|
||||
*
|
||||
* @param resource $link The connection link identifier
|
||||
* @param array $options An enumerated array of option name/value pairs. The following table
|
||||
* lists the option name and the expected type
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Option name
|
||||
* Option type
|
||||
* Description
|
||||
* Example
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* date_century_boundary
|
||||
* integer
|
||||
* The threshold by which a 2-digit year is determined to be in
|
||||
* the current century or in the next century. Equivalent to II_DATE_CENTURY_BOUNDARY
|
||||
* 50
|
||||
*
|
||||
*
|
||||
* timezone
|
||||
* string
|
||||
* Controls the timezone of the session. If not set, it will
|
||||
* default the value defined by II_TIMEZONE_NAME. If
|
||||
* II_TIMEZONE_NAME is not defined, NA-PACIFIC (GMT-8 with Daylight
|
||||
* Savings) is used.
|
||||
* UNITED-KINGDOM
|
||||
*
|
||||
*
|
||||
* date_format
|
||||
* integer
|
||||
* Sets the allowable input and output format for Ingres dates.
|
||||
* Defaults to the value defined by II_DATE_FORMAT. If II_DATE_FORMAT is
|
||||
* not set, the default date format is US, for example mm/dd/yy. Valid values
|
||||
* for date_format are:
|
||||
*
|
||||
* INGRES_DATE_DMY
|
||||
* INGRES_DATE_FINISH
|
||||
* INGRES_DATE_GERMAN
|
||||
* INGRES_DATE_ISO
|
||||
* INGRES_DATE_ISO4
|
||||
* INGRES_DATE_MDY
|
||||
* INGRES_DATE_MULTINATIONAL
|
||||
* INGRES_DATE_MULTINATIONAL4
|
||||
* INGRES_DATE_YMD
|
||||
* INGRES_DATE_US
|
||||
*
|
||||
*
|
||||
*
|
||||
* INGRES_DATE_ISO4
|
||||
*
|
||||
*
|
||||
* decimal_separator
|
||||
* string
|
||||
* The character identifier for decimal data
|
||||
* ","
|
||||
*
|
||||
*
|
||||
* money_lort
|
||||
* integer
|
||||
* Leading or trailing currency sign. Valid values for money_lort
|
||||
* are:
|
||||
*
|
||||
* INGRES_MONEY_LEADING
|
||||
* INGRES_MONEY_TRAILING
|
||||
*
|
||||
*
|
||||
*
|
||||
* INGRES_MONEY_LEADING
|
||||
*
|
||||
*
|
||||
* money_sign
|
||||
* string
|
||||
* The currency symbol to be used with the MONEY datatype
|
||||
* €
|
||||
*
|
||||
*
|
||||
* money_precision
|
||||
* integer
|
||||
* The precision of the MONEY datatype
|
||||
* 2
|
||||
*
|
||||
*
|
||||
* float4_precision
|
||||
* integer
|
||||
* Precision of the FLOAT4 datatype
|
||||
* 10
|
||||
*
|
||||
*
|
||||
* float8_precision
|
||||
* integer
|
||||
* Precision of the FLOAT8 data
|
||||
* 10
|
||||
*
|
||||
*
|
||||
* blob_segment_length
|
||||
* integer
|
||||
* The amount of data in bytes to fetch at a time when retrieving
|
||||
* BLOB or CLOB data. Defaults to 4096 bytes when not set explicitly
|
||||
* 8192
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Sets the allowable input and output format for Ingres dates.
|
||||
* Defaults to the value defined by II_DATE_FORMAT. If II_DATE_FORMAT is
|
||||
* not set, the default date format is US, for example mm/dd/yy. Valid values
|
||||
* for date_format are:
|
||||
*
|
||||
* INGRES_DATE_DMY
|
||||
* INGRES_DATE_FINISH
|
||||
* INGRES_DATE_GERMAN
|
||||
* INGRES_DATE_ISO
|
||||
* INGRES_DATE_ISO4
|
||||
* INGRES_DATE_MDY
|
||||
* INGRES_DATE_MULTINATIONAL
|
||||
* INGRES_DATE_MULTINATIONAL4
|
||||
* INGRES_DATE_YMD
|
||||
* INGRES_DATE_US
|
||||
*
|
||||
*
|
||||
* Leading or trailing currency sign. Valid values for money_lort
|
||||
* are:
|
||||
*
|
||||
* INGRES_MONEY_LEADING
|
||||
* INGRES_MONEY_TRAILING
|
||||
*
|
||||
* @throws IngresiiException
|
||||
*
|
||||
*/
|
||||
function ingres_set_environment($link, array $options): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ingres_set_environment($link, $options);
|
||||
if ($result === false) {
|
||||
throw IngresiiException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
28
vendor/thecodingmachine/safe/generated/json.php
vendored
28
vendor/thecodingmachine/safe/generated/json.php
vendored
@@ -8,7 +8,7 @@ use Safe\Exceptions\JsonException;
|
||||
* Returns a string containing the JSON representation of the supplied
|
||||
* value.
|
||||
*
|
||||
* The encoding is affected by the supplied options
|
||||
* The encoding is affected by the supplied flags
|
||||
* and additionally the encoding of float values depends on the value of
|
||||
* serialize_precision.
|
||||
*
|
||||
@@ -19,7 +19,7 @@ use Safe\Exceptions\JsonException;
|
||||
*
|
||||
* PHP implements a superset of JSON as specified in the original
|
||||
* RFC 7159.
|
||||
* @param int $options Bitmask consisting of
|
||||
* @param int $flags Bitmask consisting of
|
||||
* JSON_FORCE_OBJECT,
|
||||
* JSON_HEX_QUOT,
|
||||
* JSON_HEX_TAG,
|
||||
@@ -42,30 +42,10 @@ use Safe\Exceptions\JsonException;
|
||||
* @throws JsonException
|
||||
*
|
||||
*/
|
||||
function json_encode($value, int $options = 0, int $depth = 512): string
|
||||
function json_encode($value, int $flags = 0, int $depth = 512): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \json_encode($value, $options, $depth);
|
||||
if ($result === false) {
|
||||
throw JsonException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the error string of the last json_encode or json_decode
|
||||
* call, which did not specify JSON_THROW_ON_ERROR.
|
||||
*
|
||||
* @return string Returns the error message on success, "No error" if no
|
||||
* error has occurred.
|
||||
* @throws JsonException
|
||||
*
|
||||
*/
|
||||
function json_last_error_msg(): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \json_last_error_msg();
|
||||
$result = \json_encode($value, $flags, $depth);
|
||||
if ($result === false) {
|
||||
throw JsonException::createFromPhpError();
|
||||
}
|
||||
|
||||
851
vendor/thecodingmachine/safe/generated/ldap.php
vendored
851
vendor/thecodingmachine/safe/generated/ldap.php
vendored
File diff suppressed because it is too large
Load Diff
@@ -25,11 +25,46 @@ function libxml_get_last_error(): \LibXMLError
|
||||
|
||||
/**
|
||||
* Changes the default external entity loader.
|
||||
* This can be used to suppress the expansion of arbitrary external entities to avoid XXE attacks,
|
||||
* even when LIBXML_NOENT has been set for the respective operation,
|
||||
* and is usually preferable over calling libxml_disable_entity_loader.
|
||||
*
|
||||
* @param callable $resolver_function A callable that takes three arguments. Two strings, a public id
|
||||
* and system id, and a context (an array with four keys) as the third argument.
|
||||
* This callback should return a resource, a string from which a resource can be
|
||||
* opened, or NULL.
|
||||
* @param callable $resolver_function A callable with the following signature:
|
||||
*
|
||||
* resourcestringnullresolver
|
||||
* stringpublic_id
|
||||
* stringsystem_id
|
||||
* arraycontext
|
||||
*
|
||||
*
|
||||
*
|
||||
* public_id
|
||||
*
|
||||
*
|
||||
* The public ID.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* system_id
|
||||
*
|
||||
*
|
||||
* The system ID.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* context
|
||||
*
|
||||
*
|
||||
* An array with the four elements "directory", "intSubName",
|
||||
* "extSubURI" and "extSubSystem".
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* This callable should return a resource, a string from which a resource can be
|
||||
* opened. If NULL is returned, the entity reference resolution will fail.
|
||||
* @throws LibxmlException
|
||||
*
|
||||
*/
|
||||
|
||||
236
vendor/thecodingmachine/safe/generated/mbstring.php
vendored
236
vendor/thecodingmachine/safe/generated/mbstring.php
vendored
@@ -5,21 +5,66 @@ namespace Safe;
|
||||
use Safe\Exceptions\MbstringException;
|
||||
|
||||
/**
|
||||
* Returns a string containing the character specified by the Unicode code point value,
|
||||
* encoded in the specified encoding.
|
||||
*
|
||||
* This function complements mb_ord.
|
||||
*
|
||||
* @param int $cp
|
||||
* @param string $encoding
|
||||
* @return string Returns a specific character.
|
||||
* @param int $codepoint A Unicode codepoint value, e.g. 128024 for U+1F418 ELEPHANT
|
||||
* @param string $encoding The encoding
|
||||
* parameter is the character encoding. If it is omitted or NULL, the internal character
|
||||
* encoding value will be used.
|
||||
* @return string A string containing the requested character, if it can be represented in the specified
|
||||
* encoding.
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_chr(int $cp, string $encoding = null): string
|
||||
function mb_chr(int $codepoint, string $encoding = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($encoding !== null) {
|
||||
$result = \mb_chr($cp, $encoding);
|
||||
$result = \mb_chr($codepoint, $encoding);
|
||||
} else {
|
||||
$result = \mb_chr($cp);
|
||||
$result = \mb_chr($codepoint);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Converts string from from_encoding,
|
||||
* or the current internal encoding, to to_encoding.
|
||||
* If string is an array, all its string values will be
|
||||
* converted recursively.
|
||||
*
|
||||
* @param string|array $string The string or array to be converted.
|
||||
* @param string $to_encoding The desired encoding of the result.
|
||||
* @param mixed $from_encoding The current encoding used to interpret string.
|
||||
* Multiple encodings may be specified as an array or comma separated
|
||||
* list, in which case the correct encoding will be guessed using the
|
||||
* same algorithm as mb_detect_encoding.
|
||||
*
|
||||
* If from_encoding is NULL or not specified, the
|
||||
* mbstring.internal_encoding setting
|
||||
* will be used if set, otherwise the default_charset setting.
|
||||
*
|
||||
* See supported encodings
|
||||
* for valid values of to_encoding
|
||||
* and from_encoding.
|
||||
* @return string|array The encoded string or array on success.
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_convert_encoding($string, string $to_encoding, $from_encoding = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($from_encoding !== null) {
|
||||
$result = \mb_convert_encoding($string, $to_encoding, $from_encoding);
|
||||
} else {
|
||||
$result = \mb_convert_encoding($string, $to_encoding);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
@@ -30,12 +75,12 @@ function mb_chr(int $cp, string $encoding = null): string
|
||||
|
||||
/**
|
||||
* Sets the automatic character
|
||||
* encoding detection order to encoding_list.
|
||||
* encoding detection order to encoding.
|
||||
*
|
||||
* @param mixed $encoding_list encoding_list is an array or
|
||||
* @param mixed $encoding encoding is an array or
|
||||
* comma separated list of character encoding. See supported encodings.
|
||||
*
|
||||
* If encoding_list is omitted, it returns
|
||||
* If encoding is omitted or NULL, it returns
|
||||
* the current character encoding detection order as array.
|
||||
*
|
||||
* This setting affects mb_detect_encoding and
|
||||
@@ -57,11 +102,11 @@ function mb_chr(int $cp, string $encoding = null): string
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_detect_order($encoding_list = null)
|
||||
function mb_detect_order($encoding = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($encoding_list !== null) {
|
||||
$result = \mb_detect_order($encoding_list);
|
||||
if ($encoding !== null) {
|
||||
$result = \mb_detect_order($encoding);
|
||||
} else {
|
||||
$result = \mb_detect_order();
|
||||
}
|
||||
@@ -118,15 +163,21 @@ function mb_encoding_aliases(string $encoding): array
|
||||
* clutter the function namespace with a callback function's name
|
||||
* not used anywhere else.
|
||||
* @param string $string The string being checked.
|
||||
* @param string $option The search option. See mb_regex_set_options for explanation.
|
||||
* @return string The resultant string on success.
|
||||
* @param string $options The search option. See mb_regex_set_options for explanation.
|
||||
* @return string|null The resultant string on success.
|
||||
* If string is not valid for the current encoding, NULL
|
||||
* is returned.
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_ereg_replace_callback(string $pattern, callable $callback, string $string, string $option = "msr"): string
|
||||
function mb_ereg_replace_callback(string $pattern, callable $callback, string $string, string $options = null): ?string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \mb_ereg_replace_callback($pattern, $callback, $string, $option);
|
||||
if ($options !== null) {
|
||||
$result = \mb_ereg_replace_callback($pattern, $callback, $string, $options);
|
||||
} else {
|
||||
$result = \mb_ereg_replace_callback($pattern, $callback, $string);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
}
|
||||
@@ -142,15 +193,21 @@ function mb_ereg_replace_callback(string $pattern, callable $callback, string $s
|
||||
* Multibyte characters may be used in pattern.
|
||||
* @param string $replacement The replacement text.
|
||||
* @param string $string The string being checked.
|
||||
* @param string $option
|
||||
* @return string The resultant string on success.
|
||||
* @param string $options
|
||||
* @return string|null The resultant string on success.
|
||||
* If string is not valid for the current encoding, NULL
|
||||
* is returned.
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_ereg_replace(string $pattern, string $replacement, string $string, string $option = "msr"): string
|
||||
function mb_ereg_replace(string $pattern, string $replacement, string $string, string $options = null): ?string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \mb_ereg_replace($pattern, $replacement, $string, $option);
|
||||
if ($options !== null) {
|
||||
$result = \mb_ereg_replace($pattern, $replacement, $string, $options);
|
||||
} else {
|
||||
$result = \mb_ereg_replace($pattern, $replacement, $string);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
}
|
||||
@@ -186,15 +243,15 @@ function mb_ereg_search_getregs(): array
|
||||
*
|
||||
* @param string $string The search string.
|
||||
* @param string $pattern The search pattern.
|
||||
* @param string $option The search option. See mb_regex_set_options for explanation.
|
||||
* @param string $options The search option. See mb_regex_set_options for explanation.
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_ereg_search_init(string $string, string $pattern = null, string $option = "msr"): void
|
||||
function mb_ereg_search_init(string $string, string $pattern = null, string $options = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($option !== "msr") {
|
||||
$result = \mb_ereg_search_init($string, $pattern, $option);
|
||||
if ($options !== null) {
|
||||
$result = \mb_ereg_search_init($string, $pattern, $options);
|
||||
} elseif ($pattern !== null) {
|
||||
$result = \mb_ereg_search_init($string, $pattern);
|
||||
} else {
|
||||
@@ -210,16 +267,16 @@ function mb_ereg_search_init(string $string, string $pattern = null, string $opt
|
||||
* Returns the matched part of a multibyte regular expression.
|
||||
*
|
||||
* @param string $pattern The search pattern.
|
||||
* @param string $option The search option. See mb_regex_set_options for explanation.
|
||||
* @param string $options The search option. See mb_regex_set_options for explanation.
|
||||
* @return array
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_ereg_search_regs(string $pattern = null, string $option = "ms"): array
|
||||
function mb_ereg_search_regs(string $pattern = null, string $options = null): array
|
||||
{
|
||||
error_clear_last();
|
||||
if ($option !== "ms") {
|
||||
$result = \mb_ereg_search_regs($pattern, $option);
|
||||
if ($options !== null) {
|
||||
$result = \mb_ereg_search_regs($pattern, $options);
|
||||
} elseif ($pattern !== null) {
|
||||
$result = \mb_ereg_search_regs($pattern);
|
||||
} else {
|
||||
@@ -235,14 +292,14 @@ function mb_ereg_search_regs(string $pattern = null, string $option = "ms"): arr
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param int $position The position to set. If it is negative, it counts from the end of the string.
|
||||
* @param int $offset The position to set. If it is negative, it counts from the end of the string.
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_ereg_search_setpos(int $position): void
|
||||
function mb_ereg_search_setpos(int $offset): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \mb_ereg_search_setpos($position);
|
||||
$result = \mb_ereg_search_setpos($offset);
|
||||
if ($result === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
}
|
||||
@@ -253,17 +310,61 @@ function mb_ereg_search_setpos(int $position): void
|
||||
*
|
||||
*
|
||||
* @param string $pattern The regular expression pattern. Multibyte characters may be used. The case will be ignored.
|
||||
* @param string $replace The replacement text.
|
||||
* @param string $replacement The replacement text.
|
||||
* @param string $string The searched string.
|
||||
* @param string $option
|
||||
* @param string $options
|
||||
* @return string The resultant string.
|
||||
* If string is not valid for the current encoding, NULL
|
||||
* is returned.
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_eregi_replace(string $pattern, string $replace, string $string, string $option = "msri"): string
|
||||
function mb_eregi_replace(string $pattern, string $replacement, string $string, string $options = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \mb_eregi_replace($pattern, $replace, $string, $option);
|
||||
if ($options !== null) {
|
||||
$result = \mb_eregi_replace($pattern, $replacement, $string, $options);
|
||||
} else {
|
||||
$result = \mb_eregi_replace($pattern, $replacement, $string);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param string $type If type is not specified or is specified as "all",
|
||||
* "internal_encoding", "http_input",
|
||||
* "http_output", "http_output_conv_mimetypes",
|
||||
* "mail_charset", "mail_header_encoding",
|
||||
* "mail_body_encoding", "illegal_chars",
|
||||
* "encoding_translation", "language",
|
||||
* "detect_order", "substitute_character"
|
||||
* and "strict_detection"
|
||||
* will be returned.
|
||||
*
|
||||
* If type is specified as
|
||||
* "internal_encoding", "http_input",
|
||||
* "http_output", "http_output_conv_mimetypes",
|
||||
* "mail_charset", "mail_header_encoding",
|
||||
* "mail_body_encoding", "illegal_chars",
|
||||
* "encoding_translation", "language",
|
||||
* "detect_order", "substitute_character"
|
||||
* or "strict_detection"
|
||||
* the specified setting parameter will be returned.
|
||||
* @return mixed An array of type information if type
|
||||
* is not specified, otherwise a specific type.
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_get_info(string $type = "all")
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \mb_get_info($type);
|
||||
if ($result === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
}
|
||||
@@ -336,21 +437,25 @@ function mb_internal_encoding(string $encoding = null)
|
||||
|
||||
|
||||
/**
|
||||
* Returns the Unicode code point value of the given character.
|
||||
*
|
||||
* This function complements mb_chr.
|
||||
*
|
||||
* @param string $str
|
||||
* @param string $encoding
|
||||
* @return int Returns a code point of character.
|
||||
* @param string $string A string
|
||||
* @param string $encoding The encoding
|
||||
* parameter is the character encoding. If it is omitted or NULL, the internal character
|
||||
* encoding value will be used.
|
||||
* @return int The Unicode code point for the first character of string.
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_ord(string $str, string $encoding = null): int
|
||||
function mb_ord(string $string, string $encoding = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($encoding !== null) {
|
||||
$result = \mb_ord($str, $encoding);
|
||||
$result = \mb_ord($string, $encoding);
|
||||
} else {
|
||||
$result = \mb_ord($str);
|
||||
$result = \mb_ord($string);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
@@ -367,15 +472,15 @@ function mb_ord(string $str, string $encoding = null): int
|
||||
* encoding and set values to the result array or
|
||||
* global variables.
|
||||
*
|
||||
* @param string $encoded_string The URL encoded data.
|
||||
* @param string $string The URL encoded data.
|
||||
* @param array|null $result An array containing decoded and character encoded converted values.
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_parse_str(string $encoded_string, ?array &$result): void
|
||||
function mb_parse_str(string $string, ?array &$result): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \mb_parse_str($encoded_string, $result);
|
||||
$result = \mb_parse_str($string, $result);
|
||||
if ($result === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
}
|
||||
@@ -386,7 +491,7 @@ function mb_parse_str(string $encoded_string, ?array &$result): void
|
||||
* Set/Get character encoding for a multibyte regex.
|
||||
*
|
||||
* @param string $encoding The encoding
|
||||
* parameter is the character encoding. If it is omitted, the internal character
|
||||
* parameter is the character encoding. If it is omitted or NULL, the internal character
|
||||
* encoding value will be used.
|
||||
* @return string|bool
|
||||
* @throws MbstringException
|
||||
@@ -444,7 +549,7 @@ function mb_regex_encoding(string $encoding = null)
|
||||
* automatically (which leads to doubling CR if CRLF is used).
|
||||
* This should be a last resort, as it does not comply with
|
||||
* RFC 2822.
|
||||
* @param string $additional_parameter additional_parameter is a MTA command line
|
||||
* @param string $additional_params additional_params is a MTA command line
|
||||
* parameter. It is useful when setting the correct Return-Path
|
||||
* header when using sendmail.
|
||||
*
|
||||
@@ -464,10 +569,14 @@ function mb_regex_encoding(string $encoding = null)
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_send_mail(string $to, string $subject, string $message, $additional_headers = null, string $additional_parameter = null): void
|
||||
function mb_send_mail(string $to, string $subject, string $message, $additional_headers = [], string $additional_params = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \mb_send_mail($to, $subject, $message, $additional_headers, $additional_parameter);
|
||||
if ($additional_params !== null) {
|
||||
$result = \mb_send_mail($to, $subject, $message, $additional_headers, $additional_params);
|
||||
} else {
|
||||
$result = \mb_send_mail($to, $subject, $message, $additional_headers);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
}
|
||||
@@ -493,34 +602,3 @@ function mb_split(string $pattern, string $string, int $limit = -1): array
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function will return an array of strings, it is a version of str_split with support for encodings of variable character size as well as fixed-size encodings of 1,2 or 4 byte characters.
|
||||
* If the split_length parameter is specified, the string is broken down into chunks of the specified length in characters (not bytes).
|
||||
* The encoding parameter can be optionally specified and it is good practice to do so.
|
||||
*
|
||||
* @param string $string The string to split into characters or chunks.
|
||||
* @param int $split_length If specified, each element of the returned array will be composed of multiple characters instead of a single character.
|
||||
* @param string $encoding The encoding
|
||||
* parameter is the character encoding. If it is omitted, the internal character
|
||||
* encoding value will be used.
|
||||
*
|
||||
* A string specifying one of the supported encodings.
|
||||
* @return array mb_str_split returns an array of strings.
|
||||
* @throws MbstringException
|
||||
*
|
||||
*/
|
||||
function mb_str_split(string $string, int $split_length = 1, string $encoding = null): array
|
||||
{
|
||||
error_clear_last();
|
||||
if ($encoding !== null) {
|
||||
$result = \mb_str_split($string, $split_length, $encoding);
|
||||
} else {
|
||||
$result = \mb_str_split($string, $split_length);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw MbstringException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
126
vendor/thecodingmachine/safe/generated/misc.php
vendored
126
vendor/thecodingmachine/safe/generated/misc.php
vendored
@@ -7,14 +7,14 @@ use Safe\Exceptions\MiscException;
|
||||
/**
|
||||
* Defines a named constant at runtime.
|
||||
*
|
||||
* @param string $name The name of the constant.
|
||||
* @param string $constant_name The name of the constant.
|
||||
*
|
||||
* It is possible to define constants with reserved or
|
||||
* even invalid names, whose value can (only) be retrieved with
|
||||
* constant. However, doing so is not recommended.
|
||||
* @param mixed $value The value of the constant. In PHP 5, value must
|
||||
* be a scalar value (integer,
|
||||
* float, string, boolean, or
|
||||
* be a scalar value (int,
|
||||
* float, string, bool, or
|
||||
* NULL). In PHP 7, array values are also accepted.
|
||||
*
|
||||
* While it is possible to define resource constants, it is
|
||||
@@ -28,10 +28,10 @@ use Safe\Exceptions\MiscException;
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function define(string $name, $value, bool $case_insensitive = false): void
|
||||
function define(string $constant_name, $value, bool $case_insensitive = false): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \define($name, $value, $case_insensitive);
|
||||
$result = \define($constant_name, $value, $case_insensitive);
|
||||
if ($result === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
@@ -72,7 +72,7 @@ function highlight_file(string $filename, bool $return = false)
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param string $str The PHP code to be highlighted. This should include the opening tag.
|
||||
* @param string $string The PHP code to be highlighted. This should include the opening tag.
|
||||
* @param bool $return Set this parameter to TRUE to make this function return the
|
||||
* highlighted code.
|
||||
* @return string|bool If return is set to TRUE, returns the highlighted
|
||||
@@ -81,10 +81,34 @@ function highlight_file(string $filename, bool $return = false)
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function highlight_string(string $str, bool $return = false)
|
||||
function highlight_string(string $string, bool $return = false)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \highlight_string($str, $return);
|
||||
$result = \highlight_string($string, $return);
|
||||
if ($result === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param bool $as_number Whether the high resolution time should be returned as array
|
||||
* or number.
|
||||
* @return array{0:int,1:int}|int|float Returns an array of integers in the form [seconds, nanoseconds], if the
|
||||
* parameter as_number is false. Otherwise the nanoseconds
|
||||
* are returned as int (64bit platforms) or float
|
||||
* (32bit platforms).
|
||||
* Returns FALSE on failure.
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function hrtime(bool $as_number = false)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \hrtime($as_number);
|
||||
if ($result === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
@@ -232,7 +256,7 @@ function highlight_string(string $str, bool $return = false)
|
||||
*
|
||||
*
|
||||
* Z
|
||||
* NUL-padded string (new in PHP 5.5)
|
||||
* NUL-padded string
|
||||
*
|
||||
*
|
||||
* @
|
||||
@@ -241,16 +265,16 @@ function highlight_string(string $str, bool $return = false)
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param mixed $params
|
||||
* @param mixed $values
|
||||
* @return string Returns a binary string containing data.
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function pack(string $format, ...$params): string
|
||||
function pack(string $format, ...$values): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($params !== []) {
|
||||
$result = \pack($format, ...$params);
|
||||
if ($values !== []) {
|
||||
$result = \pack($format, ...$values);
|
||||
} else {
|
||||
$result = \pack($format);
|
||||
}
|
||||
@@ -288,14 +312,14 @@ function sapi_windows_cp_conv($in_codepage, $out_codepage, string $subject): str
|
||||
/**
|
||||
* Set the codepage of the current process.
|
||||
*
|
||||
* @param int $cp A codepage identifier.
|
||||
* @param int $codepage A codepage identifier.
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function sapi_windows_cp_set(int $cp): void
|
||||
function sapi_windows_cp_set(int $codepage): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \sapi_windows_cp_set($cp);
|
||||
$result = \sapi_windows_cp_set($codepage);
|
||||
if ($result === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
@@ -324,9 +348,50 @@ function sapi_windows_generate_ctrl_event(int $event, int $pid = 0): void
|
||||
|
||||
|
||||
/**
|
||||
* If enable is omitted, the function returns TRUE if the stream stream has VT100 control codes enabled, FALSE otherwise.
|
||||
* Sets or removes a CTRL event handler, which allows Windows
|
||||
* CLI processes to intercept or ignore CTRL+C and
|
||||
* CTRL+BREAK events. Note that in multithreaded environments,
|
||||
* this is only possible when called from the main thread.
|
||||
*
|
||||
* If enable is specified, the function will try to enable or disable the VT100 features of the stream stream.
|
||||
* @param $handler A callback function to set or remove. If set, this function will be called
|
||||
* whenever a CTRL+C or CTRL+BREAK event
|
||||
* occurs. The function is supposed to have the following signature:
|
||||
*
|
||||
* voidhandler
|
||||
* intevent
|
||||
*
|
||||
*
|
||||
*
|
||||
* event
|
||||
*
|
||||
*
|
||||
* The CTRL event which has been received;
|
||||
* either PHP_WINDOWS_EVENT_CTRL_C
|
||||
* or PHP_WINDOWS_EVENT_CTRL_BREAK.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Setting a NULL handler causes the process to ignore
|
||||
* CTRL+C events, but not CTRL+BREAK events.
|
||||
* @param bool $add
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function sapi_windows_set_ctrl_handler($handler, bool $add = true): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \sapi_windows_set_ctrl_handler($handler, $add);
|
||||
if ($result === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* If enable is NULL, the function returns TRUE if the stream stream has VT100 control codes enabled, FALSE otherwise.
|
||||
*
|
||||
* If enable is a bool, the function will try to enable or disable the VT100 features of the stream stream.
|
||||
* If the feature has been successfully enabled (or disabled).
|
||||
*
|
||||
* At startup, PHP tries to enable the VT100 feature of the STDOUT/STDERR streams. By the way, if those streams are redirected to a file, the VT100 features may not be enabled.
|
||||
@@ -335,7 +400,7 @@ function sapi_windows_generate_ctrl_event(int $event, int $pid = 0): void
|
||||
* They allow the modification of the terminal's output. On Windows these sequences are called Console Virtual Terminal Sequences.
|
||||
*
|
||||
* @param resource $stream The stream on which the function will operate.
|
||||
* @param bool $enable If specified, the VT100 feature will be enabled (if TRUE) or disabled (if FALSE).
|
||||
* @param bool $enable If bool, the VT100 feature will be enabled (if TRUE) or disabled (if FALSE).
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
@@ -385,7 +450,7 @@ function sleep(int $seconds): int
|
||||
*
|
||||
* @param int $seconds Must be a non-negative integer.
|
||||
* @param int $nanoseconds Must be a non-negative integer less than 1 billion.
|
||||
* @return array{0:int,1:int}|bool Returns TRUE on success.
|
||||
* @return array{0:0|positive-int,1:0|positive-int}|bool Returns TRUE on success.
|
||||
*
|
||||
* If the delay was interrupted by a signal, an associative array will be
|
||||
* returned with the components:
|
||||
@@ -445,18 +510,33 @@ function time_sleep_until(float $timestamp): void
|
||||
* then each of the array keys will have a sequence number behind
|
||||
* the given name.
|
||||
*
|
||||
* Changes were made to bring this function into line with Perl:
|
||||
*
|
||||
*
|
||||
* The "a" code now retains trailing NULL bytes.
|
||||
*
|
||||
*
|
||||
* The "A" code now strips all trailing ASCII whitespace (spaces, tabs,
|
||||
* newlines, carriage returns, and NULL bytes).
|
||||
*
|
||||
*
|
||||
* The "Z" code was added for NULL-padded strings, and removes trailing
|
||||
* NULL bytes.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param string $format See pack for an explanation of the format codes.
|
||||
* @param string $data The packed data.
|
||||
* @param string $string The packed data.
|
||||
* @param int $offset The offset to begin unpacking from.
|
||||
* @return array Returns an associative array containing unpacked elements of binary
|
||||
* string.
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function unpack(string $format, string $data, int $offset = 0): array
|
||||
function unpack(string $format, string $string, int $offset = 0): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \unpack($format, $data, $offset);
|
||||
$result = \unpack($format, $string, $offset);
|
||||
if ($result === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
|
||||
443
vendor/thecodingmachine/safe/generated/msql.php
vendored
443
vendor/thecodingmachine/safe/generated/msql.php
vendored
@@ -1,443 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\MsqlException;
|
||||
|
||||
/**
|
||||
* Returns number of affected rows by the last SELECT, UPDATE or DELETE
|
||||
* query associated with result.
|
||||
*
|
||||
* @param resource $result The result resource that
|
||||
* is being evaluated. This result comes from a call to
|
||||
* msql_query.
|
||||
* @return int Returns the number of affected rows on success.
|
||||
* @throws MsqlException
|
||||
*
|
||||
*/
|
||||
function msql_affected_rows($result): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \msql_affected_rows($result);
|
||||
if ($result === false) {
|
||||
throw MsqlException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* msql_close closes the non-persistent connection to
|
||||
* the mSQL server that's associated with the specified link identifier.
|
||||
*
|
||||
* Using msql_close isn't usually necessary, as
|
||||
* non-persistent open links are automatically closed at the end of the
|
||||
* script's execution. See also freeing resources.
|
||||
*
|
||||
* @param resource|null $link_identifier The mSQL connection.
|
||||
* If not specified, the last link opened by msql_connect
|
||||
* is assumed. If no such link is found, the function will try to establish a
|
||||
* link as if msql_connect was called, and use it.
|
||||
* @throws MsqlException
|
||||
*
|
||||
*/
|
||||
function msql_close($link_identifier = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($link_identifier !== null) {
|
||||
$result = \msql_close($link_identifier);
|
||||
} else {
|
||||
$result = \msql_close();
|
||||
}
|
||||
if ($result === false) {
|
||||
throw MsqlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* msql_connect establishes a connection to a mSQL
|
||||
* server.
|
||||
*
|
||||
* If a second call is made to msql_connect with
|
||||
* the same arguments, no new link will be established, but instead, the
|
||||
* link identifier of the already opened link will be returned.
|
||||
*
|
||||
* The link to the server will be closed as soon as the execution of the
|
||||
* script ends, unless it's closed earlier by explicitly calling
|
||||
* msql_close.
|
||||
*
|
||||
* @param string $hostname The hostname can also include a port number. e.g.
|
||||
* hostname,port.
|
||||
*
|
||||
* If not specified, the connection is established by the means of a Unix
|
||||
* domain socket, being then more efficient then a localhost TCP socket
|
||||
* connection.
|
||||
*
|
||||
* While this function will accept a colon (:) as a
|
||||
* host/port separator, a comma (,) is the preferred
|
||||
* method.
|
||||
* @return resource Returns a positive mSQL link identifier on success.
|
||||
* @throws MsqlException
|
||||
*
|
||||
*/
|
||||
function msql_connect(string $hostname = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($hostname !== null) {
|
||||
$result = \msql_connect($hostname);
|
||||
} else {
|
||||
$result = \msql_connect();
|
||||
}
|
||||
if ($result === false) {
|
||||
throw MsqlException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* msql_create_db attempts to create a new database on
|
||||
* the mSQL server.
|
||||
*
|
||||
* @param string $database_name The name of the mSQL database.
|
||||
* @param resource|null $link_identifier The mSQL connection.
|
||||
* If not specified, the last link opened by msql_connect
|
||||
* is assumed. If no such link is found, the function will try to establish a
|
||||
* link as if msql_connect was called, and use it.
|
||||
* @throws MsqlException
|
||||
*
|
||||
*/
|
||||
function msql_create_db(string $database_name, $link_identifier = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($link_identifier !== null) {
|
||||
$result = \msql_create_db($database_name, $link_identifier);
|
||||
} else {
|
||||
$result = \msql_create_db($database_name);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw MsqlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* msql_data_seek moves the internal row
|
||||
* pointer of the mSQL result associated with the specified query
|
||||
* identifier to point to the specified row number. The next call
|
||||
* to msql_fetch_row would return that
|
||||
* row.
|
||||
*
|
||||
* @param resource $result The result resource that
|
||||
* is being evaluated. This result comes from a call to
|
||||
* msql_query.
|
||||
* @param int $row_number The seeked row number.
|
||||
* @throws MsqlException
|
||||
*
|
||||
*/
|
||||
function msql_data_seek($result, int $row_number): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \msql_data_seek($result, $row_number);
|
||||
if ($result === false) {
|
||||
throw MsqlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* msql_db_query selects a database and executes a query
|
||||
* on it.
|
||||
*
|
||||
* @param string $database The name of the mSQL database.
|
||||
* @param string $query The SQL query.
|
||||
* @param resource|null $link_identifier The mSQL connection.
|
||||
* If not specified, the last link opened by msql_connect
|
||||
* is assumed. If no such link is found, the function will try to establish a
|
||||
* link as if msql_connect was called, and use it.
|
||||
* @return resource Returns a positive mSQL query identifier to the query result.
|
||||
* @throws MsqlException
|
||||
*
|
||||
*/
|
||||
function msql_db_query(string $database, string $query, $link_identifier = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($link_identifier !== null) {
|
||||
$result = \msql_db_query($database, $query, $link_identifier);
|
||||
} else {
|
||||
$result = \msql_db_query($database, $query);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw MsqlException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* msql_drop_db attempts to drop (remove) a database
|
||||
* from the mSQL server.
|
||||
*
|
||||
* @param string $database_name The name of the database.
|
||||
* @param resource|null $link_identifier The mSQL connection.
|
||||
* If not specified, the last link opened by msql_connect
|
||||
* is assumed. If no such link is found, the function will try to establish a
|
||||
* link as if msql_connect was called, and use it.
|
||||
* @throws MsqlException
|
||||
*
|
||||
*/
|
||||
function msql_drop_db(string $database_name, $link_identifier = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($link_identifier !== null) {
|
||||
$result = \msql_drop_db($database_name, $link_identifier);
|
||||
} else {
|
||||
$result = \msql_drop_db($database_name);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw MsqlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* msql_field_len returns the length of the specified
|
||||
* field.
|
||||
*
|
||||
* @param resource $result The result resource that
|
||||
* is being evaluated. This result comes from a call to
|
||||
* msql_query.
|
||||
* @param int $field_offset The numerical field offset. The
|
||||
* field_offset starts at 1.
|
||||
* @return int Returns the length of the specified field.
|
||||
* @throws MsqlException
|
||||
*
|
||||
*/
|
||||
function msql_field_len($result, int $field_offset): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \msql_field_len($result, $field_offset);
|
||||
if ($result === false) {
|
||||
throw MsqlException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* msql_field_name gets the name of the specified field
|
||||
* index.
|
||||
*
|
||||
* @param resource $result The result resource that
|
||||
* is being evaluated. This result comes from a call to
|
||||
* msql_query.
|
||||
* @param int $field_offset The numerical field offset. The
|
||||
* field_offset starts at 1.
|
||||
* @return string The name of the field.
|
||||
* @throws MsqlException
|
||||
*
|
||||
*/
|
||||
function msql_field_name($result, int $field_offset): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \msql_field_name($result, $field_offset);
|
||||
if ($result === false) {
|
||||
throw MsqlException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Seeks to the specified field offset. If the next call to
|
||||
* msql_fetch_field won't include a field offset, this
|
||||
* field would be returned.
|
||||
*
|
||||
* @param resource $result The result resource that
|
||||
* is being evaluated. This result comes from a call to
|
||||
* msql_query.
|
||||
* @param int $field_offset The numerical field offset. The
|
||||
* field_offset starts at 1.
|
||||
* @throws MsqlException
|
||||
*
|
||||
*/
|
||||
function msql_field_seek($result, int $field_offset): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \msql_field_seek($result, $field_offset);
|
||||
if ($result === false) {
|
||||
throw MsqlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the name of the table that the specified field is in.
|
||||
*
|
||||
* @param resource $result The result resource that
|
||||
* is being evaluated. This result comes from a call to
|
||||
* msql_query.
|
||||
* @param int $field_offset The numerical field offset. The
|
||||
* field_offset starts at 1.
|
||||
* @return int The name of the table on success.
|
||||
* @throws MsqlException
|
||||
*
|
||||
*/
|
||||
function msql_field_table($result, int $field_offset): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \msql_field_table($result, $field_offset);
|
||||
if ($result === false) {
|
||||
throw MsqlException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* msql_field_type gets the type of the specified field
|
||||
* index.
|
||||
*
|
||||
* @param resource $result The result resource that
|
||||
* is being evaluated. This result comes from a call to
|
||||
* msql_query.
|
||||
* @param int $field_offset The numerical field offset. The
|
||||
* field_offset starts at 1.
|
||||
* @return string The type of the field. One of int,
|
||||
* char, real, ident,
|
||||
* null or unknown. This functions will
|
||||
* return FALSE on failure.
|
||||
* @throws MsqlException
|
||||
*
|
||||
*/
|
||||
function msql_field_type($result, int $field_offset): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \msql_field_type($result, $field_offset);
|
||||
if ($result === false) {
|
||||
throw MsqlException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* msql_free_result frees the memory associated
|
||||
* with query_identifier. When PHP completes a
|
||||
* request, this memory is freed automatically, so you only need to
|
||||
* call this function when you want to make sure you don't use too
|
||||
* much memory while the script is running.
|
||||
*
|
||||
* @param resource $result The result resource that
|
||||
* is being evaluated. This result comes from a call to
|
||||
* msql_query.
|
||||
* @throws MsqlException
|
||||
*
|
||||
*/
|
||||
function msql_free_result($result): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \msql_free_result($result);
|
||||
if ($result === false) {
|
||||
throw MsqlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* msql_pconnect acts very much like
|
||||
* msql_connect with two major differences.
|
||||
*
|
||||
* First, when connecting, the function would first try to find a
|
||||
* (persistent) link that's already open with the same host.
|
||||
* If one is found, an identifier for it will be returned instead of opening
|
||||
* a new connection.
|
||||
*
|
||||
* Second, the connection to the SQL server will not be closed when the
|
||||
* execution of the script ends. Instead, the link will remain open for
|
||||
* future use (msql_close will not close links
|
||||
* established by this function).
|
||||
*
|
||||
* @param string $hostname The hostname can also include a port number. e.g.
|
||||
* hostname,port.
|
||||
*
|
||||
* If not specified, the connection is established by the means of a Unix
|
||||
* domain socket, being more efficient than a localhost TCP socket
|
||||
* connection.
|
||||
* @return resource Returns a positive mSQL link identifier on success.
|
||||
* @throws MsqlException
|
||||
*
|
||||
*/
|
||||
function msql_pconnect(string $hostname = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($hostname !== null) {
|
||||
$result = \msql_pconnect($hostname);
|
||||
} else {
|
||||
$result = \msql_pconnect();
|
||||
}
|
||||
if ($result === false) {
|
||||
throw MsqlException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* msql_query sends a query to the currently active
|
||||
* database on the server that's associated with the specified link
|
||||
* identifier.
|
||||
*
|
||||
* @param string $query The SQL query.
|
||||
* @param resource|null $link_identifier The mSQL connection.
|
||||
* If not specified, the last link opened by msql_connect
|
||||
* is assumed. If no such link is found, the function will try to establish a
|
||||
* link as if msql_connect was called, and use it.
|
||||
* @return resource Returns a positive mSQL query identifier on success.
|
||||
* @throws MsqlException
|
||||
*
|
||||
*/
|
||||
function msql_query(string $query, $link_identifier = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($link_identifier !== null) {
|
||||
$result = \msql_query($query, $link_identifier);
|
||||
} else {
|
||||
$result = \msql_query($query);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw MsqlException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* msql_select_db sets the current active database on
|
||||
* the server that's associated with the specified
|
||||
* link_identifier.
|
||||
*
|
||||
* Subsequent calls to msql_query will be made on the
|
||||
* active database.
|
||||
*
|
||||
* @param string $database_name The database name.
|
||||
* @param resource|null $link_identifier The mSQL connection.
|
||||
* If not specified, the last link opened by msql_connect
|
||||
* is assumed. If no such link is found, the function will try to establish a
|
||||
* link as if msql_connect was called, and use it.
|
||||
* @throws MsqlException
|
||||
*
|
||||
*/
|
||||
function msql_select_db(string $database_name, $link_identifier = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($link_identifier !== null) {
|
||||
$result = \msql_select_db($database_name, $link_identifier);
|
||||
} else {
|
||||
$result = \msql_select_db($database_name);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw MsqlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
119
vendor/thecodingmachine/safe/generated/mysqlndMs.php
vendored
119
vendor/thecodingmachine/safe/generated/mysqlndMs.php
vendored
@@ -1,119 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\MysqlndMsException;
|
||||
|
||||
/**
|
||||
* Returns a list of currently configured servers.
|
||||
*
|
||||
* @param mixed $connection A MySQL connection handle obtained from any of the
|
||||
* connect functions of the mysqli,
|
||||
* mysql or
|
||||
* PDO_MYSQL extensions.
|
||||
* @return array FALSE on error. Otherwise, returns an array with two entries
|
||||
* masters and slaves each of which contains
|
||||
* an array listing all corresponding servers.
|
||||
*
|
||||
* The function can be used to check and debug the list of servers currently
|
||||
* used by the plugin. It is mostly useful when the list of servers changes at
|
||||
* runtime, for example, when using MySQL Fabric.
|
||||
*
|
||||
* masters and slaves server entries
|
||||
* @throws MysqlndMsException
|
||||
*
|
||||
*/
|
||||
function mysqlnd_ms_dump_servers($connection): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \mysqlnd_ms_dump_servers($connection);
|
||||
if ($result === false) {
|
||||
throw MysqlndMsException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* MySQL Fabric related.
|
||||
*
|
||||
* Switch the connection to the nodes handling global sharding queries
|
||||
* for the given table name.
|
||||
*
|
||||
* @param mixed $connection A MySQL connection handle obtained from any of the
|
||||
* connect functions of the mysqli,
|
||||
* mysql or
|
||||
* PDO_MYSQL extensions.
|
||||
* @param mixed $table_name The table name to ask Fabric about.
|
||||
* @return array FALSE on error. Otherwise, TRUE
|
||||
* @throws MysqlndMsException
|
||||
*
|
||||
*/
|
||||
function mysqlnd_ms_fabric_select_global($connection, $table_name): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \mysqlnd_ms_fabric_select_global($connection, $table_name);
|
||||
if ($result === false) {
|
||||
throw MysqlndMsException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* MySQL Fabric related.
|
||||
*
|
||||
* Switch the connection to the shards responsible for the
|
||||
* given table name and shard key.
|
||||
*
|
||||
* @param mixed $connection A MySQL connection handle obtained from any of the
|
||||
* connect functions of the mysqli,
|
||||
* mysql or
|
||||
* PDO_MYSQL extensions.
|
||||
* @param mixed $table_name The table name to ask Fabric about.
|
||||
* @param mixed $shard_key The shard key to ask Fabric about.
|
||||
* @return array FALSE on error. Otherwise, TRUE
|
||||
* @throws MysqlndMsException
|
||||
*
|
||||
*/
|
||||
function mysqlnd_ms_fabric_select_shard($connection, $table_name, $shard_key): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \mysqlnd_ms_fabric_select_shard($connection, $table_name, $shard_key);
|
||||
if ($result === false) {
|
||||
throw MysqlndMsException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns an array which describes the last used connection from the plugins
|
||||
* connection pool currently pointed to by the user connection handle. If using the
|
||||
* plugin, a user connection handle represents a pool of database connections.
|
||||
* It is not possible to tell from the user connection handles properties to which
|
||||
* database server from the pool the user connection handle points.
|
||||
*
|
||||
* The function can be used to debug or monitor PECL mysqlnd_ms.
|
||||
*
|
||||
* @param mixed $connection A MySQL connection handle obtained from any of the
|
||||
* connect functions of the mysqli,
|
||||
* mysql or
|
||||
* PDO_MYSQL extensions.
|
||||
* @return array FALSE on error. Otherwise, an
|
||||
* array which describes the connection used to
|
||||
* execute the last statement on.
|
||||
*
|
||||
* Array which describes the connection.
|
||||
* @throws MysqlndMsException
|
||||
*
|
||||
*/
|
||||
function mysqlnd_ms_get_last_used_connection($connection): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \mysqlnd_ms_get_last_used_connection($connection);
|
||||
if ($result === false) {
|
||||
throw MysqlndMsException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
103
vendor/thecodingmachine/safe/generated/mysqlndQc.php
vendored
103
vendor/thecodingmachine/safe/generated/mysqlndQc.php
vendored
@@ -1,103 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\MysqlndQcException;
|
||||
|
||||
/**
|
||||
* Flush all cache contents.
|
||||
*
|
||||
* Flushing the cache is a storage handler responsibility.
|
||||
* All built-in storage handler but the
|
||||
* memcache storage
|
||||
* handler support flushing the cache. The
|
||||
* memcache
|
||||
* storage handler cannot flush its cache contents.
|
||||
*
|
||||
* User-defined storage handler may or may not support the operation.
|
||||
*
|
||||
* @throws MysqlndQcException
|
||||
*
|
||||
*/
|
||||
function mysqlnd_qc_clear_cache(): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \mysqlnd_qc_clear_cache();
|
||||
if ($result === false) {
|
||||
throw MysqlndQcException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Installs a callback which decides whether a statement is cached.
|
||||
*
|
||||
* There are several ways of hinting PELC/mysqlnd_qc to cache a query.
|
||||
* By default, PECL/mysqlnd_qc attempts to cache a if caching of all statements
|
||||
* is enabled or the query string begins with a certain SQL hint.
|
||||
* The plugin internally calls a function named is_select()
|
||||
* to find out. This internal function can be replaced with a user-defined callback.
|
||||
* Then, the user-defined callback is responsible to decide whether the plugin
|
||||
* attempts to cache a statement. Because the internal function is replaced
|
||||
* with the callback, the callback gains full control. The callback is free
|
||||
* to ignore the configuration setting mysqlnd_qc.cache_by_default
|
||||
* and SQL hints.
|
||||
*
|
||||
* The callback is invoked for every statement inspected by the plugin.
|
||||
* It is given the statements string as a parameter. The callback returns
|
||||
* FALSE if the statement shall not be cached. It returns TRUE to
|
||||
* make the plugin attempt to cache the statements result set, if any.
|
||||
* A so-created cache entry is given the default TTL set with the
|
||||
* PHP configuration directive mysqlnd_qc.ttl.
|
||||
* If a different TTL shall be used, the callback returns a numeric
|
||||
* value to be used as the TTL.
|
||||
*
|
||||
* The internal is_select function is part of the internal
|
||||
* cache storage handler interface. Thus, a user-defined storage handler
|
||||
* offers the same capabilities.
|
||||
*
|
||||
* @param string $callback
|
||||
* @return mixed Returns TRUE on success.
|
||||
* @throws MysqlndQcException
|
||||
*
|
||||
*/
|
||||
function mysqlnd_qc_set_is_select(string $callback)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \mysqlnd_qc_set_is_select($callback);
|
||||
if ($result === false) {
|
||||
throw MysqlndQcException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the storage handler used by the query cache. A list of available
|
||||
* storage handler can be obtained from
|
||||
* mysqlnd_qc_get_available_handlers.
|
||||
* Which storage are available depends on the compile time
|
||||
* configuration of the query cache plugin. The
|
||||
* default storage handler is always available.
|
||||
* All other storage handler must be enabled explicitly when building the
|
||||
* extension.
|
||||
*
|
||||
* @param string $handler Handler can be of type string representing the name of a
|
||||
* built-in storage handler or an object of type
|
||||
* mysqlnd_qc_handler_default.
|
||||
* The names of the built-in storage handler are
|
||||
* default,
|
||||
* APC,
|
||||
* MEMCACHE,
|
||||
* sqlite.
|
||||
* @throws MysqlndQcException
|
||||
*
|
||||
*/
|
||||
function mysqlnd_qc_set_storage_handler(string $handler): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \mysqlnd_qc_set_storage_handler($handler);
|
||||
if ($result === false) {
|
||||
throw MysqlndQcException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
247
vendor/thecodingmachine/safe/generated/network.php
vendored
247
vendor/thecodingmachine/safe/generated/network.php
vendored
@@ -53,10 +53,11 @@ function closelog(): void
|
||||
* always return every record, the slower DNS_ALL
|
||||
* will collect all records more reliably.
|
||||
*
|
||||
* DNS_CAA is not supported on Windows.
|
||||
* @param array|null $authns Passed by reference and, if given, will be populated with Resource
|
||||
* Windows: DNS_CAA is not supported.
|
||||
* Support for DNS_A6 is not implemented.
|
||||
* @param array|null $authoritative_name_servers Passed by reference and, if given, will be populated with Resource
|
||||
* Records for the Authoritative Name Servers.
|
||||
* @param array|null $addtl Passed by reference and, if given, will be populated with any
|
||||
* @param array|null $additional_records Passed by reference and, if given, will be populated with any
|
||||
* Additional Records.
|
||||
* @param bool $raw The type will be interpreted as a raw DNS type ID
|
||||
* (the DNS_* constants cannot be used).
|
||||
@@ -208,7 +209,7 @@ function closelog(): void
|
||||
*
|
||||
*
|
||||
*
|
||||
* A6(PHP >= 5.1.0)
|
||||
* A6
|
||||
*
|
||||
* masklen: Length (in bits) to inherit from the target
|
||||
* specified by chain.
|
||||
@@ -245,10 +246,10 @@ function closelog(): void
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function dns_get_record(string $hostname, int $type = DNS_ANY, ?array &$authns = null, ?array &$addtl = null, bool $raw = false): array
|
||||
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();
|
||||
$result = \dns_get_record($hostname, $type, $authns, $addtl, $raw);
|
||||
$result = \dns_get_record($hostname, $type, $authoritative_name_servers, $additional_records, $raw);
|
||||
if ($result === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
@@ -280,16 +281,17 @@ function dns_get_record(string $hostname, int $type = DNS_ANY, ?array &$authns =
|
||||
* @param int $port The port number. This can be omitted and skipped with
|
||||
* -1 for transports that do not use ports, such as
|
||||
* unix://.
|
||||
* @param int|null $errno If provided, holds the system level error number that occurred in the
|
||||
* @param int|null $error_code If provided, holds the system level error number that occurred in the
|
||||
* system-level connect() call.
|
||||
*
|
||||
* If the value returned in errno is
|
||||
* If the value returned in error_code is
|
||||
* 0 and the function returned FALSE, it is an
|
||||
* indication that the error occurred before the
|
||||
* connect() call. This is most likely due to a
|
||||
* problem initializing the socket.
|
||||
* @param string|null $errstr The error message as a string.
|
||||
* @param float $timeout The connection timeout, in seconds.
|
||||
* @param string|null $error_message The error message as a string.
|
||||
* @param float $timeout The connection timeout, in seconds. When NULL, the
|
||||
* default_socket_timeout php.ini setting is used.
|
||||
*
|
||||
* If you need to set a timeout for reading/writing data over the
|
||||
* socket, use stream_set_timeout, as the
|
||||
@@ -304,13 +306,13 @@ function dns_get_record(string $hostname, int $type = DNS_ANY, ?array &$authns =
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function fsockopen(string $hostname, int $port = -1, ?int &$errno = null, ?string &$errstr = null, float $timeout = null)
|
||||
function fsockopen(string $hostname, int $port = -1, ?int &$error_code = null, ?string &$error_message = null, float $timeout = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($timeout !== null) {
|
||||
$result = \fsockopen($hostname, $port, $errno, $errstr, $timeout);
|
||||
$result = \fsockopen($hostname, $port, $error_code, $error_message, $timeout);
|
||||
} else {
|
||||
$result = \fsockopen($hostname, $port, $errno, $errstr);
|
||||
$result = \fsockopen($hostname, $port, $error_code, $error_message);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
@@ -341,18 +343,18 @@ function gethostname(): string
|
||||
|
||||
/**
|
||||
* getprotobyname returns the protocol number
|
||||
* associated with the protocol name as per
|
||||
* associated with the protocol protocol as per
|
||||
* /etc/protocols.
|
||||
*
|
||||
* @param string $name The protocol name.
|
||||
* @param string $protocol The protocol name.
|
||||
* @return int Returns the protocol number.
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function getprotobyname(string $name): int
|
||||
function getprotobyname(string $protocol): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \getprotobyname($name);
|
||||
$result = \getprotobyname($protocol);
|
||||
if ($result === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
@@ -362,18 +364,41 @@ function getprotobyname(string $name): int
|
||||
|
||||
/**
|
||||
* getprotobynumber returns the protocol name
|
||||
* associated with protocol number as per
|
||||
* associated with protocol protocol as per
|
||||
* /etc/protocols.
|
||||
*
|
||||
* @param int $number The protocol number.
|
||||
* @param int $protocol The protocol number.
|
||||
* @return string Returns the protocol name as a string.
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function getprotobynumber(int $number): string
|
||||
function getprotobynumber(int $protocol): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \getprotobynumber($number);
|
||||
$result = \getprotobynumber($protocol);
|
||||
if ($result === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getservbyport returns the Internet service
|
||||
* associated with port for the specified
|
||||
* protocol as per /etc/services.
|
||||
*
|
||||
* @param int $port The port number.
|
||||
* @param string $protocol protocol is either "tcp"
|
||||
* or "udp" (in lowercase).
|
||||
* @return string Returns the Internet service name as a string.
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function getservbyport(int $port, string $protocol): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \getservbyport($port, $protocol);
|
||||
if ($result === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
@@ -406,15 +431,141 @@ function header_register_callback(callable $callback): void
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param string $in_addr A 32bit IPv4, or 128bit IPv6 address.
|
||||
* @param string $ip A 32bit IPv4, or 128bit IPv6 address.
|
||||
* @return string Returns a string representation of the address.
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function inet_ntop(string $in_addr): string
|
||||
function inet_ntop(string $ip): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \inet_ntop($in_addr);
|
||||
$result = \inet_ntop($ip);
|
||||
if ($result === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The function long2ip generates an Internet address
|
||||
* in dotted format (i.e.: aaa.bbb.ccc.ddd) from the long integer
|
||||
* representation.
|
||||
*
|
||||
* @param int $ip A proper address representation in long integer.
|
||||
* @return string Returns the Internet IP address as a string.
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function long2ip(int $ip): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \long2ip($ip);
|
||||
if ($result === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns an enumeration of network interfaces (adapters) on the local machine.
|
||||
*
|
||||
* @return array Returns an associative array where the key is the name of the interface and
|
||||
* the value an associative array of interface attributes.
|
||||
*
|
||||
* Each interface associative array contains:
|
||||
*
|
||||
* Interface attributes
|
||||
*
|
||||
*
|
||||
*
|
||||
* Name
|
||||
* Description
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* description
|
||||
*
|
||||
* Optional string value for description of the interface.
|
||||
* Windows only.
|
||||
*
|
||||
*
|
||||
*
|
||||
* mac
|
||||
*
|
||||
* Optional string value for MAC address of the interface.
|
||||
* Windows only.
|
||||
*
|
||||
*
|
||||
*
|
||||
* mtu
|
||||
*
|
||||
* Integer value for Maximum transmission unit (MTU) of the interface.
|
||||
* Windows only.
|
||||
*
|
||||
*
|
||||
*
|
||||
* unicast
|
||||
*
|
||||
* Array of associative arrays, see Unicast attributes below.
|
||||
*
|
||||
*
|
||||
*
|
||||
* up
|
||||
*
|
||||
* Boolean status (on/off) for interface.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Unicast attributes
|
||||
*
|
||||
*
|
||||
*
|
||||
* Name
|
||||
* Description
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* flags
|
||||
*
|
||||
* Integer value.
|
||||
*
|
||||
*
|
||||
*
|
||||
* family
|
||||
*
|
||||
* Integer value.
|
||||
*
|
||||
*
|
||||
*
|
||||
* address
|
||||
*
|
||||
* String value for address in either IPv4 or IPv6.
|
||||
*
|
||||
*
|
||||
*
|
||||
* netmask
|
||||
*
|
||||
* String value for netmask in either IPv4 or IPv6.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function net_get_interfaces(): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \net_get_interfaces();
|
||||
if ($result === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
@@ -428,11 +579,11 @@ function inet_ntop(string $in_addr): string
|
||||
*
|
||||
* The use of openlog is optional. It
|
||||
* will automatically be called by syslog if
|
||||
* necessary, in which case ident will default
|
||||
* necessary, in which case prefix will default
|
||||
* to FALSE.
|
||||
*
|
||||
* @param string $ident The string ident is added to each message.
|
||||
* @param int $option The option argument is used to indicate
|
||||
* @param string $prefix The string prefix is added to each message.
|
||||
* @param int $flags The flags argument is used to indicate
|
||||
* what logging options will be used when generating a log message.
|
||||
*
|
||||
* openlog Options
|
||||
@@ -554,16 +705,49 @@ function inet_ntop(string $in_addr): string
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
function openlog(string $ident, int $option, int $facility): void
|
||||
function openlog(string $prefix, int $flags, int $facility): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \openlog($ident, $option, $facility);
|
||||
$result = \openlog($prefix, $flags, $facility);
|
||||
if ($result === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function behaves exactly as fsockopen with the
|
||||
* difference that the connection is not closed after the script finishes.
|
||||
* It is the persistent version of fsockopen.
|
||||
*
|
||||
* @param string $hostname
|
||||
* @param int $port
|
||||
* @param int|null $error_code
|
||||
* @param string|null $error_message
|
||||
* @param float $timeout
|
||||
* @return resource pfsockopen returns a file pointer which may be used
|
||||
* together with the other file functions (such as
|
||||
* fgets, fgetss,
|
||||
* fwrite, fclose, and
|
||||
* feof).
|
||||
* @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) {
|
||||
$result = \pfsockopen($hostname, $port, $error_code, $error_message, $timeout);
|
||||
} else {
|
||||
$result = \pfsockopen($hostname, $port, $error_code, $error_message);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw NetworkException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* syslog generates a log message that will be
|
||||
* distributed by the system logger.
|
||||
@@ -622,10 +806,7 @@ function openlog(string $ident, int $option, int $facility): void
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param string $message The message to send, except that the two characters
|
||||
* %m will be replaced by the error message string
|
||||
* (strerror) corresponding to the present value of
|
||||
* errno.
|
||||
* @param string $message The message to send.
|
||||
* @throws NetworkException
|
||||
*
|
||||
*/
|
||||
|
||||
512
vendor/thecodingmachine/safe/generated/oci8.php
vendored
512
vendor/thecodingmachine/safe/generated/oci8.php
vendored
@@ -5,15 +5,15 @@ namespace Safe;
|
||||
use Safe\Exceptions\Oci8Exception;
|
||||
|
||||
/**
|
||||
* Binds the PHP array var_array to the Oracle
|
||||
* placeholder name, which points to an Oracle PL/SQL
|
||||
* Binds the PHP array var to the Oracle
|
||||
* placeholder param, which points to an Oracle PL/SQL
|
||||
* array. Whether it will be used for input or output will be determined at
|
||||
* run-time.
|
||||
*
|
||||
* @param resource $statement A valid OCI statement identifier.
|
||||
* @param string $name The Oracle placeholder.
|
||||
* @param array $var_array An array.
|
||||
* @param int $max_table_length Sets the maximum length both for incoming and result arrays.
|
||||
* @param string $param The Oracle placeholder.
|
||||
* @param array $var An array.
|
||||
* @param int $max_array_length Sets the maximum length both for incoming and result arrays.
|
||||
* @param int $max_item_length Sets maximum length for array items. If not specified or equals to -1,
|
||||
* oci_bind_array_by_name will find the longest
|
||||
* element in the incoming array and will use it as the maximum length.
|
||||
@@ -101,10 +101,10 @@ use Safe\Exceptions\Oci8Exception;
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_bind_array_by_name($statement, string $name, array &$var_array, int $max_table_length, int $max_item_length = -1, int $type = SQLT_AFC): void
|
||||
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();
|
||||
$result = \oci_bind_array_by_name($statement, $name, $var_array, $max_table_length, $max_item_length, $type);
|
||||
$result = \oci_bind_array_by_name($statement, $param, $var, $max_array_length, $max_item_length, $type);
|
||||
if ($result === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
@@ -112,8 +112,8 @@ function oci_bind_array_by_name($statement, string $name, array &$var_array, int
|
||||
|
||||
|
||||
/**
|
||||
* Binds a PHP variable variable to the Oracle
|
||||
* bind variable placeholder bv_name. Binding
|
||||
* Binds a PHP variable var to the Oracle
|
||||
* bind variable placeholder param. Binding
|
||||
* is important for Oracle database performance and also as a way to
|
||||
* avoid SQL Injection security issues.
|
||||
*
|
||||
@@ -136,12 +136,12 @@ function oci_bind_array_by_name($statement, string $name, array &$var_array, int
|
||||
* bind variable will be used for input or output is determined at
|
||||
* run-time.
|
||||
*
|
||||
* You must specify maxlength when using
|
||||
* You must specify max_length when using
|
||||
* an OUT bind so that PHP allocates enough memory
|
||||
* to hold the returned value.
|
||||
*
|
||||
* For IN binds it is recommended to set
|
||||
* the maxlength length if the statement is
|
||||
* the max_length length if the statement is
|
||||
* re-executed multiple times with different values for the PHP
|
||||
* variable. Otherwise Oracle may truncate data to the length of the
|
||||
* initial PHP variable value. If you don't know what the maximum
|
||||
@@ -168,16 +168,16 @@ function oci_bind_array_by_name($statement, string $name, array &$var_array, int
|
||||
* SQL statement, as this can be a security risk if unfiltered user
|
||||
* text is concatenated.
|
||||
*
|
||||
* @param resource $statement A valid OCI8 statement identifer.
|
||||
* @param string $bv_name The colon-prefixed bind variable placeholder used in the
|
||||
* @param resource $statement A valid OCI8 statement identifier.
|
||||
* @param string $param The colon-prefixed bind variable placeholder used in the
|
||||
* statement. The colon is optional
|
||||
* in bv_name. Oracle does not use question
|
||||
* in param. Oracle does not use question
|
||||
* marks for placeholders.
|
||||
* @param mixed $variable The PHP variable to be associated with bv_name
|
||||
* @param int $maxlength Sets the maximum length for the data. If you set it to -1, this
|
||||
* @param mixed $var The PHP variable to be associated with param
|
||||
* @param int $max_length Sets the maximum length for the data. If you set it to -1, this
|
||||
* function will use the current length
|
||||
* of variable to set the maximum
|
||||
* length. In this case the variable must
|
||||
* of var to set the maximum
|
||||
* length. In this case the var must
|
||||
* exist and contain data
|
||||
* when oci_bind_by_name is called.
|
||||
* @param int $type The datatype that Oracle will treat the data as. The
|
||||
@@ -307,10 +307,10 @@ function oci_bind_array_by_name($statement, string $name, array &$var_array, int
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_bind_by_name($statement, string $bv_name, &$variable, int $maxlength = -1, int $type = SQLT_CHR): void
|
||||
function oci_bind_by_name($statement, string $param, &$var, int $max_length = -1, int $type = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \oci_bind_by_name($statement, $bv_name, $variable, $maxlength, $type);
|
||||
$result = \oci_bind_by_name($statement, $param, $var, $max_length, $type);
|
||||
if ($result === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
@@ -335,31 +335,6 @@ function oci_cancel($statement): void
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unsets connection. The underlying database
|
||||
* connection is closed if no other resources are using it and if it
|
||||
* was created with oci_connect
|
||||
* or oci_new_connect.
|
||||
*
|
||||
* It is recommended to close connections that are no longer needed
|
||||
* because this makes database resources available for other users.
|
||||
*
|
||||
* @param resource $connection An Oracle connection identifier returned by
|
||||
* oci_connect, oci_pconnect,
|
||||
* or oci_new_connect.
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_close($connection): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \oci_close($connection);
|
||||
if ($result === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Commits the outstanding transaction for the
|
||||
* Oracle connection. A commit ends the
|
||||
@@ -395,9 +370,11 @@ function oci_commit($connection): void
|
||||
/**
|
||||
* Returns a connection identifier needed for most other OCI8 operations.
|
||||
*
|
||||
* See Connection Handling for
|
||||
* general information on connection management and connection
|
||||
* pooling.
|
||||
* For performance, most applications should use persistent connections
|
||||
* with oci_pconnect instead
|
||||
* of oci_connect.
|
||||
* See Connection Handling for general
|
||||
* information on connection management and connection pooling.
|
||||
*
|
||||
* From PHP 5.1.2 (PECL OCI8 1.1) oci_close can
|
||||
* be used to close the connection.
|
||||
@@ -419,7 +396,7 @@ function oci_commit($connection): void
|
||||
* the tnsnames.ora file, or the name of a local
|
||||
* Oracle instance.
|
||||
*
|
||||
* If not specified, PHP uses
|
||||
* If not specified or NULL, PHP uses
|
||||
* environment variables such as TWO_TASK (on Linux)
|
||||
* or LOCAL (on Windows)
|
||||
* and ORACLE_SID to determine the
|
||||
@@ -432,19 +409,19 @@ function oci_commit($connection): void
|
||||
* [//]host_name[:port][/service_name]. From Oracle
|
||||
* 11g, the syntax is:
|
||||
* [//]host_name[:port][/service_name][:server_type][/instance_name].
|
||||
* Service names can be found by running the Oracle
|
||||
* utility lsnrctl status on the database server
|
||||
* Further options were introduced with Oracle 19c, including timeout and keep-alive
|
||||
* settings. Refer to Oracle documentation. Service names can be found by running
|
||||
* the Oracle utility lsnrctl status on the database server
|
||||
* machine.
|
||||
*
|
||||
*
|
||||
* The tnsnames.ora file can be in the Oracle Net
|
||||
* search path, which
|
||||
* includes $ORACLE_HOME/network/admin
|
||||
* and /etc. Alternatively
|
||||
* set TNS_ADMIN so
|
||||
* that $TNS_ADMIN/tnsnames.ora is read. Make sure
|
||||
* the web daemon has read access to the file.
|
||||
* @param string $character_set Determines
|
||||
* The tnsnames.ora file can be in the Oracle Net search path,
|
||||
* which
|
||||
* includes /your/path/to/instantclient/network/admin, $ORACLE_HOME/network/admin
|
||||
* and /etc. Alternatively set TNS_ADMIN
|
||||
* so that $TNS_ADMIN/tnsnames.ora is read. Make sure the web
|
||||
* daemon has read access to the file.
|
||||
* @param string $encoding Determines
|
||||
* the character set used by the Oracle Client libraries. The character
|
||||
* set does not need to match the character set used by the database. If
|
||||
* it doesn't match, Oracle will do its best to convert data to and from
|
||||
@@ -489,13 +466,13 @@ function oci_commit($connection): void
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_connect(string $username, string $password, string $connection_string = null, string $character_set = null, int $session_mode = null)
|
||||
function oci_connect(string $username, string $password, string $connection_string = null, string $encoding = "", int $session_mode = OCI_DEFAULT)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($session_mode !== null) {
|
||||
$result = \oci_connect($username, $password, $connection_string, $character_set, $session_mode);
|
||||
} elseif ($character_set !== null) {
|
||||
$result = \oci_connect($username, $password, $connection_string, $character_set);
|
||||
if ($session_mode !== OCI_DEFAULT) {
|
||||
$result = \oci_connect($username, $password, $connection_string, $encoding, $session_mode);
|
||||
} elseif ($encoding !== "") {
|
||||
$result = \oci_connect($username, $password, $connection_string, $encoding);
|
||||
} elseif ($connection_string !== null) {
|
||||
$result = \oci_connect($username, $password, $connection_string);
|
||||
} else {
|
||||
@@ -518,12 +495,12 @@ function oci_connect(string $username, string $password, string $connection_stri
|
||||
* identifier created by oci_parse and executed
|
||||
* by oci_execute, or a REF
|
||||
* CURSOR statement identifier.
|
||||
* @param string $column_name The column name used in the query.
|
||||
* @param string $column The column name used in the query.
|
||||
*
|
||||
* Use uppercase for Oracle's default, non-case sensitive column
|
||||
* names. Use the exact column name case for case-sensitive
|
||||
* column names.
|
||||
* @param mixed $variable The PHP variable that will contain the returned column value.
|
||||
* @param mixed $var The PHP variable that will contain the returned column value.
|
||||
* @param int $type The data type to be returned. Generally not needed. Note that
|
||||
* Oracle-style data conversions are not performed. For example,
|
||||
* SQLT_INT will be ignored and the returned
|
||||
@@ -534,10 +511,10 @@ function oci_connect(string $username, string $password, string $connection_stri
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_define_by_name($statement, string $column_name, &$variable, int $type = SQLT_CHR): void
|
||||
function oci_define_by_name($statement, string $column, &$var, int $type = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \oci_define_by_name($statement, $column_name, $variable, $type);
|
||||
$result = \oci_define_by_name($statement, $column, $var, $type);
|
||||
if ($result === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
@@ -632,121 +609,18 @@ function oci_execute($statement, int $mode = OCI_COMMIT_ON_SUCCESS): void
|
||||
|
||||
|
||||
/**
|
||||
* Fetches multiple rows from a query into a two-dimensional array.
|
||||
* By default, all rows are returned.
|
||||
*
|
||||
* This function can be called only once for each query executed
|
||||
* with oci_execute.
|
||||
*
|
||||
* @param resource $statement A valid OCI8 statement
|
||||
* identifier created by oci_parse and executed
|
||||
* by oci_execute, or a REF
|
||||
* CURSOR statement identifier.
|
||||
* @param array|null $output The variable to contain the returned rows.
|
||||
*
|
||||
* LOB columns are returned as strings, where Oracle supports
|
||||
* conversion.
|
||||
*
|
||||
* See oci_fetch_array for more information
|
||||
* on how data and types are fetched.
|
||||
* @param int $skip The number of initial rows to discard when fetching the
|
||||
* result. The default value is 0, so the first row onwards is
|
||||
* returned.
|
||||
* @param int $maxrows The number of rows to return. The default is -1 meaning return
|
||||
* all the rows from skip + 1 onwards.
|
||||
* @param int $flags Parameter flags indicates the array
|
||||
* structure and whether associative arrays should be used.
|
||||
*
|
||||
* oci_fetch_all Array Structure Modes
|
||||
*
|
||||
*
|
||||
*
|
||||
* Constant
|
||||
* Description
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* OCI_FETCHSTATEMENT_BY_ROW
|
||||
* The outer array will contain one sub-array per query
|
||||
* row.
|
||||
*
|
||||
*
|
||||
* OCI_FETCHSTATEMENT_BY_COLUMN
|
||||
* The outer array will contain one sub-array per query
|
||||
* column. This is the default.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Arrays can be indexed either by column heading or numerically.
|
||||
* Only one index mode will be returned.
|
||||
*
|
||||
* oci_fetch_all Array Index Modes
|
||||
*
|
||||
*
|
||||
*
|
||||
* Constant
|
||||
* Description
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* OCI_NUM
|
||||
* Numeric indexes are used for each column's array.
|
||||
*
|
||||
*
|
||||
* OCI_ASSOC
|
||||
* Associative indexes are used for each column's
|
||||
* array. This is the default.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Use the addition operator "+" to choose a combination
|
||||
* of array structure and index modes.
|
||||
*
|
||||
* Oracle's default, non-case sensitive column names will have
|
||||
* uppercase array keys. Case-sensitive column names will have
|
||||
* array keys using the exact column case.
|
||||
* Use var_dump
|
||||
* on output to verify the appropriate case
|
||||
* to use for each query.
|
||||
*
|
||||
* Queries that have more than one column with the same name
|
||||
* should use column aliases. Otherwise only one of the columns
|
||||
* will appear in an associative array.
|
||||
* @return int Returns the number of rows in output, which
|
||||
* may be 0 or more.
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_fetch_all($statement, ?array &$output, int $skip = 0, int $maxrows = -1, int $flags = OCI_FETCHSTATEMENT_BY_COLUMN + OCI_ASSOC): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \oci_fetch_all($statement, $output, $skip, $maxrows, $flags);
|
||||
if ($result === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the name of the field.
|
||||
* Returns the name of the column.
|
||||
*
|
||||
* @param resource $statement A valid OCI statement identifier.
|
||||
* @param mixed $field Can be the field's index (1-based) or name.
|
||||
* @return string Returns the name as a strings.
|
||||
* @param mixed $column Can be the field's index (1-based) or name.
|
||||
* @return string Returns the name as a string
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_field_name($statement, $field): string
|
||||
function oci_field_name($statement, $column): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \oci_field_name($statement, $field);
|
||||
$result = \oci_field_name($statement, $column);
|
||||
if ($result === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
@@ -755,22 +629,22 @@ function oci_field_name($statement, $field): string
|
||||
|
||||
|
||||
/**
|
||||
* Returns precision of the field.
|
||||
* Returns precision of the column.
|
||||
*
|
||||
* For FLOAT columns, precision is nonzero and scale is -127.
|
||||
* If precision is 0, then column is NUMBER. Else it's
|
||||
* NUMBER(precision, scale).
|
||||
*
|
||||
* @param resource $statement A valid OCI statement identifier.
|
||||
* @param mixed $field Can be the field's index (1-based) or name.
|
||||
* @return int Returns the precision as an integers.
|
||||
* @param mixed $column Can be the field's index (1-based) or name.
|
||||
* @return int Returns the precision as an integer
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_field_precision($statement, $field): int
|
||||
function oci_field_precision($statement, $column): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \oci_field_precision($statement, $field);
|
||||
$result = \oci_field_precision($statement, $column);
|
||||
if ($result === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
@@ -779,22 +653,22 @@ function oci_field_precision($statement, $field): int
|
||||
|
||||
|
||||
/**
|
||||
* Returns the scale of the column with field index.
|
||||
* Returns the scale of the column with column index.
|
||||
*
|
||||
* For FLOAT columns, precision is nonzero and scale is -127.
|
||||
* If precision is 0, then column is NUMBER. Else it's
|
||||
* NUMBER(precision, scale).
|
||||
*
|
||||
* @param resource $statement A valid OCI statement identifier.
|
||||
* @param mixed $field Can be the field's index (1-based) or name.
|
||||
* @return int Returns the scale as an integers.
|
||||
* @param mixed $column Can be the field's index (1-based) or name.
|
||||
* @return int Returns the scale as an integer
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_field_scale($statement, $field): int
|
||||
function oci_field_scale($statement, $column): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \oci_field_scale($statement, $field);
|
||||
$result = \oci_field_scale($statement, $column);
|
||||
if ($result === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
@@ -803,18 +677,18 @@ function oci_field_scale($statement, $field): int
|
||||
|
||||
|
||||
/**
|
||||
* Returns the size of a field.
|
||||
* Returns the size of a column.
|
||||
*
|
||||
* @param resource $statement A valid OCI statement identifier.
|
||||
* @param mixed $field Can be the field's index (1-based) or name.
|
||||
* @return int Returns the size of a field in bytess.
|
||||
* @param mixed $column Can be the field's index (1-based) or name.
|
||||
* @return int Returns the size of a column in bytes
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_field_size($statement, $field): int
|
||||
function oci_field_size($statement, $column): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \oci_field_size($statement, $field);
|
||||
$result = \oci_field_size($statement, $column);
|
||||
if ($result === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
@@ -823,20 +697,20 @@ function oci_field_size($statement, $field): int
|
||||
|
||||
|
||||
/**
|
||||
* Returns Oracle's raw "SQLT" data type of the field.
|
||||
* Returns Oracle's raw "SQLT" data type of the column.
|
||||
*
|
||||
* If you want a field's type name, then use oci_field_type instead.
|
||||
*
|
||||
* @param resource $statement A valid OCI statement identifier.
|
||||
* @param mixed $field Can be the field's index (1-based) or name.
|
||||
* @return int Returns Oracle's raw data type as a numbers.
|
||||
* @param mixed $column Can be the field's index (1-based) or name.
|
||||
* @return int Returns Oracle's raw data type as a number
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_field_type_raw($statement, $field): int
|
||||
function oci_field_type_raw($statement, $column): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \oci_field_type_raw($statement, $field);
|
||||
$result = \oci_field_type_raw($statement, $column);
|
||||
if ($result === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
@@ -848,15 +722,15 @@ function oci_field_type_raw($statement, $field): int
|
||||
* Returns a field's data type name.
|
||||
*
|
||||
* @param resource $statement A valid OCI statement identifier.
|
||||
* @param mixed $field Can be the field's index (1-based) or name.
|
||||
* @return mixed Returns the field data type as a strings.
|
||||
* @param mixed $column Can be the field's index (1-based) or name.
|
||||
* @return mixed Returns the field data type as a string or an integer
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_field_type($statement, $field)
|
||||
function oci_field_type($statement, $column)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \oci_field_type($statement, $field);
|
||||
$result = \oci_field_type($statement, $column);
|
||||
if ($result === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
@@ -867,14 +741,14 @@ function oci_field_type($statement, $field)
|
||||
/**
|
||||
* Frees a descriptor allocated by oci_new_descriptor.
|
||||
*
|
||||
* @param resource $descriptor
|
||||
* @param \OCILob $lob Descriptor allocated by oci_new_descriptor.
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_free_descriptor($descriptor): void
|
||||
function oci_free_descriptor(\OCILob $lob): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \oci_free_descriptor($descriptor);
|
||||
$result = \oci_free_descriptor($lob);
|
||||
if ($result === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
@@ -905,17 +779,21 @@ function oci_free_statement($statement): void
|
||||
*
|
||||
* @param resource $connection An Oracle connection identifier, returned by
|
||||
* oci_connect or oci_pconnect.
|
||||
* @param string $tdo Should be a valid named type (uppercase).
|
||||
* @param string $type_name Should be a valid named type (uppercase).
|
||||
* @param string $schema Should point to the scheme, where the named type was created. The name
|
||||
* of the current user is the default value.
|
||||
* of the current user is used when NULL is passed.
|
||||
* @return \OCI-Collection Returns a new OCICollection object.
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_new_collection($connection, string $tdo, string $schema = null)
|
||||
function oci_new_collection($connection, string $type_name, string $schema = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \oci_new_collection($connection, $tdo, $schema);
|
||||
if ($schema !== null) {
|
||||
$result = \oci_new_collection($connection, $type_name, $schema);
|
||||
} else {
|
||||
$result = \oci_new_collection($connection, $type_name);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
@@ -941,7 +819,7 @@ function oci_new_collection($connection, string $tdo, string $schema = null)
|
||||
* the tnsnames.ora file, or the name of a local
|
||||
* Oracle instance.
|
||||
*
|
||||
* If not specified, PHP uses
|
||||
* If not specified or NULL, PHP uses
|
||||
* environment variables such as TWO_TASK (on Linux)
|
||||
* or LOCAL (on Windows)
|
||||
* and ORACLE_SID to determine the
|
||||
@@ -954,19 +832,19 @@ function oci_new_collection($connection, string $tdo, string $schema = null)
|
||||
* [//]host_name[:port][/service_name]. From Oracle
|
||||
* 11g, the syntax is:
|
||||
* [//]host_name[:port][/service_name][:server_type][/instance_name].
|
||||
* Service names can be found by running the Oracle
|
||||
* utility lsnrctl status on the database server
|
||||
* Further options were introduced with Oracle 19c, including timeout and keep-alive
|
||||
* settings. Refer to Oracle documentation. Service names can be found by running
|
||||
* the Oracle utility lsnrctl status on the database server
|
||||
* machine.
|
||||
*
|
||||
*
|
||||
* The tnsnames.ora file can be in the Oracle Net
|
||||
* search path, which
|
||||
* includes $ORACLE_HOME/network/admin
|
||||
* and /etc. Alternatively
|
||||
* set TNS_ADMIN so
|
||||
* that $TNS_ADMIN/tnsnames.ora is read. Make sure
|
||||
* the web daemon has read access to the file.
|
||||
* @param string $character_set Determines
|
||||
* The tnsnames.ora file can be in the Oracle Net search path,
|
||||
* which
|
||||
* includes /your/path/to/instantclient/network/admin, $ORACLE_HOME/network/admin
|
||||
* and /etc. Alternatively set TNS_ADMIN
|
||||
* so that $TNS_ADMIN/tnsnames.ora is read. Make sure the web
|
||||
* daemon has read access to the file.
|
||||
* @param string $encoding Determines
|
||||
* the character set used by the Oracle Client libraries. The character
|
||||
* set does not need to match the character set used by the database. If
|
||||
* it doesn't match, Oracle will do its best to convert data to and from
|
||||
@@ -1011,13 +889,13 @@ function oci_new_collection($connection, string $tdo, string $schema = null)
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_new_connect(string $username, string $password, string $connection_string = null, string $character_set = null, int $session_mode = null)
|
||||
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 !== null) {
|
||||
$result = \oci_new_connect($username, $password, $connection_string, $character_set, $session_mode);
|
||||
} elseif ($character_set !== null) {
|
||||
$result = \oci_new_connect($username, $password, $connection_string, $character_set);
|
||||
if ($session_mode !== OCI_DEFAULT) {
|
||||
$result = \oci_new_connect($username, $password, $connection_string, $encoding, $session_mode);
|
||||
} elseif ($encoding !== "") {
|
||||
$result = \oci_new_connect($username, $password, $connection_string, $encoding);
|
||||
} elseif ($connection_string !== null) {
|
||||
$result = \oci_new_connect($username, $password, $connection_string);
|
||||
} else {
|
||||
@@ -1058,7 +936,7 @@ function oci_new_cursor($connection)
|
||||
* @param int $type Valid values for type are:
|
||||
* OCI_DTYPE_FILE, OCI_DTYPE_LOB and
|
||||
* OCI_DTYPE_ROWID.
|
||||
* @return \OCI-Lob Returns a new LOB or FILE descriptor on success, FALSE on error.
|
||||
* @return \OCI-Lob|false Returns a new LOB or FILE descriptor on success.
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
@@ -1066,26 +944,7 @@ function oci_new_descriptor($connection, int $type = OCI_DTYPE_LOB)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \oci_new_descriptor($connection, $type);
|
||||
if ($result === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the number of columns in the given statement.
|
||||
*
|
||||
* @param resource $statement A valid OCI statement identifier.
|
||||
* @return int Returns the number of columns as an integers.
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_num_fields($statement): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \oci_num_fields($statement);
|
||||
if ($result === false) {
|
||||
if ($result === null) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
@@ -1096,7 +955,7 @@ function oci_num_fields($statement): int
|
||||
* Gets the number of rows affected during statement execution.
|
||||
*
|
||||
* @param resource $statement A valid OCI statement identifier.
|
||||
* @return int Returns the number of rows affected as an integers.
|
||||
* @return int Returns the number of rows affected as an integer
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
@@ -1112,7 +971,7 @@ function oci_num_rows($statement): int
|
||||
|
||||
|
||||
/**
|
||||
* Prepares sql_text using
|
||||
* Prepares sql using
|
||||
* connection and returns the statement identifier,
|
||||
* which can be used with oci_bind_by_name,
|
||||
* oci_execute and other functions.
|
||||
@@ -1123,7 +982,7 @@ function oci_num_rows($statement): int
|
||||
*
|
||||
* @param resource $connection An Oracle connection identifier, returned by
|
||||
* oci_connect, oci_pconnect, or oci_new_connect.
|
||||
* @param string $sql_text The SQL or PL/SQL statement.
|
||||
* @param string $sql The SQL or PL/SQL statement.
|
||||
*
|
||||
* SQL statements should not end with a
|
||||
* semi-colon (";"). PL/SQL
|
||||
@@ -1133,10 +992,10 @@ function oci_num_rows($statement): int
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_parse($connection, string $sql_text)
|
||||
function oci_parse($connection, string $sql)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \oci_parse($connection, $sql_text);
|
||||
$result = \oci_parse($connection, $sql);
|
||||
if ($result === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
@@ -1147,11 +1006,12 @@ function oci_parse($connection, string $sql_text)
|
||||
/**
|
||||
* Creates a persistent connection to an Oracle server and logs on.
|
||||
*
|
||||
* Persistent connections are cached and re-used between requests, resulting
|
||||
* in reduced overhead on each page load; a typical PHP application will have
|
||||
* a single persistent connection open against an Oracle server per Apache
|
||||
* child process (or PHP FastCGI/CGI process). See the Persistent Database
|
||||
* Connections section for more information.
|
||||
* Persistent connections are cached and re-used between requests, resulting in
|
||||
* reduced overhead on each page load; a typical PHP application will have a
|
||||
* single persistent connection open against an Oracle server per Apache child
|
||||
* process (or PHP FPM process). See the OCI8
|
||||
* Connection Handling and Connection Pooling section for more
|
||||
* information.
|
||||
*
|
||||
* @param string $username The Oracle user name.
|
||||
* @param string $password The password for username.
|
||||
@@ -1162,7 +1022,7 @@ function oci_parse($connection, string $sql_text)
|
||||
* the tnsnames.ora file, or the name of a local
|
||||
* Oracle instance.
|
||||
*
|
||||
* If not specified, PHP uses
|
||||
* If not specified or NULL, PHP uses
|
||||
* environment variables such as TWO_TASK (on Linux)
|
||||
* or LOCAL (on Windows)
|
||||
* and ORACLE_SID to determine the
|
||||
@@ -1175,19 +1035,19 @@ function oci_parse($connection, string $sql_text)
|
||||
* [//]host_name[:port][/service_name]. From Oracle
|
||||
* 11g, the syntax is:
|
||||
* [//]host_name[:port][/service_name][:server_type][/instance_name].
|
||||
* Service names can be found by running the Oracle
|
||||
* utility lsnrctl status on the database server
|
||||
* Further options were introduced with Oracle 19c, including timeout and keep-alive
|
||||
* settings. Refer to Oracle documentation. Service names can be found by running
|
||||
* the Oracle utility lsnrctl status on the database server
|
||||
* machine.
|
||||
*
|
||||
*
|
||||
* The tnsnames.ora file can be in the Oracle Net
|
||||
* search path, which
|
||||
* includes $ORACLE_HOME/network/admin
|
||||
* and /etc. Alternatively
|
||||
* set TNS_ADMIN so
|
||||
* that $TNS_ADMIN/tnsnames.ora is read. Make sure
|
||||
* the web daemon has read access to the file.
|
||||
* @param string $character_set Determines
|
||||
* The tnsnames.ora file can be in the Oracle Net search path,
|
||||
* which
|
||||
* includes /your/path/to/instantclient/network/admin, $ORACLE_HOME/network/admin
|
||||
* and /etc. Alternatively set TNS_ADMIN
|
||||
* so that $TNS_ADMIN/tnsnames.ora is read. Make sure the web
|
||||
* daemon has read access to the file.
|
||||
* @param string $encoding Determines
|
||||
* the character set used by the Oracle Client libraries. The character
|
||||
* set does not need to match the character set used by the database. If
|
||||
* it doesn't match, Oracle will do its best to convert data to and from
|
||||
@@ -1232,13 +1092,13 @@ function oci_parse($connection, string $sql_text)
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_pconnect(string $username, string $password, string $connection_string = null, string $character_set = null, int $session_mode = null)
|
||||
function oci_pconnect(string $username, string $password, string $connection_string = null, string $encoding = "", int $session_mode = OCI_DEFAULT)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($session_mode !== null) {
|
||||
$result = \oci_pconnect($username, $password, $connection_string, $character_set, $session_mode);
|
||||
} elseif ($character_set !== null) {
|
||||
$result = \oci_pconnect($username, $password, $connection_string, $character_set);
|
||||
if ($session_mode !== OCI_DEFAULT) {
|
||||
$result = \oci_pconnect($username, $password, $connection_string, $encoding, $session_mode);
|
||||
} elseif ($encoding !== "") {
|
||||
$result = \oci_pconnect($username, $password, $connection_string, $encoding);
|
||||
} elseif ($connection_string !== null) {
|
||||
$result = \oci_pconnect($username, $password, $connection_string);
|
||||
} else {
|
||||
@@ -1252,7 +1112,45 @@ function oci_pconnect(string $username, string $password, string $connection_str
|
||||
|
||||
|
||||
/**
|
||||
* Returns the data from field in the current row,
|
||||
* Registers a user-defined callback function to connection.
|
||||
* If connection fails due to instance or network failure,
|
||||
* the registered callback function will be invoked for several times during
|
||||
* failover. See OCI8 Transparent Application Failover
|
||||
* (TAF) Support for information.
|
||||
*
|
||||
* When oci_register_taf_callback is called multiple times,
|
||||
* each registration overwrites the previous one.
|
||||
*
|
||||
* Use oci_unregister_taf_callback to explicitly unregister a
|
||||
* user-defined callback.
|
||||
*
|
||||
* TAF callback registration will NOT be saved across
|
||||
* persistent connections, therefore the callback needs to be re-registered for
|
||||
* a new persistent connection.
|
||||
*
|
||||
* @param resource $connection An Oracle connection identifier.
|
||||
* @param callable $callback A user-defined callback to register for Oracle TAF. It can be a
|
||||
* string of the function name or a Closure (anonymous function).
|
||||
*
|
||||
* The interface of a TAF user-defined callback function is as follows:
|
||||
*
|
||||
* See the parameter description and an example on
|
||||
* OCI8 Transparent Application Failover (TAF) Support page.
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_register_taf_callback($connection, callable $callback): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \oci_register_taf_callback($connection, $callback);
|
||||
if ($result === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the data from column in the current row,
|
||||
* fetched by oci_fetch.
|
||||
*
|
||||
* For details on the data type mapping performed by
|
||||
@@ -1260,7 +1158,7 @@ function oci_pconnect(string $username, string $password, string $connection_str
|
||||
* supported by the driver
|
||||
*
|
||||
* @param resource $statement
|
||||
* @param mixed $field Can be either use the column number (1-based) or the column name.
|
||||
* @param mixed $column Can be either use the column number (1-based) or the column name.
|
||||
* The case of the column name must be the case that Oracle meta data
|
||||
* describes the column as, which is uppercase for columns created
|
||||
* case insensitively.
|
||||
@@ -1269,10 +1167,10 @@ function oci_pconnect(string $username, string $password, string $connection_str
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_result($statement, $field): string
|
||||
function oci_result($statement, $column): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \oci_result($statement, $field);
|
||||
$result = \oci_result($statement, $column);
|
||||
if ($result === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
@@ -1349,14 +1247,14 @@ function oci_server_version($connection): string
|
||||
* @param resource $connection An Oracle connection identifier,
|
||||
* returned by oci_connect, oci_pconnect,
|
||||
* or oci_new_connect.
|
||||
* @param string $action_name User chosen string up to 32 bytes long.
|
||||
* @param string $action User chosen string up to 32 bytes long.
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_set_action($connection, string $action_name): void
|
||||
function oci_set_action($connection, string $action): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \oci_set_action($connection, $action_name);
|
||||
$result = \oci_set_action($connection, $action);
|
||||
if ($result === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
@@ -1391,14 +1289,14 @@ function oci_set_action($connection, string $action_name): void
|
||||
* @param resource $connection An Oracle connection identifier,
|
||||
* returned by oci_connect, oci_pconnect,
|
||||
* or oci_new_connect.
|
||||
* @param int $time_out The maximum time in milliseconds that any single round-trip between PHP and Oracle Database may take.
|
||||
* @param int $timeout The maximum time in milliseconds that any single round-trip between PHP and Oracle Database may take.
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_set_call_timeout($connection, int $time_out): void
|
||||
function oci_set_call_timeout($connection, int $timeout): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \oci_set_call_timeout($connection, $time_out);
|
||||
$result = \oci_set_call_timeout($connection, $timeout);
|
||||
if ($result === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
@@ -1426,14 +1324,14 @@ function oci_set_call_timeout($connection, int $time_out): void
|
||||
* @param resource $connection An Oracle connection identifier,
|
||||
* returned by oci_connect, oci_pconnect,
|
||||
* or oci_new_connect.
|
||||
* @param string $client_identifier User chosen string up to 64 bytes long.
|
||||
* @param string $client_id User chosen string up to 64 bytes long.
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_set_client_identifier($connection, string $client_identifier): void
|
||||
function oci_set_client_identifier($connection, string $client_id): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \oci_set_client_identifier($connection, $client_identifier);
|
||||
$result = \oci_set_client_identifier($connection, $client_id);
|
||||
if ($result === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
@@ -1485,14 +1383,14 @@ function oci_set_client_info($connection, string $client_info): void
|
||||
* @param resource $connection An Oracle connection identifier,
|
||||
* returned by oci_connect, oci_pconnect,
|
||||
* or oci_new_connect.
|
||||
* @param string $dbop User chosen string.
|
||||
* @param string $action User chosen string.
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_set_db_operation($connection, string $dbop): void
|
||||
function oci_set_db_operation($connection, string $action): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \oci_set_db_operation($connection, $dbop);
|
||||
$result = \oci_set_db_operation($connection, $action);
|
||||
if ($result === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
@@ -1550,14 +1448,50 @@ function oci_set_edition(string $edition): void
|
||||
* @param resource $connection An Oracle connection identifier,
|
||||
* returned by oci_connect, oci_pconnect,
|
||||
* or oci_new_connect.
|
||||
* @param string $module_name User chosen string up to 48 bytes long.
|
||||
* @param string $name User chosen string up to 48 bytes long.
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_set_module_name($connection, string $module_name): void
|
||||
function oci_set_module_name($connection, string $name): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \oci_set_module_name($connection, $module_name);
|
||||
$result = \oci_set_module_name($connection, $name);
|
||||
if ($result === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the internal buffer size used to fetch each CLOB or BLOB value when the
|
||||
* implementation gets the internal Oracle LOB locator from the database after
|
||||
* a successful query call to oci_execute and for each
|
||||
* subsequent internal fetch request to the database. Increasing this value
|
||||
* can improve the performance of fetching smaller LOBs by reducing round-trips
|
||||
* between PHP and the database. Memory usage will change.
|
||||
*
|
||||
* The value affects LOBs returned as OCILob instances and also those returned
|
||||
* using OCI_RETURN_LOBS.
|
||||
*
|
||||
* Call oci_set_prefetch_lob before
|
||||
* calling oci_execute. If it is not called, the value
|
||||
* of oci8.prefetch_lob_size
|
||||
* is used.
|
||||
*
|
||||
* The LOB prefetch value should only be set with Oracle Database 12.2 or later.
|
||||
*
|
||||
* @param resource $statement A valid OCI8 statement
|
||||
* identifier created by oci_parse and executed
|
||||
* by oci_execute, or a REF
|
||||
* CURSOR statement identifier.
|
||||
* @param int $prefetch_lob_size The number of bytes of each LOB to be prefetched, >= 0
|
||||
* @throws Oci8Exception
|
||||
*
|
||||
*/
|
||||
function oci_set_prefetch_lob($statement, int $prefetch_lob_size): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \oci_set_prefetch_lob($statement, $prefetch_lob_size);
|
||||
if ($result === false) {
|
||||
throw Oci8Exception::createFromPhpError();
|
||||
}
|
||||
|
||||
@@ -9,14 +9,14 @@ use Safe\Exceptions\OpcacheException;
|
||||
* executing it. This can be used to prime the cache after a Web server
|
||||
* restart by pre-caching files that will be included in later requests.
|
||||
*
|
||||
* @param string $file The path to the PHP script to be compiled.
|
||||
* @param string $filename The path to the PHP script to be compiled.
|
||||
* @throws OpcacheException
|
||||
*
|
||||
*/
|
||||
function opcache_compile_file(string $file): void
|
||||
function opcache_compile_file(string $filename): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \opcache_compile_file($file);
|
||||
$result = \opcache_compile_file($filename);
|
||||
if ($result === false) {
|
||||
throw OpcacheException::createFromPhpError();
|
||||
}
|
||||
@@ -24,17 +24,18 @@ function opcache_compile_file(string $file): void
|
||||
|
||||
|
||||
/**
|
||||
* This function returns state information about the cache instance
|
||||
* This function returns state information about the in-memory cache instance. It will not return any
|
||||
* information about the file cache.
|
||||
*
|
||||
* @param bool $get_scripts Include script specific state information
|
||||
* @param bool $include_scripts Include script specific state information
|
||||
* @return array Returns an array of information, optionally containing script specific state information.
|
||||
* @throws OpcacheException
|
||||
*
|
||||
*/
|
||||
function opcache_get_status(bool $get_scripts = true): array
|
||||
function opcache_get_status(bool $include_scripts = true): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \opcache_get_status($get_scripts);
|
||||
$result = \opcache_get_status($include_scripts);
|
||||
if ($result === false) {
|
||||
throw OpcacheException::createFromPhpError();
|
||||
}
|
||||
|
||||
890
vendor/thecodingmachine/safe/generated/openssl.php
vendored
890
vendor/thecodingmachine/safe/generated/openssl.php
vendored
File diff suppressed because it is too large
Load Diff
@@ -4,6 +4,29 @@ namespace Safe;
|
||||
|
||||
use Safe\Exceptions\OutcontrolException;
|
||||
|
||||
/**
|
||||
* This function discards the contents of the output buffer.
|
||||
*
|
||||
* This function does not destroy the output buffer like
|
||||
* ob_end_clean does.
|
||||
*
|
||||
* The output buffer must be started by
|
||||
* ob_start with PHP_OUTPUT_HANDLER_CLEANABLE
|
||||
* flag. Otherwise ob_clean will not work.
|
||||
*
|
||||
* @throws OutcontrolException
|
||||
*
|
||||
*/
|
||||
function ob_clean(): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ob_clean();
|
||||
if ($result === false) {
|
||||
throw OutcontrolException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function discards the contents of the topmost output buffer and turns
|
||||
* off this output buffering. If you want to further process the buffer's
|
||||
@@ -55,6 +78,134 @@ function ob_end_flush(): void
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function will send the contents of the output buffer (if any). If you
|
||||
* want to further process the buffer's contents you have to call
|
||||
* ob_get_contents before ob_flush
|
||||
* as the buffer contents are discarded after ob_flush
|
||||
* is called.
|
||||
*
|
||||
* This function does not destroy the output buffer like
|
||||
* ob_end_flush does.
|
||||
*
|
||||
* @throws OutcontrolException
|
||||
*
|
||||
*/
|
||||
function ob_flush(): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ob_flush();
|
||||
if ($result === false) {
|
||||
throw OutcontrolException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function will turn output buffering on. While output buffering is
|
||||
* active no output is sent from the script (other than headers), instead the
|
||||
* output is stored in an internal buffer.
|
||||
*
|
||||
* The contents of this internal buffer may be copied into a string variable
|
||||
* using ob_get_contents. To output what is stored in
|
||||
* the internal buffer, use ob_end_flush. Alternatively,
|
||||
* ob_end_clean will silently discard the buffer
|
||||
* contents.
|
||||
*
|
||||
* Output buffers are stackable, that is, you may call
|
||||
* ob_start while another
|
||||
* ob_start is active. Just make
|
||||
* sure that you call ob_end_flush
|
||||
* the appropriate number of times. If multiple output callback
|
||||
* functions are active, output is being filtered sequentially
|
||||
* through each of them in nesting order.
|
||||
*
|
||||
* If output buffering is still active when the script ends, PHP outputs the
|
||||
* contents automatically.
|
||||
*
|
||||
* @param string|array|callable|null $callback An optional callback function may be
|
||||
* specified. This function takes a string as a parameter and should
|
||||
* return a string. The function will be called when
|
||||
* the output buffer is flushed (sent) or cleaned (with
|
||||
* ob_flush, ob_clean or similar
|
||||
* function) or when the output buffer
|
||||
* is flushed to the browser at the end of the request. When
|
||||
* callback is called, it will receive the
|
||||
* contents of the output buffer as its parameter and is expected to
|
||||
* return a new output buffer as a result, which will be sent to the
|
||||
* browser. If the callback is not a
|
||||
* callable function, this function will return FALSE.
|
||||
* This is the callback signature:
|
||||
*
|
||||
*
|
||||
* stringhandler
|
||||
* stringbuffer
|
||||
* intphase
|
||||
*
|
||||
*
|
||||
*
|
||||
* buffer
|
||||
*
|
||||
*
|
||||
* Contents of the output buffer.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* phase
|
||||
*
|
||||
*
|
||||
* Bitmask of PHP_OUTPUT_HANDLER_* constants.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* If callback returns FALSE original
|
||||
* input is sent to the browser.
|
||||
*
|
||||
* The callback parameter may be bypassed
|
||||
* by passing a NULL value.
|
||||
*
|
||||
* ob_end_clean, ob_end_flush,
|
||||
* ob_clean, ob_flush and
|
||||
* ob_start may not be called from a callback
|
||||
* function. If you call them from callback function, the behavior is
|
||||
* undefined. If you would like to delete the contents of a buffer,
|
||||
* return "" (a null string) from callback function.
|
||||
* You can't even call functions using the output buffering functions like
|
||||
* print_r($expression, true) or
|
||||
* highlight_file($filename, true) from a callback
|
||||
* function.
|
||||
*
|
||||
* ob_gzhandler function exists to
|
||||
* facilitate sending gz-encoded data to web browsers that support
|
||||
* compressed web pages. ob_gzhandler determines
|
||||
* what type of content encoding the browser will accept and will return
|
||||
* its output accordingly.
|
||||
* @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) {
|
||||
$result = \ob_start($callback, $chunk_size, $flags);
|
||||
} elseif ($chunk_size !== 0) {
|
||||
$result = \ob_start($callback, $chunk_size);
|
||||
} elseif ($callback !== null) {
|
||||
$result = \ob_start($callback);
|
||||
} else {
|
||||
$result = \ob_start();
|
||||
}
|
||||
if ($result === false) {
|
||||
throw OutcontrolException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function adds another name/value pair to the URL rewrite mechanism.
|
||||
* The name and value will be added to URLs (as GET parameter) and forms
|
||||
|
||||
207
vendor/thecodingmachine/safe/generated/pcntl.php
vendored
207
vendor/thecodingmachine/safe/generated/pcntl.php
vendored
@@ -4,59 +4,27 @@ namespace Safe;
|
||||
|
||||
use Safe\Exceptions\PcntlException;
|
||||
|
||||
/**
|
||||
* Executes the program with the given arguments.
|
||||
*
|
||||
* @param string $path path must be the path to a binary executable or a
|
||||
* script with a valid path pointing to an executable in the shebang (
|
||||
* #!/usr/local/bin/perl for example) as the first line. See your system's
|
||||
* man execve(2) page for additional information.
|
||||
* @param array $args args is an array of argument strings passed to the
|
||||
* program.
|
||||
* @param array $envs envs is an array of strings which are passed as
|
||||
* environment to the program. The array is in the format of name => value,
|
||||
* the key being the name of the environmental variable and the value being
|
||||
* the value of that variable.
|
||||
* @throws PcntlException
|
||||
*
|
||||
*/
|
||||
function pcntl_exec(string $path, array $args = null, array $envs = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($envs !== null) {
|
||||
$result = \pcntl_exec($path, $args, $envs);
|
||||
} elseif ($args !== null) {
|
||||
$result = \pcntl_exec($path, $args);
|
||||
} else {
|
||||
$result = \pcntl_exec($path);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw PcntlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* pcntl_getpriority gets the priority of
|
||||
* pid. Because priority levels can differ between
|
||||
* process_id. Because priority levels can differ between
|
||||
* system types and kernel versions, please see your system's getpriority(2)
|
||||
* man page for specific details.
|
||||
*
|
||||
* @param int $pid If not specified, the pid of the current process is used.
|
||||
* @param int $process_identifier One of PRIO_PGRP, PRIO_USER
|
||||
* @param int $process_id If NULL, the process id of the current process is used.
|
||||
* @param int $mode One of PRIO_PGRP, PRIO_USER
|
||||
* or PRIO_PROCESS.
|
||||
* @return int pcntl_getpriority returns the priority of the process. A lower numerical value causes more favorable
|
||||
* scheduling.
|
||||
* @throws PcntlException
|
||||
*
|
||||
*/
|
||||
function pcntl_getpriority(int $pid = null, int $process_identifier = PRIO_PROCESS): int
|
||||
function pcntl_getpriority(int $process_id = null, int $mode = PRIO_PROCESS): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($process_identifier !== PRIO_PROCESS) {
|
||||
$result = \pcntl_getpriority($pid, $process_identifier);
|
||||
} elseif ($pid !== null) {
|
||||
$result = \pcntl_getpriority($pid);
|
||||
if ($mode !== PRIO_PROCESS) {
|
||||
$result = \pcntl_getpriority($process_id, $mode);
|
||||
} elseif ($process_id !== null) {
|
||||
$result = \pcntl_getpriority($process_id);
|
||||
} else {
|
||||
$result = \pcntl_getpriority();
|
||||
}
|
||||
@@ -69,7 +37,7 @@ function pcntl_getpriority(int $pid = null, int $process_identifier = PRIO_PROCE
|
||||
|
||||
/**
|
||||
* pcntl_setpriority sets the priority of
|
||||
* pid.
|
||||
* process_id.
|
||||
*
|
||||
* @param int $priority priority is generally a value in the range
|
||||
* -20 to 20. The default priority
|
||||
@@ -77,19 +45,19 @@ function pcntl_getpriority(int $pid = null, int $process_identifier = PRIO_PROCE
|
||||
* favorable scheduling. Because priority levels can differ between
|
||||
* system types and kernel versions, please see your system's setpriority(2)
|
||||
* man page for specific details.
|
||||
* @param int $pid If not specified, the pid of the current process is used.
|
||||
* @param int $process_identifier One of PRIO_PGRP, PRIO_USER
|
||||
* @param int $process_id If NULL, the process id of the current process is used.
|
||||
* @param int $mode One of PRIO_PGRP, PRIO_USER
|
||||
* or PRIO_PROCESS.
|
||||
* @throws PcntlException
|
||||
*
|
||||
*/
|
||||
function pcntl_setpriority(int $priority, int $pid = null, int $process_identifier = PRIO_PROCESS): void
|
||||
function pcntl_setpriority(int $priority, int $process_id = null, int $mode = PRIO_PROCESS): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($process_identifier !== PRIO_PROCESS) {
|
||||
$result = \pcntl_setpriority($priority, $pid, $process_identifier);
|
||||
} elseif ($pid !== null) {
|
||||
$result = \pcntl_setpriority($priority, $pid);
|
||||
if ($mode !== PRIO_PROCESS) {
|
||||
$result = \pcntl_setpriority($priority, $process_id, $mode);
|
||||
} elseif ($process_id !== null) {
|
||||
$result = \pcntl_setpriority($priority, $process_id);
|
||||
} else {
|
||||
$result = \pcntl_setpriority($priority);
|
||||
}
|
||||
@@ -118,10 +86,65 @@ function pcntl_signal_dispatch(): void
|
||||
|
||||
|
||||
/**
|
||||
* The pcntl_sigprocmask function adds, removes or sets blocked
|
||||
* signals, depending on the how parameter.
|
||||
* The pcntl_signal function installs a new
|
||||
* signal handler or replaces the current signal handler for the signal indicated by signal.
|
||||
*
|
||||
* @param int $how Sets the behavior of pcntl_sigprocmask. Possible
|
||||
* @param int $signal The signal number.
|
||||
* @param callable|int $handler The signal handler. This may be either a callable, which
|
||||
* will be invoked to handle the signal, or either of the two global
|
||||
* constants SIG_IGN or SIG_DFL,
|
||||
* which will ignore the signal or restore the default signal handler
|
||||
* respectively.
|
||||
*
|
||||
* If a callable is given, it must implement the following
|
||||
* signature:
|
||||
*
|
||||
*
|
||||
* voidhandler
|
||||
* intsigno
|
||||
* mixedsiginfo
|
||||
*
|
||||
*
|
||||
*
|
||||
* signal
|
||||
*
|
||||
*
|
||||
* The signal being handled.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* siginfo
|
||||
*
|
||||
*
|
||||
* If operating systems supports siginfo_t structures, this will be an array of signal information dependent on the signal.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Note that when you set a handler to an object method, that object's
|
||||
* reference count is increased which makes it persist until you either
|
||||
* change the handler to something else, or your script ends.
|
||||
* @param bool $restart_syscalls
|
||||
* @throws PcntlException
|
||||
*
|
||||
*/
|
||||
function pcntl_signal(int $signal, $handler, bool $restart_syscalls = true): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \pcntl_signal($signal, $handler, $restart_syscalls);
|
||||
if ($result === false) {
|
||||
throw PcntlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The pcntl_sigprocmask function adds, removes or sets blocked
|
||||
* signals, depending on the mode parameter.
|
||||
*
|
||||
* @param int $mode Sets the behavior of pcntl_sigprocmask. Possible
|
||||
* values:
|
||||
*
|
||||
* SIG_BLOCK: Add the signals to the
|
||||
@@ -131,16 +154,16 @@ function pcntl_signal_dispatch(): void
|
||||
* SIG_SETMASK: Replace the currently
|
||||
* blocked signals by the given list of signals.
|
||||
*
|
||||
* @param array $set List of signals.
|
||||
* @param array|null $oldset The oldset parameter is set to an array
|
||||
* @param array $signals List of signals.
|
||||
* @param array|null $old_signals The old_signals parameter is set to an array
|
||||
* containing the list of the previously blocked signals.
|
||||
* @throws PcntlException
|
||||
*
|
||||
*/
|
||||
function pcntl_sigprocmask(int $how, array $set, ?array &$oldset = null): void
|
||||
function pcntl_sigprocmask(int $mode, array $signals, ?array &$old_signals = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \pcntl_sigprocmask($how, $set, $oldset);
|
||||
$result = \pcntl_sigprocmask($mode, $signals, $old_signals);
|
||||
if ($result === false) {
|
||||
throw PcntlException::createFromPhpError();
|
||||
}
|
||||
@@ -148,17 +171,81 @@ function pcntl_sigprocmask(int $how, array $set, ?array &$oldset = null): void
|
||||
|
||||
|
||||
/**
|
||||
* The pcntl_sigtimedwait function operates in exactly
|
||||
* the same way as pcntl_sigwaitinfo except that it takes
|
||||
* two additional parameters, seconds and
|
||||
* nanoseconds, which enable an upper bound to be placed
|
||||
* on the time for which the script is suspended.
|
||||
*
|
||||
*
|
||||
* @param int $errno
|
||||
* @return string Returns error description on success.
|
||||
* @param array $signals Array of signals to wait for.
|
||||
* @param array|null $info The info is set to an array containing
|
||||
* information about the signal. See
|
||||
* pcntl_sigwaitinfo.
|
||||
* @param int $seconds Timeout in seconds.
|
||||
* @param int $nanoseconds Timeout in nanoseconds.
|
||||
* @return int pcntl_sigtimedwait returns a signal number on success.
|
||||
* @throws PcntlException
|
||||
*
|
||||
*/
|
||||
function pcntl_strerror(int $errno): string
|
||||
function pcntl_sigtimedwait(array $signals, ?array &$info = [], int $seconds = 0, int $nanoseconds = 0): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \pcntl_strerror($errno);
|
||||
$result = \pcntl_sigtimedwait($signals, $info, $seconds, $nanoseconds);
|
||||
if ($result === false) {
|
||||
throw PcntlException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The pcntl_sigwaitinfo function suspends execution of the
|
||||
* calling script until one of the signals given in signals
|
||||
* are delivered. If one of the signal is already pending (e.g. blocked by
|
||||
* pcntl_sigprocmask),
|
||||
* pcntl_sigwaitinfo will return immediately.
|
||||
*
|
||||
* @param array $signals Array of signals to wait for.
|
||||
* @param array|null $info The info parameter is set to an array containing
|
||||
* information about the signal.
|
||||
*
|
||||
* The following elements are set for all signals:
|
||||
*
|
||||
* signo: Signal number
|
||||
* errno: An error number
|
||||
* code: Signal code
|
||||
*
|
||||
*
|
||||
* The following elements may be set for the SIGCHLD signal:
|
||||
*
|
||||
* status: Exit value or signal
|
||||
* utime: User time consumed
|
||||
* stime: System time consumed
|
||||
* pid: Sending process ID
|
||||
* uid: Real user ID of sending process
|
||||
*
|
||||
*
|
||||
* The following elements may be set for the SIGILL,
|
||||
* SIGFPE, SIGSEGV and
|
||||
* SIGBUS signals:
|
||||
*
|
||||
* addr: Memory location which caused fault
|
||||
*
|
||||
*
|
||||
* The following element may be set for the SIGPOLL
|
||||
* signal:
|
||||
*
|
||||
* band: Band event
|
||||
* fd: File descriptor number
|
||||
*
|
||||
* @return int Returns a signal number on success.
|
||||
* @throws PcntlException
|
||||
*
|
||||
*/
|
||||
function pcntl_sigwaitinfo(array $signals, ?array &$info = []): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \pcntl_sigwaitinfo($signals, $info);
|
||||
if ($result === false) {
|
||||
throw PcntlException::createFromPhpError();
|
||||
}
|
||||
|
||||
36
vendor/thecodingmachine/safe/generated/pcre.php
vendored
36
vendor/thecodingmachine/safe/generated/pcre.php
vendored
@@ -4,6 +4,32 @@ namespace Safe;
|
||||
|
||||
use Safe\Exceptions\PcreException;
|
||||
|
||||
/**
|
||||
* Returns the array consisting of the elements of the
|
||||
* array array that match the given
|
||||
* pattern.
|
||||
*
|
||||
* @param string $pattern The pattern to search for, as a string.
|
||||
* @param array $array The input array.
|
||||
* @param int $flags If set to PREG_GREP_INVERT, this function returns
|
||||
* the elements of the input array that do not match
|
||||
* the given pattern.
|
||||
* @return array Returns an array indexed using the keys from the
|
||||
* array array.
|
||||
* @throws PcreException
|
||||
*
|
||||
*/
|
||||
function preg_grep(string $pattern, array $array, int $flags = 0): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \preg_grep($pattern, $array, $flags);
|
||||
if ($result === false) {
|
||||
throw PcreException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Searches subject for all matches to the regular
|
||||
* expression given in pattern and puts them in
|
||||
@@ -15,7 +41,7 @@ use Safe\Exceptions\PcreException;
|
||||
*
|
||||
* @param string $pattern The pattern to search for, as a string.
|
||||
* @param string $subject The input string.
|
||||
* @param array $matches Array of all matches in multi-dimensional array ordered according to
|
||||
* @param array|null $matches Array of all matches in multi-dimensional array ordered according to
|
||||
* flags.
|
||||
* @param int $flags Can be a combination of the following flags (note that it doesn't make
|
||||
* sense to use PREG_PATTERN_ORDER together with
|
||||
@@ -343,11 +369,11 @@ use Safe\Exceptions\PcreException;
|
||||
*
|
||||
*
|
||||
* The above example will output:
|
||||
* @return int Returns the number of full pattern matches (which might be zero).
|
||||
* @return int|null Returns the number of full pattern matches (which might be zero).
|
||||
* @throws PcreException
|
||||
*
|
||||
*/
|
||||
function preg_match_all(string $pattern, string $subject, array &$matches = null, int $flags = PREG_PATTERN_ORDER, int $offset = 0): int
|
||||
function preg_match_all(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): ?int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \preg_match_all($pattern, $subject, $matches, $flags, $offset);
|
||||
@@ -364,7 +390,7 @@ function preg_match_all(string $pattern, string $subject, array &$matches = null
|
||||
*
|
||||
* @param string $pattern The pattern to search for, as a string.
|
||||
* @param string $subject The input string.
|
||||
* @param array $matches If matches is provided, then it is filled with
|
||||
* @param string[]|null $matches If matches is provided, then it is filled with
|
||||
* the results of search. $matches[0] will contain the
|
||||
* text that matched the full pattern, $matches[1]
|
||||
* will have the text that matched the first captured parenthesized
|
||||
@@ -584,7 +610,7 @@ function preg_match_all(string $pattern, string $subject, array &$matches = null
|
||||
* @throws PcreException
|
||||
*
|
||||
*/
|
||||
function preg_match(string $pattern, string $subject, array &$matches = null, int $flags = 0, int $offset = 0): int
|
||||
function preg_match(string $pattern, string $subject, ?iterable &$matches = null, int $flags = 0, int $offset = 0): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \preg_match($pattern, $subject, $matches, $flags, $offset);
|
||||
|
||||
1553
vendor/thecodingmachine/safe/generated/pdf.php
vendored
1553
vendor/thecodingmachine/safe/generated/pdf.php
vendored
File diff suppressed because it is too large
Load Diff
988
vendor/thecodingmachine/safe/generated/pgsql.php
vendored
988
vendor/thecodingmachine/safe/generated/pgsql.php
vendored
File diff suppressed because it is too large
Load Diff
504
vendor/thecodingmachine/safe/generated/posix.php
vendored
504
vendor/thecodingmachine/safe/generated/posix.php
vendored
@@ -7,8 +7,8 @@ use Safe\Exceptions\PosixException;
|
||||
/**
|
||||
* posix_access checks the user's permission of a file.
|
||||
*
|
||||
* @param string $file The name of the file to be tested.
|
||||
* @param int $mode A mask consisting of one or more of POSIX_F_OK,
|
||||
* @param string $filename The name of the file to be tested.
|
||||
* @param int $flags A mask consisting of one or more of POSIX_F_OK,
|
||||
* POSIX_R_OK, POSIX_W_OK and
|
||||
* POSIX_X_OK.
|
||||
*
|
||||
@@ -20,16 +20,80 @@ use Safe\Exceptions\PosixException;
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_access(string $file, int $mode = POSIX_F_OK): void
|
||||
function posix_access(string $filename, int $flags = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \posix_access($file, $mode);
|
||||
$result = \posix_access($filename, $flags);
|
||||
if ($result === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets information about a group provided its id.
|
||||
*
|
||||
* @param int $group_id The group id.
|
||||
* @return array The array elements returned are:
|
||||
*
|
||||
* The group information array
|
||||
*
|
||||
*
|
||||
*
|
||||
* Element
|
||||
* Description
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* name
|
||||
*
|
||||
* The name element contains the name of the group. This is
|
||||
* a short, usually less than 16 character "handle" of the
|
||||
* group, not the real, full name.
|
||||
*
|
||||
*
|
||||
*
|
||||
* passwd
|
||||
*
|
||||
* The passwd element contains the group's password in an
|
||||
* encrypted format. Often, for example on a system employing
|
||||
* "shadow" passwords, an asterisk is returned instead.
|
||||
*
|
||||
*
|
||||
*
|
||||
* gid
|
||||
*
|
||||
* Group ID, should be the same as the
|
||||
* group_id parameter used when calling the
|
||||
* function, and hence redundant.
|
||||
*
|
||||
*
|
||||
*
|
||||
* members
|
||||
*
|
||||
* This consists of an array of
|
||||
* string's for all the members in the group.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* The function returns FALSE on failure.
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_getgrgid(int $group_id): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \posix_getgrgid($group_id);
|
||||
if ($result === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets information about a group provided its name.
|
||||
*
|
||||
@@ -95,18 +159,260 @@ function posix_getgrnam(string $name): array
|
||||
|
||||
|
||||
/**
|
||||
* Returns the process group identifier of the process
|
||||
* pid.
|
||||
* Gets the group set of the current process.
|
||||
*
|
||||
* @param int $pid The process id.
|
||||
* @return int Returns the identifier, as an integer.
|
||||
* @return array Returns an array of integers containing the numeric group ids of the group
|
||||
* set of the current process.
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_getpgid(int $pid): int
|
||||
function posix_getgroups(): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \posix_getpgid($pid);
|
||||
$result = \posix_getgroups();
|
||||
if ($result === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the login name of the user owning the current process.
|
||||
*
|
||||
* @return string Returns the login name of the user, as a string.
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_getlogin(): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \posix_getlogin();
|
||||
if ($result === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns an array of information about the user
|
||||
* referenced by the given user ID.
|
||||
*
|
||||
* @param int $user_id The user identifier.
|
||||
* @return array Returns an associative array with the following elements:
|
||||
*
|
||||
* The user information array
|
||||
*
|
||||
*
|
||||
*
|
||||
* Element
|
||||
* Description
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* name
|
||||
*
|
||||
* The name element contains the username of the user. This is
|
||||
* a short, usually less than 16 character "handle" of the
|
||||
* user, not the real, full name.
|
||||
*
|
||||
*
|
||||
*
|
||||
* passwd
|
||||
*
|
||||
* The passwd element contains the user's password in an
|
||||
* encrypted format. Often, for example on a system employing
|
||||
* "shadow" passwords, an asterisk is returned instead.
|
||||
*
|
||||
*
|
||||
*
|
||||
* uid
|
||||
*
|
||||
* User ID, should be the same as the
|
||||
* user_id parameter used when calling the
|
||||
* function, and hence redundant.
|
||||
*
|
||||
*
|
||||
*
|
||||
* gid
|
||||
*
|
||||
* The group ID of the user. Use the function
|
||||
* posix_getgrgid to resolve the group
|
||||
* name and a list of its members.
|
||||
*
|
||||
*
|
||||
*
|
||||
* gecos
|
||||
*
|
||||
* GECOS is an obsolete term that refers to the finger
|
||||
* information field on a Honeywell batch processing system.
|
||||
* The field, however, lives on, and its contents have been
|
||||
* formalized by POSIX. The field contains a comma separated
|
||||
* list containing the user's full name, office phone, office
|
||||
* number, and home phone number. On most systems, only the
|
||||
* user's full name is available.
|
||||
*
|
||||
*
|
||||
*
|
||||
* dir
|
||||
*
|
||||
* This element contains the absolute path to the
|
||||
* home directory of the user.
|
||||
*
|
||||
*
|
||||
*
|
||||
* shell
|
||||
*
|
||||
* The shell element contains the absolute path to the
|
||||
* executable of the user's default shell.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* The function returns FALSE on failure.
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_getpwuid(int $user_id): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \posix_getpwuid($user_id);
|
||||
if ($result === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* posix_getrlimit returns an array
|
||||
* of information about the current resource's soft and hard limits.
|
||||
*
|
||||
*
|
||||
* Each resource has an associated soft and hard limit. The soft
|
||||
* limit is the value that the kernel enforces for the corresponding
|
||||
* resource. The hard limit acts as a ceiling for the soft limit.
|
||||
* An unprivileged process may only set its soft limit to a value
|
||||
* from 0 to the hard limit, and irreversibly lower its hard limit.
|
||||
*
|
||||
* @return array Returns an associative array of elements for each
|
||||
* limit that is defined. Each limit has a soft and a hard limit.
|
||||
*
|
||||
* List of possible limits returned
|
||||
*
|
||||
*
|
||||
*
|
||||
* Limit name
|
||||
* Limit description
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* core
|
||||
*
|
||||
* The maximum size of the core file. When 0, not core files are
|
||||
* created. When core files are larger than this size, they will
|
||||
* be truncated at this size.
|
||||
*
|
||||
*
|
||||
*
|
||||
* totalmem
|
||||
*
|
||||
* The maximum size of the memory of the process, in bytes.
|
||||
*
|
||||
*
|
||||
*
|
||||
* virtualmem
|
||||
*
|
||||
* The maximum size of the virtual memory for the process, in bytes.
|
||||
*
|
||||
*
|
||||
*
|
||||
* data
|
||||
*
|
||||
* The maximum size of the data segment for the process, in bytes.
|
||||
*
|
||||
*
|
||||
*
|
||||
* stack
|
||||
*
|
||||
* The maximum size of the process stack, in bytes.
|
||||
*
|
||||
*
|
||||
*
|
||||
* rss
|
||||
*
|
||||
* The maximum number of virtual pages resident in RAM
|
||||
*
|
||||
*
|
||||
*
|
||||
* maxproc
|
||||
*
|
||||
* The maximum number of processes that can be created for the
|
||||
* real user ID of the calling process.
|
||||
*
|
||||
*
|
||||
*
|
||||
* memlock
|
||||
*
|
||||
* The maximum number of bytes of memory that may be locked into RAM.
|
||||
*
|
||||
*
|
||||
*
|
||||
* cpu
|
||||
*
|
||||
* The amount of time the process is allowed to use the CPU.
|
||||
*
|
||||
*
|
||||
*
|
||||
* filesize
|
||||
*
|
||||
* The maximum size of the data segment for the process, in bytes.
|
||||
*
|
||||
*
|
||||
*
|
||||
* openfiles
|
||||
*
|
||||
* One more than the maximum number of open file descriptors.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* The function returns FALSE on failure.
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_getrlimit(): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \posix_getrlimit();
|
||||
if ($result === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the session id of the process process_id.
|
||||
* The session id of a process is the process group id of the session leader.
|
||||
*
|
||||
* @param int $process_id The process identifier. If set to 0, the current process is
|
||||
* assumed. If an invalid process_id is
|
||||
* specified, then FALSE is returned and an error is set which
|
||||
* can be checked with posix_get_last_error.
|
||||
* @return int Returns the identifier, as an int.
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_getsid(int $process_id): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \posix_getsid($process_id);
|
||||
if ($result === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
@@ -117,15 +423,15 @@ function posix_getpgid(int $pid): int
|
||||
/**
|
||||
* Calculates the group access list for the user specified in name.
|
||||
*
|
||||
* @param string $name The user to calculate the list for.
|
||||
* @param int $base_group_id Typically the group number from the password file.
|
||||
* @param string $username The user to calculate the list for.
|
||||
* @param int $group_id Typically the group number from the password file.
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_initgroups(string $name, int $base_group_id): void
|
||||
function posix_initgroups(string $username, int $group_id): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \posix_initgroups($name, $base_group_id);
|
||||
$result = \posix_initgroups($username, $group_id);
|
||||
if ($result === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
@@ -133,18 +439,18 @@ function posix_initgroups(string $name, int $base_group_id): void
|
||||
|
||||
|
||||
/**
|
||||
* Send the signal sig to the process with
|
||||
* the process identifier pid.
|
||||
* Send the signal signal to the process with
|
||||
* the process identifier process_id.
|
||||
*
|
||||
* @param int $pid The process identifier.
|
||||
* @param int $sig One of the PCNTL signals constants.
|
||||
* @param int $process_id The process identifier.
|
||||
* @param int $signal One of the PCNTL signals constants.
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_kill(int $pid, int $sig): void
|
||||
function posix_kill(int $process_id, int $signal): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \posix_kill($pid, $sig);
|
||||
$result = \posix_kill($process_id, $signal);
|
||||
if ($result === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
@@ -156,8 +462,8 @@ function posix_kill(int $pid, int $sig): void
|
||||
* FIFO file which exists in the file system and acts as
|
||||
* a bidirectional communication endpoint for processes.
|
||||
*
|
||||
* @param string $pathname Path to the FIFO file.
|
||||
* @param int $mode The second parameter mode has to be given in
|
||||
* @param string $filename Path to the FIFO file.
|
||||
* @param int $permissions The second parameter permissions has to be given in
|
||||
* octal notation (e.g. 0644). The permission of the newly created
|
||||
* FIFO also depends on the setting of the current
|
||||
* umask. The permissions of the created file are
|
||||
@@ -165,10 +471,10 @@ function posix_kill(int $pid, int $sig): void
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_mkfifo(string $pathname, int $mode): void
|
||||
function posix_mkfifo(string $filename, int $permissions): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \posix_mkfifo($pathname, $mode);
|
||||
$result = \posix_mkfifo($filename, $permissions);
|
||||
if ($result === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
@@ -178,8 +484,8 @@ function posix_mkfifo(string $pathname, int $mode): void
|
||||
/**
|
||||
* Creates a special or ordinary file.
|
||||
*
|
||||
* @param string $pathname The file to create
|
||||
* @param int $mode This parameter is constructed by a bitwise OR between file type (one of
|
||||
* @param string $filename The file to create
|
||||
* @param int $flags This parameter is constructed by a bitwise OR between file type (one of
|
||||
* the following constants: POSIX_S_IFREG,
|
||||
* POSIX_S_IFCHR, POSIX_S_IFBLK,
|
||||
* POSIX_S_IFIFO or
|
||||
@@ -190,10 +496,10 @@ function posix_mkfifo(string $pathname, int $mode): void
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_mknod(string $pathname, int $mode, int $major = 0, int $minor = 0): void
|
||||
function posix_mknod(string $filename, int $flags, int $major = 0, int $minor = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \posix_mknod($pathname, $mode, $major, $minor);
|
||||
$result = \posix_mknod($filename, $flags, $major, $minor);
|
||||
if ($result === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
@@ -205,14 +511,14 @@ function posix_mknod(string $pathname, int $mode, int $major = 0, int $minor = 0
|
||||
* privileged function and needs appropriate privileges (usually
|
||||
* root) on the system to be able to perform this function.
|
||||
*
|
||||
* @param int $gid The group id.
|
||||
* @param int $group_id The group id.
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_setegid(int $gid): void
|
||||
function posix_setegid(int $group_id): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \posix_setegid($gid);
|
||||
$result = \posix_setegid($group_id);
|
||||
if ($result === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
@@ -224,14 +530,14 @@ function posix_setegid(int $gid): void
|
||||
* function and needs appropriate privileges (usually root) on
|
||||
* the system to be able to perform this function.
|
||||
*
|
||||
* @param int $uid The user id.
|
||||
* @param int $user_id The user id.
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_seteuid(int $uid): void
|
||||
function posix_seteuid(int $user_id): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \posix_seteuid($uid);
|
||||
$result = \posix_seteuid($user_id);
|
||||
if ($result === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
@@ -246,14 +552,14 @@ function posix_seteuid(int $uid): void
|
||||
* posix_setgid first,
|
||||
* posix_setuid last.
|
||||
*
|
||||
* @param int $gid The group id.
|
||||
* @param int $group_id The group id.
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_setgid(int $gid): void
|
||||
function posix_setgid(int $group_id): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \posix_setgid($gid);
|
||||
$result = \posix_setgid($group_id);
|
||||
if ($result === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
@@ -261,18 +567,18 @@ function posix_setgid(int $gid): void
|
||||
|
||||
|
||||
/**
|
||||
* Let the process pid join the process group
|
||||
* pgid.
|
||||
* Let the process process_id join the process group
|
||||
* process_group_id.
|
||||
*
|
||||
* @param int $pid The process id.
|
||||
* @param int $pgid The process group id.
|
||||
* @param int $process_id The process id.
|
||||
* @param int $process_group_id The process group id.
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_setpgid(int $pid, int $pgid): void
|
||||
function posix_setpgid(int $process_id, int $process_group_id): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \posix_setpgid($pid, $pgid);
|
||||
$result = \posix_setpgid($process_id, $process_group_id);
|
||||
if ($result === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
@@ -293,17 +599,17 @@ function posix_setpgid(int $pid, int $pgid): void
|
||||
* @param int $resource The
|
||||
* resource limit constant
|
||||
* corresponding to the limit that is being set.
|
||||
* @param int $softlimit The soft limit, in whatever unit the resource limit requires, or
|
||||
* @param int $soft_limit The soft limit, in whatever unit the resource limit requires, or
|
||||
* POSIX_RLIMIT_INFINITY.
|
||||
* @param int $hardlimit The hard limit, in whatever unit the resource limit requires, or
|
||||
* @param int $hard_limit The hard limit, in whatever unit the resource limit requires, or
|
||||
* POSIX_RLIMIT_INFINITY.
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_setrlimit(int $resource, int $softlimit, int $hardlimit): void
|
||||
function posix_setrlimit(int $resource, int $soft_limit, int $hard_limit): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \posix_setrlimit($resource, $softlimit, $hardlimit);
|
||||
$result = \posix_setrlimit($resource, $soft_limit, $hard_limit);
|
||||
if ($result === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
@@ -315,15 +621,113 @@ function posix_setrlimit(int $resource, int $softlimit, int $hardlimit): void
|
||||
* function that needs appropriate privileges (usually root) on
|
||||
* the system to be able to perform this function.
|
||||
*
|
||||
* @param int $uid The user id.
|
||||
* @param int $user_id The user id.
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_setuid(int $uid): void
|
||||
function posix_setuid(int $user_id): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \posix_setuid($uid);
|
||||
$result = \posix_setuid($user_id);
|
||||
if ($result === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets information about the current CPU usage.
|
||||
*
|
||||
* @return array Returns a hash of strings with information about the current
|
||||
* process CPU usage. The indices of the hash are:
|
||||
*
|
||||
*
|
||||
*
|
||||
* ticks - the number of clock ticks that have elapsed since
|
||||
* reboot.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* utime - user time used by the current process.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* stime - system time used by the current process.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* cutime - user time used by current process and children.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* cstime - system time used by current process and children.
|
||||
*
|
||||
*
|
||||
*
|
||||
* The function returns FALSE on failure.
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_times(): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \posix_times();
|
||||
if ($result === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets information about the system.
|
||||
*
|
||||
* Posix requires that assumptions must not be made about the
|
||||
* format of the values, e.g. the assumption that a release may contain
|
||||
* three digits or anything else returned by this function.
|
||||
*
|
||||
* @return array Returns a hash of strings with information about the
|
||||
* system. The indices of the hash are
|
||||
*
|
||||
*
|
||||
* sysname - operating system name (e.g. Linux)
|
||||
*
|
||||
*
|
||||
* nodename - system name (e.g. valiant)
|
||||
*
|
||||
*
|
||||
* release - operating system release (e.g. 2.2.10)
|
||||
*
|
||||
*
|
||||
* version - operating system version (e.g. #4 Tue Jul 20
|
||||
* 17:01:36 MEST 1999)
|
||||
*
|
||||
*
|
||||
* machine - system architecture (e.g. i586)
|
||||
*
|
||||
*
|
||||
* domainname - DNS domainname (e.g. example.com)
|
||||
*
|
||||
*
|
||||
*
|
||||
* domainname is a GNU extension and not part of POSIX.1, so this
|
||||
* field is only available on GNU systems or when using the GNU
|
||||
* libc.
|
||||
*
|
||||
* The function returns FALSE on failure.
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_uname(): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \posix_uname();
|
||||
if ($result === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -558,7 +558,7 @@ function ps_delete($psdoc): void
|
||||
* Ends a page which was started with ps_begin_page.
|
||||
* Ending a page will leave the current drawing context, which e.g. requires
|
||||
* to reload fonts if they were loading within the page, and to set many
|
||||
* other drawing parameters like the line width, or color..
|
||||
* other drawing parameters like the line width, or color.
|
||||
*
|
||||
* @param resource $psdoc Resource identifier of the postscript file
|
||||
* as returned by ps_new.
|
||||
|
||||
194
vendor/thecodingmachine/safe/generated/pspell.php
vendored
194
vendor/thecodingmachine/safe/generated/pspell.php
vendored
@@ -7,15 +7,15 @@ use Safe\Exceptions\PspellException;
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param int $dictionary_link
|
||||
* @param int $dictionary An PSpell\Dictionary instance.
|
||||
* @param string $word The added word.
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_add_to_personal(int $dictionary_link, string $word): void
|
||||
function pspell_add_to_personal(int $dictionary, string $word): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \pspell_add_to_personal($dictionary_link, $word);
|
||||
$result = \pspell_add_to_personal($dictionary, $word);
|
||||
if ($result === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
@@ -25,15 +25,15 @@ function pspell_add_to_personal(int $dictionary_link, string $word): void
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param int $dictionary_link
|
||||
* @param int $dictionary An PSpell\Dictionary instance.
|
||||
* @param string $word The added word.
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_add_to_session(int $dictionary_link, string $word): void
|
||||
function pspell_add_to_session(int $dictionary, string $word): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \pspell_add_to_session($dictionary_link, $word);
|
||||
$result = \pspell_add_to_session($dictionary, $word);
|
||||
if ($result === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
@@ -43,14 +43,14 @@ function pspell_add_to_session(int $dictionary_link, string $word): void
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param int $dictionary_link
|
||||
* @param int $dictionary An PSpell\Dictionary instance.
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_clear_session(int $dictionary_link): void
|
||||
function pspell_clear_session(int $dictionary): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \pspell_clear_session($dictionary_link);
|
||||
$result = \pspell_clear_session($dictionary);
|
||||
if ($result === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
@@ -86,22 +86,14 @@ function pspell_clear_session(int $dictionary_link): void
|
||||
* 'viscii', 'cp1252', 'machine unsigned 16', 'machine unsigned
|
||||
* 32'. This parameter is largely untested, so be careful when
|
||||
* using.
|
||||
* @return int Returns a pspell config identifier.
|
||||
* @return int Returns an PSpell\Config instance on success.
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_config_create(string $language, string $spelling = null, string $jargon = null, string $encoding = null): int
|
||||
function pspell_config_create(string $language, string $spelling = "", string $jargon = "", string $encoding = ""): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($encoding !== null) {
|
||||
$result = \pspell_config_create($language, $spelling, $jargon, $encoding);
|
||||
} elseif ($jargon !== null) {
|
||||
$result = \pspell_config_create($language, $spelling, $jargon);
|
||||
} elseif ($spelling !== null) {
|
||||
$result = \pspell_config_create($language, $spelling);
|
||||
} else {
|
||||
$result = \pspell_config_create($language);
|
||||
}
|
||||
$result = \pspell_config_create($language, $spelling, $jargon, $encoding);
|
||||
if ($result === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
@@ -114,15 +106,15 @@ function pspell_config_create(string $language, string $spelling = null, string
|
||||
* currently not documented; only its argument list is available.
|
||||
*
|
||||
*
|
||||
* @param int $conf
|
||||
* @param int $config
|
||||
* @param string $directory
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_config_data_dir(int $conf, string $directory): void
|
||||
function pspell_config_data_dir(int $config, string $directory): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \pspell_config_data_dir($conf, $directory);
|
||||
$result = \pspell_config_data_dir($config, $directory);
|
||||
if ($result === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
@@ -134,15 +126,15 @@ function pspell_config_data_dir(int $conf, string $directory): void
|
||||
* currently not documented; only its argument list is available.
|
||||
*
|
||||
*
|
||||
* @param int $conf
|
||||
* @param int $config
|
||||
* @param string $directory
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_config_dict_dir(int $conf, string $directory): void
|
||||
function pspell_config_dict_dir(int $config, string $directory): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \pspell_config_dict_dir($conf, $directory);
|
||||
$result = \pspell_config_dict_dir($config, $directory);
|
||||
if ($result === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
@@ -152,15 +144,15 @@ function pspell_config_dict_dir(int $conf, string $directory): void
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param int $dictionary_link
|
||||
* @param int $n Words less than n characters will be skipped.
|
||||
* @param int $config An PSpell\Config instance.
|
||||
* @param int $min_length Words less than min_length characters will be skipped.
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_config_ignore(int $dictionary_link, int $n): void
|
||||
function pspell_config_ignore(int $config, int $min_length): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \pspell_config_ignore($dictionary_link, $n);
|
||||
$result = \pspell_config_ignore($config, $min_length);
|
||||
if ($result === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
@@ -170,7 +162,7 @@ function pspell_config_ignore(int $dictionary_link, int $n): void
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param int $dictionary_link
|
||||
* @param int $config An PSpell\Config instance.
|
||||
* @param int $mode The mode parameter is the mode in which spellchecker will work.
|
||||
* There are several modes available:
|
||||
*
|
||||
@@ -195,10 +187,10 @@ function pspell_config_ignore(int $dictionary_link, int $n): void
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_config_mode(int $dictionary_link, int $mode): void
|
||||
function pspell_config_mode(int $config, int $mode): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \pspell_config_mode($dictionary_link, $mode);
|
||||
$result = \pspell_config_mode($config, $mode);
|
||||
if ($result === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
@@ -214,16 +206,16 @@ function pspell_config_mode(int $dictionary_link, int $mode): void
|
||||
* pspell_config_personal should be used on a config
|
||||
* before calling pspell_new_config.
|
||||
*
|
||||
* @param int $dictionary_link
|
||||
* @param string $file The personal wordlist. If the file does not exist, it will be created.
|
||||
* @param int $config An PSpell\Config instance.
|
||||
* @param string $filename The personal wordlist. If the file does not exist, it will be created.
|
||||
* The file should be writable by whoever PHP runs as (e.g. nobody).
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_config_personal(int $dictionary_link, string $file): void
|
||||
function pspell_config_personal(int $config, string $filename): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \pspell_config_personal($dictionary_link, $file);
|
||||
$result = \pspell_config_personal($config, $filename);
|
||||
if ($result === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
@@ -242,15 +234,15 @@ function pspell_config_personal(int $dictionary_link, string $file): void
|
||||
* pspell_config_repl should be used on a config
|
||||
* before calling pspell_new_config.
|
||||
*
|
||||
* @param int $dictionary_link
|
||||
* @param string $file The file should be writable by whoever PHP runs as (e.g. nobody).
|
||||
* @param int $config An PSpell\Config instance.
|
||||
* @param string $filename The file should be writable by whoever PHP runs as (e.g. nobody).
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_config_repl(int $dictionary_link, string $file): void
|
||||
function pspell_config_repl(int $config, string $filename): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \pspell_config_repl($dictionary_link, $file);
|
||||
$result = \pspell_config_repl($config, $filename);
|
||||
if ($result === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
@@ -267,16 +259,16 @@ function pspell_config_repl(int $dictionary_link, string $file): void
|
||||
* pspell_config_runtogether should be used on a config
|
||||
* before calling pspell_new_config.
|
||||
*
|
||||
* @param int $dictionary_link
|
||||
* @param bool $flag TRUE if run-together words should be treated as legal compounds,
|
||||
* @param int $config An PSpell\Config instance.
|
||||
* @param bool $allow TRUE if run-together words should be treated as legal compounds,
|
||||
* FALSE otherwise.
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_config_runtogether(int $dictionary_link, bool $flag): void
|
||||
function pspell_config_runtogether(int $config, bool $allow): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \pspell_config_runtogether($dictionary_link, $flag);
|
||||
$result = \pspell_config_runtogether($config, $allow);
|
||||
if ($result === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
@@ -295,15 +287,15 @@ function pspell_config_runtogether(int $dictionary_link, bool $flag): void
|
||||
* pspell_config_save_repl should be used on a config
|
||||
* before calling pspell_new_config.
|
||||
*
|
||||
* @param int $dictionary_link
|
||||
* @param bool $flag TRUE if replacement pairs should be saved, FALSE otherwise.
|
||||
* @param int $config An PSpell\Config instance.
|
||||
* @param bool $save TRUE if replacement pairs should be saved, FALSE otherwise.
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_config_save_repl(int $dictionary_link, bool $flag): void
|
||||
function pspell_config_save_repl(int $config, bool $save): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \pspell_config_save_repl($dictionary_link, $flag);
|
||||
$result = \pspell_config_save_repl($config, $save);
|
||||
if ($result === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
@@ -315,7 +307,7 @@ function pspell_config_save_repl(int $dictionary_link, bool $flag): void
|
||||
*
|
||||
* @param int $config The config parameter is the one returned by
|
||||
* pspell_config_create when the config was created.
|
||||
* @return int Returns a dictionary link identifier on success.
|
||||
* @return int Returns an PSpell\Dictionary instance on success
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
@@ -330,9 +322,79 @@ function pspell_new_config(int $config): int
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* For more information and examples, check out inline manual pspell
|
||||
* website:http://aspell.net/.
|
||||
*
|
||||
* @param string $filename The file where words added to the personal list will be stored.
|
||||
* It should be an absolute filename beginning with '/' because otherwise
|
||||
* it will be relative to $HOME, which is "/root" for most systems, and
|
||||
* is probably not what you want.
|
||||
* @param string $language The language code which consists of the two letter ISO 639 language
|
||||
* code and an optional two letter ISO 3166 country code after a dash
|
||||
* or underscore.
|
||||
* @param string $spelling The requested spelling for languages with more than one spelling such
|
||||
* as English. Known values are 'american', 'british', and 'canadian'.
|
||||
* @param string $jargon Extra information to distinguish two different words lists that have
|
||||
* the same language and spelling parameters.
|
||||
* @param string $encoding The encoding that words are expected to be in. Valid values are
|
||||
* utf-8, iso8859-*,
|
||||
* koi8-r, viscii,
|
||||
* cp1252, machine unsigned 16,
|
||||
* machine unsigned 32.
|
||||
* @param int $mode The mode in which spellchecker will work. There are several modes available:
|
||||
*
|
||||
*
|
||||
*
|
||||
* PSPELL_FAST - Fast mode (least number of
|
||||
* suggestions)
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* PSPELL_NORMAL - Normal mode (more suggestions)
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* PSPELL_BAD_SPELLERS - Slow mode (a lot of
|
||||
* suggestions)
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* PSPELL_RUN_TOGETHER - Consider run-together words
|
||||
* as legal compounds. That is, "thecat" will be a legal compound,
|
||||
* although there should be a space between the two words. Changing this
|
||||
* setting only affects the results returned by
|
||||
* pspell_check; pspell_suggest
|
||||
* will still return suggestions.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Mode is a bitmask constructed from different constants listed above.
|
||||
* However, PSPELL_FAST,
|
||||
* PSPELL_NORMAL and
|
||||
* PSPELL_BAD_SPELLERS are mutually exclusive, so you
|
||||
* should select only one of them.
|
||||
* @return int Returns an PSpell\Dictionary instance on success.
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_new_personal(string $filename, string $language, string $spelling = "", string $jargon = "", string $encoding = "", int $mode = 0): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \pspell_new_personal($filename, $language, $spelling, $jargon, $encoding, $mode);
|
||||
if ($result === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* pspell_new opens up a new dictionary and
|
||||
* returns the dictionary link identifier for use in other pspell
|
||||
* returns an PSpell\Dictionary instance for use in other pspell
|
||||
* functions.
|
||||
*
|
||||
* For more information and examples, check out inline manual pspell
|
||||
@@ -388,24 +450,14 @@ function pspell_new_config(int $config): int
|
||||
* PSPELL_NORMAL and
|
||||
* PSPELL_BAD_SPELLERS are mutually exclusive, so you
|
||||
* should select only one of them.
|
||||
* @return int Returns the dictionary link identifier on success.
|
||||
* @return int Returns an PSpell\Dictionary instance on success.
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_new(string $language, string $spelling = null, string $jargon = null, string $encoding = null, int $mode = 0): int
|
||||
function pspell_new(string $language, string $spelling = "", string $jargon = "", string $encoding = "", int $mode = 0): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($mode !== 0) {
|
||||
$result = \pspell_new($language, $spelling, $jargon, $encoding, $mode);
|
||||
} elseif ($encoding !== null) {
|
||||
$result = \pspell_new($language, $spelling, $jargon, $encoding);
|
||||
} elseif ($jargon !== null) {
|
||||
$result = \pspell_new($language, $spelling, $jargon);
|
||||
} elseif ($spelling !== null) {
|
||||
$result = \pspell_new($language, $spelling);
|
||||
} else {
|
||||
$result = \pspell_new($language);
|
||||
}
|
||||
$result = \pspell_new($language, $spelling, $jargon, $encoding, $mode);
|
||||
if ($result === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
@@ -416,15 +468,14 @@ function pspell_new(string $language, string $spelling = null, string $jargon =
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param int $dictionary_link A dictionary link identifier opened with
|
||||
* pspell_new_personal.
|
||||
* @param int $dictionary An PSpell\Dictionary instance.
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_save_wordlist(int $dictionary_link): void
|
||||
function pspell_save_wordlist(int $dictionary): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \pspell_save_wordlist($dictionary_link);
|
||||
$result = \pspell_save_wordlist($dictionary);
|
||||
if ($result === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
@@ -434,17 +485,16 @@ function pspell_save_wordlist(int $dictionary_link): void
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param int $dictionary_link A dictionary link identifier, opened with
|
||||
* pspell_new_personal
|
||||
* @param int $dictionary An PSpell\Dictionary instance.
|
||||
* @param string $misspelled The misspelled word.
|
||||
* @param string $correct The fixed spelling for the misspelled word.
|
||||
* @throws PspellException
|
||||
*
|
||||
*/
|
||||
function pspell_store_replacement(int $dictionary_link, string $misspelled, string $correct): void
|
||||
function pspell_store_replacement(int $dictionary, string $misspelled, string $correct): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \pspell_store_replacement($dictionary_link, $misspelled, $correct);
|
||||
$result = \pspell_store_replacement($dictionary, $misspelled, $correct);
|
||||
if ($result === false) {
|
||||
throw PspellException::createFromPhpError();
|
||||
}
|
||||
|
||||
@@ -7,14 +7,14 @@ use Safe\Exceptions\ReadlineException;
|
||||
/**
|
||||
* This function adds a line to the command line history.
|
||||
*
|
||||
* @param string $line The line to be added in the history.
|
||||
* @param string $prompt The line to be added in the history.
|
||||
* @throws ReadlineException
|
||||
*
|
||||
*/
|
||||
function readline_add_history(string $line): void
|
||||
function readline_add_history(string $prompt): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \readline_add_history($line);
|
||||
$result = \readline_add_history($prompt);
|
||||
if ($result === false) {
|
||||
throw ReadlineException::createFromPhpError();
|
||||
}
|
||||
@@ -32,38 +32,6 @@ function readline_add_history(string $line): void
|
||||
* stream_select as it allows interleaving of IO and
|
||||
* user input, unlike readline.
|
||||
*
|
||||
*
|
||||
* Readline Callback Interface Example
|
||||
*
|
||||
* 10) {
|
||||
* $prompting = false;
|
||||
* readline_callback_handler_remove();
|
||||
* } else {
|
||||
* readline_callback_handler_install("[$c] Enter something: ", 'rl_callback');
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* $c = 1;
|
||||
* $prompting = true;
|
||||
*
|
||||
* readline_callback_handler_install("[$c] Enter something: ", 'rl_callback');
|
||||
*
|
||||
* while ($prompting) {
|
||||
* $w = NULL;
|
||||
* $e = NULL;
|
||||
* $n = stream_select($r = array(STDIN), $w, $e, null);
|
||||
* if ($n && in_array(STDIN, $r)) {
|
||||
* // read a character, will call the callback when a newline is entered
|
||||
* readline_callback_read_char();
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* echo "Prompting disabled. All done.\n";
|
||||
* ?>
|
||||
* ]]>
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param string $prompt The prompt message.
|
||||
* @param callable $callback The callback function takes one parameter; the
|
||||
* user input returned.
|
||||
@@ -100,15 +68,15 @@ function readline_clear_history(): void
|
||||
* This function registers a completion function. This is the same kind of
|
||||
* functionality you'd get if you hit your tab key while using Bash.
|
||||
*
|
||||
* @param callable $function You must supply the name of an existing function which accepts a
|
||||
* @param callable $callback You must supply the name of an existing function which accepts a
|
||||
* partial command line and returns an array of possible matches.
|
||||
* @throws ReadlineException
|
||||
*
|
||||
*/
|
||||
function readline_completion_function(callable $function): void
|
||||
function readline_completion_function(callable $callback): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \readline_completion_function($function);
|
||||
$result = \readline_completion_function($callback);
|
||||
if ($result === false) {
|
||||
throw ReadlineException::createFromPhpError();
|
||||
}
|
||||
|
||||
167
vendor/thecodingmachine/safe/generated/rrd.php
vendored
167
vendor/thecodingmachine/safe/generated/rrd.php
vendored
@@ -21,3 +21,170 @@ function rrd_create(string $filename, array $options): void
|
||||
throw RrdException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the first data sample from the specified RRA of the RRD file.
|
||||
*
|
||||
* @param string $file RRD database file name.
|
||||
* @param int $raaindex The index number of the RRA that is to be examined. Default value is 0.
|
||||
* @return int Integer number of unix timestamp.
|
||||
* @throws RrdException
|
||||
*
|
||||
*/
|
||||
function rrd_first(string $file, int $raaindex = 0): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \rrd_first($file, $raaindex);
|
||||
if ($result === false) {
|
||||
throw RrdException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates image for a particular data from RRD file.
|
||||
*
|
||||
* @param string $filename The filename to output the graph to. This will generally end in either
|
||||
* .png, .svg or
|
||||
* .eps, depending on the format you want to output.
|
||||
* @param array $options Options for generating image. See man page of rrd graph for all
|
||||
* possible options. All options (data definitions, variable definitions, etc.)
|
||||
* are allowed.
|
||||
* @return array Array with information about generated image is returned.
|
||||
* @throws RrdException
|
||||
*
|
||||
*/
|
||||
function rrd_graph(string $filename, array $options): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \rrd_graph($filename, $options);
|
||||
if ($result === false) {
|
||||
throw RrdException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns information about particular RRD database file.
|
||||
*
|
||||
* @param string $filename RRD database file name.
|
||||
* @return array Array with information about requested RRD file.
|
||||
* @throws RrdException
|
||||
*
|
||||
*/
|
||||
function rrd_info(string $filename): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \rrd_info($filename);
|
||||
if ($result === false) {
|
||||
throw RrdException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets array of the UNIX timestamp and the values stored for each date in the
|
||||
* most recent update of the RRD database file.
|
||||
*
|
||||
* @param string $filename RRD database file name.
|
||||
* @return array Array of information about last update.
|
||||
* @throws RrdException
|
||||
*
|
||||
*/
|
||||
function rrd_lastupdate(string $filename): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \rrd_lastupdate($filename);
|
||||
if ($result === false) {
|
||||
throw RrdException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Restores the RRD file from the XML dump.
|
||||
*
|
||||
* @param string $xml_file XML filename with the dump of the original RRD database file.
|
||||
* @param string $rrd_file Restored RRD database file name.
|
||||
* @param array $options Array of options for restoring. See man page for rrd restore.
|
||||
* @throws RrdException
|
||||
*
|
||||
*/
|
||||
function rrd_restore(string $xml_file, string $rrd_file, array $options = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($options !== null) {
|
||||
$result = \rrd_restore($xml_file, $rrd_file, $options);
|
||||
} else {
|
||||
$result = \rrd_restore($xml_file, $rrd_file);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw RrdException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Change some options in the RRD dabase header file. E.g. renames the source for
|
||||
* the data etc.
|
||||
*
|
||||
* @param string $filename RRD database file name.
|
||||
* @param array $options Options with RRD database file properties which will be changed. See
|
||||
* rrd tune man page for details.
|
||||
* @throws RrdException
|
||||
*
|
||||
*/
|
||||
function rrd_tune(string $filename, array $options): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \rrd_tune($filename, $options);
|
||||
if ($result === false) {
|
||||
throw RrdException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Updates the RRD database file. The input data is time interpolated according to the
|
||||
* properties of the RRD database file.
|
||||
*
|
||||
* @param string $filename RRD database file name. This database will be updated.
|
||||
* @param array $options Options for updating the RRD database. This is list of strings. See man page of rrd update
|
||||
* for whole list of options.
|
||||
* @throws RrdException
|
||||
*
|
||||
*/
|
||||
function rrd_update(string $filename, array $options): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \rrd_update($filename, $options);
|
||||
if ($result === false) {
|
||||
throw RrdException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Exports the information about RRD database file. This data can be converted
|
||||
* to XML file via user space PHP script and then restored back as RRD database
|
||||
* file.
|
||||
*
|
||||
* @param array $options Array of options for the export, see rrd xport man page.
|
||||
* @return array Array with information about RRD database file.
|
||||
* @throws RrdException
|
||||
*
|
||||
*/
|
||||
function rrd_xport(array $options): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \rrd_xport($options);
|
||||
if ($result === false) {
|
||||
throw RrdException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
300
vendor/thecodingmachine/safe/generated/sem.php
vendored
300
vendor/thecodingmachine/safe/generated/sem.php
vendored
@@ -4,6 +4,34 @@ namespace Safe;
|
||||
|
||||
use Safe\Exceptions\SemException;
|
||||
|
||||
/**
|
||||
* msg_get_queue returns an id that can be used to
|
||||
* access the System V message queue with the given
|
||||
* key. The first call creates the message queue with
|
||||
* the optional permissions.
|
||||
* A second call to msg_get_queue for the same
|
||||
* key will return a different message queue
|
||||
* identifier, but both identifiers access the same underlying message
|
||||
* queue.
|
||||
*
|
||||
* @param int $key Message queue numeric ID
|
||||
* @param int $permissions Queue permissions. Default to 0666. If the message queue already
|
||||
* exists, the permissions will be ignored.
|
||||
* @return resource Returns SysvMessageQueue instance that can be used to access the System V message queue.
|
||||
* @throws SemException
|
||||
*
|
||||
*/
|
||||
function msg_get_queue(int $key, int $permissions = 0666)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \msg_get_queue($key, $permissions);
|
||||
if ($result === false) {
|
||||
throw SemException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks whether the message queue key exists.
|
||||
*
|
||||
@@ -24,23 +52,23 @@ function msg_queue_exists(int $key): void
|
||||
/**
|
||||
* msg_receive will receive the first message from the
|
||||
* specified queue of the type specified by
|
||||
* desiredmsgtype.
|
||||
* desired_message_type.
|
||||
*
|
||||
* @param resource $queue Message queue resource handle
|
||||
* @param int $desiredmsgtype If desiredmsgtype is 0, the message from the front
|
||||
* of the queue is returned. If desiredmsgtype is
|
||||
* @param resource $queue The message queue.
|
||||
* @param int $desired_message_type If desired_message_type is 0, the message from the front
|
||||
* of the queue is returned. If desired_message_type is
|
||||
* greater than 0, then the first message of that type is returned.
|
||||
* If desiredmsgtype is less than 0, the first
|
||||
* If desired_message_type is less than 0, the first
|
||||
* message on the queue with a type less than or equal to the
|
||||
* absolute value of desiredmsgtype will be read.
|
||||
* absolute value of desired_message_type will be read.
|
||||
* If no messages match the criteria, your script will wait until a suitable
|
||||
* message arrives on the queue. You can prevent the script from blocking
|
||||
* by specifying MSG_IPC_NOWAIT in the
|
||||
* flags parameter.
|
||||
* @param int|null $msgtype The type of the message that was received will be stored in this
|
||||
* @param int|null $received_message_type The type of the message that was received will be stored in this
|
||||
* parameter.
|
||||
* @param int $maxsize The maximum size of message to be accepted is specified by the
|
||||
* maxsize; if the message in the queue is larger
|
||||
* @param int $max_message_size The maximum size of message to be accepted is specified by the
|
||||
* max_message_size; if the message in the queue is larger
|
||||
* than this size the function will fail (unless you set
|
||||
* flags as described below).
|
||||
* @param mixed $message The received message will be stored in message,
|
||||
@@ -64,7 +92,7 @@ function msg_queue_exists(int $key): void
|
||||
*
|
||||
* MSG_IPC_NOWAIT
|
||||
* If there are no messages of the
|
||||
* desiredmsgtype, return immediately and do not
|
||||
* desired_message_type, return immediately and do not
|
||||
* wait. The function will fail and return an integer value
|
||||
* corresponding to MSG_ENOMSG.
|
||||
*
|
||||
@@ -72,30 +100,30 @@ function msg_queue_exists(int $key): void
|
||||
*
|
||||
* MSG_EXCEPT
|
||||
* Using this flag in combination with a
|
||||
* desiredmsgtype greater than 0 will cause the
|
||||
* desired_message_type greater than 0 will cause the
|
||||
* function to receive the first message that is not equal to
|
||||
* desiredmsgtype.
|
||||
* desired_message_type.
|
||||
*
|
||||
*
|
||||
* MSG_NOERROR
|
||||
*
|
||||
* If the message is longer than maxsize,
|
||||
* If the message is longer than max_message_size,
|
||||
* setting this flag will truncate the message to
|
||||
* maxsize and will not signal an error.
|
||||
* max_message_size and will not signal an error.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param int|null $errorcode If the function fails, the optional errorcode
|
||||
* @param int|null $error_code If the function fails, the optional error_code
|
||||
* will be set to the value of the system errno variable.
|
||||
* @throws SemException
|
||||
*
|
||||
*/
|
||||
function msg_receive($queue, int $desiredmsgtype, ?int &$msgtype, int $maxsize, &$message, bool $unserialize = true, int $flags = 0, ?int &$errorcode = null): void
|
||||
function msg_receive($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();
|
||||
$result = \msg_receive($queue, $desiredmsgtype, $msgtype, $maxsize, $message, $unserialize, $flags, $errorcode);
|
||||
$result = \msg_receive($queue, $desired_message_type, $received_message_type, $max_message_size, $message, $unserialize, $flags, $error_code);
|
||||
if ($result === false) {
|
||||
throw SemException::createFromPhpError();
|
||||
}
|
||||
@@ -108,7 +136,7 @@ function msg_receive($queue, int $desiredmsgtype, ?int &$msgtype, int $maxsize,
|
||||
* processes have finished working with the message queue and you need to
|
||||
* release the system resources held by it.
|
||||
*
|
||||
* @param resource $queue Message queue resource handle
|
||||
* @param resource $queue The message queue.
|
||||
* @throws SemException
|
||||
*
|
||||
*/
|
||||
@@ -124,15 +152,15 @@ function msg_remove_queue($queue): void
|
||||
|
||||
/**
|
||||
* msg_send sends a message of type
|
||||
* msgtype (which MUST be greater than 0) to
|
||||
* message_type (which MUST be greater than 0) to
|
||||
* the message queue specified by queue.
|
||||
*
|
||||
* @param resource $queue Message queue resource handle
|
||||
* @param int $msgtype The type of the message (MUST be greater than 0)
|
||||
* @param resource $queue The message queue.
|
||||
* @param int $message_type The type of the message (MUST be greater than 0)
|
||||
* @param mixed $message The body of the message.
|
||||
*
|
||||
* If serialize set to FALSE is supplied,
|
||||
* MUST be of type: string, integer, float
|
||||
* MUST be of type: string, int, float
|
||||
* or bool. In other case a warning will be issued.
|
||||
* @param bool $serialize The optional serialize controls how the
|
||||
* message is sent. serialize
|
||||
@@ -148,17 +176,17 @@ function msg_remove_queue($queue): void
|
||||
* optional blocking parameter to FALSE, in which
|
||||
* case msg_send will immediately return FALSE if the
|
||||
* message is too big for the queue, and set the optional
|
||||
* errorcode to MSG_EAGAIN,
|
||||
* error_code to MSG_EAGAIN,
|
||||
* indicating that you should try to send your message again a little
|
||||
* later on.
|
||||
* @param int|null $errorcode If the function fails, the optional errorcode will be set to the value of the system errno variable.
|
||||
* @param int|null $error_code If the function fails, the optional errorcode will be set to the value of the system errno variable.
|
||||
* @throws SemException
|
||||
*
|
||||
*/
|
||||
function msg_send($queue, int $msgtype, $message, bool $serialize = true, bool $blocking = true, ?int &$errorcode = null): void
|
||||
function msg_send($queue, int $message_type, $message, bool $serialize = true, bool $blocking = true, ?int &$error_code = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \msg_send($queue, $msgtype, $message, $serialize, $blocking, $errorcode);
|
||||
$result = \msg_send($queue, $message_type, $message, $serialize, $blocking, $error_code);
|
||||
if ($result === false) {
|
||||
throw SemException::createFromPhpError();
|
||||
}
|
||||
@@ -176,7 +204,7 @@ function msg_send($queue, int $msgtype, $message, bool $serialize = true, bool $
|
||||
* root privileges are required to raise the msg_qbytes values above the
|
||||
* system defined limit.
|
||||
*
|
||||
* @param resource $queue Message queue resource handle
|
||||
* @param resource $queue The message queue.
|
||||
* @param array $data You specify the values you require by setting the value of the keys
|
||||
* that you require in the data array.
|
||||
* @throws SemException
|
||||
@@ -192,6 +220,100 @@ function msg_set_queue($queue, array $data): void
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* msg_stat_queue returns the message queue meta data
|
||||
* for the message queue specified by the queue.
|
||||
* This is useful, for example, to determine which process sent the message
|
||||
* that was just received.
|
||||
*
|
||||
* @param resource $queue The message queue.
|
||||
* @return array On success, the return value is an array whose keys and values have the following
|
||||
* meanings:
|
||||
*
|
||||
* Array structure for msg_stat_queue
|
||||
*
|
||||
*
|
||||
*
|
||||
* msg_perm.uid
|
||||
*
|
||||
* The uid of the owner of the queue.
|
||||
*
|
||||
*
|
||||
*
|
||||
* msg_perm.gid
|
||||
*
|
||||
* The gid of the owner of the queue.
|
||||
*
|
||||
*
|
||||
*
|
||||
* msg_perm.mode
|
||||
*
|
||||
* The file access mode of the queue.
|
||||
*
|
||||
*
|
||||
*
|
||||
* msg_stime
|
||||
*
|
||||
* The time that the last message was sent to the queue.
|
||||
*
|
||||
*
|
||||
*
|
||||
* msg_rtime
|
||||
*
|
||||
* The time that the last message was received from the queue.
|
||||
*
|
||||
*
|
||||
*
|
||||
* msg_ctime
|
||||
*
|
||||
* The time that the queue was last changed.
|
||||
*
|
||||
*
|
||||
*
|
||||
* msg_qnum
|
||||
*
|
||||
* The number of messages waiting to be read from the queue.
|
||||
*
|
||||
*
|
||||
*
|
||||
* msg_qbytes
|
||||
*
|
||||
* The maximum number of bytes allowed in one message queue. On
|
||||
* Linux, this value may be read and modified via
|
||||
* /proc/sys/kernel/msgmnb.
|
||||
*
|
||||
*
|
||||
*
|
||||
* msg_lspid
|
||||
*
|
||||
* The pid of the process that sent the last message to the queue.
|
||||
*
|
||||
*
|
||||
*
|
||||
* msg_lrpid
|
||||
*
|
||||
* The pid of the process that received the last message from the queue.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Returns FALSE on failure.
|
||||
* @throws SemException
|
||||
*
|
||||
*/
|
||||
function msg_stat_queue($queue): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \msg_stat_queue($queue);
|
||||
if ($result === false) {
|
||||
throw SemException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* sem_acquire by default blocks (if necessary) until the
|
||||
* semaphore can be acquired. A process attempting to acquire a semaphore which
|
||||
@@ -202,19 +324,19 @@ function msg_set_queue($queue, array $data): void
|
||||
* explicitly released will be released automatically and a warning will be
|
||||
* generated.
|
||||
*
|
||||
* @param resource $sem_identifier sem_identifier is a semaphore resource,
|
||||
* @param resource $semaphore semaphore is a semaphore
|
||||
* obtained from sem_get.
|
||||
* @param bool $nowait Specifies if the process shouldn't wait for the semaphore to be acquired.
|
||||
* @param bool $non_blocking Specifies if the process shouldn't wait for the semaphore to be acquired.
|
||||
* If set to true, the call will return
|
||||
* false immediately if a semaphore cannot be immediately
|
||||
* acquired.
|
||||
* @throws SemException
|
||||
*
|
||||
*/
|
||||
function sem_acquire($sem_identifier, bool $nowait = false): void
|
||||
function sem_acquire($semaphore, bool $non_blocking = false): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \sem_acquire($sem_identifier, $nowait);
|
||||
$result = \sem_acquire($semaphore, $non_blocking);
|
||||
if ($result === false) {
|
||||
throw SemException::createFromPhpError();
|
||||
}
|
||||
@@ -235,19 +357,19 @@ function sem_acquire($sem_identifier, bool $nowait = false): void
|
||||
* @param int $key
|
||||
* @param int $max_acquire The number of processes that can acquire the semaphore simultaneously
|
||||
* is set to max_acquire.
|
||||
* @param int $perm The semaphore permissions. Actually this value is
|
||||
* @param int $permissions The semaphore permissions. Actually this value is
|
||||
* set only if the process finds it is the only process currently
|
||||
* attached to the semaphore.
|
||||
* @param int $auto_release Specifies if the semaphore should be automatically released on request
|
||||
* @param bool $auto_release Specifies if the semaphore should be automatically released on request
|
||||
* shutdown.
|
||||
* @return resource Returns a positive semaphore identifier on success.
|
||||
* @throws SemException
|
||||
*
|
||||
*/
|
||||
function sem_get(int $key, int $max_acquire = 1, int $perm = 0666, int $auto_release = 1)
|
||||
function sem_get(int $key, int $max_acquire = 1, int $permissions = 0666, bool $auto_release = true)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \sem_get($key, $max_acquire, $perm, $auto_release);
|
||||
$result = \sem_get($key, $max_acquire, $permissions, $auto_release);
|
||||
if ($result === false) {
|
||||
throw SemException::createFromPhpError();
|
||||
}
|
||||
@@ -263,15 +385,15 @@ function sem_get(int $key, int $max_acquire = 1, int $perm = 0666, int $auto_rel
|
||||
* After releasing the semaphore, sem_acquire
|
||||
* may be called to re-acquire it.
|
||||
*
|
||||
* @param resource $sem_identifier A Semaphore resource handle as returned by
|
||||
* @param resource $semaphore A Semaphore as returned by
|
||||
* sem_get.
|
||||
* @throws SemException
|
||||
*
|
||||
*/
|
||||
function sem_release($sem_identifier): void
|
||||
function sem_release($semaphore): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \sem_release($sem_identifier);
|
||||
$result = \sem_release($semaphore);
|
||||
if ($result === false) {
|
||||
throw SemException::createFromPhpError();
|
||||
}
|
||||
@@ -283,15 +405,74 @@ function sem_release($sem_identifier): void
|
||||
*
|
||||
* After removing the semaphore, it is no longer accessible.
|
||||
*
|
||||
* @param resource $sem_identifier A semaphore resource identifier as returned
|
||||
* @param resource $semaphore A semaphore as returned
|
||||
* by sem_get.
|
||||
* @throws SemException
|
||||
*
|
||||
*/
|
||||
function sem_remove($sem_identifier): void
|
||||
function sem_remove($semaphore): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \sem_remove($sem_identifier);
|
||||
$result = \sem_remove($semaphore);
|
||||
if ($result === false) {
|
||||
throw SemException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* shm_attach returns an id that can be used to access
|
||||
* the System V shared memory with the given key, the
|
||||
* first call creates the shared memory segment with
|
||||
* size and the optional perm-bits
|
||||
* permissions.
|
||||
*
|
||||
* A second call to shm_attach for the same
|
||||
* key will return a different SysvSharedMemory
|
||||
* instance, but both instances access the same underlying
|
||||
* shared memory. size and
|
||||
* permissions will be ignored.
|
||||
*
|
||||
* @param int $key A numeric shared memory segment ID
|
||||
* @param int $size The memory size. If not provided, default to the
|
||||
* sysvshm.init_mem in the php.ini, otherwise 10000
|
||||
* bytes.
|
||||
* @param int $permissions The optional permission bits. Default to 0666.
|
||||
* @return resource Returns a SysvSharedMemory instance on success.
|
||||
* @throws SemException
|
||||
*
|
||||
*/
|
||||
function shm_attach(int $key, int $size = null, int $permissions = 0666)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($permissions !== 0666) {
|
||||
$result = \shm_attach($key, $size, $permissions);
|
||||
} elseif ($size !== null) {
|
||||
$result = \shm_attach($key, $size);
|
||||
} else {
|
||||
$result = \shm_attach($key);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw SemException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* shm_detach disconnects from the shared memory given
|
||||
* by the shm created by
|
||||
* shm_attach. Remember, that shared memory still exist
|
||||
* in the Unix system and the data is still present.
|
||||
*
|
||||
* @param resource $shm A shared memory segment obtained from shm_attach.
|
||||
* @throws SemException
|
||||
*
|
||||
*/
|
||||
function shm_detach($shm): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \shm_detach($shm);
|
||||
if ($result === false) {
|
||||
throw SemException::createFromPhpError();
|
||||
}
|
||||
@@ -300,28 +481,27 @@ function sem_remove($sem_identifier): void
|
||||
|
||||
/**
|
||||
* shm_put_var inserts or updates the
|
||||
* variable with the given
|
||||
* variable_key.
|
||||
* value with the given
|
||||
* key.
|
||||
*
|
||||
* Warnings (E_WARNING level) will be issued if
|
||||
* shm_identifier is not a valid SysV shared memory
|
||||
* shm is not a valid SysV shared memory
|
||||
* index or if there was not enough shared memory remaining to complete your
|
||||
* request.
|
||||
*
|
||||
* @param resource $shm_identifier A shared memory resource handle as returned by
|
||||
* shm_attach
|
||||
* @param int $variable_key The variable key.
|
||||
* @param mixed $variable The variable. All variable types
|
||||
* @param resource $shm A shared memory segment obtained from shm_attach.
|
||||
* @param int $key The variable key.
|
||||
* @param mixed $value The variable. All variable types
|
||||
* that serialize supports may be used: generally
|
||||
* this means all types except for resources and some internal objects
|
||||
* that cannot be serialized.
|
||||
* @throws SemException
|
||||
*
|
||||
*/
|
||||
function shm_put_var($shm_identifier, int $variable_key, $variable): void
|
||||
function shm_put_var($shm, int $key, $value): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \shm_put_var($shm_identifier, $variable_key, $variable);
|
||||
$result = \shm_put_var($shm, $key, $value);
|
||||
if ($result === false) {
|
||||
throw SemException::createFromPhpError();
|
||||
}
|
||||
@@ -329,19 +509,18 @@ function shm_put_var($shm_identifier, int $variable_key, $variable): void
|
||||
|
||||
|
||||
/**
|
||||
* Removes a variable with a given variable_key
|
||||
* Removes a variable with a given key
|
||||
* and frees the occupied memory.
|
||||
*
|
||||
* @param resource $shm_identifier The shared memory identifier as returned by
|
||||
* shm_attach
|
||||
* @param int $variable_key The variable key.
|
||||
* @param resource $shm A shared memory segment obtained from shm_attach.
|
||||
* @param int $key The variable key.
|
||||
* @throws SemException
|
||||
*
|
||||
*/
|
||||
function shm_remove_var($shm_identifier, int $variable_key): void
|
||||
function shm_remove_var($shm, int $key): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \shm_remove_var($shm_identifier, $variable_key);
|
||||
$result = \shm_remove_var($shm, $key);
|
||||
if ($result === false) {
|
||||
throw SemException::createFromPhpError();
|
||||
}
|
||||
@@ -350,17 +529,16 @@ function shm_remove_var($shm_identifier, int $variable_key): void
|
||||
|
||||
/**
|
||||
* shm_remove removes the shared memory
|
||||
* shm_identifier. All data will be destroyed.
|
||||
* shm. All data will be destroyed.
|
||||
*
|
||||
* @param resource $shm_identifier The shared memory identifier as returned by
|
||||
* shm_attach
|
||||
* @param resource $shm A shared memory segment obtained from shm_attach.
|
||||
* @throws SemException
|
||||
*
|
||||
*/
|
||||
function shm_remove($shm_identifier): void
|
||||
function shm_remove($shm): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \shm_remove($shm_identifier);
|
||||
$result = \shm_remove($shm);
|
||||
if ($result === false) {
|
||||
throw SemException::createFromPhpError();
|
||||
}
|
||||
|
||||
219
vendor/thecodingmachine/safe/generated/session.php
vendored
219
vendor/thecodingmachine/safe/generated/session.php
vendored
@@ -21,6 +21,42 @@ function session_abort(): void
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* session_create_id is used to create new
|
||||
* session id for the current session. It returns collision free
|
||||
* session id.
|
||||
*
|
||||
* If session is not active, collision check is omitted.
|
||||
*
|
||||
* Session ID is created according to php.ini settings.
|
||||
*
|
||||
* It is important to use the same user ID of your web server for GC
|
||||
* task script. Otherwise, you may have permission problems especially
|
||||
* with files save handler.
|
||||
*
|
||||
* @param string $prefix If prefix is specified, new session id
|
||||
* is prefixed by prefix. Not all
|
||||
* characters are allowed within the session id. Characters in
|
||||
* the range a-z A-Z 0-9 , (comma) and -
|
||||
* (minus) are allowed.
|
||||
* @return string session_create_id returns new collision free
|
||||
* session id for the current session. If it is used without active
|
||||
* session, it omits collision check.
|
||||
* On failure, FALSE is returned.
|
||||
* @throws SessionException
|
||||
*
|
||||
*/
|
||||
function session_create_id(string $prefix = ""): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \session_create_id($prefix);
|
||||
if ($result === false) {
|
||||
throw SessionException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* session_decode decodes the serialized session data provided in
|
||||
* $data, and populates the $_SESSION superglobal
|
||||
@@ -69,6 +105,151 @@ function session_destroy(): void
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* session_encode returns a serialized string of the
|
||||
* contents of the current session data stored in the $_SESSION superglobal.
|
||||
*
|
||||
* By default, the serialization method used is internal to PHP, and is not the same as serialize.
|
||||
* The serialization method can be set using session.serialize_handler.
|
||||
*
|
||||
* @return string Returns the contents of the current session encoded.
|
||||
* @throws SessionException
|
||||
*
|
||||
*/
|
||||
function session_encode(): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \session_encode();
|
||||
if ($result === false) {
|
||||
throw SessionException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* session_id is used to get or set the session id for
|
||||
* the current session.
|
||||
*
|
||||
* The constant SID can also be used to
|
||||
* retrieve the current name and session id as a string suitable for
|
||||
* adding to URLs. See also Session
|
||||
* handling.
|
||||
*
|
||||
* @param string $id If id is specified and not NULL, it will replace the current
|
||||
* session id. session_id needs to be called before
|
||||
* session_start for that purpose. Depending on the
|
||||
* session handler, not all characters are allowed within the session id.
|
||||
* For example, the file session handler only allows characters in the
|
||||
* range a-z A-Z 0-9 , (comma) and - (minus)!
|
||||
* @return string session_id returns the session id for the current
|
||||
* session or the empty string ("") if there is no current
|
||||
* session (no current session id exists).
|
||||
* On failure, FALSE is returned.
|
||||
* @throws SessionException
|
||||
*
|
||||
*/
|
||||
function session_id(string $id = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($id !== null) {
|
||||
$result = \session_id($id);
|
||||
} else {
|
||||
$result = \session_id();
|
||||
}
|
||||
if ($result === false) {
|
||||
throw SessionException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* session_module_name gets the name of the current
|
||||
* session module, which is also known as
|
||||
* session.save_handler.
|
||||
*
|
||||
* @param string $module If module is specified and not NULL, that module will be
|
||||
* used instead.
|
||||
* Passing "user" to this parameter is forbidden. Instead
|
||||
* session_set_save_handler has to be called to set a user
|
||||
* defined session handler.
|
||||
* @return string Returns the name of the current session module.
|
||||
* @throws SessionException
|
||||
*
|
||||
*/
|
||||
function session_module_name(string $module = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($module !== null) {
|
||||
$result = \session_module_name($module);
|
||||
} else {
|
||||
$result = \session_module_name();
|
||||
}
|
||||
if ($result === false) {
|
||||
throw SessionException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* session_name returns the name of the current
|
||||
* session. If name is given,
|
||||
* session_name will update the session name and return
|
||||
* the old session name.
|
||||
*
|
||||
* If a new session name is
|
||||
* supplied, session_name modifies the HTTP cookie
|
||||
* (and output content when session.transid is
|
||||
* enabled). Once the HTTP cookie is
|
||||
* sent, session_name raises error.
|
||||
* session_name must be called
|
||||
* before session_start for the session to work
|
||||
* properly.
|
||||
*
|
||||
* The session name is reset to the default value stored in
|
||||
* session.name at request startup time. Thus, you need to
|
||||
* call session_name for every request (and before
|
||||
* session_start is called).
|
||||
*
|
||||
* @param string $name The session name references the name of the session, which is
|
||||
* used in cookies and URLs (e.g. PHPSESSID). It
|
||||
* should contain only alphanumeric characters; it should be short and
|
||||
* descriptive (i.e. for users with enabled cookie warnings).
|
||||
* If name is specified and not NULL, the name of the current
|
||||
* session is changed to its value.
|
||||
*
|
||||
*
|
||||
*
|
||||
* The session name can't consist of digits only, at least one letter
|
||||
* must be present. Otherwise a new session id is generated every time.
|
||||
*
|
||||
*
|
||||
*
|
||||
* The session name can't consist of digits only, at least one letter
|
||||
* must be present. Otherwise a new session id is generated every time.
|
||||
* @return string Returns the name of the current session. If name is given
|
||||
* and function updates the session name, name of the old session
|
||||
* is returned.
|
||||
* @throws SessionException
|
||||
*
|
||||
*/
|
||||
function session_name(string $name = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($name !== null) {
|
||||
$result = \session_name($name);
|
||||
} else {
|
||||
$result = \session_name();
|
||||
}
|
||||
if ($result === false) {
|
||||
throw SessionException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* session_regenerate_id will replace the current
|
||||
* session id with a new one, and keep the current session information.
|
||||
@@ -112,6 +293,44 @@ function session_reset(): void
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* session_save_path returns the path of the current
|
||||
* directory used to save session data.
|
||||
*
|
||||
* @param string $path Session data path. If specified and not NULL, the path to which data is saved will
|
||||
* be changed. session_save_path needs to be called
|
||||
* before session_start for that purpose.
|
||||
*
|
||||
*
|
||||
*
|
||||
* On some operating systems, you may want to specify a path on a
|
||||
* filesystem that handles lots of small files efficiently. For example,
|
||||
* on Linux, reiserfs may provide better performance than ext2fs.
|
||||
*
|
||||
*
|
||||
*
|
||||
* On some operating systems, you may want to specify a path on a
|
||||
* filesystem that handles lots of small files efficiently. For example,
|
||||
* on Linux, reiserfs may provide better performance than ext2fs.
|
||||
* @return string Returns the path of the current directory used for data storage.
|
||||
* @throws SessionException
|
||||
*
|
||||
*/
|
||||
function session_save_path(string $path = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($path !== null) {
|
||||
$result = \session_save_path($path);
|
||||
} else {
|
||||
$result = \session_save_path();
|
||||
}
|
||||
if ($result === false) {
|
||||
throw SessionException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The session_unset function frees all session variables
|
||||
* currently registered.
|
||||
|
||||
39
vendor/thecodingmachine/safe/generated/shmop.php
vendored
39
vendor/thecodingmachine/safe/generated/shmop.php
vendored
@@ -7,15 +7,15 @@ use Safe\Exceptions\ShmopException;
|
||||
/**
|
||||
* shmop_delete is used to delete a shared memory block.
|
||||
*
|
||||
* @param resource $shmid The shared memory block resource created by
|
||||
* @param resource $shmop The shared memory block resource created by
|
||||
* shmop_open
|
||||
* @throws ShmopException
|
||||
*
|
||||
*/
|
||||
function shmop_delete($shmid): void
|
||||
function shmop_delete($shmop): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \shmop_delete($shmid);
|
||||
$result = \shmop_delete($shmop);
|
||||
if ($result === false) {
|
||||
throw ShmopException::createFromPhpError();
|
||||
}
|
||||
@@ -25,42 +25,19 @@ function shmop_delete($shmid): void
|
||||
/**
|
||||
* shmop_read will read a string from shared memory block.
|
||||
*
|
||||
* @param resource $shmid The shared memory block identifier created by
|
||||
* @param resource $shmop The shared memory block identifier created by
|
||||
* shmop_open
|
||||
* @param int $start Offset from which to start reading
|
||||
* @param int $count The number of bytes to read.
|
||||
* @param int $offset Offset from which to start reading
|
||||
* @param int $size The number of bytes to read.
|
||||
* 0 reads shmop_size($shmid) - $start bytes.
|
||||
* @return string Returns the data.
|
||||
* @throws ShmopException
|
||||
*
|
||||
*/
|
||||
function shmop_read($shmid, int $start, int $count): string
|
||||
function shmop_read($shmop, int $offset, int $size): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \shmop_read($shmid, $start, $count);
|
||||
if ($result === false) {
|
||||
throw ShmopException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* shmop_write will write a string into shared memory block.
|
||||
*
|
||||
* @param resource $shmid The shared memory block identifier created by
|
||||
* shmop_open
|
||||
* @param string $data A string to write into shared memory block
|
||||
* @param int $offset Specifies where to start writing data inside the shared memory
|
||||
* segment.
|
||||
* @return int The size of the written data.
|
||||
* @throws ShmopException
|
||||
*
|
||||
*/
|
||||
function shmop_write($shmid, string $data, int $offset): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \shmop_write($shmid, $data, $offset);
|
||||
$result = \shmop_read($shmop, $offset, $size);
|
||||
if ($result === false) {
|
||||
throw ShmopException::createFromPhpError();
|
||||
}
|
||||
|
||||
@@ -1,94 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\SimplexmlException;
|
||||
|
||||
/**
|
||||
* This function takes a node of a DOM
|
||||
* document and makes it into a SimpleXML node. This new object can
|
||||
* then be used as a native SimpleXML element.
|
||||
*
|
||||
* @param \DOMNode $node A DOM Element node
|
||||
* @param string $class_name You may use this optional parameter so that
|
||||
* simplexml_import_dom will return an object of
|
||||
* the specified class. That class should extend the
|
||||
* SimpleXMLElement class.
|
||||
* @return \SimpleXMLElement Returns a SimpleXMLElement.
|
||||
* @throws SimplexmlException
|
||||
*
|
||||
*/
|
||||
function simplexml_import_dom(\DOMNode $node, string $class_name = "SimpleXMLElement"): \SimpleXMLElement
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \simplexml_import_dom($node, $class_name);
|
||||
if ($result === false) {
|
||||
throw SimplexmlException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convert the well-formed XML document in the given file to an object.
|
||||
*
|
||||
* @param string $filename Path to the XML file
|
||||
*
|
||||
* Libxml 2 unescapes the URI, so if you want to pass e.g.
|
||||
* b&c as the URI parameter a,
|
||||
* you have to call
|
||||
* simplexml_load_file(rawurlencode('http://example.com/?a=' .
|
||||
* urlencode('b&c'))). Since PHP 5.1.0 you don't need to do
|
||||
* this because PHP will do it for you.
|
||||
* @param string $class_name You may use this optional parameter so that
|
||||
* simplexml_load_file will return an object of
|
||||
* the specified class. That class should extend the
|
||||
* SimpleXMLElement class.
|
||||
* @param int $options Since PHP 5.1.0 and Libxml 2.6.0, you may also use the
|
||||
* options parameter to specify additional Libxml parameters.
|
||||
* @param string $ns Namespace prefix or URI.
|
||||
* @param bool $is_prefix TRUE if ns is a prefix, FALSE if it's a URI;
|
||||
* defaults to FALSE.
|
||||
* @return \SimpleXMLElement Returns an object of class SimpleXMLElement with
|
||||
* properties containing the data held within the XML document.
|
||||
* @throws SimplexmlException
|
||||
*
|
||||
*/
|
||||
function simplexml_load_file(string $filename, string $class_name = "SimpleXMLElement", int $options = 0, string $ns = "", bool $is_prefix = false): \SimpleXMLElement
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \simplexml_load_file($filename, $class_name, $options, $ns, $is_prefix);
|
||||
if ($result === false) {
|
||||
throw SimplexmlException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Takes a well-formed XML string and returns it as an object.
|
||||
*
|
||||
* @param string $data A well-formed XML string
|
||||
* @param string $class_name You may use this optional parameter so that
|
||||
* simplexml_load_string will return an object of
|
||||
* the specified class. That class should extend the
|
||||
* SimpleXMLElement class.
|
||||
* @param int $options Since PHP 5.1.0 and Libxml 2.6.0, you may also use the
|
||||
* options parameter to specify additional Libxml parameters.
|
||||
* @param string $ns Namespace prefix or URI.
|
||||
* @param bool $is_prefix TRUE if ns is a prefix, FALSE if it's a URI;
|
||||
* defaults to FALSE.
|
||||
* @return \SimpleXMLElement Returns an object of class SimpleXMLElement with
|
||||
* properties containing the data held within the xml document.
|
||||
* @throws SimplexmlException
|
||||
*
|
||||
*/
|
||||
function simplexml_load_string(string $data, string $class_name = "SimpleXMLElement", int $options = 0, string $ns = "", bool $is_prefix = false): \SimpleXMLElement
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \simplexml_load_string($data, $class_name, $options, $ns, $is_prefix);
|
||||
if ($result === false) {
|
||||
throw SimplexmlException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
224
vendor/thecodingmachine/safe/generated/sockets.php
vendored
224
vendor/thecodingmachine/safe/generated/sockets.php
vendored
@@ -10,23 +10,23 @@ use Safe\Exceptions\SocketsException;
|
||||
* socket_bind, and told to listen for connections
|
||||
* with socket_listen, this function will accept
|
||||
* incoming connections on that socket. Once a successful connection
|
||||
* is made, a new socket resource is returned, which may be used
|
||||
* for communication. If there are multiple connections queued on
|
||||
* the socket, the first will be used. If there are no pending
|
||||
* is made, a new Socket instance is returned,
|
||||
* which may be used for communication. If there are multiple connections
|
||||
* queued on the socket, the first will be used. If there are no pending
|
||||
* connections, socket_accept will block until
|
||||
* a connection becomes present. If socket
|
||||
* has been made non-blocking using
|
||||
* socket_set_blocking or
|
||||
* socket_set_nonblock, FALSE will be returned.
|
||||
*
|
||||
* The socket resource returned by
|
||||
* The Socket instance returned by
|
||||
* socket_accept may not be used to accept new
|
||||
* connections. The original listening socket
|
||||
* socket, however, remains open and may be
|
||||
* reused.
|
||||
*
|
||||
* @param resource $socket A valid socket resource created with socket_create.
|
||||
* @return resource Returns a new socket resource on success. The actual
|
||||
* @param resource $socket A Socket instance created with socket_create.
|
||||
* @return resource Returns a new Socket instance on success. The actual
|
||||
* error code can be retrieved by calling
|
||||
* socket_last_error. This error code may be passed to
|
||||
* socket_strerror to get a textual explanation of the
|
||||
@@ -46,19 +46,19 @@ function socket_accept($socket)
|
||||
|
||||
|
||||
/**
|
||||
* Create a Socket resource, and bind it to the provided AddrInfo resource. The return
|
||||
* Create a Socket instance, and bind it to the provided AddressInfo. The return
|
||||
* value of this function may be used with socket_listen.
|
||||
*
|
||||
* @param resource $addr Resource created from socket_addrinfo_lookup.
|
||||
* @return resource Returns a Socket resource on success.
|
||||
* @param resource $address AddressInfo instance created from socket_addrinfo_lookup.
|
||||
* @return resource|null Returns a Socket instance on success.
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_addrinfo_bind($addr)
|
||||
function socket_addrinfo_bind($address)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \socket_addrinfo_bind($addr);
|
||||
if ($result === null) {
|
||||
$result = \socket_addrinfo_bind($address);
|
||||
if ($result === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
@@ -66,19 +66,50 @@ function socket_addrinfo_bind($addr)
|
||||
|
||||
|
||||
/**
|
||||
* Create a Socket resource, and connect it to the provided AddrInfo resource. The return
|
||||
* Create a Socket instance, and connect it to the provided AddressInfo instance. The return
|
||||
* value of this function may be used with the rest of the socket functions.
|
||||
*
|
||||
* @param resource $addr Resource created from socket_addrinfo_lookup
|
||||
* @return resource Returns a Socket resource on success.
|
||||
* @param resource $address AddressInfo instance created from socket_addrinfo_lookup
|
||||
* @return resource|null Returns a Socket instance on success.
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_addrinfo_connect($addr)
|
||||
function socket_addrinfo_connect($address)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \socket_addrinfo_connect($addr);
|
||||
if ($result === null) {
|
||||
$result = \socket_addrinfo_connect($address);
|
||||
if ($result === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Lookup different ways we can connect to host. The returned array contains
|
||||
* a set of AddressInfo instances that we can bind to using socket_addrinfo_bind.
|
||||
*
|
||||
* @param string $host Hostname to search.
|
||||
* @param mixed $service The service to connect to. If service is a name, it is translated to the corresponding
|
||||
* port number.
|
||||
* @param array $hints Hints provide criteria for selecting addresses returned. You may specify the
|
||||
* hints as defined by getadrinfo.
|
||||
* @return resource[] Returns an array of AddressInfo instances that can be used with the other socket_addrinfo functions.
|
||||
* On failure, FALSE is returned.
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_addrinfo_lookup(string $host, $service = null, array $hints = []): iterable
|
||||
{
|
||||
error_clear_last();
|
||||
if ($hints !== []) {
|
||||
$result = \socket_addrinfo_lookup($host, $service, $hints);
|
||||
} elseif ($service !== null) {
|
||||
$result = \socket_addrinfo_lookup($host, $service);
|
||||
} else {
|
||||
$result = \socket_addrinfo_lookup($host);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
@@ -91,7 +122,7 @@ function socket_addrinfo_connect($addr)
|
||||
* a connection is be established using socket_connect
|
||||
* or socket_listen.
|
||||
*
|
||||
* @param resource $socket A valid socket resource created with socket_create.
|
||||
* @param resource $socket A Socket instance created with socket_create.
|
||||
* @param string $address If the socket is of the AF_INET family, the
|
||||
* address is an IP in dotted-quad notation
|
||||
* (e.g. 127.0.0.1).
|
||||
@@ -116,11 +147,12 @@ function socket_bind($socket, string $address, int $port = 0): void
|
||||
|
||||
|
||||
/**
|
||||
* Initiate a connection to address using the socket resource
|
||||
* socket, which must be a valid socket
|
||||
* resource created with socket_create.
|
||||
* Initiate a connection to address using the Socket instance
|
||||
* socket, which must be Socket
|
||||
* instance created with socket_create.
|
||||
*
|
||||
* @param resource $socket
|
||||
* @param resource $socket A Socket instance created with
|
||||
* socket_create.
|
||||
* @param string $address The address parameter is either an IPv4 address
|
||||
* in dotted-quad notation (e.g. 127.0.0.1) if
|
||||
* socket is AF_INET, a valid
|
||||
@@ -135,10 +167,14 @@ function socket_bind($socket, string $address, int $port = 0): void
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_connect($socket, string $address, int $port = 0): void
|
||||
function socket_connect($socket, string $address, int $port = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \socket_connect($socket, $address, $port);
|
||||
if ($port !== null) {
|
||||
$result = \socket_connect($socket, $address, $port);
|
||||
} else {
|
||||
$result = \socket_connect($socket, $address);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
@@ -146,7 +182,7 @@ function socket_connect($socket, string $address, int $port = 0): void
|
||||
|
||||
|
||||
/**
|
||||
* socket_create_listen creates a new socket resource of
|
||||
* socket_create_listen creates a new Socket instance of
|
||||
* type AF_INET listening on all
|
||||
* local interfaces on the given port waiting for new connections.
|
||||
*
|
||||
@@ -159,7 +195,7 @@ function socket_connect($socket, string $address, int $port = 0): void
|
||||
* SOMAXCONN may be passed as
|
||||
* backlog parameter, see
|
||||
* socket_listen for more information.
|
||||
* @return resource socket_create_listen returns a new socket resource
|
||||
* @return resource socket_create_listen returns a new Socket instance
|
||||
* on success. The error code can be retrieved with
|
||||
* socket_last_error. This code may be passed to
|
||||
* socket_strerror to get a textual explanation of the
|
||||
@@ -180,7 +216,7 @@ function socket_create_listen(int $port, int $backlog = 128)
|
||||
|
||||
/**
|
||||
* socket_create_pair creates two connected and
|
||||
* indistinguishable sockets, and stores them in fd.
|
||||
* indistinguishable sockets, and stores them in pair.
|
||||
* This function is commonly used in IPC (InterProcess Communication).
|
||||
*
|
||||
* @param int $domain The domain parameter specifies the protocol
|
||||
@@ -199,14 +235,14 @@ function socket_create_listen(int $port, int $backlog = 128)
|
||||
*
|
||||
* See socket_create for the full list of supported
|
||||
* protocols.
|
||||
* @param resource[]|null $fd Reference to an array in which the two socket resources will be inserted.
|
||||
* @param resource[]|null $pair Reference to an array in which the two Socket instances will be inserted.
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_create_pair(int $domain, int $type, int $protocol, ?iterable &$fd): void
|
||||
function socket_create_pair(int $domain, int $type, int $protocol, ?iterable &$pair): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \socket_create_pair($domain, $type, $protocol, $fd);
|
||||
$result = \socket_create_pair($domain, $type, $protocol, $pair);
|
||||
if ($result === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
@@ -214,7 +250,7 @@ function socket_create_pair(int $domain, int $type, int $protocol, ?iterable &$f
|
||||
|
||||
|
||||
/**
|
||||
* Creates and returns a socket resource, also referred to as an endpoint
|
||||
* Creates and returns a Socket instance, also referred to as an endpoint
|
||||
* of communication. A typical network connection is made up of 2 sockets, one
|
||||
* performing the role of the client, and another performing the role of the server.
|
||||
*
|
||||
@@ -229,7 +265,7 @@ function socket_create_pair(int $domain, int $type, int $protocol, ?iterable &$f
|
||||
* the desired protocol is TCP, or UDP the corresponding constants
|
||||
* SOL_TCP, and SOL_UDP
|
||||
* can also be used.
|
||||
* @return resource socket_create returns a socket resource on success. The actual error code can be retrieved by calling
|
||||
* @return resource socket_create returns a Socket instance on success. The actual error code can be retrieved by calling
|
||||
* socket_last_error. This error code may be passed to
|
||||
* socket_strerror to get a textual explanation of the
|
||||
* error.
|
||||
@@ -268,10 +304,10 @@ function socket_export_stream($socket)
|
||||
|
||||
/**
|
||||
* The socket_get_option function retrieves the value for
|
||||
* the option specified by the optname parameter for the
|
||||
* the option specified by the option parameter for the
|
||||
* specified socket.
|
||||
*
|
||||
* @param resource $socket A valid socket resource created with socket_create
|
||||
* @param resource $socket A Socket instance created with socket_create
|
||||
* or socket_accept.
|
||||
* @param int $level The level parameter specifies the protocol
|
||||
* level at which the option resides. For example, to retrieve options at
|
||||
@@ -280,7 +316,7 @@ function socket_export_stream($socket)
|
||||
* TCP, can be used by
|
||||
* specifying the protocol number of that level. Protocol numbers can be
|
||||
* found by using the getprotobyname function.
|
||||
* @param int $optname Reports whether the socket lingers on
|
||||
* @param int $option Reports whether the socket lingers on
|
||||
* socket_close if data is present. By default,
|
||||
* when the socket is closed, it attempts to send all unsent data.
|
||||
* In the case of a connection-oriented socket,
|
||||
@@ -298,14 +334,14 @@ function socket_export_stream($socket)
|
||||
* is sent or the time specified in l_linger
|
||||
* elapses. If the socket is non-blocking,
|
||||
* socket_close will fail and return an error.
|
||||
* @return mixed Returns the value of the given options.
|
||||
* @return mixed Returns the value of the given option.
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_get_option($socket, int $level, int $optname)
|
||||
function socket_get_option($socket, int $level, int $option)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \socket_get_option($socket, $level, $optname);
|
||||
$result = \socket_get_option($socket, $level, $option);
|
||||
if ($result === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
@@ -317,9 +353,9 @@ function socket_get_option($socket, int $level, int $optname)
|
||||
* Queries the remote side of the given socket which may either result in
|
||||
* host/port or in a Unix filesystem path, dependent on its type.
|
||||
*
|
||||
* @param resource $socket A valid socket resource created with socket_create
|
||||
* @param resource $socket A Socket instance created with socket_create
|
||||
* or socket_accept.
|
||||
* @param string $address If the given socket is of type AF_INET or
|
||||
* @param string|null $address If the given socket is of type AF_INET or
|
||||
* AF_INET6, socket_getpeername
|
||||
* will return the peers (remote) IP address in
|
||||
* appropriate notation (e.g. 127.0.0.1 or
|
||||
@@ -336,7 +372,7 @@ function socket_get_option($socket, int $level, int $optname)
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_getpeername($socket, string &$address, ?int &$port = null): void
|
||||
function socket_getpeername($socket, ?string &$address, ?int &$port = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \socket_getpeername($socket, $address, $port);
|
||||
@@ -349,9 +385,9 @@ function socket_getpeername($socket, string &$address, ?int &$port = null): void
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param resource $socket A valid socket resource created with socket_create
|
||||
* @param resource $socket A Socket instance created with socket_create
|
||||
* or socket_accept.
|
||||
* @param string|null $addr If the given socket is of type AF_INET
|
||||
* @param string|null $address If the given socket is of type AF_INET
|
||||
* or AF_INET6, socket_getsockname
|
||||
* will return the local IP address in appropriate notation (e.g.
|
||||
* 127.0.0.1 or fe80::1) in the
|
||||
@@ -366,10 +402,10 @@ function socket_getpeername($socket, string &$address, ?int &$port = null): void
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_getsockname($socket, ?string &$addr, ?int &$port = null): void
|
||||
function socket_getsockname($socket, ?string &$address, ?int &$port = null): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \socket_getsockname($socket, $addr, $port);
|
||||
$result = \socket_getsockname($socket, $address, $port);
|
||||
if ($result === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
@@ -380,7 +416,7 @@ function socket_getsockname($socket, ?string &$addr, ?int &$port = null): void
|
||||
* Imports a stream that encapsulates a socket into a socket extension resource.
|
||||
*
|
||||
* @param resource $stream The stream resource to import.
|
||||
* @return resource|false Returns FALSE.
|
||||
* @return resource Returns FALSE on failure.
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
@@ -388,7 +424,7 @@ function socket_import_stream($stream)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \socket_import_stream($stream);
|
||||
if ($result === null) {
|
||||
if ($result === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
@@ -405,7 +441,7 @@ function socket_import_stream($stream)
|
||||
* type SOCK_STREAM or
|
||||
* SOCK_SEQPACKET.
|
||||
*
|
||||
* @param resource $socket A valid socket resource created with socket_create
|
||||
* @param resource $socket A Socket instance created with socket_create
|
||||
* or socket_addrinfo_bind
|
||||
* @param int $backlog A maximum of backlog incoming connections will be
|
||||
* queued for processing. If a connection request arrives with the queue
|
||||
@@ -434,19 +470,19 @@ function socket_listen($socket, int $backlog = 0): void
|
||||
|
||||
|
||||
/**
|
||||
* The function socket_read reads from the socket
|
||||
* resource socket created by the
|
||||
* The function socket_read reads from the Socket instance
|
||||
* socket created by the
|
||||
* socket_create or
|
||||
* socket_accept functions.
|
||||
*
|
||||
* @param resource $socket A valid socket resource created with socket_create
|
||||
* @param resource $socket A Socket instance created with socket_create
|
||||
* or socket_accept.
|
||||
* @param int $length The maximum number of bytes read is specified by the
|
||||
* length parameter. Otherwise you can use
|
||||
* \r, \n,
|
||||
* or \0 to end reading (depending on the type
|
||||
* or \0 to end reading (depending on the mode
|
||||
* parameter, see below).
|
||||
* @param int $type Optional type parameter is a named constant:
|
||||
* @param int $mode Optional mode parameter is a named constant:
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -469,10 +505,10 @@ function socket_listen($socket, int $backlog = 0): void
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_read($socket, int $length, int $type = PHP_BINARY_READ): string
|
||||
function socket_read($socket, int $length, int $mode = PHP_BINARY_READ): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \socket_read($socket, $length, $type);
|
||||
$result = \socket_read($socket, $length, $mode);
|
||||
if ($result === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
@@ -482,14 +518,14 @@ function socket_read($socket, int $length, int $type = PHP_BINARY_READ): string
|
||||
|
||||
/**
|
||||
* The function socket_send sends
|
||||
* len bytes to the socket
|
||||
* socket from buf.
|
||||
* length bytes to the socket
|
||||
* socket from data.
|
||||
*
|
||||
* @param resource $socket A valid socket resource created with socket_create
|
||||
* @param resource $socket A Socket instance created with socket_create
|
||||
* or socket_accept.
|
||||
* @param string $buf A buffer containing the data that will be sent to the remote host.
|
||||
* @param int $len The number of bytes that will be sent to the remote host from
|
||||
* buf.
|
||||
* @param string $data A buffer containing the data that will be sent to the remote host.
|
||||
* @param int $length The number of bytes that will be sent to the remote host from
|
||||
* data.
|
||||
* @param int $flags The value of flags can be any combination of
|
||||
* the following flags, joined with the binary OR (|)
|
||||
* operator.
|
||||
@@ -530,10 +566,10 @@ function socket_read($socket, int $length, int $type = PHP_BINARY_READ): string
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_send($socket, string $buf, int $len, int $flags): int
|
||||
function socket_send($socket, string $data, int $length, int $flags): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \socket_send($socket, $buf, $len, $flags);
|
||||
$result = \socket_send($socket, $data, $length, $flags);
|
||||
if ($result === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
@@ -564,13 +600,13 @@ function socket_sendmsg($socket, array $message, int $flags = 0): int
|
||||
|
||||
/**
|
||||
* The function socket_sendto sends
|
||||
* len bytes from buf
|
||||
* length bytes from data
|
||||
* through the socket socket to the
|
||||
* port at the address addr.
|
||||
* port at the address address.
|
||||
*
|
||||
* @param resource $socket A valid socket resource created using socket_create.
|
||||
* @param string $buf The sent data will be taken from buffer buf.
|
||||
* @param int $len len bytes from buf will be
|
||||
* @param resource $socket A Socket instance created using socket_create.
|
||||
* @param string $data The sent data will be taken from buffer data.
|
||||
* @param int $length length bytes from data will be
|
||||
* sent.
|
||||
* @param int $flags The value of flags can be any combination of
|
||||
* the following flags, joined with the binary OR (|)
|
||||
@@ -608,7 +644,7 @@ function socket_sendmsg($socket, array $message, int $flags = 0): int
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param string $addr IP address of the remote host.
|
||||
* @param string $address IP address of the remote host.
|
||||
* @param int $port port is the remote port number at which the data
|
||||
* will be sent.
|
||||
* @return int socket_sendto returns the number of bytes sent to the
|
||||
@@ -616,10 +652,14 @@ function socket_sendmsg($socket, array $message, int $flags = 0): int
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_sendto($socket, string $buf, int $len, int $flags, string $addr, int $port = 0): int
|
||||
function socket_sendto($socket, string $data, int $length, int $flags, string $address, int $port = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \socket_sendto($socket, $buf, $len, $flags, $addr, $port);
|
||||
if ($port !== null) {
|
||||
$result = \socket_sendto($socket, $data, $length, $flags, $address, $port);
|
||||
} else {
|
||||
$result = \socket_sendto($socket, $data, $length, $flags, $address);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
@@ -636,7 +676,7 @@ function socket_sendto($socket, string $buf, int $len, int $flags, string $addr,
|
||||
* a blocking socket, the script will pause its execution until it receives
|
||||
* a signal or it can perform the operation.
|
||||
*
|
||||
* @param resource $socket A valid socket resource created with socket_create
|
||||
* @param resource $socket A Socket instance created with socket_create
|
||||
* or socket_accept.
|
||||
* @throws SocketsException
|
||||
*
|
||||
@@ -661,7 +701,7 @@ function socket_set_block($socket): void
|
||||
* signal or it can perform the operation. Rather, if the operation would result
|
||||
* in a block, the called function will fail.
|
||||
*
|
||||
* @param resource $socket A valid socket resource created with socket_create
|
||||
* @param resource $socket A Socket instance created with socket_create
|
||||
* or socket_accept.
|
||||
* @throws SocketsException
|
||||
*
|
||||
@@ -678,12 +718,12 @@ function socket_set_nonblock($socket): void
|
||||
|
||||
/**
|
||||
* The socket_set_option function sets the option
|
||||
* specified by the optname parameter, at the
|
||||
* specified by the option parameter, at the
|
||||
* specified protocol level, to the value pointed to
|
||||
* by the optval parameter for the
|
||||
* by the value parameter for the
|
||||
* socket.
|
||||
*
|
||||
* @param resource $socket A valid socket resource created with socket_create
|
||||
* @param resource $socket A Socket instance created with socket_create
|
||||
* or socket_accept.
|
||||
* @param int $level The level parameter specifies the protocol
|
||||
* level at which the option resides. For example, to retrieve options at
|
||||
@@ -692,16 +732,16 @@ function socket_set_nonblock($socket): void
|
||||
* TCP, can be used by specifying the protocol number of that level.
|
||||
* Protocol numbers can be found by using the
|
||||
* getprotobyname function.
|
||||
* @param int $optname The available socket options are the same as those for the
|
||||
* @param int $option The available socket options are the same as those for the
|
||||
* socket_get_option function.
|
||||
* @param int|string|array $optval The option value.
|
||||
* @param int|string|array $value The option value.
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_set_option($socket, int $level, int $optname, $optval): void
|
||||
function socket_set_option($socket, int $level, int $option, $value): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \socket_set_option($socket, $level, $optname, $optval);
|
||||
$result = \socket_set_option($socket, $level, $option, $value);
|
||||
if ($result === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
@@ -713,10 +753,10 @@ function socket_set_option($socket, int $level, int $optname, $optval): void
|
||||
* incoming, outgoing or all data (the default) from being sent through the
|
||||
* socket
|
||||
*
|
||||
* @param resource $socket A valid socket resource created with socket_create.
|
||||
* @param int $how The value of how can be one of the following:
|
||||
* @param resource $socket A Socket instance created with socket_create.
|
||||
* @param int $mode The value of mode can be one of the following:
|
||||
*
|
||||
* possible values for how
|
||||
* possible values for mode
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -743,10 +783,10 @@ function socket_set_option($socket, int $level, int $optname, $optval): void
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_shutdown($socket, int $how = 2): void
|
||||
function socket_shutdown($socket, int $mode = 2): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \socket_shutdown($socket, $how);
|
||||
$result = \socket_shutdown($socket, $mode);
|
||||
if ($result === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
@@ -756,18 +796,18 @@ function socket_shutdown($socket, int $how = 2): void
|
||||
/**
|
||||
* Exports the WSAPROTOCOL_INFO structure into shared memory and returns
|
||||
* an identifier to be used with socket_wsaprotocol_info_import. The
|
||||
* exported ID is only valid for the given target_pid.
|
||||
* exported ID is only valid for the given process_id.
|
||||
*
|
||||
* @param resource $socket A valid socket resource.
|
||||
* @param int $target_pid The ID of the process which will import the socket.
|
||||
* @param resource $socket A Socket instance.
|
||||
* @param int $process_id The ID of the process which will import the socket.
|
||||
* @return string Returns an identifier to be used for the import
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_wsaprotocol_info_export($socket, int $target_pid): string
|
||||
function socket_wsaprotocol_info_export($socket, int $process_id): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \socket_wsaprotocol_info_export($socket, $target_pid);
|
||||
$result = \socket_wsaprotocol_info_export($socket, $process_id);
|
||||
if ($result === false) {
|
||||
throw SocketsException::createFromPhpError();
|
||||
}
|
||||
@@ -780,7 +820,7 @@ function socket_wsaprotocol_info_export($socket, int $target_pid): string
|
||||
*
|
||||
* @param string $info_id The ID which has been returned by a former call to
|
||||
* socket_wsaprotocol_info_export.
|
||||
* @return resource Returns the socket resource
|
||||
* @return resource Returns a Socket instance on success
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
|
||||
320
vendor/thecodingmachine/safe/generated/sodium.php
vendored
320
vendor/thecodingmachine/safe/generated/sodium.php
vendored
@@ -5,24 +5,23 @@ namespace Safe;
|
||||
use Safe\Exceptions\SodiumException;
|
||||
|
||||
/**
|
||||
* Uses a CPU- and memory-hard hash algorithm along with a randomly-generated salt, and memory and CPU limits to generate an ASCII-encoded hash suitable for password storage.
|
||||
* Verify then decrypt with AES-256-GCM.
|
||||
* Only available if sodium_crypto_aead_aes256gcm_is_available returns TRUE.
|
||||
*
|
||||
* @param string $password string; The password to generate a hash for.
|
||||
* @param int $opslimit Represents a maximum amount of computations to perform. Raising this number will make the function require more CPU cycles to compute a key. There are constants available to set the operations limit to appropriate values depending on intended use, in order of strength: SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE, SODIUM_CRYPTO_PWHASH_OPSLIMIT_MODERATE and SODIUM_CRYPTO_PWHASH_OPSLIMIT_SENSITIVE.
|
||||
* @param int $memlimit The maximum amount of RAM that the function will use, in bytes. There are constants to help you choose an appropriate value, in order of size: SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE, SODIUM_CRYPTO_PWHASH_MEMLIMIT_MODERATE, and SODIUM_CRYPTO_PWHASH_MEMLIMIT_SENSITIVE. Typically these should be paired with the matching opslimit values.
|
||||
* @return string Returns the hashed password.
|
||||
*
|
||||
* In order to produce the same password hash from the same password, the same values for opslimit and memlimit must be used. These are embedded within the generated hash, so
|
||||
* everything that's needed to verify the hash is included. This allows
|
||||
* the sodium_crypto_pwhash_str_verify function to verify the hash without
|
||||
* needing separate storage for the other parameters.
|
||||
* @param string $ciphertext Must be in the format provided by sodium_crypto_aead_aes256gcm_encrypt
|
||||
* (ciphertext and tag, concatenated).
|
||||
* @param string $additional_data Additional, authenticated data. This is used in the verification of the authentication tag
|
||||
* appended to the ciphertext, but it is not encrypted or stored in the ciphertext.
|
||||
* @param string $nonce A number that must be only used once, per message. 12 bytes long.
|
||||
* @param string $key Encryption key (256-bit).
|
||||
* @return string Returns the plaintext on success.
|
||||
* @throws SodiumException
|
||||
*
|
||||
*/
|
||||
function sodium_crypto_pwhash_str(string $password, int $opslimit, int $memlimit): string
|
||||
function sodium_crypto_aead_aes256gcm_decrypt(string $ciphertext, string $additional_data, string $nonce, string $key): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \sodium_crypto_pwhash_str($password, $opslimit, $memlimit);
|
||||
$result = \sodium_crypto_aead_aes256gcm_decrypt($ciphertext, $additional_data, $nonce, $key);
|
||||
if ($result === false) {
|
||||
throw SodiumException::createFromPhpError();
|
||||
}
|
||||
@@ -31,28 +30,297 @@ function sodium_crypto_pwhash_str(string $password, int $opslimit, int $memlimit
|
||||
|
||||
|
||||
/**
|
||||
* This function provides low-level access to libsodium's crypto_pwhash key derivation function. Unless you have specific reason to use this function, you should use sodium_crypto_pwhash_str or password_hash functions instead.
|
||||
* Verify then decrypt with ChaCha20-Poly1305.
|
||||
*
|
||||
* @param int $length integer; The length of the password hash to generate, in bytes.
|
||||
* @param string $password string; The password to generate a hash for.
|
||||
* @param string $salt string A salt to add to the password before hashing. The salt should be unpredictable, ideally generated from a good random mumber source such as random_bytes, and have a length of at least SODIUM_CRYPTO_PWHASH_SALTBYTES bytes.
|
||||
* @param int $opslimit Represents a maximum amount of computations to perform. Raising this number will make the function require more CPU cycles to compute a key. There are some constants available to set the operations limit to appropriate values depending on intended use, in order of strength: SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE, SODIUM_CRYPTO_PWHASH_OPSLIMIT_MODERATE and SODIUM_CRYPTO_PWHASH_OPSLIMIT_SENSITIVE.
|
||||
* @param int $memlimit The maximum amount of RAM that the function will use, in bytes. There are constants to help you choose an appropriate value, in order of size: SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE, SODIUM_CRYPTO_PWHASH_MEMLIMIT_MODERATE, and SODIUM_CRYPTO_PWHASH_MEMLIMIT_SENSITIVE. Typically these should be paired with the matching opslimit values.
|
||||
* @param int $alg integer A number indicating the hash algorithm to use. By default SODIUM_CRYPTO_PWHASH_ALG_DEFAULT (the currently recommended algorithm, which can change from one version of libsodium to another), or explicitly using SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13, representing the Argon2id algorithm version 1.3.
|
||||
* @return string Returns the derived key. The return value is a binary string of the hash, not an ASCII-encoded representation, and does not contain additional information about the parameters used to create the hash, so you will need to keep that information if you are ever going to verify the password in future. Use sodium_crypto_pwhash_str to avoid needing to do all that.
|
||||
* @param string $ciphertext Must be in the format provided by sodium_crypto_aead_chacha20poly1305_encrypt
|
||||
* (ciphertext and tag, concatenated).
|
||||
* @param string $additional_data Additional, authenticated data. This is used in the verification of the authentication tag
|
||||
* appended to the ciphertext, but it is not encrypted or stored in the ciphertext.
|
||||
* @param string $nonce A number that must be only used once, per message. 8 bytes long.
|
||||
* @param string $key Encryption key (256-bit).
|
||||
* @return string Returns the plaintext on success.
|
||||
* @throws SodiumException
|
||||
*
|
||||
*/
|
||||
function sodium_crypto_pwhash(int $length, string $password, string $salt, int $opslimit, int $memlimit, int $alg = null): string
|
||||
function sodium_crypto_aead_chacha20poly1305_decrypt(string $ciphertext, string $additional_data, string $nonce, string $key): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($alg !== null) {
|
||||
$result = \sodium_crypto_pwhash($length, $password, $salt, $opslimit, $memlimit, $alg);
|
||||
} else {
|
||||
$result = \sodium_crypto_pwhash($length, $password, $salt, $opslimit, $memlimit);
|
||||
}
|
||||
$result = \sodium_crypto_aead_chacha20poly1305_decrypt($ciphertext, $additional_data, $nonce, $key);
|
||||
if ($result === false) {
|
||||
throw SodiumException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Encrypt then authenticate with ChaCha20-Poly1305.
|
||||
*
|
||||
* @param string $message The plaintext message to encrypt.
|
||||
* @param string $additional_data Additional, authenticated data. This is used in the verification of the authentication tag
|
||||
* appended to the ciphertext, but it is not encrypted or stored in the ciphertext.
|
||||
* @param string $nonce A number that must be only used once, per message. 8 bytes long.
|
||||
* @param string $key Encryption key (256-bit).
|
||||
* @return string Returns the ciphertext and tag on success.
|
||||
* @throws SodiumException
|
||||
*
|
||||
*/
|
||||
function sodium_crypto_aead_chacha20poly1305_encrypt(string $message, string $additional_data, string $nonce, string $key): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \sodium_crypto_aead_chacha20poly1305_encrypt($message, $additional_data, $nonce, $key);
|
||||
if ($result === false) {
|
||||
throw SodiumException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Verify then decrypt with ChaCha20-Poly1305 (IETF variant).
|
||||
*
|
||||
* The IETF variant uses 96-bit nonces and 32-bit internal counters, instead of 64-bit for both.
|
||||
*
|
||||
* @param string $ciphertext Must be in the format provided by sodium_crypto_aead_chacha20poly1305_ietf_encrypt
|
||||
* (ciphertext and tag, concatenated).
|
||||
* @param string $additional_data Additional, authenticated data. This is used in the verification of the authentication tag
|
||||
* appended to the ciphertext, but it is not encrypted or stored in the ciphertext.
|
||||
* @param string $nonce A number that must be only used once, per message. 12 bytes long.
|
||||
* @param string $key Encryption key (256-bit).
|
||||
* @return string Returns the plaintext on success.
|
||||
* @throws SodiumException
|
||||
*
|
||||
*/
|
||||
function sodium_crypto_aead_chacha20poly1305_ietf_decrypt(string $ciphertext, string $additional_data, string $nonce, string $key): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \sodium_crypto_aead_chacha20poly1305_ietf_decrypt($ciphertext, $additional_data, $nonce, $key);
|
||||
if ($result === false) {
|
||||
throw SodiumException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Encrypt then authenticate with ChaCha20-Poly1305 (IETF variant).
|
||||
*
|
||||
* The IETF variant uses 96-bit nonces and 32-bit internal counters, instead of 64-bit for both.
|
||||
*
|
||||
* @param string $message The plaintext message to encrypt.
|
||||
* @param string $additional_data Additional, authenticated data. This is used in the verification of the authentication tag
|
||||
* appended to the ciphertext, but it is not encrypted or stored in the ciphertext.
|
||||
* @param string $nonce A number that must be only used once, per message. 12 bytes long.
|
||||
* @param string $key Encryption key (256-bit).
|
||||
* @return string Returns the ciphertext and tag on success.
|
||||
* @throws SodiumException
|
||||
*
|
||||
*/
|
||||
function sodium_crypto_aead_chacha20poly1305_ietf_encrypt(string $message, string $additional_data, string $nonce, string $key): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \sodium_crypto_aead_chacha20poly1305_ietf_encrypt($message, $additional_data, $nonce, $key);
|
||||
if ($result === false) {
|
||||
throw SodiumException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Verify then decrypt with ChaCha20-Poly1305 (eXtended-nonce variant).
|
||||
*
|
||||
* Generally, XChaCha20-Poly1305 is the best of the provided AEAD modes to use.
|
||||
*
|
||||
* @param string $ciphertext Must be in the format provided by sodium_crypto_aead_chacha20poly1305_ietf_encrypt
|
||||
* (ciphertext and tag, concatenated).
|
||||
* @param string $additional_data Additional, authenticated data. This is used in the verification of the authentication tag
|
||||
* appended to the ciphertext, but it is not encrypted or stored in the ciphertext.
|
||||
* @param string $nonce A number that must be only used once, per message. 24 bytes long.
|
||||
* This is a large enough bound to generate randomly (i.e. random_bytes).
|
||||
* @param string $key Encryption key (256-bit).
|
||||
* @return string Returns the plaintext on success.
|
||||
* @throws SodiumException
|
||||
*
|
||||
*/
|
||||
function sodium_crypto_aead_xchacha20poly1305_ietf_decrypt(string $ciphertext, string $additional_data, string $nonce, string $key): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \sodium_crypto_aead_xchacha20poly1305_ietf_decrypt($ciphertext, $additional_data, $nonce, $key);
|
||||
if ($result === false) {
|
||||
throw SodiumException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Encrypt then authenticate with XChaCha20-Poly1305 (eXtended-nonce variant).
|
||||
*
|
||||
* Generally, XChaCha20-Poly1305 is the best of the provided AEAD modes to use.
|
||||
*
|
||||
* @param string $message The plaintext message to encrypt.
|
||||
* @param string $additional_data Additional, authenticated data. This is used in the verification of the authentication tag
|
||||
* appended to the ciphertext, but it is not encrypted or stored in the ciphertext.
|
||||
* @param string $nonce A number that must be only used once, per message. 24 bytes long.
|
||||
* This is a large enough bound to generate randomly (i.e. random_bytes).
|
||||
* @param string $key Encryption key (256-bit).
|
||||
* @return string Returns the ciphertext and tag on success.
|
||||
* @throws SodiumException
|
||||
*
|
||||
*/
|
||||
function sodium_crypto_aead_xchacha20poly1305_ietf_encrypt(string $message, string $additional_data, string $nonce, string $key): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \sodium_crypto_aead_xchacha20poly1305_ietf_encrypt($message, $additional_data, $nonce, $key);
|
||||
if ($result === false) {
|
||||
throw SodiumException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Verify the authentication tag is valid for a given message and key.
|
||||
*
|
||||
* Unlike with digital signatures (e.g. sodium_crypto_sign_verify_detached),
|
||||
* any party capable of verifying a message is also capable of authenticating
|
||||
* their own messages. (Hence, symmetric authentication.)
|
||||
*
|
||||
* @param string $mac Authentication tag produced by sodium_crypto_auth
|
||||
* @param string $message Message
|
||||
* @param string $key Authentication key
|
||||
* @throws SodiumException
|
||||
*
|
||||
*/
|
||||
function sodium_crypto_auth_verify(string $mac, string $message, string $key): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \sodium_crypto_auth_verify($mac, $message, $key);
|
||||
if ($result === false) {
|
||||
throw SodiumException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Decrypt a message using asymmetric (public key) cryptography.
|
||||
*
|
||||
* @param string $ciphertext The encrypted message to attempt to decrypt.
|
||||
* @param string $nonce A number that must be only used once, per message. 24 bytes long.
|
||||
* This is a large enough bound to generate randomly (i.e. random_bytes).
|
||||
* @param string $key_pair See sodium_crypto_box_keypair_from_secretkey_and_publickey.
|
||||
* This should include the sender's public key and the recipient's secret key.
|
||||
* @return string Returns the plaintext message on success.
|
||||
* @throws SodiumException
|
||||
*
|
||||
*/
|
||||
function sodium_crypto_box_open(string $ciphertext, string $nonce, string $key_pair): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \sodium_crypto_box_open($ciphertext, $nonce, $key_pair);
|
||||
if ($result === false) {
|
||||
throw SodiumException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Decrypt a message that was encrypted with sodium_crypto_box_seal
|
||||
*
|
||||
* @param string $ciphertext The encrypted message
|
||||
* @param string $key_pair The keypair of the recipient. Must include the secret key.
|
||||
* @return string The plaintext on success.
|
||||
* @throws SodiumException
|
||||
*
|
||||
*/
|
||||
function sodium_crypto_box_seal_open(string $ciphertext, string $key_pair): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \sodium_crypto_box_seal_open($ciphertext, $key_pair);
|
||||
if ($result === false) {
|
||||
throw SodiumException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Appends a message to the internal hash state.
|
||||
*
|
||||
* @param string $state The return value of sodium_crypto_generichash_init.
|
||||
* @param string $message Data to append to the hashing state.
|
||||
* @throws SodiumException
|
||||
*
|
||||
*/
|
||||
function sodium_crypto_generichash_update(string &$state, string $message): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \sodium_crypto_generichash_update($state, $message);
|
||||
if ($result === false) {
|
||||
throw SodiumException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Decrypt an encrypted message with a symmetric (shared) key.
|
||||
*
|
||||
* @param string $ciphertext Must be in the format provided by sodium_crypto_secretbox
|
||||
* (ciphertext and tag, concatenated).
|
||||
* @param string $nonce A number that must be only used once, per message. 24 bytes long.
|
||||
* This is a large enough bound to generate randomly (i.e. random_bytes).
|
||||
* @param string $key Encryption key (256-bit).
|
||||
* @return string The decrypted string on success.
|
||||
* @throws SodiumException
|
||||
*
|
||||
*/
|
||||
function sodium_crypto_secretbox_open(string $ciphertext, string $nonce, string $key): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \sodium_crypto_secretbox_open($ciphertext, $nonce, $key);
|
||||
if ($result === false) {
|
||||
throw SodiumException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Verify the signature attached to a message and return the message
|
||||
*
|
||||
* @param string $signed_message A message signed with sodium_crypto_sign
|
||||
* @param string $public_key An Ed25519 public key
|
||||
* @return string Returns the original signed message on success.
|
||||
* @throws SodiumException
|
||||
*
|
||||
*/
|
||||
function sodium_crypto_sign_open(string $signed_message, string $public_key): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \sodium_crypto_sign_open($signed_message, $public_key);
|
||||
if ($result === false) {
|
||||
throw SodiumException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Verify signature for the message
|
||||
*
|
||||
* @param string $signature The cryptographic signature obtained from sodium_crypto_sign_detached
|
||||
* @param string $message The message being verified
|
||||
* @param string $public_key Ed25519 public key
|
||||
* @throws SodiumException
|
||||
*
|
||||
*/
|
||||
function sodium_crypto_sign_verify_detached(string $signature, string $message, string $public_key): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \sodium_crypto_sign_verify_detached($signature, $message, $public_key);
|
||||
if ($result === false) {
|
||||
throw SodiumException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
61
vendor/thecodingmachine/safe/generated/spl.php
vendored
61
vendor/thecodingmachine/safe/generated/spl.php
vendored
@@ -6,19 +6,18 @@ use Safe\Exceptions\SplException;
|
||||
|
||||
/**
|
||||
* This function returns an array with the names of the interfaces that the
|
||||
* given class and its parents implement.
|
||||
* given object_or_class and its parents implement.
|
||||
*
|
||||
* @param mixed $class An object (class instance) or a string (class or interface name).
|
||||
* @param bool $autoload Whether to allow this function to load the class automatically through
|
||||
* the __autoload magic method.
|
||||
* @return array An array on success.
|
||||
* @param object|string $object_or_class An object (class instance) or a string (class or interface name).
|
||||
* @param bool $autoload Whether to call __autoload by default.
|
||||
* @return array An array on success, or FALSE when the given class doesn't exist.
|
||||
* @throws SplException
|
||||
*
|
||||
*/
|
||||
function class_implements($class, bool $autoload = true): array
|
||||
function class_implements($object_or_class, bool $autoload = true): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \class_implements($class, $autoload);
|
||||
$result = \class_implements($object_or_class, $autoload);
|
||||
if ($result === false) {
|
||||
throw SplException::createFromPhpError();
|
||||
}
|
||||
@@ -28,19 +27,18 @@ function class_implements($class, bool $autoload = true): array
|
||||
|
||||
/**
|
||||
* This function returns an array with the name of the parent classes of
|
||||
* the given class.
|
||||
* the given object_or_class.
|
||||
*
|
||||
* @param mixed $class An object (class instance) or a string (class name).
|
||||
* @param bool $autoload Whether to allow this function to load the class automatically through
|
||||
* the __autoload magic method.
|
||||
* @return array An array on success.
|
||||
* @param object|string $object_or_class An object (class instance) or a string (class name).
|
||||
* @param bool $autoload Whether to call __autoload by default.
|
||||
* @return array An array on success, or FALSE when the given class doesn't exist.
|
||||
* @throws SplException
|
||||
*
|
||||
*/
|
||||
function class_parents($class, bool $autoload = true): array
|
||||
function class_parents($object_or_class, bool $autoload = true): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \class_parents($class, $autoload);
|
||||
$result = \class_parents($object_or_class, $autoload);
|
||||
if ($result === false) {
|
||||
throw SplException::createFromPhpError();
|
||||
}
|
||||
@@ -50,20 +48,19 @@ function class_parents($class, bool $autoload = true): array
|
||||
|
||||
/**
|
||||
* This function returns an array with the names of the traits that the
|
||||
* given class uses. This does however not include
|
||||
* given object_or_class uses. This does however not include
|
||||
* any traits used by a parent class.
|
||||
*
|
||||
* @param mixed $class An object (class instance) or a string (class name).
|
||||
* @param bool $autoload Whether to allow this function to load the class automatically through
|
||||
* the __autoload magic method.
|
||||
* @return array An array on success.
|
||||
* @param object|string $object_or_class An object (class instance) or a string (class name).
|
||||
* @param bool $autoload Whether to call __autoload by default.
|
||||
* @return array An array on success, or FALSE when the given class doesn't exist.
|
||||
* @throws SplException
|
||||
*
|
||||
*/
|
||||
function class_uses($class, bool $autoload = true): array
|
||||
function class_uses($object_or_class, bool $autoload = true): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \class_uses($class, $autoload);
|
||||
$result = \class_uses($object_or_class, $autoload);
|
||||
if ($result === false) {
|
||||
throw SplException::createFromPhpError();
|
||||
}
|
||||
@@ -87,27 +84,27 @@ function class_uses($class, bool $autoload = true): array
|
||||
* runs through each of them in the order they are defined. By contrast,
|
||||
* __autoload may only be defined once.
|
||||
*
|
||||
* @param callable(string):void $autoload_function The autoload function being registered.
|
||||
* If no parameter is provided, then the default implementation of
|
||||
* @param callable(string):void $callback The autoload function being registered.
|
||||
* If NULL, then the default implementation of
|
||||
* spl_autoload will be registered.
|
||||
* @param bool $throw This parameter specifies whether
|
||||
* spl_autoload_register should throw
|
||||
* exceptions when the autoload_function
|
||||
* exceptions when the callback
|
||||
* cannot be registered.
|
||||
* @param bool $prepend If true, spl_autoload_register will prepend
|
||||
* the autoloader on the autoload queue instead of appending it.
|
||||
* @throws SplException
|
||||
*
|
||||
*/
|
||||
function spl_autoload_register(callable $autoload_function = null, bool $throw = true, bool $prepend = false): void
|
||||
function spl_autoload_register(callable $callback = null, bool $throw = true, bool $prepend = false): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($prepend !== false) {
|
||||
$result = \spl_autoload_register($autoload_function, $throw, $prepend);
|
||||
$result = \spl_autoload_register($callback, $throw, $prepend);
|
||||
} elseif ($throw !== true) {
|
||||
$result = \spl_autoload_register($autoload_function, $throw);
|
||||
} elseif ($autoload_function !== null) {
|
||||
$result = \spl_autoload_register($autoload_function);
|
||||
$result = \spl_autoload_register($callback, $throw);
|
||||
} elseif ($callback !== null) {
|
||||
$result = \spl_autoload_register($callback);
|
||||
} else {
|
||||
$result = \spl_autoload_register();
|
||||
}
|
||||
@@ -125,14 +122,14 @@ function spl_autoload_register(callable $autoload_function = null, bool $throw =
|
||||
* When this function results in the queue being deactivated, any
|
||||
* __autoload function that previously existed will not be reactivated.
|
||||
*
|
||||
* @param mixed $autoload_function The autoload function being unregistered.
|
||||
* @param mixed $callback The autoload function being unregistered.
|
||||
* @throws SplException
|
||||
*
|
||||
*/
|
||||
function spl_autoload_unregister($autoload_function): void
|
||||
function spl_autoload_unregister($callback): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \spl_autoload_unregister($autoload_function);
|
||||
$result = \spl_autoload_unregister($callback);
|
||||
if ($result === false) {
|
||||
throw SplException::createFromPhpError();
|
||||
}
|
||||
|
||||
108
vendor/thecodingmachine/safe/generated/ssh2.php
vendored
108
vendor/thecodingmachine/safe/generated/ssh2.php
vendored
@@ -380,6 +380,53 @@ function ssh2_exec($session, string $command, string $pty = null, array $env = n
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Accepts a connection created by a listener.
|
||||
*
|
||||
* @param resource $listener An SSH2 Listener resource, obtained from a call to ssh2_forward_listen.
|
||||
* @return Returns a stream resource.
|
||||
* @throws Ssh2Exception
|
||||
*
|
||||
*/
|
||||
function ssh2_forward_accept($listener)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ssh2_forward_accept($listener);
|
||||
if ($result === false) {
|
||||
throw Ssh2Exception::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Binds a port on the remote server and listen for connections.
|
||||
*
|
||||
* @param resource $session An SSH Session resource, obtained from a call to ssh2_connect.
|
||||
* @param int $port The port of the remote server.
|
||||
* @param string $host
|
||||
* @param int $max_connections
|
||||
* @return Returns an SSH2 Listener.
|
||||
* @throws Ssh2Exception
|
||||
*
|
||||
*/
|
||||
function ssh2_forward_listen($session, int $port, string $host = null, int $max_connections = 16)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($max_connections !== 16) {
|
||||
$result = \ssh2_forward_listen($session, $port, $host, $max_connections);
|
||||
} elseif ($host !== null) {
|
||||
$result = \ssh2_forward_listen($session, $port, $host);
|
||||
} else {
|
||||
$result = \ssh2_forward_listen($session, $port);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw Ssh2Exception::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
@@ -496,6 +543,27 @@ function ssh2_scp_send($session, string $local_file, string $remote_file, int $c
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sends an EOF to the stream; this is typically used to close standard input,
|
||||
* while keeping output and error alive. For example, one can send a remote
|
||||
* process some data over standard input, close it to start processing, and
|
||||
* still be able to read out the results without creating additional files.
|
||||
*
|
||||
* @param resource $channel An SSH stream; can be acquired through functions like ssh2_fetch_stream
|
||||
* or ssh2_connect.
|
||||
* @throws Ssh2Exception
|
||||
*
|
||||
*/
|
||||
function ssh2_send_eof($channel): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \ssh2_send_eof($channel);
|
||||
if ($result === false) {
|
||||
throw Ssh2Exception::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Attempts to change the mode of the specified file to that given in
|
||||
* mode.
|
||||
@@ -526,6 +594,7 @@ function ssh2_sftp_chmod($sftp, string $filename, int $mode): void
|
||||
* @param resource $sftp An SSH2 SFTP resource opened by ssh2_sftp.
|
||||
* @param string $dirname Path of the new directory.
|
||||
* @param int $mode Permissions on the new directory.
|
||||
* The actual mode is affected by the current umask.
|
||||
* @param bool $recursive If recursive is TRUE any parent directories
|
||||
* required for dirname will be automatically created as well.
|
||||
* @throws Ssh2Exception
|
||||
@@ -639,3 +708,42 @@ function ssh2_sftp($session)
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Open a shell at the remote end and allocate a stream for it.
|
||||
*
|
||||
* @param resource $session An SSH connection link identifier, obtained from a call to
|
||||
* ssh2_connect.
|
||||
* @param string $term_type term_type should correspond to one of the
|
||||
* entries in the target system's /etc/termcap file.
|
||||
* @param array $env env may be passed as an associative array of
|
||||
* name/value pairs to set in the target environment.
|
||||
* @param int $width Width of the virtual terminal.
|
||||
* @param int $height Height of the virtual terminal.
|
||||
* @param int $width_height_type width_height_type should be one of
|
||||
* SSH2_TERM_UNIT_CHARS or
|
||||
* SSH2_TERM_UNIT_PIXELS.
|
||||
* @return resource Returns a stream resource on success.
|
||||
* @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) {
|
||||
$result = \ssh2_shell($session, $term_type, $env, $width, $height, $width_height_type);
|
||||
} elseif ($height !== 25) {
|
||||
$result = \ssh2_shell($session, $term_type, $env, $width, $height);
|
||||
} elseif ($width !== 80) {
|
||||
$result = \ssh2_shell($session, $term_type, $env, $width);
|
||||
} elseif ($env !== null) {
|
||||
$result = \ssh2_shell($session, $term_type, $env);
|
||||
} else {
|
||||
$result = \ssh2_shell($session, $term_type);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw Ssh2Exception::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
287
vendor/thecodingmachine/safe/generated/stream.php
vendored
287
vendor/thecodingmachine/safe/generated/stream.php
vendored
@@ -7,18 +7,16 @@ use Safe\Exceptions\StreamException;
|
||||
/**
|
||||
* Sets parameters on the specified context.
|
||||
*
|
||||
* @param resource $stream_or_context The stream or context to apply the parameters too.
|
||||
* @param array $params An array of parameters to set.
|
||||
*
|
||||
* params should be an associative array of the structure:
|
||||
* @param resource $context The stream or context to apply the parameters too.
|
||||
* @param array $params An associative array of parameters to be set in the following format:
|
||||
* $params['paramname'] = "paramvalue";.
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_context_set_params($stream_or_context, array $params): void
|
||||
function stream_context_set_params($context, array $params): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \stream_context_set_params($stream_or_context, $params);
|
||||
$result = \stream_context_set_params($context, $params);
|
||||
if ($result === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
@@ -26,25 +24,31 @@ function stream_context_set_params($stream_or_context, array $params): void
|
||||
|
||||
|
||||
/**
|
||||
* Makes a copy of up to maxlength bytes
|
||||
* Makes a copy of up to length bytes
|
||||
* of data from the current position (or from the
|
||||
* offset position, if specified) in
|
||||
* source to dest. If
|
||||
* maxlength is not specified, all remaining content in
|
||||
* source will be copied.
|
||||
* from to to. If
|
||||
* length is NULL, all remaining content in
|
||||
* from will be copied.
|
||||
*
|
||||
* @param resource $source The source stream
|
||||
* @param resource $dest The destination stream
|
||||
* @param int $maxlength Maximum bytes to copy
|
||||
* @param resource $from The source stream
|
||||
* @param resource $to The destination stream
|
||||
* @param int $length Maximum bytes to copy. By default all bytes left are copied.
|
||||
* @param int $offset The offset where to start to copy data
|
||||
* @return int Returns the total count of bytes copied.
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_copy_to_stream($source, $dest, int $maxlength = -1, int $offset = 0): int
|
||||
function stream_copy_to_stream($from, $to, int $length = null, int $offset = 0): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \stream_copy_to_stream($source, $dest, $maxlength, $offset);
|
||||
if ($offset !== 0) {
|
||||
$result = \stream_copy_to_stream($from, $to, $length, $offset);
|
||||
} elseif ($length !== null) {
|
||||
$result = \stream_copy_to_stream($from, $to, $length);
|
||||
} else {
|
||||
$result = \stream_copy_to_stream($from, $to);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
@@ -69,7 +73,7 @@ function stream_copy_to_stream($source, $dest, int $maxlength = -1, int $offset
|
||||
* STREAM_FILTER_WRITE, and/or
|
||||
* STREAM_FILTER_ALL can also be passed to the
|
||||
* read_write parameter to override this behavior.
|
||||
* @param mixed $params This filter will be added with the specified
|
||||
* @param array $params This filter will be added with the specified
|
||||
* params to the end of
|
||||
* the list and will therefore be called last during stream operations.
|
||||
* To add a filter to the beginning of the list, use
|
||||
@@ -83,7 +87,7 @@ function stream_copy_to_stream($source, $dest, int $maxlength = -1, int $offset
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_filter_append($stream, string $filtername, int $read_write = null, $params = null)
|
||||
function stream_filter_append($stream, string $filtername, int $read_write = null, array $params = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($params !== null) {
|
||||
@@ -119,7 +123,7 @@ function stream_filter_append($stream, string $filtername, int $read_write = nul
|
||||
* read_write parameter to override this behavior.
|
||||
* See stream_filter_append for an example of
|
||||
* using this parameter.
|
||||
* @param mixed $params This filter will be added with the specified params
|
||||
* @param array $params This filter will be added with the specified params
|
||||
* to the beginning of the list and will therefore be
|
||||
* called first during stream operations. To add a filter to the end of the
|
||||
* list, use stream_filter_append.
|
||||
@@ -132,7 +136,7 @@ function stream_filter_append($stream, string $filtername, int $read_write = nul
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_filter_prepend($stream, string $filtername, int $read_write = null, $params = null)
|
||||
function stream_filter_prepend($stream, string $filtername, int $read_write = null, array $params = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($params !== null) {
|
||||
@@ -155,8 +159,8 @@ function stream_filter_prepend($stream, string $filtername, int $read_write = nu
|
||||
* filesystem functions (such as fopen,
|
||||
* fread etc.).
|
||||
*
|
||||
* @param string $filtername The filter name to be registered.
|
||||
* @param string $classname To implement a filter, you need to define a class as an extension of
|
||||
* @param string $filter_name The filter name to be registered.
|
||||
* @param string $class To implement a filter, you need to define a class as an extension of
|
||||
* php_user_filter with a number of member
|
||||
* functions. When performing read/write operations on the stream
|
||||
* to which your filter is attached, PHP will pass the data through your
|
||||
@@ -167,10 +171,10 @@ function stream_filter_prepend($stream, string $filtername, int $read_write = nu
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_filter_register(string $filtername, string $classname): void
|
||||
function stream_filter_register(string $filter_name, string $class): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \stream_filter_register($filtername, $classname);
|
||||
$result = \stream_filter_register($filter_name, $class);
|
||||
if ($result === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
@@ -202,11 +206,11 @@ function stream_filter_remove($stream_filter): void
|
||||
* Identical to file_get_contents, except that
|
||||
* stream_get_contents operates on an already open
|
||||
* stream resource and returns the remaining contents in a string, up to
|
||||
* maxlength bytes and starting at the specified
|
||||
* length bytes and starting at the specified
|
||||
* offset.
|
||||
*
|
||||
* @param resource $handle A stream resource (e.g. returned from fopen)
|
||||
* @param int $maxlength The maximum bytes to read. Defaults to -1 (read all the remaining
|
||||
* @param resource $stream A stream resource (e.g. returned from fopen)
|
||||
* @param int $length The maximum bytes to read. Defaults to NULL (read all the remaining
|
||||
* buffer).
|
||||
* @param int $offset Seek to the specified offset before reading. If this number is negative,
|
||||
* no seeking will occur and reading will start from the current position.
|
||||
@@ -214,10 +218,50 @@ function stream_filter_remove($stream_filter): void
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_get_contents($handle, int $maxlength = -1, int $offset = -1): string
|
||||
function stream_get_contents($stream, int $length = null, int $offset = -1): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \stream_get_contents($handle, $maxlength, $offset);
|
||||
if ($offset !== -1) {
|
||||
$result = \stream_get_contents($stream, $length, $offset);
|
||||
} elseif ($length !== null) {
|
||||
$result = \stream_get_contents($stream, $length);
|
||||
} else {
|
||||
$result = \stream_get_contents($stream);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets a line from the given handle.
|
||||
*
|
||||
* Reading ends when length bytes have been read, when
|
||||
* the non-empty string specified by ending is found (which is
|
||||
* not included in the return value), or on EOF
|
||||
* (whichever comes first).
|
||||
*
|
||||
* This function is nearly identical to fgets except in
|
||||
* that it allows end of line delimiters other than the standard \n, \r, and
|
||||
* \r\n, and does not return the delimiter itself.
|
||||
*
|
||||
* @param resource $stream A valid file handle.
|
||||
* @param int $length The maximum number of bytes to read from the handle.
|
||||
* Negative values are not supported.
|
||||
* Zero (0) means the default socket chunk size,
|
||||
* i.e. 8192 bytes.
|
||||
* @param string $ending An optional string delimiter.
|
||||
* @return string Returns a string of up to length bytes read from the file
|
||||
* pointed to by stream.
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_get_line($stream, int $length, string $ending = ""): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \stream_get_line($stream, $length, $ending);
|
||||
if ($result === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
@@ -269,7 +313,7 @@ function stream_resolve_include_path(string $filename): string
|
||||
* (currently, regular files and socket streams).
|
||||
*
|
||||
* @param resource $stream The stream.
|
||||
* @param bool $mode If mode is FALSE, the given stream
|
||||
* @param bool $enable If enable is FALSE, the given stream
|
||||
* will be switched to non-blocking mode, and if TRUE, it
|
||||
* will be switched to blocking mode. This affects calls like
|
||||
* fgets and fread
|
||||
@@ -280,10 +324,10 @@ function stream_resolve_include_path(string $filename): string
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_set_blocking($stream, bool $mode): void
|
||||
function stream_set_blocking($stream, bool $enable): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \stream_set_blocking($stream, $mode);
|
||||
$result = \stream_set_blocking($stream, $enable);
|
||||
if ($result === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
@@ -319,10 +363,11 @@ function stream_set_timeout($stream, int $seconds, int $microseconds = 0): void
|
||||
* Accept a connection on a socket previously created by
|
||||
* stream_socket_server.
|
||||
*
|
||||
* @param resource $server_socket The server socket to accept a connection from.
|
||||
* @param resource $socket The server socket to accept a connection from.
|
||||
* @param float $timeout Override the default socket accept timeout. Time should be given in
|
||||
* seconds.
|
||||
* @param string|null $peername Will be set to the name (address) of the client which connected, if
|
||||
* seconds. By default, default_socket_timeout
|
||||
* is used.
|
||||
* @param string|null $peer_name Will be set to the name (address) of the client which connected, if
|
||||
* included and available from the selected transport.
|
||||
*
|
||||
* Can also be determined later using
|
||||
@@ -331,15 +376,15 @@ function stream_set_timeout($stream, int $seconds, int $microseconds = 0): void
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_socket_accept($server_socket, float $timeout = null, ?string &$peername = null)
|
||||
function stream_socket_accept($socket, float $timeout = null, ?string &$peer_name = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($peername !== null) {
|
||||
$result = \stream_socket_accept($server_socket, $timeout, $peername);
|
||||
if ($peer_name !== null) {
|
||||
$result = \stream_socket_accept($socket, $timeout, $peer_name);
|
||||
} elseif ($timeout !== null) {
|
||||
$result = \stream_socket_accept($server_socket, $timeout);
|
||||
$result = \stream_socket_accept($socket, $timeout);
|
||||
} else {
|
||||
$result = \stream_socket_accept($server_socket);
|
||||
$result = \stream_socket_accept($socket);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
@@ -350,20 +395,21 @@ function stream_socket_accept($server_socket, float $timeout = null, ?string &$p
|
||||
|
||||
/**
|
||||
* Initiates a stream or datagram connection to the destination specified
|
||||
* by remote_socket. The type of socket created
|
||||
* by address. The type of socket created
|
||||
* is determined by the transport specified using standard URL formatting:
|
||||
* transport://target. For Internet Domain sockets
|
||||
* (AF_INET) such as TCP and UDP, the target portion
|
||||
* of the remote_socket parameter should consist of
|
||||
* of the address parameter should consist of
|
||||
* a hostname or IP address followed by a colon and a port number. For Unix
|
||||
* domain sockets, the target portion should point
|
||||
* to the socket file on the filesystem.
|
||||
*
|
||||
* @param string $remote_socket Address to the socket to connect to.
|
||||
* @param int $errno Will be set to the system level error number if connection fails.
|
||||
* @param string $errstr Will be set to the system level error message if the connection fails.
|
||||
* @param string $address Address to the socket to connect to.
|
||||
* @param int|null $error_code Will be set to the system level error number if connection fails.
|
||||
* @param string|null $error_message Will be set to the system level error message if the connection fails.
|
||||
* @param float $timeout Number of seconds until the connect() system call
|
||||
* should timeout.
|
||||
* should timeout. By default, default_socket_timeout
|
||||
* is used.
|
||||
*
|
||||
*
|
||||
* This parameter only applies when not making asynchronous
|
||||
@@ -397,17 +443,17 @@ function stream_socket_accept($server_socket, float $timeout = null, ?string &$p
|
||||
* @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)
|
||||
function stream_socket_client(string $address, ?int &$error_code = null, ?string &$error_message = null, float $timeout = null, int $flags = STREAM_CLIENT_CONNECT, $context = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($context !== null) {
|
||||
$result = \stream_socket_client($remote_socket, $errno, $errstr, $timeout, $flags, $context);
|
||||
$result = \stream_socket_client($address, $error_code, $error_message, $timeout, $flags, $context);
|
||||
} elseif ($flags !== STREAM_CLIENT_CONNECT) {
|
||||
$result = \stream_socket_client($remote_socket, $errno, $errstr, $timeout, $flags);
|
||||
$result = \stream_socket_client($address, $error_code, $error_message, $timeout, $flags);
|
||||
} elseif ($timeout !== null) {
|
||||
$result = \stream_socket_client($remote_socket, $errno, $errstr, $timeout);
|
||||
$result = \stream_socket_client($address, $error_code, $error_message, $timeout);
|
||||
} else {
|
||||
$result = \stream_socket_client($remote_socket, $errno, $errstr);
|
||||
$result = \stream_socket_client($address, $error_code, $error_message);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
@@ -416,6 +462,27 @@ function stream_socket_client(string $remote_socket, int &$errno = null, string
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the local or remote name of a given socket connection.
|
||||
*
|
||||
* @param resource $socket The socket to get the name of.
|
||||
* @param bool $remote If set to TRUE the remote socket name will be returned, if set
|
||||
* to FALSE the local socket name will be returned.
|
||||
* @return string The name of the socket.
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_socket_get_name($socket, bool $remote): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \stream_socket_get_name($socket, $remote);
|
||||
if ($result === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* stream_socket_pair creates a pair of connected,
|
||||
* indistinguishable socket streams. This function is commonly used in IPC
|
||||
@@ -450,14 +517,101 @@ function stream_socket_pair(int $domain, int $type, int $protocol): iterable
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* stream_socket_recvfrom accepts
|
||||
* data from a remote socket up to length bytes.
|
||||
*
|
||||
* @param resource $socket The remote socket.
|
||||
* @param int $length The number of bytes to receive from the socket.
|
||||
* @param int $flags The value of flags can be any combination
|
||||
* of the following:
|
||||
*
|
||||
* Possible values for flags
|
||||
*
|
||||
*
|
||||
*
|
||||
* STREAM_OOB
|
||||
*
|
||||
* Process OOB (out-of-band) data.
|
||||
*
|
||||
*
|
||||
*
|
||||
* STREAM_PEEK
|
||||
*
|
||||
* Retrieve data from the socket, but do not consume the buffer.
|
||||
* Subsequent calls to fread or
|
||||
* stream_socket_recvfrom will see
|
||||
* the same data.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param string|null $address If address is provided it will be populated with
|
||||
* the address of the remote socket.
|
||||
* @return string Returns the read data, as a string.
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_socket_recvfrom($socket, int $length, int $flags = 0, ?string &$address = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \stream_socket_recvfrom($socket, $length, $flags, $address);
|
||||
if ($result === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sends the specified data through the
|
||||
* socket.
|
||||
*
|
||||
* @param resource $socket The socket to send data to.
|
||||
* @param string $data The data to be sent.
|
||||
* @param int $flags The value of flags can be any combination
|
||||
* of the following:
|
||||
*
|
||||
* possible values for flags
|
||||
*
|
||||
*
|
||||
*
|
||||
* STREAM_OOB
|
||||
*
|
||||
* Process OOB (out-of-band) data.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param string $address The address specified when the socket stream was created will be used
|
||||
* unless an alternate address is specified in address.
|
||||
*
|
||||
* If specified, it must be in dotted quad (or [ipv6]) format.
|
||||
* @return int Returns a result code, as an integer.
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_socket_sendto($socket, string $data, int $flags = 0, string $address = ""): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \stream_socket_sendto($socket, $data, $flags, $address);
|
||||
if ($result === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a stream or datagram socket on the specified
|
||||
* local_socket.
|
||||
* address.
|
||||
*
|
||||
* This function only creates a socket, to begin accepting connections
|
||||
* use stream_socket_accept.
|
||||
*
|
||||
* @param string $local_socket The type of socket created is determined by the transport specified
|
||||
* @param string $address The type of socket created is determined by the transport specified
|
||||
* using standard URL formatting: transport://target.
|
||||
*
|
||||
* For Internet Domain sockets (AF_INET) such as TCP and UDP, the
|
||||
@@ -471,17 +625,17 @@ function stream_socket_pair(int $domain, int $type, int $protocol): iterable
|
||||
* A list of available transports can be retrieved using
|
||||
* stream_get_transports. See
|
||||
* for a list of bulitin transports.
|
||||
* @param int $errno If the optional errno and errstr
|
||||
* @param int|null $error_code If the optional error_code and error_message
|
||||
* arguments are present they will be set to indicate the actual system
|
||||
* level error that occurred in the system-level socket(),
|
||||
* bind(), and listen() calls. If
|
||||
* the value returned in errno is
|
||||
* the value returned in error_code is
|
||||
* 0 and the function returned FALSE, it is an
|
||||
* indication that the error occurred before the bind()
|
||||
* call. This is most likely due to a problem initializing the socket.
|
||||
* Note that the errno and
|
||||
* errstr arguments will always be passed by reference.
|
||||
* @param string $errstr See errno description.
|
||||
* Note that the error_code and
|
||||
* error_message arguments will always be passed by reference.
|
||||
* @param string|null $error_message See error_code description.
|
||||
* @param int $flags A bitmask field which may be set to any combination of socket creation
|
||||
* flags.
|
||||
*
|
||||
@@ -492,13 +646,13 @@ function stream_socket_pair(int $domain, int $type, int $protocol): iterable
|
||||
* @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)
|
||||
function stream_socket_server(string $address, ?int &$error_code = null, ?string &$error_message = null, int $flags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN, $context = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($context !== null) {
|
||||
$result = \stream_socket_server($local_socket, $errno, $errstr, $flags, $context);
|
||||
$result = \stream_socket_server($address, $error_code, $error_message, $flags, $context);
|
||||
} else {
|
||||
$result = \stream_socket_server($local_socket, $errno, $errstr, $flags);
|
||||
$result = \stream_socket_server($address, $error_code, $error_message, $flags);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
@@ -512,7 +666,7 @@ function stream_socket_server(string $local_socket, int &$errno = null, string &
|
||||
*
|
||||
* @param resource $stream An open stream (opened with stream_socket_client,
|
||||
* for example)
|
||||
* @param int $how One of the following constants: STREAM_SHUT_RD
|
||||
* @param int $mode One of the following constants: STREAM_SHUT_RD
|
||||
* (disable further receptions), STREAM_SHUT_WR
|
||||
* (disable further transmissions) or
|
||||
* STREAM_SHUT_RDWR (disable further receptions and
|
||||
@@ -520,10 +674,10 @@ function stream_socket_server(string $local_socket, int &$errno = null, string &
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_socket_shutdown($stream, int $how): void
|
||||
function stream_socket_shutdown($stream, int $mode): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \stream_socket_shutdown($stream, $how);
|
||||
$result = \stream_socket_shutdown($stream, $mode);
|
||||
if ($result === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
@@ -554,17 +708,18 @@ function stream_supports_lock($stream): void
|
||||
* fread etc.).
|
||||
*
|
||||
* @param string $protocol The wrapper name to be registered.
|
||||
* @param string $classname The classname which implements the protocol.
|
||||
* Valid protocol names must contain alphanumerics, dots (.), plusses (+), or hyphens (-) only.
|
||||
* @param string $class The classname which implements the protocol.
|
||||
* @param int $flags Should be set to STREAM_IS_URL if
|
||||
* protocol is a URL protocol. Default is 0, local
|
||||
* stream.
|
||||
* @throws StreamException
|
||||
*
|
||||
*/
|
||||
function stream_wrapper_register(string $protocol, string $classname, int $flags = 0): void
|
||||
function stream_wrapper_register(string $protocol, string $class, int $flags = 0): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \stream_wrapper_register($protocol, $classname, $flags);
|
||||
$result = \stream_wrapper_register($protocol, $class, $flags);
|
||||
if ($result === false) {
|
||||
throw StreamException::createFromPhpError();
|
||||
}
|
||||
|
||||
782
vendor/thecodingmachine/safe/generated/strings.php
vendored
782
vendor/thecodingmachine/safe/generated/strings.php
vendored
@@ -7,39 +7,15 @@ use Safe\Exceptions\StringsException;
|
||||
/**
|
||||
* convert_uudecode decodes a uuencoded string.
|
||||
*
|
||||
* @param string $data The uuencoded data.
|
||||
* @param string $string The uuencoded data.
|
||||
* @return string Returns the decoded data as a string.
|
||||
* @throws StringsException
|
||||
*
|
||||
*/
|
||||
function convert_uudecode(string $data): string
|
||||
function convert_uudecode(string $string): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \convert_uudecode($data);
|
||||
if ($result === false) {
|
||||
throw StringsException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* convert_uuencode encodes a string using the uuencode
|
||||
* algorithm.
|
||||
*
|
||||
* Uuencode translates all strings (including binary data) into printable
|
||||
* characters, making them safe for network transmissions. Uuencoded data is
|
||||
* about 35% larger than the original.
|
||||
*
|
||||
* @param string $data The data to be encoded.
|
||||
* @return string Returns the uuencoded data.
|
||||
* @throws StringsException
|
||||
*
|
||||
*/
|
||||
function convert_uuencode(string $data): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \convert_uuencode($data);
|
||||
$result = \convert_uudecode($string);
|
||||
if ($result === false) {
|
||||
throw StringsException::createFromPhpError();
|
||||
}
|
||||
@@ -50,15 +26,15 @@ function convert_uuencode(string $data): string
|
||||
/**
|
||||
* Decodes a hexadecimally encoded binary string.
|
||||
*
|
||||
* @param string $data Hexadecimal representation of data.
|
||||
* @param string $string Hexadecimal representation of data.
|
||||
* @return string Returns the binary representation of the given data.
|
||||
* @throws StringsException
|
||||
*
|
||||
*/
|
||||
function hex2bin(string $data): string
|
||||
function hex2bin(string $string): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \hex2bin($data);
|
||||
$result = \hex2bin($string);
|
||||
if ($result === false) {
|
||||
throw StringsException::createFromPhpError();
|
||||
}
|
||||
@@ -74,48 +50,16 @@ function hex2bin(string $data): string
|
||||
* The hash is a 32-character hexadecimal number.
|
||||
*
|
||||
* @param string $filename The filename
|
||||
* @param bool $raw_output When TRUE, returns the digest in raw binary format with a length of
|
||||
* @param bool $binary When TRUE, returns the digest in raw binary format with a length of
|
||||
* 16.
|
||||
* @return string Returns a string on success, FALSE otherwise.
|
||||
* @throws StringsException
|
||||
*
|
||||
*/
|
||||
function md5_file(string $filename, bool $raw_output = false): string
|
||||
function md5_file(string $filename, bool $binary = false): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \md5_file($filename, $raw_output);
|
||||
if ($result === false) {
|
||||
throw StringsException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Calculates the metaphone key of str.
|
||||
*
|
||||
* Similar to soundex metaphone creates the same key for
|
||||
* similar sounding words. It's more accurate than
|
||||
* soundex as it knows the basic rules of English
|
||||
* pronunciation. The metaphone generated keys are of variable length.
|
||||
*
|
||||
* Metaphone was developed by Lawrence Philips
|
||||
* <lphilips at verity dot com>. It is described in ["Practical
|
||||
* Algorithms for Programmers", Binstock & Rex, Addison Wesley,
|
||||
* 1995].
|
||||
*
|
||||
* @param string $str The input string.
|
||||
* @param int $phonemes This parameter restricts the returned metaphone key to
|
||||
* phonemes characters in length.
|
||||
* The default value of 0 means no restriction.
|
||||
* @return string Returns the metaphone key as a string.
|
||||
* @throws StringsException
|
||||
*
|
||||
*/
|
||||
function metaphone(string $str, int $phonemes = 0): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \metaphone($str, $phonemes);
|
||||
$result = \md5_file($filename, $binary);
|
||||
if ($result === false) {
|
||||
throw StringsException::createFromPhpError();
|
||||
}
|
||||
@@ -127,718 +71,16 @@ function metaphone(string $str, int $phonemes = 0): string
|
||||
*
|
||||
*
|
||||
* @param string $filename The filename of the file to hash.
|
||||
* @param bool $raw_output When TRUE, returns the digest in raw binary format with a length of
|
||||
* @param bool $binary When TRUE, returns the digest in raw binary format with a length of
|
||||
* 20.
|
||||
* @return string Returns a string on success, FALSE otherwise.
|
||||
* @throws StringsException
|
||||
*
|
||||
*/
|
||||
function sha1_file(string $filename, bool $raw_output = false): string
|
||||
function sha1_file(string $filename, bool $binary = false): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \sha1_file($filename, $raw_output);
|
||||
if ($result === false) {
|
||||
throw StringsException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Calculates the soundex key of str.
|
||||
*
|
||||
* Soundex keys have the property that words pronounced similarly
|
||||
* produce the same soundex key, and can thus be used to simplify
|
||||
* searches in databases where you know the pronunciation but not
|
||||
* the spelling. This soundex function returns a string 4 characters
|
||||
* long, starting with a letter.
|
||||
*
|
||||
* This particular soundex function is one described by Donald Knuth
|
||||
* in "The Art Of Computer Programming, vol. 3: Sorting And
|
||||
* Searching", Addison-Wesley (1973), pp. 391-392.
|
||||
*
|
||||
* @param string $str The input string.
|
||||
* @return string Returns the soundex key as a string.
|
||||
* @throws StringsException
|
||||
*
|
||||
*/
|
||||
function soundex(string $str): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \soundex($str);
|
||||
if ($result === false) {
|
||||
throw StringsException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a string produced according to the formatting string
|
||||
* format.
|
||||
*
|
||||
* @param string $format The format string is composed of zero or more directives:
|
||||
* ordinary characters (excluding %) that are
|
||||
* copied directly to the result and conversion
|
||||
* specifications, each of which results in fetching its
|
||||
* own parameter.
|
||||
*
|
||||
* A conversion specification follows this prototype:
|
||||
* %[argnum$][flags][width][.precision]specifier.
|
||||
*
|
||||
* An integer followed by a dollar sign $,
|
||||
* to specify which number argument to treat in the conversion.
|
||||
*
|
||||
*
|
||||
* Flags
|
||||
*
|
||||
*
|
||||
*
|
||||
* Flag
|
||||
* Description
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* -
|
||||
*
|
||||
* Left-justify within the given field width;
|
||||
* Right justification is the default
|
||||
*
|
||||
*
|
||||
*
|
||||
* +
|
||||
*
|
||||
* Prefix positive numbers with a plus sign
|
||||
* +; Default only negative
|
||||
* are prefixed with a negative sign.
|
||||
*
|
||||
*
|
||||
*
|
||||
* (space)
|
||||
*
|
||||
* Pads the result with spaces.
|
||||
* This is the default.
|
||||
*
|
||||
*
|
||||
*
|
||||
* 0
|
||||
*
|
||||
* Only left-pads numbers with zeros.
|
||||
* With s specifiers this can
|
||||
* also right-pad with zeros.
|
||||
*
|
||||
*
|
||||
*
|
||||
* '(char)
|
||||
*
|
||||
* Pads the result with the character (char).
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* An integer that says how many characters (minimum)
|
||||
* this conversion should result in.
|
||||
*
|
||||
* A period . followed by an integer
|
||||
* who's meaning depends on the specifier:
|
||||
*
|
||||
*
|
||||
*
|
||||
* For e, E,
|
||||
* f and F
|
||||
* specifiers: this is the number of digits to be printed
|
||||
* after the decimal point (by default, this is 6).
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* For g and G
|
||||
* specifiers: this is the maximum number of significant
|
||||
* digits to be printed.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* For s specifier: it acts as a cutoff point,
|
||||
* setting a maximum character limit to the string.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* If the period is specified without an explicit value for precision,
|
||||
* 0 is assumed.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Specifiers
|
||||
*
|
||||
*
|
||||
*
|
||||
* Specifier
|
||||
* Description
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* %
|
||||
*
|
||||
* A literal percent character. No argument is required.
|
||||
*
|
||||
*
|
||||
*
|
||||
* b
|
||||
*
|
||||
* The argument is treated as an integer and presented
|
||||
* as a binary number.
|
||||
*
|
||||
*
|
||||
*
|
||||
* c
|
||||
*
|
||||
* The argument is treated as an integer and presented
|
||||
* as the character with that ASCII.
|
||||
*
|
||||
*
|
||||
*
|
||||
* d
|
||||
*
|
||||
* The argument is treated as an integer and presented
|
||||
* as a (signed) decimal number.
|
||||
*
|
||||
*
|
||||
*
|
||||
* e
|
||||
*
|
||||
* The argument is treated as scientific notation (e.g. 1.2e+2).
|
||||
* The precision specifier stands for the number of digits after the
|
||||
* decimal point since PHP 5.2.1. In earlier versions, it was taken as
|
||||
* number of significant digits (one less).
|
||||
*
|
||||
*
|
||||
*
|
||||
* E
|
||||
*
|
||||
* Like the e specifier but uses
|
||||
* uppercase letter (e.g. 1.2E+2).
|
||||
*
|
||||
*
|
||||
*
|
||||
* f
|
||||
*
|
||||
* The argument is treated as a float and presented
|
||||
* as a floating-point number (locale aware).
|
||||
*
|
||||
*
|
||||
*
|
||||
* F
|
||||
*
|
||||
* The argument is treated as a float and presented
|
||||
* as a floating-point number (non-locale aware).
|
||||
* Available as of PHP 5.0.3.
|
||||
*
|
||||
*
|
||||
*
|
||||
* g
|
||||
*
|
||||
*
|
||||
* General format.
|
||||
*
|
||||
*
|
||||
* Let P equal the precision if nonzero, 6 if the precision is omitted,
|
||||
* or 1 if the precision is zero.
|
||||
* Then, if a conversion with style E would have an exponent of X:
|
||||
*
|
||||
*
|
||||
* If P > X ≥ −4, the conversion is with style f and precision P − (X + 1).
|
||||
* Otherwise, the conversion is with style e and precision P − 1.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* G
|
||||
*
|
||||
* Like the g specifier but uses
|
||||
* E and f.
|
||||
*
|
||||
*
|
||||
*
|
||||
* o
|
||||
*
|
||||
* The argument is treated as an integer and presented
|
||||
* as an octal number.
|
||||
*
|
||||
*
|
||||
*
|
||||
* s
|
||||
*
|
||||
* The argument is treated and presented as a string.
|
||||
*
|
||||
*
|
||||
*
|
||||
* u
|
||||
*
|
||||
* The argument is treated as an integer and presented
|
||||
* as an unsigned decimal number.
|
||||
*
|
||||
*
|
||||
*
|
||||
* x
|
||||
*
|
||||
* The argument is treated as an integer and presented
|
||||
* as a hexadecimal number (with lowercase letters).
|
||||
*
|
||||
*
|
||||
*
|
||||
* X
|
||||
*
|
||||
* The argument is treated as an integer and presented
|
||||
* as a hexadecimal number (with uppercase letters).
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* General format.
|
||||
*
|
||||
* Let P equal the precision if nonzero, 6 if the precision is omitted,
|
||||
* or 1 if the precision is zero.
|
||||
* Then, if a conversion with style E would have an exponent of X:
|
||||
*
|
||||
* If P > X ≥ −4, the conversion is with style f and precision P − (X + 1).
|
||||
* Otherwise, the conversion is with style e and precision P − 1.
|
||||
*
|
||||
* The c type specifier ignores padding and width
|
||||
*
|
||||
* Attempting to use a combination of the string and width specifiers with character sets that require more than one byte per character may result in unexpected results
|
||||
*
|
||||
* Variables will be co-erced to a suitable type for the specifier:
|
||||
*
|
||||
* Type Handling
|
||||
*
|
||||
*
|
||||
*
|
||||
* Type
|
||||
* Specifiers
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* string
|
||||
* s
|
||||
*
|
||||
*
|
||||
* integer
|
||||
*
|
||||
* d,
|
||||
* u,
|
||||
* c,
|
||||
* o,
|
||||
* x,
|
||||
* X,
|
||||
* b
|
||||
*
|
||||
*
|
||||
*
|
||||
* double
|
||||
*
|
||||
* g,
|
||||
* G,
|
||||
* e,
|
||||
* E,
|
||||
* f,
|
||||
* F
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param mixed $params
|
||||
* @return string Returns a string produced according to the formatting string
|
||||
* format.
|
||||
* @throws StringsException
|
||||
*
|
||||
*/
|
||||
function sprintf(string $format, ...$params): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($params !== []) {
|
||||
$result = \sprintf($format, ...$params);
|
||||
} else {
|
||||
$result = \sprintf($format);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw StringsException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the portion of string specified by the
|
||||
* start and length parameters.
|
||||
*
|
||||
* @param string $string The input string.
|
||||
* @param int $start If start is non-negative, the returned string
|
||||
* will start at the start'th position in
|
||||
* string, counting from zero. For instance,
|
||||
* in the string 'abcdef', the character at
|
||||
* position 0 is 'a', the
|
||||
* character at position 2 is
|
||||
* 'c', and so forth.
|
||||
*
|
||||
* If start is negative, the returned string
|
||||
* will start at the start'th character
|
||||
* from the end of string.
|
||||
*
|
||||
* If string is less than
|
||||
* start characters long, FALSE will be returned.
|
||||
*
|
||||
*
|
||||
* Using a negative start
|
||||
*
|
||||
*
|
||||
* ]]>
|
||||
*
|
||||
*
|
||||
* @param int $length If length is given and is positive, the string
|
||||
* returned will contain at most length characters
|
||||
* beginning from start (depending on the length of
|
||||
* string).
|
||||
*
|
||||
* If length is given and is negative, then that many
|
||||
* characters will be omitted from the end of string
|
||||
* (after the start position has been calculated when a
|
||||
* start is negative). If
|
||||
* start denotes the position of this truncation or
|
||||
* beyond, FALSE will be returned.
|
||||
*
|
||||
* If length is given and is 0,
|
||||
* FALSE or NULL, an empty string will be returned.
|
||||
*
|
||||
* If length is omitted, the substring starting from
|
||||
* start until the end of the string will be
|
||||
* returned.
|
||||
* @return string Returns the extracted part of string;, or
|
||||
* an empty string.
|
||||
* @throws StringsException
|
||||
*
|
||||
*/
|
||||
function substr(string $string, int $start, int $length = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($length !== null) {
|
||||
$result = \substr($string, $start, $length);
|
||||
} else {
|
||||
$result = \substr($string, $start);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw StringsException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Operates as sprintf but accepts an array of
|
||||
* arguments, rather than a variable number of arguments.
|
||||
*
|
||||
* @param string $format The format string is composed of zero or more directives:
|
||||
* ordinary characters (excluding %) that are
|
||||
* copied directly to the result and conversion
|
||||
* specifications, each of which results in fetching its
|
||||
* own parameter.
|
||||
*
|
||||
* A conversion specification follows this prototype:
|
||||
* %[argnum$][flags][width][.precision]specifier.
|
||||
*
|
||||
* An integer followed by a dollar sign $,
|
||||
* to specify which number argument to treat in the conversion.
|
||||
*
|
||||
*
|
||||
* Flags
|
||||
*
|
||||
*
|
||||
*
|
||||
* Flag
|
||||
* Description
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* -
|
||||
*
|
||||
* Left-justify within the given field width;
|
||||
* Right justification is the default
|
||||
*
|
||||
*
|
||||
*
|
||||
* +
|
||||
*
|
||||
* Prefix positive numbers with a plus sign
|
||||
* +; Default only negative
|
||||
* are prefixed with a negative sign.
|
||||
*
|
||||
*
|
||||
*
|
||||
* (space)
|
||||
*
|
||||
* Pads the result with spaces.
|
||||
* This is the default.
|
||||
*
|
||||
*
|
||||
*
|
||||
* 0
|
||||
*
|
||||
* Only left-pads numbers with zeros.
|
||||
* With s specifiers this can
|
||||
* also right-pad with zeros.
|
||||
*
|
||||
*
|
||||
*
|
||||
* '(char)
|
||||
*
|
||||
* Pads the result with the character (char).
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* An integer that says how many characters (minimum)
|
||||
* this conversion should result in.
|
||||
*
|
||||
* A period . followed by an integer
|
||||
* who's meaning depends on the specifier:
|
||||
*
|
||||
*
|
||||
*
|
||||
* For e, E,
|
||||
* f and F
|
||||
* specifiers: this is the number of digits to be printed
|
||||
* after the decimal point (by default, this is 6).
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* For g and G
|
||||
* specifiers: this is the maximum number of significant
|
||||
* digits to be printed.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* For s specifier: it acts as a cutoff point,
|
||||
* setting a maximum character limit to the string.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* If the period is specified without an explicit value for precision,
|
||||
* 0 is assumed.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Specifiers
|
||||
*
|
||||
*
|
||||
*
|
||||
* Specifier
|
||||
* Description
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* %
|
||||
*
|
||||
* A literal percent character. No argument is required.
|
||||
*
|
||||
*
|
||||
*
|
||||
* b
|
||||
*
|
||||
* The argument is treated as an integer and presented
|
||||
* as a binary number.
|
||||
*
|
||||
*
|
||||
*
|
||||
* c
|
||||
*
|
||||
* The argument is treated as an integer and presented
|
||||
* as the character with that ASCII.
|
||||
*
|
||||
*
|
||||
*
|
||||
* d
|
||||
*
|
||||
* The argument is treated as an integer and presented
|
||||
* as a (signed) decimal number.
|
||||
*
|
||||
*
|
||||
*
|
||||
* e
|
||||
*
|
||||
* The argument is treated as scientific notation (e.g. 1.2e+2).
|
||||
* The precision specifier stands for the number of digits after the
|
||||
* decimal point since PHP 5.2.1. In earlier versions, it was taken as
|
||||
* number of significant digits (one less).
|
||||
*
|
||||
*
|
||||
*
|
||||
* E
|
||||
*
|
||||
* Like the e specifier but uses
|
||||
* uppercase letter (e.g. 1.2E+2).
|
||||
*
|
||||
*
|
||||
*
|
||||
* f
|
||||
*
|
||||
* The argument is treated as a float and presented
|
||||
* as a floating-point number (locale aware).
|
||||
*
|
||||
*
|
||||
*
|
||||
* F
|
||||
*
|
||||
* The argument is treated as a float and presented
|
||||
* as a floating-point number (non-locale aware).
|
||||
* Available as of PHP 5.0.3.
|
||||
*
|
||||
*
|
||||
*
|
||||
* g
|
||||
*
|
||||
*
|
||||
* General format.
|
||||
*
|
||||
*
|
||||
* Let P equal the precision if nonzero, 6 if the precision is omitted,
|
||||
* or 1 if the precision is zero.
|
||||
* Then, if a conversion with style E would have an exponent of X:
|
||||
*
|
||||
*
|
||||
* If P > X ≥ −4, the conversion is with style f and precision P − (X + 1).
|
||||
* Otherwise, the conversion is with style e and precision P − 1.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* G
|
||||
*
|
||||
* Like the g specifier but uses
|
||||
* E and f.
|
||||
*
|
||||
*
|
||||
*
|
||||
* o
|
||||
*
|
||||
* The argument is treated as an integer and presented
|
||||
* as an octal number.
|
||||
*
|
||||
*
|
||||
*
|
||||
* s
|
||||
*
|
||||
* The argument is treated and presented as a string.
|
||||
*
|
||||
*
|
||||
*
|
||||
* u
|
||||
*
|
||||
* The argument is treated as an integer and presented
|
||||
* as an unsigned decimal number.
|
||||
*
|
||||
*
|
||||
*
|
||||
* x
|
||||
*
|
||||
* The argument is treated as an integer and presented
|
||||
* as a hexadecimal number (with lowercase letters).
|
||||
*
|
||||
*
|
||||
*
|
||||
* X
|
||||
*
|
||||
* The argument is treated as an integer and presented
|
||||
* as a hexadecimal number (with uppercase letters).
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* General format.
|
||||
*
|
||||
* Let P equal the precision if nonzero, 6 if the precision is omitted,
|
||||
* or 1 if the precision is zero.
|
||||
* Then, if a conversion with style E would have an exponent of X:
|
||||
*
|
||||
* If P > X ≥ −4, the conversion is with style f and precision P − (X + 1).
|
||||
* Otherwise, the conversion is with style e and precision P − 1.
|
||||
*
|
||||
* The c type specifier ignores padding and width
|
||||
*
|
||||
* Attempting to use a combination of the string and width specifiers with character sets that require more than one byte per character may result in unexpected results
|
||||
*
|
||||
* Variables will be co-erced to a suitable type for the specifier:
|
||||
*
|
||||
* Type Handling
|
||||
*
|
||||
*
|
||||
*
|
||||
* Type
|
||||
* Specifiers
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* string
|
||||
* s
|
||||
*
|
||||
*
|
||||
* integer
|
||||
*
|
||||
* d,
|
||||
* u,
|
||||
* c,
|
||||
* o,
|
||||
* x,
|
||||
* X,
|
||||
* b
|
||||
*
|
||||
*
|
||||
*
|
||||
* double
|
||||
*
|
||||
* g,
|
||||
* G,
|
||||
* e,
|
||||
* E,
|
||||
* f,
|
||||
* F
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param array $args
|
||||
* @return string Return array values as a formatted string according to
|
||||
* format.
|
||||
* @throws StringsException
|
||||
*
|
||||
*/
|
||||
function vsprintf(string $format, array $args): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \vsprintf($format, $args);
|
||||
$result = \sha1_file($filename, $binary);
|
||||
if ($result === false) {
|
||||
throw StringsException::createFromPhpError();
|
||||
}
|
||||
|
||||
@@ -4,6 +4,46 @@ namespace Safe;
|
||||
|
||||
use Safe\Exceptions\SwooleException;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param string $hostname The host name.
|
||||
* @param callable $callback The host name.
|
||||
*
|
||||
* The IP address.
|
||||
* @throws SwooleException
|
||||
*
|
||||
*/
|
||||
function swoole_async_dns_lookup(string $hostname, callable $callback): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \swoole_async_dns_lookup($hostname, $callback);
|
||||
if ($result === false) {
|
||||
throw SwooleException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param string $filename The filename of the file being read.
|
||||
* @param string $callback The name of the file.
|
||||
*
|
||||
* The content read from the file.
|
||||
* @throws SwooleException
|
||||
*
|
||||
*/
|
||||
function swoole_async_readfile(string $filename, string $callback): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \swoole_async_readfile($filename, $callback);
|
||||
if ($result === false) {
|
||||
throw SwooleException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
||||
477
vendor/thecodingmachine/safe/generated/uodbc.php
vendored
477
vendor/thecodingmachine/safe/generated/uodbc.php
vendored
@@ -10,24 +10,24 @@ use Safe\Exceptions\UodbcException;
|
||||
* By default, auto-commit is on for a connection. Disabling
|
||||
* auto-commit is equivalent with starting a transaction.
|
||||
*
|
||||
* @param resource $connection_id The ODBC connection identifier,
|
||||
* @param resource $odbc The ODBC connection identifier,
|
||||
* see odbc_connect for details.
|
||||
* @param bool $OnOff If OnOff is TRUE, auto-commit is enabled, if
|
||||
* @param bool $enable If enable is TRUE, auto-commit is enabled, if
|
||||
* it is FALSE auto-commit is disabled.
|
||||
* @return mixed Without the OnOff parameter, this function returns
|
||||
* auto-commit status for connection_id. Non-zero is
|
||||
* @return mixed Without the enable parameter, this function returns
|
||||
* auto-commit status for odbc. Non-zero is
|
||||
* returned if auto-commit is on, 0 if it is off, or FALSE if an error
|
||||
* occurs.
|
||||
*
|
||||
* If OnOff is set, this function returns TRUE on
|
||||
* If enable is set, this function returns TRUE on
|
||||
* success.
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_autocommit($connection_id, bool $OnOff = false)
|
||||
function odbc_autocommit($odbc, bool $enable = false)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \odbc_autocommit($connection_id, $OnOff);
|
||||
$result = \odbc_autocommit($odbc, $enable);
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
@@ -103,9 +103,9 @@ function odbc_autocommit($connection_id, bool $OnOff = false)
|
||||
* If odbc_result is used, passthru means that the data are
|
||||
* sent directly to the client (i.e. printed).
|
||||
*
|
||||
* @param int $result_id The result identifier.
|
||||
* @param int $statement The result identifier.
|
||||
*
|
||||
* If result_id is 0, the
|
||||
* If statement is 0, the
|
||||
* settings apply as default for new results.
|
||||
* @param int $mode Possible values for mode are:
|
||||
*
|
||||
@@ -134,10 +134,10 @@ function odbc_autocommit($connection_id, bool $OnOff = false)
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_binmode(int $result_id, int $mode): void
|
||||
function odbc_binmode(int $statement, int $mode): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \odbc_binmode($result_id, $mode);
|
||||
$result = \odbc_binmode($statement, $mode);
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
@@ -147,18 +147,18 @@ function odbc_binmode(int $result_id, int $mode): void
|
||||
/**
|
||||
* Lists columns and associated privileges for the given table.
|
||||
*
|
||||
* @param resource $connection_id The ODBC connection identifier,
|
||||
* @param resource $odbc The ODBC connection identifier,
|
||||
* see odbc_connect for details.
|
||||
* @param string $catalog The catalog ('qualifier' in ODBC 2 parlance).
|
||||
* @param string $schema The schema ('owner' in ODBC 2 parlance).
|
||||
* This parameter accepts the following search patterns:
|
||||
* % to match zero or more characters,
|
||||
* and _ to match a single character.
|
||||
* @param string $table_name The table name.
|
||||
* @param string $table The table name.
|
||||
* This parameter accepts the following search patterns:
|
||||
* % to match zero or more characters,
|
||||
* and _ to match a single character.
|
||||
* @param string $column_name The column name.
|
||||
* @param string $column The column name.
|
||||
* This parameter accepts the following search patterns:
|
||||
* % to match zero or more characters,
|
||||
* and _ to match a single character.
|
||||
@@ -181,10 +181,10 @@ function odbc_binmode(int $result_id, int $mode): void
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_columnprivileges($connection_id, string $catalog, string $schema, string $table_name, string $column_name)
|
||||
function odbc_columnprivileges($odbc, string $catalog, string $schema, string $table, string $column)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \odbc_columnprivileges($connection_id, $catalog, $schema, $table_name, $column_name);
|
||||
$result = \odbc_columnprivileges($odbc, $catalog, $schema, $table, $column);
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
@@ -195,18 +195,18 @@ function odbc_columnprivileges($connection_id, string $catalog, string $schema,
|
||||
/**
|
||||
* Lists all columns in the requested range.
|
||||
*
|
||||
* @param resource $connection_id The ODBC connection identifier,
|
||||
* @param resource $odbc The ODBC connection identifier,
|
||||
* see odbc_connect for details.
|
||||
* @param string $catalog The catalog ('qualifier' in ODBC 2 parlance).
|
||||
* @param string $schema The schema ('owner' in ODBC 2 parlance).
|
||||
* This parameter accepts the following search patterns:
|
||||
* % to match zero or more characters,
|
||||
* and _ to match a single character.
|
||||
* @param string $table_name The table name.
|
||||
* @param string $table The table name.
|
||||
* This parameter accepts the following search patterns:
|
||||
* % to match zero or more characters,
|
||||
* and _ to match a single character.
|
||||
* @param string $column_name The column name.
|
||||
* @param string $column The column name.
|
||||
* This parameter accepts the following search patterns:
|
||||
* % to match zero or more characters,
|
||||
* and _ to match a single character.
|
||||
@@ -237,19 +237,19 @@ function odbc_columnprivileges($connection_id, string $catalog, string $schema,
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_columns($connection_id, string $catalog = null, string $schema = null, string $table_name = null, string $column_name = null)
|
||||
function odbc_columns($odbc, string $catalog = null, string $schema = null, string $table = null, string $column = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($column_name !== null) {
|
||||
$result = \odbc_columns($connection_id, $catalog, $schema, $table_name, $column_name);
|
||||
} elseif ($table_name !== null) {
|
||||
$result = \odbc_columns($connection_id, $catalog, $schema, $table_name);
|
||||
if ($column !== null) {
|
||||
$result = \odbc_columns($odbc, $catalog, $schema, $table, $column);
|
||||
} elseif ($table !== null) {
|
||||
$result = \odbc_columns($odbc, $catalog, $schema, $table);
|
||||
} elseif ($schema !== null) {
|
||||
$result = \odbc_columns($connection_id, $catalog, $schema);
|
||||
$result = \odbc_columns($odbc, $catalog, $schema);
|
||||
} elseif ($catalog !== null) {
|
||||
$result = \odbc_columns($connection_id, $catalog);
|
||||
$result = \odbc_columns($odbc, $catalog);
|
||||
} else {
|
||||
$result = \odbc_columns($connection_id);
|
||||
$result = \odbc_columns($odbc);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
@@ -261,26 +261,88 @@ function odbc_columns($connection_id, string $catalog = null, string $schema = n
|
||||
/**
|
||||
* Commits all pending transactions on the connection.
|
||||
*
|
||||
* @param resource $connection_id The ODBC connection identifier,
|
||||
* @param resource $odbc The ODBC connection identifier,
|
||||
* see odbc_connect for details.
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_commit($connection_id): void
|
||||
function odbc_commit($odbc): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \odbc_commit($connection_id);
|
||||
$result = \odbc_commit($odbc);
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param string $dsn The database source name for the connection. Alternatively, a
|
||||
* DSN-less connection string can be used.
|
||||
* @param string $user The username.
|
||||
* @param string $password The password.
|
||||
* @param int $cursor_option This sets the type of cursor to be used
|
||||
* for this connection. This parameter is not normally needed, but
|
||||
* can be useful for working around problems with some ODBC drivers.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* SQL_CUR_USE_IF_NEEDED
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* SQL_CUR_USE_ODBC
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* SQL_CUR_USE_DRIVER
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return resource Returns an ODBC connection.
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_connect(string $dsn, string $user, string $password, int $cursor_option = SQL_CUR_USE_DRIVER)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \odbc_connect($dsn, $user, $password, $cursor_option);
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the cursorname for the given result_id.
|
||||
*
|
||||
* @param resource $statement The result identifier.
|
||||
* @return string Returns the cursor name, as a string.
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_cursor($statement): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \odbc_cursor($statement);
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function will return the list of available DSN (after calling it
|
||||
* several times).
|
||||
*
|
||||
* @param resource $connection_id The ODBC connection identifier,
|
||||
* @param resource $odbc The ODBC connection identifier,
|
||||
* see odbc_connect for details.
|
||||
* @param int $fetch_type The fetch_type can be one of two constant types:
|
||||
* SQL_FETCH_FIRST, SQL_FETCH_NEXT.
|
||||
@@ -291,10 +353,10 @@ function odbc_commit($connection_id): void
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_data_source($connection_id, int $fetch_type): array
|
||||
function odbc_data_source($odbc, int $fetch_type): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \odbc_data_source($connection_id, $fetch_type);
|
||||
$result = \odbc_data_source($odbc, $fetch_type);
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
@@ -305,23 +367,18 @@ function odbc_data_source($connection_id, int $fetch_type): array
|
||||
/**
|
||||
* Sends an SQL statement to the database server.
|
||||
*
|
||||
* @param resource $connection_id The ODBC connection identifier,
|
||||
* @param resource $odbc The ODBC connection identifier,
|
||||
* see odbc_connect for details.
|
||||
* @param string $query_string The SQL statement.
|
||||
* @param int $flags This parameter is currently not used.
|
||||
* @param string $query The SQL statement.
|
||||
* @return resource Returns an ODBC result identifier if the SQL command was executed
|
||||
* successfully.
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_exec($connection_id, string $query_string, int $flags = null)
|
||||
function odbc_exec($odbc, string $query)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($flags !== null) {
|
||||
$result = \odbc_exec($connection_id, $query_string, $flags);
|
||||
} else {
|
||||
$result = \odbc_exec($connection_id, $query_string);
|
||||
}
|
||||
$result = \odbc_exec($odbc, $query);
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
@@ -332,27 +389,23 @@ function odbc_exec($connection_id, string $query_string, int $flags = null)
|
||||
/**
|
||||
* Executes a statement prepared with odbc_prepare.
|
||||
*
|
||||
* @param resource $result_id The result id resource, from odbc_prepare.
|
||||
* @param array $parameters_array Parameters in parameter_array will be
|
||||
* @param resource $statement The result id resource, from odbc_prepare.
|
||||
* @param array $params Parameters in params will be
|
||||
* substituted for placeholders in the prepared statement in order.
|
||||
* Elements of this array will be converted to strings by calling this
|
||||
* function.
|
||||
*
|
||||
* Any parameters in parameter_array which
|
||||
* Any parameters in params which
|
||||
* start and end with single quotes will be taken as the name of a
|
||||
* file to read and send to the database server as the data for the
|
||||
* appropriate placeholder.
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_execute($result_id, array $parameters_array = null): void
|
||||
function odbc_execute($statement, array $params = []): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($parameters_array !== null) {
|
||||
$result = \odbc_execute($result_id, $parameters_array);
|
||||
} else {
|
||||
$result = \odbc_execute($result_id);
|
||||
}
|
||||
$result = \odbc_execute($statement, $params);
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
@@ -362,25 +415,21 @@ function odbc_execute($result_id, array $parameters_array = null): void
|
||||
/**
|
||||
* Fetch one result row into array.
|
||||
*
|
||||
* @param resource $result_id The result resource.
|
||||
* @param array|null $result_array The result array
|
||||
* @param resource $statement The result resource.
|
||||
* @param array|null $array The result array
|
||||
* that can be of any type since it will be converted to type
|
||||
* array. The array will contain the column values starting at array
|
||||
* index 0.
|
||||
* @param int $rownumber The row number.
|
||||
* @param int $row The row number.
|
||||
* @return int Returns the number of columns in the result;
|
||||
* FALSE on error.
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_fetch_into($result_id, ?array &$result_array, int $rownumber = null): int
|
||||
function odbc_fetch_into($statement, ?array &$array, int $row = 0): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($rownumber !== null) {
|
||||
$result = \odbc_fetch_into($result_id, $result_array, $rownumber);
|
||||
} else {
|
||||
$result = \odbc_fetch_into($result_id, $result_array);
|
||||
}
|
||||
$result = \odbc_fetch_into($statement, $array, $row);
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
@@ -392,16 +441,16 @@ function odbc_fetch_into($result_id, ?array &$result_array, int $rownumber = nul
|
||||
* Gets the length of the field referenced by number in the given result
|
||||
* identifier.
|
||||
*
|
||||
* @param resource $result_id The result identifier.
|
||||
* @param int $field_number The field number. Field numbering starts at 1.
|
||||
* @param resource $statement The result identifier.
|
||||
* @param int $field The field number. Field numbering starts at 1.
|
||||
* @return int Returns the field length.
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_field_len($result_id, int $field_number): int
|
||||
function odbc_field_len($statement, int $field): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \odbc_field_len($result_id, $field_number);
|
||||
$result = \odbc_field_len($statement, $field);
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
@@ -413,16 +462,16 @@ function odbc_field_len($result_id, int $field_number): int
|
||||
* Gets the name of the field occupying the given column number in the given
|
||||
* result identifier.
|
||||
*
|
||||
* @param resource $result_id The result identifier.
|
||||
* @param int $field_number The field number. Field numbering starts at 1.
|
||||
* @param resource $statement The result identifier.
|
||||
* @param int $field The field number. Field numbering starts at 1.
|
||||
* @return string Returns the field name as a string.
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_field_name($result_id, int $field_number): string
|
||||
function odbc_field_name($statement, int $field): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \odbc_field_name($result_id, $field_number);
|
||||
$result = \odbc_field_name($statement, $field);
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
@@ -434,17 +483,17 @@ function odbc_field_name($result_id, int $field_number): string
|
||||
* Gets the number of the column slot that corresponds to the named field in
|
||||
* the given result identifier.
|
||||
*
|
||||
* @param resource $result_id The result identifier.
|
||||
* @param string $field_name The field name.
|
||||
* @param resource $statement The result identifier.
|
||||
* @param string $field The field name.
|
||||
* @return int Returns the field number as a integer.
|
||||
* Field numbering starts at 1.
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_field_num($result_id, string $field_name): int
|
||||
function odbc_field_num($statement, string $field): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \odbc_field_num($result_id, $field_name);
|
||||
$result = \odbc_field_num($statement, $field);
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
@@ -456,16 +505,16 @@ function odbc_field_num($result_id, string $field_name): int
|
||||
* Gets the scale of the field referenced by number in the given result
|
||||
* identifier.
|
||||
*
|
||||
* @param resource $result_id The result identifier.
|
||||
* @param int $field_number The field number. Field numbering starts at 1.
|
||||
* @param resource $statement The result identifier.
|
||||
* @param int $field The field number. Field numbering starts at 1.
|
||||
* @return int Returns the field scale as a integer.
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_field_scale($result_id, int $field_number): int
|
||||
function odbc_field_scale($statement, int $field): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \odbc_field_scale($result_id, $field_number);
|
||||
$result = \odbc_field_scale($statement, $field);
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
@@ -477,16 +526,16 @@ function odbc_field_scale($result_id, int $field_number): int
|
||||
* Gets the SQL type of the field referenced by number in the given result
|
||||
* identifier.
|
||||
*
|
||||
* @param resource $result_id The result identifier.
|
||||
* @param int $field_number The field number. Field numbering starts at 1.
|
||||
* @param resource $statement The result identifier.
|
||||
* @param int $field The field number. Field numbering starts at 1.
|
||||
* @return string Returns the field type as a string.
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_field_type($result_id, int $field_number): string
|
||||
function odbc_field_type($statement, int $field): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \odbc_field_type($result_id, $field_number);
|
||||
$result = \odbc_field_type($statement, $field);
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
@@ -499,7 +548,7 @@ function odbc_field_type($result_id, int $field_number): string
|
||||
* foreign keys in other tables that refer to the primary key in the
|
||||
* specified table
|
||||
*
|
||||
* @param resource $connection_id The ODBC connection identifier,
|
||||
* @param resource $odbc The ODBC connection identifier,
|
||||
* see odbc_connect for details.
|
||||
* @param string $pk_catalog The catalog ('qualifier' in ODBC 2 parlance) of the primary key table.
|
||||
* @param string $pk_schema The schema ('owner' in ODBC 2 parlance) of the primary key table.
|
||||
@@ -530,10 +579,10 @@ function odbc_field_type($result_id, int $field_number): string
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_foreignkeys($connection_id, string $pk_catalog, string $pk_schema, string $pk_table, string $fk_catalog, string $fk_schema, string $fk_table)
|
||||
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();
|
||||
$result = \odbc_foreignkeys($connection_id, $pk_catalog, $pk_schema, $pk_table, $fk_catalog, $fk_schema, $fk_table);
|
||||
$result = \odbc_foreignkeys($odbc, $pk_catalog, $pk_schema, $pk_table, $fk_catalog, $fk_schema, $fk_table);
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
@@ -544,7 +593,7 @@ function odbc_foreignkeys($connection_id, string $pk_catalog, string $pk_schema,
|
||||
/**
|
||||
* Retrieves information about data types supported by the data source.
|
||||
*
|
||||
* @param resource $connection_id The ODBC connection identifier,
|
||||
* @param resource $odbc The ODBC connection identifier,
|
||||
* see odbc_connect for details.
|
||||
* @param int $data_type The data type, which can be used to restrict the information to a
|
||||
* single data type.
|
||||
@@ -573,14 +622,10 @@ function odbc_foreignkeys($connection_id, string $pk_catalog, string $pk_schema,
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_gettypeinfo($connection_id, int $data_type = null)
|
||||
function odbc_gettypeinfo($odbc, int $data_type = 0)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($data_type !== null) {
|
||||
$result = \odbc_gettypeinfo($connection_id, $data_type);
|
||||
} else {
|
||||
$result = \odbc_gettypeinfo($connection_id);
|
||||
}
|
||||
$result = \odbc_gettypeinfo($odbc, $data_type);
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
@@ -593,23 +638,55 @@ function odbc_gettypeinfo($connection_id, int $data_type = null)
|
||||
* The default length can be set using the
|
||||
* uodbc.defaultlrl php.ini directive.
|
||||
*
|
||||
* @param resource $result_id The result identifier.
|
||||
* @param resource $statement The result identifier.
|
||||
* @param int $length The number of bytes returned to PHP is controlled by the parameter
|
||||
* length. If it is set to 0, long column data is passed through to the
|
||||
* client (i.e. printed) when retrieved with odbc_result.
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_longreadlen($result_id, int $length): void
|
||||
function odbc_longreadlen($statement, int $length): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \odbc_longreadlen($result_id, $length);
|
||||
$result = \odbc_longreadlen($statement, $length);
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Opens a persistent database connection.
|
||||
*
|
||||
* This function is much like
|
||||
* odbc_connect, except that the connection is
|
||||
* not really closed when the script has finished. Future requests
|
||||
* for a connection with the same dsn,
|
||||
* user, password
|
||||
* combination (via odbc_connect and
|
||||
* odbc_pconnect) can reuse the persistent
|
||||
* connection.
|
||||
*
|
||||
* @param string $dsn
|
||||
* @param string $user
|
||||
* @param string $password
|
||||
* @param int $cursor_option
|
||||
* @return resource Returns an ODBC connection.
|
||||
* error.
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_pconnect(string $dsn, string $user, string $password, int $cursor_option = SQL_CUR_USE_DRIVER)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \odbc_pconnect($dsn, $user, $password, $cursor_option);
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Prepares a statement for execution. The result identifier can be used
|
||||
* later to execute the statement with odbc_execute.
|
||||
@@ -619,18 +696,18 @@ function odbc_longreadlen($result_id, int $length): void
|
||||
* defined by the ODBC specification. However, the Unified ODBC driver
|
||||
* currently only supports parameters of type IN to stored procedures.
|
||||
*
|
||||
* @param resource $connection_id The ODBC connection identifier,
|
||||
* @param resource $odbc The ODBC connection identifier,
|
||||
* see odbc_connect for details.
|
||||
* @param string $query_string The query string statement being prepared.
|
||||
* @param string $query The query string statement being prepared.
|
||||
* @return resource Returns an ODBC result identifier if the SQL command was prepared
|
||||
* successfully.
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_prepare($connection_id, string $query_string)
|
||||
function odbc_prepare($odbc, string $query)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \odbc_prepare($connection_id, $query_string);
|
||||
$result = \odbc_prepare($odbc, $query);
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
@@ -642,7 +719,7 @@ function odbc_prepare($connection_id, string $query_string)
|
||||
* Returns a result identifier that can be used to fetch the column names
|
||||
* that comprise the primary key for a table.
|
||||
*
|
||||
* @param resource $connection_id The ODBC connection identifier,
|
||||
* @param resource $odbc The ODBC connection identifier,
|
||||
* see odbc_connect for details.
|
||||
* @param string $catalog The catalog ('qualifier' in ODBC 2 parlance).
|
||||
* @param string $schema The schema ('owner' in ODBC 2 parlance).
|
||||
@@ -662,10 +739,130 @@ function odbc_prepare($connection_id, string $query_string)
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_primarykeys($connection_id, string $catalog, string $schema, string $table)
|
||||
function odbc_primarykeys($odbc, string $catalog, string $schema, string $table)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \odbc_primarykeys($connection_id, $catalog, $schema, $table);
|
||||
$result = \odbc_primarykeys($odbc, $catalog, $schema, $table);
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve information about parameters to procedures.
|
||||
*
|
||||
* @param $odbc The ODBC connection identifier,
|
||||
* see odbc_connect for details.
|
||||
* @param string $catalog The catalog ('qualifier' in ODBC 2 parlance).
|
||||
* @param string $schema The schema ('owner' in ODBC 2 parlance).
|
||||
* This parameter accepts the following search patterns:
|
||||
* % to match zero or more characters,
|
||||
* and _ to match a single character.
|
||||
* @param string $procedure The proc.
|
||||
* This parameter accepts the following search patterns:
|
||||
* % to match zero or more characters,
|
||||
* and _ to match a single character.
|
||||
* @param string $column The column.
|
||||
* This parameter accepts the following search patterns:
|
||||
* % to match zero or more characters,
|
||||
* and _ to match a single character.
|
||||
* @return resource Returns the list of input and output parameters, as well as the
|
||||
* columns that make up the result set for the specified procedures.
|
||||
* Returns an ODBC result identifier.
|
||||
*
|
||||
* The result set has the following columns:
|
||||
*
|
||||
* PROCEDURE_CAT
|
||||
* PROCEDURE_SCHEM
|
||||
* PROCEDURE_NAME
|
||||
* COLUMN_NAME
|
||||
* COLUMN_TYPE
|
||||
* DATA_TYPE
|
||||
* TYPE_NAME
|
||||
* COLUMN_SIZE
|
||||
* BUFFER_LENGTH
|
||||
* DECIMAL_DIGITS
|
||||
* NUM_PREC_RADIX
|
||||
* NULLABLE
|
||||
* REMARKS
|
||||
* COLUMN_DEF
|
||||
* SQL_DATA_TYPE
|
||||
* SQL_DATETIME_SUB
|
||||
* CHAR_OCTET_LENGTH
|
||||
* ORDINAL_POSITION
|
||||
* IS_NULLABLE
|
||||
*
|
||||
* Drivers can report additional columns.
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_procedurecolumns($odbc, string $catalog = null, string $schema = null, string $procedure = null, string $column = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($column !== null) {
|
||||
$result = \odbc_procedurecolumns($odbc, $catalog, $schema, $procedure, $column);
|
||||
} elseif ($procedure !== null) {
|
||||
$result = \odbc_procedurecolumns($odbc, $catalog, $schema, $procedure);
|
||||
} elseif ($schema !== null) {
|
||||
$result = \odbc_procedurecolumns($odbc, $catalog, $schema);
|
||||
} elseif ($catalog !== null) {
|
||||
$result = \odbc_procedurecolumns($odbc, $catalog);
|
||||
} else {
|
||||
$result = \odbc_procedurecolumns($odbc);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Lists all procedures in the requested range.
|
||||
*
|
||||
* @param $odbc The ODBC connection identifier,
|
||||
* see odbc_connect for details.
|
||||
* @param string $catalog The catalog ('qualifier' in ODBC 2 parlance).
|
||||
* @param string $schema The schema ('owner' in ODBC 2 parlance).
|
||||
* This parameter accepts the following search patterns:
|
||||
* % to match zero or more characters,
|
||||
* and _ to match a single character.
|
||||
* @param string $procedure The name.
|
||||
* This parameter accepts the following search patterns:
|
||||
* % to match zero or more characters,
|
||||
* and _ to match a single character.
|
||||
* @return resource Returns an ODBC
|
||||
* result identifier containing the information.
|
||||
*
|
||||
* The result set has the following columns:
|
||||
*
|
||||
* PROCEDURE_CAT
|
||||
* PROCEDURE_SCHEM
|
||||
* PROCEDURE_NAME
|
||||
* NUM_INPUT_PARAMS
|
||||
* NUM_OUTPUT_PARAMS
|
||||
* NUM_RESULT_SETS
|
||||
* REMARKS
|
||||
* PROCEDURE_TYPE
|
||||
*
|
||||
* Drivers can report additional columns.
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_procedures($odbc, string $catalog = null, string $schema = null, string $procedure = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($procedure !== null) {
|
||||
$result = \odbc_procedures($odbc, $catalog, $schema, $procedure);
|
||||
} elseif ($schema !== null) {
|
||||
$result = \odbc_procedures($odbc, $catalog, $schema);
|
||||
} elseif ($catalog !== null) {
|
||||
$result = \odbc_procedures($odbc, $catalog);
|
||||
} else {
|
||||
$result = \odbc_procedures($odbc);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
@@ -681,20 +878,16 @@ function odbc_primarykeys($connection_id, string $catalog, string $schema, strin
|
||||
* This function is not supposed to be used in production environments; it is
|
||||
* merely meant for development purposes, to get a result set quickly rendered.
|
||||
*
|
||||
* @param resource $result_id The result identifier.
|
||||
* @param resource $statement The result identifier.
|
||||
* @param string $format Additional overall table formatting.
|
||||
* @return int Returns the number of rows in the result.
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_result_all($result_id, string $format = null): int
|
||||
function odbc_result_all($statement, string $format = ""): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($format !== null) {
|
||||
$result = \odbc_result_all($result_id, $format);
|
||||
} else {
|
||||
$result = \odbc_result_all($result_id);
|
||||
}
|
||||
$result = \odbc_result_all($statement, $format);
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
@@ -705,7 +898,7 @@ function odbc_result_all($result_id, string $format = null): int
|
||||
/**
|
||||
* Get result data
|
||||
*
|
||||
* @param resource $result_id The ODBC resource.
|
||||
* @param resource $statement The ODBC resource.
|
||||
* @param mixed $field The field name being retrieved. It can either be an integer containing
|
||||
* the column number of the field you want; or it can be a string
|
||||
* containing the name of the field.
|
||||
@@ -714,10 +907,10 @@ function odbc_result_all($result_id, string $format = null): int
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_result($result_id, $field)
|
||||
function odbc_result($statement, $field)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \odbc_result($result_id, $field);
|
||||
$result = \odbc_result($statement, $field);
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
@@ -728,15 +921,15 @@ function odbc_result($result_id, $field)
|
||||
/**
|
||||
* Rolls back all pending statements on the connection.
|
||||
*
|
||||
* @param resource $connection_id The ODBC connection identifier,
|
||||
* @param resource $odbc The ODBC connection identifier,
|
||||
* see odbc_connect for details.
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_rollback($connection_id): void
|
||||
function odbc_rollback($odbc): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \odbc_rollback($connection_id);
|
||||
$result = \odbc_rollback($odbc);
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
@@ -762,21 +955,21 @@ function odbc_rollback($connection_id): void
|
||||
* to use a commercial product, that's all that really
|
||||
* matters.
|
||||
*
|
||||
* @param resource $id Is a connection id or result id on which to change the settings.
|
||||
* @param resource $odbc Is a connection id or result id on which to change the settings.
|
||||
* For SQLSetConnectOption(), this is a connection id.
|
||||
* For SQLSetStmtOption(), this is a result id.
|
||||
* @param int $function Is the ODBC function to use. The value should be
|
||||
* @param int $which Is the ODBC function to use. The value should be
|
||||
* 1 for SQLSetConnectOption() and
|
||||
* 2 for SQLSetStmtOption().
|
||||
* @param int $option The option to set.
|
||||
* @param int $param The value for the given option.
|
||||
* @param int $value The value for the given option.
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_setoption($id, int $function, int $option, int $param): void
|
||||
function odbc_setoption($odbc, int $which, int $option, int $value): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \odbc_setoption($id, $function, $option, $param);
|
||||
$result = \odbc_setoption($odbc, $which, $option, $value);
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
@@ -788,7 +981,7 @@ function odbc_setoption($id, int $function, int $option, int $param): void
|
||||
* row in the table, or columns that are automatically updated when any
|
||||
* value in the row is updated by a transaction.
|
||||
*
|
||||
* @param resource $connection_id The ODBC connection identifier,
|
||||
* @param resource $odbc The ODBC connection identifier,
|
||||
* see odbc_connect for details.
|
||||
* @param int $type
|
||||
* @param string $catalog The catalog ('qualifier' in ODBC 2 parlance).
|
||||
@@ -816,10 +1009,10 @@ function odbc_setoption($id, int $function, int $option, int $param): void
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_specialcolumns($connection_id, int $type, string $catalog, string $schema, string $table, int $scope, int $nullable)
|
||||
function odbc_specialcolumns($odbc, int $type, string $catalog, string $schema, string $table, int $scope, int $nullable)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \odbc_specialcolumns($connection_id, $type, $catalog, $schema, $table, $scope, $nullable);
|
||||
$result = \odbc_specialcolumns($odbc, $type, $catalog, $schema, $table, $scope, $nullable);
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
@@ -830,11 +1023,11 @@ function odbc_specialcolumns($connection_id, int $type, string $catalog, string
|
||||
/**
|
||||
* Get statistics about a table and its indexes.
|
||||
*
|
||||
* @param resource $connection_id The ODBC connection identifier,
|
||||
* @param resource $odbc The ODBC connection identifier,
|
||||
* see odbc_connect for details.
|
||||
* @param string $catalog The catalog ('qualifier' in ODBC 2 parlance).
|
||||
* @param string $schema The schema ('owner' in ODBC 2 parlance).
|
||||
* @param string $table_name The table name.
|
||||
* @param string $table The table name.
|
||||
* @param int $unique The type of the index.
|
||||
* One of SQL_INDEX_UNIQUE or SQL_INDEX_ALL.
|
||||
* @param int $accuracy One of SQL_ENSURE or SQL_QUICK.
|
||||
@@ -862,10 +1055,10 @@ function odbc_specialcolumns($connection_id, int $type, string $catalog, string
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_statistics($connection_id, string $catalog, string $schema, string $table_name, int $unique, int $accuracy)
|
||||
function odbc_statistics($odbc, string $catalog, string $schema, string $table, int $unique, int $accuracy)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \odbc_statistics($connection_id, $catalog, $schema, $table_name, $unique, $accuracy);
|
||||
$result = \odbc_statistics($odbc, $catalog, $schema, $table, $unique, $accuracy);
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
@@ -877,14 +1070,14 @@ function odbc_statistics($connection_id, string $catalog, string $schema, string
|
||||
* Lists tables in the requested range and the privileges associated
|
||||
* with each table.
|
||||
*
|
||||
* @param resource $connection_id The ODBC connection identifier,
|
||||
* @param resource $odbc The ODBC connection identifier,
|
||||
* see odbc_connect for details.
|
||||
* @param string $catalog The catalog ('qualifier' in ODBC 2 parlance).
|
||||
* @param string $schema The schema ('owner' in ODBC 2 parlance).
|
||||
* This parameter accepts the following search patterns:
|
||||
* % to match zero or more characters,
|
||||
* and _ to match a single character.
|
||||
* @param string $name The name.
|
||||
* @param string $table The name.
|
||||
* This parameter accepts the following search patterns:
|
||||
* % to match zero or more characters,
|
||||
* and _ to match a single character.
|
||||
@@ -904,10 +1097,10 @@ function odbc_statistics($connection_id, string $catalog, string $schema, string
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_tableprivileges($connection_id, string $catalog, string $schema, string $name)
|
||||
function odbc_tableprivileges($odbc, string $catalog, string $schema, string $table)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \odbc_tableprivileges($connection_id, $catalog, $schema, $name);
|
||||
$result = \odbc_tableprivileges($odbc, $catalog, $schema, $table);
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
}
|
||||
@@ -921,14 +1114,14 @@ function odbc_tableprivileges($connection_id, string $catalog, string $schema, s
|
||||
* To support enumeration of qualifiers, owners, and table types,
|
||||
* the following special semantics for the
|
||||
* catalog, schema,
|
||||
* name, and
|
||||
* table, and
|
||||
* table_type are available:
|
||||
*
|
||||
*
|
||||
*
|
||||
* If catalog is a single percent
|
||||
* character (%) and schema and
|
||||
* name are empty strings, then the result
|
||||
* table are empty strings, then the result
|
||||
* set contains a list of valid qualifiers for the data
|
||||
* source. (All columns except the TABLE_QUALIFIER column contain
|
||||
* NULLs.)
|
||||
@@ -938,7 +1131,7 @@ function odbc_tableprivileges($connection_id, string $catalog, string $schema, s
|
||||
*
|
||||
* If schema is a single percent character
|
||||
* (%) and catalog and
|
||||
* name are empty strings, then the result
|
||||
* table are empty strings, then the result
|
||||
* set contains a list of valid owners for the data source. (All
|
||||
* columns except the TABLE_OWNER column contain
|
||||
* NULLs.)
|
||||
@@ -948,7 +1141,7 @@ function odbc_tableprivileges($connection_id, string $catalog, string $schema, s
|
||||
*
|
||||
* If table_type is a single percent
|
||||
* character (%) and catalog,
|
||||
* schema and name
|
||||
* schema and table
|
||||
* are empty strings, then the result set contains a list of
|
||||
* valid table types for the data source. (All columns except the
|
||||
* TABLE_TYPE column contain NULLs.)
|
||||
@@ -956,14 +1149,14 @@ function odbc_tableprivileges($connection_id, string $catalog, string $schema, s
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param resource $connection_id The ODBC connection identifier,
|
||||
* @param resource $odbc The ODBC connection identifier,
|
||||
* see odbc_connect for details.
|
||||
* @param string $catalog The catalog ('qualifier' in ODBC 2 parlance).
|
||||
* @param string $schema The schema ('owner' in ODBC 2 parlance).
|
||||
* This parameter accepts the following search patterns:
|
||||
* % to match zero or more characters,
|
||||
* and _ to match a single character.
|
||||
* @param string $name The name.
|
||||
* @param string $table The name.
|
||||
* This parameter accepts the following search patterns:
|
||||
* % to match zero or more characters,
|
||||
* and _ to match a single character.
|
||||
@@ -988,19 +1181,19 @@ function odbc_tableprivileges($connection_id, string $catalog, string $schema, s
|
||||
* @throws UodbcException
|
||||
*
|
||||
*/
|
||||
function odbc_tables($connection_id, string $catalog = null, string $schema = null, string $name = null, string $types = null)
|
||||
function odbc_tables($odbc, string $catalog = null, string $schema = null, string $table = null, string $types = null)
|
||||
{
|
||||
error_clear_last();
|
||||
if ($types !== null) {
|
||||
$result = \odbc_tables($connection_id, $catalog, $schema, $name, $types);
|
||||
} elseif ($name !== null) {
|
||||
$result = \odbc_tables($connection_id, $catalog, $schema, $name);
|
||||
$result = \odbc_tables($odbc, $catalog, $schema, $table, $types);
|
||||
} elseif ($table !== null) {
|
||||
$result = \odbc_tables($odbc, $catalog, $schema, $table);
|
||||
} elseif ($schema !== null) {
|
||||
$result = \odbc_tables($connection_id, $catalog, $schema);
|
||||
$result = \odbc_tables($odbc, $catalog, $schema);
|
||||
} elseif ($catalog !== null) {
|
||||
$result = \odbc_tables($connection_id, $catalog);
|
||||
$result = \odbc_tables($odbc, $catalog);
|
||||
} else {
|
||||
$result = \odbc_tables($connection_id);
|
||||
$result = \odbc_tables($odbc);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw UodbcException::createFromPhpError();
|
||||
|
||||
90
vendor/thecodingmachine/safe/generated/url.php
vendored
90
vendor/thecodingmachine/safe/generated/url.php
vendored
@@ -5,9 +5,9 @@ namespace Safe;
|
||||
use Safe\Exceptions\UrlException;
|
||||
|
||||
/**
|
||||
* Decodes a base64 encoded data.
|
||||
* Decodes a base64 encoded string.
|
||||
*
|
||||
* @param string $data The encoded data.
|
||||
* @param string $string The encoded data.
|
||||
* @param bool $strict If the strict parameter is set to TRUE
|
||||
* then the base64_decode function will return
|
||||
* FALSE if the input contains character from outside the base64
|
||||
@@ -17,10 +17,10 @@ use Safe\Exceptions\UrlException;
|
||||
* @throws UrlException
|
||||
*
|
||||
*/
|
||||
function base64_decode(string $data, bool $strict = false): string
|
||||
function base64_decode(string $string, bool $strict = false): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \base64_decode($data, $strict);
|
||||
$result = \base64_decode($string, $strict);
|
||||
if ($result === false) {
|
||||
throw UrlException::createFromPhpError();
|
||||
}
|
||||
@@ -33,22 +33,23 @@ function base64_decode(string $data, bool $strict = false): string
|
||||
* by the server in response to a HTTP request.
|
||||
*
|
||||
* @param string $url The target URL.
|
||||
* @param int $format If the optional format parameter is set to non-zero,
|
||||
* @param bool $associative If the optional associative parameter is set to true,
|
||||
* get_headers parses the response and sets the
|
||||
* array's keys.
|
||||
* @param resource $context A valid context resource created with
|
||||
* stream_context_create.
|
||||
* stream_context_create, or NULL to use the
|
||||
* default context.
|
||||
* @return array Returns an indexed or associative array with the headers.
|
||||
* @throws UrlException
|
||||
*
|
||||
*/
|
||||
function get_headers(string $url, int $format = 0, $context = null): array
|
||||
function get_headers(string $url, bool $associative = false, $context = null): array
|
||||
{
|
||||
error_clear_last();
|
||||
if ($context !== null) {
|
||||
$result = \get_headers($url, $format, $context);
|
||||
$result = \get_headers($url, $associative, $context);
|
||||
} else {
|
||||
$result = \get_headers($url, $format);
|
||||
$result = \get_headers($url, $associative);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw UrlException::createFromPhpError();
|
||||
@@ -57,18 +58,64 @@ function get_headers(string $url, int $format = 0, $context = null): array
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Opens filename and parses it line by line for
|
||||
* <meta> tags in the file. The parsing stops at
|
||||
* </head>.
|
||||
*
|
||||
* @param string $filename The path to the HTML file, as a string. This can be a local file or an
|
||||
* URL.
|
||||
*
|
||||
*
|
||||
* What get_meta_tags parses
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* ]]>
|
||||
*
|
||||
*
|
||||
* @param bool $use_include_path Setting use_include_path to TRUE will result
|
||||
* in PHP trying to open the file along the standard include path as per
|
||||
* the include_path directive.
|
||||
* This is used for local files, not URLs.
|
||||
* @return array Returns an array with all the parsed meta tags.
|
||||
*
|
||||
* The value of the name property becomes the key, the value of the content
|
||||
* property becomes the value of the returned array, so you can easily use
|
||||
* standard array functions to traverse it or access single values.
|
||||
* Special characters in the value of the name property are substituted with
|
||||
* '_', the rest is converted to lower case. If two meta tags have the same
|
||||
* name, only the last one is returned.
|
||||
*
|
||||
* Returns FALSE on failure.
|
||||
* @throws UrlException
|
||||
*
|
||||
*/
|
||||
function get_meta_tags(string $filename, bool $use_include_path = false): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \get_meta_tags($filename, $use_include_path);
|
||||
if ($result === false) {
|
||||
throw UrlException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function parses a URL and returns an associative array containing any
|
||||
* of the various components of the URL that are present.
|
||||
* The values of the array elements are not URL decoded.
|
||||
*
|
||||
* This function is not meant to validate
|
||||
* the given URL, it only breaks it up into the above listed parts. Partial
|
||||
* the given URL, it only breaks it up into the parts listed below. Partial and invalid
|
||||
* URLs are also accepted, parse_url tries its best to
|
||||
* parse them correctly.
|
||||
*
|
||||
* @param string $url The URL to parse. Invalid characters are replaced by
|
||||
* _.
|
||||
* @param string $url The URL to parse.
|
||||
* @param int $component Specify one of PHP_URL_SCHEME,
|
||||
* PHP_URL_HOST, PHP_URL_PORT,
|
||||
* PHP_URL_USER, PHP_URL_PASS,
|
||||
@@ -76,8 +123,8 @@ function get_headers(string $url, int $format = 0, $context = null): array
|
||||
* or PHP_URL_FRAGMENT to retrieve just a specific
|
||||
* URL component as a string (except when
|
||||
* PHP_URL_PORT is given, in which case the return
|
||||
* value will be an integer).
|
||||
* @return mixed On seriously malformed URLs, parse_url.
|
||||
* value will be an int).
|
||||
* @return array|int|string|null On seriously malformed URLs, parse_url.
|
||||
*
|
||||
* If the component parameter is omitted, an
|
||||
* associative array is returned. At least one element will be
|
||||
@@ -127,9 +174,22 @@ function get_headers(string $url, int $format = 0, $context = null): array
|
||||
*
|
||||
* If the component parameter is specified,
|
||||
* parse_url returns a string (or an
|
||||
* integer, in the case of PHP_URL_PORT)
|
||||
* int, in the case of PHP_URL_PORT)
|
||||
* instead of an array. If the requested component doesn't exist
|
||||
* within the given URL, NULL will be returned.
|
||||
* As of PHP 8.0.0, parse_url distinguishes absent and empty
|
||||
* queries and fragments:
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Previously all cases resulted in query and fragment being NULL.
|
||||
*
|
||||
* Note that control characters (cf. ctype_cntrl) in the
|
||||
* components are replaced with underscores (_).
|
||||
* @throws UrlException
|
||||
*
|
||||
*/
|
||||
|
||||
711
vendor/thecodingmachine/safe/generated/xml.php
vendored
711
vendor/thecodingmachine/safe/generated/xml.php
vendored
@@ -5,72 +5,449 @@ namespace Safe;
|
||||
use Safe\Exceptions\XmlException;
|
||||
|
||||
/**
|
||||
* xml_parser_create_ns creates a new XML parser
|
||||
* with XML namespace support and returns a resource handle referencing
|
||||
* it to be used by the other XML functions.
|
||||
* Frees the given XML parser.
|
||||
*
|
||||
* @param string $encoding The input encoding is automatically detected, so that the
|
||||
* encoding parameter specifies only the output
|
||||
* encoding. In PHP 5.0.0 and 5.0.1, the default output charset is
|
||||
* ISO-8859-1, while in PHP 5.0.2 and upper is UTF-8. The supported
|
||||
* encodings are ISO-8859-1, UTF-8 and
|
||||
* US-ASCII.
|
||||
* @param string $separator With a namespace aware parser tag parameters passed to the various
|
||||
* handler functions will consist of namespace and tag name separated by
|
||||
* the string specified in separator.
|
||||
* @return resource Returns a resource handle for the new XML parser.
|
||||
* @param resource $parser
|
||||
* @throws XmlException
|
||||
*
|
||||
*/
|
||||
function xml_parser_create_ns(string $encoding = null, string $separator = ":")
|
||||
function xml_parser_free($parser): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($separator !== ":") {
|
||||
$result = \xml_parser_create_ns($encoding, $separator);
|
||||
} elseif ($encoding !== null) {
|
||||
$result = \xml_parser_create_ns($encoding);
|
||||
} else {
|
||||
$result = \xml_parser_create_ns();
|
||||
}
|
||||
$result = \xml_parser_free($parser);
|
||||
if ($result === false) {
|
||||
throw XmlException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* xml_parser_create creates a new XML parser
|
||||
* and returns a resource handle referencing it to be used by the
|
||||
* other XML functions.
|
||||
* Sets the character data handler function for the XML parser
|
||||
* parser.
|
||||
*
|
||||
* @param string $encoding The optional encoding specifies the character
|
||||
* encoding for the input/output in PHP 4. Starting from PHP 5, the input
|
||||
* encoding is automatically detected, so that the
|
||||
* encoding parameter specifies only the output
|
||||
* encoding. In PHP 4, the default output encoding is the same as the
|
||||
* input charset. If empty string is passed, the parser attempts to identify
|
||||
* which encoding the document is encoded in by looking at the heading 3 or
|
||||
* 4 bytes. In PHP 5.0.0 and 5.0.1, the default output charset is
|
||||
* ISO-8859-1, while in PHP 5.0.2 and upper is UTF-8. The supported
|
||||
* encodings are ISO-8859-1, UTF-8 and
|
||||
* US-ASCII.
|
||||
* @return resource Returns a resource handle for the new XML parser.
|
||||
* @param resource $parser A reference to the XML parser to set up character data handler function.
|
||||
* @param callable $handler handler is a string containing the name of a
|
||||
* function that must exist when xml_parse is called
|
||||
* for parser.
|
||||
*
|
||||
* The function named by handler must accept
|
||||
* two parameters:
|
||||
*
|
||||
* handler
|
||||
* XMLParserparser
|
||||
* stringdata
|
||||
*
|
||||
*
|
||||
*
|
||||
* parser
|
||||
*
|
||||
*
|
||||
* The first parameter, parser, is a
|
||||
* reference to the XML parser calling the handler.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* data
|
||||
*
|
||||
*
|
||||
* The second parameter, data, contains
|
||||
* the character data as a string.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Character data handler is called for every piece of a text in the XML
|
||||
* document. It can be called multiple times inside each fragment (e.g.
|
||||
* for non-ASCII strings).
|
||||
*
|
||||
* If a handler function is set to an empty string, or FALSE, the handler
|
||||
* in question is disabled.
|
||||
* @throws XmlException
|
||||
*
|
||||
*/
|
||||
function xml_parser_create(string $encoding = null)
|
||||
function xml_set_character_data_handler($parser, callable $handler): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($encoding !== null) {
|
||||
$result = \xml_parser_create($encoding);
|
||||
} else {
|
||||
$result = \xml_parser_create();
|
||||
}
|
||||
$result = \xml_set_character_data_handler($parser, $handler);
|
||||
if ($result === false) {
|
||||
throw XmlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the default handler function for the XML parser
|
||||
* parser.
|
||||
*
|
||||
* @param resource $parser A reference to the XML parser to set up default handler function.
|
||||
* @param callable $handler handler is a string containing the name of a
|
||||
* function that must exist when xml_parse is called
|
||||
* for parser.
|
||||
*
|
||||
* The function named by handler must accept
|
||||
* two parameters:
|
||||
*
|
||||
* handler
|
||||
* XMLParserparser
|
||||
* stringdata
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* parser
|
||||
*
|
||||
*
|
||||
*
|
||||
* The first parameter, parser, is a
|
||||
* reference to the XML parser calling the handler.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* data
|
||||
*
|
||||
*
|
||||
*
|
||||
* The second parameter, data, contains
|
||||
* the character data.This may be the XML declaration,
|
||||
* document type declaration, entities or other data for which
|
||||
* no other handler exists.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* If a handler function is set to an empty string, or FALSE, the handler
|
||||
* in question is disabled.
|
||||
* @throws XmlException
|
||||
*
|
||||
*/
|
||||
function xml_set_default_handler($parser, callable $handler): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \xml_set_default_handler($parser, $handler);
|
||||
if ($result === false) {
|
||||
throw XmlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the element handler functions for the XML parser.
|
||||
* start_handler and
|
||||
* end_handler are strings containing
|
||||
* the names of functions that must exist when xml_parse
|
||||
* is called for parser.
|
||||
*
|
||||
* @param resource $parser A reference to the XML parser to set up start and end element handler functions.
|
||||
* @param callable $start_handler The function named by start_handler
|
||||
* must accept three parameters:
|
||||
*
|
||||
* start_element_handler
|
||||
* XMLParserparser
|
||||
* stringname
|
||||
* arrayattribs
|
||||
*
|
||||
*
|
||||
*
|
||||
* parser
|
||||
*
|
||||
*
|
||||
* The first parameter, parser, is a
|
||||
* reference to the XML parser calling the handler.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* name
|
||||
*
|
||||
*
|
||||
* The second parameter, name, contains the name
|
||||
* of the element for which this handler is called.If case-folding is in effect for this
|
||||
* parser, the element name will be in uppercase letters.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* attribs
|
||||
*
|
||||
*
|
||||
* The third parameter, attribs, contains an
|
||||
* associative array with the element's attributes (if any).The keys
|
||||
* of this array are the attribute names, the values are the attribute
|
||||
* values.Attribute names are case-folded on the same criteria as
|
||||
* element names.Attribute values are not
|
||||
* case-folded.
|
||||
*
|
||||
*
|
||||
* The original order of the attributes can be retrieved by walking
|
||||
* through attribs the normal way, using
|
||||
* each.The first key in the array was the first
|
||||
* attribute, and so on.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param callable $end_handler
|
||||
* @throws XmlException
|
||||
*
|
||||
*/
|
||||
function xml_set_element_handler($parser, callable $start_handler, callable $end_handler): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \xml_set_element_handler($parser, $start_handler, $end_handler);
|
||||
if ($result === false) {
|
||||
throw XmlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set a handler to be called when leaving the scope of a namespace
|
||||
* declaration. This will be called, for each namespace declaration, after
|
||||
* the handler for the end tag of the element in which the namespace was
|
||||
* declared.
|
||||
*
|
||||
* @param resource $parser A reference to the XML parser.
|
||||
* @param callable $handler handler is a string containing the name of a
|
||||
* function that must exist when xml_parse is called
|
||||
* for parser.
|
||||
*
|
||||
* The function named by handler must accept
|
||||
* two parameters, and should return an integer value. If the
|
||||
* value returned from the handler is FALSE (which it will be if no
|
||||
* value is returned), the XML parser will stop parsing and
|
||||
* xml_get_error_code will return
|
||||
* XML_ERROR_EXTERNAL_ENTITY_HANDLING.
|
||||
*
|
||||
* handler
|
||||
* XMLParserparser
|
||||
* stringprefix
|
||||
*
|
||||
*
|
||||
*
|
||||
* parser
|
||||
*
|
||||
*
|
||||
* The first parameter, parser, is a
|
||||
* reference to the XML parser calling the handler.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* prefix
|
||||
*
|
||||
*
|
||||
* The prefix is a string used to reference the namespace within an XML object.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* If a handler function is set to an empty string, or FALSE, the handler
|
||||
* in question is disabled.
|
||||
* @throws XmlException
|
||||
*
|
||||
*/
|
||||
function xml_set_end_namespace_decl_handler($parser, callable $handler): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \xml_set_end_namespace_decl_handler($parser, $handler);
|
||||
if ($result === false) {
|
||||
throw XmlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the external entity reference handler function for the XML parser
|
||||
* parser.
|
||||
*
|
||||
* @param resource $parser A reference to the XML parser to set up external entity reference handler function.
|
||||
* @param callable $handler handler is a string containing the name of a
|
||||
* function that must exist when xml_parse is called
|
||||
* for parser.
|
||||
*
|
||||
* The function named by handler must accept
|
||||
* five parameters, and should return an integer value.If the
|
||||
* value returned from the handler is FALSE (which it will be if no
|
||||
* value is returned), the XML parser will stop parsing and
|
||||
* xml_get_error_code will return
|
||||
* XML_ERROR_EXTERNAL_ENTITY_HANDLING.
|
||||
*
|
||||
* handler
|
||||
* XMLParserparser
|
||||
* stringopen_entity_names
|
||||
* stringbase
|
||||
* stringsystem_id
|
||||
* stringpublic_id
|
||||
*
|
||||
*
|
||||
*
|
||||
* parser
|
||||
*
|
||||
*
|
||||
* The first parameter, parser, is a
|
||||
* reference to the XML parser calling the handler.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* open_entity_names
|
||||
*
|
||||
*
|
||||
* The second parameter, open_entity_names, is a
|
||||
* space-separated list of the names of the entities that are open for
|
||||
* the parse of this entity (including the name of the referenced
|
||||
* entity).
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* base
|
||||
*
|
||||
*
|
||||
* This is the base for resolving the system identifier
|
||||
* (system_id) of the external entity.Currently
|
||||
* this parameter will always be set to an empty string.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* system_id
|
||||
*
|
||||
*
|
||||
* The fourth parameter, system_id, is the
|
||||
* system identifier as specified in the entity declaration.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* public_id
|
||||
*
|
||||
*
|
||||
* The fifth parameter, public_id, is the
|
||||
* public identifier as specified in the entity declaration, or
|
||||
* an empty string if none was specified; the whitespace in the
|
||||
* public identifier will have been normalized as required by
|
||||
* the XML spec.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* If a handler function is set to an empty string, or FALSE, the handler
|
||||
* in question is disabled.
|
||||
* @throws XmlException
|
||||
*
|
||||
*/
|
||||
function xml_set_external_entity_ref_handler($parser, callable $handler): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \xml_set_external_entity_ref_handler($parser, $handler);
|
||||
if ($result === false) {
|
||||
throw XmlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the notation declaration handler function for the XML parser
|
||||
* parser.
|
||||
*
|
||||
* A notation declaration is part of the document's DTD and has the
|
||||
* following format:
|
||||
*
|
||||
* name
|
||||
* { systemId | publicId?>
|
||||
* ]]>
|
||||
*
|
||||
* See section 4.7 of the XML 1.0
|
||||
* spec for the definition of notation declarations.
|
||||
*
|
||||
* @param resource $parser A reference to the XML parser to set up notation declaration handler function.
|
||||
* @param callable $handler handler is a string containing the name of a
|
||||
* function that must exist when xml_parse is called
|
||||
* for parser.
|
||||
*
|
||||
* The function named by handler must accept
|
||||
* five parameters:
|
||||
*
|
||||
* handler
|
||||
* XMLParserparser
|
||||
* stringnotation_name
|
||||
* stringbase
|
||||
* stringsystem_id
|
||||
* stringpublic_id
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* parser
|
||||
*
|
||||
*
|
||||
*
|
||||
* The first parameter, parser, is a
|
||||
* reference to the XML parser calling the handler.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* notation_name
|
||||
*
|
||||
*
|
||||
* This is the notation's name, as per
|
||||
* the notation format described above.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* base
|
||||
*
|
||||
*
|
||||
*
|
||||
* This is the base for resolving the system identifier
|
||||
* (system_id) of the notation declaration.
|
||||
* Currently this parameter will always be set to an empty string.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* system_id
|
||||
*
|
||||
*
|
||||
* System identifier of the external notation declaration.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* public_id
|
||||
*
|
||||
*
|
||||
*
|
||||
* Public identifier of the external notation declaration.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* If a handler function is set to an empty string, or FALSE, the handler
|
||||
* in question is disabled.
|
||||
* @throws XmlException
|
||||
*
|
||||
*/
|
||||
function xml_set_notation_decl_handler($parser, callable $handler): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \xml_set_notation_decl_handler($parser, $handler);
|
||||
if ($result === false) {
|
||||
throw XmlException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +462,7 @@ function xml_parser_create(string $encoding = null)
|
||||
* @throws XmlException
|
||||
*
|
||||
*/
|
||||
function xml_set_object($parser, object &$object): void
|
||||
function xml_set_object($parser, object $object): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \xml_set_object($parser, $object);
|
||||
@@ -93,3 +470,247 @@ function xml_set_object($parser, object &$object): void
|
||||
throw XmlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the processing instruction (PI) handler function for the XML parser
|
||||
* parser.
|
||||
*
|
||||
* A processing instruction has the following format:
|
||||
*
|
||||
* <?target
|
||||
* data?>
|
||||
*
|
||||
*
|
||||
* You can put PHP code into such a tag, but be aware of one limitation: in
|
||||
* an XML PI, the PI end tag (?>) can not be quoted,
|
||||
* so this character sequence should not appear in the PHP code you embed
|
||||
* with PIs in XML documents.If it does, the rest of the PHP code, as well
|
||||
* as the "real" PI end tag, will be treated as character data.
|
||||
*
|
||||
* @param resource $parser A reference to the XML parser to set up processing instruction (PI) handler function.
|
||||
* @param callable $handler handler is a string containing the name of a
|
||||
* function that must exist when xml_parse is called
|
||||
* for parser.
|
||||
*
|
||||
* The function named by handler must accept
|
||||
* three parameters:
|
||||
*
|
||||
* handler
|
||||
* XMLParserparser
|
||||
* stringtarget
|
||||
* stringdata
|
||||
*
|
||||
*
|
||||
*
|
||||
* parser
|
||||
*
|
||||
*
|
||||
* The first parameter, parser, is a
|
||||
* reference to the XML parser calling the handler.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* target
|
||||
*
|
||||
*
|
||||
* The second parameter, target, contains the PI
|
||||
* target.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* data
|
||||
*
|
||||
*
|
||||
* The third parameter, data, contains the PI
|
||||
* data.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* If a handler function is set to an empty string, or FALSE, the handler
|
||||
* in question is disabled.
|
||||
* @throws XmlException
|
||||
*
|
||||
*/
|
||||
function xml_set_processing_instruction_handler($parser, callable $handler): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \xml_set_processing_instruction_handler($parser, $handler);
|
||||
if ($result === false) {
|
||||
throw XmlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set a handler to be called when a namespace is declared. Namespace
|
||||
* declarations occur inside start tags. But the namespace declaration start
|
||||
* handler is called before the start tag handler for each namespace declared
|
||||
* in that start tag.
|
||||
*
|
||||
* @param resource $parser A reference to the XML parser.
|
||||
* @param callable $handler handler is a string containing the name of a
|
||||
* function that must exist when xml_parse is called
|
||||
* for parser.
|
||||
*
|
||||
* The function named by handler must accept
|
||||
* three parameters, and should return an integer value. If the
|
||||
* value returned from the handler is FALSE (which it will be if no
|
||||
* value is returned), the XML parser will stop parsing and
|
||||
* xml_get_error_code will return
|
||||
* XML_ERROR_EXTERNAL_ENTITY_HANDLING.
|
||||
*
|
||||
* handler
|
||||
* XMLParserparser
|
||||
* stringprefix
|
||||
* stringuri
|
||||
*
|
||||
*
|
||||
*
|
||||
* parser
|
||||
*
|
||||
*
|
||||
* The first parameter, parser, is a
|
||||
* reference to the XML parser calling the handler.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* prefix
|
||||
*
|
||||
*
|
||||
* The prefix is a string used to reference the namespace within an XML object.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* uri
|
||||
*
|
||||
*
|
||||
* Uniform Resource Identifier (URI) of namespace.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* If a handler function is set to an empty string, or FALSE, the handler
|
||||
* in question is disabled.
|
||||
* @throws XmlException
|
||||
*
|
||||
*/
|
||||
function xml_set_start_namespace_decl_handler($parser, callable $handler): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \xml_set_start_namespace_decl_handler($parser, $handler);
|
||||
if ($result === false) {
|
||||
throw XmlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the unparsed entity declaration handler function for the XML parser
|
||||
* parser.
|
||||
*
|
||||
* The handler will be called if the XML parser
|
||||
* encounters an external entity declaration with an NDATA declaration, like
|
||||
* the following:
|
||||
*
|
||||
* name {publicId | systemId}
|
||||
* NDATA notationName
|
||||
* ]]>
|
||||
*
|
||||
*
|
||||
* See section 4.2.2 of
|
||||
* the XML 1.0 spec for the definition of notation declared
|
||||
* external entities.
|
||||
*
|
||||
* @param resource $parser A reference to the XML parser to set up unparsed entity declaration handler function.
|
||||
* @param callable $handler handler is a string containing the name of a
|
||||
* function that must exist when xml_parse is called
|
||||
* for parser.
|
||||
*
|
||||
* The function named by handler must accept six
|
||||
* parameters:
|
||||
*
|
||||
* handler
|
||||
* XMLParserparser
|
||||
* stringentity_name
|
||||
* stringbase
|
||||
* stringsystem_id
|
||||
* stringpublic_id
|
||||
* stringnotation_name
|
||||
*
|
||||
*
|
||||
*
|
||||
* parser
|
||||
*
|
||||
*
|
||||
* The first parameter, parser, is a
|
||||
* reference to the XML parser calling the
|
||||
* handler.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* entity_name
|
||||
*
|
||||
*
|
||||
* The name of the entity that is about to be defined.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* base
|
||||
*
|
||||
*
|
||||
* This is the base for resolving the system identifier
|
||||
* (systemId) of the external entity.Currently
|
||||
* this parameter will always be set to an empty string.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* system_id
|
||||
*
|
||||
*
|
||||
* System identifier for the external entity.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* public_id
|
||||
*
|
||||
*
|
||||
* Public identifier for the external entity.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* notation_name
|
||||
*
|
||||
*
|
||||
* Name of the notation of this entity (see
|
||||
* xml_set_notation_decl_handler).
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* If a handler function is set to an empty string, or FALSE, the handler
|
||||
* in question is disabled.
|
||||
* @throws XmlException
|
||||
*
|
||||
*/
|
||||
function xml_set_unparsed_entity_decl_handler($parser, callable $handler): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \xml_set_unparsed_entity_decl_handler($parser, $handler);
|
||||
if ($result === false) {
|
||||
throw XmlException::createFromPhpError();
|
||||
}
|
||||
}
|
||||
|
||||
18
vendor/thecodingmachine/safe/generated/yaml.php
vendored
18
vendor/thecodingmachine/safe/generated/yaml.php
vendored
@@ -26,7 +26,11 @@ use Safe\Exceptions\YamlException;
|
||||
function yaml_parse_file(string $filename, int $pos = 0, ?int &$ndocs = null, array $callbacks = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \yaml_parse_file($filename, $pos, $ndocs, $callbacks);
|
||||
if ($callbacks !== null) {
|
||||
$result = \yaml_parse_file($filename, $pos, $ndocs, $callbacks);
|
||||
} else {
|
||||
$result = \yaml_parse_file($filename, $pos, $ndocs);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw YamlException::createFromPhpError();
|
||||
}
|
||||
@@ -59,7 +63,11 @@ function yaml_parse_file(string $filename, int $pos = 0, ?int &$ndocs = null, ar
|
||||
function yaml_parse_url(string $url, int $pos = 0, ?int &$ndocs = null, array $callbacks = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \yaml_parse_url($url, $pos, $ndocs, $callbacks);
|
||||
if ($callbacks !== null) {
|
||||
$result = \yaml_parse_url($url, $pos, $ndocs, $callbacks);
|
||||
} else {
|
||||
$result = \yaml_parse_url($url, $pos, $ndocs);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw YamlException::createFromPhpError();
|
||||
}
|
||||
@@ -89,7 +97,11 @@ function yaml_parse_url(string $url, int $pos = 0, ?int &$ndocs = null, array $c
|
||||
function yaml_parse(string $input, int $pos = 0, ?int &$ndocs = null, array $callbacks = null)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \yaml_parse($input, $pos, $ndocs, $callbacks);
|
||||
if ($callbacks !== null) {
|
||||
$result = \yaml_parse($input, $pos, $ndocs, $callbacks);
|
||||
} else {
|
||||
$result = \yaml_parse($input, $pos, $ndocs);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw YamlException::createFromPhpError();
|
||||
}
|
||||
|
||||
93
vendor/thecodingmachine/safe/generated/zip.php
vendored
93
vendor/thecodingmachine/safe/generated/zip.php
vendored
@@ -21,10 +21,87 @@ function zip_entry_close($zip_entry): void
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the compressed size of the specified directory entry.
|
||||
*
|
||||
* @param resource $zip_entry A directory entry returned by zip_read.
|
||||
* @return int The compressed size.
|
||||
* @throws ZipException
|
||||
*
|
||||
*/
|
||||
function zip_entry_compressedsize($zip_entry): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \zip_entry_compressedsize($zip_entry);
|
||||
if ($result === false) {
|
||||
throw ZipException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the compression method of the directory entry specified
|
||||
* by zip_entry.
|
||||
*
|
||||
* @param resource $zip_entry A directory entry returned by zip_read.
|
||||
* @return string The compression method.
|
||||
* @throws ZipException
|
||||
*
|
||||
*/
|
||||
function zip_entry_compressionmethod($zip_entry): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \zip_entry_compressionmethod($zip_entry);
|
||||
if ($result === false) {
|
||||
throw ZipException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the actual size of the specified directory entry.
|
||||
*
|
||||
* @param resource $zip_entry A directory entry returned by zip_read.
|
||||
* @return int The size of the directory entry.
|
||||
* @throws ZipException
|
||||
*
|
||||
*/
|
||||
function zip_entry_filesize($zip_entry): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \zip_entry_filesize($zip_entry);
|
||||
if ($result === false) {
|
||||
throw ZipException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the name of the specified directory entry.
|
||||
*
|
||||
* @param resource $zip_entry A directory entry returned by zip_read.
|
||||
* @return string The name of the directory entry.
|
||||
* @throws ZipException
|
||||
*
|
||||
*/
|
||||
function zip_entry_name($zip_entry): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \zip_entry_name($zip_entry);
|
||||
if ($result === false) {
|
||||
throw ZipException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Opens a directory entry in a zip file for reading.
|
||||
*
|
||||
* @param resource $zip A valid resource handle returned by zip_open.
|
||||
* @param resource $zip_dp A valid resource handle returned by zip_open.
|
||||
* @param resource $zip_entry A directory entry returned by zip_read.
|
||||
* @param string $mode Any of the modes specified in the documentation of
|
||||
* fopen.
|
||||
@@ -35,14 +112,10 @@ function zip_entry_close($zip_entry): void
|
||||
* @throws ZipException
|
||||
*
|
||||
*/
|
||||
function zip_entry_open($zip, $zip_entry, string $mode = null): void
|
||||
function zip_entry_open($zip_dp, $zip_entry, string $mode = "rb"): void
|
||||
{
|
||||
error_clear_last();
|
||||
if ($mode !== null) {
|
||||
$result = \zip_entry_open($zip, $zip_entry, $mode);
|
||||
} else {
|
||||
$result = \zip_entry_open($zip, $zip_entry);
|
||||
}
|
||||
$result = \zip_entry_open($zip_dp, $zip_entry, $mode);
|
||||
if ($result === false) {
|
||||
throw ZipException::createFromPhpError();
|
||||
}
|
||||
@@ -53,17 +126,17 @@ function zip_entry_open($zip, $zip_entry, string $mode = null): void
|
||||
* Reads from an open directory entry.
|
||||
*
|
||||
* @param resource $zip_entry A directory entry returned by zip_read.
|
||||
* @param int $length The number of bytes to return.
|
||||
* @param int $len The number of bytes to return.
|
||||
*
|
||||
* This should be the uncompressed length you wish to read.
|
||||
* @return string Returns the data read, empty string on end of a file.
|
||||
* @throws ZipException
|
||||
*
|
||||
*/
|
||||
function zip_entry_read($zip_entry, int $length = 1024): string
|
||||
function zip_entry_read($zip_entry, int $len = 1024): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \zip_entry_read($zip_entry, $length);
|
||||
$result = \zip_entry_read($zip_entry, $len);
|
||||
if ($result === false) {
|
||||
throw ZipException::createFromPhpError();
|
||||
}
|
||||
|
||||
224
vendor/thecodingmachine/safe/generated/zlib.php
vendored
224
vendor/thecodingmachine/safe/generated/zlib.php
vendored
@@ -71,7 +71,11 @@ function deflate_add($context, string $data, int $flush_mode = ZLIB_SYNC_FLUSH):
|
||||
* window
|
||||
*
|
||||
*
|
||||
* The zlib window size (logarithmic) in range 8..15; defaults to 15.
|
||||
* The zlib window size (logarithmic) in range 8..15;
|
||||
* defaults to 15.
|
||||
* zlib changes a window size of 8 to 9,
|
||||
* and as of zlib 1.2.8 fails with a warning, if a window size of 8
|
||||
* is requested for ZLIB_ENCODING_RAW or ZLIB_ENCODING_GZIP.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -101,7 +105,11 @@ function deflate_add($context, string $data, int $flush_mode = ZLIB_SYNC_FLUSH):
|
||||
*
|
||||
* The compression memory level in range 1..9; defaults to 8.
|
||||
*
|
||||
* The zlib window size (logarithmic) in range 8..15; defaults to 15.
|
||||
* The zlib window size (logarithmic) in range 8..15;
|
||||
* defaults to 15.
|
||||
* zlib changes a window size of 8 to 9,
|
||||
* and as of zlib 1.2.8 fails with a warning, if a window size of 8
|
||||
* is requested for ZLIB_ENCODING_RAW or ZLIB_ENCODING_GZIP.
|
||||
*
|
||||
* One of ZLIB_FILTERED,
|
||||
* ZLIB_HUFFMAN_ONLY, ZLIB_RLE,
|
||||
@@ -115,7 +123,7 @@ function deflate_add($context, string $data, int $flush_mode = ZLIB_SYNC_FLUSH):
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function deflate_init(int $encoding, array $options = null)
|
||||
function deflate_init(int $encoding, array $options = [])
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \deflate_init($encoding, $options);
|
||||
@@ -129,15 +137,15 @@ function deflate_init(int $encoding, array $options = null)
|
||||
/**
|
||||
* Closes the given gz-file pointer.
|
||||
*
|
||||
* @param resource $zp The gz-file pointer. It must be valid, and must point to a file
|
||||
* @param resource $stream The gz-file pointer. It must be valid, and must point to a file
|
||||
* successfully opened by gzopen.
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function gzclose($zp): void
|
||||
function gzclose($stream): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \gzclose($zp);
|
||||
$result = \gzclose($stream);
|
||||
if ($result === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
@@ -178,19 +186,15 @@ function gzcompress(string $data, int $level = -1, int $encoding = ZLIB_ENCODING
|
||||
* data.
|
||||
*
|
||||
* @param string $data The data to decode, encoded by gzencode.
|
||||
* @param int $length The maximum length of data to decode.
|
||||
* @return string The decoded string.
|
||||
* @param int $max_length The maximum length of data to decode.
|
||||
* @return string The decoded string, or.
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function gzdecode(string $data, int $length = null): string
|
||||
function gzdecode(string $data, int $max_length = 0): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($length !== null) {
|
||||
$result = \gzdecode($data, $length);
|
||||
} else {
|
||||
$result = \gzdecode($data);
|
||||
}
|
||||
$result = \gzdecode($data, $max_length);
|
||||
if ($result === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
@@ -239,24 +243,42 @@ function gzdeflate(string $data, int $level = -1, int $encoding = ZLIB_ENCODING_
|
||||
* @param int $level The level of compression. Can be given as 0 for no compression up to 9
|
||||
* for maximum compression. If not given, the default compression level will
|
||||
* be the default compression level of the zlib library.
|
||||
* @param int $encoding_mode The encoding mode. Can be FORCE_GZIP (the default)
|
||||
* @param int $encoding The encoding mode. Can be FORCE_GZIP (the default)
|
||||
* or FORCE_DEFLATE.
|
||||
*
|
||||
* Prior to PHP 5.4.0, using FORCE_DEFLATE results in
|
||||
* a standard zlib deflated string (inclusive zlib headers) after a gzip
|
||||
* file header but without the trailing crc32 checksum.
|
||||
*
|
||||
* In PHP 5.4.0 and later, FORCE_DEFLATE generates
|
||||
* FORCE_DEFLATE generates
|
||||
* RFC 1950 compliant output, consisting of a zlib header, the deflated
|
||||
* data, and an Adler checksum.
|
||||
* @return string The encoded string.
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function gzencode(string $data, int $level = -1, int $encoding_mode = FORCE_GZIP): string
|
||||
function gzencode(string $data, int $level = -1, int $encoding = ZLIB_ENCODING_GZIP): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \gzencode($data, $level, $encoding_mode);
|
||||
$result = \gzencode($data, $level, $encoding);
|
||||
if ($result === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function is identical to readgzfile, except that
|
||||
* it returns the file in an array.
|
||||
*
|
||||
* @param string $filename The file name.
|
||||
* @param int $use_include_path You can set this optional parameter to 1, if you
|
||||
* want to search for the file in the include_path too.
|
||||
* @return array An array containing the file, one line per cell, empty lines included, and with newlines still attached.
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function gzfile(string $filename, int $use_include_path = 0): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \gzfile($filename, $use_include_path);
|
||||
if ($result === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
@@ -269,20 +291,20 @@ function gzencode(string $data, int $level = -1, int $encoding_mode = FORCE_GZIP
|
||||
* file pointer. Reading ends when length - 1 bytes have been read, on a
|
||||
* newline, or on EOF (whichever comes first).
|
||||
*
|
||||
* @param resource $zp The gz-file pointer. It must be valid, and must point to a file
|
||||
* @param resource $stream The gz-file pointer. It must be valid, and must point to a file
|
||||
* successfully opened by gzopen.
|
||||
* @param int $length The length of data to get.
|
||||
* @return string The uncompressed string.
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function gzgets($zp, int $length = null): string
|
||||
function gzgets($stream, int $length = null): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($length !== null) {
|
||||
$result = \gzgets($zp, $length);
|
||||
$result = \gzgets($stream, $length);
|
||||
} else {
|
||||
$result = \gzgets($zp);
|
||||
$result = \gzgets($stream);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
@@ -324,19 +346,56 @@ function gzgetss($zp, int $length, string $allowable_tags = null): string
|
||||
* This function inflates a deflated string.
|
||||
*
|
||||
* @param string $data The data compressed by gzdeflate.
|
||||
* @param int $length The maximum length of data to decode.
|
||||
* @param int $max_length The maximum length of decoded data.
|
||||
* @return string The original uncompressed data.
|
||||
*
|
||||
* The function will return an error if the uncompressed data is more than
|
||||
* 32768 times the length of the compressed input data
|
||||
* or more than the optional parameter length.
|
||||
* or, unless max_length is 0, more than the optional parameter max_length.
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function gzinflate(string $data, int $length = 0): string
|
||||
function gzinflate(string $data, int $max_length = 0): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \gzinflate($data, $length);
|
||||
$result = \gzinflate($data, $max_length);
|
||||
if ($result === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Opens a gzip (.gz) file for reading or writing.
|
||||
*
|
||||
* gzopen can be used to read a file which is
|
||||
* not in gzip format; in this case gzread will
|
||||
* directly read from the file without decompression.
|
||||
*
|
||||
* @param string $filename The file name.
|
||||
* @param string $mode As in fopen (rb or
|
||||
* wb) but can also include a compression level
|
||||
* (wb9) or a strategy: f for
|
||||
* filtered data as in wb6f, h for
|
||||
* Huffman only compression as in wb1h.
|
||||
* (See the description of deflateInit2
|
||||
* in zlib.h for
|
||||
* more information about the strategy parameter.)
|
||||
* @param int $use_include_path You can set this optional parameter to 1, if you
|
||||
* want to search for the file in the include_path too.
|
||||
* @return resource Returns a file pointer to the file opened, after that, everything you read
|
||||
* from this file descriptor will be transparently decompressed and what you
|
||||
* write gets compressed.
|
||||
*
|
||||
* If the open fails, the function returns FALSE.
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function gzopen(string $filename, string $mode, int $use_include_path = 0)
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \gzopen($filename, $mode, $use_include_path);
|
||||
if ($result === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
@@ -348,17 +407,41 @@ function gzinflate(string $data, int $length = 0): string
|
||||
* Reads to EOF on the given gz-file pointer from the current position and
|
||||
* writes the (uncompressed) results to standard output.
|
||||
*
|
||||
* @param resource $zp The gz-file pointer. It must be valid, and must point to a file
|
||||
* @param resource $stream The gz-file pointer. It must be valid, and must point to a file
|
||||
* successfully opened by gzopen.
|
||||
* @return int The number of uncompressed characters read from gz
|
||||
* and passed through to the input.
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function gzpassthru($zp): int
|
||||
function gzpassthru($stream): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \gzpassthru($zp);
|
||||
$result = \gzpassthru($stream);
|
||||
if ($result === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* gzread reads up to length bytes
|
||||
* from the given gz-file pointer. Reading stops when
|
||||
* length (uncompressed) bytes have been read
|
||||
* or EOF is reached, whichever comes first.
|
||||
*
|
||||
* @param resource $stream The gz-file pointer. It must be valid, and must point to a file
|
||||
* successfully opened by gzopen.
|
||||
* @param int $length The number of bytes to read.
|
||||
* @return string The data that have been read.
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function gzread($stream, int $length): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \gzread($stream, $length);
|
||||
if ($result === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
@@ -370,15 +453,15 @@ function gzpassthru($zp): int
|
||||
* Sets the file position indicator of the given gz-file pointer to the
|
||||
* beginning of the file stream.
|
||||
*
|
||||
* @param resource $zp The gz-file pointer. It must be valid, and must point to a file
|
||||
* @param resource $stream The gz-file pointer. It must be valid, and must point to a file
|
||||
* successfully opened by gzopen.
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function gzrewind($zp): void
|
||||
function gzrewind($stream): void
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \gzrewind($zp);
|
||||
$result = \gzrewind($stream);
|
||||
if ($result === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
@@ -389,19 +472,50 @@ function gzrewind($zp): void
|
||||
* This function uncompress a compressed string.
|
||||
*
|
||||
* @param string $data The data compressed by gzcompress.
|
||||
* @param int $length The maximum length of data to decode.
|
||||
* @param int $max_length The maximum length of data to decode.
|
||||
* @return string The original uncompressed data.
|
||||
*
|
||||
* The function will return an error if the uncompressed data is more than
|
||||
* 32768 times the length of the compressed input data
|
||||
* or more than the optional parameter length.
|
||||
* or more than the optional parameter max_length.
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function gzuncompress(string $data, int $length = 0): string
|
||||
function gzuncompress(string $data, int $max_length = 0): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \gzuncompress($data, $length);
|
||||
$result = \gzuncompress($data, $max_length);
|
||||
if ($result === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* gzwrite writes the contents of
|
||||
* data to the given gz-file.
|
||||
*
|
||||
* @param resource $stream The gz-file pointer. It must be valid, and must point to a file
|
||||
* successfully opened by gzopen.
|
||||
* @param string $data The string to write.
|
||||
* @param int $length The number of uncompressed bytes to write. If supplied, writing will
|
||||
* stop after length (uncompressed) bytes have been
|
||||
* written or the end of data is reached,
|
||||
* whichever comes first.
|
||||
* @return int Returns the number of (uncompressed) bytes written to the given gz-file
|
||||
* stream.
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function gzwrite($stream, string $data, int $length = null): int
|
||||
{
|
||||
error_clear_last();
|
||||
if ($length !== null) {
|
||||
$result = \gzwrite($stream, $data, $length);
|
||||
} else {
|
||||
$result = \gzwrite($stream, $data);
|
||||
}
|
||||
if ($result === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
@@ -412,15 +526,15 @@ function gzuncompress(string $data, int $length = 0): string
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param resource $resource
|
||||
* @param resource $context
|
||||
* @return int Returns number of bytes read so far.
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function inflate_get_read_len($resource): int
|
||||
function inflate_get_read_len($context): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \inflate_get_read_len($resource);
|
||||
$result = \inflate_get_read_len($context);
|
||||
if ($result === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
@@ -431,15 +545,15 @@ function inflate_get_read_len($resource): int
|
||||
/**
|
||||
* Usually returns either ZLIB_OK or ZLIB_STREAM_END.
|
||||
*
|
||||
* @param resource $resource
|
||||
* @param resource $context
|
||||
* @return int Returns decompression status.
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function inflate_get_status($resource): int
|
||||
function inflate_get_status($context): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \inflate_get_status($resource);
|
||||
$result = \inflate_get_status($context);
|
||||
if ($result === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
@@ -454,7 +568,7 @@ function inflate_get_status($resource): int
|
||||
* available.
|
||||
*
|
||||
* @param resource $context A context created with inflate_init.
|
||||
* @param string $encoded_data A chunk of compressed data.
|
||||
* @param string $data A chunk of compressed data.
|
||||
* @param int $flush_mode One of ZLIB_BLOCK,
|
||||
* ZLIB_NO_FLUSH,
|
||||
* ZLIB_PARTIAL_FLUSH,
|
||||
@@ -468,10 +582,10 @@ function inflate_get_status($resource): int
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function inflate_add($context, string $encoded_data, int $flush_mode = ZLIB_SYNC_FLUSH): string
|
||||
function inflate_add($context, string $data, int $flush_mode = ZLIB_SYNC_FLUSH): string
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \inflate_add($context, $encoded_data, $flush_mode);
|
||||
$result = \inflate_add($context, $data, $flush_mode);
|
||||
if ($result === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
@@ -550,7 +664,7 @@ function inflate_add($context, string $encoded_data, int $flush_mode = ZLIB_SYNC
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function inflate_init(int $encoding, array $options = null)
|
||||
function inflate_init(int $encoding, array $options = [])
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \inflate_init($encoding, $options);
|
||||
@@ -591,19 +705,15 @@ function readgzfile(string $filename, int $use_include_path = 0): int
|
||||
* Uncompress any raw/gzip/zlib encoded data.
|
||||
*
|
||||
* @param string $data
|
||||
* @param int $max_decoded_len
|
||||
* @param int $max_length
|
||||
* @return string Returns the uncompressed data.
|
||||
* @throws ZlibException
|
||||
*
|
||||
*/
|
||||
function zlib_decode(string $data, int $max_decoded_len = null): string
|
||||
function zlib_decode(string $data, int $max_length = 0): string
|
||||
{
|
||||
error_clear_last();
|
||||
if ($max_decoded_len !== null) {
|
||||
$result = \zlib_decode($data, $max_decoded_len);
|
||||
} else {
|
||||
$result = \zlib_decode($data);
|
||||
}
|
||||
$result = \zlib_decode($data, $max_length);
|
||||
if ($result === false) {
|
||||
throw ZlibException::createFromPhpError();
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ class DateTime extends \DateTime
|
||||
*/
|
||||
public static function createFromFormat($format, $time, $timezone = null): self
|
||||
{
|
||||
$datetime = parent::createFromFormat($format, $time, $timezone);
|
||||
$datetime = \DateTime::createFromFormat($format, $time, $timezone);
|
||||
if ($datetime === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
|
||||
@@ -2,10 +2,6 @@
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use DateInterval;
|
||||
use DateTime;
|
||||
use DateTimeInterface;
|
||||
use DateTimeZone;
|
||||
use Safe\Exceptions\DatetimeException;
|
||||
|
||||
/**
|
||||
@@ -23,7 +19,7 @@ class DateTimeImmutable extends \DateTimeImmutable
|
||||
/**
|
||||
* DateTimeImmutable constructor.
|
||||
* @param string $time
|
||||
* @param DateTimeZone|null $timezone
|
||||
* @param \DateTimeZone|null $timezone
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function __construct($time = 'now', $timezone = null)
|
||||
@@ -52,12 +48,12 @@ class DateTimeImmutable extends \DateTimeImmutable
|
||||
/**
|
||||
* @param string $format
|
||||
* @param string $time
|
||||
* @param DateTimeZone|null $timezone
|
||||
* @param \DateTimeZone|null $timezone
|
||||
* @throws DatetimeException
|
||||
*/
|
||||
public static function createFromFormat($format, $time, $timezone = null): self
|
||||
{
|
||||
$datetime = parent::createFromFormat($format, $time, $timezone);
|
||||
$datetime = \DateTimeImmutable::createFromFormat($format, $time, $timezone);
|
||||
if ($datetime === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
@@ -80,12 +76,12 @@ class DateTimeImmutable extends \DateTimeImmutable
|
||||
}
|
||||
|
||||
/**
|
||||
* @param DateTimeInterface $datetime2
|
||||
* @param \DateTimeInterface $datetime2
|
||||
* @param bool $absolute
|
||||
* @return DateInterval
|
||||
* @return \DateInterval
|
||||
* @throws DatetimeException
|
||||
*/
|
||||
public function diff($datetime2, $absolute = false): DateInterval
|
||||
public function diff($datetime2, $absolute = false): \DateInterval
|
||||
{
|
||||
/** @var \DateInterval|false $result */
|
||||
$result = $this->innerDateTime->diff($datetime2, $absolute);
|
||||
@@ -178,7 +174,7 @@ class DateTimeImmutable extends \DateTimeImmutable
|
||||
}
|
||||
|
||||
/**
|
||||
* @param DateTimeZone $timezone
|
||||
* @param \DateTimeZone $timezone
|
||||
* @return DateTimeImmutable
|
||||
* @throws DatetimeException
|
||||
*/
|
||||
@@ -193,7 +189,7 @@ class DateTimeImmutable extends \DateTimeImmutable
|
||||
}
|
||||
|
||||
/**
|
||||
* @param DateInterval $interval
|
||||
* @param \DateInterval $interval
|
||||
* @return DateTimeImmutable
|
||||
* @throws DatetimeException
|
||||
*/
|
||||
@@ -224,7 +220,7 @@ class DateTimeImmutable extends \DateTimeImmutable
|
||||
//overload getters to use the inner datetime immutable instead of itself
|
||||
|
||||
/**
|
||||
* @param DateInterval $interval
|
||||
* @param \DateInterval $interval
|
||||
* @return DateTimeImmutable
|
||||
*/
|
||||
public function add($interval): self
|
||||
@@ -233,12 +229,14 @@ class DateTimeImmutable extends \DateTimeImmutable
|
||||
}
|
||||
|
||||
/**
|
||||
* @param DateTime $dateTime
|
||||
* @param \DateTime $dateTime
|
||||
* @return DateTimeImmutable
|
||||
*/
|
||||
public static function createFromMutable($dateTime): self
|
||||
{
|
||||
return self::createFromRegular(parent::createFromMutable($dateTime));
|
||||
$date = \DateTimeImmutable::createFromMutable($dateTime);
|
||||
|
||||
return self::createFromRegular($date);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -250,7 +248,7 @@ class DateTimeImmutable extends \DateTimeImmutable
|
||||
return self::createFromRegular(parent::__set_state($array));
|
||||
}
|
||||
|
||||
public function getTimezone(): DateTimeZone
|
||||
public function getTimezone(): \DateTimeZone
|
||||
{
|
||||
return $this->innerDateTime->getTimezone();
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@ namespace Safe\Exceptions;
|
||||
class CurlException extends \Exception implements SafeExceptionInterface
|
||||
{
|
||||
/**
|
||||
* @param resource $ch
|
||||
* @param \CurlHandle $ch
|
||||
*/
|
||||
public static function createFromCurlResource($ch): self
|
||||
public static function createFromPhpError($ch): self
|
||||
{
|
||||
return new self(\curl_error($ch), \curl_errno($ch));
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
namespace Safe\Exceptions;
|
||||
|
||||
class JsonException extends \Exception implements SafeExceptionInterface
|
||||
class JsonException extends \JsonException implements SafeExceptionInterface
|
||||
{
|
||||
public static function createFromPhpError(): self
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ class SimplexmlException extends \ErrorException implements SafeExceptionInterfa
|
||||
{
|
||||
public static function createFromPhpError(): self
|
||||
{
|
||||
$error = error_get_last();
|
||||
$error = \error_get_last();
|
||||
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
|
||||
}
|
||||
}
|
||||
178
vendor/thecodingmachine/safe/lib/special_cases.php
vendored
178
vendor/thecodingmachine/safe/lib/special_cases.php
vendored
@@ -7,13 +7,18 @@
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use Safe\Exceptions\SocketsException;
|
||||
use Safe\Exceptions\FilesystemException;
|
||||
use const PREG_NO_ERROR;
|
||||
|
||||
use Safe\Exceptions\MiscException;
|
||||
use Safe\Exceptions\PosixException;
|
||||
use Safe\Exceptions\SocketsException;
|
||||
use Safe\Exceptions\ApcException;
|
||||
use Safe\Exceptions\ApcuException;
|
||||
use Safe\Exceptions\JsonException;
|
||||
use Safe\Exceptions\OpensslException;
|
||||
use Safe\Exceptions\PcreException;
|
||||
use Safe\Exceptions\SimplexmlException;
|
||||
|
||||
/**
|
||||
* Wrapper for json_decode that throws when an error occurs.
|
||||
@@ -21,7 +26,7 @@ use Safe\Exceptions\PcreException;
|
||||
* @param string $json JSON data to parse
|
||||
* @param bool $assoc When true, returned objects will be converted
|
||||
* into associative arrays.
|
||||
* @param int $depth User specified recursion depth.
|
||||
* @param int<1, max> $depth User specified recursion depth.
|
||||
* @param int $options Bitmask of JSON decode options.
|
||||
*
|
||||
* @return mixed
|
||||
@@ -83,12 +88,12 @@ function apcu_fetch($key)
|
||||
* pattern and replaces them with
|
||||
* replacement.
|
||||
*
|
||||
* @param mixed $pattern The pattern to search for. It can be either a string or an array with
|
||||
* @param string[]|string $pattern The pattern to search for. It can be either a string or an array with
|
||||
* strings.
|
||||
*
|
||||
* Several PCRE modifiers
|
||||
* are also available.
|
||||
* @param mixed $replacement The string or an array with strings to replace. If this parameter is a
|
||||
* @param string[]|string $replacement The string or an array with strings to replace. If this parameter is a
|
||||
* string and the pattern parameter is an array,
|
||||
* all patterns will be replaced by that string. If both
|
||||
* pattern and replacement
|
||||
@@ -216,7 +221,7 @@ function openssl_encrypt(string $data, string $method, string $key, int $options
|
||||
* socket from the given
|
||||
* buffer.
|
||||
*
|
||||
* @param resource $socket
|
||||
* @param \Socket $socket
|
||||
* @param string $buffer The buffer to be written.
|
||||
* @param int $length The optional parameter length can specify an
|
||||
* alternate length of bytes written to the socket. If this length is
|
||||
@@ -230,7 +235,7 @@ function openssl_encrypt(string $data, string $method, string $key, int $options
|
||||
* @throws SocketsException
|
||||
*
|
||||
*/
|
||||
function socket_write($socket, string $buffer, int $length = 0): int
|
||||
function socket_write(\Socket $socket, string $buffer, int $length = 0): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = $length === 0 ? \socket_write($socket, $buffer) : \socket_write($socket, $buffer, $length);
|
||||
@@ -239,3 +244,164 @@ function socket_write($socket, string $buffer, int $length = 0): int
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function takes a node of a DOM
|
||||
* document and makes it into a SimpleXML node. This new object can
|
||||
* then be used as a native SimpleXML element.
|
||||
*
|
||||
* @param \DOMNode $node A DOM Element node
|
||||
* @param string $class_name You may use this optional parameter so that
|
||||
* simplexml_import_dom will return an object of
|
||||
* the specified class. That class should extend the
|
||||
* SimpleXMLElement class.
|
||||
* @return \SimpleXMLElement Returns a SimpleXMLElement.
|
||||
* @throws SimplexmlException
|
||||
*
|
||||
*/
|
||||
function simplexml_import_dom(\DOMNode $node, string $class_name = \SimpleXMLElement::class): \SimpleXMLElement
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \simplexml_import_dom($node, $class_name);
|
||||
if ($result === null) {
|
||||
throw SimplexmlException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the well-formed XML document in the given file to an object.
|
||||
*
|
||||
* @param string $filename Path to the XML file
|
||||
* @param string $class_name You may use this optional parameter so that
|
||||
* simplexml_load_file will return an object of
|
||||
* the specified class. That class should extend the
|
||||
* SimpleXMLElement class.
|
||||
* @param int $options Since Libxml 2.6.0, you may also use the
|
||||
* options parameter to specify additional Libxml parameters.
|
||||
* @param string $namespace_or_prefix Namespace prefix or URI.
|
||||
* @param bool $is_prefix TRUE if namespace_or_prefix is a prefix, FALSE if it's a URI;
|
||||
* defaults to FALSE.
|
||||
* @return \SimpleXMLElement Returns an object of class SimpleXMLElement with
|
||||
* properties containing the data held within the XML document.
|
||||
* @throws SimplexmlException
|
||||
*
|
||||
*/
|
||||
function simplexml_load_file(string $filename, string $class_name = \SimpleXMLElement::class, int $options = 0, string $namespace_or_prefix = "", bool $is_prefix = false): \SimpleXMLElement
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \simplexml_load_file($filename, $class_name, $options, $namespace_or_prefix, $is_prefix);
|
||||
if ($result === false) {
|
||||
throw SimplexmlException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Takes a well-formed XML string and returns it as an object.
|
||||
*
|
||||
* @param string $data A well-formed XML string
|
||||
* @param string $class_name You may use this optional parameter so that
|
||||
* simplexml_load_string will return an object of
|
||||
* the specified class. That class should extend the
|
||||
* SimpleXMLElement class.
|
||||
* @param int $options Since Libxml 2.6.0, you may also use the
|
||||
* options parameter to specify additional Libxml parameters.
|
||||
* @param string $namespace_or_prefix Namespace prefix or URI.
|
||||
* @param bool $is_prefix TRUE if namespace_or_prefix is a prefix, FALSE if it's a URI;
|
||||
* defaults to FALSE.
|
||||
* @return \SimpleXMLElement Returns an object of class SimpleXMLElement with
|
||||
* properties containing the data held within the xml document.
|
||||
* @throws SimplexmlException
|
||||
*
|
||||
*/
|
||||
function simplexml_load_string(string $data, string $class_name = \SimpleXMLElement::class, int $options = 0, string $namespace_or_prefix = "", bool $is_prefix = false): \SimpleXMLElement
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \simplexml_load_string($data, $class_name, $options, $namespace_or_prefix, $is_prefix);
|
||||
if ($result === false) {
|
||||
throw SimplexmlException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns three samples representing the average system load
|
||||
* (the number of processes in the system run queue) over the last 1, 5 and 15
|
||||
* minutes, respectively. Returns FALSE on failure.
|
||||
*
|
||||
* @return array<int,float> Returns an array with three samples (last 1, 5 and 15
|
||||
* minutes).
|
||||
* @throws MiscException
|
||||
*
|
||||
*/
|
||||
function sys_getloadavg(): array
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \sys_getloadavg();
|
||||
if ($result === false) {
|
||||
throw MiscException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the process group identifier of the process
|
||||
* process_id.
|
||||
*
|
||||
* @param int $process_id The process id.
|
||||
* @return int Returns the identifier, as an int.
|
||||
* @throws PosixException
|
||||
*
|
||||
*/
|
||||
function posix_getpgid(int $process_id): int
|
||||
{
|
||||
error_clear_last();
|
||||
$result = \posix_getpgid($process_id);
|
||||
if ($result === false) {
|
||||
throw PosixException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* fputcsv formats a line (passed as a
|
||||
* fields array) as CSV and writes it (terminated by a
|
||||
* newline) to the specified file stream.
|
||||
*
|
||||
* @param resource $stream The file pointer must be valid, and must point to
|
||||
* a file successfully opened by fopen or
|
||||
* fsockopen (and not yet closed by
|
||||
* fclose).
|
||||
* @phpstan-param (scalar|\Stringable|null)[] $fields
|
||||
* @param array $fields An array of strings.
|
||||
* @param string $separator The optional separator parameter sets the field
|
||||
* delimiter (one single-byte character only).
|
||||
* @param string $enclosure The optional enclosure parameter sets the field
|
||||
* enclosure (one single-byte character only).
|
||||
* @param string $escape The optional escape parameter sets the
|
||||
* escape character (at most one single-byte character).
|
||||
* An empty string ("") disables the proprietary escape mechanism.
|
||||
* @param string $eol The optional eol parameter sets
|
||||
* a custom End of Line sequence.
|
||||
* @return int Returns the length of the written string.
|
||||
* @throws FilesystemException
|
||||
*
|
||||
*/
|
||||
function fputcsv($stream, array $fields, string $separator = ",", string $enclosure = "\"", string $escape = "\\", string $eol = "\n"): int
|
||||
{
|
||||
error_clear_last();
|
||||
if (PHP_VERSION_ID >= 80100) {
|
||||
/** @phpstan-ignore-next-line */
|
||||
$result = \fputcsv($stream, $fields, $separator, $enclosure, $escape, $eol);
|
||||
} else {
|
||||
$result = \fputcsv($stream, $fields, $separator, $enclosure, $escape);
|
||||
}
|
||||
|
||||
if ($result === false) {
|
||||
throw FilesystemException::createFromPhpError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
14
vendor/thecodingmachine/safe/phpunit.xml.dist
vendored
Normal file
14
vendor/thecodingmachine/safe/phpunit.xml.dist
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<phpunit
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
|
||||
colors="true"
|
||||
bootstrap="vendor/autoload.php"
|
||||
>
|
||||
<testsuites>
|
||||
<testsuite name="Main test Suite">
|
||||
<directory>./tests/</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
</phpunit>
|
||||
@@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||
use Rector\Renaming\Rector\FuncCall\RenameFunctionRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
# This file configures rector/rector:~0.7.0 to replace all PHP functions with their equivalent "safe" functions
|
||||
// This file configures rector/rector to replace all PHP functions with their equivalent "safe" functions.
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
@@ -13,8 +13,8 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
->call('configure', [[ RenameFunctionRector::OLD_FUNCTION_TO_NEW_FUNCTION => [
|
||||
'apache_getenv' => 'Safe\apache_getenv',
|
||||
'apache_get_version' => 'Safe\apache_get_version',
|
||||
'apache_lookup_uri' => 'Safe\apache_lookup_uri',
|
||||
'apache_request_headers' => 'Safe\apache_request_headers',
|
||||
'apache_reset_timeout' => 'Safe\apache_reset_timeout',
|
||||
'apache_response_headers' => 'Safe\apache_response_headers',
|
||||
'apache_setenv' => 'Safe\apache_setenv',
|
||||
'apcu_cache_info' => 'Safe\apcu_cache_info',
|
||||
@@ -24,14 +24,12 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'apcu_inc' => 'Safe\apcu_inc',
|
||||
'apcu_sma_info' => 'Safe\apcu_sma_info',
|
||||
'apc_fetch' => 'Safe\apc_fetch',
|
||||
'array_combine' => 'Safe\array_combine',
|
||||
'array_flip' => 'Safe\array_flip',
|
||||
'array_replace' => 'Safe\array_replace',
|
||||
'array_replace_recursive' => 'Safe\array_replace_recursive',
|
||||
'array_walk_recursive' => 'Safe\array_walk_recursive',
|
||||
'arsort' => 'Safe\arsort',
|
||||
'asort' => 'Safe\asort',
|
||||
'assert_options' => 'Safe\assert_options',
|
||||
'base64_decode' => 'Safe\base64_decode',
|
||||
'bindtextdomain' => 'Safe\bindtextdomain',
|
||||
'bzclose' => 'Safe\bzclose',
|
||||
'bzflush' => 'Safe\bzflush',
|
||||
'bzread' => 'Safe\bzread',
|
||||
@@ -47,32 +45,75 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'class_uses' => 'Safe\class_uses',
|
||||
'cli_set_process_title' => 'Safe\cli_set_process_title',
|
||||
'closelog' => 'Safe\closelog',
|
||||
'com_create_guid' => 'Safe\com_create_guid',
|
||||
'com_event_sink' => 'Safe\com_event_sink',
|
||||
'com_load_typelib' => 'Safe\com_load_typelib',
|
||||
'com_print_typeinfo' => 'Safe\com_print_typeinfo',
|
||||
'convert_uudecode' => 'Safe\convert_uudecode',
|
||||
'convert_uuencode' => 'Safe\convert_uuencode',
|
||||
'copy' => 'Safe\copy',
|
||||
'create_function' => 'Safe\create_function',
|
||||
'cubrid_bind' => 'Safe\cubrid_bind',
|
||||
'cubrid_column_names' => 'Safe\cubrid_column_names',
|
||||
'cubrid_column_types' => 'Safe\cubrid_column_types',
|
||||
'cubrid_col_size' => 'Safe\cubrid_col_size',
|
||||
'cubrid_commit' => 'Safe\cubrid_commit',
|
||||
'cubrid_connect' => 'Safe\cubrid_connect',
|
||||
'cubrid_connect_with_url' => 'Safe\cubrid_connect_with_url',
|
||||
'cubrid_current_oid' => 'Safe\cubrid_current_oid',
|
||||
'cubrid_disconnect' => 'Safe\cubrid_disconnect',
|
||||
'cubrid_drop' => 'Safe\cubrid_drop',
|
||||
'cubrid_free_result' => 'Safe\cubrid_free_result',
|
||||
'cubrid_get_charset' => 'Safe\cubrid_get_charset',
|
||||
'cubrid_get_class_name' => 'Safe\cubrid_get_class_name',
|
||||
'cubrid_get_client_info' => 'Safe\cubrid_get_client_info',
|
||||
'cubrid_get_db_parameter' => 'Safe\cubrid_get_db_parameter',
|
||||
'cubrid_get_query_timeout' => 'Safe\cubrid_get_query_timeout',
|
||||
'cubrid_get_server_info' => 'Safe\cubrid_get_server_info',
|
||||
'cubrid_insert_id' => 'Safe\cubrid_insert_id',
|
||||
'cubrid_lob2_bind' => 'Safe\cubrid_lob2_bind',
|
||||
'cubrid_lob2_close' => 'Safe\cubrid_lob2_close',
|
||||
'cubrid_lob2_export' => 'Safe\cubrid_lob2_export',
|
||||
'cubrid_lob2_import' => 'Safe\cubrid_lob2_import',
|
||||
'cubrid_lob2_new' => 'Safe\cubrid_lob2_new',
|
||||
'cubrid_lob2_read' => 'Safe\cubrid_lob2_read',
|
||||
'cubrid_lob2_seek' => 'Safe\cubrid_lob2_seek',
|
||||
'cubrid_lob2_seek64' => 'Safe\cubrid_lob2_seek64',
|
||||
'cubrid_lob2_size' => 'Safe\cubrid_lob2_size',
|
||||
'cubrid_lob2_size64' => 'Safe\cubrid_lob2_size64',
|
||||
'cubrid_lob2_tell' => 'Safe\cubrid_lob2_tell',
|
||||
'cubrid_lob2_tell64' => 'Safe\cubrid_lob2_tell64',
|
||||
'cubrid_lob2_write' => 'Safe\cubrid_lob2_write',
|
||||
'cubrid_lob_close' => 'Safe\cubrid_lob_close',
|
||||
'cubrid_lob_export' => 'Safe\cubrid_lob_export',
|
||||
'cubrid_lob_get' => 'Safe\cubrid_lob_get',
|
||||
'cubrid_lob_send' => 'Safe\cubrid_lob_send',
|
||||
'cubrid_lob_size' => 'Safe\cubrid_lob_size',
|
||||
'cubrid_lock_read' => 'Safe\cubrid_lock_read',
|
||||
'cubrid_lock_write' => 'Safe\cubrid_lock_write',
|
||||
'cubrid_move_cursor' => 'Safe\cubrid_move_cursor',
|
||||
'cubrid_next_result' => 'Safe\cubrid_next_result',
|
||||
'cubrid_pconnect' => 'Safe\cubrid_pconnect',
|
||||
'cubrid_pconnect_with_url' => 'Safe\cubrid_pconnect_with_url',
|
||||
'cubrid_prepare' => 'Safe\cubrid_prepare',
|
||||
'cubrid_put' => 'Safe\cubrid_put',
|
||||
'cubrid_rollback' => 'Safe\cubrid_rollback',
|
||||
'cubrid_schema' => 'Safe\cubrid_schema',
|
||||
'cubrid_seq_drop' => 'Safe\cubrid_seq_drop',
|
||||
'cubrid_seq_insert' => 'Safe\cubrid_seq_insert',
|
||||
'cubrid_seq_put' => 'Safe\cubrid_seq_put',
|
||||
'cubrid_set_add' => 'Safe\cubrid_set_add',
|
||||
'cubrid_set_autocommit' => 'Safe\cubrid_set_autocommit',
|
||||
'cubrid_set_db_parameter' => 'Safe\cubrid_set_db_parameter',
|
||||
'cubrid_set_drop' => 'Safe\cubrid_set_drop',
|
||||
'cubrid_set_query_timeout' => 'Safe\cubrid_set_query_timeout',
|
||||
'curl_copy_handle' => 'Safe\curl_copy_handle',
|
||||
'curl_escape' => 'Safe\curl_escape',
|
||||
'curl_exec' => 'Safe\curl_exec',
|
||||
'curl_getinfo' => 'Safe\curl_getinfo',
|
||||
'curl_init' => 'Safe\curl_init',
|
||||
'curl_multi_errno' => 'Safe\curl_multi_errno',
|
||||
'curl_multi_info_read' => 'Safe\curl_multi_info_read',
|
||||
'curl_multi_init' => 'Safe\curl_multi_init',
|
||||
'curl_multi_setopt' => 'Safe\curl_multi_setopt',
|
||||
'curl_setopt' => 'Safe\curl_setopt',
|
||||
'curl_share_errno' => 'Safe\curl_share_errno',
|
||||
'curl_share_setopt' => 'Safe\curl_share_setopt',
|
||||
@@ -112,6 +153,7 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'eio_event_loop' => 'Safe\eio_event_loop',
|
||||
'eio_fallocate' => 'Safe\eio_fallocate',
|
||||
'eio_fchmod' => 'Safe\eio_fchmod',
|
||||
'eio_fchown' => 'Safe\eio_fchown',
|
||||
'eio_fdatasync' => 'Safe\eio_fdatasync',
|
||||
'eio_fstat' => 'Safe\eio_fstat',
|
||||
'eio_fstatvfs' => 'Safe\eio_fstatvfs',
|
||||
@@ -141,16 +183,20 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'eio_utime' => 'Safe\eio_utime',
|
||||
'eio_write' => 'Safe\eio_write',
|
||||
'error_log' => 'Safe\error_log',
|
||||
'exec' => 'Safe\exec',
|
||||
'fastcgi_finish_request' => 'Safe\fastcgi_finish_request',
|
||||
'fbird_blob_cancel' => 'Safe\fbird_blob_cancel',
|
||||
'fclose' => 'Safe\fclose',
|
||||
'fdatasync' => 'Safe\fdatasync',
|
||||
'fflush' => 'Safe\fflush',
|
||||
'fgetcsv' => 'Safe\fgetcsv',
|
||||
'file' => 'Safe\file',
|
||||
'fileatime' => 'Safe\fileatime',
|
||||
'filectime' => 'Safe\filectime',
|
||||
'fileinode' => 'Safe\fileinode',
|
||||
'filemtime' => 'Safe\filemtime',
|
||||
'fileowner' => 'Safe\fileowner',
|
||||
'fileperms' => 'Safe\fileperms',
|
||||
'filesize' => 'Safe\filesize',
|
||||
'file_get_contents' => 'Safe\file_get_contents',
|
||||
'file_put_contents' => 'Safe\file_put_contents',
|
||||
@@ -163,6 +209,8 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'fputcsv' => 'Safe\fputcsv',
|
||||
'fread' => 'Safe\fread',
|
||||
'fsockopen' => 'Safe\fsockopen',
|
||||
'fstat' => 'Safe\fstat',
|
||||
'fsync' => 'Safe\fsync',
|
||||
'ftp_alloc' => 'Safe\ftp_alloc',
|
||||
'ftp_append' => 'Safe\ftp_append',
|
||||
'ftp_cdup' => 'Safe\ftp_cdup',
|
||||
@@ -177,10 +225,12 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'ftp_login' => 'Safe\ftp_login',
|
||||
'ftp_mkdir' => 'Safe\ftp_mkdir',
|
||||
'ftp_mlsd' => 'Safe\ftp_mlsd',
|
||||
'ftp_nb_put' => 'Safe\ftp_nb_put',
|
||||
'ftp_nlist' => 'Safe\ftp_nlist',
|
||||
'ftp_pasv' => 'Safe\ftp_pasv',
|
||||
'ftp_put' => 'Safe\ftp_put',
|
||||
'ftp_pwd' => 'Safe\ftp_pwd',
|
||||
'ftp_raw' => 'Safe\ftp_raw',
|
||||
'ftp_rename' => 'Safe\ftp_rename',
|
||||
'ftp_rmdir' => 'Safe\ftp_rmdir',
|
||||
'ftp_site' => 'Safe\ftp_site',
|
||||
@@ -200,19 +250,22 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'getopt' => 'Safe\getopt',
|
||||
'getprotobyname' => 'Safe\getprotobyname',
|
||||
'getprotobynumber' => 'Safe\getprotobynumber',
|
||||
'getrusage' => 'Safe\getrusage',
|
||||
'getservbyport' => 'Safe\getservbyport',
|
||||
'get_headers' => 'Safe\get_headers',
|
||||
'get_include_path' => 'Safe\get_include_path',
|
||||
'get_meta_tags' => 'Safe\get_meta_tags',
|
||||
'glob' => 'Safe\glob',
|
||||
'gmdate' => 'Safe\gmdate',
|
||||
'gmp_binomial' => 'Safe\gmp_binomial',
|
||||
'gmp_export' => 'Safe\gmp_export',
|
||||
'gmp_import' => 'Safe\gmp_import',
|
||||
'gmmktime' => 'Safe\gmmktime',
|
||||
'gmp_random_seed' => 'Safe\gmp_random_seed',
|
||||
'gmstrftime' => 'Safe\gmstrftime',
|
||||
'gnupg_adddecryptkey' => 'Safe\gnupg_adddecryptkey',
|
||||
'gnupg_addencryptkey' => 'Safe\gnupg_addencryptkey',
|
||||
'gnupg_addsignkey' => 'Safe\gnupg_addsignkey',
|
||||
'gnupg_cleardecryptkeys' => 'Safe\gnupg_cleardecryptkeys',
|
||||
'gnupg_clearencryptkeys' => 'Safe\gnupg_clearencryptkeys',
|
||||
'gnupg_clearsignkeys' => 'Safe\gnupg_clearsignkeys',
|
||||
'gnupg_deletekey' => 'Safe\gnupg_deletekey',
|
||||
'gnupg_setarmor' => 'Safe\gnupg_setarmor',
|
||||
'gnupg_setsignmode' => 'Safe\gnupg_setsignmode',
|
||||
'gzclose' => 'Safe\gzclose',
|
||||
@@ -220,18 +273,23 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'gzdecode' => 'Safe\gzdecode',
|
||||
'gzdeflate' => 'Safe\gzdeflate',
|
||||
'gzencode' => 'Safe\gzencode',
|
||||
'gzfile' => 'Safe\gzfile',
|
||||
'gzgets' => 'Safe\gzgets',
|
||||
'gzgetss' => 'Safe\gzgetss',
|
||||
'gzinflate' => 'Safe\gzinflate',
|
||||
'gzopen' => 'Safe\gzopen',
|
||||
'gzpassthru' => 'Safe\gzpassthru',
|
||||
'gzread' => 'Safe\gzread',
|
||||
'gzrewind' => 'Safe\gzrewind',
|
||||
'gzuncompress' => 'Safe\gzuncompress',
|
||||
'gzwrite' => 'Safe\gzwrite',
|
||||
'hash_hkdf' => 'Safe\hash_hkdf',
|
||||
'hash_update_file' => 'Safe\hash_update_file',
|
||||
'header_register_callback' => 'Safe\header_register_callback',
|
||||
'hex2bin' => 'Safe\hex2bin',
|
||||
'highlight_file' => 'Safe\highlight_file',
|
||||
'highlight_string' => 'Safe\highlight_string',
|
||||
'hrtime' => 'Safe\hrtime',
|
||||
'ibase_add_user' => 'Safe\ibase_add_user',
|
||||
'ibase_backup' => 'Safe\ibase_backup',
|
||||
'ibase_blob_cancel' => 'Safe\ibase_blob_cancel',
|
||||
@@ -258,6 +316,7 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'iconv' => 'Safe\iconv',
|
||||
'iconv_get_encoding' => 'Safe\iconv_get_encoding',
|
||||
'iconv_set_encoding' => 'Safe\iconv_set_encoding',
|
||||
'idate' => 'Safe\idate',
|
||||
'image2wbmp' => 'Safe\image2wbmp',
|
||||
'imageaffine' => 'Safe\imageaffine',
|
||||
'imageaffinematrixconcat' => 'Safe\imageaffinematrixconcat',
|
||||
@@ -265,12 +324,14 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'imagealphablending' => 'Safe\imagealphablending',
|
||||
'imageantialias' => 'Safe\imageantialias',
|
||||
'imagearc' => 'Safe\imagearc',
|
||||
'imageavif' => 'Safe\imageavif',
|
||||
'imagebmp' => 'Safe\imagebmp',
|
||||
'imagechar' => 'Safe\imagechar',
|
||||
'imagecharup' => 'Safe\imagecharup',
|
||||
'imagecolorat' => 'Safe\imagecolorat',
|
||||
'imagecolordeallocate' => 'Safe\imagecolordeallocate',
|
||||
'imagecolormatch' => 'Safe\imagecolormatch',
|
||||
'imagecolorset' => 'Safe\imagecolorset',
|
||||
'imageconvolution' => 'Safe\imageconvolution',
|
||||
'imagecopy' => 'Safe\imagecopy',
|
||||
'imagecopymerge' => 'Safe\imagecopymerge',
|
||||
@@ -278,6 +339,7 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'imagecopyresampled' => 'Safe\imagecopyresampled',
|
||||
'imagecopyresized' => 'Safe\imagecopyresized',
|
||||
'imagecreate' => 'Safe\imagecreate',
|
||||
'imagecreatefromavif' => 'Safe\imagecreatefromavif',
|
||||
'imagecreatefrombmp' => 'Safe\imagecreatefrombmp',
|
||||
'imagecreatefromgd' => 'Safe\imagecreatefromgd',
|
||||
'imagecreatefromgd2' => 'Safe\imagecreatefromgd2',
|
||||
@@ -285,6 +347,8 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'imagecreatefromgif' => 'Safe\imagecreatefromgif',
|
||||
'imagecreatefromjpeg' => 'Safe\imagecreatefromjpeg',
|
||||
'imagecreatefrompng' => 'Safe\imagecreatefrompng',
|
||||
'imagecreatefromstring' => 'Safe\imagecreatefromstring',
|
||||
'imagecreatefromtga' => 'Safe\imagecreatefromtga',
|
||||
'imagecreatefromwbmp' => 'Safe\imagecreatefromwbmp',
|
||||
'imagecreatefromwebp' => 'Safe\imagecreatefromwebp',
|
||||
'imagecreatefromxbm' => 'Safe\imagecreatefromxbm',
|
||||
@@ -298,11 +362,12 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'imagefill' => 'Safe\imagefill',
|
||||
'imagefilledarc' => 'Safe\imagefilledarc',
|
||||
'imagefilledellipse' => 'Safe\imagefilledellipse',
|
||||
'imagefilledpolygon' => 'Safe\imagefilledpolygon',
|
||||
'imagefilledrectangle' => 'Safe\imagefilledrectangle',
|
||||
'imagefilltoborder' => 'Safe\imagefilltoborder',
|
||||
'imagefilter' => 'Safe\imagefilter',
|
||||
'imageflip' => 'Safe\imageflip',
|
||||
'imageftbbox' => 'Safe\imageftbbox',
|
||||
'imagefttext' => 'Safe\imagefttext',
|
||||
'imagegammacorrect' => 'Safe\imagegammacorrect',
|
||||
'imagegd' => 'Safe\imagegd',
|
||||
'imagegd2' => 'Safe\imagegd2',
|
||||
@@ -313,10 +378,9 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'imagelayereffect' => 'Safe\imagelayereffect',
|
||||
'imageline' => 'Safe\imageline',
|
||||
'imageloadfont' => 'Safe\imageloadfont',
|
||||
'imageopenpolygon' => 'Safe\imageopenpolygon',
|
||||
'imagepng' => 'Safe\imagepng',
|
||||
'imagepolygon' => 'Safe\imagepolygon',
|
||||
'imagerectangle' => 'Safe\imagerectangle',
|
||||
'imageresolution' => 'Safe\imageresolution',
|
||||
'imagerotate' => 'Safe\imagerotate',
|
||||
'imagesavealpha' => 'Safe\imagesavealpha',
|
||||
'imagescale' => 'Safe\imagescale',
|
||||
@@ -337,29 +401,49 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'imagewbmp' => 'Safe\imagewbmp',
|
||||
'imagewebp' => 'Safe\imagewebp',
|
||||
'imagexbm' => 'Safe\imagexbm',
|
||||
'image_type_to_extension' => 'Safe\image_type_to_extension',
|
||||
'imap_8bit' => 'Safe\imap_8bit',
|
||||
'imap_append' => 'Safe\imap_append',
|
||||
'imap_base64' => 'Safe\imap_base64',
|
||||
'imap_binary' => 'Safe\imap_binary',
|
||||
'imap_body' => 'Safe\imap_body',
|
||||
'imap_bodystruct' => 'Safe\imap_bodystruct',
|
||||
'imap_check' => 'Safe\imap_check',
|
||||
'imap_clearflag_full' => 'Safe\imap_clearflag_full',
|
||||
'imap_close' => 'Safe\imap_close',
|
||||
'imap_createmailbox' => 'Safe\imap_createmailbox',
|
||||
'imap_deletemailbox' => 'Safe\imap_deletemailbox',
|
||||
'imap_fetchbody' => 'Safe\imap_fetchbody',
|
||||
'imap_fetchheader' => 'Safe\imap_fetchheader',
|
||||
'imap_fetchmime' => 'Safe\imap_fetchmime',
|
||||
'imap_fetchstructure' => 'Safe\imap_fetchstructure',
|
||||
'imap_fetch_overview' => 'Safe\imap_fetch_overview',
|
||||
'imap_gc' => 'Safe\imap_gc',
|
||||
'imap_getacl' => 'Safe\imap_getacl',
|
||||
'imap_getmailboxes' => 'Safe\imap_getmailboxes',
|
||||
'imap_getsubscribed' => 'Safe\imap_getsubscribed',
|
||||
'imap_headerinfo' => 'Safe\imap_headerinfo',
|
||||
'imap_headers' => 'Safe\imap_headers',
|
||||
'imap_listscan' => 'Safe\imap_listscan',
|
||||
'imap_lsub' => 'Safe\imap_lsub',
|
||||
'imap_mail' => 'Safe\imap_mail',
|
||||
'imap_mailboxmsginfo' => 'Safe\imap_mailboxmsginfo',
|
||||
'imap_mail_compose' => 'Safe\imap_mail_compose',
|
||||
'imap_mail_copy' => 'Safe\imap_mail_copy',
|
||||
'imap_mail_move' => 'Safe\imap_mail_move',
|
||||
'imap_mime_header_decode' => 'Safe\imap_mime_header_decode',
|
||||
'imap_mutf7_to_utf8' => 'Safe\imap_mutf7_to_utf8',
|
||||
'imap_num_msg' => 'Safe\imap_num_msg',
|
||||
'imap_open' => 'Safe\imap_open',
|
||||
'imap_qprint' => 'Safe\imap_qprint',
|
||||
'imap_renamemailbox' => 'Safe\imap_renamemailbox',
|
||||
'imap_rfc822_write_address' => 'Safe\imap_rfc822_write_address',
|
||||
'imap_savebody' => 'Safe\imap_savebody',
|
||||
'imap_setacl' => 'Safe\imap_setacl',
|
||||
'imap_setflag_full' => 'Safe\imap_setflag_full',
|
||||
'imap_set_quota' => 'Safe\imap_set_quota',
|
||||
'imap_sort' => 'Safe\imap_sort',
|
||||
'imap_status' => 'Safe\imap_status',
|
||||
'imap_subscribe' => 'Safe\imap_subscribe',
|
||||
'imap_thread' => 'Safe\imap_thread',
|
||||
'imap_timeout' => 'Safe\imap_timeout',
|
||||
@@ -371,42 +455,25 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'inflate_get_read_len' => 'Safe\inflate_get_read_len',
|
||||
'inflate_get_status' => 'Safe\inflate_get_status',
|
||||
'inflate_init' => 'Safe\inflate_init',
|
||||
'ingres_autocommit' => 'Safe\ingres_autocommit',
|
||||
'ingres_close' => 'Safe\ingres_close',
|
||||
'ingres_commit' => 'Safe\ingres_commit',
|
||||
'ingres_connect' => 'Safe\ingres_connect',
|
||||
'ingres_execute' => 'Safe\ingres_execute',
|
||||
'ingres_field_name' => 'Safe\ingres_field_name',
|
||||
'ingres_field_type' => 'Safe\ingres_field_type',
|
||||
'ingres_free_result' => 'Safe\ingres_free_result',
|
||||
'ingres_pconnect' => 'Safe\ingres_pconnect',
|
||||
'ingres_result_seek' => 'Safe\ingres_result_seek',
|
||||
'ingres_rollback' => 'Safe\ingres_rollback',
|
||||
'ingres_set_environment' => 'Safe\ingres_set_environment',
|
||||
'ini_get' => 'Safe\ini_get',
|
||||
'ini_set' => 'Safe\ini_set',
|
||||
'inotify_init' => 'Safe\inotify_init',
|
||||
'inotify_rm_watch' => 'Safe\inotify_rm_watch',
|
||||
'iptcembed' => 'Safe\iptcembed',
|
||||
'iptcparse' => 'Safe\iptcparse',
|
||||
'jdtounix' => 'Safe\jdtounix',
|
||||
'jpeg2wbmp' => 'Safe\jpeg2wbmp',
|
||||
'json_decode' => 'Safe\json_decode',
|
||||
'json_encode' => 'Safe\json_encode',
|
||||
'json_last_error_msg' => 'Safe\json_last_error_msg',
|
||||
'krsort' => 'Safe\krsort',
|
||||
'ksort' => 'Safe\ksort',
|
||||
'lchgrp' => 'Safe\lchgrp',
|
||||
'lchown' => 'Safe\lchown',
|
||||
'ldap_8859_to_t61' => 'Safe\ldap_8859_to_t61',
|
||||
'ldap_add' => 'Safe\ldap_add',
|
||||
'ldap_add_ext' => 'Safe\ldap_add_ext',
|
||||
'ldap_bind' => 'Safe\ldap_bind',
|
||||
'ldap_bind_ext' => 'Safe\ldap_bind_ext',
|
||||
'ldap_control_paged_result' => 'Safe\ldap_control_paged_result',
|
||||
'ldap_control_paged_result_response' => 'Safe\ldap_control_paged_result_response',
|
||||
'ldap_count_entries' => 'Safe\ldap_count_entries',
|
||||
'ldap_delete' => 'Safe\ldap_delete',
|
||||
'ldap_delete_ext' => 'Safe\ldap_delete_ext',
|
||||
'ldap_dn2ufn' => 'Safe\ldap_dn2ufn',
|
||||
'ldap_exop' => 'Safe\ldap_exop',
|
||||
'ldap_exop_passwd' => 'Safe\ldap_exop_passwd',
|
||||
'ldap_exop_whoami' => 'Safe\ldap_exop_whoami',
|
||||
@@ -420,27 +487,22 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'ldap_get_option' => 'Safe\ldap_get_option',
|
||||
'ldap_get_values' => 'Safe\ldap_get_values',
|
||||
'ldap_get_values_len' => 'Safe\ldap_get_values_len',
|
||||
'ldap_list' => 'Safe\ldap_list',
|
||||
'ldap_modify_batch' => 'Safe\ldap_modify_batch',
|
||||
'ldap_mod_add' => 'Safe\ldap_mod_add',
|
||||
'ldap_mod_add_ext' => 'Safe\ldap_mod_add_ext',
|
||||
'ldap_mod_del' => 'Safe\ldap_mod_del',
|
||||
'ldap_mod_del_ext' => 'Safe\ldap_mod_del_ext',
|
||||
'ldap_mod_replace' => 'Safe\ldap_mod_replace',
|
||||
'ldap_mod_replace_ext' => 'Safe\ldap_mod_replace_ext',
|
||||
'ldap_next_attribute' => 'Safe\ldap_next_attribute',
|
||||
'ldap_parse_exop' => 'Safe\ldap_parse_exop',
|
||||
'ldap_parse_result' => 'Safe\ldap_parse_result',
|
||||
'ldap_read' => 'Safe\ldap_read',
|
||||
'ldap_rename' => 'Safe\ldap_rename',
|
||||
'ldap_rename_ext' => 'Safe\ldap_rename_ext',
|
||||
'ldap_sasl_bind' => 'Safe\ldap_sasl_bind',
|
||||
'ldap_search' => 'Safe\ldap_search',
|
||||
'ldap_set_option' => 'Safe\ldap_set_option',
|
||||
'ldap_unbind' => 'Safe\ldap_unbind',
|
||||
'libxml_get_last_error' => 'Safe\libxml_get_last_error',
|
||||
'libxml_set_external_entity_loader' => 'Safe\libxml_set_external_entity_loader',
|
||||
'link' => 'Safe\link',
|
||||
'long2ip' => 'Safe\long2ip',
|
||||
'lstat' => 'Safe\lstat',
|
||||
'lzf_compress' => 'Safe\lzf_compress',
|
||||
'lzf_decompress' => 'Safe\lzf_decompress',
|
||||
'mailparse_msg_extract_part_file' => 'Safe\mailparse_msg_extract_part_file',
|
||||
@@ -449,6 +511,7 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'mailparse_msg_parse_file' => 'Safe\mailparse_msg_parse_file',
|
||||
'mailparse_stream_encode' => 'Safe\mailparse_stream_encode',
|
||||
'mb_chr' => 'Safe\mb_chr',
|
||||
'mb_convert_encoding' => 'Safe\mb_convert_encoding',
|
||||
'mb_detect_order' => 'Safe\mb_detect_order',
|
||||
'mb_encoding_aliases' => 'Safe\mb_encoding_aliases',
|
||||
'mb_eregi_replace' => 'Safe\mb_eregi_replace',
|
||||
@@ -458,6 +521,7 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'mb_ereg_search_init' => 'Safe\mb_ereg_search_init',
|
||||
'mb_ereg_search_regs' => 'Safe\mb_ereg_search_regs',
|
||||
'mb_ereg_search_setpos' => 'Safe\mb_ereg_search_setpos',
|
||||
'mb_get_info' => 'Safe\mb_get_info',
|
||||
'mb_http_output' => 'Safe\mb_http_output',
|
||||
'mb_internal_encoding' => 'Safe\mb_internal_encoding',
|
||||
'mb_ord' => 'Safe\mb_ord',
|
||||
@@ -465,42 +529,17 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'mb_regex_encoding' => 'Safe\mb_regex_encoding',
|
||||
'mb_send_mail' => 'Safe\mb_send_mail',
|
||||
'mb_split' => 'Safe\mb_split',
|
||||
'mb_str_split' => 'Safe\mb_str_split',
|
||||
'md5_file' => 'Safe\md5_file',
|
||||
'metaphone' => 'Safe\metaphone',
|
||||
'mime_content_type' => 'Safe\mime_content_type',
|
||||
'mkdir' => 'Safe\mkdir',
|
||||
'mktime' => 'Safe\mktime',
|
||||
'msg_get_queue' => 'Safe\msg_get_queue',
|
||||
'msg_queue_exists' => 'Safe\msg_queue_exists',
|
||||
'msg_receive' => 'Safe\msg_receive',
|
||||
'msg_remove_queue' => 'Safe\msg_remove_queue',
|
||||
'msg_send' => 'Safe\msg_send',
|
||||
'msg_set_queue' => 'Safe\msg_set_queue',
|
||||
'msql_affected_rows' => 'Safe\msql_affected_rows',
|
||||
'msql_close' => 'Safe\msql_close',
|
||||
'msql_connect' => 'Safe\msql_connect',
|
||||
'msql_create_db' => 'Safe\msql_create_db',
|
||||
'msql_data_seek' => 'Safe\msql_data_seek',
|
||||
'msql_db_query' => 'Safe\msql_db_query',
|
||||
'msql_drop_db' => 'Safe\msql_drop_db',
|
||||
'msql_field_len' => 'Safe\msql_field_len',
|
||||
'msql_field_name' => 'Safe\msql_field_name',
|
||||
'msql_field_seek' => 'Safe\msql_field_seek',
|
||||
'msql_field_table' => 'Safe\msql_field_table',
|
||||
'msql_field_type' => 'Safe\msql_field_type',
|
||||
'msql_free_result' => 'Safe\msql_free_result',
|
||||
'msql_pconnect' => 'Safe\msql_pconnect',
|
||||
'msql_query' => 'Safe\msql_query',
|
||||
'msql_select_db' => 'Safe\msql_select_db',
|
||||
'mysqli_get_cache_stats' => 'Safe\mysqli_get_cache_stats',
|
||||
'mysqli_get_client_stats' => 'Safe\mysqli_get_client_stats',
|
||||
'mysqlnd_ms_dump_servers' => 'Safe\mysqlnd_ms_dump_servers',
|
||||
'mysqlnd_ms_fabric_select_global' => 'Safe\mysqlnd_ms_fabric_select_global',
|
||||
'mysqlnd_ms_fabric_select_shard' => 'Safe\mysqlnd_ms_fabric_select_shard',
|
||||
'mysqlnd_ms_get_last_used_connection' => 'Safe\mysqlnd_ms_get_last_used_connection',
|
||||
'mysqlnd_qc_clear_cache' => 'Safe\mysqlnd_qc_clear_cache',
|
||||
'mysqlnd_qc_set_is_select' => 'Safe\mysqlnd_qc_set_is_select',
|
||||
'mysqlnd_qc_set_storage_handler' => 'Safe\mysqlnd_qc_set_storage_handler',
|
||||
'msg_stat_queue' => 'Safe\msg_stat_queue',
|
||||
'mysql_close' => 'Safe\mysql_close',
|
||||
'mysql_connect' => 'Safe\mysql_connect',
|
||||
'mysql_create_db' => 'Safe\mysql_create_db',
|
||||
@@ -532,19 +571,19 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'mysql_tablename' => 'Safe\mysql_tablename',
|
||||
'mysql_thread_id' => 'Safe\mysql_thread_id',
|
||||
'mysql_unbuffered_query' => 'Safe\mysql_unbuffered_query',
|
||||
'natcasesort' => 'Safe\natcasesort',
|
||||
'natsort' => 'Safe\natsort',
|
||||
'net_get_interfaces' => 'Safe\net_get_interfaces',
|
||||
'ob_clean' => 'Safe\ob_clean',
|
||||
'ob_end_clean' => 'Safe\ob_end_clean',
|
||||
'ob_end_flush' => 'Safe\ob_end_flush',
|
||||
'ob_flush' => 'Safe\ob_flush',
|
||||
'ob_start' => 'Safe\ob_start',
|
||||
'oci_bind_array_by_name' => 'Safe\oci_bind_array_by_name',
|
||||
'oci_bind_by_name' => 'Safe\oci_bind_by_name',
|
||||
'oci_cancel' => 'Safe\oci_cancel',
|
||||
'oci_close' => 'Safe\oci_close',
|
||||
'oci_commit' => 'Safe\oci_commit',
|
||||
'oci_connect' => 'Safe\oci_connect',
|
||||
'oci_define_by_name' => 'Safe\oci_define_by_name',
|
||||
'oci_execute' => 'Safe\oci_execute',
|
||||
'oci_fetch_all' => 'Safe\oci_fetch_all',
|
||||
'oci_field_name' => 'Safe\oci_field_name',
|
||||
'oci_field_precision' => 'Safe\oci_field_precision',
|
||||
'oci_field_scale' => 'Safe\oci_field_scale',
|
||||
@@ -557,10 +596,10 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'oci_new_connect' => 'Safe\oci_new_connect',
|
||||
'oci_new_cursor' => 'Safe\oci_new_cursor',
|
||||
'oci_new_descriptor' => 'Safe\oci_new_descriptor',
|
||||
'oci_num_fields' => 'Safe\oci_num_fields',
|
||||
'oci_num_rows' => 'Safe\oci_num_rows',
|
||||
'oci_parse' => 'Safe\oci_parse',
|
||||
'oci_pconnect' => 'Safe\oci_pconnect',
|
||||
'oci_register_taf_callback' => 'Safe\oci_register_taf_callback',
|
||||
'oci_result' => 'Safe\oci_result',
|
||||
'oci_rollback' => 'Safe\oci_rollback',
|
||||
'oci_server_version' => 'Safe\oci_server_version',
|
||||
@@ -572,6 +611,7 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'oci_set_edition' => 'Safe\oci_set_edition',
|
||||
'oci_set_module_name' => 'Safe\oci_set_module_name',
|
||||
'oci_set_prefetch' => 'Safe\oci_set_prefetch',
|
||||
'oci_set_prefetch_lob' => 'Safe\oci_set_prefetch_lob',
|
||||
'oci_statement_type' => 'Safe\oci_statement_type',
|
||||
'oci_unregister_taf_callback' => 'Safe\oci_unregister_taf_callback',
|
||||
'odbc_autocommit' => 'Safe\odbc_autocommit',
|
||||
@@ -579,6 +619,8 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'odbc_columnprivileges' => 'Safe\odbc_columnprivileges',
|
||||
'odbc_columns' => 'Safe\odbc_columns',
|
||||
'odbc_commit' => 'Safe\odbc_commit',
|
||||
'odbc_connect' => 'Safe\odbc_connect',
|
||||
'odbc_cursor' => 'Safe\odbc_cursor',
|
||||
'odbc_data_source' => 'Safe\odbc_data_source',
|
||||
'odbc_exec' => 'Safe\odbc_exec',
|
||||
'odbc_execute' => 'Safe\odbc_execute',
|
||||
@@ -591,8 +633,11 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'odbc_foreignkeys' => 'Safe\odbc_foreignkeys',
|
||||
'odbc_gettypeinfo' => 'Safe\odbc_gettypeinfo',
|
||||
'odbc_longreadlen' => 'Safe\odbc_longreadlen',
|
||||
'odbc_pconnect' => 'Safe\odbc_pconnect',
|
||||
'odbc_prepare' => 'Safe\odbc_prepare',
|
||||
'odbc_primarykeys' => 'Safe\odbc_primarykeys',
|
||||
'odbc_procedurecolumns' => 'Safe\odbc_procedurecolumns',
|
||||
'odbc_procedures' => 'Safe\odbc_procedures',
|
||||
'odbc_result' => 'Safe\odbc_result',
|
||||
'odbc_result_all' => 'Safe\odbc_result_all',
|
||||
'odbc_rollback' => 'Safe\odbc_rollback',
|
||||
@@ -606,8 +651,14 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'opendir' => 'Safe\opendir',
|
||||
'openlog' => 'Safe\openlog',
|
||||
'openssl_cipher_iv_length' => 'Safe\openssl_cipher_iv_length',
|
||||
'openssl_cms_decrypt' => 'Safe\openssl_cms_decrypt',
|
||||
'openssl_cms_encrypt' => 'Safe\openssl_cms_encrypt',
|
||||
'openssl_cms_read' => 'Safe\openssl_cms_read',
|
||||
'openssl_cms_sign' => 'Safe\openssl_cms_sign',
|
||||
'openssl_cms_verify' => 'Safe\openssl_cms_verify',
|
||||
'openssl_csr_export' => 'Safe\openssl_csr_export',
|
||||
'openssl_csr_export_to_file' => 'Safe\openssl_csr_export_to_file',
|
||||
'openssl_csr_get_public_key' => 'Safe\openssl_csr_get_public_key',
|
||||
'openssl_csr_get_subject' => 'Safe\openssl_csr_get_subject',
|
||||
'openssl_csr_new' => 'Safe\openssl_csr_new',
|
||||
'openssl_csr_sign' => 'Safe\openssl_csr_sign',
|
||||
@@ -615,6 +666,7 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'openssl_dh_compute_key' => 'Safe\openssl_dh_compute_key',
|
||||
'openssl_digest' => 'Safe\openssl_digest',
|
||||
'openssl_encrypt' => 'Safe\openssl_encrypt',
|
||||
'openssl_get_curve_names' => 'Safe\openssl_get_curve_names',
|
||||
'openssl_open' => 'Safe\openssl_open',
|
||||
'openssl_pbkdf2' => 'Safe\openssl_pbkdf2',
|
||||
'openssl_pkcs7_decrypt' => 'Safe\openssl_pkcs7_decrypt',
|
||||
@@ -624,6 +676,7 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'openssl_pkcs12_export' => 'Safe\openssl_pkcs12_export',
|
||||
'openssl_pkcs12_export_to_file' => 'Safe\openssl_pkcs12_export_to_file',
|
||||
'openssl_pkcs12_read' => 'Safe\openssl_pkcs12_read',
|
||||
'openssl_pkey_derive' => 'Safe\openssl_pkey_derive',
|
||||
'openssl_pkey_export' => 'Safe\openssl_pkey_export',
|
||||
'openssl_pkey_export_to_file' => 'Safe\openssl_pkey_export_to_file',
|
||||
'openssl_pkey_get_private' => 'Safe\openssl_pkey_get_private',
|
||||
@@ -636,6 +689,11 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'openssl_random_pseudo_bytes' => 'Safe\openssl_random_pseudo_bytes',
|
||||
'openssl_seal' => 'Safe\openssl_seal',
|
||||
'openssl_sign' => 'Safe\openssl_sign',
|
||||
'openssl_spki_export' => 'Safe\openssl_spki_export',
|
||||
'openssl_spki_export_challenge' => 'Safe\openssl_spki_export_challenge',
|
||||
'openssl_spki_new' => 'Safe\openssl_spki_new',
|
||||
'openssl_spki_verify' => 'Safe\openssl_spki_verify',
|
||||
'openssl_verify' => 'Safe\openssl_verify',
|
||||
'openssl_x509_export' => 'Safe\openssl_x509_export',
|
||||
'openssl_x509_export_to_file' => 'Safe\openssl_x509_export_to_file',
|
||||
'openssl_x509_fingerprint' => 'Safe\openssl_x509_fingerprint',
|
||||
@@ -646,123 +704,43 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'parse_ini_file' => 'Safe\parse_ini_file',
|
||||
'parse_ini_string' => 'Safe\parse_ini_string',
|
||||
'parse_url' => 'Safe\parse_url',
|
||||
'password_hash' => 'Safe\password_hash',
|
||||
'pcntl_exec' => 'Safe\pcntl_exec',
|
||||
'passthru' => 'Safe\passthru',
|
||||
'pcntl_getpriority' => 'Safe\pcntl_getpriority',
|
||||
'pcntl_setpriority' => 'Safe\pcntl_setpriority',
|
||||
'pcntl_signal' => 'Safe\pcntl_signal',
|
||||
'pcntl_signal_dispatch' => 'Safe\pcntl_signal_dispatch',
|
||||
'pcntl_sigprocmask' => 'Safe\pcntl_sigprocmask',
|
||||
'pcntl_strerror' => 'Safe\pcntl_strerror',
|
||||
'PDF_activate_item' => 'Safe\PDF_activate_item',
|
||||
'PDF_add_locallink' => 'Safe\PDF_add_locallink',
|
||||
'PDF_add_nameddest' => 'Safe\PDF_add_nameddest',
|
||||
'PDF_add_note' => 'Safe\PDF_add_note',
|
||||
'PDF_add_pdflink' => 'Safe\PDF_add_pdflink',
|
||||
'PDF_add_thumbnail' => 'Safe\PDF_add_thumbnail',
|
||||
'PDF_add_weblink' => 'Safe\PDF_add_weblink',
|
||||
'PDF_attach_file' => 'Safe\PDF_attach_file',
|
||||
'PDF_begin_layer' => 'Safe\PDF_begin_layer',
|
||||
'PDF_begin_page' => 'Safe\PDF_begin_page',
|
||||
'PDF_begin_page_ext' => 'Safe\PDF_begin_page_ext',
|
||||
'PDF_circle' => 'Safe\PDF_circle',
|
||||
'PDF_clip' => 'Safe\PDF_clip',
|
||||
'PDF_close' => 'Safe\PDF_close',
|
||||
'PDF_closepath' => 'Safe\PDF_closepath',
|
||||
'PDF_closepath_fill_stroke' => 'Safe\PDF_closepath_fill_stroke',
|
||||
'PDF_closepath_stroke' => 'Safe\PDF_closepath_stroke',
|
||||
'PDF_close_pdi' => 'Safe\PDF_close_pdi',
|
||||
'PDF_close_pdi_page' => 'Safe\PDF_close_pdi_page',
|
||||
'PDF_concat' => 'Safe\PDF_concat',
|
||||
'PDF_continue_text' => 'Safe\PDF_continue_text',
|
||||
'PDF_curveto' => 'Safe\PDF_curveto',
|
||||
'PDF_delete' => 'Safe\PDF_delete',
|
||||
'PDF_end_layer' => 'Safe\PDF_end_layer',
|
||||
'PDF_end_page' => 'Safe\PDF_end_page',
|
||||
'PDF_end_page_ext' => 'Safe\PDF_end_page_ext',
|
||||
'PDF_end_pattern' => 'Safe\PDF_end_pattern',
|
||||
'PDF_end_template' => 'Safe\PDF_end_template',
|
||||
'PDF_fill' => 'Safe\PDF_fill',
|
||||
'PDF_fill_stroke' => 'Safe\PDF_fill_stroke',
|
||||
'PDF_fit_image' => 'Safe\PDF_fit_image',
|
||||
'PDF_fit_pdi_page' => 'Safe\PDF_fit_pdi_page',
|
||||
'PDF_fit_textline' => 'Safe\PDF_fit_textline',
|
||||
'PDF_initgraphics' => 'Safe\PDF_initgraphics',
|
||||
'PDF_lineto' => 'Safe\PDF_lineto',
|
||||
'PDF_makespotcolor' => 'Safe\PDF_makespotcolor',
|
||||
'PDF_moveto' => 'Safe\PDF_moveto',
|
||||
'PDF_open_file' => 'Safe\PDF_open_file',
|
||||
'PDF_place_image' => 'Safe\PDF_place_image',
|
||||
'PDF_place_pdi_page' => 'Safe\PDF_place_pdi_page',
|
||||
'PDF_rect' => 'Safe\PDF_rect',
|
||||
'PDF_restore' => 'Safe\PDF_restore',
|
||||
'PDF_rotate' => 'Safe\PDF_rotate',
|
||||
'PDF_save' => 'Safe\PDF_save',
|
||||
'PDF_scale' => 'Safe\PDF_scale',
|
||||
'PDF_setcolor' => 'Safe\PDF_setcolor',
|
||||
'PDF_setdash' => 'Safe\PDF_setdash',
|
||||
'PDF_setdashpattern' => 'Safe\PDF_setdashpattern',
|
||||
'PDF_setflat' => 'Safe\PDF_setflat',
|
||||
'PDF_setfont' => 'Safe\PDF_setfont',
|
||||
'PDF_setgray' => 'Safe\PDF_setgray',
|
||||
'PDF_setgray_fill' => 'Safe\PDF_setgray_fill',
|
||||
'PDF_setgray_stroke' => 'Safe\PDF_setgray_stroke',
|
||||
'PDF_setlinejoin' => 'Safe\PDF_setlinejoin',
|
||||
'PDF_setlinewidth' => 'Safe\PDF_setlinewidth',
|
||||
'PDF_setmatrix' => 'Safe\PDF_setmatrix',
|
||||
'PDF_setmiterlimit' => 'Safe\PDF_setmiterlimit',
|
||||
'PDF_setrgbcolor' => 'Safe\PDF_setrgbcolor',
|
||||
'PDF_setrgbcolor_fill' => 'Safe\PDF_setrgbcolor_fill',
|
||||
'PDF_setrgbcolor_stroke' => 'Safe\PDF_setrgbcolor_stroke',
|
||||
'PDF_set_border_color' => 'Safe\PDF_set_border_color',
|
||||
'PDF_set_border_dash' => 'Safe\PDF_set_border_dash',
|
||||
'PDF_set_border_style' => 'Safe\PDF_set_border_style',
|
||||
'PDF_set_info' => 'Safe\PDF_set_info',
|
||||
'PDF_set_layer_dependency' => 'Safe\PDF_set_layer_dependency',
|
||||
'PDF_set_parameter' => 'Safe\PDF_set_parameter',
|
||||
'PDF_set_text_pos' => 'Safe\PDF_set_text_pos',
|
||||
'PDF_set_value' => 'Safe\PDF_set_value',
|
||||
'PDF_show' => 'Safe\PDF_show',
|
||||
'PDF_show_xy' => 'Safe\PDF_show_xy',
|
||||
'PDF_skew' => 'Safe\PDF_skew',
|
||||
'PDF_stroke' => 'Safe\PDF_stroke',
|
||||
'pcntl_sigtimedwait' => 'Safe\pcntl_sigtimedwait',
|
||||
'pcntl_sigwaitinfo' => 'Safe\pcntl_sigwaitinfo',
|
||||
'pfsockopen' => 'Safe\pfsockopen',
|
||||
'pg_cancel_query' => 'Safe\pg_cancel_query',
|
||||
'pg_client_encoding' => 'Safe\pg_client_encoding',
|
||||
'pg_close' => 'Safe\pg_close',
|
||||
'pg_connect' => 'Safe\pg_connect',
|
||||
'pg_connection_reset' => 'Safe\pg_connection_reset',
|
||||
'pg_convert' => 'Safe\pg_convert',
|
||||
'pg_copy_from' => 'Safe\pg_copy_from',
|
||||
'pg_copy_to' => 'Safe\pg_copy_to',
|
||||
'pg_dbname' => 'Safe\pg_dbname',
|
||||
'pg_delete' => 'Safe\pg_delete',
|
||||
'pg_end_copy' => 'Safe\pg_end_copy',
|
||||
'pg_execute' => 'Safe\pg_execute',
|
||||
'pg_field_name' => 'Safe\pg_field_name',
|
||||
'pg_field_table' => 'Safe\pg_field_table',
|
||||
'pg_field_type' => 'Safe\pg_field_type',
|
||||
'pg_flush' => 'Safe\pg_flush',
|
||||
'pg_free_result' => 'Safe\pg_free_result',
|
||||
'pg_host' => 'Safe\pg_host',
|
||||
'pg_insert' => 'Safe\pg_insert',
|
||||
'pg_last_error' => 'Safe\pg_last_error',
|
||||
'pg_last_notice' => 'Safe\pg_last_notice',
|
||||
'pg_last_oid' => 'Safe\pg_last_oid',
|
||||
'pg_lo_close' => 'Safe\pg_lo_close',
|
||||
'pg_lo_export' => 'Safe\pg_lo_export',
|
||||
'pg_lo_import' => 'Safe\pg_lo_import',
|
||||
'pg_lo_open' => 'Safe\pg_lo_open',
|
||||
'pg_lo_read' => 'Safe\pg_lo_read',
|
||||
'pg_lo_read_all' => 'Safe\pg_lo_read_all',
|
||||
'pg_lo_seek' => 'Safe\pg_lo_seek',
|
||||
'pg_lo_truncate' => 'Safe\pg_lo_truncate',
|
||||
'pg_lo_unlink' => 'Safe\pg_lo_unlink',
|
||||
'pg_lo_write' => 'Safe\pg_lo_write',
|
||||
'pg_meta_data' => 'Safe\pg_meta_data',
|
||||
'pg_options' => 'Safe\pg_options',
|
||||
'pg_parameter_status' => 'Safe\pg_parameter_status',
|
||||
'pg_pconnect' => 'Safe\pg_pconnect',
|
||||
'pg_ping' => 'Safe\pg_ping',
|
||||
'pg_port' => 'Safe\pg_port',
|
||||
'pg_prepare' => 'Safe\pg_prepare',
|
||||
'pg_put_line' => 'Safe\pg_put_line',
|
||||
'pg_query' => 'Safe\pg_query',
|
||||
@@ -770,21 +748,21 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'pg_result_error_field' => 'Safe\pg_result_error_field',
|
||||
'pg_result_seek' => 'Safe\pg_result_seek',
|
||||
'pg_select' => 'Safe\pg_select',
|
||||
'pg_send_execute' => 'Safe\pg_send_execute',
|
||||
'pg_send_prepare' => 'Safe\pg_send_prepare',
|
||||
'pg_send_query' => 'Safe\pg_send_query',
|
||||
'pg_send_query_params' => 'Safe\pg_send_query_params',
|
||||
'pg_socket' => 'Safe\pg_socket',
|
||||
'pg_trace' => 'Safe\pg_trace',
|
||||
'pg_tty' => 'Safe\pg_tty',
|
||||
'pg_update' => 'Safe\pg_update',
|
||||
'pg_version' => 'Safe\pg_version',
|
||||
'phpcredits' => 'Safe\phpcredits',
|
||||
'phpinfo' => 'Safe\phpinfo',
|
||||
'php_sapi_name' => 'Safe\php_sapi_name',
|
||||
'png2wbmp' => 'Safe\png2wbmp',
|
||||
'posix_access' => 'Safe\posix_access',
|
||||
'posix_getgrgid' => 'Safe\posix_getgrgid',
|
||||
'posix_getgrnam' => 'Safe\posix_getgrnam',
|
||||
'posix_getpgid' => 'Safe\posix_getpgid',
|
||||
'posix_getgroups' => 'Safe\posix_getgroups',
|
||||
'posix_getlogin' => 'Safe\posix_getlogin',
|
||||
'posix_getpwuid' => 'Safe\posix_getpwuid',
|
||||
'posix_getrlimit' => 'Safe\posix_getrlimit',
|
||||
'posix_getsid' => 'Safe\posix_getsid',
|
||||
'posix_initgroups' => 'Safe\posix_initgroups',
|
||||
'posix_kill' => 'Safe\posix_kill',
|
||||
'posix_mkfifo' => 'Safe\posix_mkfifo',
|
||||
@@ -795,11 +773,13 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'posix_setpgid' => 'Safe\posix_setpgid',
|
||||
'posix_setrlimit' => 'Safe\posix_setrlimit',
|
||||
'posix_setuid' => 'Safe\posix_setuid',
|
||||
'posix_times' => 'Safe\posix_times',
|
||||
'posix_uname' => 'Safe\posix_uname',
|
||||
'preg_grep' => 'Safe\preg_grep',
|
||||
'preg_match' => 'Safe\preg_match',
|
||||
'preg_match_all' => 'Safe\preg_match_all',
|
||||
'preg_replace' => 'Safe\preg_replace',
|
||||
'preg_split' => 'Safe\preg_split',
|
||||
'proc_get_status' => 'Safe\proc_get_status',
|
||||
'proc_nice' => 'Safe\proc_nice',
|
||||
'pspell_add_to_personal' => 'Safe\pspell_add_to_personal',
|
||||
'pspell_add_to_session' => 'Safe\pspell_add_to_session',
|
||||
@@ -815,6 +795,7 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'pspell_config_save_repl' => 'Safe\pspell_config_save_repl',
|
||||
'pspell_new' => 'Safe\pspell_new',
|
||||
'pspell_new_config' => 'Safe\pspell_new_config',
|
||||
'pspell_new_personal' => 'Safe\pspell_new_personal',
|
||||
'pspell_save_wordlist' => 'Safe\pspell_save_wordlist',
|
||||
'pspell_store_replacement' => 'Safe\pspell_store_replacement',
|
||||
'ps_add_launchlink' => 'Safe\ps_add_launchlink',
|
||||
@@ -896,14 +877,21 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'register_tick_function' => 'Safe\register_tick_function',
|
||||
'rename' => 'Safe\rename',
|
||||
'rewind' => 'Safe\rewind',
|
||||
'rewinddir' => 'Safe\rewinddir',
|
||||
'rmdir' => 'Safe\rmdir',
|
||||
'rpmaddtag' => 'Safe\rpmaddtag',
|
||||
'rrd_create' => 'Safe\rrd_create',
|
||||
'rsort' => 'Safe\rsort',
|
||||
'rrd_first' => 'Safe\rrd_first',
|
||||
'rrd_graph' => 'Safe\rrd_graph',
|
||||
'rrd_info' => 'Safe\rrd_info',
|
||||
'rrd_lastupdate' => 'Safe\rrd_lastupdate',
|
||||
'rrd_restore' => 'Safe\rrd_restore',
|
||||
'rrd_tune' => 'Safe\rrd_tune',
|
||||
'rrd_update' => 'Safe\rrd_update',
|
||||
'rrd_xport' => 'Safe\rrd_xport',
|
||||
'sapi_windows_cp_conv' => 'Safe\sapi_windows_cp_conv',
|
||||
'sapi_windows_cp_set' => 'Safe\sapi_windows_cp_set',
|
||||
'sapi_windows_generate_ctrl_event' => 'Safe\sapi_windows_generate_ctrl_event',
|
||||
'sapi_windows_set_ctrl_handler' => 'Safe\sapi_windows_set_ctrl_handler',
|
||||
'sapi_windows_vt100_support' => 'Safe\sapi_windows_vt100_support',
|
||||
'scandir' => 'Safe\scandir',
|
||||
'sem_acquire' => 'Safe\sem_acquire',
|
||||
@@ -911,19 +899,27 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'sem_release' => 'Safe\sem_release',
|
||||
'sem_remove' => 'Safe\sem_remove',
|
||||
'session_abort' => 'Safe\session_abort',
|
||||
'session_create_id' => 'Safe\session_create_id',
|
||||
'session_decode' => 'Safe\session_decode',
|
||||
'session_destroy' => 'Safe\session_destroy',
|
||||
'session_encode' => 'Safe\session_encode',
|
||||
'session_id' => 'Safe\session_id',
|
||||
'session_module_name' => 'Safe\session_module_name',
|
||||
'session_name' => 'Safe\session_name',
|
||||
'session_regenerate_id' => 'Safe\session_regenerate_id',
|
||||
'session_reset' => 'Safe\session_reset',
|
||||
'session_save_path' => 'Safe\session_save_path',
|
||||
'session_unset' => 'Safe\session_unset',
|
||||
'session_write_close' => 'Safe\session_write_close',
|
||||
'settype' => 'Safe\settype',
|
||||
'set_include_path' => 'Safe\set_include_path',
|
||||
'set_time_limit' => 'Safe\set_time_limit',
|
||||
'sha1_file' => 'Safe\sha1_file',
|
||||
'shell_exec' => 'Safe\shell_exec',
|
||||
'shmop_delete' => 'Safe\shmop_delete',
|
||||
'shmop_read' => 'Safe\shmop_read',
|
||||
'shmop_write' => 'Safe\shmop_write',
|
||||
'shm_attach' => 'Safe\shm_attach',
|
||||
'shm_detach' => 'Safe\shm_detach',
|
||||
'shm_put_var' => 'Safe\shm_put_var',
|
||||
'shm_remove' => 'Safe\shm_remove',
|
||||
'shm_remove_var' => 'Safe\shm_remove_var',
|
||||
@@ -935,6 +931,7 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'socket_accept' => 'Safe\socket_accept',
|
||||
'socket_addrinfo_bind' => 'Safe\socket_addrinfo_bind',
|
||||
'socket_addrinfo_connect' => 'Safe\socket_addrinfo_connect',
|
||||
'socket_addrinfo_lookup' => 'Safe\socket_addrinfo_lookup',
|
||||
'socket_bind' => 'Safe\socket_bind',
|
||||
'socket_connect' => 'Safe\socket_connect',
|
||||
'socket_create' => 'Safe\socket_create',
|
||||
@@ -958,14 +955,23 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'socket_wsaprotocol_info_export' => 'Safe\socket_wsaprotocol_info_export',
|
||||
'socket_wsaprotocol_info_import' => 'Safe\socket_wsaprotocol_info_import',
|
||||
'socket_wsaprotocol_info_release' => 'Safe\socket_wsaprotocol_info_release',
|
||||
'sodium_crypto_pwhash' => 'Safe\sodium_crypto_pwhash',
|
||||
'sodium_crypto_pwhash_str' => 'Safe\sodium_crypto_pwhash_str',
|
||||
'sodium_crypto_aead_aes256gcm_decrypt' => 'Safe\sodium_crypto_aead_aes256gcm_decrypt',
|
||||
'sodium_crypto_aead_chacha20poly1305_decrypt' => 'Safe\sodium_crypto_aead_chacha20poly1305_decrypt',
|
||||
'sodium_crypto_aead_chacha20poly1305_encrypt' => 'Safe\sodium_crypto_aead_chacha20poly1305_encrypt',
|
||||
'sodium_crypto_aead_chacha20poly1305_ietf_decrypt' => 'Safe\sodium_crypto_aead_chacha20poly1305_ietf_decrypt',
|
||||
'sodium_crypto_aead_chacha20poly1305_ietf_encrypt' => 'Safe\sodium_crypto_aead_chacha20poly1305_ietf_encrypt',
|
||||
'sodium_crypto_aead_xchacha20poly1305_ietf_decrypt' => 'Safe\sodium_crypto_aead_xchacha20poly1305_ietf_decrypt',
|
||||
'sodium_crypto_aead_xchacha20poly1305_ietf_encrypt' => 'Safe\sodium_crypto_aead_xchacha20poly1305_ietf_encrypt',
|
||||
'sodium_crypto_auth_verify' => 'Safe\sodium_crypto_auth_verify',
|
||||
'sodium_crypto_box_open' => 'Safe\sodium_crypto_box_open',
|
||||
'sodium_crypto_box_seal_open' => 'Safe\sodium_crypto_box_seal_open',
|
||||
'sodium_crypto_generichash_update' => 'Safe\sodium_crypto_generichash_update',
|
||||
'sodium_crypto_secretbox_open' => 'Safe\sodium_crypto_secretbox_open',
|
||||
'sodium_crypto_sign_open' => 'Safe\sodium_crypto_sign_open',
|
||||
'sodium_crypto_sign_verify_detached' => 'Safe\sodium_crypto_sign_verify_detached',
|
||||
'solr_get_version' => 'Safe\solr_get_version',
|
||||
'sort' => 'Safe\sort',
|
||||
'soundex' => 'Safe\soundex',
|
||||
'spl_autoload_register' => 'Safe\spl_autoload_register',
|
||||
'spl_autoload_unregister' => 'Safe\spl_autoload_unregister',
|
||||
'sprintf' => 'Safe\sprintf',
|
||||
'sqlsrv_begin_transaction' => 'Safe\sqlsrv_begin_transaction',
|
||||
'sqlsrv_cancel' => 'Safe\sqlsrv_cancel',
|
||||
'sqlsrv_client_info' => 'Safe\sqlsrv_client_info',
|
||||
@@ -991,11 +997,14 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'ssh2_connect' => 'Safe\ssh2_connect',
|
||||
'ssh2_disconnect' => 'Safe\ssh2_disconnect',
|
||||
'ssh2_exec' => 'Safe\ssh2_exec',
|
||||
'ssh2_forward_accept' => 'Safe\ssh2_forward_accept',
|
||||
'ssh2_forward_listen' => 'Safe\ssh2_forward_listen',
|
||||
'ssh2_publickey_add' => 'Safe\ssh2_publickey_add',
|
||||
'ssh2_publickey_init' => 'Safe\ssh2_publickey_init',
|
||||
'ssh2_publickey_remove' => 'Safe\ssh2_publickey_remove',
|
||||
'ssh2_scp_recv' => 'Safe\ssh2_scp_recv',
|
||||
'ssh2_scp_send' => 'Safe\ssh2_scp_send',
|
||||
'ssh2_send_eof' => 'Safe\ssh2_send_eof',
|
||||
'ssh2_sftp' => 'Safe\ssh2_sftp',
|
||||
'ssh2_sftp_chmod' => 'Safe\ssh2_sftp_chmod',
|
||||
'ssh2_sftp_mkdir' => 'Safe\ssh2_sftp_mkdir',
|
||||
@@ -1003,6 +1012,7 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'ssh2_sftp_rmdir' => 'Safe\ssh2_sftp_rmdir',
|
||||
'ssh2_sftp_symlink' => 'Safe\ssh2_sftp_symlink',
|
||||
'ssh2_sftp_unlink' => 'Safe\ssh2_sftp_unlink',
|
||||
'ssh2_shell' => 'Safe\ssh2_shell',
|
||||
'stream_context_set_params' => 'Safe\stream_context_set_params',
|
||||
'stream_copy_to_stream' => 'Safe\stream_copy_to_stream',
|
||||
'stream_filter_append' => 'Safe\stream_filter_append',
|
||||
@@ -1010,22 +1020,28 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'stream_filter_register' => 'Safe\stream_filter_register',
|
||||
'stream_filter_remove' => 'Safe\stream_filter_remove',
|
||||
'stream_get_contents' => 'Safe\stream_get_contents',
|
||||
'stream_get_line' => 'Safe\stream_get_line',
|
||||
'stream_isatty' => 'Safe\stream_isatty',
|
||||
'stream_resolve_include_path' => 'Safe\stream_resolve_include_path',
|
||||
'stream_set_blocking' => 'Safe\stream_set_blocking',
|
||||
'stream_set_timeout' => 'Safe\stream_set_timeout',
|
||||
'stream_socket_accept' => 'Safe\stream_socket_accept',
|
||||
'stream_socket_client' => 'Safe\stream_socket_client',
|
||||
'stream_socket_get_name' => 'Safe\stream_socket_get_name',
|
||||
'stream_socket_pair' => 'Safe\stream_socket_pair',
|
||||
'stream_socket_recvfrom' => 'Safe\stream_socket_recvfrom',
|
||||
'stream_socket_sendto' => 'Safe\stream_socket_sendto',
|
||||
'stream_socket_server' => 'Safe\stream_socket_server',
|
||||
'stream_socket_shutdown' => 'Safe\stream_socket_shutdown',
|
||||
'stream_supports_lock' => 'Safe\stream_supports_lock',
|
||||
'stream_wrapper_register' => 'Safe\stream_wrapper_register',
|
||||
'stream_wrapper_restore' => 'Safe\stream_wrapper_restore',
|
||||
'stream_wrapper_unregister' => 'Safe\stream_wrapper_unregister',
|
||||
'strftime' => 'Safe\strftime',
|
||||
'strptime' => 'Safe\strptime',
|
||||
'strtotime' => 'Safe\strtotime',
|
||||
'substr' => 'Safe\substr',
|
||||
'swoole_async_dns_lookup' => 'Safe\swoole_async_dns_lookup',
|
||||
'swoole_async_readfile' => 'Safe\swoole_async_readfile',
|
||||
'swoole_async_write' => 'Safe\swoole_async_write',
|
||||
'swoole_async_writefile' => 'Safe\swoole_async_writefile',
|
||||
'swoole_event_defer' => 'Safe\swoole_event_defer',
|
||||
@@ -1040,15 +1056,14 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'time_sleep_until' => 'Safe\time_sleep_until',
|
||||
'tmpfile' => 'Safe\tmpfile',
|
||||
'touch' => 'Safe\touch',
|
||||
'uasort' => 'Safe\uasort',
|
||||
'uksort' => 'Safe\uksort',
|
||||
'unixtojd' => 'Safe\unixtojd',
|
||||
'unlink' => 'Safe\unlink',
|
||||
'unpack' => 'Safe\unpack',
|
||||
'uopz_extend' => 'Safe\uopz_extend',
|
||||
'uopz_implement' => 'Safe\uopz_implement',
|
||||
'usort' => 'Safe\usort',
|
||||
'variant_date_to_timestamp' => 'Safe\variant_date_to_timestamp',
|
||||
'variant_round' => 'Safe\variant_round',
|
||||
'virtual' => 'Safe\virtual',
|
||||
'vsprintf' => 'Safe\vsprintf',
|
||||
'xdiff_file_bdiff' => 'Safe\xdiff_file_bdiff',
|
||||
'xdiff_file_bpatch' => 'Safe\xdiff_file_bpatch',
|
||||
'xdiff_file_diff' => 'Safe\xdiff_file_diff',
|
||||
@@ -1059,9 +1074,17 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'xdiff_string_patch' => 'Safe\xdiff_string_patch',
|
||||
'xdiff_string_patch_binary' => 'Safe\xdiff_string_patch_binary',
|
||||
'xmlrpc_set_type' => 'Safe\xmlrpc_set_type',
|
||||
'xml_parser_create' => 'Safe\xml_parser_create',
|
||||
'xml_parser_create_ns' => 'Safe\xml_parser_create_ns',
|
||||
'xml_parser_free' => 'Safe\xml_parser_free',
|
||||
'xml_set_character_data_handler' => 'Safe\xml_set_character_data_handler',
|
||||
'xml_set_default_handler' => 'Safe\xml_set_default_handler',
|
||||
'xml_set_element_handler' => 'Safe\xml_set_element_handler',
|
||||
'xml_set_end_namespace_decl_handler' => 'Safe\xml_set_end_namespace_decl_handler',
|
||||
'xml_set_external_entity_ref_handler' => 'Safe\xml_set_external_entity_ref_handler',
|
||||
'xml_set_notation_decl_handler' => 'Safe\xml_set_notation_decl_handler',
|
||||
'xml_set_object' => 'Safe\xml_set_object',
|
||||
'xml_set_processing_instruction_handler' => 'Safe\xml_set_processing_instruction_handler',
|
||||
'xml_set_start_namespace_decl_handler' => 'Safe\xml_set_start_namespace_decl_handler',
|
||||
'xml_set_unparsed_entity_decl_handler' => 'Safe\xml_set_unparsed_entity_decl_handler',
|
||||
'yaml_parse' => 'Safe\yaml_parse',
|
||||
'yaml_parse_file' => 'Safe\yaml_parse_file',
|
||||
'yaml_parse_url' => 'Safe\yaml_parse_url',
|
||||
@@ -1074,8 +1097,12 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
'yaz_search' => 'Safe\yaz_search',
|
||||
'yaz_wait' => 'Safe\yaz_wait',
|
||||
'zip_entry_close' => 'Safe\zip_entry_close',
|
||||
'zip_entry_compressedsize' => 'Safe\zip_entry_compressedsize',
|
||||
'zip_entry_compressionmethod' => 'Safe\zip_entry_compressionmethod',
|
||||
'zip_entry_filesize' => 'Safe\zip_entry_filesize',
|
||||
'zip_entry_name' => 'Safe\zip_entry_name',
|
||||
'zip_entry_open' => 'Safe\zip_entry_open',
|
||||
'zip_entry_read' => 'Safe\zip_entry_read',
|
||||
'zlib_decode' => 'Safe\zlib_decode',
|
||||
]]]);
|
||||
]]]);
|
||||
};
|
||||
21
vendor/thecodingmachine/safe/tests/DateTimeImmutableTest.php
vendored
Normal file
21
vendor/thecodingmachine/safe/tests/DateTimeImmutableTest.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
final class DateTimeImmutableTest extends TestCase
|
||||
{
|
||||
public function testCreateFromMutable(): void
|
||||
{
|
||||
$unsafeDate = new \DateTime('2021-10-16T12:30:16+00:00');
|
||||
$safeImmutableDate = \Safe\DateTimeImmutable::createFromMutable($unsafeDate);
|
||||
|
||||
self::assertSame($unsafeDate->format(\DateTimeInterface::ATOM), $safeImmutableDate->format(\DateTimeInterface::ATOM));
|
||||
|
||||
$safeDate = new \Safe\DateTime('2021-10-16T12:30:16+00:00');
|
||||
$safeImmutableDate = \Safe\DateTimeImmutable::createFromMutable($safeDate);
|
||||
|
||||
self::assertSame($safeDate->format(\DateTimeInterface::ATOM), $safeImmutableDate->format(\DateTimeInterface::ATOM));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user