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,19 +32,17 @@
// 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';
// redirect to specified page // redirect to specified page
?> ?>
<script> <script>
window.location = "<?php echo $newLoc ?>"; window.location = "<?php echo $newLoc ?>";
</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,8 +59,9 @@ 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;

View File

@@ -15,7 +15,7 @@
$mediaType = isset($_REQUEST['media_type']) ? $_REQUEST['media_type'] : NULL; $mediaType = isset($_REQUEST['media_type']) ? $_REQUEST['media_type'] : NULL;
/* /*
* @var string indicates whether media type is of custom type * @var string indicates whether media type is of custom type
*/ */
$customType = isset($_REQUEST['custom_type']) ? $_REQUEST['custom_type'] : false; $customType = isset($_REQUEST['custom_type']) ? $_REQUEST['custom_type'] : false;
@@ -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)) {
if (empty($bs_file_path)) die('No blob streaming server configured!'); die(__('No blob streaming server configured!'));
} }
}
?> ?>
<html> <html>
<head> <head>

View File

@@ -150,17 +150,13 @@ $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; }
}
// Get valid statistics whatever is the table type // Get valid statistics whatever is the table type

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)
{
$this->_error_message = $GLOBALS['strUploadErrorUnknown'];
return FALSE;
}
$blob_url = PMA_BS_UpLoadFile($bs_db, $bs_table, $tmp_file_type, $tmp_filename);
PMA_File::setRecentBLOBReference($blob_url);
if (! $bs_db || ! $bs_table) {
$this->_error_message = $GLOBALS['strUploadErrorUnknown'];
return FALSE;
}
$blob_url = PMA_BS_UpLoadFile($bs_db, $bs_table, $tmp_file_type, $tmp_filename);
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 {
} // no fileinfo library exists, use file command
else // 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)
{
$this->_error_message = $GLOBALS['strUploadErrorUnknown'];
return FALSE;
}
$blob_url = PMA_BS_UpLoadFile($bs_db, $bs_table, $tmp_file_type, $tmp_filename);
PMA_File::setRecentBLOBReference($blob_url);
if (! $bs_db || !$bs_table) {
$this->_error_message = $GLOBALS['strUploadErrorUnknown'];
return FALSE;
}
$blob_url = PMA_BS_UpLoadFile($bs_db, $bs_table, $tmp_file_type, $tmp_filename);
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]);
} }
@@ -303,7 +304,7 @@ class PMA_StorageEngine
$this->support = PMA_ENGINE_SUPPORT_NO; $this->support = PMA_ENGINE_SUPPORT_NO;
} }
} else { } else {
$this->engine_init(); $this->engine_init();
} }
} }

View File

@@ -6,36 +6,38 @@
function initPBMSDatabase() function initPBMSDatabase()
{ {
$query = "create database IF NOT EXISTS pbms;"; // If no other choice then try this. $query = "create database IF NOT EXISTS pbms;"; // If no other choice then try this.
/* /*
* The user may not have privileges to create the 'pbms' database * The user may not have privileges to create the 'pbms' database
* so if it doesn't exist then we perform a select on a pbms system * so if it doesn't exist then we perform a select on a pbms system
* table in an already existing database which will cause the PBMS * table in an already existing database which will cause the PBMS
* daemon to create the 'pbms' database. * daemon to create the 'pbms' database.
*/ */
$db_array =PMA_DBI_fetch_result('SHOW DATABASES;'); $db_array = PMA_DBI_fetch_result('SHOW DATABASES;');
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;
} }
/** /**
* checks whether the necessary plugins for BLOBStreaming exist * checks whether the necessary plugins for BLOBStreaming exist
@@ -95,23 +97,23 @@ function checkBLOBStreamingPlugins()
// Retrieve MySQL plugins // Retrieve MySQL plugins
$existing_plugins = PMA_DBI_fetch_result('SHOW PLUGINS'); $existing_plugins = PMA_DBI_fetch_result('SHOW PLUGINS');
foreach ($existing_plugins as $one_existing_plugin) { foreach ($existing_plugins as $one_existing_plugin) {
// check if required plugins exist // check if required plugins exist
if ( strtolower($one_existing_plugin['Library']) == 'libpbms.so' if ( strtolower($one_existing_plugin['Library']) == 'libpbms.so'
&& $one_existing_plugin['Status'] == "ACTIVE") { && $one_existing_plugin['Status'] == "ACTIVE") {
$has_blobstreaming = true; $has_blobstreaming = true;
break; break;
} }
} }
unset($existing_plugins, $one_existing_plugin); unset($existing_plugins, $one_existing_plugin);
} }
// set variable indicating BS plugin existence // set variable indicating BS plugin existence
$PMA_Config->set('BLOBSTREAMING_PLUGINS_EXIST', $has_blobstreaming); $PMA_Config->set('BLOBSTREAMING_PLUGINS_EXIST', $has_blobstreaming);
if ($has_blobstreaming) { if ($has_blobstreaming) {
$bs_variables = PMA_BS_GetVariables(); $bs_variables = PMA_BS_GetVariables();
// if no BS variables exist, set plugin existence to false and return // if no BS variables exist, set plugin existence to false and return
if (count($bs_variables) <= 0) { if (count($bs_variables) <= 0) {
$PMA_Config->set('BLOBSTREAMING_PLUGINS_EXIST', FALSE); $PMA_Config->set('BLOBSTREAMING_PLUGINS_EXIST', FALSE);
@@ -136,7 +138,7 @@ function checkBLOBStreamingPlugins()
$PMA_Config->set('PHP_PBMS_EXISTS', FALSE); $PMA_Config->set('PHP_PBMS_EXISTS', FALSE);
$PMA_Config->set('FILEINFO_EXISTS', FALSE); $PMA_Config->set('FILEINFO_EXISTS', FALSE);
// check if PECL's fileinfo library exist // check if PECL's fileinfo library exist
$finfo = NULL; $finfo = NULL;
if (function_exists("finfo_open")) { if (function_exists("finfo_open")) {
@@ -148,7 +150,7 @@ function checkBLOBStreamingPlugins()
$PMA_Config->set('FILEINFO_EXISTS', TRUE); $PMA_Config->set('FILEINFO_EXISTS', TRUE);
finfo_close($finfo); finfo_close($finfo);
} // end if (!empty($finfo)) } // end if (!empty($finfo))
} else { } else {
PMA_cacheSet('skip_blobstreaming', true, true); PMA_cacheSet('skip_blobstreaming', true, true);
return FALSE; return FALSE;
@@ -223,8 +225,8 @@ function PMA_BS_GetVariables()
//======================== //========================
function PMA_BS_ReportPBMSError($msg) function PMA_BS_ReportPBMSError($msg)
{ {
$tmp_err = pbms_error(); $tmp_err = pbms_error();
PMA_showMessage("PBMS error, $msg $tmp_err"); PMA_showMessage("PBMS error, $msg $tmp_err");
} }
//------------ //------------
@@ -238,20 +240,21 @@ function PMA_do_connect($db_name, $quiet)
// generate bs reference link // generate bs reference link
$pbms_host = $PMA_Config->get('BLOBSTREAMING_HOST'); $pbms_host = $PMA_Config->get('BLOBSTREAMING_HOST');
$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;
} }
//------------ //------------
function PMA_do_disconnect() function PMA_do_disconnect()
{ {
pbms_close(); pbms_close();
} }
//------------ //------------
@@ -261,76 +264,76 @@ 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) {
return FALSE; if (PMA_do_connect($db_name, TRUE) == FALSE) {
} return FALSE;
}
$ok = pbms_is_blob_reference($bs_reference); $ok = pbms_is_blob_reference($bs_reference);
PMA_do_disconnect(); PMA_do_disconnect();
return $ok ; return $ok ;
} }
//------------ //------------
function PMA_BS_CreateReferenceLink($bs_reference, $db_name) function PMA_BS_CreateReferenceLink($bs_reference, $db_name)
{ {
if (PMA_do_connect($db_name, FALSE) == FALSE) { if (PMA_do_connect($db_name, FALSE) == FALSE) {
return 'Error'; return 'Error';
} }
if (pbms_get_info($bs_reference) == FALSE) { if (pbms_get_info($bs_reference) == FALSE) {
PMA_BS_ReportPBMSError("PBMS get BLOB info failed: pbms_get_info($bs_reference)"); PMA_BS_ReportPBMSError("PBMS get BLOB info failed: pbms_get_info($bs_reference)");
PMA_do_disconnect(); PMA_do_disconnect();
return 'Error'; return 'Error';
} }
$content_type = pbms_get_metadata_value("Content-type"); $content_type = pbms_get_metadata_value("Content-type");
if ($content_type == FALSE) { if ($content_type == FALSE) {
PMA_BS_ReportPBMSError("PMA_BS_CreateReferenceLink($bs_reference, $db_name): get BLOB Content-type failed: "); PMA_BS_ReportPBMSError("PMA_BS_CreateReferenceLink($bs_reference, $db_name): get BLOB Content-type failed: ");
} }
PMA_do_disconnect();
if (!$content_type)
$content_type = "image/jpeg";
$bs_url = PMA_BS_getURL($bs_reference); PMA_do_disconnect();
if (empty($bs_url)) {
PMA_BS_ReportPBMSError("No blob streaming server configured!"); if (! $content_type) {
return 'Error'; $content_type = "image/jpeg";
}
$bs_url = PMA_BS_getURL($bs_reference);
if (empty($bs_url)) {
PMA_BS_ReportPBMSError("No blob streaming server configured!");
return 'Error';
} }
$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 $output = "<a href=\"#\" onclick=\"requestMIMETypeChange('" . urlencode($db_name) . "', '" . urlencode($GLOBALS['table']) . "', '" . urlencode($bs_reference) . "', '" . urlencode($content_type) . "')\">$content_type</a>";
switch ($content_type)
{ // specify custom HTML for various content types
// no content specified switch ($content_type) {
case NULL: // no content specified
$output = "NULL"; case NULL:
break; $output = "NULL";
// image content break;
case 'image/jpeg': // image content
case 'image/png': case 'image/jpeg':
$output .= ' (<a href="' . $bs_url . '" target="new">' . __('View image') . '</a>)'; case 'image/png':
break; $output .= ' (<a href="' . $bs_url . '" target="new">' . __('View image') . '</a>)';
break;
// audio content // audio content
case 'audio/mpeg': case 'audio/mpeg':
$output .= ' (<a href="#" onclick="popupBSMedia(\'' . PMA_generate_common_url() . '\',\'' . urlencode($bs_reference) . '\', \'' . urlencode($content_type) . '\',' . ($is_custom_type ? 1 : 0) . ', 640, 120)">' . __('Play audio'). '</a>)'; $output .= ' (<a href="#" onclick="popupBSMedia(\'' . PMA_generate_common_url() . '\',\'' . urlencode($bs_reference) . '\', \'' . urlencode($content_type) . '\',' . ($is_custom_type ? 1 : 0) . ', 640, 120)">' . __('Play audio'). '</a>)';
break; break;
// video content // video content
case 'application/x-flash-video': case 'application/x-flash-video':
case 'video/mpeg': case 'video/mpeg':
$output .= ' (<a href="#" onclick="popupBSMedia(\'' . PMA_generate_common_url() . '\',\'' . urlencode($bs_reference) . '\', \'' . urlencode($content_type) . '\',' . ($is_custom_type ? 1 : 0) . ', 640, 480)">' . __('View video') . '</a>)'; $output .= ' (<a href="#" onclick="popupBSMedia(\'' . PMA_generate_common_url() . '\',\'' . urlencode($bs_reference) . '\', \'' . urlencode($content_type) . '\',' . ($is_custom_type ? 1 : 0) . ', 640, 480)">' . __('View video') . '</a>)';
break; break;
// unsupported content. specify download // unsupported content. specify download
default: default:
$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,31 +343,36 @@ 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))
return FALSE; if ((isset($tbl_type) == FALSE) || (strlen($tbl_type) == 0)) {
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";
$query = "SELECT count(*) FROM pbms.pbms_enabled E where E.name = '". PMA_sqlAddslashes($tbl_type) . "'" ; $query = "SELECT count(*) FROM pbms.pbms_enabled E where E.name = '" . PMA_sqlAddslashes($tbl_type) . "'";
$result = PMA_DBI_query($query); $result = PMA_DBI_query($query);
$data = PMA_DBI_fetch_row($result);
if ($data[0] == 1) {
return TRUE;
}
$data = PMA_DBI_fetch_row($result);
if ($data[0] == 1)
return TRUE;
return FALSE; return FALSE;
} }
@@ -372,107 +380,97 @@ 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;
} }
$fh = fopen($file_name, 'r'); $fh = fopen($file_name, 'r');
if (!$fh) { if (! $fh) {
PMA_do_disconnect(); PMA_do_disconnect();
PMA_showMessage("Could not open file: $file_name"); PMA_showMessage("Could not open file: $file_name");
return FALSE; return FALSE;
}
pbms_add_metadata("Content-type", $file_type);
$pbms_blob_url = pbms_read_stream($fh, filesize($file_name), $tbl_name);
if (!$pbms_blob_url) {
PMA_BS_ReportPBMSError("pbms_read_stream() Failed");
} }
//PMA_showMessage(" PMA_BS_UpLoadFile($db_name, $tbl_name, $file_type, $file_name): $pbms_blob_url"); pbms_add_metadata("Content-type", $file_type);
fclose($fh);
PMA_do_disconnect(); $pbms_blob_url = pbms_read_stream($fh, filesize($file_name), $tbl_name);
return $pbms_blob_url; if (! $pbms_blob_url) {
PMA_BS_ReportPBMSError("pbms_read_stream() Failed");
}
fclose($fh);
PMA_do_disconnect();
return $pbms_blob_url;
} }
//------------ //------------
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
// more eficient. // more eficient.
$query = "SELECT Repository_id, Repo_blob_offset FROM pbms_reference WHERE Blob_url='" . PMA_sqlAddslashes($blobReference) . "'"; $query = "SELECT Repository_id, Repo_blob_offset FROM pbms_reference WHERE Blob_url='" . PMA_sqlAddslashes($blobReference) . "'";
//error_log(" PMA_BS_SetContentType: $query\n", 3, "/tmp/mylog"); //error_log(" PMA_BS_SetContentType: $query\n", 3, "/tmp/mylog");
$result = PMA_DBI_query($query); $result = PMA_DBI_query($query);
//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 {
return FALSE;
} else { }
// if ($result == FALSE) { return TRUE;
// $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 TRUE;
} }
//------------ //------------
function PMA_BS_IsHiddenTable($table) function PMA_BS_IsHiddenTable($table)
{ {
switch ($table) { switch ($table) {
case 'pbms_repository' : case 'pbms_repository' :
case 'pbms_reference' : case 'pbms_reference' :
case 'pbms_metadata' : case 'pbms_metadata' :
case 'pbms_metadata_header' : case 'pbms_metadata_header' :
case 'pbms_dump' : case 'pbms_dump' :
return TRUE; return TRUE;
} }
return FALSE;
return FALSE;
} }
//------------ //------------
function PMA_BS_getURL($reference) 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); $bs_url = 'http://' . $bs_server . '/' . rtrim($reference);
//PMA_showMessage(" PMA_BS_getURL($reference): $bs_url"); return $bs_url;
return $bs_url;
} }
?> ?>

View File

@@ -788,7 +788,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
$_SESSION['PMA_Theme_Manager']->setThemeCookie(); $_SESSION['PMA_Theme_Manager']->setThemeCookie();
if (! empty($cfg['Server'])) { if (! empty($cfg['Server'])) {
/** /**
* Loads the proper database interface for this server * Loads the proper database interface for this server
@@ -953,7 +953,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
// checks for blobstreaming plugins and databases that support // checks for blobstreaming plugins and databases that support
// blobstreaming (by having the necessary tables for blobstreaming) // blobstreaming (by having the necessary tables for blobstreaming)
checkBLOBStreamingPlugins(); checkBLOBStreamingPlugins();
} // end if !defined('PMA_MINIMUM_COMMON') } // end if !defined('PMA_MINIMUM_COMMON')
// remove sensitive values from session // remove sensitive values from session

View File

@@ -654,19 +654,19 @@ function PMA_mysqlDie($error_message = '', $the_query = '',
$back_url .= '?no_history=true'; $back_url .= '?no_history=true';
} }
$_SESSION['Import_message']['go_back_url'] = $back_url; $_SESSION['Import_message']['go_back_url'] = $back_url;
$error_msg_output .= '<fieldset class="tblFooters">'; $error_msg_output .= '<fieldset class="tblFooters">';
$error_msg_output .= '[ <a href="' . $back_url . '">' . __('Back') . '</a> ]'; $error_msg_output .= '[ <a href="' . $back_url . '">' . __('Back') . '</a> ]';
$error_msg_output .= '</fieldset>' . "\n\n"; $error_msg_output .= '</fieldset>' . "\n\n";
} }
echo $error_msg_output; echo $error_msg_output;
/** /**
* display footer and exit * display footer and exit
*/ */
require_once './libraries/footer.inc.php'; require_once './libraries/footer.inc.php';
} else { } else {
echo $error_msg_output; echo $error_msg_output;
} }
@@ -793,10 +793,9 @@ function PMA_getTableList($db, $tables = null, $limit_offset = 0, $limit_count =
foreach ($tables as $table_name => $table) { foreach ($tables as $table_name => $table) {
// if BS tables exist // if BS tables exist
if (PMA_BS_IsHiddenTable($table_name)) { if (PMA_BS_IsHiddenTable($table_name)) {
continue; continue;
} }
// check for correct row count // check for correct row count
if (null === $table['Rows']) { if (null === $table['Rows']) {

View File

@@ -311,10 +311,11 @@ function PMA_getTableCount($db)
$num_tables = PMA_DBI_num_rows($tables); $num_tables = PMA_DBI_num_rows($tables);
// 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,10 +1285,9 @@ 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);
} else { } else {
$blobtext = PMA_handle_non_printable_contents('BLOB', (isset($row[$i]) ? $row[$i] : ''), $transform_function, $transform_options, $default_function, $meta, $_url_params); $blobtext = PMA_handle_non_printable_contents('BLOB', (isset($row[$i]) ? $row[$i] : ''), $transform_function, $transform_options, $default_function, $meta, $_url_params);
} }
@@ -1340,9 +1339,8 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
// user asked to see the real contents of BINARY // user asked to see the real contents of BINARY
// 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 {
@@ -1696,7 +1694,7 @@ function PMA_displayTable_checkConfigParams()
} else { } else {
// display_binary_as_hex config option // display_binary_as_hex config option
if (isset($GLOBALS['cfg']['DisplayBinaryAsHex']) && true === $GLOBALS['cfg']['DisplayBinaryAsHex']) { if (isset($GLOBALS['cfg']['DisplayBinaryAsHex']) && true === $GLOBALS['cfg']['DisplayBinaryAsHex']) {
$_SESSION['tmp_user_values']['query'][$sql_md5]['display_binary_as_hex'] = true; $_SESSION['tmp_user_values']['query'][$sql_md5]['display_binary_as_hex'] = true;
} }
} }

View File

@@ -18,12 +18,12 @@ class PMA_StorageEngine_pbms extends PMA_StorageEngine
*/ */
function engine_init() function engine_init()
{ {
$this->engine = "PBMS"; $this->engine = "PBMS";
$this->title = "PrimeBase Media Streaming Daemon"; $this->title = "PrimeBase Media Streaming Daemon";
$this->comment = "Provides BLOB streaming service for storage engines,"; $this->comment = "Provides BLOB streaming service for storage engines,";
$this->support = PMA_ENGINE_SUPPORT_YES; $this->support = PMA_ENGINE_SUPPORT_YES;
} }
function getVariables() function getVariables()
{ {
return array( return array(
@@ -64,16 +64,16 @@ class PMA_StorageEngine_pbms extends PMA_StorageEngine
), ),
); );
} }
//-------------------- //--------------------
function getInfoPages() function getInfoPages()
{ {
$pages = array(); $pages = array();
$pages['Documentation'] = __('Documentation'); $pages['Documentation'] = __('Documentation');
return $pages; return $pages;
} }
//-------------------- //--------------------
function getPage($id) function getPage($id)
{ {
if (! array_key_exists($id, $this->getInfoPages())) { if (! array_key_exists($id, $this->getInfoPages())) {
@@ -87,27 +87,27 @@ class PMA_StorageEngine_pbms extends PMA_StorageEngine
function getPageConfigure() function getPageConfigure()
{ {
} }
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"
. '<td>' . "\n" . '<td>' . "\n"
. '<p>' . "\n" . '<p>' . "\n"
. '<strong><font size="2"><b>Related Links</b></font></strong>' . "\n" . '<strong><font size="2"><b>Related Links</b></font></strong>' . "\n"
. '<br>' . "\n" . '<br>' . "\n"
. '<a href="http://bpbdev.blogspot.com/" target="_blank">The PrimeBase Media Streaming Blog by Barry Leslie</a><br><br>' . "\n" . '<a href="http://bpbdev.blogspot.com/" target="_blank">The PrimeBase Media Streaming Blog by Barry Leslie</a><br><br>' . "\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"
. '</font>' . "\n" . '</font>' . "\n"
. '</td>' . "\n" . '</td>' . "\n"
. '</tr>' . "\n" . '</tr>' . "\n"
. '</table>' . "\n"; . '</table>' . "\n";
return $output; return $output;
} }
} }
?> ?>

View File

@@ -98,16 +98,16 @@ class PMA_StorageEngine_pbxt extends PMA_StorageEngine
} }
return PMA_formatByteDown($value); return PMA_formatByteDown($value);
} }
//-------------------- //--------------------
function getInfoPages() function getInfoPages()
{ {
$pages = array(); $pages = array();
$pages['Documentation'] = __('Documentation'); $pages['Documentation'] = __('Documentation');
return $pages; return $pages;
} }
//-------------------- //--------------------
function getPage($id) function getPage($id)
{ {
if (! array_key_exists($id, $this->getInfoPages())) { if (! array_key_exists($id, $this->getInfoPages())) {
@@ -121,23 +121,23 @@ 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"
. '<td>' . "\n" . '<td>' . "\n"
. '<p>' . "\n" . '<p>' . "\n"
. '<strong><font size="2"><b>Related Links</b></font></strong>' . "\n" . '<strong><font size="2"><b>Related Links</b></font></strong>' . "\n"
. '<br>' . "\n" . '<br>' . "\n"
. '<a href="http://pbxt.blogspot.com/" target="_blank">The PrimeBase XT Blog by Paul McCullagh</a><br><br>' . "\n" . '<a href="http://pbxt.blogspot.com/" target="_blank">The PrimeBase XT Blog by Paul McCullagh</a><br><br>' . "\n"
. '<a href="http://www.blobstreaming.org/" target="_blank">The PrimeBase Media Streaming (PBMS) home page</a>.<br><br>' . "\n" . '<a href="http://www.blobstreaming.org/" target="_blank">The PrimeBase Media Streaming (PBMS) home page</a>.<br><br>' . "\n"
. '</font>' . "\n" . '</font>' . "\n"
. '</td>' . "\n" . '</td>' . "\n"
. '</tr>' . "\n" . '</tr>' . "\n"
. '</table>' . "\n"; . '</table>' . "\n";
return $output; return $output;
} }
} }
?> ?>

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
*/ */
@@ -81,20 +80,20 @@ if (empty($_REQUEST['engine'])
$odd_row = !$odd_row; $odd_row = !$odd_row;
} }
$PMA_Config = $GLOBALS['PMA_Config']; $PMA_Config = $GLOBALS['PMA_Config'];
if ($PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST')) { if ($PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST')) {
// Special case for PBMS daemon which is not listed as an engine // Special case for PBMS daemon which is not listed as an engine
echo '<tr class="' echo '<tr class="'
. ($odd_row ? 'odd' : 'even') . ($odd_row ? 'odd' : 'even')
. '">' . "\n" . '">' . "\n"
. ' <td><a href="./server_engines.php' . ' <td><a href="./server_engines.php'
. PMA_generate_common_url(array('engine' => "PBMS")) . '">' . "\n" . PMA_generate_common_url(array('engine' => "PBMS")) . '">' . "\n"
. ' ' . "PBMS\n" . ' ' . "PBMS\n"
. ' </a></td>' . "\n" . ' </a></td>' . "\n"
. ' <td>' . htmlspecialchars("PrimeBase MediaStream (PBMS) daemon") . '</td>' . "\n" . ' <td>' . htmlspecialchars("PrimeBase MediaStream (PBMS) daemon") . '</td>' . "\n"
. '</tr>' . "\n"; . '</tr>' . "\n";
} }
unset($odd_row, $engine, $details); unset($odd_row, $engine, $details);
echo '</tbody>' . "\n" echo '</tbody>' . "\n"
. '</table>' . "\n"; . '</table>' . "\n";

View File

@@ -456,17 +456,17 @@ foreach ($rows as $row_id => $vrow) {
} else { } else {
// special binary "characters" // special binary "characters"
if ($field['is_binary'] || ($field['is_blob'] && ! $cfg['ProtectBinary'])) { if ($field['is_binary'] || ($field['is_blob'] && ! $cfg['ProtectBinary'])) {
if ($_SESSION['tmp_user_values']['display_binary_as_hex'] && $cfg['ShowFunctionFields']) { if ($_SESSION['tmp_user_values']['display_binary_as_hex'] && $cfg['ShowFunctionFields']) {
$vrow[$field['Field']] = bin2hex($vrow[$field['Field']]); $vrow[$field['Field']] = bin2hex($vrow[$field['Field']]);
$field['display_binary_as_hex'] = true; $field['display_binary_as_hex'] = true;
} else { } else {
$vrow[$field['Field']] = PMA_replace_binary_contents($vrow[$field['Field']]); $vrow[$field['Field']] = PMA_replace_binary_contents($vrow[$field['Field']]);
} }
} // end if } // end if
$special_chars = htmlspecialchars($vrow[$field['Field']]); $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 //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); $special_chars_encoded = PMA_duplicateFirstNewline($special_chars);
$data = $vrow[$field['Field']]; $data = $vrow[$field['Field']];
} // end if... else... } // end if... else...
@@ -562,9 +562,9 @@ foreach ($rows as $row_id => $vrow) {
} }
// this is set only when appropriate and is always true // this is set only when appropriate and is always true
if (isset($field['display_binary_as_hex'])) { if (isset($field['display_binary_as_hex'])) {
$default_function = 'UNHEX'; $default_function = 'UNHEX';
} }
// loop on the dropdown array and print all available options for that field. // loop on the dropdown array and print all available options for that field.
foreach ($dropdown as $each_dropdown){ foreach ($dropdown as $each_dropdown){
@@ -834,7 +834,7 @@ foreach ($rows as $row_id => $vrow) {
|| ($cfg['ProtectBinary'] == 'all' && $field['is_binary'])) { || ($cfg['ProtectBinary'] == 'all' && $field['is_binary'])) {
echo "\n"; echo "\n";
// for blobstreaming // for blobstreaming
if (PMA_BS_IsTablePBMSEnabled($db, $table, $tbl_type) && PMA_BS_IsPBMSReference($data, $db)) if (PMA_BS_IsTablePBMSEnabled($db, $table, $tbl_type) && PMA_BS_IsPBMSReference($data, $db))
{ {
echo '<input type="hidden" name="remove_blob_ref_' . $field['Field_md5'] . $vkey . '" value="' . $data . '" />'; echo '<input type="hidden" name="remove_blob_ref_' . $field['Field_md5'] . $vkey . '" value="' . $data . '" />';
echo '<input type="checkbox" name="remove_blob_repo_' . $field['Field_md5'] . $vkey . '" /> ' . __('Remove BLOB Repository Reference') . "<br />"; echo '<input type="checkbox" name="remove_blob_repo_' . $field['Field_md5'] . $vkey . '" /> ' . __('Remove BLOB Repository Reference') . "<br />";
@@ -889,10 +889,9 @@ 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');
} }
echo '<br />'; echo '<br />';