Grapheme.php
9 months ago
bootstrap.php
9 months ago
bootstrap80.php
9 months ago
index.php
2 years ago
bootstrap80.php
77 lines
| 1 | <?php |
| 2 | namespace MailPoetVendor; |
| 3 | if (!defined('ABSPATH')) exit; |
| 4 | use MailPoetVendor\Symfony\Polyfill\Intl\Grapheme as p; |
| 5 | if (!\function_exists('MailPoetVendor\\grapheme_str_split')) { |
| 6 | function grapheme_str_split(string $string, int $length = 1) : array|false |
| 7 | { |
| 8 | return p\Grapheme::grapheme_str_split($string, $length); |
| 9 | } |
| 10 | } |
| 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(?string $haystack, ?int $size, ?int $type = \GRAPHEME_EXTR_COUNT, ?int $offset = 0, &$next = null) |
| 25 | { |
| 26 | return p\Grapheme::grapheme_extract((string) $haystack, (int) $size, (int) $type, (int) $offset, $next); |
| 27 | } |
| 28 | } |
| 29 | if (!\function_exists('grapheme_stripos')) { |
| 30 | function grapheme_stripos(?string $haystack, ?string $needle, ?int $offset = 0) |
| 31 | { |
| 32 | return p\Grapheme::grapheme_stripos((string) $haystack, (string) $needle, (int) $offset); |
| 33 | } |
| 34 | } |
| 35 | if (!\function_exists('grapheme_stristr')) { |
| 36 | function grapheme_stristr(?string $haystack, ?string $needle, ?bool $beforeNeedle = \false) |
| 37 | { |
| 38 | return p\Grapheme::grapheme_stristr((string) $haystack, (string) $needle, (bool) $beforeNeedle); |
| 39 | } |
| 40 | } |
| 41 | if (!\function_exists('grapheme_strlen')) { |
| 42 | function grapheme_strlen(?string $string) |
| 43 | { |
| 44 | return p\Grapheme::grapheme_strlen((string) $string); |
| 45 | } |
| 46 | } |
| 47 | if (!\function_exists('grapheme_strpos')) { |
| 48 | function grapheme_strpos(?string $haystack, ?string $needle, ?int $offset = 0) |
| 49 | { |
| 50 | return p\Grapheme::grapheme_strpos((string) $haystack, (string) $needle, (int) $offset); |
| 51 | } |
| 52 | } |
| 53 | if (!\function_exists('grapheme_strripos')) { |
| 54 | function grapheme_strripos(?string $haystack, ?string $needle, ?int $offset = 0) |
| 55 | { |
| 56 | return p\Grapheme::grapheme_strripos((string) $haystack, (string) $needle, (int) $offset); |
| 57 | } |
| 58 | } |
| 59 | if (!\function_exists('grapheme_strrpos')) { |
| 60 | function grapheme_strrpos(?string $haystack, ?string $needle, ?int $offset = 0) |
| 61 | { |
| 62 | return p\Grapheme::grapheme_strrpos((string) $haystack, (string) $needle, (int) $offset); |
| 63 | } |
| 64 | } |
| 65 | if (!\function_exists('grapheme_strstr')) { |
| 66 | function grapheme_strstr(?string $haystack, ?string $needle, ?bool $beforeNeedle = \false) |
| 67 | { |
| 68 | return p\Grapheme::grapheme_strstr((string) $haystack, (string) $needle, (bool) $beforeNeedle); |
| 69 | } |
| 70 | } |
| 71 | if (!\function_exists('grapheme_substr')) { |
| 72 | function grapheme_substr(?string $string, ?int $offset, ?int $length = null) |
| 73 | { |
| 74 | return p\Grapheme::grapheme_substr((string) $string, (int) $offset, $length); |
| 75 | } |
| 76 | } |
| 77 |