streams/vendor/symfony/polyfill-intl-idn/bootstrap.php

142 lines
4.5 KiB
PHP
Raw Normal View History

2020-05-06 05:19:42 +00:00
<?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\Intl\Idn as p;
2020-07-07 05:21:11 +00:00
if (extension_loaded('intl')) {
return;
}
if (!defined('U_IDNA_PROHIBITED_ERROR')) {
2020-05-06 05:19:42 +00:00
define('U_IDNA_PROHIBITED_ERROR', 66560);
2020-07-07 05:21:11 +00:00
}
if (!defined('U_IDNA_ERROR_START')) {
2020-05-06 05:19:42 +00:00
define('U_IDNA_ERROR_START', 66560);
2020-07-07 05:21:11 +00:00
}
if (!defined('U_IDNA_UNASSIGNED_ERROR')) {
2020-05-06 05:19:42 +00:00
define('U_IDNA_UNASSIGNED_ERROR', 66561);
2020-07-07 05:21:11 +00:00
}
if (!defined('U_IDNA_CHECK_BIDI_ERROR')) {
2020-05-06 05:19:42 +00:00
define('U_IDNA_CHECK_BIDI_ERROR', 66562);
2020-07-07 05:21:11 +00:00
}
if (!defined('U_IDNA_STD3_ASCII_RULES_ERROR')) {
2020-05-06 05:19:42 +00:00
define('U_IDNA_STD3_ASCII_RULES_ERROR', 66563);
2020-07-07 05:21:11 +00:00
}
if (!defined('U_IDNA_ACE_PREFIX_ERROR')) {
2020-05-06 05:19:42 +00:00
define('U_IDNA_ACE_PREFIX_ERROR', 66564);
2020-07-07 05:21:11 +00:00
}
if (!defined('U_IDNA_VERIFICATION_ERROR')) {
2020-05-06 05:19:42 +00:00
define('U_IDNA_VERIFICATION_ERROR', 66565);
2020-07-07 05:21:11 +00:00
}
if (!defined('U_IDNA_LABEL_TOO_LONG_ERROR')) {
2020-05-06 05:19:42 +00:00
define('U_IDNA_LABEL_TOO_LONG_ERROR', 66566);
2020-07-07 05:21:11 +00:00
}
if (!defined('U_IDNA_ZERO_LENGTH_LABEL_ERROR')) {
2020-05-06 05:19:42 +00:00
define('U_IDNA_ZERO_LENGTH_LABEL_ERROR', 66567);
2020-07-07 05:21:11 +00:00
}
if (!defined('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR')) {
2020-05-06 05:19:42 +00:00
define('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR', 66568);
2020-07-07 05:21:11 +00:00
}
if (!defined('U_IDNA_ERROR_LIMIT')) {
2020-05-06 05:19:42 +00:00
define('U_IDNA_ERROR_LIMIT', 66569);
2020-07-07 05:21:11 +00:00
}
if (!defined('U_STRINGPREP_PROHIBITED_ERROR')) {
2020-05-06 05:19:42 +00:00
define('U_STRINGPREP_PROHIBITED_ERROR', 66560);
2020-07-07 05:21:11 +00:00
}
if (!defined('U_STRINGPREP_UNASSIGNED_ERROR')) {
2020-05-06 05:19:42 +00:00
define('U_STRINGPREP_UNASSIGNED_ERROR', 66561);
2020-07-07 05:21:11 +00:00
}
if (!defined('U_STRINGPREP_CHECK_BIDI_ERROR')) {
2020-05-06 05:19:42 +00:00
define('U_STRINGPREP_CHECK_BIDI_ERROR', 66562);
2020-07-07 05:21:11 +00:00
}
if (!defined('IDNA_DEFAULT')) {
2020-05-06 05:19:42 +00:00
define('IDNA_DEFAULT', 0);
2020-07-07 05:21:11 +00:00
}
if (!defined('IDNA_ALLOW_UNASSIGNED')) {
2020-05-06 05:19:42 +00:00
define('IDNA_ALLOW_UNASSIGNED', 1);
2020-07-07 05:21:11 +00:00
}
if (!defined('IDNA_USE_STD3_RULES')) {
2020-05-06 05:19:42 +00:00
define('IDNA_USE_STD3_RULES', 2);
2020-07-07 05:21:11 +00:00
}
if (!defined('IDNA_CHECK_BIDI')) {
2020-05-06 05:19:42 +00:00
define('IDNA_CHECK_BIDI', 4);
2020-07-07 05:21:11 +00:00
}
if (!defined('IDNA_CHECK_CONTEXTJ')) {
2020-05-06 05:19:42 +00:00
define('IDNA_CHECK_CONTEXTJ', 8);
2020-07-07 05:21:11 +00:00
}
if (!defined('IDNA_NONTRANSITIONAL_TO_ASCII')) {
2020-05-06 05:19:42 +00:00
define('IDNA_NONTRANSITIONAL_TO_ASCII', 16);
2020-07-07 05:21:11 +00:00
}
if (!defined('IDNA_NONTRANSITIONAL_TO_UNICODE')) {
2020-05-06 05:19:42 +00:00
define('IDNA_NONTRANSITIONAL_TO_UNICODE', 32);
2020-07-07 05:21:11 +00:00
}
if (!defined('INTL_IDNA_VARIANT_2003')) {
2020-05-06 05:19:42 +00:00
define('INTL_IDNA_VARIANT_2003', 0);
2020-07-07 05:21:11 +00:00
}
if (!defined('INTL_IDNA_VARIANT_UTS46')) {
2020-05-06 05:19:42 +00:00
define('INTL_IDNA_VARIANT_UTS46', 1);
2020-07-07 05:21:11 +00:00
}
if (!defined('IDNA_ERROR_EMPTY_LABEL')) {
2020-05-06 05:19:42 +00:00
define('IDNA_ERROR_EMPTY_LABEL', 1);
2020-07-07 05:21:11 +00:00
}
if (!defined('IDNA_ERROR_LABEL_TOO_LONG')) {
2020-05-06 05:19:42 +00:00
define('IDNA_ERROR_LABEL_TOO_LONG', 2);
2020-07-07 05:21:11 +00:00
}
if (!defined('IDNA_ERROR_DOMAIN_NAME_TOO_LONG')) {
2020-05-06 05:19:42 +00:00
define('IDNA_ERROR_DOMAIN_NAME_TOO_LONG', 4);
2020-07-07 05:21:11 +00:00
}
if (!defined('IDNA_ERROR_LEADING_HYPHEN')) {
2020-05-06 05:19:42 +00:00
define('IDNA_ERROR_LEADING_HYPHEN', 8);
2020-07-07 05:21:11 +00:00
}
if (!defined('IDNA_ERROR_TRAILING_HYPHEN')) {
2020-05-06 05:19:42 +00:00
define('IDNA_ERROR_TRAILING_HYPHEN', 16);
2020-07-07 05:21:11 +00:00
}
if (!defined('IDNA_ERROR_HYPHEN_3_4')) {
2020-05-06 05:19:42 +00:00
define('IDNA_ERROR_HYPHEN_3_4', 32);
2020-07-07 05:21:11 +00:00
}
if (!defined('IDNA_ERROR_LEADING_COMBINING_MARK')) {
2020-05-06 05:19:42 +00:00
define('IDNA_ERROR_LEADING_COMBINING_MARK', 64);
2020-07-07 05:21:11 +00:00
}
if (!defined('IDNA_ERROR_DISALLOWED')) {
2020-05-06 05:19:42 +00:00
define('IDNA_ERROR_DISALLOWED', 128);
2020-07-07 05:21:11 +00:00
}
if (!defined('IDNA_ERROR_PUNYCODE')) {
2020-05-06 05:19:42 +00:00
define('IDNA_ERROR_PUNYCODE', 256);
2020-07-07 05:21:11 +00:00
}
if (!defined('IDNA_ERROR_LABEL_HAS_DOT')) {
2020-05-06 05:19:42 +00:00
define('IDNA_ERROR_LABEL_HAS_DOT', 512);
2020-07-07 05:21:11 +00:00
}
if (!defined('IDNA_ERROR_INVALID_ACE_LABEL')) {
2020-05-06 05:19:42 +00:00
define('IDNA_ERROR_INVALID_ACE_LABEL', 1024);
2020-07-07 05:21:11 +00:00
}
if (!defined('IDNA_ERROR_BIDI')) {
2020-05-06 05:19:42 +00:00
define('IDNA_ERROR_BIDI', 2048);
2020-07-07 05:21:11 +00:00
}
if (!defined('IDNA_ERROR_CONTEXTJ')) {
2020-05-06 05:19:42 +00:00
define('IDNA_ERROR_CONTEXTJ', 4096);
}
2020-07-07 05:21:11 +00:00
if (PHP_VERSION_ID < 70400) {
if (!function_exists('idn_to_ascii')) {
2020-05-06 05:19:42 +00:00
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); }
2020-07-07 05:21:11 +00:00
}
if (!function_exists('idn_to_utf8')) {
2020-05-06 05:19:42 +00:00
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); }
2020-07-07 05:21:11 +00:00
}
} else {
if (!function_exists('idn_to_ascii')) {
2020-05-06 05:19:42 +00:00
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); }
2020-07-07 05:21:11 +00:00
}
if (!function_exists('idn_to_utf8')) {
2020-05-06 05:19:42 +00:00
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); }
}
}