Merge remote branch 'origin/master' into export_branch
This commit is contained in:
18
ChangeLog
18
ChangeLog
@@ -91,15 +91,24 @@ $Id$
|
||||
+ [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.
|
||||
+ [core] Centralized format string expansion, @VARIABLES@ are recommended way
|
||||
now, used by file name templates, default queries, export and title
|
||||
generating.
|
||||
+ [validator] SQL validator works also with SOAP PHP extension.
|
||||
- [interface] Better formatting for SQL validator results.
|
||||
- [doc] The linked-tables infrastructure is now called phpMyAdmin
|
||||
configuration storage.
|
||||
- [interface] Move drop/empty links from being tabs to Operations tab.
|
||||
- [interface] Fixed rendering of error/notice/info titles background.
|
||||
|
||||
3.3.6.0 (not yet released)
|
||||
- bug #3031705 [core] Do not use CONCAT for DECIMAL fields.
|
||||
- bug #3033063 [core] Navi gets wrong db name
|
||||
- bug #3031705 [core] Fix generating condition for real numbers by comparing
|
||||
them to string.
|
||||
- bug #3034026 [confirmation] TRUNCATE queries get no confirmation request
|
||||
- bug #3036132 [core] Triggers not fetched if dbname has an hyphen
|
||||
|
||||
3.3.5.0 (not yet released)
|
||||
3.3.5.0 (2010-07-26)
|
||||
- patch #2932113 [information_schema] Slow export when having lots of
|
||||
databases, thanks to Stéphane Pontier - shadow_walker
|
||||
- bug #3022705 [import] Import button does not work in Catalan when there
|
||||
@@ -114,6 +123,7 @@ $Id$
|
||||
- bug [export] CSV for MS Excel (Windows) should have semi-colon as separator
|
||||
- [core] Update library PHPExcel to version 1.7.3c
|
||||
- bug #2994885, bug #3029168 [import] Convert Excel column name correctly
|
||||
- bug [scripts] MySQL 5.5.5 does not accept TIMESTAMP(14) in create_tables.sql
|
||||
|
||||
3.3.4.0 (2010-06-28)
|
||||
- bug #2996161 [import] properly escape import value
|
||||
|
@@ -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>
|
||||
@@ -167,7 +170,7 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78
|
||||
|
||||
<ol><li><a href="#quick_install">Quick Install</a></li>
|
||||
<li><a href="#setup_script">Setup script usage</a></li>
|
||||
<li><a href="#linked-tables">Linked-tables infrastructure</a></li>
|
||||
<li><a href="#linked-tables">phpMyAdmin configuration storage</a></li>
|
||||
<li><a href="#upgrading">Upgrading from an older version</a></li>
|
||||
<li><a href="#authentication_modes">Using authentication modes</a></li>
|
||||
</ol>
|
||||
@@ -323,7 +326,7 @@ rm -rf config # remove not needed directory
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<h3 id="linked-tables">Linked-tables infrastructure</h3>
|
||||
<h3 id="linked-tables">phpMyAdmin configuration storage</h3>
|
||||
|
||||
<p> For a whole set of new features (bookmarks, comments,
|
||||
<abbr title="structured query language">SQL</abbr>-history,
|
||||
@@ -370,7 +373,7 @@ rm -rf config # remove not needed directory
|
||||
is version-specific.</p>
|
||||
|
||||
<p> If you have upgraded your MySQL server from a version previous to 4.1.2 to
|
||||
version 4.1.2 or newer and if you use the pmadb/linked table infrastructure,
|
||||
version 4.1.2 or newer and if you use the phpMyAdmin configuration storage,
|
||||
you should run the SQL script found in
|
||||
<tt>scripts/upgrade_tables_mysql_4_1_2+.sql</tt>.</p>
|
||||
|
||||
@@ -440,8 +443,9 @@ GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv)
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE ON <pma_db>.* TO 'pma'@'localhost';
|
||||
</pre>
|
||||
|
||||
(this of course requires that your <a href="#linked-tables">linked-tables
|
||||
infrastructure</a> be set up).<br /></li>
|
||||
(this of course requires that your <a href="#linked-tables">phpMyAdmin
|
||||
configuration storage</a> be set up).
|
||||
<br /></li>
|
||||
|
||||
<li>Then each of the <i>true</i> users should be granted a set of privileges
|
||||
on a set of particular databases. Normally you shouldn't give global
|
||||
@@ -862,11 +866,11 @@ since this link provides funding for phpMyAdmin.
|
||||
<dt id="pmadb">
|
||||
<span id="cfg_Servers_pmadb">$cfg['Servers'][$i]['pmadb']</span> string
|
||||
</dt>
|
||||
<dd>The name of the database containing the linked-tables infrastructure.
|
||||
<dd>The name of the database containing the phpMyAdmin configuration storage.
|
||||
<br /><br />
|
||||
|
||||
See the <a href="#linked-tables">Linked-tables infrastructure</a>
|
||||
section in this document to see the benefits of this infrastructure,
|
||||
See the <a href="#linked-tables">phpMyAdmin configuration storage</a>
|
||||
section in this document to see the benefits of this feature,
|
||||
and for a quick way of creating this database and the needed tables.
|
||||
<br /><br />
|
||||
|
||||
@@ -875,7 +879,7 @@ since this link provides funding for phpMyAdmin.
|
||||
case, just put your current database name in
|
||||
<tt>$cfg['Servers'][$i]['pmadb']</tt>. For a multi-user installation,
|
||||
set this parameter to the name of your central database containing
|
||||
the linked-tables infrastructure.</dd>
|
||||
the phpMyAdmin configuration storage.</dd>
|
||||
|
||||
<dt id="bookmark">
|
||||
<span id="cfg_Servers_bookmarktable">$cfg['Servers'][$i]['bookmarktable']</span> string
|
||||
@@ -884,7 +888,7 @@ since this link provides funding for phpMyAdmin.
|
||||
useful for queries you often run.<br /><br />
|
||||
|
||||
To allow the usage of this functionality:
|
||||
<ul><li>set up <a href="#pmadb">pmadb</a> and the linked-tables infrastructure</li>
|
||||
<ul><li>set up <a href="#pmadb">pmadb</a> and the phpMyAdmin configuration storage</li>
|
||||
<li>enter the table name in
|
||||
<tt>$cfg['Servers'][$i]['bookmarktable']</tt></li>
|
||||
</ul>
|
||||
@@ -920,8 +924,8 @@ since this link provides funding for phpMyAdmin.
|
||||
|
||||
To allow the usage of this functionality:
|
||||
|
||||
<ul><li>set up <a href="#pmadb">pmadb</a> and the linked-tables
|
||||
infrastructure</li>
|
||||
<ul><li>set up <a href="#pmadb">pmadb</a> and the phpMyAdmin
|
||||
configuration storage</li>
|
||||
<li>put the relation table name in
|
||||
<tt>$cfg['Servers'][$i]['relation']</tt></li>
|
||||
<li>now as normal user open phpMyAdmin and for each one of your
|
||||
@@ -945,7 +949,7 @@ since this link provides funding for phpMyAdmin.
|
||||
cursor over the corresponding key.<br />
|
||||
This configuration variable will hold the name of this special
|
||||
table. To allow the usage of this functionality:
|
||||
<ul><li>set up <a href="#pmadb">pmadb</a> and the linked-tables infrastructure</li>
|
||||
<ul><li>set up <a href="#pmadb">pmadb</a> and the phpMyAdmin configuration storage</li>
|
||||
<li>put the table name in
|
||||
<tt>$cfg['Servers'][$i]['table_info']</tt> (e.g.
|
||||
'pma_table_info')</li>
|
||||
@@ -972,8 +976,7 @@ since this link provides funding for phpMyAdmin.
|
||||
|
||||
To allow the usage of this functionality:
|
||||
|
||||
<ul><li>set up <a href="#pmadb">pmadb</a> and the linked-tables
|
||||
infrastructure</li>
|
||||
<ul><li>set up <a href="#pmadb">pmadb</a> and the phpMyAdmin configuration storage</li>
|
||||
<li>put the correct table names in
|
||||
<tt>$cfg['Servers'][$i]['table_coords']</tt> and
|
||||
<tt>$cfg['Servers'][$i]['pdf_pages']</tt></li>
|
||||
@@ -1004,8 +1007,7 @@ since this link provides funding for phpMyAdmin.
|
||||
<br /><br />
|
||||
|
||||
To allow the usage of this functionality:
|
||||
<ul><li>set up <a href="#pmadb">pmadb</a> and the linked-tables
|
||||
infrastructure</li>
|
||||
<ul><li>set up <a href="#pmadb">pmadb</a> and the phpMyAdmin configuration storage</li>
|
||||
<li>put the table name in
|
||||
<tt>$cfg['Servers'][$i]['column_info']</tt> (e.g.
|
||||
'pma_column_info')</li>
|
||||
@@ -1045,8 +1047,7 @@ ALTER TABLE `pma_column_comments`
|
||||
|
||||
To allow the usage of this functionality:
|
||||
|
||||
<ul><li>set up <a href="#pmadb">pmadb</a> and the linked-tables
|
||||
infrastructure</li>
|
||||
<ul><li>set up <a href="#pmadb">pmadb</a> and the phpMyAdmin configuration storage</li>
|
||||
<li>put the table name in <tt>$cfg['Servers'][$i]['history']</tt>
|
||||
(e.g. 'pma_history')
|
||||
</li>
|
||||
@@ -1078,7 +1079,7 @@ ALTER TABLE `pma_column_comments`
|
||||
To allow the usage of this functionality:
|
||||
|
||||
<ul>
|
||||
<li>set up <a href="#pmadb">pmadb</a> and the linked-tables infrastructure</li>
|
||||
<li>set up <a href="#pmadb">pmadb</a> and the phpMyAdmin configuration storage</li>
|
||||
<li>put the table name in <tt>$cfg['Servers'][$i]['tracking']</tt> (e.g. 'pma_tracking')</li>
|
||||
</ul>
|
||||
</dd>
|
||||
@@ -1149,8 +1150,7 @@ CREATE DATABASE,ALTER DATABASE,DROP DATABASE</pre>
|
||||
|
||||
To allow the usage of this functionality:
|
||||
|
||||
<ul><li>set up <a href="#pmadb">pmadb</a> and the linked-tables
|
||||
infrastructure</li>
|
||||
<ul><li>set up <a href="#pmadb">pmadb</a> and the phpMyAdmin configuration storage</li>
|
||||
<li>put the table name in <tt>$cfg['Servers'][$i]['designer_coords']</tt> (e.g. 'pma_designer_coords')
|
||||
</li>
|
||||
</ul>
|
||||
@@ -2182,9 +2182,9 @@ setfacl -d -m "g:www-data:rwx" tmp
|
||||
<span id="cfg_DefaultQueryDatabase">$cfg['DefaultQueryDatabase']</span> string
|
||||
</dt>
|
||||
<dd>Default queries that will be displayed in query boxes when user didn't
|
||||
specify any. Use %d for database name, %t for table name and %f for a
|
||||
comma separated list of column names. Note that %t and %f are only
|
||||
applicable to <tt>$cfg['DefaultQueryTable']</tt>.</dd>
|
||||
specify any. You can use standard
|
||||
<a href="#faq6_27">format string expansion</a>.
|
||||
</dd>
|
||||
|
||||
<dt id="cfg_SQP_fmtType">$cfg['SQP']['fmtType'] string [<tt>html</tt>|<tt>none</tt>]</dt>
|
||||
<dd>
|
||||
@@ -4306,14 +4306,21 @@ 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>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.</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>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 LONGBLOB 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>
|
||||
|
||||
@@ -4346,6 +4353,8 @@ chmod o+rwx tmp
|
||||
<dd>Currently opened database</dd>
|
||||
<dt><code>@TABLE@</code></dt>
|
||||
<dd>Currently opened table</dd>
|
||||
<dt><code>@FIELDS@</code></dt>
|
||||
<dd>Fields of currently opened table</dd>
|
||||
<dt><code>@PHPMYADMIN@</code></dt>
|
||||
<dd>phpMyAdmin with version</dd>
|
||||
</dl>
|
||||
@@ -4845,6 +4854,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
<li>Replication support</li>
|
||||
</ul></li>
|
||||
|
||||
<li>Barrie Leslie
|
||||
<ul>
|
||||
<li>BLOBstreaming support with PBMS PHP extension</li>
|
||||
</ul></li>
|
||||
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
|
@@ -22,7 +22,6 @@ require_once './libraries/header_http.inc.php';
|
||||
* Displays the frame
|
||||
*/
|
||||
$per_page = 200;
|
||||
require_once './libraries/relation.lib.php'; // foreign keys
|
||||
require_once './libraries/transformations.lib.php'; // Transformations
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
$foreigners = ($cfgRelation['relwork'] ? PMA_getForeigners($db, $table) : FALSE);
|
||||
|
@@ -32,68 +32,17 @@
|
||||
// necessary variables exist
|
||||
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)
|
||||
{
|
||||
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>
|
||||
<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))
|
||||
} // end if ($bsDB && $bsTable && $bsReference && $bsNewMIMEType)
|
||||
|
||||
?>
|
||||
|
@@ -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;
|
||||
|
@@ -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)
|
||||
|
||||
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))
|
||||
|
||||
?>
|
||||
|
@@ -9,9 +9,7 @@
|
||||
* Gets some core libraries
|
||||
*/
|
||||
require_once './libraries/common.inc.php';
|
||||
$GLOBALS['js_include'][] = 'functions.js';
|
||||
require_once './libraries/header.inc.php';
|
||||
require_once './libraries/relation.lib.php';
|
||||
|
||||
|
||||
/**
|
||||
@@ -23,5 +21,5 @@ $cfgRelation = PMA_getRelationsParam(TRUE);
|
||||
/**
|
||||
* Displays the footer
|
||||
*/
|
||||
require_once './libraries/footer.inc.php';
|
||||
require './libraries/footer.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';
|
||||
@@ -100,7 +94,7 @@ $cfg['SaveDir'] = '';
|
||||
|
||||
/**
|
||||
* Default language to use, if not browser-defined or user-defined
|
||||
* (you find all languages in the file libraries/select_lang.lib.php)
|
||||
* (you find all languages in the locale folder)
|
||||
* uncomment the desired line:
|
||||
* default = 'en'
|
||||
*/
|
||||
|
@@ -9,7 +9,6 @@
|
||||
* Gets some core libraries
|
||||
*/
|
||||
require_once './libraries/common.inc.php';
|
||||
$GLOBALS['js_include'][] = 'functions.js';
|
||||
require_once './libraries/mysql_charsets.lib.php';
|
||||
|
||||
PMA_checkParameters(array('new_db'));
|
||||
|
@@ -18,10 +18,10 @@ if (!isset($selected_tbl)) {
|
||||
/**
|
||||
* Gets the relations settings
|
||||
*/
|
||||
require_once './libraries/relation.lib.php';
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
require_once './libraries/transformations.lib.php';
|
||||
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
/**
|
||||
* Check parameters
|
||||
@@ -320,5 +320,5 @@ function printPage()
|
||||
<?php
|
||||
echo '<br /><br /><input type="button" id="print" value="' . __('Print') . '" onclick="printPage()" />';
|
||||
|
||||
require_once './libraries/footer.inc.php';
|
||||
require './libraries/footer.inc.php';
|
||||
?>
|
||||
|
@@ -72,5 +72,5 @@ require_once './libraries/display_export.lib.php';
|
||||
/**
|
||||
* Displays the footer
|
||||
*/
|
||||
require_once './libraries/footer.inc.php';
|
||||
require './libraries/footer.inc.php';
|
||||
?>
|
||||
|
@@ -16,12 +16,8 @@
|
||||
* requirements
|
||||
*/
|
||||
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,71 +256,11 @@ 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
|
||||
*/
|
||||
|
||||
require_once './libraries/relation.lib.php';
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
/**
|
||||
@@ -428,7 +364,41 @@ if (!$is_information_schema) {
|
||||
<input type="submit" value="<?php echo __('Go'); ?>" onclick="return confirmLink(this, 'CREATE DATABASE ... <?php echo __('and then'); ?> DROP DATABASE <?php echo PMA_jsFormat($db); ?>')" />
|
||||
</fieldset>
|
||||
</form>
|
||||
<?php
|
||||
// Drop link if allowed
|
||||
// Don't even try to drop information_schema. You won't be able to. Believe me. You won't.
|
||||
// Don't allow to easilly drop mysql database, RFE #1327514.
|
||||
if (($is_superuser || $GLOBALS['cfg']['AllowUserDropDatabase']) && ! $db_is_information_schema && ($db != 'mysql')) {
|
||||
?>
|
||||
<fieldset class="caution">
|
||||
<legend><?php
|
||||
if ($cfg['PropertiesIconic']) {
|
||||
echo '<img class="icon" src="' . $pmaThemeImage . 'b_deltbl.png"'
|
||||
.' alt="" width="16" height="16" />';
|
||||
}
|
||||
echo __('Remove database');
|
||||
?></legend>
|
||||
|
||||
<ul>
|
||||
<?php
|
||||
$this_sql_query = 'DROP DATABASE ' . PMA_backquote($GLOBALS['db']);
|
||||
$this_url_params = array(
|
||||
'sql_query' => $this_sql_query,
|
||||
'back' => 'db_operations.php',
|
||||
'goto' => 'main.php',
|
||||
'reload' => '1',
|
||||
'purge' => '1',
|
||||
'zero_rows' => sprintf(__('Database %s has been dropped.'), htmlspecialchars(PMA_backquote($db))),
|
||||
'db' => NULL,
|
||||
);
|
||||
?>
|
||||
<li><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>" onclick="return confirmLinkDropDB(this, '<?php echo PMA_jsFormat($this_sql_query); ?>')">
|
||||
<?php echo __('Drop the database (DROP)'); ?></a>
|
||||
<?php echo PMA_showMySQLDocu('SQL-Syntax', 'DROP_DATABASE'); ?>
|
||||
</li>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<?php } ?>
|
||||
<?php
|
||||
/**
|
||||
* Copy database
|
||||
@@ -500,92 +470,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
|
||||
@@ -611,7 +495,7 @@ if (!$is_information_schema) {
|
||||
|
||||
if ($num_tables > 0
|
||||
&& !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false) {
|
||||
$message = PMA_Message::notice(__('The additional features for working with linked tables have been deactivated. To find out why click %shere%s.'));
|
||||
$message = PMA_Message::notice(__('The phpMyAdmin configuration storage has been deactivated. To find out why click %shere%s.'));
|
||||
$message->addParam('<a href="' . $cfg['PmaAbsoluteUri'] . 'chk_rel.php?' . $url_query . '">', false);
|
||||
$message->addParam('</a>', false);
|
||||
/* Show error if user has configured something, notice elsewhere */
|
||||
@@ -657,5 +541,5 @@ if ($cfgRelation['pdfwork'] && $num_tables > 0) { ?>
|
||||
/**
|
||||
* Displays the footer
|
||||
*/
|
||||
require_once './libraries/footer.inc.php';
|
||||
require './libraries/footer.inc.php';
|
||||
?>
|
||||
|
@@ -26,7 +26,6 @@ $err_url = 'db_sql.php?' . PMA_generate_common_url($db);
|
||||
/**
|
||||
* Settings for relations stuff
|
||||
*/
|
||||
require_once './libraries/relation.lib.php';
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
/**
|
||||
@@ -265,5 +264,5 @@ function printPage()
|
||||
id="print" value="<?php echo __('Print'); ?>" onclick="printPage()" />
|
||||
|
||||
<?php
|
||||
require_once './libraries/footer.inc.php';
|
||||
require './libraries/footer.inc.php';
|
||||
?>
|
||||
|
@@ -10,9 +10,6 @@
|
||||
* requirements
|
||||
*/
|
||||
require_once './libraries/common.inc.php';
|
||||
require_once './libraries/Table.class.php';
|
||||
require_once './libraries/relation.lib.php';
|
||||
|
||||
|
||||
/**
|
||||
* Gets the relation settings
|
||||
@@ -99,7 +96,7 @@ $tbl_result = PMA_DBI_query('SHOW TABLES FROM ' . PMA_backquote($db) . ';',
|
||||
$tbl_result_cnt = PMA_DBI_num_rows($tbl_result);
|
||||
if (0 == $tbl_result_cnt) {
|
||||
PMA_Message::error(__('No tables found in database.'))->display();
|
||||
require_once './libraries/footer.inc.php';
|
||||
require './libraries/footer.inc.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -940,5 +937,5 @@ if (!empty($qry_orderby)) {
|
||||
/**
|
||||
* Displays the footer
|
||||
*/
|
||||
require_once './libraries/footer.inc.php';
|
||||
require './libraries/footer.inc.php';
|
||||
?>
|
||||
|
@@ -350,5 +350,5 @@ $alter_select =
|
||||
/**
|
||||
* Displays the footer
|
||||
*/
|
||||
require_once './libraries/footer.inc.php';
|
||||
require './libraries/footer.inc.php';
|
||||
?>
|
||||
|
@@ -41,5 +41,5 @@ PMA_sqlQueryForm(true, false, isset($_REQUEST['delimiter']) ? $_REQUEST['delimit
|
||||
/**
|
||||
* Displays the footer
|
||||
*/
|
||||
require_once './libraries/footer.inc.php';
|
||||
require './libraries/footer.inc.php';
|
||||
?>
|
||||
|
@@ -9,7 +9,6 @@
|
||||
*
|
||||
*/
|
||||
require_once './libraries/common.inc.php';
|
||||
require_once './libraries/Table.class.php';
|
||||
|
||||
$GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.custom.js';
|
||||
|
||||
@@ -56,7 +55,7 @@ if ($num_tables == 0) {
|
||||
/**
|
||||
* Displays the footer
|
||||
*/
|
||||
require_once './libraries/footer.inc.php';
|
||||
require './libraries/footer.inc.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -150,25 +149,12 @@ $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)
|
||||
{
|
||||
if (PMA_BS_IsHiddenTable($keyname)) {
|
||||
$tableReductionCount++;
|
||||
continue 2;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// Get valid statistics whatever is the table type
|
||||
@@ -612,5 +598,5 @@ if (empty($db_is_information_schema)) {
|
||||
/**
|
||||
* Displays the footer
|
||||
*/
|
||||
require_once './libraries/footer.inc.php';
|
||||
require './libraries/footer.inc.php';
|
||||
?>
|
||||
|
@@ -8,7 +8,6 @@
|
||||
* Run common work
|
||||
*/
|
||||
require_once './libraries/common.inc.php';
|
||||
require_once './libraries/Table.class.php';
|
||||
|
||||
require './libraries/db_common.inc.php';
|
||||
$url_query .= '&goto=tbl_tracking.php&back=db_tracking.php';
|
||||
@@ -17,9 +16,6 @@ $url_query .= '&goto=tbl_tracking.php&back=db_tracking.php';
|
||||
$sub_part = '_structure';
|
||||
require './libraries/db_info.inc.php';
|
||||
|
||||
// Get relation settings
|
||||
require_once './libraries/relation.lib.php';
|
||||
|
||||
// Work to do?
|
||||
// (here, do not use $_REQUEST['db] as it can be crafted)
|
||||
if (isset($_REQUEST['delete_tracking']) && isset($_REQUEST['table'])) {
|
||||
@@ -38,7 +34,7 @@ if ($num_tables == 0 && count($data['ddlog']) == 0) {
|
||||
}
|
||||
|
||||
// Display the footer
|
||||
require_once './libraries/footer.inc.php';
|
||||
require './libraries/footer.inc.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -202,5 +198,5 @@ if (count($data['ddlog']) > 0) {
|
||||
/**
|
||||
* Display the footer
|
||||
*/
|
||||
require_once './libraries/footer.inc.php';
|
||||
require './libraries/footer.inc.php';
|
||||
?>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
/**
|
||||
* Input sanitizing.
|
||||
*/
|
||||
require_once './libraries/sanitizing.lib.php';
|
||||
require './libraries/sanitizing.lib.php';
|
||||
|
||||
/* Get variables */
|
||||
if (! empty($_REQUEST['lang']) && is_string($_REQUEST['lang'])) {
|
||||
|
@@ -59,7 +59,6 @@ if (empty($_REQUEST['asfile'])) {
|
||||
// Does export require to be into file?
|
||||
if (isset($export_list[$type]['force_file']) && ! $asfile) {
|
||||
$message = PMA_Message::error(__('Selected export type has to be saved in file!'));
|
||||
$GLOBALS['js_include'][] = 'functions.js';
|
||||
require_once './libraries/header.inc.php';
|
||||
if ($export_type == 'server') {
|
||||
$active_page = 'server_export.php';
|
||||
@@ -298,7 +297,6 @@ if ($save_on_server) {
|
||||
}
|
||||
}
|
||||
if (isset($message)) {
|
||||
$GLOBALS['js_include'][] = 'functions.js';
|
||||
require_once './libraries/header.inc.php';
|
||||
if ($export_type == 'server') {
|
||||
$active_page = 'server_export.php';
|
||||
@@ -350,7 +348,6 @@ if (!$save_on_server) {
|
||||
$num_tables = count($tables);
|
||||
if ($num_tables == 0) {
|
||||
$message = PMA_Message::error(__('No tables found in database.'));
|
||||
$GLOBALS['js_include'][] = 'functions.js';
|
||||
require_once './libraries/header.inc.php';
|
||||
$active_page = 'db_export.php';
|
||||
require './db_export.php';
|
||||
@@ -386,7 +383,6 @@ $do_relation = isset($GLOBALS[$what . '_relation']);
|
||||
$do_comments = isset($GLOBALS[$what . '_comments']);
|
||||
$do_mime = isset($GLOBALS[$what . '_mime']);
|
||||
if ($do_relation || $do_comments || $do_mime) {
|
||||
require_once './libraries/relation.lib.php';
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
}
|
||||
if ($do_mime) {
|
||||
@@ -565,7 +561,6 @@ if (!PMA_exportFooter()) {
|
||||
// End of fake loop
|
||||
|
||||
if ($save_on_server && isset($message)) {
|
||||
$GLOBALS['js_include'][] = 'functions.js';
|
||||
require_once './libraries/header.inc.php';
|
||||
if ($export_type == 'server') {
|
||||
$active_page = 'server_export.php';
|
||||
@@ -622,7 +617,6 @@ if (!empty($asfile)) {
|
||||
$message = new PMA_Message(__('Dump has been saved to file %s.'), PMA_Message::SUCCESS, $save_filename);
|
||||
}
|
||||
|
||||
$GLOBALS['js_include'][] = 'functions.js';
|
||||
require_once './libraries/header.inc.php';
|
||||
if ($export_type == 'server') {
|
||||
$active_page = 'server_export.php';
|
||||
@@ -673,6 +667,6 @@ else {
|
||||
//]]>
|
||||
</script>
|
||||
<?php
|
||||
require_once './libraries/footer.inc.php';
|
||||
require './libraries/footer.inc.php';
|
||||
} // end if
|
||||
?>
|
||||
|
@@ -12,7 +12,6 @@
|
||||
*/
|
||||
require_once './libraries/common.inc.php';
|
||||
//require_once './libraries/display_import_functions.lib.php';
|
||||
$GLOBALS['js_include'][] = 'functions.js';
|
||||
|
||||
// reset import messages for ajax request
|
||||
$_SESSION['Import_message']['message'] = null;
|
||||
|
@@ -32,11 +32,6 @@
|
||||
*/
|
||||
require_once './libraries/common.inc.php';
|
||||
|
||||
/**
|
||||
* Includes the ThemeManager if it hasn't been included yet
|
||||
*/
|
||||
require_once './libraries/relation.lib.php';
|
||||
|
||||
// free the session file, for the other frames to be loaded
|
||||
session_write_close();
|
||||
|
||||
|
@@ -152,7 +152,7 @@ function confirmQuery(theForm1, sqlQuery1)
|
||||
} // end if
|
||||
} // end if
|
||||
|
||||
// Confirms a "DROP/DELETE/ALTER" statement
|
||||
// Confirms a "DROP/DELETE/ALTER/TRUNCATE" statement
|
||||
//
|
||||
// TODO: find a way (if possible) to use the parser-analyser
|
||||
// for this kind of verification
|
||||
@@ -162,22 +162,24 @@ function confirmQuery(theForm1, sqlQuery1)
|
||||
var do_confirm_re_0 = new RegExp('^\\s*DROP\\s+(IF EXISTS\\s+)?(TABLE|DATABASE|PROCEDURE)\\s', 'i');
|
||||
var do_confirm_re_1 = new RegExp('^\\s*ALTER\\s+TABLE\\s+((`[^`]+`)|([A-Za-z0-9_$]+))\\s+DROP\\s', 'i');
|
||||
var do_confirm_re_2 = new RegExp('^\\s*DELETE\\s+FROM\\s', 'i');
|
||||
var do_confirm_re_3 = new RegExp('^\\s*TRUNCATE\\s', 'i');
|
||||
|
||||
if (do_confirm_re_0.test(sqlQuery1.value)
|
||||
|| do_confirm_re_1.test(sqlQuery1.value)
|
||||
|| do_confirm_re_2.test(sqlQuery1.value)) {
|
||||
|| do_confirm_re_2.test(sqlQuery1.value)
|
||||
|| do_confirm_re_3.test(sqlQuery1.value)) {
|
||||
var message = (sqlQuery1.value.length > 100)
|
||||
? sqlQuery1.value.substr(0, 100) + '\n ...'
|
||||
: sqlQuery1.value;
|
||||
var is_confirmed = confirm(PMA_messages['strDoYouReally'] + ' :\n' + message);
|
||||
// drop/delete/alter statement is confirmed -> update the
|
||||
// statement is confirmed -> update the
|
||||
// "is_js_confirmed" form field so the confirm test won't be
|
||||
// run on the server side and allows to submit the form
|
||||
if (is_confirmed) {
|
||||
theForm1.elements['is_js_confirmed'].value = 1;
|
||||
return true;
|
||||
}
|
||||
// "DROP/DELETE/ALTER" statement is rejected -> do not submit
|
||||
// the form
|
||||
// statement is rejected -> do not submit the form
|
||||
else {
|
||||
window.focus();
|
||||
sqlQuery1.focus();
|
||||
|
@@ -9,7 +9,7 @@
|
||||
/**
|
||||
* Load vendor configuration.
|
||||
*/
|
||||
require_once('./libraries/vendor_config.php');
|
||||
require('./libraries/vendor_config.php');
|
||||
|
||||
/**
|
||||
* Configuration class
|
||||
|
@@ -279,117 +279,26 @@ 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');
|
||||
if ($is_bs_upload) {
|
||||
$bs_db = $_REQUEST['db'];
|
||||
$bs_table = $_REQUEST['table'];
|
||||
|
||||
// setup file handle and related variables
|
||||
$tmp_file = fopen($file['tmp_name'], 'r');
|
||||
$tmp_filename = $file['tmp_name'];
|
||||
$tmp_file_type = $file['type'];
|
||||
$tmp_file_size = $file['size'];
|
||||
|
||||
if (!$tmp_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.');
|
||||
if (! $bs_db || ! $bs_table) {
|
||||
$this->_error_message = $GLOBALS['strUploadErrorUnknown'];
|
||||
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)
|
||||
$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
|
||||
@@ -487,134 +396,42 @@ 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
$allBSTablesExist = FALSE;
|
||||
|
||||
// if necessary BS tables exist
|
||||
if ($allBSTablesExist)
|
||||
{
|
||||
// load BS variables
|
||||
$bs_server = $PMA_Config->get('BLOBSTREAMING_SERVER');
|
||||
if ($is_bs_upload) {
|
||||
$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'))
|
||||
{
|
||||
if ($PMA_Config->get('FILEINFO_EXISTS')) {
|
||||
// attempt to init fileinfo
|
||||
$finfo = finfo_open(FILEINFO_MIME);
|
||||
|
||||
// fileinfo exists
|
||||
if ($finfo)
|
||||
{
|
||||
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
|
||||
} else {
|
||||
// no fileinfo library exists, use file command
|
||||
$tmp_file_type = exec("file -bi " . escapeshellarg($tmp_filename));
|
||||
}
|
||||
|
||||
if (!$tmp_file_type)
|
||||
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.');
|
||||
if (! $bs_db || !$bs_table) {
|
||||
$this->_error_message = $GLOBALS['strUploadErrorUnknown'];
|
||||
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)
|
||||
$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]);
|
||||
@@ -633,47 +450,6 @@ 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'))
|
||||
{
|
||||
@@ -694,66 +470,16 @@ class PMA_File
|
||||
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)
|
||||
$bs_db = $_REQUEST['db'];
|
||||
$bs_table = $_REQUEST['table'];
|
||||
if (!$bs_db || !$bs_table)
|
||||
{
|
||||
$this->_error_message = __('Unknown error in file upload.');
|
||||
$this->_error_message = $GLOBALS['strUploadErrorUnknown'];
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
$bs_server_path = 'http://' . $bs_server . '/' . $bs_db . '/' . $bs_table;
|
||||
$blob_url = PMA_BS_UpLoadFile($bs_db, $bs_table, $tmp_file_type, $tmp_filename);
|
||||
PMA_File::setRecentBLOBReference($blob_url);
|
||||
|
||||
// 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]);
|
||||
|
@@ -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,6 +303,8 @@ class PMA_StorageEngine
|
||||
default:
|
||||
$this->support = PMA_ENGINE_SUPPORT_NO;
|
||||
}
|
||||
} else {
|
||||
$this->engine_init();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -781,7 +781,6 @@ class PMA_Table
|
||||
$GLOBALS['sql_query'] .= "\n\n" . $sql_insert_data . ';';
|
||||
}
|
||||
|
||||
require_once './libraries/relation.lib.php';
|
||||
$GLOBALS['cfgRelation'] = PMA_getRelationsParam();
|
||||
|
||||
// Drops old table if the user has requested to move it
|
||||
@@ -1057,7 +1056,6 @@ class PMA_Table
|
||||
* @todo move into extra function PMA_Relation::renameTable($new_name, $old_name, $new_db, $old_db)
|
||||
*/
|
||||
// Move old entries from comments to new table
|
||||
require_once './libraries/relation.lib.php';
|
||||
$GLOBALS['cfgRelation'] = PMA_getRelationsParam();
|
||||
if ($GLOBALS['cfgRelation']['commwork']) {
|
||||
$remove_query = '
|
||||
|
@@ -5,11 +5,6 @@
|
||||
* @package phpMyAdmin
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
require_once './libraries/Theme.class.php';
|
||||
|
||||
/**
|
||||
*
|
||||
* @package phpMyAdmin
|
||||
|
@@ -5,11 +5,6 @@
|
||||
* @package phpMyAdmin
|
||||
*/
|
||||
|
||||
/**
|
||||
* Gets relation settings
|
||||
*/
|
||||
require_once './libraries/relation.lib.php';
|
||||
|
||||
/**
|
||||
* This class tracks changes on databases, tables and views.
|
||||
* For more information please see phpMyAdmin/Documentation.html
|
||||
|
@@ -131,7 +131,7 @@ function PMA_auth_fails()
|
||||
echo '</tr>' . "\n";
|
||||
}
|
||||
echo '</table>' . "\n";
|
||||
require_once './libraries/footer.inc.php';
|
||||
require './libraries/footer.inc.php';
|
||||
return TRUE;
|
||||
} // end of the 'PMA_auth_fails()' function
|
||||
|
||||
|
@@ -172,13 +172,14 @@ function PMA_auth()
|
||||
?>
|
||||
<script src="./js/jquery/jquery-1.4.2.js" type="text/javascript"></script>
|
||||
<script src="./js/update-location.js" type="text/javascript"></script>
|
||||
<?php
|
||||
if ( false === $GLOBALS['cfg']['AllowThirdPartyFraming']) {
|
||||
?>
|
||||
<script src="./js/cross_framing_protection.js" type="text/javascript"></script>
|
||||
<?php
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
// show login form in top frame
|
||||
if (top != self) {
|
||||
window.top.location.href=location;
|
||||
}
|
||||
?>
|
||||
//]]>
|
||||
</script>
|
||||
<script src="./js/functions.js" type="text/javascript"></script>
|
||||
</head>
|
||||
|
||||
|
@@ -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,50 +91,27 @@ 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) {
|
||||
// check if required plugins exist
|
||||
foreach ($required_plugins as $one_required_plugin) {
|
||||
if ( strtolower($one_existing_plugin['Library']) == strtolower($one_required_plugin['Library'])
|
||||
if ( strtolower($one_existing_plugin['Library']) == 'libpbms.so'
|
||||
&& $one_existing_plugin['Status'] == "ACTIVE") {
|
||||
$number_of_required_plugins_found++;
|
||||
}
|
||||
}
|
||||
if (2 == $number_of_required_plugins_found) {
|
||||
$allPluginsExist = true;
|
||||
$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
|
||||
@@ -116,43 +121,66 @@ function checkBLOBStreamingPlugins()
|
||||
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')) {
|
||||
// Check that the required pbms functions exist:
|
||||
if ((function_exists("pbms_connect") == FALSE) ||
|
||||
(function_exists("pbms_error") == FALSE) ||
|
||||
(function_exists("pbms_close") == FALSE) ||
|
||||
(function_exists("pbms_is_blob_reference") == FALSE) ||
|
||||
(function_exists("pbms_get_info") == FALSE) ||
|
||||
(function_exists("pbms_get_metadata_value") == FALSE) ||
|
||||
(function_exists("pbms_add_metadata") == FALSE) ||
|
||||
(function_exists("pbms_read_stream") == FALSE)) {
|
||||
|
||||
// We should probably notify the user that they need to install
|
||||
// the pbms client lib and PHP extension to make use of blob streaming.
|
||||
$PMA_Config->set('BLOBSTREAMING_PLUGINS_EXIST', FALSE);
|
||||
PMA_cacheSet('skip_blobstreaming', true, true);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (function_exists("pbms_connection_pool_size")) {
|
||||
if ( isset($PMA_Config->settings['pbms_connection_pool_size'])) {
|
||||
$pool_size = $PMA_Config->settings['pbms_connection_pool_size'];
|
||||
if ($pool_size == "") {
|
||||
$pool_size = 1;
|
||||
}
|
||||
} else {
|
||||
$pool_size = 1;
|
||||
}
|
||||
pbms_connection_pool_size($pool_size);
|
||||
}
|
||||
|
||||
// get BS server port
|
||||
$BS_PORT = $bs_variables[$PMA_Config->get('PBMS_NAME') . '_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;
|
||||
} // 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']);
|
||||
$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,180 +193,15 @@ 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
|
||||
@@ -388,7 +251,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,284 +264,109 @@ 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();
|
||||
|
||||
// return success of query execution
|
||||
if ($result && 0 == $GLOBALS['errno'])
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
// 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'];
|
||||
}
|
||||
|
||||
/**
|
||||
* creates the BLOBStreaming tables for a given database
|
||||
*
|
||||
* @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)
|
||||
{
|
||||
// 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)
|
||||
if (empty($PMA_Config)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// return true on success
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
// 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);
|
||||
|
||||
// return false if query execution fails
|
||||
if (!$result)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// return true on success
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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'];
|
||||
|
||||
// return if unable to load PMA configuration
|
||||
if (empty($PMA_Config))
|
||||
return FALSE;
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
$referenceExists = 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;
|
||||
|
||||
// load PMA configuration
|
||||
$PMA_Config = $GLOBALS['PMA_Config'];
|
||||
|
||||
// return if unable to load PMA configuration
|
||||
if (empty($PMA_Config))
|
||||
return $referenceExists;
|
||||
|
||||
// select specified database
|
||||
PMA_DBI_select_db($db_name);
|
||||
|
||||
// run query on BS reference retrieval
|
||||
$query = "SELECT * FROM " . PMA_backquote($PMA_Config->get('PBMS_NAME') . "_reference") . " WHERE Blob_url='" . PMA_sqlAddslashes($bs_reference) . "'";
|
||||
$result = PMA_DBI_query($query);
|
||||
|
||||
// if record exists
|
||||
if ($data = @PMA_DBI_fetch_assoc($result))
|
||||
$referenceExists = TRUE;
|
||||
|
||||
// return reference existance
|
||||
return $referenceExists;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
// load PMA configuration
|
||||
$PMA_Config = $GLOBALS['PMA_Config'];
|
||||
|
||||
// return if unable to load PMA configuration
|
||||
if (empty($PMA_Config))
|
||||
return '';
|
||||
|
||||
// generate bs reference link
|
||||
$bs_ref_link = 'http://' . $PMA_Config->get('BLOBSTREAMING_SERVER') . '/' . $bs_reference;
|
||||
$pbms_host = $PMA_Config->get('BLOBSTREAMING_HOST');
|
||||
$pbms_port = $PMA_Config->get('BLOBSTREAMING_PORT');
|
||||
|
||||
// select specified database
|
||||
PMA_DBI_select_db($db_name);
|
||||
|
||||
$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");
|
||||
|
||||
// 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) . "'";
|
||||
|
||||
$result = PMA_DBI_query($query);
|
||||
|
||||
// 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;
|
||||
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);
|
||||
}
|
||||
else
|
||||
$content_type = $data['Content_type'];
|
||||
|
||||
if (!$content_type)
|
||||
$content_type = NULL;
|
||||
if ($ok == FALSE) {
|
||||
if ($quiet == FALSE) {
|
||||
PMA_BS_ReportPBMSError(__('PBMS connection failed:') . " pbms_connect($pbms_host, $pbms_port, $db_name)");
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//------------
|
||||
function PMA_do_disconnect()
|
||||
{
|
||||
pbms_close();
|
||||
}
|
||||
|
||||
//------------
|
||||
/**
|
||||
* checks whether the BLOB reference looks valid
|
||||
*
|
||||
*/
|
||||
function PMA_BS_IsPBMSReference($bs_reference, $db_name)
|
||||
{
|
||||
if (PMA_cacheGet('skip_blobstreaming', true)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// You do not really need a connection to the PBMS Daemon
|
||||
// to check if a reference looks valid but unfortunalty the API
|
||||
// requires one at this point so until the API is updated
|
||||
// we need to epen one here. If you use pool connections this
|
||||
// will not be a performance problem.
|
||||
if (PMA_do_connect($db_name, FALSE) == FALSE) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
$ok = pbms_is_blob_reference($bs_reference);
|
||||
return $ok ;
|
||||
}
|
||||
|
||||
//------------
|
||||
function PMA_BS_CreateReferenceLink($bs_reference, $db_name)
|
||||
{
|
||||
if (PMA_do_connect($db_name, FALSE) == FALSE) {
|
||||
return __('Error');
|
||||
}
|
||||
|
||||
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) {
|
||||
$br = trim($bs_reference);
|
||||
PMA_BS_ReportPBMSError("PMA_BS_CreateReferenceLink('$br', '$db_name'): " . __('get BLOB Content-Type failed'));
|
||||
}
|
||||
|
||||
PMA_do_disconnect();
|
||||
|
||||
if (! $content_type) {
|
||||
$content_type = "image/jpeg";
|
||||
}
|
||||
|
||||
$bs_url = PMA_BS_getURL($bs_reference);
|
||||
if (empty($bs_url)) {
|
||||
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>";
|
||||
|
||||
// specify custom HTML for various content types
|
||||
switch ($content_type)
|
||||
{
|
||||
switch ($content_type) {
|
||||
// no content specified
|
||||
case NULL:
|
||||
$output = "NULL";
|
||||
@@ -686,7 +374,7 @@ function PMA_BS_CreateReferenceLink($bs_reference, $db_name)
|
||||
// image content
|
||||
case 'image/jpeg':
|
||||
case 'image/png':
|
||||
$output .= ' (<a href="' . $bs_ref_link . '" target="new">' . __('View image') . '</a>)';
|
||||
$output .= ' (<a href="' . $bs_url . '" target="new">' . __('View image') . '</a>)';
|
||||
break;
|
||||
// audio content
|
||||
case 'audio/mpeg':
|
||||
@@ -699,15 +387,148 @@ function PMA_BS_CreateReferenceLink($bs_reference, $db_name)
|
||||
break;
|
||||
// unsupported content. specify download
|
||||
default:
|
||||
$output .= ' (<a href="' . $bs_ref_link . '" target="new">' . __('Download file'). '</a>)';
|
||||
$output .= ' (<a href="' . $bs_url . '" target="new">' . __('Download file'). '</a>)';
|
||||
}
|
||||
|
||||
// return HTML
|
||||
return $output;
|
||||
} // end if ($data = @PMA_DBI_fetch_assoc($result))
|
||||
}
|
||||
|
||||
// return on error
|
||||
return 'Error';
|
||||
//------------
|
||||
// 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)
|
||||
{
|
||||
if (PMA_cacheGet('skip_blobstreaming', true)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
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 FALSE;
|
||||
}
|
||||
|
||||
if (! $PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST')) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// This information should be cached rather than selecting it each time.
|
||||
//$query = "SELECT count(*) FROM information_schema.TABLES T, pbms.pbms_enabled E where T.table_schema = ". PMA_backquote($db_name) . " and T.table_name = ". PMA_backquote($tbl_name) . " and T.engine = E.name";
|
||||
$query = "SELECT count(*) FROM pbms.pbms_enabled E where E.name = '" . PMA_sqlAddslashes($tbl_type) . "'";
|
||||
$result = PMA_DBI_query($query);
|
||||
|
||||
$data = PMA_DBI_fetch_row($result);
|
||||
if ($data[0] == 1) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//------------
|
||||
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;
|
||||
}
|
||||
|
||||
$fh = fopen($file_name, 'r');
|
||||
if (! $fh) {
|
||||
PMA_do_disconnect();
|
||||
PMA_showMessage(sprintf(__('Could not open file: %s'), $file_name));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pbms_add_metadata("Content-Type", $file_type);
|
||||
|
||||
$pbms_blob_url = pbms_read_stream($fh, filesize($file_name), $tbl_name);
|
||||
if (! $pbms_blob_url) {
|
||||
PMA_BS_ReportPBMSError("pbms_read_stream()");
|
||||
}
|
||||
|
||||
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 efficient.
|
||||
$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)) {
|
||||
$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;
|
||||
}
|
||||
|
||||
//------------
|
||||
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;
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -6,11 +6,6 @@
|
||||
* @package phpMyAdmin
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
require_once './libraries/relation.lib.php';
|
||||
|
||||
/**
|
||||
* Defines the bookmark parameters for the current user
|
||||
*
|
||||
|
@@ -49,7 +49,7 @@ if (!defined('E_DEPRECATED')) {
|
||||
/**
|
||||
* the error handler
|
||||
*/
|
||||
require_once './libraries/Error_Handler.class.php';
|
||||
require './libraries/Error_Handler.class.php';
|
||||
|
||||
/**
|
||||
* initialize the error handler
|
||||
@@ -78,42 +78,42 @@ define('PHPMYADMIN', true);
|
||||
/**
|
||||
* core functions
|
||||
*/
|
||||
require_once './libraries/core.lib.php';
|
||||
require './libraries/core.lib.php';
|
||||
|
||||
/**
|
||||
* Input sanitizing
|
||||
*/
|
||||
require_once './libraries/sanitizing.lib.php';
|
||||
require './libraries/sanitizing.lib.php';
|
||||
|
||||
/**
|
||||
* the PMA_Theme class
|
||||
*/
|
||||
require_once './libraries/Theme.class.php';
|
||||
require './libraries/Theme.class.php';
|
||||
|
||||
/**
|
||||
* the PMA_Theme_Manager class
|
||||
*/
|
||||
require_once './libraries/Theme_Manager.class.php';
|
||||
require './libraries/Theme_Manager.class.php';
|
||||
|
||||
/**
|
||||
* the PMA_Config class
|
||||
*/
|
||||
require_once './libraries/Config.class.php';
|
||||
require './libraries/Config.class.php';
|
||||
|
||||
/**
|
||||
* the relation lib, tracker needs it
|
||||
*/
|
||||
require_once './libraries/relation.lib.php';
|
||||
require './libraries/relation.lib.php';
|
||||
|
||||
/**
|
||||
* the PMA_Tracker class
|
||||
*/
|
||||
require_once './libraries/Tracker.class.php';
|
||||
require './libraries/Tracker.class.php';
|
||||
|
||||
/**
|
||||
* the PMA_Table class
|
||||
*/
|
||||
require_once './libraries/Table.class.php';
|
||||
require './libraries/Table.class.php';
|
||||
|
||||
if (!defined('PMA_MINIMUM_COMMON')) {
|
||||
/**
|
||||
@@ -334,7 +334,7 @@ if ($GLOBALS['PMA_Config']->get('ForceSSL')
|
||||
/**
|
||||
* include session handling after the globals, to prevent overwriting
|
||||
*/
|
||||
require_once './libraries/session.inc.php';
|
||||
require './libraries/session.inc.php';
|
||||
|
||||
/**
|
||||
* init some variables LABEL_variables_init
|
||||
@@ -478,7 +478,7 @@ if (! PMA_isValid($_REQUEST['token']) || $_SESSION[' PMA_token '] != $_REQUEST['
|
||||
/**
|
||||
* Require cleanup functions
|
||||
*/
|
||||
require_once './libraries/cleanup.lib.php';
|
||||
require './libraries/cleanup.lib.php';
|
||||
/**
|
||||
* Do actual cleanup
|
||||
*/
|
||||
@@ -557,7 +557,7 @@ $GLOBALS['footnotes'] = array();
|
||||
/**
|
||||
* lang detection is done here
|
||||
*/
|
||||
require_once './libraries/select_lang.lib.php';
|
||||
require './libraries/select_lang.lib.php';
|
||||
|
||||
/**
|
||||
* check for errors occurred while loading configuration
|
||||
@@ -809,7 +809,6 @@ 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 {
|
||||
@@ -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
|
||||
|
@@ -666,7 +666,7 @@ function PMA_mysqlDie($error_message = '', $the_query = '',
|
||||
* display footer and exit
|
||||
*/
|
||||
|
||||
require_once './libraries/footer.inc.php';
|
||||
require './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']) {
|
||||
@@ -1277,6 +1270,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" .
|
||||
"//<![CDATA[\n" .
|
||||
"document.write('[<a href=\"#\" title=\"" .
|
||||
@@ -2101,7 +2105,8 @@ function PMA_getUniqueCondition($handle, $fields_cnt, $fields_meta, $row, $force
|
||||
$condition .= 'IS NULL AND';
|
||||
} else {
|
||||
// timestamp is numeric on some MySQL 4.1
|
||||
if ($meta->numeric && $meta->type != 'timestamp') {
|
||||
// for real we use CONCAT above and it should compare to string
|
||||
if ($meta->numeric && $meta->type != 'timestamp' && $meta->type != 'real') {
|
||||
$condition .= '= ' . $row[$i] . ' AND';
|
||||
} elseif (($meta->type == 'blob' || $meta->type == 'string')
|
||||
// hexify only if this is a true not empty BLOB or a BINARY
|
||||
@@ -2886,6 +2891,24 @@ function PMA_expandUserString($string, $escape = NULL, $updates = array()) {
|
||||
}
|
||||
}
|
||||
|
||||
/* Fetch fields list if required */
|
||||
if (strpos($string, '@FIELDS@') !== FALSE) {
|
||||
$fields_list = PMA_DBI_fetch_result(
|
||||
'SHOW COLUMNS FROM ' . PMA_backquote($GLOBALS['db'])
|
||||
. '.' . PMA_backquote($GLOBALS['table']));
|
||||
|
||||
$field_names = array();
|
||||
foreach ($fields_list as $field) {
|
||||
if (!is_null($escape)) {
|
||||
$field_names[] = $escape($field['Field']);
|
||||
} else {
|
||||
$field_names[] = $field['Field'];
|
||||
}
|
||||
}
|
||||
|
||||
$replace['@FIELDS@'] = implode(',', $field_names);
|
||||
}
|
||||
|
||||
/* Do the replacement */
|
||||
return str_replace(array_keys($replace), array_values($replace), strftime($string));
|
||||
}
|
||||
|
@@ -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)
|
||||
*
|
||||
@@ -1123,7 +1117,7 @@ $cfg['Export']['file_template_table'] = '@TABLE@';
|
||||
*
|
||||
* @global string $cfg['Export']['file_template_database']
|
||||
*/
|
||||
$cfg['Export']['file_template_database'] = '@DB@';
|
||||
$cfg['Export']['file_template_database'] = '@DATABASE@';
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -1938,8 +1932,7 @@ $cfg['DefaultLang'] = 'en';
|
||||
$cfg['DefaultConnectionCollation'] = 'utf8_general_ci';
|
||||
|
||||
/**
|
||||
* Force: always use this language - must be defined in
|
||||
* libraries/select_lang.lib.php
|
||||
* Force: always use this language
|
||||
* $cfg['Lang'] = 'en';
|
||||
*
|
||||
* Regular expression to limit listed languages, e.g. '^(cs|en)' for Czech and
|
||||
@@ -2351,22 +2344,14 @@ $cfg['ThemePerServer'] = false;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Default queries
|
||||
* %d will be replaced by the database name.
|
||||
* %t will be replaced by the table name.
|
||||
* %f will be replaced by a list of field names.
|
||||
* (%t and %f only applies to DefaultQueryTable)
|
||||
* Default query for table
|
||||
*
|
||||
* @global string $cfg['DefaultQueryTable']
|
||||
*/
|
||||
$cfg['DefaultQueryTable'] = 'SELECT * FROM %t WHERE 1';
|
||||
$cfg['DefaultQueryTable'] = 'SELECT * FROM @TABLE@ WHERE 1';
|
||||
|
||||
/**
|
||||
* Default queries
|
||||
* %d will be replaced by the database name.
|
||||
* %t will be replaced by the table name.
|
||||
* %f will be replaced by a list of field names.
|
||||
* (%t and %f only applies to DefaultQueryTable)
|
||||
* Default query for database
|
||||
*
|
||||
* @global string $cfg['DefaultQueryDatabase']
|
||||
*/
|
||||
|
@@ -220,30 +220,7 @@ function PMA_securePath($path)
|
||||
*/
|
||||
function PMA_fatalError($error_message, $message_args = null)
|
||||
{
|
||||
// it could happen PMA_fatalError() is called before language file is loaded
|
||||
if (! isset($GLOBALS['available_languages'])) {
|
||||
$GLOBALS['cfg'] = array(
|
||||
'DefaultLang' => 'en',
|
||||
);
|
||||
|
||||
// Loads the language file
|
||||
require_once './libraries/select_lang.lib.php';
|
||||
|
||||
// $text_dir is set in po file
|
||||
if (isset($text_dir)) {
|
||||
$GLOBALS['text_dir'] = $text_dir;
|
||||
}
|
||||
}
|
||||
|
||||
// $error_message could be a language string identifier: strString
|
||||
if (substr($error_message, 0, 3) === 'str') {
|
||||
if (isset($$error_message)) {
|
||||
$error_message = $$error_message;
|
||||
} elseif (isset($GLOBALS[$error_message])) {
|
||||
$error_message = $GLOBALS[$error_message];
|
||||
}
|
||||
}
|
||||
|
||||
/* Use format string if applicable */
|
||||
if (is_string($message_args)) {
|
||||
$error_message = sprintf($error_message, $message_args);
|
||||
} elseif (is_array($message_args)) {
|
||||
@@ -251,12 +228,18 @@ function PMA_fatalError($error_message, $message_args = null)
|
||||
}
|
||||
$error_message = strtr($error_message, array('<br />' => '[br]'));
|
||||
|
||||
if (function_exists('__')) {
|
||||
$error_header = __('Error');
|
||||
} else {
|
||||
$error_header = 'Error';
|
||||
}
|
||||
|
||||
// Displays the error message
|
||||
// (do not use & for parameters sent by header)
|
||||
$query_params = array(
|
||||
'lang' => $GLOBALS['available_languages'][$GLOBALS['lang']][1],
|
||||
'dir' => $GLOBALS['text_dir'],
|
||||
'type' => __('Error'),
|
||||
'type' => $error_header,
|
||||
'error' => $error_message,
|
||||
);
|
||||
header('Location: ' . (defined('PMA_SETUP') ? '../' : '') . 'error.php?'
|
||||
@@ -310,31 +293,12 @@ 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 blobstreaming table, reduce the table count
|
||||
if ($data['Tables_in_' . $db] == $table_key)
|
||||
{
|
||||
if ($num_tables > 0)
|
||||
// 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--;
|
||||
|
||||
break;
|
||||
}
|
||||
} // end if PMA configuration exists
|
||||
}
|
||||
|
||||
PMA_DBI_free_result($tables);
|
||||
} else {
|
||||
|
@@ -237,8 +237,6 @@ function PMA_usort_comparison_callback($a, $b)
|
||||
function PMA_DBI_get_tables_full($database, $table = false, $tbl_is_group = false, $link = null,
|
||||
$limit_offset = 0, $limit_count = false, $sort_by = 'Name', $sort_order = 'ASC')
|
||||
{
|
||||
require_once './libraries/Table.class.php';
|
||||
|
||||
if (true === $limit_count) {
|
||||
$limit_count = $GLOBALS['cfg']['MaxTableList'];
|
||||
}
|
||||
@@ -1391,7 +1389,7 @@ function PMA_DBI_get_triggers($db, $table, $delimiter = '//')
|
||||
// instead of WHERE EVENT_OBJECT_SCHEMA='dbname'
|
||||
$triggers = PMA_DBI_fetch_result("SELECT TRIGGER_SCHEMA, TRIGGER_NAME, EVENT_MANIPULATION, ACTION_TIMING, ACTION_STATEMENT, EVENT_OBJECT_SCHEMA, EVENT_OBJECT_TABLE FROM information_schema.TRIGGERS WHERE TRIGGER_SCHEMA= '" . PMA_sqlAddslashes($db,true) . "' and EVENT_OBJECT_TABLE = '" . PMA_sqlAddslashes($table, true) . "';");
|
||||
} else {
|
||||
$triggers = PMA_DBI_fetch_result("SHOW TRIGGERS FROM " . PMA_sqlAddslashes($db,true) . " LIKE '" . PMA_sqlAddslashes($table, true) . "';");
|
||||
$triggers = PMA_DBI_fetch_result("SHOW TRIGGERS FROM " . PMA_backquote(PMA_sqlAddslashes($db,true)) . " LIKE '" . PMA_sqlAddslashes($table, true) . "';");
|
||||
}
|
||||
|
||||
if ($triggers) {
|
||||
|
@@ -65,7 +65,6 @@ if (isset($submitcollation) && !empty($db_collation)) {
|
||||
unset($db_charset, $db_collation);
|
||||
}
|
||||
|
||||
$GLOBALS['js_include'][] = 'functions.js';
|
||||
require_once './libraries/header.inc.php';
|
||||
|
||||
/**
|
||||
|
@@ -13,7 +13,6 @@ if (! defined('PHPMYADMIN')) {
|
||||
*/
|
||||
require_once './libraries/common.inc.php';
|
||||
|
||||
require_once './libraries/relation.lib.php';
|
||||
/**
|
||||
* Gets the relation settings
|
||||
*/
|
||||
@@ -35,19 +34,6 @@ $is_superuser = PMA_isSuperuser();
|
||||
/**
|
||||
* Prepares links
|
||||
*/
|
||||
// Drop link if allowed
|
||||
// Don't even try to drop information_schema. You won't be able to. Believe me. You won't.
|
||||
// Don't allow to easilly drop mysql database, RFE #1327514.
|
||||
if (($is_superuser || $GLOBALS['cfg']['AllowUserDropDatabase']) && ! $db_is_information_schema && ($db != 'mysql')) {
|
||||
$tab_drop['link'] = 'sql.php';
|
||||
$tab_drop['args']['sql_query'] = 'DROP DATABASE ' . PMA_backquote($db);
|
||||
$tab_drop['args']['zero_rows'] = sprintf(__('Database %s has been dropped.'), htmlspecialchars(PMA_backquote($db)));
|
||||
$tab_drop['args']['goto'] = 'main.php';
|
||||
$tab_drop['args']['back'] = 'db' . $sub_part . '.php';
|
||||
$tab_drop['args']['reload'] = 1;
|
||||
$tab_drop['args']['purge'] = 1;
|
||||
$tab_drop['attr'] = 'onclick="return confirmLinkDropDB(this, \'DROP DATABASE ' . PMA_jsFormat($db) . '\')"';
|
||||
}
|
||||
|
||||
/**
|
||||
* export, search and qbe links if there is at least one table
|
||||
@@ -96,9 +82,6 @@ if (! $db_is_information_schema) {
|
||||
$tab_import['link'] = 'db_import.php';
|
||||
$tab_import['text'] = __('Import');
|
||||
$tab_import['icon'] = 'b_import.png';
|
||||
$tab_drop['text'] = __('Drop');
|
||||
$tab_drop['icon'] = 'b_deltbl.png';
|
||||
$tab_drop['class'] = 'caution';
|
||||
$tab_operation['link'] = 'db_operations.php';
|
||||
$tab_operation['text'] = __('Operations');
|
||||
$tab_operation['icon'] = 'b_tblops.png';
|
||||
@@ -133,9 +116,6 @@ if (! $db_is_information_schema) {
|
||||
if ($is_superuser) {
|
||||
$tabs[] =& $tab_privileges;
|
||||
}
|
||||
if ($is_superuser || $GLOBALS['cfg']['AllowUserDropDatabase']) {
|
||||
$tabs[] =& $tab_drop;
|
||||
}
|
||||
}
|
||||
|
||||
$url_params['db'] = $db;
|
||||
|
@@ -10,11 +10,6 @@ if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
require_once './libraries/Table.class.php';
|
||||
|
||||
if (empty($is_db)) {
|
||||
if (strlen($db)) {
|
||||
$is_db = @PMA_DBI_select_db($db);
|
||||
|
@@ -488,8 +488,8 @@ function PMA_DBI_get_fields_meta($result)
|
||||
{
|
||||
// Build an associative array for a type look up
|
||||
$typeAr = array();
|
||||
$typeAr[MYSQLI_TYPE_DECIMAL] = 'decimal';
|
||||
$typeAr[MYSQLI_TYPE_NEWDECIMAL] = 'decimal';
|
||||
$typeAr[MYSQLI_TYPE_DECIMAL] = 'real';
|
||||
$typeAr[MYSQLI_TYPE_NEWDECIMAL] = 'real';
|
||||
$typeAr[MYSQLI_TYPE_BIT] = 'int';
|
||||
$typeAr[MYSQLI_TYPE_TINY] = 'int';
|
||||
$typeAr[MYSQLI_TYPE_SHORT] = 'int';
|
||||
|
@@ -8,13 +8,7 @@ if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
require_once './libraries/Table.class.php';
|
||||
|
||||
// Get relations & co. status
|
||||
require_once './libraries/relation.lib.php';
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
|
||||
@@ -150,7 +144,7 @@ echo PMA_pluginGetJavascript($export_list);
|
||||
$trans->addMessage('@SERVER@/');
|
||||
$trans->addString(__('server name'));
|
||||
if ($export_type == 'database' || $export_type == 'table') {
|
||||
$trans->addMessage('@DB@/');
|
||||
$trans->addMessage('@DATABASE@/');
|
||||
$trans->addString(__('database name'));
|
||||
if ($export_type == 'table') {
|
||||
$trans->addMessage('@TABLE@/');
|
||||
|
@@ -9,7 +9,6 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
require_once './libraries/Table.class.php';
|
||||
require_once './libraries/Index.class.php';
|
||||
|
||||
/**
|
||||
@@ -1285,47 +1284,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);
|
||||
@@ -1379,8 +1339,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
||||
// fields
|
||||
if ($_SESSION['tmp_user_values']['display_binary_as_hex'] && PMA_contains_nonprintable_ascii($row[$i])) {
|
||||
$row[$i] = bin2hex($row[$i]);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$row[$i] = htmlspecialchars(PMA_replace_binary_contents($row[$i]));
|
||||
}
|
||||
} else {
|
||||
|
113
libraries/engines/pbms.lib.php
Normal file
113
libraries/engines/pbms.lib.php
Normal file
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -49,8 +49,6 @@ if (! defined('PHPMYADMIN')) {
|
||||
/**
|
||||
* for PMA_setHistory()
|
||||
*/
|
||||
require_once './libraries/relation.lib.php';
|
||||
|
||||
if (! PMA_isValid($_REQUEST['no_history']) && empty($GLOBALS['error_message'])
|
||||
&& ! empty($GLOBALS['sql_query'])) {
|
||||
PMA_setHistory(PMA_ifSetOr($GLOBALS['db'], ''),
|
||||
|
@@ -143,7 +143,6 @@ if (empty($GLOBALS['is_header_sent'])) {
|
||||
/**
|
||||
* Settings for relations stuff
|
||||
*/
|
||||
require_once './libraries/relation.lib.php';
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
// Get additional information about tables for tooltip is done
|
||||
|
@@ -30,6 +30,7 @@ $title = PMA_expandUserString(
|
||||
// here, the function does not exist with this configuration: $cfg['ServerDefault'] = 0;
|
||||
$is_superuser = function_exists('PMA_isSuperuser') && PMA_isSuperuser();
|
||||
|
||||
$GLOBALS['js_include'][] = 'functions.js';
|
||||
$GLOBALS['js_include'][] = 'tooltip.js';
|
||||
$params = array('lang' => $GLOBALS['lang']);
|
||||
if (isset($GLOBALS['db'])) {
|
||||
|
@@ -12,7 +12,6 @@ if (! defined('PHPMYADMIN')) {
|
||||
/**
|
||||
* Load relations.
|
||||
*/
|
||||
require_once './libraries/relation.lib.php';
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
/**
|
||||
|
@@ -127,7 +127,6 @@ if (! empty($submit_mult)
|
||||
* Displays the confirmation form if required
|
||||
*/
|
||||
if (!empty($submit_mult) && !empty($what)) {
|
||||
$GLOBALS['js_include'][] = 'functions.js';
|
||||
unset($message);
|
||||
|
||||
require_once './libraries/header.inc.php';
|
||||
@@ -262,7 +261,7 @@ if (!empty($submit_mult) && !empty($what)) {
|
||||
<input type="submit" name="mult_btn" value="<?php echo __('No'); ?>" id="buttonNo" />
|
||||
</fieldset>
|
||||
<?php
|
||||
require_once './libraries/footer.inc.php';
|
||||
require './libraries/footer.inc.php';
|
||||
} // end if
|
||||
|
||||
|
||||
|
@@ -198,14 +198,6 @@ function PMA_getServerCollation() {
|
||||
* @return string collation description
|
||||
*/
|
||||
function PMA_getCollationDescr($collation) {
|
||||
static $collation_cache;
|
||||
|
||||
if (!is_array($collation_cache)) {
|
||||
$collation_cache = array();
|
||||
} elseif (isset($collation_cache[$collation])) {
|
||||
return $collation_cache[$collation];
|
||||
}
|
||||
|
||||
if ($collation == 'binary') {
|
||||
return __('Binary');
|
||||
}
|
||||
|
@@ -9,11 +9,6 @@ if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
require_once './libraries/Table.class.php';
|
||||
|
||||
/**
|
||||
* Executes a query as controluser if possible, otherwise as normal user
|
||||
*
|
||||
|
@@ -9,11 +9,6 @@ if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
require_once './libraries/relation.lib.php';
|
||||
|
||||
/**
|
||||
* Cleanu column related relation stuff
|
||||
*
|
||||
|
@@ -367,7 +367,7 @@ $GLOBALS['lang_path'] = './locale/';
|
||||
/**
|
||||
* Load gettext functions.
|
||||
*/
|
||||
require_once './libraries/php-gettext/gettext.inc';
|
||||
require './libraries/php-gettext/gettext.inc';
|
||||
|
||||
/**
|
||||
* @global string interface language
|
||||
|
@@ -40,8 +40,6 @@ require_once './libraries/bookmark.lib.php'; // used for file listing
|
||||
* @uses $GLOBALS['cfg']['DefaultQueryDatabase']
|
||||
* @uses $GLOBALS['cfg']['Servers']
|
||||
* @uses $GLOBALS['cfg']['DefaultTabDatabase']
|
||||
* @uses $GLOBALS['cfg']['DefaultQueryDatabase']
|
||||
* @uses $GLOBALS['cfg']['DefaultQueryTable']
|
||||
* @uses $GLOBALS['cfg']['Bookmark']
|
||||
* @uses PMA_generate_common_url()
|
||||
* @uses PMA_backquote()
|
||||
@@ -235,8 +233,7 @@ function PMA_sqlQueryFormInsert($query = '', $is_querywindow = false, $delimiter
|
||||
// $tmp_db_link = htmlspecialchars($db);
|
||||
$legend = sprintf(__('Run SQL query/queries on database %s'), $tmp_db_link);
|
||||
if (empty($query)) {
|
||||
$query = str_replace('%d',
|
||||
PMA_backquote($db), $GLOBALS['cfg']['DefaultQueryDatabase']);
|
||||
$query = PMA_expandUserString($GLOBALS['cfg']['DefaultQueryDatabase'], 'PMA_backquote');
|
||||
}
|
||||
} else {
|
||||
$table = $GLOBALS['table'];
|
||||
@@ -259,18 +256,8 @@ function PMA_sqlQueryFormInsert($query = '', $is_querywindow = false, $delimiter
|
||||
// else use
|
||||
// $tmp_db_link = htmlspecialchars($db);
|
||||
$legend = sprintf(__('Run SQL query/queries on database %s'), $tmp_db_link);
|
||||
if (empty($query) && count($fields_list)) {
|
||||
$field_names = array();
|
||||
foreach ($fields_list as $field) {
|
||||
$field_names[] = PMA_backquote($field['Field']);
|
||||
}
|
||||
$query =
|
||||
str_replace('%d', PMA_backquote($db),
|
||||
str_replace('%t', PMA_backquote($table),
|
||||
str_replace('%f',
|
||||
implode(', ', $field_names),
|
||||
$GLOBALS['cfg']['DefaultQueryTable'])));
|
||||
unset($field_names);
|
||||
if (empty($query)) {
|
||||
$query = PMA_expandUserString($GLOBALS['cfg']['DefaultQueryTable'], 'PMA_backquote');
|
||||
}
|
||||
}
|
||||
$legend .= ': ' . PMA_showMySQLDocu('SQL-Syntax', 'SELECT');
|
||||
|
@@ -12,11 +12,6 @@ if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
require_once './libraries/Table.class.php';
|
||||
|
||||
/**
|
||||
* requirements
|
||||
*/
|
||||
|
@@ -37,7 +37,6 @@ $err_url = $cfg['DefaultTabTable'] . PMA_generate_common_url($url_params);
|
||||
/**
|
||||
* Displays headers
|
||||
*/
|
||||
$GLOBALS['js_include'][] = 'functions.js';
|
||||
require_once './libraries/header.inc.php';
|
||||
|
||||
/**
|
||||
@@ -92,19 +91,6 @@ if (! $tbl_is_view && ! (isset($db_is_information_schema) && $db_is_information_
|
||||
$tabs['operation']['icon'] = 'b_tblops.png';
|
||||
$tabs['operation']['link'] = 'tbl_operations.php';
|
||||
$tabs['operation']['text'] = __('Operations');
|
||||
|
||||
$tabs['empty']['link'] = 'sql.php';
|
||||
$tabs['empty']['args']['reload'] = 1;
|
||||
$tabs['empty']['args']['sql_query'] = 'TRUNCATE TABLE ' . PMA_backquote($table);
|
||||
$tabs['empty']['args']['zero_rows'] = sprintf(__('Table %s has been emptied'), htmlspecialchars($table));
|
||||
$tabs['empty']['attr'] = 'onclick="return confirmLink(this, \'TRUNCATE TABLE ' . PMA_jsFormat($table) . '\')"';
|
||||
$tabs['empty']['args']['goto'] = 'tbl_structure.php';
|
||||
$tabs['empty']['class'] = 'caution';
|
||||
$tabs['empty']['icon'] = 'b_empty.png';
|
||||
$tabs['empty']['text'] = __('Empty');
|
||||
if ($table_info_num_rows == 0) {
|
||||
$tabs['empty']['warning'] = __('Table seems to be empty!');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -116,25 +102,6 @@ if ($tbl_is_view && ! (isset($db_is_information_schema) && $db_is_information_sc
|
||||
$tabs['operation']['text'] = __('Operations');
|
||||
}
|
||||
|
||||
/**
|
||||
* no drop in information_schema
|
||||
*/
|
||||
if (! (isset($db_is_information_schema) && $db_is_information_schema)) {
|
||||
$tabs['drop']['icon'] = 'b_deltbl.png';
|
||||
$tabs['drop']['link'] = 'sql.php';
|
||||
$tabs['drop']['url_params'] = array('table' => NULL);
|
||||
$tabs['drop']['text'] = __('Drop');
|
||||
$tabs['drop']['args']['reload'] = 1;
|
||||
$tabs['drop']['args']['purge'] = 1;
|
||||
$drop_command = 'DROP ' . ($tbl_is_view ? 'VIEW' : 'TABLE');
|
||||
$tabs['drop']['args']['sql_query'] = $drop_command . ' ' . PMA_backquote($table);
|
||||
$tabs['drop']['args']['goto'] = 'db_structure.php';
|
||||
$tabs['drop']['args']['zero_rows'] = sprintf(($tbl_is_view ? __('View %s has been dropped') : __('Table %s has been dropped')), htmlspecialchars($table));
|
||||
$tabs['drop']['attr'] = 'onclick="return confirmLink(this, \'' . $drop_command . ' ' . PMA_jsFormat($table) . '\')"';
|
||||
unset($drop_command);
|
||||
$tabs['drop']['class'] = 'caution';
|
||||
}
|
||||
|
||||
if ($table_info_num_rows == 0 && !$tbl_is_view) {
|
||||
$tabs['browse']['warning'] = __('Table seems to be empty!');
|
||||
$tabs['search']['warning'] = __('Table seems to be empty!');
|
||||
|
@@ -117,7 +117,6 @@ if (!$is_backup) {
|
||||
|
||||
$header_cells[] = '<abbr title="AUTO_INCREMENT">' . ($display_type == 'horizontal' ? 'A_I' : 'AUTO_INCREMENT') . '</abbr>';
|
||||
|
||||
require_once './libraries/relation.lib.php';
|
||||
require_once './libraries/transformations.lib.php';
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
|
3
main.php
3
main.php
@@ -309,7 +309,6 @@ if (file_exists('./config')) {
|
||||
* Check whether relations are supported.
|
||||
*/
|
||||
if ($server > 0) {
|
||||
require_once './libraries/relation.lib.php';
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
if(!$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false) {
|
||||
$message = PMA_Message::notice(__('The additional features for working with linked tables have been deactivated. To find out why click %shere%s.'));
|
||||
@@ -391,5 +390,5 @@ function PMA_printListItem($name, $id = null, $url = null, $mysql_help_page = nu
|
||||
/**
|
||||
* Displays the footer
|
||||
*/
|
||||
require_once './libraries/footer.inc.php';
|
||||
require './libraries/footer.inc.php';
|
||||
?>
|
||||
|
@@ -110,9 +110,8 @@ if ($GLOBALS['server'] && ! strlen($GLOBALS['db'])) {
|
||||
$db_start = $GLOBALS['db'];
|
||||
|
||||
/**
|
||||
* the relation library
|
||||
* the relation settings
|
||||
*/
|
||||
require_once './libraries/relation.lib.php';
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
/**
|
||||
|
@@ -20,7 +20,6 @@ require_once './libraries/db_info.inc.php';
|
||||
/**
|
||||
* Settings for relation stuff
|
||||
*/
|
||||
require_once './libraries/relation.lib.php';
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
// This is to avoid "Command out of sync" errors. Before switching this to
|
||||
@@ -39,24 +38,24 @@ $query_default_option = PMA_DBI_QUERY_STORE;
|
||||
if (!$cfgRelation['relwork']) {
|
||||
echo sprintf(__('<b>%s</b> table not found or not set in %s'), 'relation', 'config.inc.php') . '<br />' . "\n"
|
||||
. PMA_showDocu('relation') . "\n";
|
||||
require_once './libraries/footer.inc.php';
|
||||
require './libraries/footer.inc.php';
|
||||
}
|
||||
|
||||
if (!$cfgRelation['displaywork']) {
|
||||
echo sprintf(__('<b>%s</b> table not found or not set in %s'), 'table_info', 'config.inc.php') . '<br />' . "\n"
|
||||
. PMA_showDocu('table_info') . "\n";
|
||||
require_once './libraries/footer.inc.php';
|
||||
require './libraries/footer.inc.php';
|
||||
}
|
||||
|
||||
if (!isset($cfgRelation['table_coords'])){
|
||||
echo sprintf(__('<b>%s</b> table not found or not set in %s'), 'table_coords', 'config.inc.php') . '<br />' . "\n"
|
||||
. PMA_showDocu('table_coords') . "\n";
|
||||
require_once './libraries/footer.inc.php';
|
||||
require './libraries/footer.inc.php';
|
||||
}
|
||||
if (!isset($cfgRelation['pdf_pages'])) {
|
||||
echo sprintf(__('<b>%s</b> table not found or not set in %s'), 'pdf_page', 'config.inc.php') . '<br />' . "\n"
|
||||
. PMA_showDocu('pdf_pages') . "\n";
|
||||
require_once './libraries/footer.inc.php';
|
||||
require './libraries/footer.inc.php';
|
||||
}
|
||||
|
||||
if ($cfgRelation['pdfwork']) {
|
||||
@@ -556,5 +555,5 @@ ToggleDragDrop('pdflayout');
|
||||
* Displays the footer
|
||||
*/
|
||||
echo "\n";
|
||||
require_once './libraries/footer.inc.php';
|
||||
require './libraries/footer.inc.php';
|
||||
?>
|
||||
|
@@ -13,7 +13,6 @@ require_once './libraries/common.inc.php';
|
||||
/**
|
||||
* Settings for relation stuff
|
||||
*/
|
||||
require_once './libraries/relation.lib.php';
|
||||
require_once './libraries/transformations.lib.php';
|
||||
require_once './libraries/Index.class.php';
|
||||
|
||||
@@ -30,7 +29,7 @@ $cfgRelation = PMA_getRelationsParam();
|
||||
if (!$cfgRelation['pdfwork']) {
|
||||
echo '<font color="red">' . __('Error') . '</font><br />' . "\n";
|
||||
$url_to_goto = '<a href="' . $cfg['PmaAbsoluteUri'] . 'chk_rel.php?' . $url_query . '">';
|
||||
echo sprintf(__('The additional features for working with linked tables have been deactivated. To find out why click %shere%s.'), $url_to_goto, '</a>') . "\n";
|
||||
echo sprintf(__('The phpMyAdmin configuration storage has been deactivated. To find out why click %shere%s.'), $url_to_goto, '</a>') . "\n";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -240,7 +239,7 @@ class PMA_PDF extends TCPDF {
|
||||
. '">' . __('Back') . '</a>';
|
||||
echo "\n";
|
||||
|
||||
require_once './libraries/footer.inc.php';
|
||||
require './libraries/footer.inc.php';
|
||||
} // end of the "PMA_PDF_die()" function
|
||||
/**
|
||||
* Aliases the "Error()" function from the FPDF class to the
|
||||
|
@@ -13,7 +13,6 @@ require_once './libraries/header_http.inc.php';
|
||||
|
||||
$GLOBALS['PMD']['STYLE'] = 'default';
|
||||
|
||||
require_once './libraries/relation.lib.php';
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
$GLOBALS['script_display_field'] =
|
||||
|
@@ -8,7 +8,6 @@
|
||||
*
|
||||
*/
|
||||
include_once 'pmd_common.php';
|
||||
require_once './libraries/relation.lib.php';
|
||||
|
||||
|
||||
$table = $T;
|
||||
|
@@ -15,8 +15,6 @@ if (! isset($scale)) {
|
||||
include_once 'pmd_save_pos.php';
|
||||
}
|
||||
|
||||
require_once './libraries/relation.lib.php';
|
||||
|
||||
if (isset($scale) && ! isset($createpage)) {
|
||||
if (empty($pdf_page_number)) {
|
||||
die("<script>alert('Pages not found!');history.go(-2);</script>");
|
||||
|
@@ -11,7 +11,6 @@
|
||||
include_once 'pmd_common.php';
|
||||
$die_save_pos = 0;
|
||||
include_once 'pmd_save_pos.php';
|
||||
require_once './libraries/relation.lib.php';
|
||||
extract($_POST, EXTR_SKIP);
|
||||
|
||||
$tables = PMA_DBI_get_tables_full($db, $T1);
|
||||
|
@@ -9,7 +9,6 @@
|
||||
*
|
||||
*/
|
||||
include_once 'pmd_common.php';
|
||||
require_once './libraries/relation.lib.php';
|
||||
extract($_POST, EXTR_SKIP);
|
||||
extract($_GET, EXTR_SKIP);
|
||||
$die_save_pos = 0;
|
||||
|
@@ -9,7 +9,6 @@
|
||||
*
|
||||
*/
|
||||
include_once 'pmd_common.php';
|
||||
require_once './libraries/relation.lib.php';
|
||||
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
|
2323
po/be@latin.po
2323
po/be@latin.po
File diff suppressed because it is too large
Load Diff
2341
po/en_GB.po
2341
po/en_GB.po
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user