krz/vox-populi

A Tumblr web client.

clone: git clone https://gitbay.org/krz/vox-populi.git

main: vendor/symfony/polyfill-intl-idn/bootstrap.php · raw

  1<?php
  2
  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
 12use Symfony\Polyfill\Intl\Idn as p;
 13
 14if (extension_loaded('intl')) {
 15    return;
 16}
 17
 18if (!defined('U_IDNA_PROHIBITED_ERROR')) {
 19    define('U_IDNA_PROHIBITED_ERROR', 66560);
 20}
 21if (!defined('U_IDNA_ERROR_START')) {
 22    define('U_IDNA_ERROR_START', 66560);
 23}
 24if (!defined('U_IDNA_UNASSIGNED_ERROR')) {
 25    define('U_IDNA_UNASSIGNED_ERROR', 66561);
 26}
 27if (!defined('U_IDNA_CHECK_BIDI_ERROR')) {
 28    define('U_IDNA_CHECK_BIDI_ERROR', 66562);
 29}
 30if (!defined('U_IDNA_STD3_ASCII_RULES_ERROR')) {
 31    define('U_IDNA_STD3_ASCII_RULES_ERROR', 66563);
 32}
 33if (!defined('U_IDNA_ACE_PREFIX_ERROR')) {
 34    define('U_IDNA_ACE_PREFIX_ERROR', 66564);
 35}
 36if (!defined('U_IDNA_VERIFICATION_ERROR')) {
 37    define('U_IDNA_VERIFICATION_ERROR', 66565);
 38}
 39if (!defined('U_IDNA_LABEL_TOO_LONG_ERROR')) {
 40    define('U_IDNA_LABEL_TOO_LONG_ERROR', 66566);
 41}
 42if (!defined('U_IDNA_ZERO_LENGTH_LABEL_ERROR')) {
 43    define('U_IDNA_ZERO_LENGTH_LABEL_ERROR', 66567);
 44}
 45if (!defined('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR')) {
 46    define('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR', 66568);
 47}
 48if (!defined('U_IDNA_ERROR_LIMIT')) {
 49    define('U_IDNA_ERROR_LIMIT', 66569);
 50}
 51if (!defined('U_STRINGPREP_PROHIBITED_ERROR')) {
 52    define('U_STRINGPREP_PROHIBITED_ERROR', 66560);
 53}
 54if (!defined('U_STRINGPREP_UNASSIGNED_ERROR')) {
 55    define('U_STRINGPREP_UNASSIGNED_ERROR', 66561);
 56}
 57if (!defined('U_STRINGPREP_CHECK_BIDI_ERROR')) {
 58    define('U_STRINGPREP_CHECK_BIDI_ERROR', 66562);
 59}
 60if (!defined('IDNA_DEFAULT')) {
 61    define('IDNA_DEFAULT', 0);
 62}
 63if (!defined('IDNA_ALLOW_UNASSIGNED')) {
 64    define('IDNA_ALLOW_UNASSIGNED', 1);
 65}
 66if (!defined('IDNA_USE_STD3_RULES')) {
 67    define('IDNA_USE_STD3_RULES', 2);
 68}
 69if (!defined('IDNA_CHECK_BIDI')) {
 70    define('IDNA_CHECK_BIDI', 4);
 71}
 72if (!defined('IDNA_CHECK_CONTEXTJ')) {
 73    define('IDNA_CHECK_CONTEXTJ', 8);
 74}
 75if (!defined('IDNA_NONTRANSITIONAL_TO_ASCII')) {
 76    define('IDNA_NONTRANSITIONAL_TO_ASCII', 16);
 77}
 78if (!defined('IDNA_NONTRANSITIONAL_TO_UNICODE')) {
 79    define('IDNA_NONTRANSITIONAL_TO_UNICODE', 32);
 80}
 81if (!defined('INTL_IDNA_VARIANT_2003')) {
 82    define('INTL_IDNA_VARIANT_2003', 0);
 83}
 84if (!defined('INTL_IDNA_VARIANT_UTS46')) {
 85    define('INTL_IDNA_VARIANT_UTS46', 1);
 86}
 87if (!defined('IDNA_ERROR_EMPTY_LABEL')) {
 88    define('IDNA_ERROR_EMPTY_LABEL', 1);
 89}
 90if (!defined('IDNA_ERROR_LABEL_TOO_LONG')) {
 91    define('IDNA_ERROR_LABEL_TOO_LONG', 2);
 92}
 93if (!defined('IDNA_ERROR_DOMAIN_NAME_TOO_LONG')) {
 94    define('IDNA_ERROR_DOMAIN_NAME_TOO_LONG', 4);
 95}
 96if (!defined('IDNA_ERROR_LEADING_HYPHEN')) {
 97    define('IDNA_ERROR_LEADING_HYPHEN', 8);
 98}
 99if (!defined('IDNA_ERROR_TRAILING_HYPHEN')) {
100    define('IDNA_ERROR_TRAILING_HYPHEN', 16);
101}
102if (!defined('IDNA_ERROR_HYPHEN_3_4')) {
103    define('IDNA_ERROR_HYPHEN_3_4', 32);
104}
105if (!defined('IDNA_ERROR_LEADING_COMBINING_MARK')) {
106    define('IDNA_ERROR_LEADING_COMBINING_MARK', 64);
107}
108if (!defined('IDNA_ERROR_DISALLOWED')) {
109    define('IDNA_ERROR_DISALLOWED', 128);
110}
111if (!defined('IDNA_ERROR_PUNYCODE')) {
112    define('IDNA_ERROR_PUNYCODE', 256);
113}
114if (!defined('IDNA_ERROR_LABEL_HAS_DOT')) {
115    define('IDNA_ERROR_LABEL_HAS_DOT', 512);
116}
117if (!defined('IDNA_ERROR_INVALID_ACE_LABEL')) {
118    define('IDNA_ERROR_INVALID_ACE_LABEL', 1024);
119}
120if (!defined('IDNA_ERROR_BIDI')) {
121    define('IDNA_ERROR_BIDI', 2048);
122}
123if (!defined('IDNA_ERROR_CONTEXTJ')) {
124    define('IDNA_ERROR_CONTEXTJ', 4096);
125}
126
127if (PHP_VERSION_ID < 70400) {
128    if (!function_exists('idn_to_ascii')) {
129        function idn_to_ascii($domain, $options = IDNA_DEFAULT, $variant = INTL_IDNA_VARIANT_2003, &$idna_info = array()) { return p\Idn::idn_to_ascii($domain, $options, $variant, $idna_info); }
130    }
131    if (!function_exists('idn_to_utf8')) {
132        function idn_to_utf8($domain, $options = IDNA_DEFAULT, $variant = INTL_IDNA_VARIANT_2003, &$idna_info = array()) { return p\Idn::idn_to_utf8($domain, $options, $variant, $idna_info); }
133    }
134} else {
135    if (!function_exists('idn_to_ascii')) {
136        function idn_to_ascii($domain, $options = IDNA_DEFAULT, $variant = INTL_IDNA_VARIANT_UTS46, &$idna_info = array()) { return p\Idn::idn_to_ascii($domain, $options, $variant, $idna_info); }
137    }
138    if (!function_exists('idn_to_utf8')) {
139        function idn_to_utf8($domain, $options = IDNA_DEFAULT, $variant = INTL_IDNA_VARIANT_UTS46, &$idna_info = array()) { return p\Idn::idn_to_utf8($domain, $options, $variant, $idna_info); }
140    }
141}