本文整理汇总了PHP中CBXPunycode::Encode方法的典型用法代码示例。如果您正苦于以下问题:PHP CBXPunycode::Encode方法的具体用法?PHP CBXPunycode::Encode怎么用?PHP CBXPunycode::Encode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBXPunycode
的用法示例。
在下文中一共展示了CBXPunycode::Encode方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: intval
function __construct($step = 0, $fast = 0, $fix_mode = 0)
{
if (!$this->step = intval($step))
$this->arTestVars['site_checker_success'] = 'Y';
$this->test_percent = 0;
$this->strError = '';
$this->timeout = 10; // sec for one step
$this->strResult = '';
$this->fix_mode = intval($fix_mode);
$this->cafile = $_SERVER['DOCUMENT_ROOT'].'/bitrix/tmp/cacert.pem';
$this->host = $_REQUEST['HTTP_HOST'] ? $_REQUEST['HTTP_HOST'] : 'localhost';
if (!$fix_mode) // no need to know the host in fix mode
{
if (!preg_match('/^[a-z0-9\.\-]+$/i', $this->host)) // cyrillic domain hack
{
$host = $this->host;
$host0 = CharsetConverter::ConvertCharset($host, 'utf8', 'cp1251');
if (preg_match("/[\xC0-\xFF]/",$host0))
{
// utf-8;
if (!defined('BX_UTF') && BX_UTF !== true)
$host = $host0;
}
elseif (preg_match("/[\xC0-\xFF]/",$host))
{
// windows-1251
if (defined('BX_UTF') && BX_UTF === true)
$host = CharsetConverter::ConvertCharset($host, 'cp1251', 'utf8');
}
$converter = new CBXPunycode();
$host = $converter->Encode($host);
$this->host = $host;
}
}
$this->ssl = $_REQUEST['HTTPS'] == 'on';
$this->port = $_REQUEST['SERVER_PORT'] ? $_REQUEST['SERVER_PORT'] : ($this->ssl ? 443 : 80);
$arTestGroup = array();
$arGroupName = array();
$arGroupName[1] = IsModuleInstalled('intranet') ? GetMessage("MAIN_SC_GENERAL") : GetMessage("MAIN_SC_GENERAL_SITE");
$arGroupDesc[1] = GetMessage("MAIN_SC_REQUIRED_MODS_DESC");
$arTestGroup[1] = array(
array('check_php_modules' =>GetMessage('SC_T_MODULES')),
array('check_php_settings' =>GetMessage('SC_T_PHP')),
array('check_security' => GetMessage('SC_T_APACHE')),
array('check_server_vars' =>GetMessage('SC_T_SERVER')),
array('check_session' => GetMessage('SC_T_SESS')),
array('check_mbstring' =>GetMessage('SC_T_MBSTRING')),
array('check_socket' => GetMessage('SC_T_SOCK')),
);
$arGroupName[2] = GetMessage("MAIN_SC_BUSINESS");
$arGroupDesc[2] = GetMessage("MAIN_SC_CORRECT_DESC");
$arTestGroup[2] = array(
array('check_pull_stream' => GetMessage("MAIN_SC_TEST_CHAT")),
array('check_pull_comments' => GetMessage("MAIN_SC_TEST_COMMENTS")),
array('check_turn' => GetMessage("MAIN_SC_TEST_VIDEO")),
array('check_access_mobile' => GetMessage("MAIN_SC_TEST_MOBILE")),
array('check_push_bitrix' => GetMessage("MAIN_SC_TEST_PUSH")),
array('check_access_docs' => GetMessage("MAIN_SC_TEST_DOCS")),
array('check_fast_download' => GetMessage("MAIN_SC_TEST_FAST_FILES")),
array('check_search' => GetMessage("MAIN_SC_TEST_SEARCH_CONTENTS")),
array('check_mail' => GetMessage("MAIN_SC_MAIL_TEST")),
array('check_ca_file' => GetMessage("MAIN_SC_CLOUD_TEST")),
array('check_connect_mail' => GetMessage("MAIN_SC_TEST_MAIL_INTEGRATION")),
array('check_socnet' => GetMessage("MAIN_SC_TEST_SOCNET_INTEGRATION")),
);
if (IsModuleInstalled('extranet'))
$arTestGroup[2][] = array('check_extranet' => GetMessage("MAIN_SC_EXTRANET_ACCESS"));
$arGroupName[4] = GetMessage("MAIN_SC_WINDOWS_ENV");
$arGroupDesc[4] = '';
$arTestGroup[4] = array(
array('check_webdav' => GetMessage("MAIN_SC_DOCS_EDIT_MS_OFFICE")),
array('check_socket_ssl' => GetMessage("MAIN_SC_EXTERNAL_APPS_TEST")),
array('check_ad' => GetMessage("MAIN_SC_TEST_LDAP")),
array('check_ntlm' => GetMessage("MAIN_SC_TEST_NTLM")),
);
$arGroupName[8] = GetMessage("MAIN_SC_PERFORM");
$arGroupDesc[8] = '';
$arTestGroup[8] = array(
array('check_perf' => GetMessage("MAIN_SC_PERF_TEST")),
array('check_compression' => GetMessage("MAIN_SC_COMPRESSION_TEST")),
);
$arGroupName[16] = GetMessage('SC_GR_EXTENDED');
$arTestGroup[16] = array(
array('check_dbconn_settings' => GetMessage('SC_T_DBCONN_SETTINGS')),
array('check_dbconn' => GetMessage('SC_T_DBCONN')),
array('check_bx_crontab' => GetMessage("MAIN_SC_AGENTS_CRON")),
array('check_session_ua' => GetMessage('SC_T_SESS_UA')),
array('check_sites' => GetMessage('SC_T_SITES')),
array('check_install_scripts' => GetMessage('SC_T_INSTALL_SCRIPTS')),
array('check_clone' => GetMessage('SC_T_CLONE')),
array('check_pcre_recursion' => GetMessage('SC_T_RECURSION')),
array('check_method_exists' => GetMessage('SC_T_METHOD_EXISTS')),
//.........这里部分代码省略.........
示例2: BeginNote
require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/prolog.php";
$APPLICATION->SetTitle(GetMessage("MAIN_DUMP_AUTO_PAGE_TITLE"));
require $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/include/prolog_admin_after.php";
$arAllBucket = CBackup::GetBucketList();
$strError = '';
if ($DB->type != 'MYSQL') {
echo BeginNote() . GetMessage('MAIN_DUMP_MYSQL_ONLY') . EndNote();
}
$server_name = COption::GetOptionString("main", "server_name", "");
if (!$server_name) {
$server_name = $_SERVER['HTTP_HOST'];
}
$server_name = rtrim($server_name, '/');
if (!preg_match('/^[a-z0-9\\.\\-]+$/i', $server_name)) {
$converter = new CBXPunycode(defined('BX_UTF') && BX_UTF === true ? 'UTF-8' : 'windows-1251');
$host = $converter->Encode($server_name);
if (!preg_match('#--p1ai$#', $host)) {
// trying to guess
$host = $converter->Encode(CharsetConverter::ConvertCharset($server_name, 'utf-8', 'windows-1251'));
}
$server_name = $host;
}
$url = (CMain::IsHTTPS() ? "https://" : "http://") . $server_name;
define('LOCK_FILE', $_SERVER['DOCUMENT_ROOT'] . '/bitrix/backup/auto_lock');
$dump_auto_enable = IntOption('dump_auto_enable');
if ($_REQUEST['save']) {
if (!check_bitrix_sessid()) {
CAdminMessage::ShowMessage(array("MESSAGE" => GetMessage("MAIN_DUMP_ERROR"), "DETAILS" => GetMessage("DUMP_MAIN_SESISON_ERROR"), "TYPE" => "ERROR", "HTML" => true));
} else {
$BUCKET_ID = $_REQUEST['dump_bucket_id'];
if (!$bMcrypt) {
示例3: GetServerName
public static function GetServerName()
{
if (defined("SITE_SERVER_NAME") && strlen(SITE_SERVER_NAME) > 0) {
$server_name = SITE_SERVER_NAME;
}
if (!$server_name) {
$server_name = COption::GetOptionString("main", "server_name", "");
}
if (!$server_name) {
$server_name = $_SERVER['HTTP_HOST'];
}
$server_name = rtrim($server_name, '/');
if (!preg_match('/^[a-z0-9\\.\\-]+$/i', $server_name)) {
$converter = new CBXPunycode(defined('BX_UTF') && BX_UTF === true ? 'UTF-8' : 'windows-1251');
$host = $converter->Encode($server_name);
if (!preg_match('#--p1ai$#', $host)) {
// trying to guess
$host = $converter->Encode(CharsetConverter::ConvertCharset($server_name, 'utf-8', 'windows-1251'));
}
$server_name = $host;
}
return $server_name;
}
示例4: GetServerPath
public static function GetServerPath()
{
if (defined("SITE_SERVER_NAME") && strlen(SITE_SERVER_NAME) > 0)
$server_name = SITE_SERVER_NAME;
if (!$server_name)
$server_name = COption::GetOptionString("main", "server_name", "");
if (!$server_name)
$server_name = $_SERVER['HTTP_HOST'];
$server_name = rtrim($server_name, '/');
if (!preg_match('/^[a-z0-9\.\-]+$/i', $server_name)) // cyrillic domain hack
{
$converter = new CBXPunycode(defined('BX_UTF') && BX_UTF === true ? 'UTF-8' : 'windows-1251');
$host = $converter->Encode($server_name);
if (!preg_match('#--p1ai$#', $host)) // trying to guess
$host = $converter->Encode(CharsetConverter::ConvertCharset($server_name, 'utf-8', 'windows-1251'));
$server_name = $host;
}
$serverPath = (CMain::IsHTTPS() ? "https://" : "http://").$server_name;
return $serverPath;
}