-
-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #316 Verify the signature of polyfills on PHP >= 8 (nicolas-grekas)
This PR was merged into the 1.21-dev branch. Discussion ---------- Verify the signature of polyfills on PHP >= 8 Commits ------- 7c8190b Verify the signature of polyfills on PHP >= 8
- Loading branch information
Showing
21 changed files
with
748 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<?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\Apcu as p; | ||
|
||
if (extension_loaded('Zend Data Cache')) { | ||
if (!function_exists('apcu_add')) { | ||
function apcu_add($key, mixed $value, int $ttl = 0): array|bool { return p\Apcu::apcu_add($key, $value, $ttl); } | ||
} | ||
if (!function_exists('apcu_delete')) { | ||
function apcu_delete($key): array|bool { return p\Apcu::apcu_delete($key); } | ||
} | ||
if (!function_exists('apcu_exists')) { | ||
function apcu_exists($key): array|bool { return p\Apcu::apcu_exists($key); } | ||
} | ||
if (!function_exists('apcu_fetch')) { | ||
function apcu_fetch($key, &$success = null): mixed { return p\Apcu::apcu_fetch($key, $success); } | ||
} | ||
if (!function_exists('apcu_store')) { | ||
function apcu_store($key, mixed $value, int $ttl = 0): array|bool { return p\Apcu::apcu_store($key, $value, $ttl); } | ||
} | ||
} else { | ||
if (!function_exists('apcu_add')) { | ||
function apcu_add($key, mixed $value, int $ttl = 0): array|bool { return apc_add($key, $value, $ttl); } | ||
} | ||
if (!function_exists('apcu_delete')) { | ||
function apcu_delete($key): array|bool { return apc_delete($key); } | ||
} | ||
if (!function_exists('apcu_exists')) { | ||
function apcu_exists($key): array|bool { return apc_exists($key); } | ||
} | ||
if (!function_exists('apcu_fetch')) { | ||
function apcu_fetch($key, &$success = null) { return apc_fetch($key, $success); } | ||
} | ||
if (!function_exists('apcu_store')) { | ||
function apcu_store($key, mixed $value, int $ttl = 0): array|bool { return apc_store($key, $value, $ttl); } | ||
} | ||
} | ||
|
||
if (!function_exists('apcu_cache_info')) { | ||
function apcu_cache_info($limited = false) { return apc_cache_info('user', $limited); } | ||
} | ||
if (!function_exists('apcu_cas')) { | ||
function apcu_cas($key, $old, $new) { return apc_cas($key, $old, $new); } | ||
} | ||
if (!function_exists('apcu_clear_cache')) { | ||
function apcu_clear_cache() { return apc_clear_cache('user'); } | ||
} | ||
if (!function_exists('apcu_dec')) { | ||
function apcu_dec($key, $step = 1, &$success = false) { return apc_dec($key, $step, $success); } | ||
} | ||
if (!function_exists('apcu_inc')) { | ||
function apcu_inc($key, $step = 1, &$success = false) { return apc_inc($key, $step, $success); } | ||
} | ||
if (!function_exists('apcu_sma_info')) { | ||
function apcu_sma_info($limited = false) { return apc_sma_info($limited); } | ||
} | ||
|
||
if (!class_exists('APCuIterator', false) && class_exists('APCIterator', false)) { | ||
class APCuIterator extends APCIterator | ||
{ | ||
public function __construct($search = null, $format = APC_ITER_ALL, $chunk_size = 100, $list = APC_LIST_ACTIVE) | ||
{ | ||
parent::__construct('user', $search, $format, $chunk_size, $list); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?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\Ctype as p; | ||
|
||
if (!function_exists('ctype_alnum')) { | ||
function ctype_alnum(mixed $text): bool { return p\Ctype::ctype_alnum($text); } | ||
} | ||
if (!function_exists('ctype_alpha')) { | ||
function ctype_alpha(mixed $text): bool { return p\Ctype::ctype_alpha($text); } | ||
} | ||
if (!function_exists('ctype_cntrl')) { | ||
function ctype_cntrl(mixed $text): bool { return p\Ctype::ctype_cntrl($text); } | ||
} | ||
if (!function_exists('ctype_digit')) { | ||
function ctype_digit(mixed $text): bool { return p\Ctype::ctype_digit($text); } | ||
} | ||
if (!function_exists('ctype_graph')) { | ||
function ctype_graph(mixed $text): bool { return p\Ctype::ctype_graph($text); } | ||
} | ||
if (!function_exists('ctype_lower')) { | ||
function ctype_lower(mixed $text): bool { return p\Ctype::ctype_lower($text); } | ||
} | ||
if (!function_exists('ctype_print')) { | ||
function ctype_print(mixed $text): bool { return p\Ctype::ctype_print($text); } | ||
} | ||
if (!function_exists('ctype_punct')) { | ||
function ctype_punct(mixed $text): bool { return p\Ctype::ctype_punct($text); } | ||
} | ||
if (!function_exists('ctype_space')) { | ||
function ctype_space(mixed $text): bool { return p\Ctype::ctype_space($text); } | ||
} | ||
if (!function_exists('ctype_upper')) { | ||
function ctype_upper(mixed $text): bool { return p\Ctype::ctype_upper($text); } | ||
} | ||
if (!function_exists('ctype_xdigit')) { | ||
function ctype_xdigit(mixed $text): bool { return p\Ctype::ctype_xdigit($text); } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<?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\Iconv as p; | ||
|
||
if (!defined('ICONV_IMPL')) { | ||
define('ICONV_IMPL', 'Symfony'); | ||
} | ||
if (!defined('ICONV_VERSION')) { | ||
define('ICONV_VERSION', '1.0'); | ||
} | ||
if (!defined('ICONV_MIME_DECODE_STRICT')) { | ||
define('ICONV_MIME_DECODE_STRICT', 1); | ||
} | ||
if (!defined('ICONV_MIME_DECODE_CONTINUE_ON_ERROR')) { | ||
define('ICONV_MIME_DECODE_CONTINUE_ON_ERROR', 2); | ||
} | ||
|
||
if (!function_exists('iconv')) { | ||
function iconv(string $from_encoding, string $to_encoding, string $string): string|false { return p\Iconv::iconv($from_encoding, $to_encoding, $string); } | ||
} | ||
if (!function_exists('iconv_get_encoding')) { | ||
function iconv_get_encoding(string $type = 'all'): array|string|false { return p\Iconv::iconv_get_encoding($type); } | ||
} | ||
if (!function_exists('iconv_set_encoding')) { | ||
function iconv_set_encoding(string $type, string $encoding): bool { return p\Iconv::iconv_set_encoding($type, $encoding); } | ||
} | ||
if (!function_exists('iconv_mime_encode')) { | ||
function iconv_mime_encode(string $field_name, string $field_value, array $options = []): string|false { return p\Iconv::iconv_mime_encode($field_name, $field_value, $options); } | ||
} | ||
if (!function_exists('iconv_mime_decode_headers')) { | ||
function iconv_mime_decode_headers(string $headers, int $mode = 0, string $encoding = null): array|false { return p\Iconv::iconv_mime_decode_headers($headers, $mode, $encoding); } | ||
} | ||
|
||
if (extension_loaded('mbstring')) { | ||
if (!function_exists('iconv_strlen')) { | ||
function iconv_strlen(string $string, string $encoding = null): int|false { null === $encoding && $encoding = p\Iconv::$internalEncoding; return mb_strlen($string, $encoding); } | ||
} | ||
if (!function_exists('iconv_strpos')) { | ||
function iconv_strpos(string $haystack, string $needle, int $offset = 0, string $encoding = null): int|false { null === $encoding && $encoding = p\Iconv::$internalEncoding; return mb_strpos($haystack, $needle, $offset, $encoding); } | ||
} | ||
if (!function_exists('iconv_strrpos')) { | ||
function iconv_strrpos(string $haystack, string $needle, string $encoding = null): int|false { null === $encoding && $encoding = p\Iconv::$internalEncoding; return mb_strrpos($haystack, $needle, 0, $encoding); } | ||
} | ||
if (!function_exists('iconv_substr')) { | ||
function iconv_substr(string $string, int $offset, int $length = null, string $encoding = null): string|false { null === $encoding && $encoding = p\Iconv::$internalEncoding; return mb_substr($string, $offset, $length, $encoding); } | ||
} | ||
if (!function_exists('iconv_mime_decode')) { | ||
function iconv_mime_decode($string, $mode = 0, $encoding = null) { null === $encoding && $encoding = p\Iconv::$internalEncoding; return mb_decode_mimeheader($string, $mode, $encoding); } | ||
} | ||
} else { | ||
if (!function_exists('iconv_strlen')) { | ||
if (extension_loaded('xml')) { | ||
function iconv_strlen(string $string, string $encoding = null): int|false { return p\Iconv::strlen1($string, $encoding); } | ||
} else { | ||
function iconv_strlen(string $string, string $encoding = null): int|false { return p\Iconv::strlen2($string, $encoding); } | ||
} | ||
} | ||
|
||
if (!function_exists('iconv_strpos')) { | ||
function iconv_strpos(string $haystack, string $needle, int $offset = 0, string $encoding = null): int|false { return p\Iconv::iconv_strpos($haystack, $needle, $offset, $encoding); } | ||
} | ||
if (!function_exists('iconv_strrpos')) { | ||
function iconv_strrpos(string $haystack, string $needle, string $encoding = null): int|false { return p\Iconv::iconv_strrpos($haystack, $needle, $encoding); } | ||
} | ||
if (!function_exists('iconv_substr')) { | ||
function iconv_substr(string $string, int $offset, int $length = null, string $encoding = null): string|false { return p\Iconv::iconv_substr($string, $offset, $length, $encoding); } | ||
} | ||
if (!function_exists('iconv_mime_decode')) { | ||
function iconv_mime_decode(string $string, int $mode = 0, string $encoding = null): string|false { return p\Iconv::iconv_mime_decode($string, $mode, $encoding); } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.