mirror of
https://github.com/itflow-org/itflow
synced 2026-06-22 01:31:06 +00:00
Allow PHP-8.2 and up Compatibility instead of just PHP-8.4
This commit is contained in:
273
plugins/vendor/symfony/polyfill-php84/Php84.php
vendored
273
plugins/vendor/symfony/polyfill-php84/Php84.php
vendored
@@ -19,7 +19,8 @@ namespace Symfony\Polyfill\Php84;
|
||||
*/
|
||||
final class Php84
|
||||
{
|
||||
public static function mb_ucfirst(string $string, ?string $encoding = null): string
|
||||
/** @return string|false */
|
||||
public static function mb_ucfirst(string $string, ?string $encoding = null)
|
||||
{
|
||||
if (null === $encoding) {
|
||||
$encoding = mb_internal_encoding();
|
||||
@@ -28,12 +29,17 @@ final class Php84
|
||||
try {
|
||||
$validEncoding = @mb_check_encoding('', $encoding);
|
||||
} catch (\ValueError $e) {
|
||||
throw new \ValueError(sprintf('mb_ucfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given', $encoding));
|
||||
throw new \ValueError(\sprintf('mb_ucfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given', $encoding));
|
||||
}
|
||||
|
||||
// BC for PHP 7.3 and lower
|
||||
if (!$validEncoding) {
|
||||
throw new \ValueError(sprintf('mb_ucfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given', $encoding));
|
||||
if (80000 > \PHP_VERSION_ID) {
|
||||
trigger_error(\sprintf('mb_ucfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given', $encoding), \E_USER_WARNING);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
throw new \ValueError(\sprintf('mb_ucfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given', $encoding));
|
||||
}
|
||||
|
||||
$firstChar = mb_substr($string, 0, 1, $encoding);
|
||||
@@ -42,7 +48,8 @@ final class Php84
|
||||
return $firstChar.mb_substr($string, 1, null, $encoding);
|
||||
}
|
||||
|
||||
public static function mb_lcfirst(string $string, ?string $encoding = null): string
|
||||
/** @return string|false */
|
||||
public static function mb_lcfirst(string $string, ?string $encoding = null)
|
||||
{
|
||||
if (null === $encoding) {
|
||||
$encoding = mb_internal_encoding();
|
||||
@@ -51,12 +58,17 @@ final class Php84
|
||||
try {
|
||||
$validEncoding = @mb_check_encoding('', $encoding);
|
||||
} catch (\ValueError $e) {
|
||||
throw new \ValueError(sprintf('mb_lcfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given', $encoding));
|
||||
throw new \ValueError(\sprintf('mb_lcfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given', $encoding));
|
||||
}
|
||||
|
||||
// BC for PHP 7.3 and lower
|
||||
if (!$validEncoding) {
|
||||
throw new \ValueError(sprintf('mb_lcfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given', $encoding));
|
||||
if (80000 > \PHP_VERSION_ID) {
|
||||
trigger_error(\sprintf('mb_lcfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given', $encoding), \E_USER_WARNING);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
throw new \ValueError(\sprintf('mb_lcfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given', $encoding));
|
||||
}
|
||||
|
||||
$firstChar = mb_substr($string, 0, 1, $encoding);
|
||||
@@ -114,22 +126,26 @@ final class Php84
|
||||
return $num ** $exponent;
|
||||
}
|
||||
|
||||
public static function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string
|
||||
/** @return string|false */
|
||||
public static function mb_trim(string $string, ?string $characters = null, ?string $encoding = null)
|
||||
{
|
||||
return self::mb_internal_trim('{^[%s]+|[%1$s]+$}Du', $string, $characters, $encoding, __FUNCTION__);
|
||||
}
|
||||
|
||||
public static function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string
|
||||
/** @return string|false */
|
||||
public static function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null)
|
||||
{
|
||||
return self::mb_internal_trim('{^[%s]+}Du', $string, $characters, $encoding, __FUNCTION__);
|
||||
}
|
||||
|
||||
public static function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string
|
||||
/** @return string|false */
|
||||
public static function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null)
|
||||
{
|
||||
return self::mb_internal_trim('{[%s]+$}Du', $string, $characters, $encoding, __FUNCTION__);
|
||||
}
|
||||
|
||||
private static function mb_internal_trim(string $regex, string $string, ?string $characters, ?string $encoding, string $function): string
|
||||
/** @return string|false */
|
||||
private static function mb_internal_trim(string $regex, string $string, ?string $characters, ?string $encoding, string $function)
|
||||
{
|
||||
if (null === $encoding) {
|
||||
$encoding = mb_internal_encoding();
|
||||
@@ -138,12 +154,17 @@ final class Php84
|
||||
try {
|
||||
$validEncoding = @mb_check_encoding('', $encoding);
|
||||
} catch (\ValueError $e) {
|
||||
throw new \ValueError(sprintf('%s(): Argument #3 ($encoding) must be a valid encoding, "%s" given', $function, $encoding));
|
||||
throw new \ValueError(\sprintf('%s(): Argument #3 ($encoding) must be a valid encoding, "%s" given', $function, $encoding));
|
||||
}
|
||||
|
||||
// BC for PHP 7.3 and lower
|
||||
if (!$validEncoding) {
|
||||
throw new \ValueError(sprintf('%s(): Argument #3 ($encoding) must be a valid encoding, "%s" given', $function, $encoding));
|
||||
if (80000 > \PHP_VERSION_ID) {
|
||||
trigger_error(\sprintf('%s(): Argument #3 ($encoding) must be a valid encoding, "%s" given', $function, $encoding), \E_USER_WARNING);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
throw new \ValueError(\sprintf('%s(): Argument #3 ($encoding) must be a valid encoding, "%s" given', $function, $encoding));
|
||||
}
|
||||
|
||||
if ('' === $characters) {
|
||||
@@ -166,7 +187,7 @@ final class Php84
|
||||
$characters = preg_quote($characters);
|
||||
}
|
||||
|
||||
$string = preg_replace(sprintf($regex, $characters), '', $string);
|
||||
$string = preg_replace(\sprintf($regex, $characters), '', $string);
|
||||
|
||||
if ('UTF-8' === $encoding) {
|
||||
return $string;
|
||||
@@ -185,11 +206,11 @@ final class Php84
|
||||
return [];
|
||||
}
|
||||
|
||||
$regex = ((float) \PCRE_VERSION < 10 ? (float) \PCRE_VERSION >= 8.32 : (float) \PCRE_VERSION >= 10.39)
|
||||
$regex = ((float) \PCRE_VERSION >= 10.44)
|
||||
? '\X'
|
||||
: '(?:\r\n|(?:[ -~\x{200C}\x{200D}]|[ᆨ-ᇹ]+|[ᄀ-ᅟ]*(?:[가개갸걔거게겨계고과괘괴교구궈궤귀규그긔기까깨꺄꺠꺼께껴꼐꼬꽈꽤꾀꾜꾸꿔꿰뀌뀨끄끠끼나내냐냬너네녀녜노놔놰뇌뇨누눠눼뉘뉴느늬니다대댜댸더데뎌뎨도돠돼되됴두둬뒈뒤듀드듸디따때땨떄떠떼뗘뗴또똬뙈뙤뚀뚜뚸뛔뛰뜌뜨띄띠라래랴럐러레려례로롸뢔뢰료루뤄뤠뤼류르릐리마매먀먜머메며몌모뫄뫠뫼묘무뭐뭬뮈뮤므믜미바배뱌뱨버베벼볘보봐봬뵈뵤부붜붸뷔뷰브븨비빠빼뺘뺴뻐뻬뼈뼤뽀뽜뽸뾔뾰뿌뿨쀄쀠쀼쁘쁴삐사새샤섀서세셔셰소솨쇄쇠쇼수숴쉐쉬슈스싀시싸쌔쌰썌써쎄쎠쎼쏘쏴쐐쐬쑈쑤쒀쒜쒸쓔쓰씌씨아애야얘어에여예오와왜외요우워웨위유으의이자재쟈쟤저제져졔조좌좨죄죠주줘줴쥐쥬즈즤지짜째쨔쨰쩌쩨쪄쪠쪼쫘쫴쬐쬬쭈쭤쮀쮜쮸쯔쯰찌차채챠챼처체쳐쳬초촤쵀최쵸추춰췌취츄츠츼치카캐캬컈커케켜켸코콰쾌쾨쿄쿠쿼퀘퀴큐크킈키타태탸턔터테텨톄토톼퇘퇴툐투퉈퉤튀튜트틔티파패퍄퍠퍼페펴폐포퐈퐤푀표푸풔풰퓌퓨프픠피하해햐햬허헤혀혜호화홰회효후훠훼휘휴흐희히]?[ᅠ-ᆢ]+|[가-힣])[ᆨ-ᇹ]*|[ᄀ-ᅟ]+|[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}])[\p{Mn}\p{Me}\x{09BE}\x{09D7}\x{0B3E}\x{0B57}\x{0BBE}\x{0BD7}\x{0CC2}\x{0CD5}\x{0CD6}\x{0D3E}\x{0D57}\x{0DCF}\x{0DDF}\x{200C}\x{200D}\x{1D165}\x{1D16E}-\x{1D172}]*|[\p{Cc}\p{Cf}\p{Zl}\p{Zp}])';
|
||||
: '(?:\r\n|[\x{1F1E6}-\x{1F1FF}][\x{1F1E6}-\x{1F1FF}]?|(?:[ -~\x{200C}\x{200D}]|[ᆨ-ᇹ]+|[ᄀ-ᅟ]*(?:[가개갸걔거게겨계고과괘괴교구궈궤귀규그긔기까깨꺄꺠꺼께껴꼐꼬꽈꽤꾀꾜꾸꿔꿰뀌뀨끄끠끼나내냐냬너네녀녜노놔놰뇌뇨누눠눼뉘뉴느늬니다대댜댸더데뎌뎨도돠돼되됴두둬뒈뒤듀드듸디따때땨떄떠떼뗘뗴또똬뙈뙤뚀뚜뚸뛔뛰뜌뜨띄띠라래랴럐러레려례로롸뢔뢰료루뤄뤠뤼류르릐리마매먀먜머메며몌모뫄뫠뫼묘무뭐뭬뮈뮤므믜미바배뱌뱨버베벼볘보봐봬뵈뵤부붜붸뷔뷰브븨비빠빼뺘뺴뻐뻬뼈뼤뽀뽜뽸뾔뾰뿌뿨쀄쀠쀼쁘쁴삐사새샤섀서세셔셰소솨쇄쇠쇼수숴쉐쉬슈스싀시싸쌔쌰썌써쎄쎠쎼쏘쏴쐐쐬쑈쑤쒀쒜쒸쓔쓰씌씨아애야얘어에여예오와왜외요우워웨위유으의이자재쟈쟤저제져졔조좌좨죄죠주줘줴쥐쥬즈즤지짜째쨔쨰쩌쩨쪄쪠쪼쫘쫴쬐쬬쭈쭤쮀쮜쮸쯔쯰찌차채챠챼처체쳐쳬초촤쵀최쵸추춰췌취츄츠츼치카캐캬컈커케켜켸코콰쾌쾨쿄쿠쿼퀘퀴큐크킈키타태탸턔터테텨톄토톼퇘퇴툐투퉈퉤튀튜트틔티파패퍄퍠퍼페펴폐포퐈퐤푀표푸풔풰퓌퓨프픠피하해햐햬허헤혀혜호화홰회효후훠훼휘휴흐희히]?[ᅠ-ᆢ]+|[가-힣])[ᆨ-ᇹ]*|[ᄀ-ᅟ]+|[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}])[\p{Mn}\p{Mc}\p{Me}\x{09BE}\x{09D7}\x{0B3E}\x{0B57}\x{0BBE}\x{0BD7}\x{0CC2}\x{0CD5}\x{0CD6}\x{0D3E}\x{0D57}\x{0DCF}\x{0DDF}\x{200C}\x{1D165}\x{1D16E}-\x{1D172}\x{1F3FB}-\x{1F3FF}\x{FE0E}-\x{FE0F}\x{E0020}-\x{E007F}]*(?:\x{200D}(?:[\x{1F1E6}-\x{1F1FF}]|[ -~\x{200C}\x{200D}]|[ᆨ-ᇹ]+|[ᄀ-ᅟ]*(?:[가-힣]?[ᅠ-ᆢ]+|[가-힣])[ᆨ-ᇹ]*|[ᄀ-ᅟ]+|[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}])[\p{Mn}\p{Mc}\p{Me}\x{09BE}\x{09D7}\x{0B3E}\x{0B57}\x{0BBE}\x{0BD7}\x{0CC2}\x{0CD5}\x{0CD6}\x{0D3E}\x{0D57}\x{0DCF}\x{0DDF}\x{200C}\x{1D165}\x{1D16E}-\x{1D172}\x{1F3FB}-\x{1F3FF}\x{FE0E}-\x{FE0F}\x{E0020}-\x{E007F}]*)*|[\p{Cc}\p{Cf}\p{Zl}\p{Zp}])';
|
||||
|
||||
if (!preg_match_all('/'. $regex .'/u', $string, $matches)) {
|
||||
if (!preg_match_all('/'.$regex.'/u', $string, $matches)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -205,13 +226,219 @@ final class Php84
|
||||
return $chunks;
|
||||
}
|
||||
|
||||
public static function bcceil(string $num): string
|
||||
{
|
||||
if (!is_numeric($num)) {
|
||||
throw new \ValueError('bcceil(): Argument #1 ($num) is not well-formed');
|
||||
}
|
||||
|
||||
return self::bcround($num, 0, \RoundingMode::PositiveInfinity);
|
||||
}
|
||||
|
||||
public static function bcdivmod(string $num1, string $num2, ?int $scale = null): ?array
|
||||
{
|
||||
if (null === $quot = \bcdiv($num1, $num2, 0)) {
|
||||
return null;
|
||||
if (null === $quot = @bcdiv($num1, $num2, 0)) {
|
||||
throw new \DivisionByZeroError('Division by zero');
|
||||
}
|
||||
$scale = $scale ?? (\PHP_VERSION_ID >= 70300 ? \bcscale() : (ini_get('bcmath.scale') ?: 0));
|
||||
$scale = $scale ?? (\PHP_VERSION_ID >= 70300 ? bcscale() : (\ini_get('bcmath.scale') ?: 0));
|
||||
|
||||
return [$quot, \bcmod($num1, $num2, $scale)];
|
||||
return [$quot, bcmod($num1, $num2, $scale)];
|
||||
}
|
||||
|
||||
public static function bcfloor(string $num): string
|
||||
{
|
||||
if (!is_numeric($num)) {
|
||||
throw new \ValueError('bcfloor(): Argument #1 ($num) is not well-formed');
|
||||
}
|
||||
|
||||
return self::bcround($num, 0, \RoundingMode::NegativeInfinity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \RoundingMode|\RoundingMode::* $mode
|
||||
*/
|
||||
public static function bcround(string $num, int $precision = 0, $mode = \RoundingMode::HalfAwayFromZero): string
|
||||
{
|
||||
if (!is_numeric($num)) {
|
||||
throw new \ValueError('bcround(): Argument #1 ($num) is not well-formed');
|
||||
}
|
||||
|
||||
$sign = 1;
|
||||
if ('' !== $num && ('-' === $num[0] || '+' === $num[0])) {
|
||||
if ('-' === $num[0]) {
|
||||
$sign = -1;
|
||||
}
|
||||
|
||||
$num = substr($num, 1);
|
||||
}
|
||||
|
||||
if (false !== strpos($num, '.')) {
|
||||
[$intPart, $fracPart] = array_pad(explode('.', $num, 2), 2, '');
|
||||
} else {
|
||||
$intPart = $num;
|
||||
$fracPart = '';
|
||||
}
|
||||
|
||||
if ('' === $intPart) {
|
||||
$intPart = '0';
|
||||
}
|
||||
|
||||
$intPart = self::trimLeadingZeros($intPart);
|
||||
$fracPart = (string) $fracPart;
|
||||
|
||||
if ($precision >= 0) {
|
||||
$fracLength = \strlen($fracPart);
|
||||
|
||||
if ($precision <= $fracLength) {
|
||||
$scaledInt = $intPart.(string) substr($fracPart, 0, $precision);
|
||||
$scaledFrac = (string) substr($fracPart, $precision);
|
||||
} else {
|
||||
$scaledInt = $intPart.$fracPart.str_repeat('0', $precision - $fracLength);
|
||||
$scaledFrac = '';
|
||||
}
|
||||
} else {
|
||||
$shift = -$precision;
|
||||
$intLength = \strlen($intPart);
|
||||
|
||||
if ($shift <= $intLength) {
|
||||
$splitPos = $intLength - $shift;
|
||||
$scaledInt = substr($intPart, 0, $splitPos);
|
||||
$scaledInt = '' === $scaledInt ? '0' : $scaledInt;
|
||||
$scaledFrac = substr($intPart, $splitPos).$fracPart;
|
||||
} else {
|
||||
$scaledInt = '0';
|
||||
$scaledFrac = str_repeat('0', $shift - $intLength).$intPart.$fracPart;
|
||||
}
|
||||
}
|
||||
|
||||
$roundedInt = self::roundIntegerPart($scaledInt, $scaledFrac, $sign, $mode);
|
||||
$isZero = '' === trim($roundedInt, '0');
|
||||
$absResult = self::formatRoundedDigits($roundedInt, $precision);
|
||||
|
||||
if (-1 === $sign && !$isZero) {
|
||||
$absResult = '-'.$absResult;
|
||||
}
|
||||
|
||||
return $absResult;
|
||||
}
|
||||
|
||||
private static function roundIntegerPart(string $intPart, string $fracPart, int $sign, $mode): string
|
||||
{
|
||||
$intPart = self::trimLeadingZeros($intPart);
|
||||
|
||||
if ('' === $fracPart || '' === trim($fracPart, '0')) {
|
||||
return $intPart;
|
||||
}
|
||||
|
||||
$firstDigit = $fracPart[0];
|
||||
$tail = (string) substr($fracPart, 1);
|
||||
$tailNonZero = '' !== trim($tail, '0');
|
||||
$isGreaterThanHalf = $firstDigit > '5' || ('5' === $firstDigit && $tailNonZero);
|
||||
$isExactlyHalf = '5' === $firstDigit && !$tailNonZero;
|
||||
$shouldIncrease = false;
|
||||
|
||||
switch ($mode) {
|
||||
case \RoundingMode::TowardsZero:
|
||||
break;
|
||||
|
||||
case \RoundingMode::AwayFromZero:
|
||||
$shouldIncrease = true;
|
||||
break;
|
||||
|
||||
case \RoundingMode::PositiveInfinity:
|
||||
$shouldIncrease = $sign > 0;
|
||||
break;
|
||||
|
||||
case \RoundingMode::NegativeInfinity:
|
||||
$shouldIncrease = $sign < 0;
|
||||
break;
|
||||
|
||||
case \RoundingMode::HalfAwayFromZero:
|
||||
$shouldIncrease = $isGreaterThanHalf || $isExactlyHalf;
|
||||
break;
|
||||
|
||||
case \RoundingMode::HalfTowardsZero:
|
||||
$shouldIncrease = $isGreaterThanHalf;
|
||||
break;
|
||||
|
||||
case \RoundingMode::HalfEven:
|
||||
if ($isGreaterThanHalf) {
|
||||
$shouldIncrease = true;
|
||||
} elseif ($isExactlyHalf && 1 === self::lastDigit($intPart) % 2) {
|
||||
$shouldIncrease = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case \RoundingMode::HalfOdd:
|
||||
if ($isGreaterThanHalf) {
|
||||
$shouldIncrease = true;
|
||||
} elseif ($isExactlyHalf && 0 === self::lastDigit($intPart) % 2) {
|
||||
$shouldIncrease = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if ($shouldIncrease) {
|
||||
$intPart = self::incrementDigits($intPart);
|
||||
}
|
||||
|
||||
return self::trimLeadingZeros($intPart);
|
||||
}
|
||||
|
||||
private static function formatRoundedDigits(string $roundedInt, int $precision): string
|
||||
{
|
||||
if ($precision > 0) {
|
||||
if (\strlen($roundedInt) <= $precision) {
|
||||
$roundedInt = str_pad($roundedInt, $precision + 1, '0', \STR_PAD_LEFT);
|
||||
}
|
||||
|
||||
$intDigits = substr($roundedInt, 0, -$precision);
|
||||
$fracDigits = substr($roundedInt, -$precision);
|
||||
|
||||
$intDigits = self::trimLeadingZeros('' === $intDigits ? '0' : $intDigits);
|
||||
$fracDigits = str_pad($fracDigits, $precision, '0', \STR_PAD_LEFT);
|
||||
|
||||
return $intDigits.'.'.$fracDigits;
|
||||
}
|
||||
|
||||
if (0 === $precision) {
|
||||
return self::trimLeadingZeros($roundedInt);
|
||||
}
|
||||
|
||||
$shift = -$precision;
|
||||
$digits = $roundedInt.str_repeat('0', $shift);
|
||||
|
||||
return self::trimLeadingZeros($digits);
|
||||
}
|
||||
|
||||
private static function incrementDigits(string $digits): string
|
||||
{
|
||||
$digits = '' === $digits ? '0' : $digits;
|
||||
$index = \strlen($digits) - 1;
|
||||
$result = $digits;
|
||||
$carry = 1;
|
||||
|
||||
while ($index >= 0 && $carry) {
|
||||
$value = \ord($result[$index]) - 48 + $carry;
|
||||
$carry = $value >= 10 ? 1 : 0;
|
||||
$result[$index] = \chr(48 + ($value % 10));
|
||||
--$index;
|
||||
}
|
||||
|
||||
return $carry ? '1'.$result : $result;
|
||||
}
|
||||
|
||||
private static function trimLeadingZeros(string $digits): string
|
||||
{
|
||||
$digits = ltrim($digits, '0');
|
||||
|
||||
return '' === $digits ? '0' : $digits;
|
||||
}
|
||||
|
||||
private static function lastDigit(string $digits): int
|
||||
{
|
||||
$length = \strlen($digits);
|
||||
|
||||
return $length ? \ord($digits[$length - 1]) - 48 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ This component provides features added to PHP 8.4 core:
|
||||
- [`grapheme_str_split`](https://wiki.php.net/rfc/grapheme_str_split)
|
||||
- [`mb_trim`, `mb_ltrim` and `mb_rtrim`](https://wiki.php.net/rfc/mb_trim)
|
||||
- [`mb_ucfirst` and `mb_lcfirst`](https://wiki.php.net/rfc/mb_ucfirst)
|
||||
- [`PDO` driver specific sub-classes](https://wiki.php.net/rfc/pdo_driver_specific_subclasses)
|
||||
- [`ReflectionConstant`](https://github.com/php/php-src/pull/13669)
|
||||
|
||||
More information can be found in the
|
||||
|
||||
25
plugins/vendor/symfony/polyfill-php84/Resources/Deprecated.php
vendored
Normal file
25
plugins/vendor/symfony/polyfill-php84/Resources/Deprecated.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
if (\PHP_VERSION_ID < 80400) {
|
||||
#[Attribute(Attribute::TARGET_METHOD | Attribute::TARGET_FUNCTION | Attribute::TARGET_CLASS_CONSTANT)]
|
||||
final class Deprecated
|
||||
{
|
||||
public readonly ?string $message;
|
||||
public readonly ?string $since;
|
||||
|
||||
public function __construct(?string $message = null, ?string $since = null)
|
||||
{
|
||||
$this->message = $message;
|
||||
$this->since = $since;
|
||||
}
|
||||
}
|
||||
}
|
||||
24
plugins/vendor/symfony/polyfill-php84/Resources/RoundingMode.php
vendored
Normal file
24
plugins/vendor/symfony/polyfill-php84/Resources/RoundingMode.php
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
if (\PHP_VERSION_ID < 80400) {
|
||||
enum RoundingMode
|
||||
{
|
||||
case HalfAwayFromZero;
|
||||
case HalfTowardsZero;
|
||||
case HalfEven;
|
||||
case HalfOdd;
|
||||
case TowardsZero;
|
||||
case AwayFromZero;
|
||||
case NegativeInfinity;
|
||||
case PositiveInfinity;
|
||||
}
|
||||
}
|
||||
@@ -9,12 +9,19 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
if (\PHP_VERSION_ID < 80400) {
|
||||
if (\PHP_VERSION_ID < 80100) {
|
||||
#[Attribute(Attribute::TARGET_METHOD | Attribute::TARGET_FUNCTION | Attribute::TARGET_CLASS_CONSTANT)]
|
||||
final class Deprecated
|
||||
{
|
||||
public readonly ?string $message;
|
||||
public readonly ?string $since;
|
||||
/**
|
||||
* @readonly
|
||||
*/
|
||||
public ?string $message;
|
||||
|
||||
/**
|
||||
* @readonly
|
||||
*/
|
||||
public ?string $since;
|
||||
|
||||
public function __construct(?string $message = null, ?string $since = null)
|
||||
{
|
||||
@@ -22,4 +29,6 @@ if (\PHP_VERSION_ID < 80400) {
|
||||
$this->since = $since;
|
||||
}
|
||||
}
|
||||
} elseif (\PHP_VERSION_ID < 80400) {
|
||||
require dirname(__DIR__).'/Deprecated.php';
|
||||
}
|
||||
|
||||
43
plugins/vendor/symfony/polyfill-php84/Resources/stubs/Pdo/Dblib.php
vendored
Normal file
43
plugins/vendor/symfony/polyfill-php84/Resources/stubs/Pdo/Dblib.php
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Pdo;
|
||||
|
||||
if (\PHP_VERSION_ID < 80400 && \extension_loaded('pdo_dblib')) {
|
||||
class Dblib extends \PDO
|
||||
{
|
||||
public const ATTR_CONNECTION_TIMEOUT = \PDO::DBLIB_ATTR_CONNECTION_TIMEOUT;
|
||||
public const ATTR_QUERY_TIMEOUT = \PDO::DBLIB_ATTR_QUERY_TIMEOUT;
|
||||
public const ATTR_STRINGIFY_UNIQUEIDENTIFIER = \PDO::DBLIB_ATTR_STRINGIFY_UNIQUEIDENTIFIER;
|
||||
public const ATTR_VERSION = \PDO::DBLIB_ATTR_VERSION;
|
||||
public const ATTR_TDS_VERSION = \PHP_VERSION_ID >= 70300 ? \PDO::DBLIB_ATTR_TDS_VERSION : 1004;
|
||||
public const ATTR_SKIP_EMPTY_ROWSETS = \PHP_VERSION_ID >= 70300 ? \PDO::DBLIB_ATTR_SKIP_EMPTY_ROWSETS : 1005;
|
||||
public const ATTR_DATETIME_CONVERT = \PHP_VERSION_ID >= 70300 ? \PDO::DBLIB_ATTR_DATETIME_CONVERT : 1006;
|
||||
|
||||
public function __construct(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null)
|
||||
{
|
||||
parent::__construct($dsn, $username, $password, $options);
|
||||
|
||||
if ('dblib' !== $driver = $this->getAttribute(\PDO::ATTR_DRIVER_NAME)) {
|
||||
throw new \PDOException(\sprintf('Pdo\Dblib::__construct() cannot be used for connecting to the "%s" driver', $driver));
|
||||
}
|
||||
}
|
||||
|
||||
public static function connect(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null): self
|
||||
{
|
||||
try {
|
||||
return new self($dsn, $username, $password, $options);
|
||||
} catch (\PDOException $e) {
|
||||
throw preg_match('/^Pdo\\\\Dblib::__construct\(\) cannot be used for connecting to the "([a-z]+)" driver/', $e->getMessage(), $matches) ? new \PDOException(\sprintf('Pdo\Dblib::connect() cannot be used for connecting to the "%s" driver', $matches[1])) : $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
39
plugins/vendor/symfony/polyfill-php84/Resources/stubs/Pdo/Firebird.php
vendored
Normal file
39
plugins/vendor/symfony/polyfill-php84/Resources/stubs/Pdo/Firebird.php
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Pdo;
|
||||
|
||||
if (\PHP_VERSION_ID < 80400 && \extension_loaded('pdo_firebird')) {
|
||||
class Firebird extends \PDO
|
||||
{
|
||||
public const ATTR_DATE_FORMAT = \PDO::FB_ATTR_DATE_FORMAT;
|
||||
public const ATTR_TIME_FORMAT = \PDO::FB_ATTR_TIME_FORMAT;
|
||||
public const ATTR_TIMESTAMP_FORMAT = \PDO::FB_ATTR_TIMESTAMP_FORMAT;
|
||||
|
||||
public function __construct(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null)
|
||||
{
|
||||
parent::__construct($dsn, $username, $password, $options);
|
||||
|
||||
if ('firebird' !== $driver = $this->getAttribute(\PDO::ATTR_DRIVER_NAME)) {
|
||||
throw new \PDOException(\sprintf('Pdo\Firebird::__construct() cannot be used for connecting to the "%s" driver', $driver));
|
||||
}
|
||||
}
|
||||
|
||||
public static function connect(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null): self
|
||||
{
|
||||
try {
|
||||
return new self($dsn, $username, $password, $options);
|
||||
} catch (\PDOException $e) {
|
||||
throw preg_match('/^Pdo\\\\Firebird::__construct\(\) cannot be used for connecting to the "([a-z]+)" driver/', $e->getMessage(), $matches) ? new \PDOException(\sprintf('Pdo\Firebird::connect() cannot be used for connecting to the "%s" driver', $matches[1])) : $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
140
plugins/vendor/symfony/polyfill-php84/Resources/stubs/Pdo/Mysql.php
vendored
Normal file
140
plugins/vendor/symfony/polyfill-php84/Resources/stubs/Pdo/Mysql.php
vendored
Normal file
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Pdo;
|
||||
|
||||
use PDO;
|
||||
|
||||
if (\PHP_VERSION_ID < 80400 && \extension_loaded('pdo_mysql')) {
|
||||
// Feature detection for non-mysqlnd; see also https://www.php.net/manual/en/class.pdo-mysql.php#pdo-mysql.constants.attr-max-buffer-size
|
||||
if (\defined('PDO::MYSQL_ATTR_MAX_BUFFER_SIZE') && \defined('PDO::MYSQL_ATTR_READ_DEFAULT_FILE') && \defined('PDO::MYSQL_ATTR_READ_DEFAULT_GROUP')) {
|
||||
class Mysql extends \PDO
|
||||
{
|
||||
public const ATTR_COMPRESS = \PDO::MYSQL_ATTR_COMPRESS;
|
||||
public const ATTR_DIRECT_QUERY = \PDO::MYSQL_ATTR_DIRECT_QUERY;
|
||||
public const ATTR_FOUND_ROWS = \PDO::MYSQL_ATTR_FOUND_ROWS;
|
||||
public const ATTR_IGNORE_SPACE = \PDO::MYSQL_ATTR_IGNORE_SPACE;
|
||||
public const ATTR_INIT_COMMAND = \PDO::MYSQL_ATTR_INIT_COMMAND;
|
||||
public const ATTR_LOCAL_INFILE = \PDO::MYSQL_ATTR_LOCAL_INFILE;
|
||||
public const ATTR_LOCAL_INFILE_DIRECTORY = \PHP_VERSION_ID >= 80100 ? \PDO::MYSQL_ATTR_LOCAL_INFILE_DIRECTORY : 1015;
|
||||
public const ATTR_MAX_BUFFER_SIZE = \PDO::MYSQL_ATTR_MAX_BUFFER_SIZE;
|
||||
public const ATTR_MULTI_STATEMENTS = \PDO::MYSQL_ATTR_MULTI_STATEMENTS;
|
||||
public const ATTR_READ_DEFAULT_FILE = \PDO::MYSQL_ATTR_READ_DEFAULT_FILE;
|
||||
public const ATTR_READ_DEFAULT_GROUP = \PDO::MYSQL_ATTR_READ_DEFAULT_GROUP;
|
||||
public const ATTR_SERVER_PUBLIC_KEY = \PDO::MYSQL_ATTR_SERVER_PUBLIC_KEY;
|
||||
public const ATTR_SSL_CA = \PDO::MYSQL_ATTR_SSL_CA;
|
||||
public const ATTR_SSL_CAPATH = \PDO::MYSQL_ATTR_SSL_CAPATH;
|
||||
public const ATTR_SSL_CERT = \PDO::MYSQL_ATTR_SSL_CERT;
|
||||
public const ATTR_SSL_CIPHER = \PDO::MYSQL_ATTR_SSL_CIPHER;
|
||||
public const ATTR_SSL_KEY = \PDO::MYSQL_ATTR_SSL_KEY;
|
||||
public const ATTR_USE_BUFFERED_QUERY = \PDO::MYSQL_ATTR_USE_BUFFERED_QUERY;
|
||||
|
||||
public function __construct(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null)
|
||||
{
|
||||
parent::__construct($dsn, $username, $password, $options);
|
||||
|
||||
if ('mysql' !== $driver = $this->getAttribute(\PDO::ATTR_DRIVER_NAME)) {
|
||||
throw new \PDOException(\sprintf('Pdo\Mysql::__construct() cannot be used for connecting to the "%s" driver', $driver));
|
||||
}
|
||||
}
|
||||
|
||||
public static function connect(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null): self
|
||||
{
|
||||
try {
|
||||
return new self($dsn, $username, $password, $options);
|
||||
} catch (\PDOException $e) {
|
||||
throw preg_match('/^Pdo\\\\Mysql::__construct\(\) cannot be used for connecting to the "([a-z]+)" driver/', $e->getMessage(), $matches) ? new \PDOException(\sprintf('Pdo\Mysql::connect() cannot be used for connecting to the "%s" driver', $matches[1])) : $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif (\defined('PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT')) {
|
||||
class Mysql extends \PDO
|
||||
{
|
||||
public const ATTR_COMPRESS = \PDO::MYSQL_ATTR_COMPRESS;
|
||||
public const ATTR_DIRECT_QUERY = \PDO::MYSQL_ATTR_DIRECT_QUERY;
|
||||
public const ATTR_FOUND_ROWS = \PDO::MYSQL_ATTR_FOUND_ROWS;
|
||||
public const ATTR_IGNORE_SPACE = \PDO::MYSQL_ATTR_IGNORE_SPACE;
|
||||
public const ATTR_INIT_COMMAND = \PDO::MYSQL_ATTR_INIT_COMMAND;
|
||||
public const ATTR_LOCAL_INFILE = \PDO::MYSQL_ATTR_LOCAL_INFILE;
|
||||
public const ATTR_LOCAL_INFILE_DIRECTORY = \PHP_VERSION_ID >= 80100 ? \PDO::MYSQL_ATTR_LOCAL_INFILE_DIRECTORY : 1015;
|
||||
// public const ATTR_MAX_BUFFER_SIZE = PDO::MYSQL_ATTR_MAX_BUFFER_SIZE; // disabled for mysqlnd
|
||||
public const ATTR_MULTI_STATEMENTS = \PDO::MYSQL_ATTR_MULTI_STATEMENTS;
|
||||
// public const ATTR_READ_DEFAULT_FILE = PDO::MYSQL_ATTR_READ_DEFAULT_FILE; // disabled for mysqlnd
|
||||
// public const ATTR_READ_DEFAULT_GROUP = PDO::MYSQL_ATTR_READ_DEFAULT_GROUP; // disabled for mysqlnd
|
||||
public const ATTR_SERVER_PUBLIC_KEY = \PDO::MYSQL_ATTR_SERVER_PUBLIC_KEY;
|
||||
public const ATTR_SSL_CA = \PDO::MYSQL_ATTR_SSL_CA;
|
||||
public const ATTR_SSL_CAPATH = \PDO::MYSQL_ATTR_SSL_CAPATH;
|
||||
public const ATTR_SSL_CERT = \PDO::MYSQL_ATTR_SSL_CERT;
|
||||
public const ATTR_SSL_CIPHER = \PDO::MYSQL_ATTR_SSL_CIPHER;
|
||||
public const ATTR_SSL_KEY = \PDO::MYSQL_ATTR_SSL_KEY;
|
||||
public const ATTR_SSL_VERIFY_SERVER_CERT = \PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT;
|
||||
public const ATTR_USE_BUFFERED_QUERY = \PDO::MYSQL_ATTR_USE_BUFFERED_QUERY;
|
||||
|
||||
public function __construct(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null)
|
||||
{
|
||||
parent::__construct($dsn, $username, $password, $options);
|
||||
|
||||
if ('mysql' !== $driver = $this->getAttribute(\PDO::ATTR_DRIVER_NAME)) {
|
||||
throw new \PDOException(\sprintf('Pdo\Mysql::__construct() cannot be used for connecting to the "%s" driver', $driver));
|
||||
}
|
||||
}
|
||||
|
||||
public static function connect(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null): self
|
||||
{
|
||||
try {
|
||||
return new self($dsn, $username, $password, $options);
|
||||
} catch (\PDOException $e) {
|
||||
throw preg_match('/^Pdo\\\\Mysql::__construct\(\) cannot be used for connecting to the "([a-z]+)" driver/', $e->getMessage(), $matches) ? new \PDOException(\sprintf('Pdo\Mysql::connect() cannot be used for connecting to the "%s" driver', $matches[1])) : $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
class Mysql extends \PDO
|
||||
{
|
||||
public const ATTR_COMPRESS = \PDO::MYSQL_ATTR_COMPRESS;
|
||||
public const ATTR_DIRECT_QUERY = \PDO::MYSQL_ATTR_DIRECT_QUERY;
|
||||
public const ATTR_FOUND_ROWS = \PDO::MYSQL_ATTR_FOUND_ROWS;
|
||||
public const ATTR_IGNORE_SPACE = \PDO::MYSQL_ATTR_IGNORE_SPACE;
|
||||
public const ATTR_INIT_COMMAND = \PDO::MYSQL_ATTR_INIT_COMMAND;
|
||||
public const ATTR_LOCAL_INFILE = \PDO::MYSQL_ATTR_LOCAL_INFILE;
|
||||
public const ATTR_LOCAL_INFILE_DIRECTORY = \PHP_VERSION_ID >= 80100 ? \PDO::MYSQL_ATTR_LOCAL_INFILE_DIRECTORY : 1015;
|
||||
// public const ATTR_MAX_BUFFER_SIZE = PDO::MYSQL_ATTR_MAX_BUFFER_SIZE; // disabled for mysqlnd
|
||||
public const ATTR_MULTI_STATEMENTS = \PDO::MYSQL_ATTR_MULTI_STATEMENTS;
|
||||
// public const ATTR_READ_DEFAULT_FILE = PDO::MYSQL_ATTR_READ_DEFAULT_FILE; // disabled for mysqlnd
|
||||
// public const ATTR_READ_DEFAULT_GROUP = PDO::MYSQL_ATTR_READ_DEFAULT_GROUP; // disabled for mysqlnd
|
||||
public const ATTR_SERVER_PUBLIC_KEY = \PDO::MYSQL_ATTR_SERVER_PUBLIC_KEY;
|
||||
public const ATTR_SSL_CA = \PDO::MYSQL_ATTR_SSL_CA;
|
||||
public const ATTR_SSL_CAPATH = \PDO::MYSQL_ATTR_SSL_CAPATH;
|
||||
public const ATTR_SSL_CERT = \PDO::MYSQL_ATTR_SSL_CERT;
|
||||
public const ATTR_SSL_CIPHER = \PDO::MYSQL_ATTR_SSL_CIPHER;
|
||||
public const ATTR_SSL_KEY = \PDO::MYSQL_ATTR_SSL_KEY;
|
||||
public const ATTR_USE_BUFFERED_QUERY = \PDO::MYSQL_ATTR_USE_BUFFERED_QUERY;
|
||||
|
||||
public function __construct(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null)
|
||||
{
|
||||
parent::__construct($dsn, $username, $password, $options);
|
||||
|
||||
if ('mysql' !== $driver = $this->getAttribute(\PDO::ATTR_DRIVER_NAME)) {
|
||||
throw new \PDOException(\sprintf('Pdo\Mysql::__construct() cannot be used for connecting to the "%s" driver', $driver));
|
||||
}
|
||||
}
|
||||
|
||||
public static function connect(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null): self
|
||||
{
|
||||
try {
|
||||
return new self($dsn, $username, $password, $options);
|
||||
} catch (\PDOException $e) {
|
||||
throw preg_match('/^Pdo\\\\Mysql::__construct\(\) cannot be used for connecting to the "([a-z]+)" driver/', $e->getMessage(), $matches) ? new \PDOException(\sprintf('Pdo\Mysql::connect() cannot be used for connecting to the "%s" driver', $matches[1])) : $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
41
plugins/vendor/symfony/polyfill-php84/Resources/stubs/Pdo/Odbc.php
vendored
Normal file
41
plugins/vendor/symfony/polyfill-php84/Resources/stubs/Pdo/Odbc.php
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Pdo;
|
||||
|
||||
if (\PHP_VERSION_ID < 80400 && \extension_loaded('pdo_odbc')) {
|
||||
class Odbc extends \PDO
|
||||
{
|
||||
public const ATTR_USE_CURSOR_LIBRARY = \PDO::ODBC_ATTR_USE_CURSOR_LIBRARY;
|
||||
public const ATTR_ASSUME_UTF8 = \PDO::ODBC_ATTR_ASSUME_UTF8;
|
||||
public const SQL_USE_IF_NEEDED = \PDO::ODBC_SQL_USE_IF_NEEDED;
|
||||
public const SQL_USE_DRIVER = \PDO::ODBC_SQL_USE_DRIVER;
|
||||
public const SQL_USE_ODBC = \PDO::ODBC_SQL_USE_ODBC;
|
||||
|
||||
public function __construct(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null)
|
||||
{
|
||||
parent::__construct($dsn, $username, $password, $options);
|
||||
|
||||
if ('odbc' !== $driver = $this->getAttribute(\PDO::ATTR_DRIVER_NAME)) {
|
||||
throw new \PDOException(\sprintf('Pdo\Odbc::__construct() cannot be used for connecting to the "%s" driver', $driver));
|
||||
}
|
||||
}
|
||||
|
||||
public static function connect(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null): self
|
||||
{
|
||||
try {
|
||||
return new self($dsn, $username, $password, $options);
|
||||
} catch (\PDOException $e) {
|
||||
throw preg_match('/^Pdo\\\\Odbc::__construct\(\) cannot be used for connecting to the "([a-z]+)" driver/', $e->getMessage(), $matches) ? new \PDOException(\sprintf('Pdo\Odbc::connect() cannot be used for connecting to the "%s" driver', $matches[1])) : $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
94
plugins/vendor/symfony/polyfill-php84/Resources/stubs/Pdo/Pgsql.php
vendored
Normal file
94
plugins/vendor/symfony/polyfill-php84/Resources/stubs/Pdo/Pgsql.php
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Pdo;
|
||||
|
||||
if (\PHP_VERSION_ID < 80400 && \extension_loaded('pdo_pgsql')) {
|
||||
class Pgsql extends \PDO
|
||||
{
|
||||
public const ATTR_DISABLE_PREPARES = \PDO::PGSQL_ATTR_DISABLE_PREPARES;
|
||||
|
||||
public function __construct(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null)
|
||||
{
|
||||
parent::__construct($dsn, $username, $password, $options);
|
||||
|
||||
if ('pgsql' !== $driver = $this->getAttribute(\PDO::ATTR_DRIVER_NAME)) {
|
||||
throw new \PDOException(\sprintf('Pdo\Pgsql::__construct() cannot be used for connecting to the "%s" driver', $driver));
|
||||
}
|
||||
}
|
||||
|
||||
public static function connect(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null): self
|
||||
{
|
||||
try {
|
||||
return new self($dsn, $username, $password, $options);
|
||||
} catch (\PDOException $e) {
|
||||
throw preg_match('/^Pdo\\\\Pgsql::__construct\(\) cannot be used for connecting to the "([a-z]+)" driver/', $e->getMessage(), $matches) ? new \PDOException(\sprintf('Pdo\Pgsql::connect() cannot be used for connecting to the "%s" driver', $matches[1])) : $e;
|
||||
}
|
||||
}
|
||||
|
||||
public function copyFromArray(string $tableName, array $rows, string $separator = "\t", string $nullAs = '\\\\N', ?string $fields = null): bool
|
||||
{
|
||||
return $this->pgsqlCopyFromArray($tableName, $rows, $separator, $nullAs, $fields);
|
||||
}
|
||||
|
||||
public function copyFromFile(string $tableName, string $filename, string $separator = "\t", string $nullAs = '\\\\N', ?string $fields = null): bool
|
||||
{
|
||||
return $this->pgsqlCopyFromFile($tableName, $filename, $separator, $nullAs, $fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array|false
|
||||
*/
|
||||
public function copyToArray(string $tableName, string $separator = "\t", string $nullAs = '\\\\N', ?string $fields = null)
|
||||
{
|
||||
return $this->pgsqlCopyToArray($tableName, $separator, $nullAs, $fields);
|
||||
}
|
||||
|
||||
public function copyToFile(string $tableName, string $filename, string $separator = "\t", string $nullAs = '\\\\N', ?string $fields = null): bool
|
||||
{
|
||||
return $this->pgsqlCopyToFile($tableName, $filename, $separator, $nullAs, $fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array|false
|
||||
*/
|
||||
public function getNotify(int $fetchMode = \PDO::FETCH_DEFAULT, int $timeoutMilliseconds = 0)
|
||||
{
|
||||
return $this->pgsqlGetNotify($fetchMode, $timeoutMilliseconds);
|
||||
}
|
||||
|
||||
public function getPid(): int
|
||||
{
|
||||
return $this->pgsqlGetPid();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|false
|
||||
*/
|
||||
public function lobCreate()
|
||||
{
|
||||
return $this->pgsqlLOBCreate();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return resource|false
|
||||
*/
|
||||
public function lobOpen(string $oid, string $mode = 'rb')
|
||||
{
|
||||
return $this->pgsqlLOBOpen($oid, $mode);
|
||||
}
|
||||
|
||||
public function lobUnlink(string $oid): bool
|
||||
{
|
||||
return $this->pgsqlLOBUnlink($oid);
|
||||
}
|
||||
}
|
||||
}
|
||||
58
plugins/vendor/symfony/polyfill-php84/Resources/stubs/Pdo/Sqlite.php
vendored
Normal file
58
plugins/vendor/symfony/polyfill-php84/Resources/stubs/Pdo/Sqlite.php
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Pdo;
|
||||
|
||||
if (\PHP_VERSION_ID < 80400 && \extension_loaded('pdo_sqlite')) {
|
||||
class Sqlite extends \PDO
|
||||
{
|
||||
public const ATTR_EXTENDED_RESULT_CODES = \PHP_VERSION_ID >= 70400 ? \PDO::SQLITE_ATTR_EXTENDED_RESULT_CODES : 1002;
|
||||
public const ATTR_OPEN_FLAGS = \PHP_VERSION_ID >= 70300 ? \PDO::SQLITE_ATTR_OPEN_FLAGS : 1000;
|
||||
public const ATTR_READONLY_STATEMENT = \PHP_VERSION_ID >= 70400 ? \PDO::SQLITE_ATTR_READONLY_STATEMENT : 1001;
|
||||
public const DETERMINISTIC = \PDO::SQLITE_DETERMINISTIC;
|
||||
public const OPEN_READONLY = \PHP_VERSION_ID >= 70300 ? \PDO::SQLITE_OPEN_READONLY : 1;
|
||||
public const OPEN_READWRITE = \PHP_VERSION_ID >= 70300 ? \PDO::SQLITE_OPEN_READWRITE : 2;
|
||||
public const OPEN_CREATE = \PHP_VERSION_ID >= 70300 ? \PDO::SQLITE_OPEN_CREATE : 4;
|
||||
|
||||
public function __construct(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null)
|
||||
{
|
||||
parent::__construct($dsn, $username, $password, $options);
|
||||
|
||||
if ('sqlite' !== $driver = $this->getAttribute(\PDO::ATTR_DRIVER_NAME)) {
|
||||
throw new \PDOException(\sprintf('Pdo\Sqlite::__construct() cannot be used for connecting to the "%s" driver', $driver));
|
||||
}
|
||||
}
|
||||
|
||||
public static function connect(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null): self
|
||||
{
|
||||
try {
|
||||
return new self($dsn, $username, $password, $options);
|
||||
} catch (\PDOException $e) {
|
||||
throw preg_match('/^Pdo\\\\Sqlite::__construct\(\) cannot be used for connecting to the "([a-z]+)" driver/', $e->getMessage(), $matches) ? new \PDOException(\sprintf('Pdo\Sqlite::connect() cannot be used for connecting to the "%s" driver', $matches[1])) : $e;
|
||||
}
|
||||
}
|
||||
|
||||
public function createAggregate(string $name, callable $step, callable $finalize, int $numArgs = -1): bool
|
||||
{
|
||||
return $this->sqliteCreateAggregate($name, $step, $finalize, $numArgs);
|
||||
}
|
||||
|
||||
public function createCollation(string $name, callable $callback): bool
|
||||
{
|
||||
return $this->sqliteCreateCollation($name, $callback);
|
||||
}
|
||||
|
||||
public function createFunction(string $function_name, callable $callback, int $num_args = -1, int $flags = 0): bool
|
||||
{
|
||||
return $this->sqliteCreateFunction($function_name, $callback, $num_args, $flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,9 +10,7 @@
|
||||
*/
|
||||
|
||||
if (\PHP_VERSION_ID < 80400) {
|
||||
/**
|
||||
* @author Daniel Scherzer <daniel.e.scherzer@gmail.com>
|
||||
*/
|
||||
// @author Daniel Scherzer <daniel.e.scherzer@gmail.com>
|
||||
final class ReflectionConstant
|
||||
{
|
||||
/**
|
||||
@@ -24,6 +22,7 @@ if (\PHP_VERSION_ID < 80400) {
|
||||
|
||||
private $value;
|
||||
private $deprecated;
|
||||
private $persistent;
|
||||
|
||||
private static $persistentConstants = [];
|
||||
|
||||
|
||||
44
plugins/vendor/symfony/polyfill-php84/Resources/stubs/RoundingMode.php
vendored
Normal file
44
plugins/vendor/symfony/polyfill-php84/Resources/stubs/RoundingMode.php
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
if (\PHP_VERSION_ID < 80100) {
|
||||
final class RoundingMode
|
||||
{
|
||||
const HalfAwayFromZero = 0;
|
||||
const HalfTowardsZero = 1;
|
||||
const HalfEven = 2;
|
||||
const HalfOdd = 3;
|
||||
const TowardsZero = 4;
|
||||
const AwayFromZero = 5;
|
||||
const NegativeInfinity = 6;
|
||||
const PositiveInfinity = 7;
|
||||
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public static function cases(): array
|
||||
{
|
||||
return [
|
||||
self::HalfAwayFromZero,
|
||||
self::HalfTowardsZero,
|
||||
self::HalfEven,
|
||||
self::HalfOdd,
|
||||
self::TowardsZero,
|
||||
self::AwayFromZero,
|
||||
self::NegativeInfinity,
|
||||
self::PositiveInfinity,
|
||||
];
|
||||
}
|
||||
}
|
||||
} elseif (\PHP_VERSION_ID < 80400) {
|
||||
require dirname(__DIR__).'/RoundingMode.php';
|
||||
}
|
||||
@@ -15,13 +15,17 @@ if (\PHP_VERSION_ID >= 80400) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (defined('CURL_VERSION_HTTP3') || PHP_VERSION_ID < 80200 && function_exists('curl_version') && curl_version()['version'] >= 0x074200) { // libcurl >= 7.66.0
|
||||
if (!defined('CURL_HTTP_VERSION_3')) {
|
||||
define('CURL_HTTP_VERSION_3', 30);
|
||||
}
|
||||
if (\extension_loaded('curl')) {
|
||||
// CURL_VERSION_HTTP3 is defined by PHP 8.2+ when libcurl >= 7.66.0
|
||||
if (defined('CURL_VERSION_HTTP3') || \PHP_VERSION_ID < 80200 && curl_version()['version_number'] >= 0x074200) {
|
||||
if (!defined('CURL_HTTP_VERSION_3')) {
|
||||
define('CURL_HTTP_VERSION_3', 30);
|
||||
}
|
||||
|
||||
if (!defined('CURL_HTTP_VERSION_3ONLY') && defined('CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256')) { // libcurl >= 7.80.0 (7.88 would be better but is slow to check)
|
||||
define('CURL_HTTP_VERSION_3ONLY', 31);
|
||||
// CURL_HTTP_VERSION_3ONLY requires libcurl >= 7.88.0 and is not gated by any PHP-defined constant before 8.4
|
||||
if (!defined('CURL_HTTP_VERSION_3ONLY') && curl_version()['version_number'] >= 0x075800) {
|
||||
define('CURL_HTTP_VERSION_3ONLY', 31);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,32 +49,45 @@ if (!function_exists('fpow')) {
|
||||
function fpow(float $num, float $exponent): float { return p\Php84::fpow($num, $exponent); }
|
||||
}
|
||||
|
||||
if (\PHP_VERSION_ID < 80000) {
|
||||
require __DIR__.'/bootstrap72.php';
|
||||
}
|
||||
|
||||
if (extension_loaded('mbstring')) {
|
||||
if (!function_exists('mb_ucfirst')) {
|
||||
function mb_ucfirst(string $string, ?string $encoding = null): string { return p\Php84::mb_ucfirst($string, $encoding); }
|
||||
function mb_ucfirst(?string $string, ?string $encoding = null): string { return p\Php84::mb_ucfirst((string) $string, $encoding); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_lcfirst')) {
|
||||
function mb_lcfirst(string $string, ?string $encoding = null): string { return p\Php84::mb_lcfirst($string, $encoding); }
|
||||
function mb_lcfirst(?string $string, ?string $encoding = null): string { return p\Php84::mb_lcfirst((string) $string, $encoding); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_trim')) {
|
||||
function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Php84::mb_trim($string, $characters, $encoding); }
|
||||
function mb_trim(?string $string, ?string $characters = null, ?string $encoding = null): string { return p\Php84::mb_trim((string) $string, $characters, $encoding); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_ltrim')) {
|
||||
function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Php84::mb_ltrim($string, $characters, $encoding); }
|
||||
function mb_ltrim(?string $string, ?string $characters = null, ?string $encoding = null): string { return p\Php84::mb_ltrim((string) $string, $characters, $encoding); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_rtrim')) {
|
||||
function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Php84::mb_rtrim($string, $characters, $encoding); }
|
||||
function mb_rtrim(?string $string, ?string $characters = null, ?string $encoding = null): string { return p\Php84::mb_rtrim((string) $string, $characters, $encoding); }
|
||||
}
|
||||
}
|
||||
|
||||
if (extension_loaded('bcmath')) {
|
||||
if (!function_exists('bcceil')) {
|
||||
function bcceil(string $num): string { return p\Php84::bcceil($num); }
|
||||
}
|
||||
if (!function_exists('bcdivmod')) {
|
||||
function bcdivmod(string $num1, string $num2, ?int $scale = null): ?array { return p\Php84::bcdivmod($num1, $num2, $scale); }
|
||||
}
|
||||
if (!function_exists('bcfloor')) {
|
||||
function bcfloor(string $num): string { return p\Php84::bcfloor($num); }
|
||||
}
|
||||
if (!function_exists('bcround')) {
|
||||
function bcround(string $num, int $precision = 0, $mode = RoundingMode::HalfAwayFromZero): string { return p\Php84::bcround($num, $precision, $mode); }
|
||||
}
|
||||
}
|
||||
|
||||
if (\PHP_VERSION_ID >= 80200) {
|
||||
|
||||
39
plugins/vendor/symfony/polyfill-php84/bootstrap72.php
vendored
Normal file
39
plugins/vendor/symfony/polyfill-php84/bootstrap72.php
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Symfony\Polyfill\Php84 as p;
|
||||
|
||||
if (extension_loaded('mbstring')) {
|
||||
if (!function_exists('mb_ucfirst')) {
|
||||
/** @return string|false */
|
||||
function mb_ucfirst(?string $string, ?string $encoding = null) { return p\Php84::mb_ucfirst((string) $string, $encoding); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_lcfirst')) {
|
||||
/** @return string|false */
|
||||
function mb_lcfirst(?string $string, ?string $encoding = null) { return p\Php84::mb_lcfirst((string) $string, $encoding); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_trim')) {
|
||||
/** @return string|false */
|
||||
function mb_trim(?string $string, ?string $characters = null, ?string $encoding = null) { return p\Php84::mb_trim((string) $string, $characters, $encoding); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_ltrim')) {
|
||||
/** @return string|false */
|
||||
function mb_ltrim(?string $string, ?string $characters = null, ?string $encoding = null) { return p\Php84::mb_ltrim((string) $string, $characters, $encoding); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_rtrim')) {
|
||||
/** @return string|false */
|
||||
function mb_rtrim(?string $string, ?string $characters = null, ?string $encoding = null) { return p\Php84::mb_rtrim((string) $string, $characters, $encoding); }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user