Git
Threads by month
- ----- 2025 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
July 2010
- 3 participants
- 161 discussions

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_3_5RC1-5913-g790b528
by Marc Delisle 23 Jul '10
by Marc Delisle 23 Jul '10
23 Jul '10
The branch, master has been updated
via 790b52857d269aac40282c85e24845e1fd27b924 (commit)
from 9232e0237244556102c494b0779fc7ebfd30a204 (commit)
- Log -----------------------------------------------------------------
commit 790b52857d269aac40282c85e24845e1fd27b924
Author: Marc Delisle <marc(a)infomarc.info>
Date: Fri Jul 23 09:20:51 2010 -0400
remove tabs
-----------------------------------------------------------------------
Summary of changes:
libraries/blobstreaming.lib.php | 32 ++++++++++++++++----------------
1 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/libraries/blobstreaming.lib.php b/libraries/blobstreaming.lib.php
index 3c614e6..17a05e0 100644
--- a/libraries/blobstreaming.lib.php
+++ b/libraries/blobstreaming.lib.php
@@ -13,7 +13,7 @@ function initPBMSDatabase()
* table in an already existing database which will cause the PBMS
* 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)) {
$target = "";
foreach ($db_array as $current_db) {
@@ -26,7 +26,7 @@ function initPBMSDatabase()
}
}
}
-
+
if ($target != "") {
$query = "select * from $target.pbms_metadata_header"; // If it exists this table will not contain much
}
@@ -100,7 +100,7 @@ function checkBLOBStreamingPlugins()
foreach ($existing_plugins as $one_existing_plugin) {
// check if required plugins exist
if ( strtolower($one_existing_plugin['Library']) == 'libpbms.so'
- && $one_existing_plugin['Status'] == "ACTIVE") {
+ && $one_existing_plugin['Status'] == "ACTIVE") {
$has_blobstreaming = true;
break;
}
@@ -303,16 +303,16 @@ function PMA_BS_CreateReferenceLink($bs_reference, $db_name)
}
if (pbms_get_info(trim($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();
return 'Error';
}
- $content_type = pbms_get_metadata_value("Content-Type");
+ $content_type = pbms_get_metadata_value("Content-Type");
if ($content_type == FALSE) {
$br = trim($bs_reference);
PMA_BS_ReportPBMSError("'$content_type' PMA_BS_CreateReferenceLink('$br', '$db_name'): get BLOB Content-Type failed: ");
- }
+ }
PMA_do_disconnect();
@@ -322,9 +322,9 @@ function PMA_BS_CreateReferenceLink($bs_reference, $db_name)
$bs_url = PMA_BS_getURL($bs_reference);
if (empty($bs_url)) {
- PMA_BS_ReportPBMSError("No blob streaming server configured!");
+ 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>";
@@ -339,7 +339,7 @@ function PMA_BS_CreateReferenceLink($bs_reference, $db_name)
case 'image/png':
$output .= ' (<a href="' . $bs_url . '" target="new">' . __('View image') . '</a>)';
break;
- // audio content
+ // audio content
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>)';
break;
@@ -379,7 +379,7 @@ function PMA_BS_IsTablePBMSEnabled($db_name, $tbl_name, $tbl_type)
return FALSE;
}
- if (! $PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST')) {
+ if (! $PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST')) {
return FALSE;
}
@@ -403,7 +403,7 @@ function PMA_BS_UpLoadFile($db_name, $tbl_name, $file_type, $file_name)
if (PMA_cacheGet('skip_blobstreaming', true)) {
return FALSE;
}
-
+
if (PMA_do_connect($db_name, FALSE) == FALSE) {
return FALSE;
}
@@ -411,9 +411,9 @@ function PMA_BS_UpLoadFile($db_name, $tbl_name, $file_type, $file_name)
$fh = fopen($file_name, 'r');
if (! $fh) {
PMA_do_disconnect();
- PMA_showMessage("Could not open file: $file_name");
+ PMA_showMessage("Could not open file: $file_name");
return FALSE;
- }
+ }
pbms_add_metadata("Content-Type", $file_type);
@@ -433,7 +433,7 @@ function PMA_BS_SetContentType($db_name, $bsTable, $blobReference, $contentType)
if (PMA_cacheGet('skip_blobstreaming', true)) {
return FALSE;
}
-
+
// 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
// more eficient.
@@ -447,7 +447,7 @@ function PMA_BS_SetContentType($db_name, $bsTable, $blobReference, $contentType)
$where = "WHERE Repository_id=" . $data['Repository_id'] . " AND Repo_blob_offset=" . $data['Repo_blob_offset'] ;
$query = "SELECT name from pbms_metadata $where";
$result = PMA_DBI_query($query);
-
+
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) . "')";
} else {
@@ -489,7 +489,7 @@ function PMA_BS_getURL($reference)
if (empty($bs_server)) {
return FALSE;
}
-
+
$bs_url = 'http://' . $bs_server . '/' . rtrim($reference);
return $bs_url;
}
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_3_5RC1-5912-g9232e02
by Marc Delisle 23 Jul '10
by Marc Delisle 23 Jul '10
23 Jul '10
The branch, master has been updated
via 9232e0237244556102c494b0779fc7ebfd30a204 (commit)
from 18166bd49227fde30323f47196a384d463d257cf (commit)
- Log -----------------------------------------------------------------
commit 9232e0237244556102c494b0779fc7ebfd30a204
Author: Marc Delisle <marc(a)infomarc.info>
Date: Fri Jul 23 09:10:24 2010 -0400
BLOB streaming doc
-----------------------------------------------------------------------
Summary of changes:
Documentation.html | 22 ++++++++++++++++------
1 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/Documentation.html b/Documentation.html
index c35cfae..a62413f 100644
--- a/Documentation.html
+++ b/Documentation.html
@@ -69,7 +69,7 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78
</li>
<li>To support uploading of ZIP files, you need the PHP <tt>zip</tt> extension.</li>
<li>For proper support of multibyte strings (eg. UTF-8, which is
- currently default), you should install mbstring and ctype
+ currently the default), you should install the mbstring and ctype
extensions.
</li>
<li>You need GD2 support in PHP to display inline
@@ -84,6 +84,9 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78
</li>
<li>To support upload progress bars, see <a href="#faq2_9">
<abbr title="Frequently Asked Questions">FAQ</abbr> 2.9</a>.</li>
+ <li>To support BLOB streaming, see PHP and MySQL requirements
+ in <a href="#faq6_25">
+ <abbr title="Frequently Asked Questions">FAQ</abbr> 6.25</a>.</li>
</ul>
</li>
<li><b>MySQL</b> 5.0 or newer (<a href="#faq1_17">details</a>);</li>
@@ -4306,13 +4309,20 @@ chmod o+rwx tmp
<h4 id="faq6_25">
<a href="#faq6_25">6.25 How does BLOB streaming work in phpMyAdmin?</a></h4>
-<p> First, for general information about BLOB streaming on MySQL, visit <a href="http://blobstreaming.org">blobstreaming.org</a>. We currently support streaming if you are running MySQL 5.1 with the PBXT and PBMS storage engines. Moreover, only PBMS 0.5.04 is supported.</p>
+<p> For general information about BLOB streaming on MySQL, visit <a href="http://blobstreaming.org">blobstreaming.org</a>. You need the following components:</p>
+<ul>
+ <li>PBMS BLOB Streaming Daemon for MySQL (0.5.15 or later)</li>
+ <li>Streaming enabled PBXT Storage engine for MySQL (1.0.11-6 or
+ later)</li>
+ <li>PBMS Client Library for MySQL (0.5.15 or later)</li>
+ <li>PBMS PHP Extension for MySQL (0.1.1 or later)</li>
+</ul>
+
+<p>Here are details about configuration and operation:</p>
<ol>
- <li>In <tt>config.inc.php</tt> your host should be defined with a FQDN (fully qualified domain name) instead of something like "localhost".</li>
- <li>A current limitation is that your first login via phpMyAdmin to a freshly-started server must be done with an account that has the SUPER privilege.</li>
- <li>On your target database, go to Operations and in the "BLOB Repository" section, click "Enable". This creates the PBMS system tables inside your database.</li>
- <li>Ensure that your target table is under the PBXT storage engine and has a LONGBLOB column.</li>
+ <li>In <tt>config.inc.php</tt> your host should be defined with a FQDN (fully qualified domain name) instead of "localhost".</li>
+ <li>Ensure that your target table is under the PBXT storage engine and has a LONGBLOB column and a primary key.</li>
<li>When you insert or update a row in this table, put a checkmark on the "Upload to BLOB repository" optional choice; otherwise, the upload will be done directly in your column instead of the repository.</li>
<li>Finally when you browse your table, you'll see in your column a link to stream your data, for example "View image". A header containing the correct MIME-type will be sent to your browser; this MIME-type was stored at upload time but in case it's incorrect, it's possible to edit it by clicking on the displayed MIME-type.</li>
</ol>
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_3_5RC1-5911-g18166bd
by Marc Delisle 23 Jul '10
by Marc Delisle 23 Jul '10
23 Jul '10
The branch, master has been updated
via 18166bd49227fde30323f47196a384d463d257cf (commit)
via 36402785de6e5d93779a8e84c5d5d40692bbc82b (commit)
from e02935a1d5ad5090434ff6a258d367814832a1df (commit)
- Log -----------------------------------------------------------------
commit 18166bd49227fde30323f47196a384d463d257cf
Merge: 36402785de6e5d93779a8e84c5d5d40692bbc82b e02935a1d5ad5090434ff6a258d367814832a1df
Author: Marc Delisle <marc(a)infomarc.info>
Date: Fri Jul 23 08:36:03 2010 -0400
Merge branch 'master' of ssh://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
commit 36402785de6e5d93779a8e84c5d5d40692bbc82b
Author: Barry Leslie <barry_leslie(a)users.sourceforge.net>
Date: Fri Jul 23 08:32:16 2010 -0400
Use PBMS pool connections
-----------------------------------------------------------------------
Summary of changes:
libraries/blobstreaming.lib.php | 42 ++++++++++++++++++++++++++++----------
1 files changed, 31 insertions(+), 11 deletions(-)
diff --git a/libraries/blobstreaming.lib.php b/libraries/blobstreaming.lib.php
index 5403e76..3c614e6 100644
--- a/libraries/blobstreaming.lib.php
+++ b/libraries/blobstreaming.lib.php
@@ -131,6 +131,20 @@ function checkBLOBStreamingPlugins()
return FALSE;
} // end if (!$BS_PORT)
+ // Ping PBMS: the database doesn't need to exist for this to work.
+ if (pbms_connect($serverCfg['host'], $BS_PORT, "anydb") == FALSE) {
+ $PMA_Config->set('BLOBSTREAMING_PLUGINS_EXIST', FALSE);
+ PMA_cacheSet('skip_blobstreaming', true, true);
+ return FALSE;
+ }
+ pbms_close();
+
+ if (function_exists("pbms_pconnect")) {
+ $PMA_Config->set('PBMS_PCONNECT_EXISTS', TRUE);
+ } else {
+ $PMA_Config->set('PBMS_PCONNECT_EXISTS', FALSE);
+ }
+
// add selected BS, CURL and fileinfo library variables to PMA configuration
$PMA_Config->set('BLOBSTREAMING_PORT', $BS_PORT);
$PMA_Config->set('BLOBSTREAMING_HOST', $serverCfg['host']);
@@ -242,9 +256,16 @@ function PMA_do_connect($db_name, $quiet)
$pbms_host = $PMA_Config->get('BLOBSTREAMING_HOST');
$pbms_port = $PMA_Config->get('BLOBSTREAMING_PORT');
- if (pbms_connect($pbms_host, $pbms_port, $db_name) == FALSE) {
+ if ($PMA_Config->get('PBMS_PCONNECT_EXISTS')) {
+ // Open a persistent connection.
+ $ok = pbms_pconnect($pbms_host, $pbms_port, $db_name);
+ } else {
+ $ok = pbms_connect($pbms_host, $pbms_port, $db_name);
+ }
+
+ if ($ok == FALSE) {
if ($quiet == FALSE) {
- PMA_BS_ReportPBMSError("PBMS Connectiuon failed: pbms_connect($pbms_host, $pbms_port, $db_name)");
+ PMA_BS_ReportPBMSError("PBMS Connection failed: pbms_connect($pbms_host, $pbms_port, $db_name)");
}
return FALSE;
}
@@ -268,11 +289,9 @@ function PMA_BS_IsPBMSReference($bs_reference, $db_name)
return FALSE;
}
- if (PMA_do_connect($db_name, TRUE) == FALSE) {
- return FALSE;
- }
+ // You do not really need a connection to the PBMS Daemon
+ // to check if a reference looks valid.
$ok = pbms_is_blob_reference($bs_reference);
- PMA_do_disconnect();
return $ok ;
}
@@ -283,15 +302,16 @@ function PMA_BS_CreateReferenceLink($bs_reference, $db_name)
return 'Error';
}
- if (pbms_get_info($bs_reference) == FALSE) {
+ if (pbms_get_info(trim($bs_reference)) == FALSE) {
PMA_BS_ReportPBMSError("PBMS get BLOB info failed: pbms_get_info($bs_reference)");
PMA_do_disconnect();
return 'Error';
}
- $content_type = pbms_get_metadata_value("Content-type");
- if ($content_type == FALSE) {
- PMA_BS_ReportPBMSError("PMA_BS_CreateReferenceLink($bs_reference, $db_name): get BLOB Content-type failed: ");
+ $content_type = pbms_get_metadata_value("Content-Type");
+ if ($content_type == FALSE) {
+ $br = trim($bs_reference);
+ PMA_BS_ReportPBMSError("'$content_type' PMA_BS_CreateReferenceLink('$br', '$db_name'): get BLOB Content-Type failed: ");
}
PMA_do_disconnect();
@@ -395,7 +415,7 @@ function PMA_BS_UpLoadFile($db_name, $tbl_name, $file_type, $file_name)
return FALSE;
}
- pbms_add_metadata("Content-type", $file_type);
+ pbms_add_metadata("Content-Type", $file_type);
$pbms_blob_url = pbms_read_stream($fh, filesize($file_name), $tbl_name);
if (! $pbms_blob_url) {
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_3_5RC1-5909-ge02935a
by Michal Čihař 23 Jul '10
by Michal Čihař 23 Jul '10
23 Jul '10
The branch, master has been updated
via e02935a1d5ad5090434ff6a258d367814832a1df (commit)
via 2b7d0f2ed7d8fca6b29783dfa1aa264318b29ea3 (commit)
via bffcffc3fde04da000229f399288c68da15de27a (commit)
via 22f3952b5717e6cc6cd54bf9ef58236052adf308 (commit)
via 9cdc5b804ca2f64d85a32fc3301796c7a2357740 (commit)
via 7741f1c0a88a43aebaf684b8027958690c6226d5 (commit)
via 6f7556f8b30c7a0bb5946986e462d9ca5989569f (commit)
via 9e5215ec07d4fda7f4d445f4878eac958dfeb3b8 (commit)
via b7d3df431de015fede89790575bfa68dbeb93e61 (commit)
via 575242f812f9f0b10298ecd522a787dc18cb5c5f (commit)
via 7b7fbc8c2940d1ee90700b81059751e3a9a0b472 (commit)
via 9272636d4bc5bf69a10f21b358061ac1e6cd26a5 (commit)
via 97d85e9068c9c2d4f3474c91150a760e6d5c1d6e (commit)
via c6609cb6af4a04466783a097be2499db0713fefd (commit)
via 47f2564ca498304a68e4c4fc1bcb18424f7afe17 (commit)
via f5eacc549ab98c49735e03e792fd14b87f54084d (commit)
via 0c6c2bf4cb4d41fda71950272bb6ea09b000f3dc (commit)
via 74e7c4342a8691b16278145addb7e5216bd4a5e3 (commit)
from ab2e4e925ed3a5245d3c9d89462831bd735bd3c9 (commit)
- Log -----------------------------------------------------------------
commit e02935a1d5ad5090434ff6a258d367814832a1df
Author: gheni <gheni(a)yahoo.cn>
Date: Fri Jul 23 08:08:12 2010 +0200
Translation update done using Pootle.
commit 2b7d0f2ed7d8fca6b29783dfa1aa264318b29ea3
Author: gheni <gheni(a)yahoo.cn>
Date: Fri Jul 23 08:00:13 2010 +0200
Translation update done using Pootle.
commit bffcffc3fde04da000229f399288c68da15de27a
Author: gheni <gheni(a)yahoo.cn>
Date: Fri Jul 23 07:59:18 2010 +0200
Translation update done using Pootle.
commit 22f3952b5717e6cc6cd54bf9ef58236052adf308
Author: gheni <gheni(a)yahoo.cn>
Date: Fri Jul 23 07:56:38 2010 +0200
Translation update done using Pootle.
commit 9cdc5b804ca2f64d85a32fc3301796c7a2357740
Author: gheni <gheni(a)yahoo.cn>
Date: Fri Jul 23 07:43:23 2010 +0200
Translation update done using Pootle.
commit 7741f1c0a88a43aebaf684b8027958690c6226d5
Author: gheni <gheni(a)yahoo.cn>
Date: Fri Jul 23 07:41:09 2010 +0200
Translation update done using Pootle.
commit 6f7556f8b30c7a0bb5946986e462d9ca5989569f
Author: gheni <gheni(a)yahoo.cn>
Date: Fri Jul 23 07:35:38 2010 +0200
Translation update done using Pootle.
commit 9e5215ec07d4fda7f4d445f4878eac958dfeb3b8
Author: gheni <gheni(a)yahoo.cn>
Date: Fri Jul 23 07:34:26 2010 +0200
Translation update done using Pootle.
commit b7d3df431de015fede89790575bfa68dbeb93e61
Author: gheni <gheni(a)yahoo.cn>
Date: Fri Jul 23 07:31:27 2010 +0200
Translation update done using Pootle.
commit 575242f812f9f0b10298ecd522a787dc18cb5c5f
Author: gheni <gheni(a)yahoo.cn>
Date: Fri Jul 23 07:30:19 2010 +0200
Translation update done using Pootle.
commit 7b7fbc8c2940d1ee90700b81059751e3a9a0b472
Author: gheni <gheni(a)yahoo.cn>
Date: Fri Jul 23 07:27:33 2010 +0200
Translation update done using Pootle.
commit 9272636d4bc5bf69a10f21b358061ac1e6cd26a5
Author: gheni <gheni(a)yahoo.cn>
Date: Fri Jul 23 07:26:14 2010 +0200
Translation update done using Pootle.
commit 97d85e9068c9c2d4f3474c91150a760e6d5c1d6e
Author: gheni <gheni(a)yahoo.cn>
Date: Fri Jul 23 07:25:25 2010 +0200
Translation update done using Pootle.
commit c6609cb6af4a04466783a097be2499db0713fefd
Author: gheni <gheni(a)yahoo.cn>
Date: Fri Jul 23 07:23:55 2010 +0200
Translation update done using Pootle.
commit 47f2564ca498304a68e4c4fc1bcb18424f7afe17
Author: gheni <gheni(a)yahoo.cn>
Date: Fri Jul 23 07:20:37 2010 +0200
Translation update done using Pootle.
commit f5eacc549ab98c49735e03e792fd14b87f54084d
Author: gheni <gheni(a)yahoo.cn>
Date: Fri Jul 23 07:20:14 2010 +0200
Translation update done using Pootle.
commit 0c6c2bf4cb4d41fda71950272bb6ea09b000f3dc
Author: gheni <gheni(a)yahoo.cn>
Date: Fri Jul 23 07:19:13 2010 +0200
Translation update done using Pootle.
commit 74e7c4342a8691b16278145addb7e5216bd4a5e3
Author: gheni <gheni(a)yahoo.cn>
Date: Fri Jul 23 07:18:04 2010 +0200
Translation update done using Pootle.
-----------------------------------------------------------------------
Summary of changes:
po/ug.po | 39 ++++++++++++++++++++++++++-------------
1 files changed, 26 insertions(+), 13 deletions(-)
diff --git a/po/ug.po b/po/ug.po
index 1e12f2b..db747c5 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(a)lists.sourceforge.net\n"
"POT-Creation-Date: 2010-07-21 13:53+0200\n"
-"PO-Revision-Date: 2010-07-22 12:44+0200\n"
+"PO-Revision-Date: 2010-07-23 08:08+0200\n"
"Last-Translator: <gheni(a)yahoo.cn>\n"
"Language-Team: Uyghur <ug(a)li.org>\n"
"Language: ug\n"
@@ -823,6 +823,8 @@ msgid ""
"You attempted to load file with unsupported compression (%s). Either support "
"for it is not implemented or disabled by your configuration."
msgstr ""
+"You attempted to load file with unsupported compression (%s). Either support "
+"for it is not implemented or disabled by your configuration."
#: import.php:336
msgid ""
@@ -830,6 +832,9 @@ msgid ""
"file size exceeded the maximum size permitted by your PHP configuration. See "
"[a@./Documentation.html#faq1_16@Documentation]FAQ 1.16[/a]."
msgstr ""
+"No data was received to import. Either no file name was submitted, or the "
+"file size exceeded the maximum size permitted by your PHP configuration. See "
+"[a@./Documentation.html#faq1_16@Documentation]FAQ 1.16[/a]."
#: import.php:371 libraries/display_import.lib.php:23
msgid "Could not load import plugins, please check your installation!"
@@ -858,12 +863,16 @@ msgid ""
"Script timeout passed, if you want to finish import, please resubmit same "
"file and import will resume."
msgstr ""
+"Script timeout passed, if you want to finish import, please resubmit same "
+"file and import will resume."
#: import.php:425
msgid ""
"However on last run no data has been parsed, this usually means phpMyAdmin "
"won't be able to finish this import unless you increase php time limits."
msgstr ""
+"However on last run no data has been parsed, this usually means phpMyAdmin "
+"won't be able to finish this import unless you increase php time limits."
#: import_status.php:30 libraries/common.lib.php:660 pdf_schema.php:240
#: user_password.php:110
@@ -872,7 +881,7 @@ msgstr "قايتىش"
#: index.php:188
msgid "phpMyAdmin is more friendly with a <b>frames-capable</b> browser."
-msgstr ""
+msgstr "phpMyAdmin <b>دەستەك</b> توركۆرگۈچلەردە ياخشى ئىشلەيدۇ."
#: js/messages.php:25 server_synchronize.php:344 server_synchronize.php:356
#: server_synchronize.php:372 server_synchronize.php:379
@@ -904,7 +913,7 @@ msgstr "سىز BLOB ئامبىرنى توقتاتماقچى!"
#: js/messages.php:35
#, php-format
msgid "Are you sure you want to disable all BLOB references for database %s?"
-msgstr ""
+msgstr "سىز ھەقىقەتەن %s ئۈستىدىكى BLOB ئىقتىدارىنى تاقىماقچىمۇ؟"
#: js/messages.php:38
msgid "Missing value in the form!"
@@ -960,7 +969,7 @@ msgstr "!خاتالىق:بۇناسىۋەت ئاللىقاچان مەۋجۈت"
#: js/messages.php:58
msgid "Error saving coordinates for Designer."
-msgstr ""
+msgstr "ساقلاشتا خاتالىق كۆرۈلدى."
#: js/messages.php:59 libraries/relation.lib.php:94
#: libraries/relation.lib.php:106
@@ -1256,16 +1265,18 @@ msgstr "ھۆججەت يۈكلەشتە ئېنىقسىز خاتالىق كۆرۈل
#: libraries/File.class.php:406
msgid "The uploaded file exceeds the upload_max_filesize directive in php.ini."
msgstr ""
+"سىز يۈكلىگەن ھۆججەت php.ini نىڭ ئىچىدىكى upload_max_filesize چەكلىمىسىدىن "
+"ئېشىپ كەتتى."
#: libraries/File.class.php:409
msgid ""
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in "
"the HTML form."
-msgstr ""
+msgstr "سز يۈكلىگەن ھۆججەت HTML نىڭ MAX_FILE_SIZE چېكىدىن ئېشىپ كەتتى."
#: libraries/File.class.php:412
msgid "The uploaded file was only partially uploaded."
-msgstr ""
+msgstr "سىز يۈكلىگەن ھۆججەتنىڭ پەقەت بىر قىسىمىلا يۈكلەندى."
#: libraries/File.class.php:415
msgid "Missing a temporary folder."
@@ -1277,13 +1288,15 @@ msgstr "ھۆججەتنى دېسكىغا يىزىشتا خاتالىق كۆرۈل
#: libraries/File.class.php:421
msgid "File upload stopped by extension."
-msgstr ""
+msgstr "كېڭەيتىلمە ئىسمى بۇنداق ھۆججەتلەرنى يوللاشقا بولمايدۇ."
#: libraries/File.class.php:898
msgid ""
"Error moving the uploaded file, see [a@./Documentation."
"html#faq1_11@Documentation]FAQ 1.11[/a]"
msgstr ""
+"Error moving the uploaded file, see "
+"[a@./Documentation.html#faq1_11@Documentation]FAQ 1.11[/a]"
#: libraries/Index.class.php:427 tbl_relation.php:528
msgid "No index defined!"
@@ -1373,22 +1386,22 @@ msgstr[1] ""
#: libraries/StorageEngine.class.php:196
msgid ""
"There is no detailed status information available for this storage engine."
-msgstr ""
+msgstr "بۇ ساقلىغۇچقا مۇناسىۋەتلىك باشقا ئۇچۇرلار مەۋجۇت ئەمەس."
#: libraries/StorageEngine.class.php:352
#, php-format
msgid "%s is available on this MySQL server."
-msgstr ""
+msgstr "%s نى بۇ MySQL مۇلازىمىتېرىدا ئىشلىتىشكە بولىدۇ."
#: libraries/StorageEngine.class.php:355
#, php-format
msgid "%s has been disabled for this MySQL server."
-msgstr ""
+msgstr "%s نى بۇ MySQL مۇلازىمىتېرىدا ئىشلىتىشكە بولمايدۇ."
#: libraries/StorageEngine.class.php:359
#, php-format
msgid "This MySQL server does not support the %s storage engine."
-msgstr ""
+msgstr "بۇ MySQL مۇلازىمىتېرى %s نى قوللىمايدۇ."
#: libraries/Table.class.php:1018
msgid "Invalid database"
@@ -1401,12 +1414,12 @@ msgstr "ئۈنۈمسىز جەدۋەل ئىسمى"
#: libraries/Table.class.php:1047
#, php-format
msgid "Error renaming table %1$s to %2$s"
-msgstr ""
+msgstr "%1$s بۇ جەدۋەل ئىسمىنى %2$s غا ئۆزگەرتىشتە خاتالىق كۆرۈلدى."
#: libraries/Table.class.php:1131
#, php-format
msgid "Table %s has been renamed to %s"
-msgstr ""
+msgstr "%1$s بۇ جەدۋەل ئىسمىنى %2$s غا ئۆزگەرتىش غەلبىلىك بولدى."
#: libraries/Theme.class.php:160
#, php-format
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_3_5RC1-5891-gab2e4e9
by Marc Delisle 22 Jul '10
by Marc Delisle 22 Jul '10
22 Jul '10
The branch, master has been updated
via ab2e4e925ed3a5245d3c9d89462831bd735bd3c9 (commit)
from 362aa516ac7b4b384e9cfb5d7aa7683b6b38515d (commit)
- Log -----------------------------------------------------------------
commit ab2e4e925ed3a5245d3c9d89462831bd735bd3c9
Author: Marc Delisle <marc(a)infomarc.info>
Date: Thu Jul 22 14:37:42 2010 -0400
correct insertion of BLOB field reference
-----------------------------------------------------------------------
Summary of changes:
tbl_replace.php | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/tbl_replace.php b/tbl_replace.php
index d3271ac..bcf64af 100644
--- a/tbl_replace.php
+++ b/tbl_replace.php
@@ -231,21 +231,21 @@ foreach ($loop_array as $rowcount => $where_clause) {
$upload_blob_repo = isset($_REQUEST['upload_blob_repo_' . $key]) ? $_REQUEST['upload_blob_repo_' . $key] : NULL;
// checks if an existing blob repository reference should be removed
- if (isset($remove_blob_repo) && !isset($upload_blob_repo)) {
+ if (isset($remove_blob_repo) && ! isset($upload_blob_repo)) {
$remove_blob_reference = $_REQUEST['remove_blob_ref_' . $key];
if (isset($remove_blob_reference)) {
$val = "''";
}
+ }
- // checks if this field requires a bs reference attached to it
- if (isset($upload_blob_repo)) {
- // get the most recent BLOB reference
- $bs_reference = PMA_File::getRecentBLOBReference();
+ // checks if this field requires a bs reference attached to it
+ if (isset($upload_blob_repo)) {
+ // get the most recent BLOB reference
+ $bs_reference = PMA_File::getRecentBLOBReference();
- // if the most recent BLOB reference exists, set it as a field value
- if (!is_null($bs_reference)) {
- $val = "'" . PMA_sqlAddslashes($bs_reference) . "'";
- }
+ // if the most recent BLOB reference exists, set it as a field value
+ if (!is_null($bs_reference)) {
+ $val = "'" . PMA_sqlAddslashes($bs_reference) . "'";
}
}
}
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_3_5RC1-5890-g362aa51
by Marc Delisle 22 Jul '10
by Marc Delisle 22 Jul '10
22 Jul '10
The branch, master has been updated
via 362aa516ac7b4b384e9cfb5d7aa7683b6b38515d (commit)
from ec9a60f8e09463ea34cdd11849b4c2357c4351e5 (commit)
- Log -----------------------------------------------------------------
commit 362aa516ac7b4b384e9cfb5d7aa7683b6b38515d
Author: Marc Delisle <marc(a)infomarc.info>
Date: Thu Jul 22 14:10:58 2010 -0400
undefined $primary_field
-----------------------------------------------------------------------
Summary of changes:
libraries/blobstreaming.lib.php | 31 +++++++++++++++++++++++++++++++
tbl_replace.php | 4 ++++
2 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/libraries/blobstreaming.lib.php b/libraries/blobstreaming.lib.php
index abbe047..5403e76 100644
--- a/libraries/blobstreaming.lib.php
+++ b/libraries/blobstreaming.lib.php
@@ -473,4 +473,35 @@ function PMA_BS_getURL($reference)
$bs_url = 'http://' . $bs_server . '/' . rtrim($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 48b98c1..d3271ac 100644
--- a/tbl_replace.php
+++ b/tbl_replace.php
@@ -210,6 +210,10 @@ 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)) {
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_3_5RC1-5889-gec9a60f
by Marc Delisle 22 Jul '10
by Marc Delisle 22 Jul '10
22 Jul '10
The branch, master has been updated
via ec9a60f8e09463ea34cdd11849b4c2357c4351e5 (commit)
from 56ebe05af73115e9c6928beb49db846fbbda460a (commit)
- Log -----------------------------------------------------------------
commit ec9a60f8e09463ea34cdd11849b4c2357c4351e5
Author: Marc Delisle <marc(a)infomarc.info>
Date: Thu Jul 22 13:22:30 2010 -0400
undefined variables; unneeded config variables
-----------------------------------------------------------------------
Summary of changes:
config.sample.inc.php | 6 ------
libraries/config.default.php | 6 ------
tbl_change.php | 2 +-
3 files changed, 1 insertions(+), 13 deletions(-)
diff --git a/config.sample.inc.php b/config.sample.inc.php
index 575e965..679555b 100644
--- a/config.sample.inc.php
+++ b/config.sample.inc.php
@@ -35,12 +35,6 @@ $cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
-/* for blobstreaming */
-$cfg['Servers'][$i]['bs_garbage_threshold'] = 50;
-$cfg['Servers'][$i]['bs_repository_threshold'] = '32M';
-$cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;
-$cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';
-
/* User for advanced features */
// $cfg['Servers'][$i]['controluser'] = 'pma';
// $cfg['Servers'][$i]['controlpass'] = 'pmapass';
diff --git a/libraries/config.default.php b/libraries/config.default.php
index 7ec7c5d..28aa85e 100644
--- a/libraries/config.default.php
+++ b/libraries/config.default.php
@@ -137,12 +137,6 @@ $cfg['Servers'][$i]['connect_type'] = 'tcp';
*/
$cfg['Servers'][$i]['extension'] = 'mysql';
-/* added for blobstreaming */
-$cfg['Servers'][$i]['bs_garbage_threshold'] = '';
-$cfg['Servers'][$i]['bs_repository_threshold'] = '';
-$cfg['Servers'][$i]['bs_temp_blob_timeout'] = '';
-$cfg['Servers'][$i]['bs_temp_log_threshold'] = '';
-
/**
* Use compressed protocol for the MySQL connection (requires PHP >= 4.3.0)
*
diff --git a/tbl_change.php b/tbl_change.php
index d8486ba..704cdc1 100644
--- a/tbl_change.php
+++ b/tbl_change.php
@@ -889,7 +889,7 @@ foreach ($rows as $row_id => $vrow) {
if ($is_upload && $field['is_blob']) {
// 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, $table, $tbl_type)) {
echo '<br />';
echo '<input type="checkbox" name="upload_blob_repo_' . $field['Field_md5'] . $vkey . '" /> ' . __('Upload to BLOB repository');
}
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_3_5RC1-5888-g56ebe05
by Marc Delisle 22 Jul '10
by Marc Delisle 22 Jul '10
22 Jul '10
The branch, master has been updated
via 56ebe05af73115e9c6928beb49db846fbbda460a (commit)
via b6349cd626d6b443e50f0d8506f30ca5f339bd9a (commit)
via a8e5b0f275b566a5eb1c9e0966f6d272c73bde2d (commit)
via f8653e58038e578569a49083e5470b6c278ac70a (commit)
via e65625ce1ed593e6f15545e61b97c1d1c88ad92a (commit)
from 049886139c62c3ed8b6573a0637ec5516857661f (commit)
- Log -----------------------------------------------------------------
commit 56ebe05af73115e9c6928beb49db846fbbda460a
Author: Marc Delisle <marc(a)infomarc.info>
Date: Thu Jul 22 13:15:27 2010 -0400
blob streaming code cleanup (work in progress)
commit b6349cd626d6b443e50f0d8506f30ca5f339bd9a
Author: Leslie <leslie(a)Leslies-Computer.local>
Date: Fri Jul 16 10:33:53 2010 -0700
Removed unused code from db_operations.php. Changed blobstreaming.lib.php so that it check to see if blob streaming is enabled before doing anything and also uses an indirect method to create the 'pbms' database if it doesn't exist.
commit a8e5b0f275b566a5eb1c9e0966f6d272c73bde2d
Author: Barry Leslie <barry_leslie(a)users.sourceforge.net>
Date: Thu Jul 15 12:35:52 2010 -0700
Fix problem where PBMS daemon is not loaded or the 'pbms' database doesn't exist.
commit f8653e58038e578569a49083e5470b6c278ac70a
Author: Barry Leslie <barry_leslie(a)users.sourceforge.net>
Date: Mon Jul 12 15:39:06 2010 -0700
Update blob streaming to match the current API and use the PBMS PHP extension.
commit e65625ce1ed593e6f15545e61b97c1d1c88ad92a
Author: Barry Leslie <barry_leslie(a)users.sourceforge.net>
Date: Mon Jul 12 15:31:11 2010 -0700
Update blob streaming to match the current API and use the PBMS PHP extension.
-----------------------------------------------------------------------
Summary of changes:
bs_change_mime_type.php | 75 +----
bs_disp_as_mime_type.php | 24 +-
bs_play_media.php | 31 +-
db_operations.php | 148 --------
db_structure.php | 21 +-
libraries/File.class.php | 434 ++++------------------
libraries/StorageEngine.class.php | 16 +-
libraries/blobstreaming.lib.php | 723 +++++++++++++------------------------
libraries/common.inc.php | 10 +-
libraries/common.lib.php | 27 +-
libraries/core.lib.php | 33 +--
libraries/display_tbl.lib.php | 48 +---
libraries/engines/pbms.lib.php | 113 ++++++
libraries/engines/pbxt.lib.php | 40 ++
server_engines.php | 20 +-
tbl_change.php | 131 +------
tbl_replace.php | 4 -
17 files changed, 584 insertions(+), 1314 deletions(-)
create mode 100644 libraries/engines/pbms.lib.php
diff --git a/bs_change_mime_type.php b/bs_change_mime_type.php
index 8ad8d1a..edefae1 100644
--- a/bs_change_mime_type.php
+++ b/bs_change_mime_type.php
@@ -30,70 +30,19 @@
$bsNewMIMEType = isset($_REQUEST['bs_new_mime_type']) ? urldecode($_REQUEST['bs_new_mime_type']) : NULL;
// necessary variables exist
- if ($bsDB && $bsTable && $bsReference && $bsNewMIMEType)
+ if ($bsDB && $bsTable && $bsReference && $bsNewMIMEType)
{
- // load PMA configuration
- $PMA_Config = $GLOBALS['PMA_Config'];
-
- // if PMA configuration exists
- if (!empty($PMA_Config))
- {
- // if BS plugins exist
- if ($PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST'))
- {
- $pbms_ref_tbl = $PMA_Config->get('PBMS_NAME') . '_reference';
- $pbms_cust_content_type_tbl = $PMA_Config->get('PBMS_NAME') . '_custom_content_type';
-
- // if specified DB is selected
- if (PMA_DBI_select_db($bsDB))
- {
- $query = "SELECT * FROM " . PMA_backquote($pbms_ref_tbl);
- $query .= " WHERE Blob_url='" . PMA_sqlAddslashes($bsReference) . "'";
-
- $result = PMA_DBI_query($query);
-
- // if record exists
- if ($data = PMA_DBI_fetch_assoc($result))
- {
- $query = "SELECT count(*) FROM " . PMA_backquote($pbms_cust_content_type_tbl);
- $query .= " WHERE Blob_url='" . PMA_sqlAddslashes($bsReference) . "'";
-
- $result = PMA_DBI_query($query);
-
- // if record exists
- if ($data = PMA_DBI_fetch_assoc($result))
- {
- if (1 == $data['count(*)'])
- {
- $query = "UPDATE " . PMA_backquote($pbms_cust_content_type_tbl) . " SET Content_type='";
- $query .= PMA_sqlAddslashes($bsNewMIMEType) . "' WHERE Blob_url='" . PMA_sqlAddslashes($bsReference) . "'";
- }
- else
- {
- $query = "INSERT INTO " . PMA_backquote($pbms_cust_content_type_tbl) . " (Blob_url, Content_type)";
- $query .= " VALUES('" . PMA_sqlAddslashes($bsReference) . "', '" . PMA_sqlAddslashes($bsNewMIMEType) . "')";
- }
-
- $result = PMA_DBI_query($query);
-
- // if query execution succeeded
- if ($result)
- {
- // 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';
-
- // redirect to specified page
- ?>
- <script>
- window.location = "<?php echo $newLoc ?>";
- </script>
- <?php
- } // end if ($result)
- } // end if ($data = PMA_DBI_fetch_assoc($result))
- } // end if ($data = PMA_DBI_fetch_assoc($result))
- } // end if (PMA_DBI_select_db($bsDB))
- } // end if ($PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST'))
- } // end if (!empty($PMA_Config))
+ if (PMA_BS_SetContentType($bsDB, $bsTable, $bsReference, $bsNewMIMEType)) {
+ // 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';
+
+ // redirect to specified page
+ ?>
+<script>
+window.location = "<?php echo $newLoc ?>";
+</script>
+ <?php
+ } // end if ($result)
} // end if ($bsDB && $bsTable && $bsReference && $bsNewMIMEType)
?>
diff --git a/bs_disp_as_mime_type.php b/bs_disp_as_mime_type.php
index 9b26a59..085d888 100644
--- a/bs_disp_as_mime_type.php
+++ b/bs_disp_as_mime_type.php
@@ -9,13 +9,6 @@
*/
require_once './libraries/common.inc.php';
-// load PMA configuration
-$PMA_Config = $GLOBALS['PMA_Config'];
-
-// retrieve BS server variables from PMA configuration
-$bs_server = $PMA_Config->get('BLOBSTREAMING_SERVER');
-if (empty($bs_server)) die('No blob streaming server configured!');
-
// Check URL parameters
PMA_checkParameters(array('reference', 'c_type'));
@@ -30,15 +23,23 @@ $reference = $_REQUEST['reference'];
*/
$c_type = preg_replace('/[^A-Za-z0-9/_-]/', '_', $_REQUEST['c_type']);
-$filename = 'http://' . $bs_server . '/' . $reference;
+// Get the blob streaming URL
+$filename = PMA_BS_getURL($reference);
+if (empty($filename)) {
+ die(__('No blob streaming server configured!'));
+}
$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");
-if ($fHnd === FALSE) die('Failed to open remote URL');
+if ($fHnd === FALSE) {
+ die(__('Failed to open remote URL'));
+}
$f_size = $hdrs['Content-Length'];
@@ -58,8 +59,9 @@ while (!feof($fHnd)) {
$content .= fread($fHnd, $f_size);
$pos = strlen($content);
- if ($pos >= $f_size)
+ if ($pos >= $f_size) {
break;
+ }
}
echo $content;
diff --git a/bs_play_media.php b/bs_play_media.php
index ad3c9af..fe6f574 100644
--- a/bs_play_media.php
+++ b/bs_play_media.php
@@ -15,7 +15,7 @@
$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;
@@ -25,24 +25,16 @@
$bsReference = isset($_REQUEST['bs_reference']) ? $_REQUEST['bs_reference'] : NULL;
// if media type and BS reference are specified
- if (isset($mediaType) && isset($bsReference))
- {
- // load PMA configuration
- $PMA_Config = $GLOBALS['PMA_Config'];
-
- // if PMA configuration exists
- if (!empty($PMA_Config))
- {
- // retrieve BS server variables from PMA configuration
- $bs_server = $PMA_Config->get('BLOBSTREAMING_SERVER');
- if (empty($bs_server)) die('No blob streaming server configured!');
-
- $bs_file_path = "http://" . $bs_server . '/' . $bsReference;
-
- if (isset($customType) && $customType)
-
- $bs_file_path = 'bs_disp_as_mime_type.php' . PMA_generate_common_url(array('reference' => $bsReference, 'c_type' => $mediaType));
-
+ if (isset($mediaType) && isset($bsReference)) {
+ if (isset($customType) && $customType) {
+ $bs_file_path = 'bs_disp_as_mime_type.php' . PMA_generate_common_url(array('reference' => $bsReference, 'c_type' => $mediaType));
+ } else {
+ // Get the BLOB streaming URL
+ $bs_file_path = PMA_BS_getURL($bsReference);
+ if (empty($bs_file_path)) {
+ die(__('No blob streaming server configured!'));
+ }
+ }
?>
<html>
<head>
@@ -69,7 +61,6 @@
</body>
</html>
<?php
- } // end if (!empty($PMA_Config))
} // end if (isset($mediaType) && isset($bsReference))
?>
diff --git a/db_operations.php b/db_operations.php
index e4e6992..7732131 100644
--- a/db_operations.php
+++ b/db_operations.php
@@ -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
@@ -500,92 +438,6 @@ if (!$is_information_schema) {
</form>
<?php
- /*
- * BLOB streaming support
- */
-
- // load PMA_Config
- $PMA_Config = $GLOBALS['PMA_Config'];
-
- // if all blobstreaming plugins exist, begin checking for blobstreaming tables
- if (!empty($PMA_Config))
- {
- if ($PMA_Config->get('PBXT_NAME') !== strtolower($db))
- {
- if ($PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST'))
- {
- $bs_tables = $PMA_Config->get('BLOBSTREAMABLE_DATABASES');
- $bs_tables = $bs_tables[$db];
-
- $oneBSTableExists = FALSE;
- $allBSTablesExist = TRUE;
-
- // first check that all blobstreaming tables do not exist
- foreach ($bs_tables as $table_key=>$tbl)
- if ($bs_tables[$table_key]['Exists'])
- $oneBSTableExists = TRUE;
- else
- $allBSTablesExist = FALSE;
-
- ?>
-
- <form method="post" action="./db_operations.php">
- <?php echo PMA_generate_common_hidden_inputs($db); ?>
- <fieldset>
- <legend>
- <?php echo PMA_getIcon('b_edit.png', __('BLOB Repository'), false, true); ?>
- </legend>
-
- <?php echo __('Status'); ?>:
-
- <?php
-
- // if the blobstreaming tables exist, provide option to disable the BLOB repository
- if ($allBSTablesExist)
- {
- ?>
- <?php echo _pgettext('BLOB repository', 'Enabled'); ?>
- </fieldset>
- <fieldset class="tblFooters">
- <input type="hidden" name="db_blob_streaming_op" value="disable" />
- <input type="submit" onclick="return confirmDisableRepository('<?php echo $db; ?>');" value="<?php echo __('Disable'); ?>" />
- </fieldset>
- <?php
- }
- else
- {
- // if any of the blobstreaming tables are missing, provide option to repair the BLOB repository
- if ($oneBSTableExists && !$allBSTablesExist)
- {
- ?>
- <?php echo __('Damaged'); ?>
- </fieldset>
- <fieldset class="tblFooters">
- <input type="hidden" name="db_blob_streaming_op" value="repair" />
- <input type="submit" value="<?php echo _pgettext('BLOB repository', 'Repair'); ?>" />
- </fieldset>
- <?php
- }
- // if none of the blobstreaming tables exist, provide option to enable BLOB repository
- else
- {
- ?>
- <?php echo _pgettext('BLOB repository', 'Disabled'); ?>
- </fieldset>
- <fieldset class="tblFooters">
- <input type="hidden" name="db_blob_streaming_op" value="enable" />
- <input type="submit" value="<?php echo __('Enable'); ?>" />
- </fieldset>
- <?php
- }
- } // end if ($allBSTablesExist)
-
- ?>
- </form>
- <?php
- } // end if ($PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST'))
- } // end if ($PMA_Config->get('PBXT_NAME') !== strtolower($db))
- }
/**
* Change database charset
diff --git a/db_structure.php b/db_structure.php
index 9a6ee24..077dcab 100644
--- a/db_structure.php
+++ b/db_structure.php
@@ -150,27 +150,14 @@ $hidden_fields = array();
$odd_row = true;
$sum_row_count_pre = '';
-// for blobstreaming
-$PMA_Config = $GLOBALS['PMA_Config'];
-
-if (!empty($PMA_Config))
- $session_bs_tables = $PMA_Config->get('BLOBSTREAMING_TABLES'); // list of blobstreaming tables
-
$tableReductionCount = 0; // the amount to reduce the table count by
foreach ($tables as $keyname => $each_table) {
- if (isset($session_bs_tables))
- {
- // compare table name against blobstreaming tables
- foreach ($session_bs_tables as $table_key=>$table_val)
- // if the table is a blobstreaming table, reduce table count and skip outer foreach loop
- if ($table_key == $keyname)
- {
- $tableReductionCount++;
- continue 2;
- }
+ if (PMA_BS_IsHiddenTable($keyname)) {
+ $tableReductionCount++;
+ continue;
}
-
+
// Get valid statistics whatever is the table type
$table_is_view = false;
diff --git a/libraries/File.class.php b/libraries/File.class.php
index a6a515f..83f5d14 100644
--- a/libraries/File.class.php
+++ b/libraries/File.class.php
@@ -279,118 +279,27 @@ class PMA_File
$is_bs_upload = FALSE;
// 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;
-
+ }
// if request is an upload to the BLOB repository
- if ($is_bs_upload)
- {
- // load PMA configuration
- $PMA_Config = $GLOBALS['PMA_Config'];
-
- // if PMA configuration is loaded
- if (!empty($PMA_Config))
- {
- // load BS variables from PMA configuration
- $pluginsExist = $PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST');
- $curlExists = $PMA_Config->get('CURL_EXISTS');
- $bs_database = $PMA_Config->get('BLOBSTREAMABLE_DATABASES');
- $bs_database = $bs_database[$_REQUEST['db']];
-
- $allBSTablesExist = TRUE;
-
- // determine if plugins and curl exist
- if ($pluginsExist && $curlExists)
- {
- foreach ($bs_database as $table_key=>$table)
- {
- if (!$bs_database[$table_key]['Exists'])
- {
- $allBSTablesExist = FALSE;
- break;
- }
- }
- }
- else
- $allBSTablesExist = FALSE;
-
- // if necessary BS tables exist
- if ($allBSTablesExist)
- {
- // setup bs variables for uploading
- $bs_server = $PMA_Config->get('BLOBSTREAMING_SERVER');
- $bs_db = $_REQUEST['db'];
- $bs_table = $_REQUEST['table'];
-
- // setup file handle and related variables
- $tmp_file = fopen($file['tmp_name'], 'r');
- $tmp_file_type = $file['type'];
- $tmp_file_size = $file['size'];
-
- if (!$tmp_file_type)
- $tmp_file_type = NULL;
+ if ($is_bs_upload) {
+ $bs_db = $_REQUEST['db'];
+ $bs_table = $_REQUEST['table'];
+ $tmp_filename = $file['tmp_name'];
+ $tmp_file_type = $file['type'];
+
+ if (! $tmp_file_type) {
+ $tmp_file_type = NULL;
+ }
- // if none of the required variables contain data, return with an unknown error message
- if (!$bs_server || !$bs_db || !$bs_table || !$tmp_file || !$tmp_file_size)
- {
- $this->_error_message = __('Unknown error in file upload.');
- return FALSE;
- }
- else
- $bs_server_path = 'http://' . $bs_server . '/' . $bs_db . '/' . $bs_table;
-
- // init curl handle
- $curlHnd = curl_init ($bs_server_path);
-
- // if curl handle init successful
- if ($curlHnd)
- {
- // specify custom header
- $customHeader = array(
- "Accept-Language: en-us;en;q=0;5",
- "Accept-Charset: ISO-8859-1;utf-8;q=0.7,*;q=0.7",
- "Content-type: $tmp_file_type"
- );
-
- // specify CURL options in array
- $curlOptArr = array(
- CURLOPT_PUT => TRUE,
- CURLOPT_HEADER => TRUE,
- CURLOPT_HTTPHEADER => $customHeader,
- CURLOPT_INFILESIZE => $tmp_file_size,
- CURLOPT_INFILE => $tmp_file,
- CURLOPT_RETURNTRANSFER => TRUE
- );
-
- // pass array of options to curl handle setup function
- curl_setopt_array($curlHnd, $curlOptArr);
-
- // execute curl request and retrieve error message(s) (if any)
- $ret = curl_exec($curlHnd);
- $errRet = curl_error($curlHnd);
-
- // close curl handle
- curl_close($curlHnd);
-
- // split entire string into array of lines
- $retArr = explode("\r\n", $ret);
-
- // check each line as a valid string of a BLOB reference
- foreach ($retArr as $value)
- if (strlen($value) > strlen("~*$bs_db/~") && "~*$bs_db/~" == substr($value, 0, strlen($bs_db) + 4))
- {
- // is a valid reference, so set as current and break
- PMA_File::setRecentBLOBReference($value);
- break;
- }
-
- // close file handle
- if ($tmp_file)
- fclose($tmp_file);
- } // end if ($curlHnd)
- } // end if ($allBSTablesExist)
- } // end if ($PMA_Config)
- } // end if ($is_bs_upload)
+ 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)
// check for file upload errors
switch ($file['error']) {
@@ -487,135 +396,43 @@ class PMA_File
$is_bs_upload = FALSE;
// 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 a request to upload file to BLOB repository using uploadDir mechanism
- if ($is_bs_upload)
- {
- // load PMA configuration
- $PMA_Config = $GLOBALS['PMA_Config'];
-
- // if the PMA configuration was loaded
- if (!empty($PMA_Config))
- {
- // load BS variables from PMA configuration
- $pluginsExist = $PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST');
- $curlExists = $PMA_Config->get('CURL_EXISTS');
- $bs_database = $PMA_Config->get('BLOBSTREAMABLE_DATABASES');
- $bs_database = $bs_database[$_REQUEST['db']];
-
- $allBSTablesExist = TRUE;
-
- // if plugins and curl exist
- if ($pluginsExist && $curlExists)
- {
- foreach ($bs_database as $table_key=>$table)
- {
- if (!$bs_database[$table_key]['Exists'])
- {
- $allBSTablesExist = FALSE;
- break;
- }
- }
+ if ($is_bs_upload) {
+ $bs_db = $_REQUEST['db'];
+ $bs_table = $_REQUEST['table'];
+ $tmp_filename = $GLOBALS['cfg']['UploadDir'] . '/' . $_REQUEST['fields_uploadlocal_' . $key]['multi_edit'][$primary];
+
+ // check if fileinfo library exists
+ if ($PMA_Config->get('FILEINFO_EXISTS')) {
+ // attempt to init fileinfo
+ $finfo = finfo_open(FILEINFO_MIME);
+
+ // fileinfo exists
+ if ($finfo) {
+ // pass in filename to fileinfo and close fileinfo handle after
+ $tmp_file_type = finfo_file($finfo, $tmp_filename);
+ finfo_close($finfo);
}
- else
- $allBSTablesExist = FALSE;
-
- // if necessary BS tables exist
- if ($allBSTablesExist)
- {
- // load BS variables
- $bs_server = $PMA_Config->get('BLOBSTREAMING_SERVER');
- $bs_db = $_REQUEST['db'];
- $bs_table = $_REQUEST['table'];
-
- // setup uploadDir mechanism and file variables
- $tmp_filename = $GLOBALS['cfg']['UploadDir'] . '/' . $_REQUEST['fields_uploadlocal_' . $key]['multi_edit'][$primary];
- $tmp_file = fopen($tmp_filename, 'r');
- $tmp_file_size = filesize($tmp_filename);
-
- // check if fileinfo library exists
- if ($PMA_Config->get('FILEINFO_EXISTS'))
- {
- // attempt to init fileinfo
- $finfo = finfo_open(FILEINFO_MIME);
-
- // fileinfo exists
- if ($finfo)
- {
- // pass in filename to fileinfo and close fileinfo handle after
- $tmp_file_type = finfo_file($finfo, $tmp_filename);
- finfo_close($finfo);
- }
- }
- else // no fileinfo library exists, use file command
- $tmp_file_type = exec("file -bi " . escapeshellarg($tmp_filename));
-
- if (!$tmp_file_type)
- $tmp_file_type = NULL;
-
- // necessary variables aren't loaded, return error message (unknown error)
- if (!$bs_server || !$bs_db || !$bs_table || !$tmp_file || !$tmp_file_size)
- {
- $this->_error_message = __('Unknown error in file upload.');
- return FALSE;
- }
- else
- $bs_server_path = 'http://' . $bs_server . '/' . $bs_db . '/' . $bs_table;
-
- // init curl handle
- $curlHnd = curl_init ($bs_server_path);
-
- // curl handle exists
- if ($curlHnd)
- {
- // specify custom header
- $customHeader = array(
- "Accept-Language: en-us;en;q=0;5",
- "Accept-Charset: ISO-8859-1;utf-8;q=0.7,*;q=0.7",
- "Content-type: $tmp_file_type"
- );
-
- // specify custom curl options
- $curlOptArr = array(
- CURLOPT_PUT => TRUE,
- CURLOPT_HEADER => TRUE,
- CURLOPT_HTTPHEADER => $customHeader,
- CURLOPT_INFILESIZE => $tmp_file_size,
- CURLOPT_INFILE => $tmp_file,
- CURLOPT_RETURNTRANSFER => TRUE
- );
-
- // setup custom curl options (as specified in above array)
- curl_setopt_array($curlHnd, $curlOptArr);
-
- // execute curl request and retrieve error message(s) (if any)
- $ret = curl_exec($curlHnd);
- $errRet = curl_error($curlHnd);
-
- // close curl handle
- curl_close($curlHnd);
-
- // split return string into lines
- $retArr = explode("\r\n", $ret);
-
- // check subsequent lines for valid BLOB reference string
- foreach ($retArr as $value)
- if (strlen($value) > strlen("~*$bs_db/~") && "~*$bs_db/~" == substr($value, 0, strlen($bs_db) + 4))
- {
- // is a valid reference, so set as current and break
- PMA_File::setRecentBLOBReference($value);
- break;
- }
-
- // close file handle
- if ($tmp_file)
- fclose($tmp_file);
- } // end if ($curlHnd)
- } // end if ($allBSTablesExist)
- } // end if ($PMA_Config)
- } // end if ($is_bs_upload)
+ } else {
+ // no fileinfo library exists, use file command
+ $tmp_file_type = exec("file -bi " . escapeshellarg($tmp_filename));
+ }
+
+ if (! $tmp_file_type) {
+ $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);
+ } // end if ($is_bs_upload)
return $this->setLocalSelectedFile($_REQUEST['fields_uploadlocal_' . $key]['multi_edit'][$primary]);
} else {
@@ -633,127 +450,36 @@ class PMA_File
// is a request to upload file to BLOB repository using uploadDir mechanism
if ($is_bs_upload)
{
- // load PMA configuration
- $PMA_Config = $GLOBALS['PMA_Config'];
-
- // if the PMA configuration was loaded
- if (!empty($PMA_Config))
- {
- // load BS variables from PMA configuration
- $pluginsExist = $PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST');
- $curlExists = $PMA_Config->get('CURL_EXISTS');
- $bs_database = $PMA_Config->get('BLOBSTREAMABLE_DATABASES');
- $bs_database = $bs_database[$_REQUEST['db']];
-
- $allBSTablesExist = TRUE;
-
- // if plugins and curl exist
- if ($pluginsExist && $curlExists)
- {
- foreach ($bs_database as $table_key=>$table)
- {
- if (!$bs_database[$table_key]['Exists'])
- {
- $allBSTablesExist = FALSE;
- break;
- }
- }
- }
- else
- $allBSTablesExist = FALSE;
-
- if ($allBSTablesExist)
- {
- // load BS variables
- $bs_server = $PMA_Config->get('BLOBSTREAMING_SERVER');
- $bs_db = $_REQUEST['db'];
- $bs_table = $_REQUEST['table'];
-
- // setup uploadDir mechanism and file variables
- $tmp_filename = $GLOBALS['cfg']['UploadDir'] . '/' . $_REQUEST['fields_uploadlocal_' . $key]['multi_edit'][$primary];
- $tmp_file = fopen($tmp_filename, 'r');
- $tmp_file_size = filesize($tmp_filename);
-
- // check if fileinfo library exists
- if ($PMA_Config->get('FILEINFO_EXISTS'))
- {
- // attempt to init fileinfo
- $finfo = finfo_open(FILEINFO_MIME);
-
- // if fileinfo exists
- if ($finfo)
- {
- // pass in filename to fileinfo and close fileinfo handle after
- $tmp_file_type = finfo_file($finfo, $tmp_filename);
- finfo_close($finfo);
- }
- }
- else // no fileinfo library exists, use file command
- $tmp_file_type = exec("file -bi " . escapeshellarg($tmp_filename));
+ // check if fileinfo library exists
+ if ($PMA_Config->get('FILEINFO_EXISTS'))
+ {
+ // attempt to init fileinfo
+ $finfo = finfo_open(FILEINFO_MIME);
+
+ // if fileinfo exists
+ if ($finfo)
+ {
+ // pass in filename to fileinfo and close fileinfo handle after
+ $tmp_file_type = finfo_file($finfo, $tmp_filename);
+ finfo_close($finfo);
+ }
+ }
+ else // no fileinfo library exists, use file command
+ $tmp_file_type = exec("file -bi " . escapeshellarg($tmp_filename));
+
+ if (!$tmp_file_type)
+ $tmp_file_type = NULL;
+
+ $bs_db = $_REQUEST['db'];
+ $bs_table = $_REQUEST['table'];
+ 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 (!$tmp_file_type)
- $tmp_file_type = NULL;
-
- // necessary variables aren't loaded, return error message (unknown error)
- if (!$bs_server || !$bs_db || !$bs_table || !$tmp_file || !$tmp_file_size)
- {
- $this->_error_message = __('Unknown error in file upload.');
- return FALSE;
- }
- else
- $bs_server_path = 'http://' . $bs_server . '/' . $bs_db . '/' . $bs_table;
-
- // init curl handle
- $curlHnd = curl_init ($bs_server_path);
-
- // if curl handle exists
- if ($curlHnd)
- {
- // specify custom header
- $customHeader = array(
- "Accept-Language: en-us;en;q=0;5",
- "Accept-Charset: ISO-8859-1;utf-8;q=0.7,*;q=0.7",
- "Content-type: $tmp_file_type"
- );
-
- // specify custom curl options
- $curlOptArr = array(
- CURLOPT_PUT => TRUE,
- CURLOPT_HEADER => TRUE,
- CURLOPT_HTTPHEADER => $customHeader,
- CURLOPT_INFILESIZE => $tmp_file_size,
- CURLOPT_INFILE => $tmp_file,
- CURLOPT_RETURNTRANSFER => TRUE
- );
-
- // setup custom curl options (as specified in above array)
- curl_setopt_array($curlHnd, $curlOptArr);
-
- // execute curl request and retrieve error message(s) (if any)
- $ret = curl_exec($curlHnd);
- $errRet = curl_error($curlHnd);
-
- // close curl handle
- curl_close($curlHnd);
-
- // split return string into lines
- $retArr = explode("\r\n", $ret);
-
- // check subsequent lines for valid BLOB reference string
- foreach ($retArr as $value)
- if (strlen($value) > strlen("~*$bs_db/~") && "~*$bs_db/~" == substr($value, 0, strlen($bs_db) + 4))
- {
- // is a valid reference, so set as current and break
- PMA_File::setRecentBLOBReference($value);
- break;
- }
-
- // close file handle
- if ($tmp_file)
- fclose($tmp_file);
- } // end if ($curlHnd)
- } // end if ($allBSTablesExist)
- } // end if ($PMA_Config)
} // end if ($is_bs_upload)
return $this->setLocalSelectedFile($_REQUEST['fields_uploadlocal_' . $key]);
diff --git a/libraries/StorageEngine.class.php b/libraries/StorageEngine.class.php
index 2ae125a..71b3636 100644
--- a/libraries/StorageEngine.class.php
+++ b/libraries/StorageEngine.class.php
@@ -91,12 +91,7 @@ class PMA_StorageEngine
&& ($details['Support'] == 'NO' || $details['Support'] == 'DISABLED')) {
continue;
}
- // currently (MySQL 5.1.26) there is no way we can be informed
- // that PBMS does not support normal table creation so
- // we use an exception here
- if ('PBMS' == $details['Engine']) {
- continue;
- }
+
$output .= ' <option value="' . htmlspecialchars($key). '"'
. (empty($details['Comment'])
? '' : ' title="' . htmlspecialchars($details['Comment']) . '"')
@@ -144,6 +139,9 @@ class PMA_StorageEngine
*/
static public function isValid($engine)
{
+ if ($engine == "PBMS") {
+ return TRUE;
+ }
$storage_engines = PMA_StorageEngine::getStorageEngines();
return isset($storage_engines[$engine]);
}
@@ -265,6 +263,8 @@ class PMA_StorageEngine
return $mysql_vars;
}
+ function engine_init() {}
+
/**
* Constructor
*
@@ -303,7 +303,9 @@ class PMA_StorageEngine
default:
$this->support = PMA_ENGINE_SUPPORT_NO;
}
- }
+ } else {
+ $this->engine_init();
+ }
}
/**
diff --git a/libraries/blobstreaming.lib.php b/libraries/blobstreaming.lib.php
index 82c3194..abbe047 100644
--- a/libraries/blobstreaming.lib.php
+++ b/libraries/blobstreaming.lib.php
@@ -4,6 +4,41 @@
* @package BLOBStreaming
*/
+function initPBMSDatabase()
+{
+ $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
+ * 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
+ * daemon to create the 'pbms' database.
+ */
+ $db_array = PMA_DBI_fetch_result('SHOW DATABASES;');
+ if (! empty($db_array)) {
+ $target = "";
+ foreach ($db_array as $current_db) {
+ if ($current_db == 'pbms') {
+ return TRUE;
+ }
+ if ($target == "") {
+ if (($current_db != 'pbxt') && ($current_db != 'mysql') && ($current_db != 'information_schema')) {
+ $target = $current_db;
+ }
+ }
+ }
+
+ if ($target != "") {
+ $query = "select * from $target.pbms_metadata_header"; // If it exists this table will not contain much
+ }
+ }
+
+ $result = PMA_DBI_query($query );
+ if (! $result) {
+ return FALSE;
+ }
+ return TRUE;
+}
+
/**
* checks whether the necessary plugins for BLOBStreaming exist
*
@@ -13,7 +48,6 @@
* @uses PMA_Config::set()
* @uses PMA_BS_SetVariables()
* @uses PMA_BS_GetVariables()
- * @uses PMA_BS_SetFieldReferences()
* @uses PMA_cacheSet()
* @uses PMA_cacheGet()
* @return boolean
@@ -28,12 +62,6 @@ function checkBLOBStreamingPlugins()
return FALSE;
}
- // At this point we might already know that plugins do not exist
- // because this was recorded in the session (cache).
- if (PMA_cacheGet('skip_blobstreaming', true)) {
- return false;
- }
-
// If we don't know that we can skip blobstreaming, we continue
// verifications; anyway, in case we won't skip blobstreaming,
// we still need to set some variables in non-persistent settings,
@@ -63,72 +91,41 @@ function checkBLOBStreamingPlugins()
$serverCfg['socket'] = "";
}
- $allPluginsExist = false;
+ $has_blobstreaming = false;
if (PMA_MYSQL_INT_VERSION >= 50109) {
- $PMA_Config->set('PBXT_NAME', 'pbxt');
- $PMA_Config->set('PBMS_NAME', 'pbms');
-
- $required_plugins[$PMA_Config->get('PBXT_NAME')]['Library'] = 'libpbxt.so';
- $required_plugins[$PMA_Config->get('PBMS_NAME')]['Library'] = 'libpbms.so';
- $number_of_required_plugins_found = 0;
// Retrieve MySQL 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
- foreach ($required_plugins as $one_required_plugin) {
- if ( strtolower($one_existing_plugin['Library']) == strtolower($one_required_plugin['Library'])
- && $one_existing_plugin['Status'] == "ACTIVE") {
- $number_of_required_plugins_found++;
- }
- }
- if (2 == $number_of_required_plugins_found) {
- $allPluginsExist = true;
+ if ( strtolower($one_existing_plugin['Library']) == 'libpbms.so'
+ && $one_existing_plugin['Status'] == "ACTIVE") {
+ $has_blobstreaming = true;
break;
}
}
- unset($required_plugins, $existing_plugins, $one_required_plugin, $one_existing_plugin, $number_of_required_plugins_found);
+ unset($existing_plugins, $one_existing_plugin);
}
// set variable indicating BS plugin existence
- $PMA_Config->set('BLOBSTREAMING_PLUGINS_EXIST', $allPluginsExist);
+ $PMA_Config->set('BLOBSTREAMING_PLUGINS_EXIST', $has_blobstreaming);
- if ($allPluginsExist) {
- // retrieve BS variables from PMA configuration
- $bs_set_variables = array();
-
- $bs_set_variables[$PMA_Config->get('PBMS_NAME') . '_garbage_threshold'] = (isset($serverCfg['bs_garbage_threshold'])) ? $serverCfg['bs_garbage_threshold'] : NULL;
- $bs_set_variables[$PMA_Config->get('PBMS_NAME') . '_repository_threshold'] = (isset($serverCfg['bs_repository_threshold'])) ? $serverCfg['bs_repository_threshold'] : NULL;
- $bs_set_variables[$PMA_Config->get('PBMS_NAME') . '_temp_blob_timeout'] = (isset($serverCfg['bs_temp_blob_timeout'])) ? $serverCfg['bs_temp_blob_timeout'] : NULL;
- $bs_set_variables[$PMA_Config->get('PBMS_NAME') . '_temp_log_threshold'] = (isset($serverCfg['bs_temp_log_threshold'])) ? $serverCfg['bs_temp_log_threshold'] : NULL;
-
- // set BS variables to PMA configuration defaults
- PMA_BS_SetVariables($bs_set_variables);
-
- // retrieve updated BS variables (configurable and unconfigurable)
+ if ($has_blobstreaming) {
$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) {
$PMA_Config->set('BLOBSTREAMING_PLUGINS_EXIST', FALSE);
PMA_cacheSet('skip_blobstreaming', true, true);
return FALSE;
} // end if (count($bs_variables) <= 0)
- // switch on BS field references
- if (strtolower($bs_variables[$PMA_Config->get('PBMS_NAME') . '_field_references']) == "off") {
- if (! PMA_BS_SetFieldReferences('ON')) {
- PMA_cacheSet('skip_blobstreaming', true, true);
- return FALSE;
- }
- }
-
- // get BS server port
- $BS_PORT = $bs_variables[$PMA_Config->get('PBMS_NAME') . '_port'];
+ // get BS server port
+ $BS_PORT = $bs_variables['pbms_port'];
- // if no BS server port exists, set plugin existance to false and return
- if (! $BS_PORT) {
+ // if no BS server port or 'pbms' database exists, set plugin existance to false and return
+ if ((! $BS_PORT) || (! initPBMSDatabase())) {
$PMA_Config->set('BLOBSTREAMING_PLUGINS_EXIST', FALSE);
PMA_cacheSet('skip_blobstreaming', true, true);
return FALSE;
@@ -138,21 +135,9 @@ function checkBLOBStreamingPlugins()
$PMA_Config->set('BLOBSTREAMING_PORT', $BS_PORT);
$PMA_Config->set('BLOBSTREAMING_HOST', $serverCfg['host']);
$PMA_Config->set('BLOBSTREAMING_SERVER', $serverCfg['host'] . ':' . $BS_PORT);
- $PMA_Config->set('CURL_EXISTS', FALSE);
+ $PMA_Config->set('PHP_PBMS_EXISTS', FALSE);
$PMA_Config->set('FILEINFO_EXISTS', FALSE);
- // check if CURL exists
- if (function_exists("curl_init")) {
- // initialize curl handler
- $curlHnd = curl_init();
-
- // CURL exists, set necessary variable and close resource
- if (! empty($curlHnd)) {
- $PMA_Config->set('CURL_EXISTS', TRUE);
- curl_close($curlHnd);
- } // end if (!empty($curlHnd))
- } // end if (function_exists("curl_init"))
-
// check if PECL's fileinfo library exist
$finfo = NULL;
@@ -165,181 +150,16 @@ function checkBLOBStreamingPlugins()
$PMA_Config->set('FILEINFO_EXISTS', TRUE);
finfo_close($finfo);
} // end if (!empty($finfo))
+
} else {
PMA_cacheSet('skip_blobstreaming', true, true);
return FALSE;
- } // end if ($allPluginsExist)
-
- $bs_tables = array();
-
- // specify table structure for BS reference table
- $bs_tables[$PMA_Config->get('PBMS_NAME') . '_reference'] = array();
- $bs_tables[$PMA_Config->get('PBMS_NAME') . '_reference']['struct'] = <<<EOD
- CREATE TABLE {$PMA_Config->get('PBMS_NAME')}_reference
- (
- Table_name CHAR(64) COMMENT 'The name of the referencing table',
- Blob_id BIGINT COMMENT 'The BLOB reference number - part of the BLOB URL',
- Column_name CHAR(64) COMMENT 'The column name of the referencing field',
- Row_condition VARCHAR(255) COMMENT 'This condition identifies the row in the table',
- Blob_url VARCHAR(200) COMMENT 'The BLOB URL for HTTP GET access',
- Repository_id INT COMMENT 'The repository file number of the BLOB',
- Repo_blob_offset BIGINT COMMENT 'The offset in the repository file',
- Blob_size BIGINT COMMENT 'The size of the BLOB in bytes',
- Deletion_time TIMESTAMP COMMENT 'The time the BLOB was deleted',
- Remove_in INT COMMENT 'The number of seconds before the reference/BLOB is removed perminently',
- Temp_log_id INT COMMENT 'Temporary log number of the referencing deletion entry',
- Temp_log_offset BIGINT COMMENT 'Temporary log offset of the referencing deletion entry'
- ) ENGINE=PBMS;
-EOD;
-
- // specify table structure for BS repository table
- $bs_tables[$PMA_Config->get('PBMS_NAME') . '_repository'] = array();
- $bs_tables[$PMA_Config->get('PBMS_NAME') . '_repository']['struct'] = <<<EOD
- CREATE TABLE {$PMA_Config->get('PBMS_NAME')}_repository
- (
- Repository_id INT COMMENT 'The repository file number',
- Repo_blob_offset BIGINT COMMENT 'The offset of the BLOB in the repository file',
- Blob_size BIGINT COMMENT 'The size of the BLOB in bytes',
- Head_size SMALLINT UNSIGNED COMMENT 'The size of the BLOB header - proceeds the BLOB data',
- Access_code INT COMMENT 'The 4-byte authorisation code required to access the BLOB - part of the BLOB URL',
- Creation_time TIMESTAMP COMMENT 'The time the BLOB was created',
- Last_ref_time TIMESTAMP COMMENT 'The last time the BLOB was referenced',
- Last_access_time TIMESTAMP COMMENT 'The last time the BLOB was accessed (read)',
- Content_type CHAR(128) COMMENT 'The content type of the BLOB - returned by HTTP GET calls',
- Blob_data LONGBLOB COMMENT 'The data of this BLOB'
- ) ENGINE=PBMS;
-EOD;
-
- // specify table structure for BS custom content type table
- $bs_tables[$PMA_Config->get('PBMS_NAME') . '_custom_content_type'] = array();
- $bs_tables[$PMA_Config->get('PBMS_NAME') . '_custom_content_type']['struct'] = <<<EOD
- CREATE TABLE {$PMA_Config->get('PBMS_NAME')}_custom_content_type
- (
- Blob_url VARCHAR(200) COMMENT 'The BLOB URL for HTTP GET access',
- Content_type VARCHAR(255) COMMENT 'The custom MIME type for a given BLOB reference as specified by the user',
-
- PRIMARY KEY(Blob_url)
- );
-EOD;
-
- // add BS tables to PMA configuration
- $PMA_Config->set('BLOBSTREAMING_TABLES', $bs_tables);
+ } // end if ($has_blobstreaming)
return TRUE;
}
/**
- * checks for databases that support BLOBStreaming
- *
- * @access public
- * @uses PMA_GetDatabases()
- * @uses PMA_TablesExist()
- * @uses PMA_Config::set()
-*/
-function checkBLOBStreamableDatabases()
-{
- // load PMA configuration
- $PMA_Config = $GLOBALS['PMA_Config'];
-
- $serverCfg = $GLOBALS['cfg']['Server'];
-
- // retrieve BS tables from PMA configuration
- $session_bs_tables = $PMA_Config->get('BLOBSTREAMING_TABLES');
-
- $bs_databases = array();
- $bs_tables = array();
-
- // return if BS tables do not exist
- if (!$session_bs_tables)
- return;
-
- foreach ($session_bs_tables as $table_key=>$table)
- {
- $bs_tables[$table_key] = array();
- $bs_tables[$table_key]['Exists'] = FALSE;
- }
-
- // retrieve MySQL databases
- $databases = PMA_GetDatabases();
-
- // check if BS tables exist for each database
- foreach ($databases as $db_key=>$db_name)
- {
- $bs_databases[$db_name] = $bs_tables;
-
- PMA_TablesExist($bs_databases[$db_name], $db_name);
- }
-
- // set BS databases in PMA configuration
- $PMA_Config->set('BLOBSTREAMABLE_DATABASES', $bs_databases);
-}
-
-
-
-/**
- * checks whether a given set of tables exist in a given database
- *
- * @access public
- * @param array - list of tables to look for
- * @param string - name of database
- * @uses PMA_DBI_select_db()
- * @uses PMA_DBI_query()
- * @uses PMA_DBI_fetch_assoc()
- */
-function PMA_TablesExist(&$tables, $db_name)
-{
- // select specified database
- PMA_DBI_select_db($db_name);
-
- // run query to retrieve tables in specified database
- $query = "SHOW TABLES";
- $result = PMA_DBI_query($query);
-
- // while there are records to parse
- while ($data = @PMA_DBI_fetch_assoc($result))
- {
- $state = TRUE;
-
- // check if necessary tables exist
- foreach ($tables as $table_key=>$table)
- if (!$table['Exists'])
- if ($data['Tables_in_' . $db_name] == $table_key)
- $tables[$table_key]['Exists'] = TRUE;
- else
- if ($state)
- $state = FALSE;
-
- // break if necessary tables are found before all records are parsed
- if ($state)
- break;
- } // end while ($data = @PMA_DBI_fetch_assoc($result))
-}
-
-/**
- * returns a list of databases
- *
- * @access public
- * @uses PMA_DBI_query()
- * @uses PMA_DBI_fetch_assoc()
- * @return array - list of databases acquired via MySQL
-*/
-function PMA_GetDatabases()
-{
- // run query to retrieve databases
- $query = "SHOW DATABASES";
- $result = PMA_DBI_query($query);
-
- $databases = array();
-
- // while there are records to parse
- while ($data = @PMA_DBI_fetch_assoc($result))
- $databases[] = $data['Database'];
-
- // return list of databases
- return $databases;
-}
-
-/**
* sets BLOBStreaming variables to a list of specified arguments
* @access public
* @uses PMA_DBI_query()
@@ -388,7 +208,7 @@ function PMA_BS_GetVariables()
return NULL;
// run query to retrieve BS variables
- $query = "SHOW VARIABLES LIKE '%" . $PMA_Config->get('PBMS_NAME') . "%'";
+ $query = "SHOW VARIABLES LIKE '%pbms%'";
$result = PMA_DBI_query($query);
$BS_Variables = array();
@@ -401,313 +221,256 @@ function PMA_BS_GetVariables()
return $BS_Variables;
}
-/**
- * sets the BLOBStreaming global field references to ON/OFF
- *
- * @access public
- * @param string - ON or OFF
- * @uses PMA_Config::get()
- * @uses PMA_sqlAddslashes()
- * @uses PMA_DBI_query()
- * @return boolean - success/failure of query execution
-*/
-function PMA_BS_SetFieldReferences($val)
+//========================
+//========================
+function PMA_BS_ReportPBMSError($msg)
+{
+ $tmp_err = pbms_error();
+ PMA_showMessage("PBMS error, $msg $tmp_err");
+}
+
+//------------
+function PMA_do_connect($db_name, $quiet)
{
- // load PMA configuration
$PMA_Config = $GLOBALS['PMA_Config'];
// return if unable to load PMA configuration
if (empty($PMA_Config))
return FALSE;
- // set field references to value specified
- $query = "SET GLOBAL " . $PMA_Config->get('PBMS_NAME') . "_field_references=" . PMA_sqlAddslashes($val);
- $result = PMA_DBI_try_query($query, null, 0);
-
- // get last known error (if applicable)
- PMA_DBI_getError();
+ // generate bs reference link
+ $pbms_host = $PMA_Config->get('BLOBSTREAMING_HOST');
+ $pbms_port = $PMA_Config->get('BLOBSTREAMING_PORT');
- // return success of query execution
- if ($result && 0 == $GLOBALS['errno'])
- return TRUE;
- else
+ if (pbms_connect($pbms_host, $pbms_port, $db_name) == FALSE) {
+ if ($quiet == FALSE) {
+ PMA_BS_ReportPBMSError("PBMS Connectiuon failed: pbms_connect($pbms_host, $pbms_port, $db_name)");
+ }
return FALSE;
+ }
+ return TRUE;
}
-/**
- * gets the SQL table definition for a given BLOBStreaming table
- *
- * @access public
- * @param string - table name
- * @uses PMA_Config::get()
- * @return string - SQL table definition
-*/
-function PMA_BS_GetTableStruct($tbl_name)
+//------------
+function PMA_do_disconnect()
{
- // retrieve table structures for BS tables
- $bs_tables = $GLOBALS['PMA_Config']->get('BLOBSTREAMING_TABLES');
-
- // return if tables don't exist
- if (!$bs_tables)
- return;
-
- // return if specified table doesn't exist in collection of BS tables
- if (!isset($bs_tables[$tbl_name]))
- return;
-
- // return specified table's structure
- return $bs_tables[$tbl_name]['struct'];
+ pbms_close();
}
+//------------
/**
- * creates the BLOBStreaming tables for a given database
+ * checks whether the BLOB reference looks valid
*
- * @access public
- * @param string - database name
- * @uses PMA_Config::get()
- * @uses PMA_DBI_select_db()
- * @uses PMA_DBI_query()
- * @uses PMA_BS_GetTableStruct()
- * @return boolean - success/failure of transactional query execution
*/
-function PMA_BS_CreateTables($db_name)
+function PMA_BS_IsPBMSReference($bs_reference, $db_name)
{
- // retrieve BS tables
- $bs_tables = $GLOBALS['PMA_Config']->get('BLOBSTREAMING_TABLES');
-
- // select specified database
- PMA_DBI_select_db($db_name);
-
- // create necessary BS tables for specified database
- foreach ($bs_tables as $table_key=>$table)
- {
- $result = PMA_DBI_query(PMA_BS_GetTableStruct($table_key));
-
- // return false if query execution fails
- if (!$result)
- return FALSE;
+ if (PMA_cacheGet('skip_blobstreaming', true)) {
+ return FALSE;
}
- // return true on success
- return TRUE;
+ if (PMA_do_connect($db_name, TRUE) == FALSE) {
+ return FALSE;
+ }
+ $ok = pbms_is_blob_reference($bs_reference);
+ PMA_do_disconnect();
+ return $ok ;
}
-/**
- * drops BLOBStreaming tables for a given database
- *
- * @access public
- * @param string - database name
- * @uses PMA_Config::get()
- * @uses PMA_DBI_select_db()
- * @uses PMA_backquote()
- * @uses PMA_DBI_query()
- * @return boolean - success/failure of transactional query execution
-*/
-function PMA_BS_DropTables($db_name)
+//------------
+function PMA_BS_CreateReferenceLink($bs_reference, $db_name)
{
- // load PMA configuration
- $PMA_Config = $GLOBALS['PMA_Config'];
-
- // return if unable to load PMA configuration
- if (empty($PMA_Config))
- return FALSE;
-
- // retrieve BS tables
- $bs_tables = $PMA_Config->get('BLOBSTREAMING_TABLES');
-
- // select specified database
- PMA_DBI_select_db($db_name);
-
- // drop BS tables
- foreach ($bs_tables as $table_key=>$table)
- {
- $query = "DROP TABLE IF EXISTS " . PMA_backquote($table_key);
- $result = PMA_DBI_query($query);
+ if (PMA_do_connect($db_name, FALSE) == FALSE) {
+ return 'Error';
+ }
- // return false if query execution fails
- if (!$result)
- return FALSE;
+ if (pbms_get_info($bs_reference) == FALSE) {
+ PMA_BS_ReportPBMSError("PBMS get BLOB info failed: pbms_get_info($bs_reference)");
+ PMA_do_disconnect();
+ return 'Error';
}
- // return true on success
- return TRUE;
-}
+ $content_type = pbms_get_metadata_value("Content-type");
+ if ($content_type == FALSE) {
+ PMA_BS_ReportPBMSError("PMA_BS_CreateReferenceLink($bs_reference, $db_name): get BLOB Content-type failed: ");
+ }
-/**
- * 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)
-{
- // load PMA configuration
- $PMA_Config = $GLOBALS['PMA_Config'];
+ PMA_do_disconnect();
- // return if unable to load PMA configuration
- if (empty($PMA_Config))
- return FALSE;
+ if (! $content_type) {
+ $content_type = "image/jpeg";
+ }
- // select specified database
- PMA_DBI_select_db($db_name);
+ $bs_url = PMA_BS_getURL($bs_reference);
+ if (empty($bs_url)) {
+ PMA_BS_ReportPBMSError("No blob streaming server configured!");
+ return 'Error';
+ }
- // retrieve table fields
- $query = "SHOW FULL FIELDS FROM " . PMA_backquote($tbl_name);
- $result = PMA_DBI_query($query);
+ $output = "<a href=\"#\" onclick=\"requestMIMETypeChange('" . urlencode($db_name) . "', '" . urlencode($GLOBALS['table']) . "', '" . urlencode($bs_reference) . "', '" . urlencode($content_type) . "')\">$content_type</a>";
- // while there are records to parse
- while ($data = PMA_DBI_fetch_assoc($result))
- if ("PRI" == $data['Key'])
- return $data['Field'];
+ // specify custom HTML for various content types
+ switch ($content_type) {
+ // no content specified
+ case NULL:
+ $output = "NULL";
+ break;
+ // image content
+ case 'image/jpeg':
+ case 'image/png':
+ $output .= ' (<a href="' . $bs_url . '" target="new">' . __('View image') . '</a>)';
+ break;
+ // audio content
+ 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>)';
+ break;
+ // video content
+ case 'application/x-flash-video':
+ 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>)';
+ break;
+ // unsupported content. specify download
+ default:
+ $output .= ' (<a href="' . $bs_url . '" target="new">' . __('Download file'). '</a>)';
+ }
- // return NULL on no primary key
- return NULL;
+ return $output;
}
-/**
- * checks whether a BLOB reference exists in the BLOB repository
- *
- * @access public
- * @param string - BLOB reference
- * @param string - database name
- * @uses PMA_DBI_select_db()
- * @uses PMA_backquote()
- * @uses PMA_Config::get()
- * @uses PMA_sqlAddslashes()
- * @uses PMA_DBI_query()
- * @return boolean - existence of BLOB reference
-*/
-function PMA_BS_ReferenceExists($bs_reference, $db_name)
+//------------
+// In the future there may be server variables to turn on/off PBMS
+// BLOB streaming on a per table or database basis. So in anticipation of this
+// PMA_BS_IsTablePBMSEnabled() passes in the table and database name even though
+// they are not currently needed.
+function PMA_BS_IsTablePBMSEnabled($db_name, $tbl_name, $tbl_type)
{
- $referenceExists = FALSE;
+ if (PMA_cacheGet('skip_blobstreaming', true)) {
+ return FALSE;
+ }
- // return false on invalid BS reference
- if (strlen ($bs_reference) < strlen ("~*$db_name/~") || "~*$db_name/~" != substr ($bs_reference, 0, strlen ($db_name) + 4))
- return $referenceExists;
+ if ((isset($tbl_type) == FALSE) || (strlen($tbl_type) == 0)) {
+ return FALSE;
+ }
// load PMA configuration
$PMA_Config = $GLOBALS['PMA_Config'];
// return if unable to load PMA configuration
- if (empty($PMA_Config))
- return $referenceExists;
+ if (empty($PMA_Config)) {
+ return FALSE;
+ }
- // select specified database
- PMA_DBI_select_db($db_name);
+ if (! $PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST')) {
+ return FALSE;
+ }
- // run query on BS reference retrieval
- $query = "SELECT * FROM " . PMA_backquote($PMA_Config->get('PBMS_NAME') . "_reference") . " WHERE Blob_url='" . PMA_sqlAddslashes($bs_reference) . "'";
+ // 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) . "'";
$result = PMA_DBI_query($query);
- // if record exists
- if ($data = @PMA_DBI_fetch_assoc($result))
- $referenceExists = TRUE;
+ $data = PMA_DBI_fetch_row($result);
+ if ($data[0] == 1) {
+ return TRUE;
+ }
- // return reference existance
- return $referenceExists;
+ return FALSE;
}
-/**
- * creates a HTTP link to a given blob reference for a given database
- *
- * @access public
- * @param string - BLOB reference
- * @param string - database name
- * @uses PMA_Config::get()
- * @uses PMA_DBI_select_db()
- * @uses PMA_backquote()
- * @uses PMA_sqlAddslashes()
- * @uses PMA_DBI_query()
- * @uses PMA_DBI_fetch_assoc()
- * @return string - HTTP link or Error
-*/
-function PMA_BS_CreateReferenceLink($bs_reference, $db_name)
+//------------
+function PMA_BS_UpLoadFile($db_name, $tbl_name, $file_type, $file_name)
{
- // load PMA configuration
- $PMA_Config = $GLOBALS['PMA_Config'];
- // return if unable to load PMA configuration
- if (empty($PMA_Config))
- return '';
+ if (PMA_cacheGet('skip_blobstreaming', true)) {
+ return FALSE;
+ }
+
+ if (PMA_do_connect($db_name, FALSE) == FALSE) {
+ return FALSE;
+ }
- // generate bs reference link
- $bs_ref_link = 'http://' . $PMA_Config->get('BLOBSTREAMING_SERVER') . '/' . $bs_reference;
+ $fh = fopen($file_name, 'r');
+ if (! $fh) {
+ PMA_do_disconnect();
+ PMA_showMessage("Could not open file: $file_name");
+ return FALSE;
+ }
- // select specified database
- PMA_DBI_select_db($db_name);
+ pbms_add_metadata("Content-type", $file_type);
- $pbms_repo_bq = PMA_backquote($PMA_Config->get('PBMS_NAME') . "_repository");
- $pbms_ref_bq = PMA_backquote($PMA_Config->get('PBMS_NAME') . "_reference");
- $pbms_cust_content_bq = PMA_backquote($PMA_Config->get('PBMS_NAME') . "_custom_content_type");
+ $pbms_blob_url = pbms_read_stream($fh, filesize($file_name), $tbl_name);
+ if (! $pbms_blob_url) {
+ PMA_BS_ReportPBMSError("pbms_read_stream() Failed");
+ }
- // run query on determining specified BS reference
- $query = "SELECT $pbms_repo_bq.Content_type, $pbms_cust_content_bq.Content_type AS Custom_type";
- $query .= " FROM $pbms_repo_bq LEFT JOIN $pbms_ref_bq ON";
- $query .= "$pbms_repo_bq.Repository_id=$pbms_ref_bq.Repository_id";
- $query .= " AND $pbms_repo_bq.Blob_size=$pbms_ref_bq.Blob_size";
- $query .= " AND $pbms_repo_bq.Repo_blob_offset=$pbms_ref_bq.Repo_blob_offset";
- $query .= " LEFT JOIN $pbms_cust_content_bq ON $pbms_cust_content_bq.Blob_url=$pbms_ref_bq.Blob_url";
- $query .= " WHERE $pbms_ref_bq.Blob_url='" . PMA_sqlAddslashes($bs_reference) . "'";
+ fclose($fh);
+ PMA_do_disconnect();
+ return $pbms_blob_url;
+}
+//------------
+function PMA_BS_SetContentType($db_name, $bsTable, $blobReference, $contentType)
+{
+ if (PMA_cacheGet('skip_blobstreaming', true)) {
+ return FALSE;
+ }
+
+ // 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
+ // more eficient.
+ $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");
$result = PMA_DBI_query($query);
+ //error_log(" $query\n", 3, "/tmp/mylog");
- // if record exists
- if ($data = @PMA_DBI_fetch_assoc($result))
- {
- // determine content-type for BS repository file (original or custom)
- $is_custom_type = false;
-
- if (isset($data['Custom_type']))
- {
- $content_type = $data['Custom_type'];
- $is_custom_type = true;
- }
- else
- $content_type = $data['Content_type'];
-
- if (!$content_type)
- $content_type = NULL;
-
- $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
- switch ($content_type)
- {
- // no content specified
- case NULL:
- $output = "NULL";
- break;
- // image content
- case 'image/jpeg':
- case 'image/png':
- $output .= ' (<a href="' . $bs_ref_link . '" target="new">' . __('View image') . '</a>)';
- break;
- // audio content
- 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>)';
- break;
- // video content
- case 'application/x-flash-video':
- 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>)';
- break;
- // unsupported content. specify download
- default:
- $output .= ' (<a href="' . $bs_ref_link . '" target="new">' . __('Download file'). '</a>)';
+// if record exists
+ if ($data = PMA_DBI_fetch_assoc($result)) {
+ $where = "WHERE Repository_id=" . $data['Repository_id'] . " AND Repo_blob_offset=" . $data['Repo_blob_offset'] ;
+ $query = "SELECT name from pbms_metadata $where";
+ $result = PMA_DBI_query($query);
+
+ 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) . "')";
+ } else {
+ $query = "UPDATE pbms_metadata SET name = 'Content_type', Value = '" . PMA_sqlAddslashes($contentType) . "' $where";
}
+//error_log("$query\n", 3, "/tmp/mylog");
+ PMA_DBI_query($query);
+ } else {
+ return FALSE;
+ }
+ return TRUE;
+}
- // return HTML
- return $output;
- } // end if ($data = @PMA_DBI_fetch_assoc($result))
-
- // return on error
- return 'Error';
+//------------
+function PMA_BS_IsHiddenTable($table)
+{
+ switch ($table) {
+ case 'pbms_repository' :
+ case 'pbms_reference' :
+ case 'pbms_metadata' :
+ case 'pbms_metadata_header' :
+ case 'pbms_dump' :
+ return TRUE;
+ }
+ return FALSE;
}
+//------------
+function PMA_BS_getURL($reference)
+{
+ // load PMA configuration
+ $PMA_Config = $GLOBALS['PMA_Config'];
+ if (empty($PMA_Config)) {
+ return FALSE;
+ }
+
+ // retrieve BS server variables from PMA configuration
+ $bs_server = $PMA_Config->get('BLOBSTREAMING_SERVER');
+ if (empty($bs_server)) {
+ return FALSE;
+ }
+
+ $bs_url = 'http://' . $bs_server . '/' . rtrim($reference);
+ return $bs_url;
+}
?>
diff --git a/libraries/common.inc.php b/libraries/common.inc.php
index abbd663..d1a6d94 100644
--- a/libraries/common.inc.php
+++ b/libraries/common.inc.php
@@ -797,7 +797,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
require_once './libraries/logging.lib.php';
- // Gets the authentication library that fits the $cfg['Server'] settings
+ // Gets the authentication library that fits the $cfg['Server'] settings
// and run authentication
// to allow HTTP or http
@@ -809,14 +809,13 @@ if (! defined('PMA_MINIMUM_COMMON')) {
* the required auth type plugin
*/
require_once './libraries/auth/' . $cfg['Server']['auth_type'] . '.auth.lib.php';
-
if (!PMA_auth_check()) {
PMA_auth();
} else {
PMA_auth_set_user();
}
- // Check IP-based Allow/Deny rules as soon as possible to reject the
+ // Check IP-based Allow/Deny rules as soon as possible to reject the
// user
// Based on mod_access in Apache:
// http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/aaa/mod_access.c?rev=1.…
@@ -953,9 +952,8 @@ if (! defined('PMA_MINIMUM_COMMON')) {
// checks for blobstreaming plugins and databases that support
// blobstreaming (by having the necessary tables for blobstreaming)
- if (checkBLOBStreamingPlugins()) {
- checkBLOBStreamableDatabases();
- }
+ checkBLOBStreamingPlugins();
+
} // end if !defined('PMA_MINIMUM_COMMON')
// remove sensitive values from session
diff --git a/libraries/common.lib.php b/libraries/common.lib.php
index 9e22f45..1010b2c 100644
--- a/libraries/common.lib.php
+++ b/libraries/common.lib.php
@@ -654,19 +654,19 @@ function PMA_mysqlDie($error_message = '', $the_query = '',
$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 .= '[ <a href="' . $back_url . '">' . __('Back') . '</a> ]';
$error_msg_output .= '</fieldset>' . "\n\n";
- }
+ }
- echo $error_msg_output;
- /**
- * display footer and exit
- */
+ echo $error_msg_output;
+ /**
+ * display footer and exit
+ */
- require_once './libraries/footer.inc.php';
+ require_once './libraries/footer.inc.php';
} else {
echo $error_msg_output;
}
@@ -791,18 +791,11 @@ function PMA_getTableList($db, $tables = null, $limit_offset = 0, $limit_count =
// load PMA configuration
$PMA_Config = $GLOBALS['PMA_Config'];
- // if PMA configuration exists
- if (!empty($PMA_Config))
- $session_bs_tables = $GLOBALS['PMA_Config']->get('BLOBSTREAMING_TABLES');
-
foreach ($tables as $table_name => $table) {
// if BS tables exist
- if (isset($session_bs_tables))
- // compare table name to tables in list of blobstreaming tables
- foreach ($session_bs_tables as $table_key=>$table_val)
- // if table is in list, skip outer foreach loop
- if ($table_name == $table_key)
- continue 2;
+ if (PMA_BS_IsHiddenTable($table_name)) {
+ continue;
+ }
// check for correct row count
if (null === $table['Rows']) {
diff --git a/libraries/core.lib.php b/libraries/core.lib.php
index 5e85d69..dcbf177 100644
--- a/libraries/core.lib.php
+++ b/libraries/core.lib.php
@@ -310,32 +310,13 @@ function PMA_getTableCount($db)
if ($tables) {
$num_tables = PMA_DBI_num_rows($tables);
- // for blobstreaming - get blobstreaming tables
- // for use in determining if a table here is a blobstreaming table
-
- // load PMA configuration
- $PMA_Config = $GLOBALS['PMA_Config'];
-
- // if PMA configuration exists
- if (!empty($PMA_Config))
- {
- // load BS tables
- $session_bs_tables = $GLOBALS['PMA_Config']->get('BLOBSTREAMING_TABLES');
-
- // if BS tables exist
- if (isset ($session_bs_tables))
- while ($data = PMA_DBI_fetch_assoc($tables))
- foreach ($session_bs_tables as $table_key=>$table_val)
- // if the table is a blobstr
eaming table, reduce the table count
- if ($data['Tables_in_' . $db] == $table_key)
- {
- if ($num_tables > 0)
- $num_tables--;
-
- break;
- }
- } // end if PMA configuration exists
-
+ // do not count hidden blobstreaming tables
+ while ((($num_tables > 0)) && $data = PMA_DBI_fetch_assoc($tables)) {
+ if (PMA_BS_IsHiddenTable($data['Tables_in_' . $db])) {
+ $num_tables--;
+ }
+ }
+
PMA_DBI_free_result($tables);
} else {
$num_tables = 0;
diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php
index 5bd2870..a435e3b 100644
--- a/libraries/display_tbl.lib.php
+++ b/libraries/display_tbl.lib.php
@@ -1285,47 +1285,8 @@ 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";
} else {
// for blobstreaming
-
- $bs_reference_exists = $allBSTablesExist = FALSE;
-
- // load PMA configuration
- $PMA_Config = $GLOBALS['PMA_Config'];
-
- // if PMA configuration exists
- if ($PMA_Config) {
- // load BS variables
- $pluginsExist = $PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST');
-
- // if BS plugins exist
- if ($pluginsExist) {
- // load BS databases
- $bs_tables = $PMA_Config->get('BLOBSTREAMABLE_DATABASES');
-
- // if BS db array and specified db string not empty and valid
- if (!empty($bs_tables) && strlen($db) > 0) {
- $bs_tables = $bs_tables[$db];
-
- if (isset($bs_tables)) {
- $allBSTablesExist = TRUE;
-
- // check if BS tables exist for given database
- foreach ($bs_tables as $table_key=>$bs_tbl)
- if (!$bs_tables[$table_key]['Exists']) {
- $allBSTablesExist = FALSE;
- break;
- }
- }
- }
- }
- }
-
- // if necessary BS tables exist
- if ($allBSTablesExist) {
- $bs_reference_exists = PMA_BS_ReferenceExists($row[$i], $db);
- }
-
// if valid BS reference exists
- if ($bs_reference_exists) {
+ if (PMA_BS_IsPBMSReference($row[$i], $db)) {
$blobtext = PMA_BS_CreateReferenceLink($row[$i], $db);
} else {
$blobtext = PMA_handle_non_printable_contents('BLOB', (isset($row[$i]) ? $row[$i] : ''), $transform_function, $transform_options, $default_function, $meta, $_url_params);
@@ -1378,9 +1339,8 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
// user asked to see the real contents of BINARY
// fields
if ($_SESSION['tmp_user_values']['display_binary_as_hex'] && PMA_contains_nonprintable_ascii($row[$i])) {
- $row[$i] = bin2hex($row[$i]);
- }
- else {
+ $row[$i] = bin2hex($row[$i]);
+ } else {
$row[$i] = htmlspecialchars(PMA_replace_binary_contents($row[$i]));
}
} else {
@@ -1734,7 +1694,7 @@ function PMA_displayTable_checkConfigParams()
} else {
// display_binary_as_hex config option
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;
}
}
diff --git a/libraries/engines/pbms.lib.php b/libraries/engines/pbms.lib.php
new file mode 100644
index 0000000..2a51c92
--- /dev/null
+++ b/libraries/engines/pbms.lib.php
@@ -0,0 +1,113 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * @version $Id$
+ * @package phpMyAdmin-Engines
+ */
+
+/**
+ * the PBMS daemon
+ * @package phpMyAdmin-Engines
+ */
+class PMA_StorageEngine_pbms extends PMA_StorageEngine
+{
+ /**
+ * returns array with variable names dedicated to PBMS daemon
+ *
+ * @return array variable names
+ */
+ function engine_init()
+ {
+ $this->engine = "PBMS";
+ $this->title = "PrimeBase Media Streaming Daemon";
+ $this->comment = "Provides BLOB streaming service for storage engines,";
+ $this->support = PMA_ENGINE_SUPPORT_YES;
+ }
+
+ function getVariables()
+ {
+ return array(
+ 'pbms_garbage_threshold' => array(
+ 'title' => __('Garbage Threshold'),
+ 'desc' => __('The percentage of garbage in a repository file before it is compacted.'),
+ 'type' => PMA_ENGINE_DETAILS_TYPE_PLAINTEXT
+ ),
+ 'pbms_port' => array(
+ 'title' => __('Port'),
+ 'desc' => __('The port for the PBMS stream-based communications. Setting this value to 0 will disable HTTP communication with the daemon.'),
+ 'type' => PMA_ENGINE_DETAILS_TYPE_PLAINTEXT
+ ),
+ 'pbms_repository_threshold' => array(
+ 'title' => __('Repository Threshold'),
+ 'desc' => __('The maximum size of a BLOB repository file. You may use Kb, MB or GB to indicate the unit of the value. A value in bytes is assumed when no unit is specified.'),
+ 'type' => PMA_ENGINE_DETAILS_TYPE_PLAINTEXT
+ ),
+ 'pbms_temp_blob_timeout' => array(
+ 'title' => __('Temp Blob Timeout'),
+ 'desc' => __('The timeout, in seconds, for temporary BLOBs. Uploaded BLOB data is removed after this time, unless they are referenced by a record in the database.'),
+ 'type' => PMA_ENGINE_DETAILS_TYPE_PLAINTEXT
+ ),
+ 'pbms_temp_log_threshold' => array(
+ 'title' => __('Temp Log Threshold'),
+ 'desc' => __('The maximum size of a temporary BLOB log file. You may use Kb, MB or GB to indicate the unit of the value. A value in bytes is assumed when no unit is specified.'),
+ 'type' => PMA_ENGINE_DETAILS_TYPE_PLAINTEXT
+ ),
+ 'pbms_max_keep_alive' => array(
+ 'title' => __('Max Keep Alive'),
+ 'desc' => __('The timeout for inactive connection with the keep-alive flag set. After this time the connection will be closed. The time-out is in milliseconds (1/1000).'),
+ 'type' => PMA_ENGINE_DETAILS_TYPE_PLAINTEXT
+ ),
+ 'pbms_http_metadata_headers' => array(
+ 'title' => __('Metadata Headers'),
+ 'desc' => __('A ":" delimited list of metadata headers to be used to initialize the pbms_metadata_header table when a database is created.'),
+ 'type' => PMA_ENGINE_DETAILS_TYPE_PLAINTEXT
+ ),
+ );
+ }
+
+ //--------------------
+ function getInfoPages()
+ {
+ $pages = array();
+ $pages['Documentation'] = __('Documentation');
+ return $pages;
+ }
+
+ //--------------------
+ function getPage($id)
+ {
+ if (! array_key_exists($id, $this->getInfoPages())) {
+ return false;
+ }
+
+ $id = 'getPage' . $id;
+
+ return $this->$id();
+ }
+
+ function getPageConfigure()
+ {
+ }
+
+ function getPageDocumentation()
+ {
+ $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"
+ . '<table id="PBMS_Related_Links" >' . "\n"
+ . '<tr>' . "\n"
+ . '<td>' . "\n"
+ . '<p>' . "\n"
+ . '<strong><font size="2"><b>Related Links</b></font></strong>' . "\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://www.primebase.com/xt" target="_blank">PrimeBase XT Home Page</a><br><br>' . "\n"
+ . '</font>' . "\n"
+ . '</td>' . "\n"
+ . '</tr>' . "\n"
+ . '</table>' . "\n";
+
+ return $output;
+ }
+}
+
+?>
diff --git a/libraries/engines/pbxt.lib.php b/libraries/engines/pbxt.lib.php
index 842f8ff..fbc6ce6 100644
--- a/libraries/engines/pbxt.lib.php
+++ b/libraries/engines/pbxt.lib.php
@@ -98,6 +98,46 @@ class PMA_StorageEngine_pbxt extends PMA_StorageEngine
}
return PMA_formatByteDown($value);
}
+
+ //--------------------
+ function getInfoPages()
+ {
+ $pages = array();
+ $pages['Documentation'] = __('Documentation');
+ return $pages;
+ }
+
+ //--------------------
+ function getPage($id)
+ {
+ if (! array_key_exists($id, $this->getInfoPages())) {
+ return false;
+ }
+
+ $id = 'getPage' . $id;
+
+ return $this->$id();
+ }
+
+ function getPageDocumentation()
+ {
+ $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"
+ . '<table id="PBMS_Related_Links" >' . "\n"
+ . '<tr>' . "\n"
+ . '<td>' . "\n"
+ . '<p>' . "\n"
+ . '<strong><font size="2"><b>Related Links</b></font></strong>' . "\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://www.blobstreaming.org/" target="_blank">The PrimeBase Media Streaming (PBMS) home page</a>.<br><br>' . "\n"
+ . '</font>' . "\n"
+ . '</td>' . "\n"
+ . '</tr>' . "\n"
+ . '</table>' . "\n";
+
+ return $output;
+ }
}
?>
diff --git a/server_engines.php b/server_engines.php
index f9664ca..5ef4e6f 100644
--- a/server_engines.php
+++ b/server_engines.php
@@ -1,9 +1,8 @@
<?php
/* 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
*/
@@ -80,7 +79,22 @@ if (empty($_REQUEST['engine'])
. '</tr>' . "\n";
$odd_row = !$odd_row;
}
- unset($odd_row, $engine, $details);
+
+ $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')
+ . '">' . "\n"
+ . ' <td><a href="./server_engines.php'
+ . PMA_generate_common_url(array('engine' => "PBMS")) . '">' . "\n"
+ . ' ' . "PBMS\n"
+ . ' </a></td>' . "\n"
+ . ' <td>' . htmlspecialchars("PrimeBase MediaStream (PBMS) daemon") . '</td>' . "\n"
+ . '</tr>' . "\n";
+ }
+
+ unset($odd_row, $engine, $details);
echo '</tbody>' . "\n"
. '</table>' . "\n";
diff --git a/tbl_change.php b/tbl_change.php
index f873490..d8486ba 100644
--- a/tbl_change.php
+++ b/tbl_change.php
@@ -456,17 +456,17 @@ foreach ($rows as $row_id => $vrow) {
} else {
// special binary "characters"
if ($field['is_binary'] || ($field['is_blob'] && ! $cfg['ProtectBinary'])) {
- if ($_SESSION['tmp_user_values']['display_binary_as_hex'] && $cfg['ShowFunctionFields']) {
- $vrow[$field['Field']] = bin2hex($vrow[$field['Field']]);
- $field['display_binary_as_hex'] = true;
- } else {
- $vrow[$field['Field']] = PMA_replace_binary_contents($vrow[$field['Field']]);
- }
+ if ($_SESSION['tmp_user_values']['display_binary_as_hex'] && $cfg['ShowFunctionFields']) {
+ $vrow[$field['Field']] = bin2hex($vrow[$field['Field']]);
+ $field['display_binary_as_hex'] = true;
+ } else {
+ $vrow[$field['Field']] = PMA_replace_binary_contents($vrow[$field['Field']]);
+ }
} // end if
$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
- $special_chars_encoded = PMA_duplicateFirstNewline($special_chars);
+ //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);
$data = $vrow[$field['Field']];
} // end if... else...
@@ -562,9 +562,9 @@ foreach ($rows as $row_id => $vrow) {
}
// this is set only when appropriate and is always true
- if (isset($field['display_binary_as_hex'])) {
- $default_function = 'UNHEX';
- }
+ if (isset($field['display_binary_as_hex'])) {
+ $default_function = 'UNHEX';
+ }
// loop on the dropdown array and print all available options for that field.
foreach ($dropdown as $each_dropdown){
@@ -834,51 +834,7 @@ foreach ($rows as $row_id => $vrow) {
|| ($cfg['ProtectBinary'] == 'all' && $field['is_binary'])) {
echo "\n";
// for blobstreaming
- $bs_reference_exists = FALSE;
-
- if (isset ($tbl_type) && strlen ($tbl_type) > 0)
- {
- // load PMA_Config
- $PMA_Config = $GLOBALS['PMA_Config'];
-
- if (!empty($PMA_Config))
- {
- $requiredTblType = $PMA_Config->get('PBXT_NAME');
-
- if ($requiredTblType == strtolower ($tbl_type))
- {
- $pluginsExist = $PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST');
-
- // check if blobstreaming plugins exist
- if ($pluginsExist)
- {
- $bs_tables = $PMA_Config->get('BLOBSTREAMABLE_DATABASES');
-
- if (!empty($bs_tables) && strlen($db) > 0)
- {
- $bs_tables = $bs_tables[$db];
-
- if (isset($bs_tables))
- {
- $allBSTablesExist = TRUE;
-
- foreach ($bs_tables as $table_key=>$bs_tbl)
- if (!$bs_tables[$table_key]['Exists'])
- {
- $allBSTablesExist = FALSE;
- break;
- }
-
- if ($allBSTablesExist)
- $bs_reference_exists = PMA_BS_ReferenceExists($data, $db);
- } // end if (isset($bs_tables))
- } // end if (!empty($bs_tables) && strlen($db) > 0)
- } // end if ($pluginsExist)
- } // end if ($requiredTblType == strtolower ($tbl_type))
- } // end if (!empty($PMA_Config))
- } // end if (isset ($tbl_type) && strlen ($tbl_type) > 0)
-
- if ($bs_reference_exists)
+ 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="checkbox" name="remove_blob_repo_' . $field['Field_md5'] . $vkey . '" /> ' . __('Remove BLOB Repository Reference') . "<br />";
@@ -894,7 +850,7 @@ foreach ($rows as $row_id => $vrow) {
unset($data_size);
}
echo "\n";
- } // end if ($bs_reference_exists)
+ } // end if (PMA_BS_IsTablePBMSEnabled($db, $table, $tbl_type) && PMA_BS_IsPBMSReference($data, $db))
?>
<input type="hidden" name="fields_type<?php echo $field_name_appendix; ?>" value="protected" />
<input type="hidden" name="fields<?php echo $field_name_appendix; ?>" value="" />
@@ -932,63 +888,10 @@ foreach ($rows as $row_id => $vrow) {
// (displayed whatever value the ProtectBinary has)
if ($is_upload && $field['is_blob']) {
- // check if field type is of longblob
- if ($field['pma_type'] == "longblob")
- {
- if (isset ($tbl_type) && strlen ($tbl_type) > 0)
- {
- // load PMA Config
- $PMA_Config = $GLOBALS['PMA_Config'];
-
- // is PMA_Config's data loaded? continue only if it is
- if (!empty($PMA_Config))
- {
- $requiredTblType = $PMA_Config->get('PBXT_NAME');
-
- if ($requiredTblType == strtolower ($tbl_type))
- {
- $pluginsExist = $PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST');
-
- // check if blobstreaming plugins exist
- if ($pluginsExist)
- {
- $curlExists = $PMA_Config->get('CURL_EXISTS');
-
- // check if CURL exists
- if ($curlExists)
- {
- $bs_tables = $PMA_Config->get('BLOBSTREAMABLE_DATABASES');
-
- // check for BLOBStreamable databases and if current database name is provided
- if (!empty($bs_tables) && strlen($db) > 0)
- {
- $bs_tables = $bs_tables[$db];
-
- // check if reference to BLOBStreaming tables exists
- if (isset($bs_tables))
- {
- $allBSTablesExist = TRUE;
-
- foreach ($bs_tables as $table_key=>$bs_tbl)
- if (!$bs_tables[$table_key]['Exists'])
- {
- $allBSTablesExist = FALSE;
- break;
- }
-
- // check if necessary BLOBStreaming tables exist
- if ($allBSTablesExist)
- {
- echo '<br />';
- echo '<input type="checkbox" name="upload_blob_repo_' . $field['Field_md5'] . $vkey . '" /> ' . __('Upload to BLOB repository');
- } // end if ($allBSTablesExist)
- } // end if (isset($bs_tables)
- } // end if (!empty($bs_tables) && strlen ($db) > 0)
- } // end if ($curlExists)
- } // end if ($pluginsExist)
- } // end if ($requiredTblType == strtolower ($tbl_type))
- } // end if (!empty($PMA_Config))
- } // end if (isset ($tbl_type) && strlen ($tbl_type) > 0)
+ // 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)) {
+ echo '<br />';
+ echo '<input type="checkbox" name="upload_blob_repo_' . $field['Field_md5'] . $vkey . '" /> ' . __('Upload to BLOB repository');
}
echo '<br />';
diff --git a/tbl_replace.php b/tbl_replace.php
index d3271ac..48b98c1 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)) {
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_3_5RC1-5883-g0498861
by Marc Delisle 22 Jul '10
by Marc Delisle 22 Jul '10
22 Jul '10
The branch, master has been updated
via 049886139c62c3ed8b6573a0637ec5516857661f (commit)
via 8e98c5dd038eef2b6a56ab13b0cd7d30d9c76498 (commit)
from 6d459c02225a3b23914130c2752e870f31f53dc7 (commit)
- Log -----------------------------------------------------------------
commit 049886139c62c3ed8b6573a0637ec5516857661f
Merge: 8e98c5dd038eef2b6a56ab13b0cd7d30d9c76498 6d459c02225a3b23914130c2752e870f31f53dc7
Author: Marc Delisle <marc(a)infomarc.info>
Date: Thu Jul 22 08:48:21 2010 -0400
Merge branch 'master' of ssh://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
commit 8e98c5dd038eef2b6a56ab13b0cd7d30d9c76498
Author: Marc Delisle <marc(a)infomarc.info>
Date: Thu Jul 22 08:47:47 2010 -0400
bug #3030862 (master only) inline sql edit got undefined
-----------------------------------------------------------------------
Summary of changes:
libraries/common.lib.php | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/libraries/common.lib.php b/libraries/common.lib.php
index 7e79faf..9e22f45 100644
--- a/libraries/common.lib.php
+++ b/libraries/common.lib.php
@@ -1277,6 +1277,17 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view
if (! empty($refresh_link)) {
PMA_profilingCheckbox($sql_query);
}
+ // if needed, generate an invisible form that contains controls for the
+ // Inline link; this way, the behavior of the Inline link does not
+ // depend on the profiling support or on the refresh link
+ if (empty($refresh_link) || ! PMA_profilingSupported()) {
+ echo '<form action="sql.php" method="post">';
+ echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']);
+ echo '<input type="hidden" name="sql_query" value="' . htmlspecialchars($sql_query) . '" />';
+ echo '</form>';
+ }
+
+ // see in js/functions.js the jQuery code attached to id inline_edit
$inline_edit = "<script type=\"text/javascript\">\n" .
"//<
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_3_5RC1-5881-g6d459c0
by Michal Čihař 22 Jul '10
by Michal Čihař 22 Jul '10
22 Jul '10
The branch, master has been updated
via 6d459c02225a3b23914130c2752e870f31f53dc7 (commit)
from 5eeea5daede7c907dac48f59bd09819c64f88a4b (commit)
- Log -----------------------------------------------------------------
commit 6d459c02225a3b23914130c2752e870f31f53dc7
Author: gheni <gheni(a)yahoo.cn>
Date: Thu Jul 22 12:44:03 2010 +0200
Translation update done using Pootle.
-----------------------------------------------------------------------
Summary of changes:
po/ug.po | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/po/ug.po b/po/ug.po
index 71a84e2..1e12f2b 100644
--- a/po/ug.po
+++ b/po/ug.po
@@ -7,8 +7,8 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 3.4.0-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel(a)lists.sourceforge.net\n"
"POT-Creation-Date: 2010-07-21 13:53+0200\n"
-"PO-Revision-Date: 2010-07-21 06:37+0200\n"
-"Last-Translator: <ablat7ihlim(a)yahoo.com.cn>\n"
+"PO-Revision-Date: 2010-07-22 12:44+0200\n"
+"Last-Translator: <gheni(a)yahoo.cn>\n"
"Language-Team: Uyghur <ug(a)li.org>\n"
"Language: ug\n"
"MIME-Version: 1.0\n"
@@ -1415,7 +1415,7 @@ msgstr ""
#: libraries/Theme.class.php:380
msgid "No preview available."
-msgstr ""
+msgstr "ئالدىن كۆرگىنى بولمايدۇ."
#: libraries/Theme.class.php:383
msgid "take it"
hooks/post-receive
--
phpMyAdmin
1
0