Update blob streaming to match the current API and use the PBMS PHP extension.

This commit is contained in:
Barry Leslie
2010-07-12 15:39:06 -07:00
committed by Marc Delisle
parent e65625ce1e
commit f8653e5803
16 changed files with 428 additions and 1216 deletions

View File

@@ -19,9 +19,6 @@ require_once './libraries/common.inc.php';
require_once './libraries/Table.class.php';
require_once './libraries/mysql_charsets.lib.php';
// add blobstreaming library functions
require_once "./libraries/blobstreaming.lib.php";
/**
* Rename/move or copy database
*/
@@ -260,65 +257,6 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) {
}
}
/*
* Enable/Disable/Repair BLOB Repository Monitoring for current database
*/
if (strlen($db) > 0 && !empty($db_blob_streaming_op))
{
// load PMA_Config
$PMA_Config = $GLOBALS['PMA_Config'];
if (!empty($PMA_Config))
{
if ($PMA_Config->get('PBXT_NAME') !== strtolower($db))
{
// if Blobstreaming plugins exist, begin checking for Blobstreaming tables
if ($PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST'))
{
$bs_tables = $PMA_Config->get('BLOBSTREAMABLE_DATABASES');
$bs_tables = $bs_tables[$db];
$oneBSTableExists = FALSE;
// check if at least one blobstreaming table exists
foreach ($bs_tables as $table_key=>$tbl)
if ($bs_tables[$table_key]['Exists'])
{
$oneBSTableExists = TRUE;
break;
}
switch ($db_blob_streaming_op)
{
// enable BLOB repository monitoring
case "enable":
// if blobstreaming tables do not exist, create them
if (!$oneBSTableExists)
PMA_BS_CreateTables($db);
break;
// disable BLOB repository monitoring
case "disable":
// if at least one blobstreaming table exists, execute drop
if ($oneBSTableExists)
PMA_BS_DropTables($db);
break;
// repair BLOB repository
case "repair":
// check if a blobstreaming table is missing
foreach ($bs_tables as $table_key=>$tbl)
if (!$bs_tables[$table_key]['Exists'])
{
PMA_DBI_select_db($db);
PMA_DBI_query(PMA_BS_GetTableStruct($table_key));
}
}
// refresh side menu
PMA_sendHeaderLocation($cfg['PmaAbsoluteUri'] . 'db_operations.php?' . PMA_generate_common_url ('','', '&') . (isset($db) ? '&db=' . urlencode($db) : '') . (isset($token) ? '&token=' . urlencode($token) : '') . (isset($goto) ? '&goto=' . urlencode($goto) : '') . 'reload=1&purge=1');
} // end if ($PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST'))
} // end if ($PMA_Config->get('PBXT_NAME') !== strtolower($db))
}
}
/**
* Settings for relations stuff