bootstrap80.php 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 (!defined('GRAPHEME_EXTR_COUNT')) {
  12. define('GRAPHEME_EXTR_COUNT', 0);
  13. }
  14. if (!defined('GRAPHEME_EXTR_MAXBYTES')) {
  15. define('GRAPHEME_EXTR_MAXBYTES', 1);
  16. }
  17. if (!defined('GRAPHEME_EXTR_MAXCHARS')) {
  18. define('GRAPHEME_EXTR_MAXCHARS', 2);
  19. }
  20. if (!function_exists('grapheme_extract')) {
  21. /**
  22. * @return string|false
  23. */
  24. function grapheme_extract($haystack, $size, $type = GRAPHEME_EXTR_COUNT, $offset = 0, &$next = null) { return p\Grapheme::grapheme_extract((string) $haystack, (int) $size, (int) $type, (int) $offset, $next); }
  25. }
  26. if (!function_exists('grapheme_stripos')) {
  27. /**
  28. * @return int|false
  29. */
  30. function grapheme_stripos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_stripos((string) $haystack, (string) $needle, (int) $offset); }
  31. }
  32. if (!function_exists('grapheme_stristr')) {
  33. /**
  34. * @return string|false
  35. */
  36. function grapheme_stristr($haystack, $needle, $beforeNeedle = false) { return p\Grapheme::grapheme_stristr((string) $haystack, (string) $needle, (bool) $beforeNeedle); }
  37. }
  38. if (!function_exists('grapheme_strlen')) {
  39. /**
  40. * @return int|false|null
  41. */
  42. function grapheme_strlen($string) { return p\Grapheme::grapheme_strlen((string) $string); }
  43. }
  44. if (!function_exists('grapheme_strpos')) {
  45. /**
  46. * @return int|false
  47. */
  48. function grapheme_strpos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_strpos((string) $haystack, (string) $needle, (int) $offset); }
  49. }
  50. if (!function_exists('grapheme_strripos')) {
  51. /**
  52. * @return int|false
  53. */
  54. function grapheme_strripos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_strripos((string) $haystack, (string) $needle, (int) $offset); }
  55. }
  56. if (!function_exists('grapheme_strrpos')) {
  57. /**
  58. * @return int|false
  59. */
  60. function grapheme_strrpos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_strrpos((string) $haystack, (string) $needle, (int) $offset); }
  61. }
  62. if (!function_exists('grapheme_strstr')) {
  63. /**
  64. * @return string|false
  65. */
  66. function grapheme_strstr($haystack, $needle, $beforeNeedle = false) { return p\Grapheme::grapheme_strstr((string) $haystack, (string) $needle, (bool) $beforeNeedle); }
  67. }
  68. if (!function_exists('grapheme_substr')) {
  69. /**
  70. * @return string|false
  71. */
  72. function grapheme_substr($string, $offset, $length = null) { return p\Grapheme::grapheme_substr((string) $string, (int) $offset, $length); }
  73. }