1<?php
2
3/*
4 * Copyright (C) 2016 Nicolas Grekas - p@tchwork.com
5 *
6 * This library is free software; you can redistribute it and/or modify it
7 * under the terms of the (at your option):
8 * Apache License v2.0 (http://apache.org/licenses/LICENSE-2.0.txt), or
9 * GNU General Public License v2.0 (http://gnu.org/licenses/gpl-2.0.txt).
10 */
11
12use Patchwork\PHP\Shim as s;
13
14const GRAPHEME_EXTR_COUNT = 0;
15const GRAPHEME_EXTR_MAXBYTES = 1;
16const GRAPHEME_EXTR_MAXCHARS = 2;
17
18@trigger_error('You are using a fallback implementation of the intl extension. Installing the native one is highly recommended instead.', E_USER_DEPRECATED);
19
20if (!function_exists('normalizer_is_normalized')) {
21    function normalizer_is_normalized($s, $form = s\Normalizer::NFC) {return s\Normalizer::isNormalized($s, $form);}
22}
23if (!function_exists('normalizer_normalize')) {
24    function normalizer_normalize($s, $form = s\Normalizer::NFC) {return s\Normalizer::normalize($s, $form);}
25}
26
27function grapheme_extract($s, $size, $type = 0, $start = 0, &$next = 0) {return s\Intl::grapheme_extract($s, $size, $type, $start, $next);}
28function grapheme_stripos($s, $needle, $offset = 0) {return s\Intl::grapheme_stripos($s, $needle, $offset);}
29function grapheme_stristr($s, $needle, $before_needle = false) {return s\Intl::grapheme_stristr($s, $needle, $before_needle);}
30function grapheme_strlen($s) {return s\Intl::grapheme_strlen($s);}
31function grapheme_strpos($s, $needle, $offset = 0) {return s\Intl::grapheme_strpos($s, $needle, $offset);}
32function grapheme_strripos($s, $needle, $offset = 0) {return s\Intl::grapheme_strripos($s, $needle, $offset);}
33function grapheme_strrpos($s, $needle, $offset = 0) {return s\Intl::grapheme_strrpos($s, $needle, $offset);}
34function grapheme_strstr($s, $needle, $before_needle = false) {return s\Intl::grapheme_strstr($s, $needle, $before_needle);}
35function grapheme_substr($s, $start, $len = 2147483647) {return s\Intl::grapheme_substr($s, $start, $len);}
36