From c8b458f53fa7661af186c003e8987c457f5f0be1 Mon Sep 17 00:00:00 2001 From: ablat7ihlim Date: Thu, 29 Jul 2010 07:45:25 +0200 Subject: [PATCH 1/8] Translation update done using Pootle. --- po/ug.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/po/ug.po b/po/ug.po index e06c396c8..a568d61d2 100644 --- a/po/ug.po +++ b/po/ug.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: phpMyAdmin 3.4.0-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2010-07-28 05:45-0400\n" -"PO-Revision-Date: 2010-07-28 04:52+0200\n" -"Last-Translator: \n" +"PO-Revision-Date: 2010-07-29 07:45+0200\n" +"Last-Translator: \n" "Language-Team: Uyghur \n" +"Language: ug\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ug\n" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Pootle 2.0.1\n" @@ -1971,7 +1971,7 @@ msgstr "" #: libraries/display_export.lib.php:145 msgid "server name" -msgstr "" +msgstr "مۇلازىمىتىر ئىسمى" #: libraries/display_export.lib.php:148 msgid "database name" From c4eba6a3b55c63cc25480bba16bd765a3812a9d0 Mon Sep 17 00:00:00 2001 From: ablat7ihlim Date: Thu, 29 Jul 2010 07:50:41 +0200 Subject: [PATCH 2/8] Translation update done using Pootle. --- po/ug.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/po/ug.po b/po/ug.po index a568d61d2..9de9c20b0 100644 --- a/po/ug.po +++ b/po/ug.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: phpMyAdmin 3.4.0-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2010-07-28 05:45-0400\n" -"PO-Revision-Date: 2010-07-29 07:45+0200\n" +"PO-Revision-Date: 2010-07-29 07:50+0200\n" "Last-Translator: \n" "Language-Team: Uyghur \n" "Language: ug\n" @@ -1975,7 +1975,7 @@ msgstr "مۇلازىمىتىر ئىسمى" #: libraries/display_export.lib.php:148 msgid "database name" -msgstr "" +msgstr "ساندان ئىسمى" #: libraries/display_export.lib.php:151 msgid "table name" From 09fd3ecc33d602c2ebdaea63b2f3df3ee8c979b1 Mon Sep 17 00:00:00 2001 From: ablat7ihlim Date: Thu, 29 Jul 2010 07:51:09 +0200 Subject: [PATCH 3/8] Translation update done using Pootle. --- po/ug.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/po/ug.po b/po/ug.po index 9de9c20b0..b42fc0ab3 100644 --- a/po/ug.po +++ b/po/ug.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: phpMyAdmin 3.4.0-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2010-07-28 05:45-0400\n" -"PO-Revision-Date: 2010-07-29 07:50+0200\n" +"PO-Revision-Date: 2010-07-29 07:51+0200\n" "Last-Translator: \n" "Language-Team: Uyghur \n" "Language: ug\n" @@ -1979,7 +1979,7 @@ msgstr "ساندان ئىسمى" #: libraries/display_export.lib.php:151 msgid "table name" -msgstr "" +msgstr "سانلىق مەلۇمات جەدىۋېلى ئىسمى" #: libraries/display_export.lib.php:155 #, php-format From 279a8f8f21dfdd595e05fe8cc570caf723b18445 Mon Sep 17 00:00:00 2001 From: Barry Leslie Date: Fri, 23 Jul 2010 08:06:24 -0700 Subject: [PATCH 4/8] The use of PBMS is not dependent on a primary key --- libraries/blobstreaming.lib.php | 30 ------------------------------ tbl_replace.php | 6 +----- 2 files changed, 1 insertion(+), 35 deletions(-) diff --git a/libraries/blobstreaming.lib.php b/libraries/blobstreaming.lib.php index 17a05e08f..b0938521c 100644 --- a/libraries/blobstreaming.lib.php +++ b/libraries/blobstreaming.lib.php @@ -494,34 +494,4 @@ function PMA_BS_getURL($reference) return $bs_url; } -/** - * returns the field name for a primary key of a given table in a given database - * - * @access public - * @param string - database name - * @param string - table name - * @uses PMA_DBI_select_db() - * @uses PMA_backquote() - * @uses PMA_DBI_query() - * @uses PMA_DBI_fetch_assoc() - * @return string - field name for primary key -*/ -function PMA_BS_GetPrimaryField($db_name, $tbl_name) -{ - // select specified database - PMA_DBI_select_db($db_name); - - // retrieve table fields - $query = "SHOW FULL FIELDS FROM " . PMA_backquote($tbl_name); - $result = PMA_DBI_query($query); - - // while there are records to parse - while ($data = PMA_DBI_fetch_assoc($result)) { - if ("PRI" == $data['Key']) { - return $data['Field']; - } - } - // return NULL on no primary key - return NULL; -} ?> diff --git a/tbl_replace.php b/tbl_replace.php index 92331b9c3..6d4fd83da 100644 --- a/tbl_replace.php +++ b/tbl_replace.php @@ -210,10 +210,6 @@ foreach ($loop_array as $rowcount => $where_clause) { ? $_REQUEST['auto_increment']['multi_edit'][$rowcount] : null; - if ($blob_streaming_active) { - $primary_field = PMA_BS_GetPrimaryField($GLOBALS['db'], $GLOBALS['table']); - } - // Fetch the current values of a row to use in case we have a protected field // @todo possibly move to ./libraries/tbl_replace_fields.inc.php if ($is_insert && $using_key && isset($me_fields_type) && is_array($me_fields_type) && isset($where_clause)) { @@ -226,7 +222,7 @@ foreach ($loop_array as $rowcount => $where_clause) { require './libraries/tbl_replace_fields.inc.php'; // for blobstreaming - if ($blob_streaming_active && (NULL != $primary_field || strlen($primary_field) > 0)) { + if ($blob_streaming_active) { $remove_blob_repo = isset($_REQUEST['remove_blob_repo_' . $key]) ? $_REQUEST['remove_blob_repo_' . $key] : NULL; $upload_blob_repo = isset($_REQUEST['upload_blob_repo_' . $key]) ? $_REQUEST['upload_blob_repo_' . $key] : NULL; From 92a54bc0e2aadb3e123cfeb4f1f995e11b22df99 Mon Sep 17 00:00:00 2001 From: Barry Leslie Date: Fri, 23 Jul 2010 09:07:31 -0700 Subject: [PATCH 5/8] Check for pbms functions. --- libraries/blobstreaming.lib.php | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/libraries/blobstreaming.lib.php b/libraries/blobstreaming.lib.php index b0938521c..1a49ed92e 100644 --- a/libraries/blobstreaming.lib.php +++ b/libraries/blobstreaming.lib.php @@ -121,6 +121,33 @@ function checkBLOBStreamingPlugins() return FALSE; } // end if (count($bs_variables) <= 0) + // Check that the required pbms functions exist: + if ((function_exists("pbms_connect") == FALSE) || + (function_exists("pbms_error") == FALSE) || + (function_exists("pbms_close") == FALSE) || + (function_exists("pbms_is_blob_reference") == FALSE) || + (function_exists("pbms_get_info") == FALSE) || + (function_exists("pbms_get_metadata_value") == FALSE) || + (function_exists("pbms_add_metadata") == FALSE) || + (function_exists("pbms_read_stream") == FALSE)) { + + // We should probably notify the user that they need to install + // the pbms client lib and PHP extension to make use of blob streaming. + $PMA_Config->set('BLOBSTREAMING_PLUGINS_EXIST', FALSE); + PMA_cacheSet('skip_blobstreaming', true, true); + return FALSE; + } + + if (function_exists("pbms_connection_pool_size")) { + if ( $PMA_Config->settings['pbms_connection_pool_size'] == "") { + $pool_size = 1; + } else { + $pool_size = $PMA_Config->settings['pbms_connection_pool_size']; + } + + pbms_connection_pool_size($pool_size); + } + // get BS server port $BS_PORT = $bs_variables['pbms_port']; @@ -151,7 +178,7 @@ function checkBLOBStreamingPlugins() $PMA_Config->set('BLOBSTREAMING_SERVER', $serverCfg['host'] . ':' . $BS_PORT); $PMA_Config->set('PHP_PBMS_EXISTS', FALSE); $PMA_Config->set('FILEINFO_EXISTS', FALSE); - + // check if PECL's fileinfo library exist $finfo = NULL; From c1bf8133cd5c0d0da463f11e25b9c84eb4bede38 Mon Sep 17 00:00:00 2001 From: Barry Leslie Date: Wed, 28 Jul 2010 12:24:41 -0700 Subject: [PATCH 6/8] fixed pbms_connection_pool_size problem --- libraries/blobstreaming.lib.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/libraries/blobstreaming.lib.php b/libraries/blobstreaming.lib.php index 1a49ed92e..f0f74c81e 100644 --- a/libraries/blobstreaming.lib.php +++ b/libraries/blobstreaming.lib.php @@ -139,12 +139,14 @@ function checkBLOBStreamingPlugins() } if (function_exists("pbms_connection_pool_size")) { - if ( $PMA_Config->settings['pbms_connection_pool_size'] == "") { - $pool_size = 1; - } else { + if ( isset($PMA_Config->settings['pbms_connection_pool_size'])) { $pool_size = $PMA_Config->settings['pbms_connection_pool_size']; - } - + if ($pool_size == "") + $pool_size = 1; + } else { + $pool_size = 1; + } + pbms_connection_pool_size($pool_size); } @@ -317,7 +319,14 @@ function PMA_BS_IsPBMSReference($bs_reference, $db_name) } // You do not really need a connection to the PBMS Daemon - // to check if a reference looks valid. + // to check if a reference looks valid but unfortunalty the API + // requires one at this point so until the API is updated + // we need to oepen one here. If you use pool connections this + // will not be a performance problem. + if (PMA_do_connect($db_name, FALSE) == FALSE) { + return FALSE; + } + $ok = pbms_is_blob_reference($bs_reference); return $ok ; } From 3e666e94de7dfcd092dd9fdbf838b88039bdb46c Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Thu, 29 Jul 2010 10:23:45 -0400 Subject: [PATCH 7/8] code and comments cleanup --- libraries/blobstreaming.lib.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libraries/blobstreaming.lib.php b/libraries/blobstreaming.lib.php index f0f74c81e..adc0b1436 100644 --- a/libraries/blobstreaming.lib.php +++ b/libraries/blobstreaming.lib.php @@ -141,13 +141,13 @@ function checkBLOBStreamingPlugins() if (function_exists("pbms_connection_pool_size")) { if ( isset($PMA_Config->settings['pbms_connection_pool_size'])) { $pool_size = $PMA_Config->settings['pbms_connection_pool_size']; - if ($pool_size == "") + if ($pool_size == "") { $pool_size = 1; - } else { + } + } else { $pool_size = 1; - } - - pbms_connection_pool_size($pool_size); + } + pbms_connection_pool_size($pool_size); } // get BS server port @@ -180,7 +180,7 @@ function checkBLOBStreamingPlugins() $PMA_Config->set('BLOBSTREAMING_SERVER', $serverCfg['host'] . ':' . $BS_PORT); $PMA_Config->set('PHP_PBMS_EXISTS', FALSE); $PMA_Config->set('FILEINFO_EXISTS', FALSE); - + // check if PECL's fileinfo library exist $finfo = NULL; @@ -320,8 +320,8 @@ function PMA_BS_IsPBMSReference($bs_reference, $db_name) // You do not really need a connection to the PBMS Daemon // to check if a reference looks valid but unfortunalty the API - // requires one at this point so until the API is updated - // we need to oepen one here. If you use pool connections this + // requires one at this point so until the API is updated + // we need to epen one here. If you use pool connections this // will not be a performance problem. if (PMA_do_connect($db_name, FALSE) == FALSE) { return FALSE; From 148eab912112004aab23f27138f93406d87b00f0 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sat, 31 Jul 2010 07:07:02 -0400 Subject: [PATCH 8/8] must set the LONGBLOB field to NULL to remove a BLOB reference --- tbl_replace.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tbl_replace.php b/tbl_replace.php index 6d4fd83da..e372bd0ab 100644 --- a/tbl_replace.php +++ b/tbl_replace.php @@ -230,7 +230,7 @@ foreach ($loop_array as $rowcount => $where_clause) { if (isset($remove_blob_repo) && ! isset($upload_blob_repo)) { $remove_blob_reference = $_REQUEST['remove_blob_ref_' . $key]; if (isset($remove_blob_reference)) { - $val = "''"; + $val = "NULL"; } }