bootstrap.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 (!defined('GRAPHEME_EXTR_COUNT')) {
  15. define('GRAPHEME_EXTR_COUNT', 0);
  16. }
  17. if (!defined('GRAPHEME_EXTR_MAXBYTES')) {
  18. define('GRAPHEME_EXTR_MAXBYTES', 1);
  19. }
  20. if (!defined('GRAPHEME_EXTR_MAXCHARS')) {
  21. define('GRAPHEME_EXTR_MAXCHARS', 2);
  22. }
  23. if (!function_exists('grapheme_extract')) {
  24. function grapheme_extract($s, $size, $type = 0, $start = 0, &$next = 0) { return p\Grapheme::grapheme_extract($s, $size, $type, $start, $next); }
  25. }
  26. if (!function_exists('grapheme_stripos')) {
  27. function grapheme_stripos($s, $needle, $offset = 0) { return p\Grapheme::grapheme_stripos($s, $needle, $offset); }
  28. }
  29. if (!function_exists('grapheme_stristr')) {
  30. function grapheme_stristr($s, $needle, $beforeNeedle = false) { return p\Grapheme::grapheme_stristr($s, $needle, $beforeNeedle); }
  31. }
  32. if (!function_exists('grapheme_strlen')) {
  33. function grapheme_strlen($s) { return p\Grapheme::grapheme_strlen($s); }
  34. }
  35. if (!function_exists('grapheme_strpos')) {
  36. function grapheme_strpos($s, $needle, $offset = 0) { return p\Grapheme::grapheme_strpos($s, $needle, $offset); }
  37. }
  38. if (!function_exists('grapheme_strripos')) {
  39. function grapheme_strripos($s, $needle, $offset = 0) { return p\Grapheme::grapheme_strripos($s, $needle, $offset); }
  40. }
  41. if (!function_exists('grapheme_strrpos')) {
  42. function grapheme_strrpos($s, $needle, $offset = 0) { return p\Grapheme::grapheme_strrpos($s, $needle, $offset); }
  43. }
  44. if (!function_exists('grapheme_strstr')) {
  45. function grapheme_strstr($s, $needle, $beforeNeedle = false) { return p\Grapheme::grapheme_strstr($s, $needle, $beforeNeedle); }
  46. }
  47. if (!function_exists('grapheme_substr')) {
  48. function grapheme_substr($s, $start, $len = 2147483647) { return p\Grapheme::grapheme_substr($s, $start, $len); }
  49. }