当前位置: 首页>>代码示例>>PHP>>正文


PHP PMA_kanji_str_conv函数代码示例

本文整理汇总了PHP中PMA_kanji_str_conv函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_kanji_str_conv函数的具体用法?PHP PMA_kanji_str_conv怎么用?PHP PMA_kanji_str_conv使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了PMA_kanji_str_conv函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: PMA_myCsvHandler

/**
 * Formats the INSERT statements depending on the target (screen/file) of the
 * cvs export
 *
 * Revisions: 2001-05-07, Lem9: added $add_character
 *            2001-07-12, loic1: $crlf should be used only if there is no EOL
 *                               character defined by the user
 *
 * @param   string  the insert statement
 *
 * @global  string  the character to add at the end of lines
 * @global  string  the buffer containing formatted strings
 */
function PMA_myCsvHandler($sql_insert)
{
    global $add_character;
    global $tmp_buffer;
    // Kanji encoding convert feature appended by Y.Kawada (2001/2/21)
    if (function_exists('PMA_kanji_str_conv')) {
        $sql_insert = PMA_kanji_str_conv($sql_insert, $GLOBALS['knjenc'], isset($GLOBALS['xkana']) ? $GLOBALS['xkana'] : '');
    }
    // Result has to be displayed on screen
    if (empty($GLOBALS['asfile'])) {
        echo htmlspecialchars($sql_insert) . $add_character;
    } else {
        if (!isset($GLOBALS['zip']) && !isset($GLOBALS['bzip']) && !isset($GLOBALS['gzip'])) {
            echo $sql_insert . $add_character;
        } else {
            $tmp_buffer .= $sql_insert . $add_character;
        }
    }
}
开发者ID:SalokineTerata,项目名称:intranet,代码行数:32,代码来源:tbl_dump.php

示例2: PMA_convert_string

            if ($sql_query == FALSE) {
                $message = $strFileCouldNotBeRead;
            }
        }
        // Convert the file's charset if necessary
        if ($cfg['AllowAnywhereRecoding'] && $allow_recoding && isset($charset_of_file) && $charset_of_file != $charset) {
            $sql_query = PMA_convert_string($charset_of_file, $charset, $sql_query);
        }
    }
    // end uploaded file stuff
}
// Kanji convert SQL textfile 2002/1/4 by Y.Kawada
if (@function_exists('PMA_kanji_str_conv')) {
    $sql_tmp = trim($sql_query);
    PMA_change_enc_order();
    $sql_query = PMA_kanji_str_conv($sql_tmp, $knjenc, isset($xkana) ? $xkana : '');
    PMA_change_enc_order();
} else {
    $sql_query = trim($sql_query);
}
// $sql_query come from the query textarea, if it's a reposted query gets its
// 'true' value
if (!empty($prev_sql_query)) {
    $prev_sql_query = urldecode($prev_sql_query);
    if ($sql_query == trim(htmlspecialchars($prev_sql_query))) {
        $sql_query = $prev_sql_query;
    }
}
// Drop database is not allowed -> ensure the query can be run
if (!$cfg['AllowUserDropDatabase'] && preg_match('@DROP[[:space:]]+(IF EXISTS[[:space:]]+)?DATABASE @i', $sql_query)) {
    // Checks if the user is a Superuser
开发者ID:quartemer,项目名称:xoopserver,代码行数:31,代码来源:read_dump.php

示例3: PMA_exportOutputHandler

/**
 * Output handler for all exports, if needed buffering, it stores data into
 * $dump_buffer, otherwise it prints thems out.
 *
 * @param   string  the insert statement
 *
 * @return  bool    Whether output suceeded
 */
function PMA_exportOutputHandler($line)
{
    global $time_start, $dump_buffer, $dump_buffer_len, $save_filename;
    // Kanji encoding convert feature
    if ($GLOBALS['output_kanji_conversion']) {
        $line = PMA_kanji_str_conv($line, $GLOBALS['knjenc'], isset($GLOBALS['xkana']) ? $GLOBALS['xkana'] : '');
    }
    // If we have to buffer data, we will perform everything at once at the end
    if ($GLOBALS['buffer_needed']) {
        $dump_buffer .= $line;
        if ($GLOBALS['onfly_compression']) {
            $dump_buffer_len += strlen($line);
            if ($dump_buffer_len > $GLOBALS['memory_limit']) {
                if ($GLOBALS['output_charset_conversion']) {
                    $dump_buffer = PMA_convert_string($GLOBALS['charset'], $GLOBALS['charset_of_file'], $dump_buffer);
                }
                // as bzipped
                if ($GLOBALS['compression'] == 'bzip' && @function_exists('bzcompress')) {
                    $dump_buffer = bzcompress($dump_buffer);
                } elseif ($GLOBALS['compression'] == 'gzip' && @function_exists('gzencode')) {
                    // without the optional parameter level because it bug
                    $dump_buffer = gzencode($dump_buffer);
                }
                if ($GLOBALS['save_on_server']) {
                    $write_result = @fwrite($GLOBALS['file_handle'], $dump_buffer);
                    if (!$write_result || $write_result != strlen($dump_buffer)) {
                        $GLOBALS['message'] = PMA_Message::error('strNoSpace');
                        $GLOBALS['message']->addParam($save_filename);
                        return false;
                    }
                } else {
                    echo $dump_buffer;
                }
                $dump_buffer = '';
                $dump_buffer_len = 0;
            }
        } else {
            $time_now = time();
            if ($time_start >= $time_now + 30) {
                $time_start = $time_now;
                header('X-pmaPing: Pong');
            }
            // end if
        }
    } else {
        if ($GLOBALS['asfile']) {
            if ($GLOBALS['output_charset_conversion']) {
                $line = PMA_convert_string($GLOBALS['charset'], $GLOBALS['charset_of_file'], $line);
            }
            if ($GLOBALS['save_on_server'] && strlen($line) > 0) {
                $write_result = @fwrite($GLOBALS['file_handle'], $line);
                if (!$write_result || $write_result != strlen($line)) {
                    $GLOBALS['message'] = PMA_Message::error('strNoSpace');
                    $GLOBALS['message']->addParam($save_filename);
                    return false;
                }
                $time_now = time();
                if ($time_start >= $time_now + 30) {
                    $time_start = $time_now;
                    header('X-pmaPing: Pong');
                }
                // end if
            } else {
                // We export as file - output normally
                echo $line;
            }
        } else {
            // We export as html - replace special chars
            echo htmlspecialchars($line);
        }
    }
    return true;
}
开发者ID:alexhava,项目名称:elixirjuice,代码行数:81,代码来源:export.php

示例4: PMA_kanji_file_conv

/**
 * Kanji file encoding convert
 * 2002/1/4 by Y.Kawada
 *
 * @param   string   the name of the file to convert
 * @param   string   the destinasion encoding code
 * @param   string   set 'kana' convert to JIS-X208-kana
 *
 * @return  string   the name of the converted file
 */
function PMA_kanji_file_conv($file, $enc, $kana)
{
    if ($enc == '' && $kana == '') {
        return $file;
    }
    $tmpfname = tempnam('', $enc);
    $fpd = fopen($tmpfname, 'wb');
    $fps = fopen($file, 'r');
    PMA_change_enc_order();
    while (!feof($fps)) {
        $line = fgets($fps, 4096);
        $dist = PMA_kanji_str_conv($line, $enc, $kana);
        fputs($fpd, $dist);
    }
    // end while
    PMA_change_enc_order();
    fclose($fps);
    fclose($fpd);
    unlink($file);
    return $tmpfname;
}
开发者ID:johangas,项目名称:moped,代码行数:31,代码来源:kanji-encoding.lib.php


注:本文中的PMA_kanji_str_conv函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。