當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PMA_replace_binary_contents函數代碼示例

本文整理匯總了PHP中PMA_replace_binary_contents函數的典型用法代碼示例。如果您正苦於以下問題:PHP PMA_replace_binary_contents函數的具體用法?PHP PMA_replace_binary_contents怎麽用?PHP PMA_replace_binary_contents使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了PMA_replace_binary_contents函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: elseif

 if (isset($vrow)) {
     if (is_null($vrow[$field['Field']])) {
         $real_null_value = TRUE;
         $vrow[$field['Field']] = '';
         $special_chars = '';
         $data = $vrow[$field['Field']];
     } elseif ($field['True_Type'] == 'bit') {
         $special_chars = PMA_printable_bit_value($vrow[$field['Field']], $extracted_fieldspec['spec_in_brackets']);
     } else {
         // loic1: special binary "characters"
         if ($field['is_binary'] || $field['is_blob'] && !$cfg['ProtectBinary']) {
             if ($_SESSION['tmp_user_values']['display_binary_as_hex'] && $cfg['ShowFunctionFields']) {
                 $vrow[$field['Field']] = bin2hex($vrow[$field['Field']]);
                 $field['display_binary_as_hex'] = true;
             } else {
                 $vrow[$field['Field']] = PMA_replace_binary_contents($vrow[$field['Field']]);
             }
         }
         // end if
         $special_chars = htmlspecialchars($vrow[$field['Field']]);
         //We need to duplicate the first \n or otherwise we will lose the first newline entered in a VARCHAR or TEXT column
         $special_chars_encoded = PMA_duplicateFirstNewline($special_chars);
         $data = $vrow[$field['Field']];
     }
     // end if... else...
     // loic1: if a timestamp field value is not included in an update
     //        statement MySQL auto-update it to the current timestamp
     // lem9:  however, things have changed since MySQL 4.1, so
     //        it's better to set a fields_prev in this situation
     $backup_field = '<input type="hidden" name="fields_prev' . $field_name_appendix . '" value="' . htmlspecialchars($vrow[$field['Field']]) . '" />';
 } else {
開發者ID:fathitarek,項目名稱:cop5725-dbms-project,代碼行數:31,代碼來源:tbl_change.php

示例2: PMA_handle_non_printable_contents

/**
 * Verifies what to do with non-printable contents (binary or BLOB)
 * in Browse mode.
 *
 * @uses    is_null()
 * @uses    isset()
 * @uses    strlen()
 * @uses    PMA_formatByteDown()
 * @uses    strpos()
 * @uses    str_replace()
 * @param   string  $category BLOB|BINARY|GEOMETRY
 * @param   string  $content  the binary content
 * @param   string  $transform_function
 * @param   string  $transform_options
 * @param   string  $default_function
 * @param   object  $meta   the meta-information about this field
 * @return  mixed  string or float
 */
function PMA_handle_non_printable_contents($category, $content, $transform_function, $transform_options, $default_function, $meta, $url_params = array())
{
    $result = '[' . $category;
    if (is_null($content)) {
        $result .= ' - NULL';
        $size = 0;
    } elseif (isset($content)) {
        $size = strlen($content);
        $display_size = PMA_formatByteDown($size, 3, 1);
        $result .= ' - ' . $display_size[0] . $display_size[1];
    }
    $result .= ']';
    if (strpos($transform_function, 'octetstream')) {
        $result = $content;
    }
    if ($size > 0) {
        if ($default_function != $transform_function) {
            $result = $transform_function($result, $transform_options, $meta);
        } else {
            $result = $default_function($result, array(), $meta);
            if (stristr($meta->type, 'BLOB') && $_SESSION['tmp_user_values']['display_blob']) {
                // in this case, restart from the original $content
                $result = htmlspecialchars(PMA_replace_binary_contents($content));
            }
            /* Create link to download */
            if (count($url_params) > 0) {
                $result = '<a href="tbl_get_field.php' . PMA_generate_common_url($url_params) . '">' . $result . '</a>';
            }
        }
    }
    return $result;
}
開發者ID:anmolview,項目名稱:yiidemos,代碼行數:50,代碼來源:display_tbl.lib.php

示例3: PMA_handle_non_printable_contents

/**
 * Verifies what to do with non-printable contents (binary or BLOB)
 * in Browse mode.
 *
 * @uses    is_null()
 * @uses    isset()
 * @uses    strlen()
 * @uses    PMA_formatByteDown()
 * @uses    strpos()
 * @uses    str_replace()
 * @param   string  $category BLOB|BINARY
 * @param   string  $content  the binary content
 * @param   string  $transform_function
 * @param   string  $transform_options
 * @param   string  $default_function
 * @param   object  $meta   the meta-information about this field
 * @return  mixed  string or float
 */
function PMA_handle_non_printable_contents($category, $content, $transform_function, $transform_options, $default_function, $meta)
{
    $result = '[' . $category;
    if (is_null($content)) {
        $result .= ' - NULL';
        $size = 0;
    } elseif (isset($content)) {
        $size = strlen($content);
        $display_size = PMA_formatByteDown($size, 3, 1);
        $result .= ' - ' . $display_size[0] . $display_size[1];
    }
    $result .= ']';
    if (strpos($transform_function, 'octetstream')) {
        $result = $content;
    }
    if ($size > 0) {
        if ($default_function != $transform_function) {
            $result = $transform_function($result, $transform_options, $meta);
        } else {
            $result = $default_function($result, array(), $meta);
            if (stristr($meta->type, 'BLOB') && $_SESSION['tmp_user_values']['display_blob']) {
                // in this case, restart from the original $content
                $result = htmlspecialchars(PMA_replace_binary_contents($content));
            }
        }
    }
    return $result;
}
開發者ID:kolbermoorer,項目名稱:edugame,代碼行數:46,代碼來源:display_tbl.lib.php

示例4: testReplaceBinaryContents

 /**
  * replace binary contents test
  * @dataProvider replaceBinaryContentsDataProvider
  */
 public function testReplaceBinaryContents($a, $e)
 {
     $this->assertEquals($e, PMA_replace_binary_contents($a));
 }
開發者ID:bugyak,項目名稱:phporadmin,代碼行數:8,代碼來源:PMA_stringOperations_test.php


注:本文中的PMA_replace_binary_contents函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。