本文整理汇总了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 {
示例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;
}
示例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;
}
示例4: testReplaceBinaryContents
/**
* replace binary contents test
* @dataProvider replaceBinaryContentsDataProvider
*/
public function testReplaceBinaryContents($a, $e)
{
$this->assertEquals($e, PMA_replace_binary_contents($a));
}