审查视图

vendor/symfony/polyfill-mbstring/bootstrap.php 7.2 KB
王智 authored
1 2 3 4 5 6 7 8 9 10 11 12 13 14
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

use Symfony\Polyfill\Mbstring as p;

if (!function_exists('mb_convert_encoding')) {
王智 authored
15
    function mb_convert_encoding($string, $to_encoding, $from_encoding = null) { return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding); }
王智 authored
16 17
}
if (!function_exists('mb_decode_mimeheader')) {
王智 authored
18
    function mb_decode_mimeheader($string) { return p\Mbstring::mb_decode_mimeheader($string); }
王智 authored
19 20
}
if (!function_exists('mb_encode_mimeheader')) {
王智 authored
21
    function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = null, $indent = null) { return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); }
王智 authored
22 23
}
if (!function_exists('mb_decode_numericentity')) {
王智 authored
24
    function mb_decode_numericentity($string, $map, $encoding = null) { return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); }
王智 authored
25 26
}
if (!function_exists('mb_encode_numericentity')) {
王智 authored
27
    function mb_encode_numericentity($string, $map, $encoding = null, $hex = false) { return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex); }
王智 authored
28 29
}
if (!function_exists('mb_convert_case')) {
王智 authored
30
    function mb_convert_case($string, $mode, $encoding = null) { return p\Mbstring::mb_convert_case($string, $mode, $encoding); }
王智 authored
31 32
}
if (!function_exists('mb_internal_encoding')) {
王智 authored
33
    function mb_internal_encoding($encoding = null) { return p\Mbstring::mb_internal_encoding($encoding); }
王智 authored
34 35
}
if (!function_exists('mb_language')) {
王智 authored
36
    function mb_language($language = null) { return p\Mbstring::mb_language($language); }
王智 authored
37 38 39 40 41 42 43 44
}
if (!function_exists('mb_list_encodings')) {
    function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); }
}
if (!function_exists('mb_encoding_aliases')) {
    function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); }
}
if (!function_exists('mb_check_encoding')) {
王智 authored
45
    function mb_check_encoding($value = null, $encoding = null) { return p\Mbstring::mb_check_encoding($value, $encoding); }
王智 authored
46 47
}
if (!function_exists('mb_detect_encoding')) {
王智 authored
48
    function mb_detect_encoding($string, $encodings = null, $strict = false) { return p\Mbstring::mb_detect_encoding($string, $encodings, $strict); }
王智 authored
49 50
}
if (!function_exists('mb_detect_order')) {
王智 authored
51
    function mb_detect_order($encoding = null) { return p\Mbstring::mb_detect_order($encoding); }
王智 authored
52 53
}
if (!function_exists('mb_parse_str')) {
王智 authored
54
    function mb_parse_str($string, &$result = array()) { parse_str($string, $result); }
王智 authored
55 56
}
if (!function_exists('mb_strlen')) {
王智 authored
57
    function mb_strlen($string, $encoding = null) { return p\Mbstring::mb_strlen($string, $encoding); }
王智 authored
58 59
}
if (!function_exists('mb_strpos')) {
王智 authored
60
    function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding); }
王智 authored
61 62
}
if (!function_exists('mb_strtolower')) {
王智 authored
63
    function mb_strtolower($string, $encoding = null) { return p\Mbstring::mb_strtolower($string, $encoding); }
王智 authored
64 65
}
if (!function_exists('mb_strtoupper')) {
王智 authored
66
    function mb_strtoupper($string, $encoding = null) { return p\Mbstring::mb_strtoupper($string, $encoding); }
王智 authored
67 68
}
if (!function_exists('mb_substitute_character')) {
王智 authored
69
    function mb_substitute_character($substitute_character = null) { return p\Mbstring::mb_substitute_character($substitute_character); }
王智 authored
70 71
}
if (!function_exists('mb_substr')) {
王智 authored
72
    function mb_substr($string, $start, $length = 2147483647, $encoding = null) { return p\Mbstring::mb_substr($string, $start, $length, $encoding); }
王智 authored
73 74
}
if (!function_exists('mb_stripos')) {
王智 authored
75
    function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding); }
王智 authored
76 77
}
if (!function_exists('mb_stristr')) {
王智 authored
78
    function mb_stristr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding); }
王智 authored
79 80
}
if (!function_exists('mb_strrchr')) {
王智 authored
81
    function mb_strrchr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding); }
王智 authored
82 83
}
if (!function_exists('mb_strrichr')) {
王智 authored
84
    function mb_strrichr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding); }
王智 authored
85 86
}
if (!function_exists('mb_strripos')) {
王智 authored
87
    function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding); }
王智 authored
88 89
}
if (!function_exists('mb_strrpos')) {
王智 authored
90
    function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding); }
王智 authored
91 92
}
if (!function_exists('mb_strstr')) {
王智 authored
93
    function mb_strstr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding); }
王智 authored
94 95 96 97 98
}
if (!function_exists('mb_get_info')) {
    function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); }
}
if (!function_exists('mb_http_output')) {
王智 authored
99
    function mb_http_output($encoding = null) { return p\Mbstring::mb_http_output($encoding); }
王智 authored
100 101
}
if (!function_exists('mb_strwidth')) {
王智 authored
102
    function mb_strwidth($string, $encoding = null) { return p\Mbstring::mb_strwidth($string, $encoding); }
王智 authored
103 104
}
if (!function_exists('mb_substr_count')) {
王智 authored
105
    function mb_substr_count($haystack, $needle, $encoding = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $encoding); }
王智 authored
106 107
}
if (!function_exists('mb_output_handler')) {
王智 authored
108
    function mb_output_handler($string, $status) { return p\Mbstring::mb_output_handler($string, $status); }
王智 authored
109 110 111 112
}
if (!function_exists('mb_http_input')) {
    function mb_http_input($type = '') { return p\Mbstring::mb_http_input($type); }
}
王智 authored
113
王智 authored
114
if (!function_exists('mb_convert_variables')) {
王智 authored
115 116 117 118 119
    if (PHP_VERSION_ID >= 80000) {
        function mb_convert_variables($to_encoding, $from_encoding, &$var, &...$vars) { return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, $var, ...$vars); }
    } else {
        function mb_convert_variables($to_encoding, $from_encoding, &...$vars) { return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, ...$vars); }
    }
王智 authored
120
}
王智 authored
121
王智 authored
122
if (!function_exists('mb_ord')) {
王智 authored
123
    function mb_ord($string, $encoding = null) { return p\Mbstring::mb_ord($string, $encoding); }
王智 authored
124 125
}
if (!function_exists('mb_chr')) {
王智 authored
126
    function mb_chr($codepoint, $encoding = null) { return p\Mbstring::mb_chr($codepoint, $encoding); }
王智 authored
127 128
}
if (!function_exists('mb_scrub')) {
王智 authored
129
    function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); }
王智 authored
130 131
}
if (!function_exists('mb_str_split')) {
王智 authored
132
    function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); }
王智 authored
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
}

if (extension_loaded('mbstring')) {
    return;
}

if (!defined('MB_CASE_UPPER')) {
    define('MB_CASE_UPPER', 0);
}
if (!defined('MB_CASE_LOWER')) {
    define('MB_CASE_LOWER', 1);
}
if (!defined('MB_CASE_TITLE')) {
    define('MB_CASE_TITLE', 2);
}