diff --git a/libraries/blobstreaming.lib.php b/libraries/blobstreaming.lib.php index 5bfb8683a..a1419ebdd 100644 --- a/libraries/blobstreaming.lib.php +++ b/libraries/blobstreaming.lib.php @@ -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; @@ -324,6 +325,9 @@ function PMA_BS_IsTablePBMSEnabled($db_name, $tbl_name, $tbl_type) // return if unable to load PMA configuration 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"; diff --git a/server_engines.php b/server_engines.php index eab5e63ce..2179f5fe8 100644 --- a/server_engines.php +++ b/server_engines.php @@ -80,17 +80,21 @@ if (empty($_REQUEST['engine']) . '' . "\n"; $odd_row = !$odd_row; } - // Special case for PBMS daemon which is not listed as an engine - echo '' . "\n" - . ' ' . "\n" - . ' ' . "PBMS\n" - . ' ' . "\n" - . ' ' . htmlspecialchars("PrimeBase BLOB streaming daemon") . '' . "\n" - . '' . "\n"; - + + $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 '' . "\n" + . ' ' . "\n" + . ' ' . "PBMS\n" + . ' ' . "\n" + . ' ' . htmlspecialchars("PrimeBase MediaStream (PBMS) daemon") . '' . "\n" + . '' . "\n"; + } + unset($odd_row, $engine, $details); echo '' . "\n" . '' . "\n";