/wp-content/plugins/google-calendar-events/third-party/symfony/polyfill-mbstring/bootstrap.php

https://github.com/livinglab/openlab · PHP · 257 lines · 247 code · 2 blank · 8 comment · 43 complexity · 510d880a2a441a4e801762345e7b650f MD5 · raw file

  1. <?php
  2. namespace SimpleCalendar\plugin_deps;
  3. /*
  4. * This file is part of the Symfony package.
  5. *
  6. * (c) Fabien Potencier <fabien@symfony.com>
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. use SimpleCalendar\plugin_deps\Symfony\Polyfill\Mbstring as p;
  12. if (\PHP_VERSION_ID >= 80000) {
  13. return require __DIR__ . '/bootstrap80.php';
  14. }
  15. if (!\function_exists('mb_convert_encoding')) {
  16. function mb_convert_encoding($string, $to_encoding, $from_encoding = null)
  17. {
  18. return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding);
  19. }
  20. }
  21. if (!\function_exists('mb_decode_mimeheader')) {
  22. function mb_decode_mimeheader($string)
  23. {
  24. return p\Mbstring::mb_decode_mimeheader($string);
  25. }
  26. }
  27. if (!\function_exists('mb_encode_mimeheader')) {
  28. function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = "\r\n", $indent = 0)
  29. {
  30. return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent);
  31. }
  32. }
  33. if (!\function_exists('mb_decode_numericentity')) {
  34. function mb_decode_numericentity($string, $map, $encoding = null)
  35. {
  36. return p\Mbstring::mb_decode_numericentity($string, $map, $encoding);
  37. }
  38. }
  39. if (!\function_exists('mb_encode_numericentity')) {
  40. function mb_encode_numericentity($string, $map, $encoding = null, $hex = \false)
  41. {
  42. return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex);
  43. }
  44. }
  45. if (!\function_exists('mb_convert_case')) {
  46. function mb_convert_case($string, $mode, $encoding = null)
  47. {
  48. return p\Mbstring::mb_convert_case($string, $mode, $encoding);
  49. }
  50. }
  51. if (!\function_exists('mb_internal_encoding')) {
  52. function mb_internal_encoding($encoding = null)
  53. {
  54. return p\Mbstring::mb_internal_encoding($encoding);
  55. }
  56. }
  57. if (!\function_exists('mb_language')) {
  58. function mb_language($language = null)
  59. {
  60. return p\Mbstring::mb_language($language);
  61. }
  62. }
  63. if (!\function_exists('mb_list_encodings')) {
  64. function mb_list_encodings()
  65. {
  66. return p\Mbstring::mb_list_encodings();
  67. }
  68. }
  69. if (!\function_exists('mb_encoding_aliases')) {
  70. function mb_encoding_aliases($encoding)
  71. {
  72. return p\Mbstring::mb_encoding_aliases($encoding);
  73. }
  74. }
  75. if (!\function_exists('mb_check_encoding')) {
  76. function mb_check_encoding($value = null, $encoding = null)
  77. {
  78. return p\Mbstring::mb_check_encoding($value, $encoding);
  79. }
  80. }
  81. if (!\function_exists('mb_detect_encoding')) {
  82. function mb_detect_encoding($string, $encodings = null, $strict = \false)
  83. {
  84. return p\Mbstring::mb_detect_encoding($string, $encodings, $strict);
  85. }
  86. }
  87. if (!\function_exists('mb_detect_order')) {
  88. function mb_detect_order($encoding = null)
  89. {
  90. return p\Mbstring::mb_detect_order($encoding);
  91. }
  92. }
  93. if (!\function_exists('mb_parse_str')) {
  94. function mb_parse_str($string, &$result = [])
  95. {
  96. \parse_str($string, $result);
  97. }
  98. }
  99. if (!\function_exists('mb_strlen')) {
  100. function mb_strlen($string, $encoding = null)
  101. {
  102. return p\Mbstring::mb_strlen($string, $encoding);
  103. }
  104. }
  105. if (!\function_exists('mb_strpos')) {
  106. function mb_strpos($haystack, $needle, $offset = 0, $encoding = null)
  107. {
  108. return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding);
  109. }
  110. }
  111. if (!\function_exists('mb_strtolower')) {
  112. function mb_strtolower($string, $encoding = null)
  113. {
  114. return p\Mbstring::mb_strtolower($string, $encoding);
  115. }
  116. }
  117. if (!\function_exists('mb_strtoupper')) {
  118. function mb_strtoupper($string, $encoding = null)
  119. {
  120. return p\Mbstring::mb_strtoupper($string, $encoding);
  121. }
  122. }
  123. if (!\function_exists('mb_substitute_character')) {
  124. function mb_substitute_character($substitute_character = null)
  125. {
  126. return p\Mbstring::mb_substitute_character($substitute_character);
  127. }
  128. }
  129. if (!\function_exists('mb_substr')) {
  130. function mb_substr($string, $start, $length = 2147483647, $encoding = null)
  131. {
  132. return p\Mbstring::mb_substr($string, $start, $length, $encoding);
  133. }
  134. }
  135. if (!\function_exists('mb_stripos')) {
  136. function mb_stripos($haystack, $needle, $offset = 0, $encoding = null)
  137. {
  138. return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding);
  139. }
  140. }
  141. if (!\function_exists('mb_stristr')) {
  142. function mb_stristr($haystack, $needle, $before_needle = \false, $encoding = null)
  143. {
  144. return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding);
  145. }
  146. }
  147. if (!\function_exists('mb_strrchr')) {
  148. function mb_strrchr($haystack, $needle, $before_needle = \false, $encoding = null)
  149. {
  150. return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding);
  151. }
  152. }
  153. if (!\function_exists('mb_strrichr')) {
  154. function mb_strrichr($haystack, $needle, $before_needle = \false, $encoding = null)
  155. {
  156. return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding);
  157. }
  158. }
  159. if (!\function_exists('mb_strripos')) {
  160. function mb_strripos($haystack, $needle, $offset = 0, $encoding = null)
  161. {
  162. return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding);
  163. }
  164. }
  165. if (!\function_exists('mb_strrpos')) {
  166. function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null)
  167. {
  168. return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding);
  169. }
  170. }
  171. if (!\function_exists('mb_strstr')) {
  172. function mb_strstr($haystack, $needle, $before_needle = \false, $encoding = null)
  173. {
  174. return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding);
  175. }
  176. }
  177. if (!\function_exists('mb_get_info')) {
  178. function mb_get_info($type = 'all')
  179. {
  180. return p\Mbstring::mb_get_info($type);
  181. }
  182. }
  183. if (!\function_exists('mb_http_output')) {
  184. function mb_http_output($encoding = null)
  185. {
  186. return p\Mbstring::mb_http_output($encoding);
  187. }
  188. }
  189. if (!\function_exists('mb_strwidth')) {
  190. function mb_strwidth($string, $encoding = null)
  191. {
  192. return p\Mbstring::mb_strwidth($string, $encoding);
  193. }
  194. }
  195. if (!\function_exists('mb_substr_count')) {
  196. function mb_substr_count($haystack, $needle, $encoding = null)
  197. {
  198. return p\Mbstring::mb_substr_count($haystack, $needle, $encoding);
  199. }
  200. }
  201. if (!\function_exists('mb_output_handler')) {
  202. function mb_output_handler($string, $status)
  203. {
  204. return p\Mbstring::mb_output_handler($string, $status);
  205. }
  206. }
  207. if (!\function_exists('mb_http_input')) {
  208. function mb_http_input($type = null)
  209. {
  210. return p\Mbstring::mb_http_input($type);
  211. }
  212. }
  213. if (!\function_exists('mb_convert_variables')) {
  214. function mb_convert_variables($to_encoding, $from_encoding, &...$vars)
  215. {
  216. return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, ...$vars);
  217. }
  218. }
  219. if (!\function_exists('mb_ord')) {
  220. function mb_ord($string, $encoding = null)
  221. {
  222. return p\Mbstring::mb_ord($string, $encoding);
  223. }
  224. }
  225. if (!\function_exists('mb_chr')) {
  226. function mb_chr($codepoint, $encoding = null)
  227. {
  228. return p\Mbstring::mb_chr($codepoint, $encoding);
  229. }
  230. }
  231. if (!\function_exists('mb_scrub')) {
  232. function mb_scrub($string, $encoding = null)
  233. {
  234. $encoding = null === $encoding ? \mb_internal_encoding() : $encoding;
  235. return \mb_convert_encoding($string, $encoding, $encoding);
  236. }
  237. }
  238. if (!\function_exists('mb_str_split')) {
  239. function mb_str_split($string, $length = 1, $encoding = null)
  240. {
  241. return p\Mbstring::mb_str_split($string, $length, $encoding);
  242. }
  243. }
  244. if (\extension_loaded('mbstring')) {
  245. return;
  246. }
  247. if (!\defined('MB_CASE_UPPER')) {
  248. \define('MB_CASE_UPPER', 0);
  249. }
  250. if (!\defined('MB_CASE_LOWER')) {
  251. \define('MB_CASE_LOWER', 1);
  252. }
  253. if (!\defined('MB_CASE_TITLE')) {
  254. \define('MB_CASE_TITLE', 2);
  255. }