blob streaming code cleanup (work in progress)

This commit is contained in:
Marc Delisle
2010-07-22 13:15:27 -04:00
parent b6349cd626
commit 56ebe05af7
15 changed files with 381 additions and 391 deletions

View File

@@ -32,8 +32,7 @@
// necessary variables exist // necessary variables exist
if ($bsDB && $bsTable && $bsReference && $bsNewMIMEType) if ($bsDB && $bsTable && $bsReference && $bsNewMIMEType)
{ {
if (PMA_BS_SetContentType($bsDB, $bsTable, $bsReference, $bsNewMIMEType)) if (PMA_BS_SetContentType($bsDB, $bsTable, $bsReference, $bsNewMIMEType)) {
{
// determine redirector page // determine redirector page
$newLoc = $cfg['PmaAbsoluteUri'] . 'sql.php?' . PMA_generate_common_url ('','', '&') . (isset($bsDB) ? '&db=' . urlencode($bsDB) : '') . (isset($bsTable) ? '&table=' . urlencode($bsTable) : '') . (isset($token) ? '&token=' . urlencode($token) : '') . (isset($goto) ? '&goto=' . urlencode($goto) : '') . '&reload=1&purge=1'; $newLoc = $cfg['PmaAbsoluteUri'] . 'sql.php?' . PMA_generate_common_url ('','', '&') . (isset($bsDB) ? '&db=' . urlencode($bsDB) : '') . (isset($bsTable) ? '&table=' . urlencode($bsTable) : '') . (isset($token) ? '&token=' . urlencode($token) : '') . (isset($goto) ? '&goto=' . urlencode($goto) : '') . '&reload=1&purge=1';
@@ -44,7 +43,6 @@
</script> </script>
<?php <?php
} // end if ($result) } // end if ($result)
} // end if ($bsDB && $bsTable && $bsReference && $bsNewMIMEType) } // end if ($bsDB && $bsTable && $bsReference && $bsNewMIMEType)
?> ?>

View File

@@ -25,15 +25,21 @@ $c_type = preg_replace('/[^A-Za-z0-9/_-]/', '_', $_REQUEST['c_type']);
// Get the blob streaming URL // Get the blob streaming URL
$filename = PMA_BS_getURL($reference); $filename = PMA_BS_getURL($reference);
if (empty($filename)) die('No blob streaming server configured!'); if (empty($filename)) {
die(__('No blob streaming server configured!'));
}
$hdrs = get_headers($filename, 1); $hdrs = get_headers($filename, 1);
if ($hdrs === FALSE) die('Failed to fetch headers'); if ($hdrs === FALSE) {
die(__('Failed to fetch headers'));
}
$fHnd = fopen($filename, "rb"); $fHnd = fopen($filename, "rb");
if ($fHnd === FALSE) die('Failed to open remote URL'); if ($fHnd === FALSE) {
die(__('Failed to open remote URL'));
}
$f_size = $hdrs['Content-Length']; $f_size = $hdrs['Content-Length'];
@@ -53,9 +59,10 @@ while (!feof($fHnd)) {
$content .= fread($fHnd, $f_size); $content .= fread($fHnd, $f_size);
$pos = strlen($content); $pos = strlen($content);
if ($pos >= $f_size) if ($pos >= $f_size) {
break; break;
} }
}
echo $content; echo $content;
flush(); flush();

View File

@@ -25,16 +25,16 @@
$bsReference = isset($_REQUEST['bs_reference']) ? $_REQUEST['bs_reference'] : NULL; $bsReference = isset($_REQUEST['bs_reference']) ? $_REQUEST['bs_reference'] : NULL;
// if media type and BS reference are specified // if media type and BS reference are specified
if (isset($mediaType) && isset($bsReference)) if (isset($mediaType) && isset($bsReference)) {
{ if (isset($customType) && $customType) {
if (isset($customType) && $customType)
$bs_file_path = 'bs_disp_as_mime_type.php' . PMA_generate_common_url(array('reference' => $bsReference, 'c_type' => $mediaType)); $bs_file_path = 'bs_disp_as_mime_type.php' . PMA_generate_common_url(array('reference' => $bsReference, 'c_type' => $mediaType));
else { } else {
// Get the BLOB streaming URL // Get the BLOB streaming URL
$bs_file_path = PMA_BS_getURL($bsReference); $bs_file_path = PMA_BS_getURL($bsReference);
if (empty($bs_file_path)) die('No blob streaming server configured!'); if (empty($bs_file_path)) {
die(__('No blob streaming server configured!'));
}
} }
?> ?>
<html> <html>
<head> <head>

View File

@@ -150,13 +150,9 @@ $hidden_fields = array();
$odd_row = true; $odd_row = true;
$sum_row_count_pre = ''; $sum_row_count_pre = '';
// added by rajk - for blobstreaming
$PMA_Config = $GLOBALS['PMA_Config'];
$tableReductionCount = 0; // the amount to reduce the table count by $tableReductionCount = 0; // the amount to reduce the table count by
foreach ($tables as $keyname => $each_table) { foreach ($tables as $keyname => $each_table) {
if (PMA_BS_IsHiddenTable($keyname)) { if (PMA_BS_IsHiddenTable($keyname)) {
$tableReductionCount++; $tableReductionCount++;
continue; continue;

View File

@@ -279,29 +279,26 @@ class PMA_File
$is_bs_upload = FALSE; $is_bs_upload = FALSE;
// check if this field requires a repository upload // check if this field requires a repository upload
if (isset($_REQUEST['upload_blob_repo_' . $key])) if (isset($_REQUEST['upload_blob_repo_' . $key])) {
$is_bs_upload = ($_REQUEST['upload_blob_repo_' . $key]['multi_edit'][0] == "on") ? TRUE : FALSE; $is_bs_upload = ($_REQUEST['upload_blob_repo_' . $key]['multi_edit'][0] == "on") ? TRUE : FALSE;
}
// if request is an upload to the BLOB repository // if request is an upload to the BLOB repository
if ($is_bs_upload) if ($is_bs_upload) {
{
$bs_db = $_REQUEST['db']; $bs_db = $_REQUEST['db'];
$bs_table = $_REQUEST['table']; $bs_table = $_REQUEST['table'];
$tmp_filename = $file['tmp_name']; $tmp_filename = $file['tmp_name'];
$tmp_file_type = $file['type']; $tmp_file_type = $file['type'];
if (!$tmp_file_type) if (! $tmp_file_type) {
$tmp_file_type = NULL; $tmp_file_type = NULL;
}
if (! $bs_db || ! $bs_table) {
if (!$bs_db || !$bs_table)
{
$this->_error_message = $GLOBALS['strUploadErrorUnknown']; $this->_error_message = $GLOBALS['strUploadErrorUnknown'];
return FALSE; return FALSE;
} }
$blob_url = PMA_BS_UpLoadFile($bs_db, $bs_table, $tmp_file_type, $tmp_filename); $blob_url = PMA_BS_UpLoadFile($bs_db, $bs_table, $tmp_file_type, $tmp_filename);
PMA_File::setRecentBLOBReference($blob_url); PMA_File::setRecentBLOBReference($blob_url);
} // end if ($is_bs_upload) } // end if ($is_bs_upload)
// check for file upload errors // check for file upload errors
@@ -399,45 +396,42 @@ class PMA_File
$is_bs_upload = FALSE; $is_bs_upload = FALSE;
// check if this field requires a repository upload // check if this field requires a repository upload
if (isset($_REQUEST['upload_blob_repo_' . $key])) if (isset($_REQUEST['upload_blob_repo_' . $key])) {
$is_bs_upload = ($_REQUEST['upload_blob_repo_' . $key]['multi_edit'][0] == "on") ? TRUE : FALSE; $is_bs_upload = ($_REQUEST['upload_blob_repo_' . $key]['multi_edit'][0] == "on") ? TRUE : FALSE;
}
// is a request to upload file to BLOB repository using uploadDir mechanism // is a request to upload file to BLOB repository using uploadDir mechanism
if ($is_bs_upload) if ($is_bs_upload) {
{
$bs_db = $_REQUEST['db']; $bs_db = $_REQUEST['db'];
$bs_table = $_REQUEST['table']; $bs_table = $_REQUEST['table'];
$tmp_filename = $GLOBALS['cfg']['UploadDir'] . '/' . $_REQUEST['fields_uploadlocal_' . $key]['multi_edit'][$primary]; $tmp_filename = $GLOBALS['cfg']['UploadDir'] . '/' . $_REQUEST['fields_uploadlocal_' . $key]['multi_edit'][$primary];
// check if fileinfo library exists // check if fileinfo library exists
if ($PMA_Config->get('FILEINFO_EXISTS')) if ($PMA_Config->get('FILEINFO_EXISTS')) {
{
// attempt to init fileinfo // attempt to init fileinfo
$finfo = finfo_open(FILEINFO_MIME); $finfo = finfo_open(FILEINFO_MIME);
// fileinfo exists // fileinfo exists
if ($finfo) if ($finfo) {
{
// pass in filename to fileinfo and close fileinfo handle after // pass in filename to fileinfo and close fileinfo handle after
$tmp_file_type = finfo_file($finfo, $tmp_filename); $tmp_file_type = finfo_file($finfo, $tmp_filename);
finfo_close($finfo); finfo_close($finfo);
} }
} } else {
else // no fileinfo library exists, use file command // no fileinfo library exists, use file command
$tmp_file_type = exec("file -bi " . escapeshellarg($tmp_filename)); $tmp_file_type = exec("file -bi " . escapeshellarg($tmp_filename));
}
if (!$tmp_file_type) if (! $tmp_file_type) {
$tmp_file_type = NULL; $tmp_file_type = NULL;
}
if (! $bs_db || !$bs_table) {
if (!$bs_db || !$bs_table)
{
$this->_error_message = $GLOBALS['strUploadErrorUnknown']; $this->_error_message = $GLOBALS['strUploadErrorUnknown'];
return FALSE; return FALSE;
} }
$blob_url = PMA_BS_UpLoadFile($bs_db, $bs_table, $tmp_file_type, $tmp_filename); $blob_url = PMA_BS_UpLoadFile($bs_db, $bs_table, $tmp_file_type, $tmp_filename);
PMA_File::setRecentBLOBReference($blob_url); PMA_File::setRecentBLOBReference($blob_url);
} // end if ($is_bs_upload) } // end if ($is_bs_upload)
return $this->setLocalSelectedFile($_REQUEST['fields_uploadlocal_' . $key]['multi_edit'][$primary]); return $this->setLocalSelectedFile($_REQUEST['fields_uploadlocal_' . $key]['multi_edit'][$primary]);

View File

@@ -139,8 +139,9 @@ class PMA_StorageEngine
*/ */
static public function isValid($engine) static public function isValid($engine)
{ {
if ($engine == "PBMS") if ($engine == "PBMS") {
return TRUE; return TRUE;
}
$storage_engines = PMA_StorageEngine::getStorageEngines(); $storage_engines = PMA_StorageEngine::getStorageEngines();
return isset($storage_engines[$engine]); return isset($storage_engines[$engine]);
} }

View File

@@ -17,23 +17,25 @@ function initPBMSDatabase()
if (! empty($db_array)) { if (! empty($db_array)) {
$target = ""; $target = "";
foreach ($db_array as $current_db) { foreach ($db_array as $current_db) {
if ($current_db == 'pbms') if ($current_db == 'pbms') {
return TRUE; return TRUE;
}
if ($target == "") { if ($target == "") {
if (($current_db != 'pbxt') && ($current_db != 'mysql') && ($current_db != 'information_schema')) if (($current_db != 'pbxt') && ($current_db != 'mysql') && ($current_db != 'information_schema')) {
$target = $current_db; $target = $current_db;
} }
} }
}
if ($target != "") if ($target != "") {
$query = "select * from $target.pbms_metadata_header"; // If it exists this table will not contain much $query = "select * from $target.pbms_metadata_header"; // If it exists this table will not contain much
} }
}
$result = PMA_DBI_query($query ); $result = PMA_DBI_query($query );
if (!$result) if (! $result) {
return FALSE; return FALSE;
}
return TRUE; return TRUE;
} }
@@ -241,8 +243,9 @@ function PMA_do_connect($db_name, $quiet)
$pbms_port = $PMA_Config->get('BLOBSTREAMING_PORT'); $pbms_port = $PMA_Config->get('BLOBSTREAMING_PORT');
if (pbms_connect($pbms_host, $pbms_port, $db_name) == FALSE) { if (pbms_connect($pbms_host, $pbms_port, $db_name) == FALSE) {
if ($quiet == FALSE) if ($quiet == FALSE) {
PMA_BS_ReportPBMSError("PBMS Connectiuon failed: pbms_connect($pbms_host, $pbms_port, $db_name)"); PMA_BS_ReportPBMSError("PBMS Connectiuon failed: pbms_connect($pbms_host, $pbms_port, $db_name)");
}
return FALSE; return FALSE;
} }
return TRUE; return TRUE;
@@ -261,8 +264,9 @@ function PMA_do_disconnect()
*/ */
function PMA_BS_IsPBMSReference($bs_reference, $db_name) function PMA_BS_IsPBMSReference($bs_reference, $db_name)
{ {
if (PMA_cacheGet('skip_blobstreaming', true)) if (PMA_cacheGet('skip_blobstreaming', true)) {
return FALSE; return FALSE;
}
if (PMA_do_connect($db_name, TRUE) == FALSE) { if (PMA_do_connect($db_name, TRUE) == FALSE) {
return FALSE; return FALSE;
@@ -292,8 +296,9 @@ function PMA_BS_CreateReferenceLink($bs_reference, $db_name)
PMA_do_disconnect(); PMA_do_disconnect();
if (!$content_type) if (! $content_type) {
$content_type = "image/jpeg"; $content_type = "image/jpeg";
}
$bs_url = PMA_BS_getURL($bs_reference); $bs_url = PMA_BS_getURL($bs_reference);
if (empty($bs_url)) { if (empty($bs_url)) {
@@ -304,8 +309,7 @@ function PMA_BS_CreateReferenceLink($bs_reference, $db_name)
$output = "<a href=\"#\" onclick=\"requestMIMETypeChange('" . urlencode($db_name) . "', '" . urlencode($GLOBALS['table']) . "', '" . urlencode($bs_reference) . "', '" . urlencode($content_type) . "')\">$content_type</a>"; $output = "<a href=\"#\" onclick=\"requestMIMETypeChange('" . urlencode($db_name) . "', '" . urlencode($GLOBALS['table']) . "', '" . urlencode($bs_reference) . "', '" . urlencode($content_type) . "')\">$content_type</a>";
// specify custom HTML for various content types // specify custom HTML for various content types
switch ($content_type) switch ($content_type) {
{
// no content specified // no content specified
case NULL: case NULL:
$output = "NULL"; $output = "NULL";
@@ -329,7 +333,6 @@ function PMA_BS_CreateReferenceLink($bs_reference, $db_name)
$output .= ' (<a href="' . $bs_url . '" target="new">' . __('Download file'). '</a>)'; $output .= ' (<a href="' . $bs_url . '" target="new">' . __('Download file'). '</a>)';
} }
//PMA_showMessage("PMA_BS_CreateReferenceLink($bs_reference, $db_name): $output");
return $output; return $output;
} }
@@ -340,21 +343,25 @@ function PMA_BS_CreateReferenceLink($bs_reference, $db_name)
// they are not currently needed. // they are not currently needed.
function PMA_BS_IsTablePBMSEnabled($db_name, $tbl_name, $tbl_type) function PMA_BS_IsTablePBMSEnabled($db_name, $tbl_name, $tbl_type)
{ {
if (PMA_cacheGet('skip_blobstreaming', true)) if (PMA_cacheGet('skip_blobstreaming', true)) {
return FALSE; return FALSE;
}
if ((isset($tbl_type) == FALSE) || (strlen($tbl_type) == 0)) if ((isset($tbl_type) == FALSE) || (strlen($tbl_type) == 0)) {
return FALSE; return FALSE;
}
// load PMA configuration // load PMA configuration
$PMA_Config = $GLOBALS['PMA_Config']; $PMA_Config = $GLOBALS['PMA_Config'];
// return if unable to load PMA configuration // return if unable to load PMA configuration
if (empty($PMA_Config)) if (empty($PMA_Config)) {
return FALSE; return FALSE;
}
if (!$PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST') ) if (! $PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST')) {
return FALSE; return FALSE;
}
// This information should be cached rather than selecting it each time. // This information should be cached rather than selecting it each time.
//$query = "SELECT count(*) FROM information_schema.TABLES T, pbms.pbms_enabled E where T.table_schema = ". PMA_backquote($db_name) . " and T.table_name = ". PMA_backquote($tbl_name) . " and T.engine = E.name"; //$query = "SELECT count(*) FROM information_schema.TABLES T, pbms.pbms_enabled E where T.table_schema = ". PMA_backquote($db_name) . " and T.table_name = ". PMA_backquote($tbl_name) . " and T.engine = E.name";
@@ -362,8 +369,9 @@ function PMA_BS_IsTablePBMSEnabled($db_name, $tbl_name, $tbl_type)
$result = PMA_DBI_query($query); $result = PMA_DBI_query($query);
$data = PMA_DBI_fetch_row($result); $data = PMA_DBI_fetch_row($result);
if ($data[0] == 1) if ($data[0] == 1) {
return TRUE; return TRUE;
}
return FALSE; return FALSE;
} }
@@ -372,8 +380,9 @@ function PMA_BS_IsTablePBMSEnabled($db_name, $tbl_name, $tbl_type)
function PMA_BS_UpLoadFile($db_name, $tbl_name, $file_type, $file_name) function PMA_BS_UpLoadFile($db_name, $tbl_name, $file_type, $file_name)
{ {
if (PMA_cacheGet('skip_blobstreaming', true)) if (PMA_cacheGet('skip_blobstreaming', true)) {
return FALSE; return FALSE;
}
if (PMA_do_connect($db_name, FALSE) == FALSE) { if (PMA_do_connect($db_name, FALSE) == FALSE) {
return FALSE; return FALSE;
@@ -393,7 +402,6 @@ function PMA_BS_UpLoadFile($db_name, $tbl_name, $file_type, $file_name)
PMA_BS_ReportPBMSError("pbms_read_stream() Failed"); PMA_BS_ReportPBMSError("pbms_read_stream() Failed");
} }
//PMA_showMessage(" PMA_BS_UpLoadFile($db_name, $tbl_name, $file_type, $file_name): $pbms_blob_url");
fclose($fh); fclose($fh);
PMA_do_disconnect(); PMA_do_disconnect();
return $pbms_blob_url; return $pbms_blob_url;
@@ -402,8 +410,9 @@ function PMA_BS_UpLoadFile($db_name, $tbl_name, $file_type, $file_name)
//------------ //------------
function PMA_BS_SetContentType($db_name, $bsTable, $blobReference, $contentType) function PMA_BS_SetContentType($db_name, $bsTable, $blobReference, $contentType)
{ {
if (PMA_cacheGet('skip_blobstreaming', true)) if (PMA_cacheGet('skip_blobstreaming', true)) {
return FALSE; return FALSE;
}
// This is a really ugly way to do this but currently there is nothing better. // This is a really ugly way to do this but currently there is nothing better.
// In a future version of PBMS the system tables will be redesigned to make this // In a future version of PBMS the system tables will be redesigned to make this
@@ -414,30 +423,21 @@ function PMA_BS_SetContentType($db_name, $bsTable, $blobReference, $contentType)
//error_log(" $query\n", 3, "/tmp/mylog"); //error_log(" $query\n", 3, "/tmp/mylog");
// if record exists // if record exists
if ($data = PMA_DBI_fetch_assoc($result)) if ($data = PMA_DBI_fetch_assoc($result)) {
{
$where = "WHERE Repository_id=" . $data['Repository_id'] . " AND Repo_blob_offset=" . $data['Repo_blob_offset'] ; $where = "WHERE Repository_id=" . $data['Repository_id'] . " AND Repo_blob_offset=" . $data['Repo_blob_offset'] ;
$query = "SELECT name from pbms_metadata $where"; $query = "SELECT name from pbms_metadata $where";
$result = PMA_DBI_query($query); $result = PMA_DBI_query($query);
if (PMA_DBI_num_rows($result) == 0) if (PMA_DBI_num_rows($result) == 0) {
$query = "INSERT into pbms_metadata Values( ". $data['Repository_id'] . ", " . $data['Repo_blob_offset'] . ", 'Content_type', '" . PMA_sqlAddslashes($contentType) . "')"; $query = "INSERT into pbms_metadata Values( ". $data['Repository_id'] . ", " . $data['Repo_blob_offset'] . ", 'Content_type', '" . PMA_sqlAddslashes($contentType) . "')";
else } else {
$query = "UPDATE pbms_metadata SET name = 'Content_type', Value = '" . PMA_sqlAddslashes($contentType) . "' $where"; $query = "UPDATE pbms_metadata SET name = 'Content_type', Value = '" . PMA_sqlAddslashes($contentType) . "' $where";
}
//error_log("$query\n", 3, "/tmp/mylog"); //error_log("$query\n", 3, "/tmp/mylog");
PMA_DBI_query($query); PMA_DBI_query($query);
} else { } else {
// if ($result == FALSE) {
// $err = PMA_DBI_getError();
// error_log("MySQL ERROR: $err\n", 3, "/tmp/mylog");
// } else
// error_log("No results: $query\n", 3, "/tmp/mylog");
return FALSE; return FALSE;
} }
return TRUE; return TRUE;
} }
@@ -452,7 +452,6 @@ function PMA_BS_IsHiddenTable($table)
case 'pbms_dump' : case 'pbms_dump' :
return TRUE; return TRUE;
} }
return FALSE; return FALSE;
} }
@@ -461,18 +460,17 @@ function PMA_BS_getURL($reference)
{ {
// load PMA configuration // load PMA configuration
$PMA_Config = $GLOBALS['PMA_Config']; $PMA_Config = $GLOBALS['PMA_Config'];
if (empty($PMA_Config)) if (empty($PMA_Config)) {
return FALSE; return FALSE;
}
// retrieve BS server variables from PMA configuration // retrieve BS server variables from PMA configuration
$bs_server = $PMA_Config->get('BLOBSTREAMING_SERVER'); $bs_server = $PMA_Config->get('BLOBSTREAMING_SERVER');
if (empty($bs_server)) if (empty($bs_server)) {
return FALSE; return FALSE;
$bs_url = 'http://' . $bs_server . '/' . rtrim($reference);
//PMA_showMessage(" PMA_BS_getURL($reference): $bs_url");
return $bs_url;
} }
$bs_url = 'http://' . $bs_server . '/' . rtrim($reference);
return $bs_url;
}
?> ?>

View File

@@ -797,7 +797,6 @@ function PMA_getTableList($db, $tables = null, $limit_offset = 0, $limit_count =
continue; continue;
} }
// check for correct row count // check for correct row count
if (null === $table['Rows']) { if (null === $table['Rows']) {
// Do not check exact row count here, // Do not check exact row count here,

View File

@@ -312,9 +312,10 @@ function PMA_getTableCount($db)
// do not count hidden blobstreaming tables // do not count hidden blobstreaming tables
while ((($num_tables > 0)) && $data = PMA_DBI_fetch_assoc($tables)) { while ((($num_tables > 0)) && $data = PMA_DBI_fetch_assoc($tables)) {
if (PMA_BS_IsHiddenTable($data['Tables_in_' . $db])) if (PMA_BS_IsHiddenTable($data['Tables_in_' . $db])) {
$num_tables--; $num_tables--;
} }
}
PMA_DBI_free_result($tables); PMA_DBI_free_result($tables);
} else { } else {

View File

@@ -1285,7 +1285,6 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
$vertical_display['data'][$row_no][$i] = ' <td align="right"' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '"><i>NULL</i></td>' . "\n"; $vertical_display['data'][$row_no][$i] = ' <td align="right"' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '"><i>NULL</i></td>' . "\n";
} else { } else {
// for blobstreaming // for blobstreaming
// if valid BS reference exists // if valid BS reference exists
if (PMA_BS_IsPBMSReference($row[$i], $db)) { if (PMA_BS_IsPBMSReference($row[$i], $db)) {
$blobtext = PMA_BS_CreateReferenceLink($row[$i], $db); $blobtext = PMA_BS_CreateReferenceLink($row[$i], $db);
@@ -1341,8 +1340,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
// fields // fields
if ($_SESSION['tmp_user_values']['display_binary_as_hex'] && PMA_contains_nonprintable_ascii($row[$i])) { if ($_SESSION['tmp_user_values']['display_binary_as_hex'] && PMA_contains_nonprintable_ascii($row[$i])) {
$row[$i] = bin2hex($row[$i]); $row[$i] = bin2hex($row[$i]);
} } else {
else {
$row[$i] = htmlspecialchars(PMA_replace_binary_contents($row[$i])); $row[$i] = htmlspecialchars(PMA_replace_binary_contents($row[$i]));
} }
} else { } else {

View File

@@ -91,7 +91,7 @@ class PMA_StorageEngine_pbms extends PMA_StorageEngine
function getPageDocumentation() function getPageDocumentation()
{ {
$output = '<p> Documentation and furtther information about PBMS can be found on ' . "\n" $output = '<p> Documentation and further information about PBMS can be found on ' . "\n"
. '<a href="http://www.blobstreaming.org/" target="_blank">The PrimeBase Media Streaming home page</a>.<br><br>' . "\n" . '<a href="http://www.blobstreaming.org/" target="_blank">The PrimeBase Media Streaming home page</a>.<br><br>' . "\n"
. '<table id="PBMS_Related_Links" >' . "\n" . '<table id="PBMS_Related_Links" >' . "\n"
. '<tr>' . "\n" . '<tr>' . "\n"

View File

@@ -121,7 +121,7 @@ class PMA_StorageEngine_pbxt extends PMA_StorageEngine
function getPageDocumentation() function getPageDocumentation()
{ {
$output = '<p> Documentation and furtther information about PBXT can be found on the ' . "\n" $output = '<p> Documentation and further information about PBXT can be found on the ' . "\n"
. '<a href="http://www.primebase.com/xt/" target="_blank">PrimeBase XT Home Page</a>.<br><br>' . "\n" . '<a href="http://www.primebase.com/xt/" target="_blank">PrimeBase XT Home Page</a>.<br><br>' . "\n"
. '<table id="PBMS_Related_Links" >' . "\n" . '<table id="PBMS_Related_Links" >' . "\n"
. '<tr>' . "\n" . '<tr>' . "\n"

View File

@@ -1,9 +1,8 @@
<?php <?php
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* display list of server enignes and additonal information about them * display list of server engines and additonal information about them
* *
* @todo falcon storage enginge is not listed under dev.mysql.com/doc/refman but dev.mysql.com/doc/falcon/
* @package phpMyAdmin * @package phpMyAdmin
*/ */

View File

@@ -889,8 +889,7 @@ foreach ($rows as $row_id => $vrow) {
if ($is_upload && $field['is_blob']) { if ($is_upload && $field['is_blob']) {
// check if field type is of longblob and if the table is PBMS enabled. // check if field type is of longblob and if the table is PBMS enabled.
if (($field['pma_type'] == "longblob") && PMA_BS_IsTablePBMSEnabled($db_name, $tbl_name, $tbl_type)) if (($field['pma_type'] == "longblob") && PMA_BS_IsTablePBMSEnabled($db_name, $tbl_name, $tbl_type)) {
{
echo '<br />'; echo '<br />';
echo '<input type="checkbox" name="upload_blob_repo_' . $field['Field_md5'] . $vkey . '" /> ' . __('Upload to BLOB repository'); echo '<input type="checkbox" name="upload_blob_repo_' . $field['Field_md5'] . $vkey . '" /> ' . __('Upload to BLOB repository');
} }