You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
2.2 KiB

3 years ago
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. use Symfony\Polyfill\Intl\Grapheme as p;
  11. if (extension_loaded('intl')) {
  12. return;
  13. }
  14. if (\PHP_VERSION_ID >= 80000) {
  15. return require __DIR__.'/bootstrap80.php';
  16. }
  17. if (!defined('GRAPHEME_EXTR_COUNT')) {
  18. define('GRAPHEME_EXTR_COUNT', 0);
  19. }
  20. if (!defined('GRAPHEME_EXTR_MAXBYTES')) {
  21. define('GRAPHEME_EXTR_MAXBYTES', 1);
  22. }
  23. if (!defined('GRAPHEME_EXTR_MAXCHARS')) {
  24. define('GRAPHEME_EXTR_MAXCHARS', 2);
  25. }
  26. if (!function_exists('grapheme_extract')) {
  27. function grapheme_extract($haystack, $size, $type = 0, $start = 0, &$next = 0) { return p\Grapheme::grapheme_extract($haystack, $size, $type, $start, $next); }
  28. }
  29. if (!function_exists('grapheme_stripos')) {
  30. function grapheme_stripos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_stripos($haystack, $needle, $offset); }
  31. }
  32. if (!function_exists('grapheme_stristr')) {
  33. function grapheme_stristr($haystack, $needle, $beforeNeedle = false) { return p\Grapheme::grapheme_stristr($haystack, $needle, $beforeNeedle); }
  34. }
  35. if (!function_exists('grapheme_strlen')) {
  36. function grapheme_strlen($input) { return p\Grapheme::grapheme_strlen($input); }
  37. }
  38. if (!function_exists('grapheme_strpos')) {
  39. function grapheme_strpos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_strpos($haystack, $needle, $offset); }
  40. }
  41. if (!function_exists('grapheme_strripos')) {
  42. function grapheme_strripos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_strripos($haystack, $needle, $offset); }
  43. }
  44. if (!function_exists('grapheme_strrpos')) {
  45. function grapheme_strrpos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_strrpos($haystack, $needle, $offset); }
  46. }
  47. if (!function_exists('grapheme_strstr')) {
  48. function grapheme_strstr($haystack, $needle, $beforeNeedle = false) { return p\Grapheme::grapheme_strstr($haystack, $needle, $beforeNeedle); }
  49. }
  50. if (!function_exists('grapheme_substr')) {
  51. function grapheme_substr($string, $offset, $length = null) { return p\Grapheme::grapheme_substr($string, $offset, $length); }
  52. }