Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change signatures for openssl_sign to Adapt to php8+ #420

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"generated/ftp.php",
"generated/funchand.php",
"generated/gettext.php",
"generated/gmp.php",
"generated/gnupg.php",
"generated/hash.php",
"generated/ibase.php",
Expand Down Expand Up @@ -73,6 +72,7 @@
"generated/ps.php",
"generated/pspell.php",
"generated/readline.php",
"generated/rnp.php",
"generated/rpminfo.php",
"generated/rrd.php",
"generated/sem.php",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Safe\Exceptions;

class GmpException extends \ErrorException implements SafeExceptionInterface
class RnpException extends \ErrorException implements SafeExceptionInterface
{
public static function createFromPhpError(): self
{
Expand Down
2 changes: 0 additions & 2 deletions generated/array.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ function array_walk_recursive(&$array, callable $callback, $arg = null): void

/**
* This function shuffles (randomizes the order of the elements in) an array.
* It uses a pseudo random number generator that is not suitable for
* cryptographic purposes.
*
* @param array $array The array.
* @throws ArrayException
Expand Down
3 changes: 2 additions & 1 deletion generated/classobj.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
*
* @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.
* @param bool $autoload Whether to autoload
* if the original class is not found.
* @throws ClassobjException
*
*/
Expand Down
11 changes: 9 additions & 2 deletions generated/curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -1777,8 +1777,9 @@ function curl_multi_setopt(\CurlMultiHandle $multi_handle, int $option, $value):
* CURL_SSLVERSION_SSLv2 (2),
* CURL_SSLVERSION_SSLv3 (3),
* CURL_SSLVERSION_TLSv1_0 (4),
* CURL_SSLVERSION_TLSv1_1 (5) or
* CURL_SSLVERSION_TLSv1_2 (6).
* CURL_SSLVERSION_TLSv1_1 (5),
* CURL_SSLVERSION_TLSv1_2 (6) or
* CURL_SSLVERSION_TLSv1_3 (7).
* The maximum TLS version can be set by using one of the CURL_SSLVERSION_MAX_*
* constants. It is also possible to OR one of the CURL_SSLVERSION_*
* constants with one of the CURL_SSLVERSION_MAX_* constants.
Expand Down Expand Up @@ -3039,6 +3040,7 @@ function curl_multi_setopt(\CurlMultiHandle $multi_handle, int $option, $value):
*
* Option
* Set value to
* Notes
*
*
*
Expand All @@ -3053,13 +3055,15 @@ function curl_multi_setopt(\CurlMultiHandle $multi_handle, int $option, $value):
*
*
*
*
* CURLOPT_PASSWDFUNCTION
*
* A callback accepting three parameters.
* The first is the cURL resource, the second is a
* string containing a password prompt, and the third is the maximum
* password length. Return the string containing the password.
*
* Removed as of PHP 7.3.0.
*
*
* CURLOPT_PROGRESSFUNCTION
Expand All @@ -3086,6 +3090,7 @@ function curl_multi_setopt(\CurlMultiHandle $multi_handle, int $option, $value):
*
*
*
*
* CURLOPT_READFUNCTION
*
* A callback accepting three parameters.
Expand All @@ -3099,6 +3104,7 @@ function curl_multi_setopt(\CurlMultiHandle $multi_handle, int $option, $value):
*
*
*
*
* CURLOPT_WRITEFUNCTION
*
* A callback accepting two parameters.
Expand All @@ -3109,6 +3115,7 @@ function curl_multi_setopt(\CurlMultiHandle $multi_handle, int $option, $value):
*
*
*
*
* CURLOPT_XFERINFOFUNCTION
*
* A callback accepting two parameters.
Expand Down
104 changes: 0 additions & 104 deletions generated/datetime.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,78 +57,6 @@ 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{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.
*
* The returned array has keys for year,
* month, day, hour,
* minute, second,
* fraction, and is_localtime.
*
* If is_localtime is present then
* zone_type indicates the type of timezone. For type
* 1 (UTC offset) the zone,
* is_dst fields are added; for type 2
* (abbreviation) the fields tz_abbr,
* is_dst are added; and for type 3
* (timezone identifier) the tz_abbr,
* tz_id are added.
*
* If relative time elements are present in the
* datetime string such as +3 days,
* the then returned array includes a nested array with the key
* relative. This array then contains the keys
* year, month, day,
* hour, minute,
* second, and if necessary weekday, and
* weekdays, depending on the string that was passed in.
*
* The array includes warning_count and
* warnings fields. The first one indicate how many
* warnings there were.
* The keys of elements warnings array indicate the
* position in the given datetime where the warning
* occurred, with the string value describing the warning itself.
*
* The array also contains error_count and
* errors fields. The first one indicate how many errors
* were found.
* The keys of elements errors array indicate the
* position in the given datetime where the error
* occurred, with the string value describing the error itself.
* @throws DatetimeException
*
*/
function date_parse(string $datetime): ?array
{
error_clear_last();
$safeResult = \date_parse($datetime);
if ($safeResult === false) {
throw DatetimeException::createFromPhpError();
}
return $safeResult;
}


/**
*
*
Expand Down Expand Up @@ -443,38 +371,6 @@ 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 (Unix timestamp) or the current time
* if no timestamp is given. In other words, timestamp
* is optional and defaults to the value of time.
*
* @param string $format Format accepted by DateTimeInterface::format.
* @param int $timestamp The optional timestamp parameter is an
* 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
* E_WARNING level error is emitted.
* @throws DatetimeException
*
*/
function date(string $format, int $timestamp = null): string
{
error_clear_last();
if ($timestamp !== null) {
$safeResult = \date($format, $timestamp);
} else {
$safeResult = \date($format);
}
if ($safeResult === false) {
throw DatetimeException::createFromPhpError();
}
return $safeResult;
}


/**
* Identical to mktime except the passed parameters represents a
* GMT date. gmmktime internally uses mktime
Expand Down
2 changes: 1 addition & 1 deletion generated/filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -1518,7 +1518,7 @@ function tempnam(string $directory, string $prefix): string


/**
* Creates a temporary file with a unique name in read-write (w+) mode and
* Creates a temporary file with a unique name in read-write-binary (w+b) mode and
* returns a file handle.
*
* The file is automatically removed when closed (for example, by calling
Expand Down
23 changes: 23 additions & 0 deletions generated/fpm.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,26 @@ function fastcgi_finish_request(): void
throw FpmException::createFromPhpError();
}
}


/**
* This function returns the full current FPM pool status as an associative array. It always
* returns the full status, including per-process status information. See the
* FPM status page guide for further
* details.
*
* Note that this function will only be defined if FPM is being used to serve the script.
*
* @return array Associative array containing the full FPM pool status.
* @throws FpmException
*
*/
function fpm_get_status(): array
{
error_clear_last();
$safeResult = \fpm_get_status();
if ($safeResult === false) {
throw FpmException::createFromPhpError();
}
return $safeResult;
}
Loading