Skip to content

Commit

Permalink
Merge branch 'master' of ssh://phpmyadmin.git.sourceforge.net/gitroot…
Browse files Browse the repository at this point in the history
…/phpmyadmin/phpmyadmin

Conflicts:
	libraries/relation.lib.php
  • Loading branch information
piotrp committed Jul 24, 2010
2 parents 2e55d85 + 084c0db commit 2d67cb5
Show file tree
Hide file tree
Showing 328 changed files with 105,399 additions and 110,650 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,15 @@ $Id$
(fixed for Privileges and Change password)
- [core] RecodingEngine now accepts none as valid option.
+ [core] Dropped AllowAnywhereRecoding configuration variable.
- rfe #3016457 [interface] Define tab order in SQL form to allow easier tab
navigation.
+ [code] Centralized format string expansion, @VARIABLES@ are recommended way
now.
+ [validator] SQL validator works also with SOAP PHP extension.
- [interface] Better formatting for SQL validator results.

3.3.6.0 (not yet released)
- bug #3031705 [core] Do not use CONCAT for DECIMAL fields.

3.3.5.0 (not yet released)
- patch #2932113 [information_schema] Slow export when having lots of
Expand Down
106 changes: 71 additions & 35 deletions Documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ <h2 id="require">Requirements</h2>
</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
Expand All @@ -84,6 +84,9 @@ <h2 id="require">Requirements</h2>
</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>
Expand Down Expand Up @@ -340,7 +343,8 @@ <h3 id="linked-tables">Linked-tables infrastructure</h3>
<abbr title="Frequently Asked Questions">FAQ</abbr> 1.23</a>).</p>

<p> If you already had this infrastructure and upgraded to MySQL 4.1.2
or newer, please use <i>./scripts/upgrade_tables_mysql_4_1_2+.sql</i>.</p>
or newer, please use <i>./scripts/upgrade_tables_mysql_4_1_2+.sql</i>
and then create new tables by importing <i>./scripts/create_tables.sql</i>.</p>

<p> You can use your phpMyAdmin to create the tables for you. Please be aware
that you may need special (administrator) privileges to create the database
Expand Down Expand Up @@ -2174,24 +2178,8 @@ <h2 id="config">Configuration</h2>
<dt id="cfg_TitleDatabase">$cfg['TitleDatabase'] string</dt>
<dt id="cfg_TitleServer">$cfg['TitleServer'] string</dt>
<dt id="cfg_TitleDefault">$cfg['TitleDefault'] string</dt>
<dd>Allows you to specify window's title bar. Following magic string can
be used to get special values:
<dl>
<dt><code>@HTTP_HOST@</code></dt>
<dd>HTTP host that runs phpMyAdmin</dd>
<dt><code>@SERVER@</code></dt>
<dd>MySQL server name</dd>
<dt><code>@VERBOSE@</code></dt>
<dd>Verbose MySQL server name as defined in <a href="#cfg_Servers_verbose">server configuration</a></dd>
<dt><code>@VSERVER@</code></dt>
<dd>Verbose MySQL server name if set, otherwise normal</dd>
<dt><code>@DATABASE@</code></dt>
<dd>Currently opened database</dd>
<dt><code>@TABLE@</code></dt>
<dd>Currently opened table</dd>
<dt><code>@PHPMYADMIN@</code></dt>
<dd>phpMyAdmin with version</dd>
</dl>
<dd>Allows you to specify window's title bar. You can use
<a href="#faq6_27">format string expansion</a>.
</dd>

<dt id="cfg_ErrorIconic">$cfg['ErrorIconic'] boolean</dt>
Expand Down Expand Up @@ -4148,25 +4136,34 @@ <h4 id="faqsqlvalidator">
<a href="#faqsqlvalidator">6.14 How do I set up the
<abbr title="structured query language">SQL</abbr> Validator?</a></h4>

<p> To use it, you need a very recent version of PHP, 4.3.0 recommended, with
<p>
To use SQL Validator, you need PHP with
<abbr title="Extensible Markup Language">XML</abbr>,
<abbr title="Perl Compatible Regular Expressions">PCRE</abbr> and
<abbr title="PHP Extension and Application Repository">PEAR</abbr> support.
On your system command line, run <tt>"pear install Net_Socket Net_URL
HTTP_Request Mail_Mime Net_DIME SOAP"</tt> to get the necessary
<abbr title="PHP Extension and Application Repository">PEAR</abbr> modules
for usage.<br />
On a more recent pear version, I had problems with the state of Net_DIME
being beta, so this single command
<tt>"pear -d preferred_state=beta install -a SOAP"</tt> installed all the
needed modules.<br />
In addition you need a <abbr title="Simple Object Access
Protocol">SOAP</abbr> support, either as a PHP extension or as a PEAR SOAP
module.
</p>

<p>
To install <abbr title="PHP Extension and Application
Repository">PEAR</abbr> <abbr title="Simple Object Access
Protocol">SOAP</abbr> module, run <tt>"pear install Net_Socket Net_URL
HTTP_Request Mail_Mime Net_DIME SOAP"</tt> to get the necessary <abbr
title="PHP Extension and Application Repository">PEAR</abbr> modules for
usage.
</p>

<p>
If you use the Validator, you should be aware that any
<abbr title="structured query language">SQL</abbr> statement you
submit will be stored anonymously (database/table/column names,
strings, numbers replaced with generic values). The Mimer
<abbr title="structured query language">SQL</abbr>
Validator itself, is &copy; 2001 Upright Database Technology.
We utilize it as free SOAP service.</p>
We utilize it as free SOAP service.
</p>

<h4 id="faq6_15">
<a href="#faq6_15">6.15 I want to add a BLOB column and put an index on
Expand Down Expand Up @@ -4337,13 +4334,20 @@ <h4 id="faq6_24">
<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 &quot;localhost&quot;.</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 &quot;BLOB Repository&quot; section, click &quot;Enable&quot;. 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 &quot;localhost&quot;.</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 &quot;Upload to BLOB repository&quot; 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 &quot;View image&quot;. 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>
Expand All @@ -4354,6 +4358,33 @@ <h4 id="faq6_26">
<p> Click the first row of the range, hold the shift key and click the last row of the range. This works everywhere you see rows, for example in Browse mode or on the Structure page.</p>


<h4 id="faq6_27">
<a href="#faq6_27">6.27 What format strings can I use?</a></h4>

<p>
In all places where phpMyAdmin accepts format strings, you can use
<code>@VARIABLE@</code> expansion and
<a href="http://php.net/strftime">strftime</a> format strings. The
expanded variables depend on a context (eg. if you don't have chosen
table, you can not get table name), but following variables can be used:
</p>
<dl>
<dt><code>@HTTP_HOST@</code></dt>
<dd>HTTP host that runs phpMyAdmin</dd>
<dt><code>@SERVER@</code></dt>
<dd>MySQL server name</dd>
<dt><code>@VERBOSE@</code></dt>
<dd>Verbose MySQL server name as defined in <a href="#cfg_Servers_verbose">server configuration</a></dd>
<dt><code>@VSERVER@</code></dt>
<dd>Verbose MySQL server name if set, otherwise normal</dd>
<dt><code>@DATABASE@</code></dt>
<dd>Currently opened database</dd>
<dt><code>@TABLE@</code></dt>
<dd>Currently opened table</dd>
<dt><code>@PHPMYADMIN@</code></dt>
<dd>phpMyAdmin with version</dd>
</dl>

<h3 id="faqproject">phpMyAdmin project</h3>

<h4 id="faq7_1">
Expand Down Expand Up @@ -4849,6 +4880,11 @@ <h3>Credits, in chronological order</h3>
<li>Replication support</li>
</ul></li>

<li>Barrie Leslie
<ul>
<li>BLOBstreaming support with PBMS PHP extension</li>
</ul></li>

</ul>

<p>
Expand Down
1 change: 0 additions & 1 deletion browse_foreigners.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
/**
* display selection for relational field values
*
* @version $Id$
* @package phpMyAdmin
*/

Expand Down
76 changes: 12 additions & 64 deletions bs_change_mime_type.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* @version 1.0
* @package BLOBStreaming
*/

Expand Down Expand Up @@ -31,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)

?>
25 changes: 13 additions & 12 deletions bs_disp_as_mime_type.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* @version 1.0
* @package BLOBStreaming
*/

Expand All @@ -10,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'));

Expand All @@ -31,15 +23,23 @@
*/
$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'];

Expand All @@ -59,8 +59,9 @@
$content .= fread($fHnd, $f_size);
$pos = strlen($content);

if ($pos >= $f_size)
if ($pos >= $f_size) {
break;
}
}

echo $content;
Expand Down
Loading

0 comments on commit 2d67cb5

Please sign in to comment.