Fix problem where PBMS daemon is not loaded or the 'pbms' database doesn't exist.

This commit is contained in:
Barry Leslie
2010-07-15 12:35:52 -07:00
committed by Marc Delisle
parent f8653e5803
commit a8e5b0f275
2 changed files with 23 additions and 15 deletions

View File

@@ -109,10 +109,11 @@ function checkBLOBStreamingPlugins()
$PMA_Config->set('PHP_PBMS_EXISTS', FALSE);
$PMA_Config->set('FILEINFO_EXISTS', FALSE);
// Check to see if the BLOB Streaming PHP extension is loaded
if (extension_loaded("PBMS")) {
$PMA_Config->set('PHP_PBMS_EXISTS', TRUE);
}
// Create the 'pbms' database if it doesn't exist.
// PBMS creates this database automaticly as soon as
// a PBMS enabled table is accessed but we may need it earlier
// when a select is done on pbms.pbms_enabled.
PMA_DBI_query("create database IF NOT EXISTS pbms;" );
// check if PECL's fileinfo library exist
$finfo = NULL;
@@ -325,6 +326,9 @@ function PMA_BS_IsTablePBMSEnabled($db_name, $tbl_name, $tbl_type)
if (empty($PMA_Config))
return FALSE;
if (!$PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST') )
return FALSE;
// 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 pbms.pbms_enabled E where E.name = '". PMA_sqlAddslashes($tbl_type) . "'" ;

View File

@@ -80,6 +80,9 @@ if (empty($_REQUEST['engine'])
. '</tr>' . "\n";
$odd_row = !$odd_row;
}
$PMA_Config = $GLOBALS['PMA_Config'];
if ($PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST')) {
// Special case for PBMS daemon which is not listed as an engine
echo '<tr class="'
. ($odd_row ? 'odd' : 'even')
@@ -88,8 +91,9 @@ if (empty($_REQUEST['engine'])
. PMA_generate_common_url(array('engine' => "PBMS")) . '">' . "\n"
. ' ' . "PBMS\n"
. ' </a></td>' . "\n"
. ' <td>' . htmlspecialchars("PrimeBase BLOB streaming daemon") . '</td>' . "\n"
. ' <td>' . htmlspecialchars("PrimeBase MediaStream (PBMS) daemon") . '</td>' . "\n"
. '</tr>' . "\n";
}
unset($odd_row, $engine, $details);
echo '</tbody>' . "\n"