Merge branch 'master' of ssh://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin

Conflicts:
	libraries/relation.lib.php
This commit is contained in:
Crack
2010-07-24 18:34:52 +02:00
328 changed files with 106122 additions and 111373 deletions

View File

@@ -89,8 +89,15 @@ $Id$
(fixed for Privileges and Change password)
- [core] RecodingEngine now accepts none as valid option.
+ [core] Dropped AllowAnywhereRecoding configuration variable.
- rfe #3016457 [interface] Define tab order in SQL form to allow easier tab
navigation.
+ [code] Centralized format string expansion, @VARIABLES@ are recommended way
now.
+ [validator] SQL validator works also with SOAP PHP extension.
- [interface] Better formatting for SQL validator results.
3.3.6.0 (not yet released)
- bug #3031705 [core] Do not use CONCAT for DECIMAL fields.
3.3.5.0 (not yet released)
- patch #2932113 [information_schema] Slow export when having lots of

View File

@@ -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>
@@ -340,7 +343,8 @@ rm -rf config # remove not needed directory
<abbr title="Frequently Asked Questions">FAQ</abbr> 1.23</a>).</p>
<p> If you already had this infrastructure and upgraded to MySQL 4.1.2
or newer, please use <i>./scripts/upgrade_tables_mysql_4_1_2+.sql</i>.</p>
or newer, please use <i>./scripts/upgrade_tables_mysql_4_1_2+.sql</i>
and then create new tables by importing <i>./scripts/create_tables.sql</i>.</p>
<p> You can use your phpMyAdmin to create the tables for you. Please be aware
that you may need special (administrator) privileges to create the database
@@ -2174,24 +2178,8 @@ setfacl -d -m "g:www-data:rwx" tmp
<dt id="cfg_TitleDatabase">$cfg['TitleDatabase'] string</dt>
<dt id="cfg_TitleServer">$cfg['TitleServer'] string</dt>
<dt id="cfg_TitleDefault">$cfg['TitleDefault'] string</dt>
<dd>Allows you to specify window's title bar. Following magic string can
be used to get special values:
<dl>
<dt><code>@HTTP_HOST@</code></dt>
<dd>HTTP host that runs phpMyAdmin</dd>
<dt><code>@SERVER@</code></dt>
<dd>MySQL server name</dd>
<dt><code>@VERBOSE@</code></dt>
<dd>Verbose MySQL server name as defined in <a href="#cfg_Servers_verbose">server configuration</a></dd>
<dt><code>@VSERVER@</code></dt>
<dd>Verbose MySQL server name if set, otherwise normal</dd>
<dt><code>@DATABASE@</code></dt>
<dd>Currently opened database</dd>
<dt><code>@TABLE@</code></dt>
<dd>Currently opened table</dd>
<dt><code>@PHPMYADMIN@</code></dt>
<dd>phpMyAdmin with version</dd>
</dl>
<dd>Allows you to specify window's title bar. You can use
<a href="#faq6_27">format string expansion</a>.
</dd>
<dt id="cfg_ErrorIconic">$cfg['ErrorIconic'] boolean</dt>
@@ -4148,25 +4136,34 @@ INSERT INTO REL_towns VALUES ('M', 'Montr&eacute;al');
<a href="#faqsqlvalidator">6.14 How do I set up the
<abbr title="structured query language">SQL</abbr> Validator?</a></h4>
<p> To use it, you need a very recent version of PHP, 4.3.0 recommended, with
<p>
To use SQL Validator, you need PHP with
<abbr title="Extensible Markup Language">XML</abbr>,
<abbr title="Perl Compatible Regular Expressions">PCRE</abbr> and
<abbr title="PHP Extension and Application Repository">PEAR</abbr> support.
On your system command line, run <tt>"pear install Net_Socket Net_URL
HTTP_Request Mail_Mime Net_DIME SOAP"</tt> to get the necessary
<abbr title="PHP Extension and Application Repository">PEAR</abbr> modules
for usage.<br />
On a more recent pear version, I had problems with the state of Net_DIME
being beta, so this single command
<tt>"pear -d preferred_state=beta install -a SOAP"</tt> installed all the
needed modules.<br />
In addition you need a <abbr title="Simple Object Access
Protocol">SOAP</abbr> support, either as a PHP extension or as a PEAR SOAP
module.
</p>
<p>
To install <abbr title="PHP Extension and Application
Repository">PEAR</abbr> <abbr title="Simple Object Access
Protocol">SOAP</abbr> module, run <tt>"pear install Net_Socket Net_URL
HTTP_Request Mail_Mime Net_DIME SOAP"</tt> to get the necessary <abbr
title="PHP Extension and Application Repository">PEAR</abbr> modules for
usage.
</p>
<p>
If you use the Validator, you should be aware that any
<abbr title="structured query language">SQL</abbr> statement you
submit will be stored anonymously (database/table/column names,
strings, numbers replaced with generic values). The Mimer
<abbr title="structured query language">SQL</abbr>
Validator itself, is &copy; 2001 Upright Database Technology.
We utilize it as free SOAP service.</p>
We utilize it as free SOAP service.
</p>
<h4 id="faq6_15">
<a href="#faq6_15">6.15 I want to add a BLOB column and put an index on
@@ -4337,13 +4334,20 @@ chmod o+rwx tmp
<h4 id="faq6_25">
<a href="#faq6_25">6.25 How does BLOB streaming work in phpMyAdmin?</a></h4>
<p> First, for general information about BLOB streaming on MySQL, visit <a href="http://blobstreaming.org">blobstreaming.org</a>. We currently support streaming if you are running MySQL 5.1 with the PBXT and PBMS storage engines. Moreover, only PBMS 0.5.04 is supported.</p>
<p> For general information about BLOB streaming on MySQL, visit <a href="http://blobstreaming.org">blobstreaming.org</a>. You need the following components:</p>
<ul>
<li>PBMS BLOB Streaming Daemon for MySQL (0.5.15 or later)</li>
<li>Streaming enabled PBXT Storage engine for MySQL (1.0.11-6 or
later)</li>
<li>PBMS Client Library for MySQL (0.5.15 or later)</li>
<li>PBMS PHP Extension for MySQL (0.1.1 or later)</li>
</ul>
<p>Here are details about configuration and operation:</p>
<ol>
<li>In <tt>config.inc.php</tt> your host should be defined with a FQDN (fully qualified domain name) instead of something like &quot;localhost&quot;.</li>
<li>A current limitation is that your first login via phpMyAdmin to a freshly-started server must be done with an account that has the SUPER privilege.</li>
<li>On your target database, go to Operations and in the &quot;BLOB Repository&quot; section, click &quot;Enable&quot;. This creates the PBMS system tables inside your database.</li>
<li>Ensure that your target table is under the PBXT storage engine and has a LONGBLOB column.</li>
<li>In <tt>config.inc.php</tt> your host should be defined with a FQDN (fully qualified domain name) instead of &quot;localhost&quot;.</li>
<li>Ensure that your target table is under the PBXT storage engine and has a LONGBLOB column and a primary key.</li>
<li>When you insert or update a row in this table, put a checkmark on the &quot;Upload to BLOB repository&quot; optional choice; otherwise, the upload will be done directly in your column instead of the repository.</li>
<li>Finally when you browse your table, you'll see in your column a link to stream your data, for example &quot;View image&quot;. A header containing the correct MIME-type will be sent to your browser; this MIME-type was stored at upload time but in case it's incorrect, it's possible to edit it by clicking on the displayed MIME-type.</li>
</ol>
@@ -4354,6 +4358,33 @@ chmod o+rwx tmp
<p> Click the first row of the range, hold the shift key and click the last row of the range. This works everywhere you see rows, for example in Browse mode or on the Structure page.</p>
<h4 id="faq6_27">
<a href="#faq6_27">6.27 What format strings can I use?</a></h4>
<p>
In all places where phpMyAdmin accepts format strings, you can use
<code>@VARIABLE@</code> expansion and
<a href="http://php.net/strftime">strftime</a> format strings. The
expanded variables depend on a context (eg. if you don't have chosen
table, you can not get table name), but following variables can be used:
</p>
<dl>
<dt><code>@HTTP_HOST@</code></dt>
<dd>HTTP host that runs phpMyAdmin</dd>
<dt><code>@SERVER@</code></dt>
<dd>MySQL server name</dd>
<dt><code>@VERBOSE@</code></dt>
<dd>Verbose MySQL server name as defined in <a href="#cfg_Servers_verbose">server configuration</a></dd>
<dt><code>@VSERVER@</code></dt>
<dd>Verbose MySQL server name if set, otherwise normal</dd>
<dt><code>@DATABASE@</code></dt>
<dd>Currently opened database</dd>
<dt><code>@TABLE@</code></dt>
<dd>Currently opened table</dd>
<dt><code>@PHPMYADMIN@</code></dt>
<dd>phpMyAdmin with version</dd>
</dl>
<h3 id="faqproject">phpMyAdmin project</h3>
<h4 id="faq7_1">
@@ -4849,6 +4880,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>

View File

@@ -3,7 +3,6 @@
/**
* display selection for relational field values
*
* @version $Id$
* @package phpMyAdmin
*/

View File

@@ -1,7 +1,6 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* @version 1.0
* @package BLOBStreaming
*/
@@ -33,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)
?>

View File

@@ -1,7 +1,6 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* @version 1.0
* @package BLOBStreaming
*/
@@ -10,13 +9,6 @@
*/
require_once './libraries/common.inc.php';
// load PMA configuration
$PMA_Config = $GLOBALS['PMA_Config'];
// retrieve BS server variables from PMA configuration
$bs_server = $PMA_Config->get('BLOBSTREAMING_SERVER');
if (empty($bs_server)) die('No blob streaming server configured!');
// Check URL parameters
PMA_checkParameters(array('reference', 'c_type'));
@@ -31,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'];
@@ -59,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;

View File

@@ -1,7 +1,6 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* @version 1.0
* @package BLOBStreaming
*/
@@ -26,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>
@@ -70,7 +61,6 @@
</body>
</html>
<?php
} // end if (!empty($PMA_Config))
} // end if (isset($mediaType) && isset($bsReference))
?>

View File

@@ -3,7 +3,6 @@
/**
* Simple script to set correct charset for changelog
*
* @version $Id$
* @package phpMyAdmin
*/

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
*
* @version $Id$
* @package phpMyAdmin
*/
@@ -10,7 +9,6 @@
* 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';

View File

@@ -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';

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
*
* @version $Id$
* @package phpMyAdmin
*/
@@ -10,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'));

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
*
* @version $Id$
* @package phpMyAdmin
*/

View File

@@ -3,7 +3,6 @@
/**
* dumps a database
*
* @version $Id$
* @uses libraries/db_common.inc.php
* @uses libraries/db_info.inc.php
* @uses libraries/display_export.lib.php

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
*
* @version $Id$
* @package phpMyAdmin
*/

View File

@@ -9,7 +9,6 @@
* - adding tables
* - viewing PDF schemas
*
* @version $Id$
* @package phpMyAdmin
*/
@@ -20,9 +19,6 @@ require_once './libraries/common.inc.php';
require_once './libraries/Table.class.php';
require_once './libraries/mysql_charsets.lib.php';
// add blobstreaming library functions
require_once "./libraries/blobstreaming.lib.php";
/**
* Rename/move or copy database
*/
@@ -261,65 +257,6 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) {
}
}
/*
* Enable/Disable/Repair BLOB Repository Monitoring for current database
*/
if (strlen($db) > 0 && !empty($db_blob_streaming_op))
{
// load PMA_Config
$PMA_Config = $GLOBALS['PMA_Config'];
if (!empty($PMA_Config))
{
if ($PMA_Config->get('PBXT_NAME') !== strtolower($db))
{
// if Blobstreaming plugins exist, begin checking for Blobstreaming tables
if ($PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST'))
{
$bs_tables = $PMA_Config->get('BLOBSTREAMABLE_DATABASES');
$bs_tables = $bs_tables[$db];
$oneBSTableExists = FALSE;
// check if at least one blobstreaming table exists
foreach ($bs_tables as $table_key=>$tbl)
if ($bs_tables[$table_key]['Exists'])
{
$oneBSTableExists = TRUE;
break;
}
switch ($db_blob_streaming_op)
{
// enable BLOB repository monitoring
case "enable":
// if blobstreaming tables do not exist, create them
if (!$oneBSTableExists)
PMA_BS_CreateTables($db);
break;
// disable BLOB repository monitoring
case "disable":
// if at least one blobstreaming table exists, execute drop
if ($oneBSTableExists)
PMA_BS_DropTables($db);
break;
// repair BLOB repository
case "repair":
// check if a blobstreaming table is missing
foreach ($bs_tables as $table_key=>$tbl)
if (!$bs_tables[$table_key]['Exists'])
{
PMA_DBI_select_db($db);
PMA_DBI_query(PMA_BS_GetTableStruct($table_key));
}
}
// refresh side menu
PMA_sendHeaderLocation($cfg['PmaAbsoluteUri'] . 'db_operations.php?' . PMA_generate_common_url ('','', '&') . (isset($db) ? '&db=' . urlencode($db) : '') . (isset($token) ? '&token=' . urlencode($token) : '') . (isset($goto) ? '&goto=' . urlencode($goto) : '') . 'reload=1&purge=1');
} // end if ($PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST'))
} // end if ($PMA_Config->get('PBXT_NAME') !== strtolower($db))
}
}
/**
* Settings for relations stuff
@@ -501,92 +438,6 @@ if (!$is_information_schema) {
</form>
<?php
/*
* BLOB streaming support
*/
// load PMA_Config
$PMA_Config = $GLOBALS['PMA_Config'];
// if all blobstreaming plugins exist, begin checking for blobstreaming tables
if (!empty($PMA_Config))
{
if ($PMA_Config->get('PBXT_NAME') !== strtolower($db))
{
if ($PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST'))
{
$bs_tables = $PMA_Config->get('BLOBSTREAMABLE_DATABASES');
$bs_tables = $bs_tables[$db];
$oneBSTableExists = FALSE;
$allBSTablesExist = TRUE;
// first check that all blobstreaming tables do not exist
foreach ($bs_tables as $table_key=>$tbl)
if ($bs_tables[$table_key]['Exists'])
$oneBSTableExists = TRUE;
else
$allBSTablesExist = FALSE;
?>
<form method="post" action="./db_operations.php">
<?php echo PMA_generate_common_hidden_inputs($db); ?>
<fieldset>
<legend>
<?php echo PMA_getIcon('b_edit.png', __('BLOB Repository'), false, true); ?>
</legend>
<?php echo __('Status'); ?>:
<?php
// if the blobstreaming tables exist, provide option to disable the BLOB repository
if ($allBSTablesExist)
{
?>
<?php echo _pgettext('BLOB repository', 'Enabled'); ?>
</fieldset>
<fieldset class="tblFooters">
<input type="hidden" name="db_blob_streaming_op" value="disable" />
<input type="submit" onclick="return confirmDisableRepository('<?php echo $db; ?>');" value="<?php echo __('Disable'); ?>" />
</fieldset>
<?php
}
else
{
// if any of the blobstreaming tables are missing, provide option to repair the BLOB repository
if ($oneBSTableExists && !$allBSTablesExist)
{
?>
<?php echo __('Damaged'); ?>
</fieldset>
<fieldset class="tblFooters">
<input type="hidden" name="db_blob_streaming_op" value="repair" />
<input type="submit" value="<?php echo _pgettext('BLOB repository', 'Repair'); ?>" />
</fieldset>
<?php
}
// if none of the blobstreaming tables exist, provide option to enable BLOB repository
else
{
?>
<?php echo _pgettext('BLOB repository', 'Disabled'); ?>
</fieldset>
<fieldset class="tblFooters">
<input type="hidden" name="db_blob_streaming_op" value="enable" />
<input type="submit" value="<?php echo __('Enable'); ?>" />
</fieldset>
<?php
}
} // end if ($allBSTablesExist)
?>
</form>
<?php
} // end if ($PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST'))
} // end if ($PMA_Config->get('PBXT_NAME') !== strtolower($db))
}
/**
* Change database charset

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
*
* @version $Id$
* @package phpMyAdmin
*/

View File

@@ -3,7 +3,6 @@
/**
* query by example the whole database
*
* @version $Id$
* @package phpMyAdmin
*/

View File

@@ -7,23 +7,6 @@
* @todo display executed query, optional?
* @uses $cfg['UseDbSearch']
* @uses $GLOBALS['db']
* @uses __('Access denied')
* @uses __('at least one of the words')
* @uses __('all words')
* @uses __('the exact phrase')
* @uses __('as regular expression')
* @uses __('Search results for "<i>%s</i>" %s:')
* @uses __('%s match(es) inside table <i>%s</i>')
* @uses __('Browse')
* @uses __('Delete')
* @uses __('<b>Total:</b> <i>%s</i> match(es)')
* @uses __('Search in database')
* @uses __('Word(s) or value(s) to search for (wildcard: "%"):')
* @uses __('Find:')
* @uses __('Words are separated by a space character (" ").')
* @uses __('Inside table(s):')
* @uses __('Unselect All')
* @uses __('Select All')
* @uses PMA_DBI_get_tables()
* @uses PMA_sqlAddslashes()
* @uses PMA_getSearchSqls()
@@ -46,7 +29,6 @@
* @uses array_intersect()
* @uses sprintf()
* @uses in_array()
* @version $Id$
* @package phpMyAdmin
*/

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
*
* @version $Id$
* @package phpMyAdmin
*/

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
*
* @version $Id$
* @package phpMyAdmin
*/
@@ -151,25 +150,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

View File

@@ -1,7 +1,6 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* @version $Id$
* @package phpMyAdmin
*/

View File

@@ -3,7 +3,6 @@
/**
* phpMyAdmin fatal error display page
*
* @version $Id$
* @package phpMyAdmin
*/

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* @todo too much die here, or?
* @version $Id$
* @package phpMyAdmin
*/
@@ -60,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';
@@ -249,20 +247,18 @@ if ($asfile) {
$GLOBALS['PMA_Config']->setUserValue('pma_server_filename_template',
'Export/file_template_server', $filename_template);
}
$filename = str_replace('__SERVER__', $GLOBALS['cfg']['Server']['host'], strftime($filename_template));
} elseif ($export_type == 'database') {
if (isset($remember_template)) {
$GLOBALS['PMA_Config']->setUserValue('pma_db_filename_template',
'Export/file_template_database', $filename_template);
}
$filename = str_replace('__DB__', $db, str_replace('__SERVER__', $GLOBALS['cfg']['Server']['host'], strftime($filename_template)));
} else {
if (isset($remember_template)) {
$GLOBALS['PMA_Config']->setUserValue('pma_table_filename_template',
'Export/file_template_table', $filename_template);
}
$filename = str_replace('__TABLE__', $table, str_replace('__DB__', $db, str_replace('__SERVER__', $GLOBALS['cfg']['Server']['host'], strftime($filename_template))));
}
$filename = PMA_expandUserString($filename_template);
// convert filename to iso-8859-1, it is safer
$filename = PMA_convert_string($charset, 'iso-8859-1', $filename);
@@ -304,7 +300,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';
@@ -356,7 +351,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';
@@ -571,7 +565,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';
@@ -628,7 +621,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';

View File

@@ -4,7 +4,6 @@
* Core script for import, this is just the glue around all other stuff
*
* @uses PMA_Bookmark_getList()
* @version $Id$
* @package phpMyAdmin
*/
@@ -13,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;

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
*
* @version $Id$
* @package phpMyAdmin
*/

View File

@@ -3,8 +3,6 @@
/**
* forms frameset
*
* @version $Id$
* @uses __('phpMyAdmin is more friendly with a <b>frames-capable</b> browser.')
* @uses $GLOBALS['cfg']['QueryHistoryDB']
* @uses $GLOBALS['cfg']['Server']['user']
* @uses $GLOBALS['cfg']['DefaultTabServer'] as src for the mainframe

View File

@@ -1725,5 +1725,13 @@ $(document).ready(function(){
insertQuery(evt.target.id);
return false;
});
$('#sqlquery').focus();
if ($('#input_username')) {
if ($('#input_username').val() == '') {
$('#input_username').focus();
} else {
$('#input_password').focus();
}
}
});

View File

@@ -3,7 +3,6 @@
/**
*
*
* @version $Id$
* @package phpMyAdmin
*/
@@ -1171,7 +1170,6 @@ class PMA_Config
* @uses $GLOBALS['PMA_Config']
* @uses PMA_Config::get()
* @uses PMA_Config::_getFontsizeOptions()
* @uses __('Font size')
* @static
* @param string $current_size currently slected font size with unit
* @return string html selectbox
@@ -1208,7 +1206,6 @@ class PMA_Config
*
* @uses PMA_generate_common_hidden_inputs()
* @uses PMA_Config::_getFontsizeSelection()
* @uses __('Go')
* @static
* @param string $current_size currently slected font size with unit
* @return string html selectbox

View File

@@ -3,7 +3,6 @@
/**
* Holds class PMA_Error
*
* @version $Id$
* @package phpMyAdmin
*/

View File

@@ -3,7 +3,6 @@
/**
* Holds class PMA_Error_Handler
*
* @version $Id$
* @package phpMyAdmin
*/

View File

@@ -3,7 +3,6 @@
/**
* file upload functions
*
* @version $Id$
* @package phpMyAdmin
*/
@@ -259,13 +258,6 @@ class PMA_File
* @uses PMA_File::setRecentBLOBReference()
* @uses curl_setopt_array()
* @uses PMA_File::$_error_message
* @uses __('The uploaded file exceeds the upload_max_filesize directive in php.ini.')
* @uses __('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.')
* @uses __('The uploaded file was only partially uploaded.')
* @uses __('Missing a temporary folder.')
* @uses __('Failed to write file to disk.')
* @uses __('File upload stopped by extension.')
* @uses __('Unknown error in file upload.')
* @uses $_FILES
* @param string $key a numeric key used to identify the different rows
* @param string $primary_key
@@ -287,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
@@ -495,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]);
@@ -641,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'))
{
@@ -702,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]);
@@ -832,7 +550,6 @@ class PMA_File
/**
*
* @access public
* @uses __('File could not be read')
* @uses PMA_File::setName()
* @uses PMA_securePath()
* @uses PMA_userDir()
@@ -881,7 +598,6 @@ class PMA_File
* @todo move check of $cfg['TempDir'] into PMA_Config?
* @access public
* @uses $cfg['TempDir']
* @uses __('Error moving the uploaded file, see [a@./Documentation.html#faq1_11@Documentation]FAQ 1.11[/a]')
* @uses PMA_File::isReadable()
* @uses PMA_File::getName()
* @uses PMA_File::setName()
@@ -937,7 +653,6 @@ class PMA_File
*
* @todo move file read part into readChunk() or getChunk()
* @todo add support for compression plugins
* @uses __('File could not be read')
* @uses PMA_File::$_compression to set it
* @uses PMA_File::getName()
* @uses fopen()

View File

@@ -3,7 +3,6 @@
/**
* holds the database index class
*
* @version $Id$
* @package phpMyAdmin
*/
@@ -539,7 +538,6 @@ class PMA_Index
/**
* Function to check over array of indexes and look for common problems
*
* @uses __('The indexes %1 and %2 seem to be equal and one of them could possibly be removed.')
* @uses is_string()
* @uses is_array()
* @uses count()

View File

@@ -3,7 +3,6 @@
/**
* hold the PMA_List base class
*
* @version $Id$
* @package phpMyAdmin
*/

View File

@@ -3,7 +3,6 @@
/**
* holds the PMA_List_Database class
*
* @version $Id$
* @package phpMyAdmin
*/

View File

@@ -3,7 +3,6 @@
/**
* Holds class PMA_Message
*
* @version $Id$
* @package phpMyAdmin
*/

View File

@@ -3,7 +3,6 @@
/**
* Library for extracting information about the partitions
*
* @version $Id$
* @package phpMyAdmin
*/

View File

@@ -3,7 +3,6 @@
/**
* Library for extracting information about the available storage engines
*
* @version $Id$
* @package phpMyAdmin
*/
@@ -92,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']) . '"')
@@ -145,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]);
}
@@ -155,7 +152,6 @@ class PMA_StorageEngine
* @uses PMA_ENGINE_DETAILS_TYPE_SIZE
* @uses PMA_ENGINE_DETAILS_TYPE_NUMERIC
* @uses PMA_StorageEngine::getVariablesStatus()
* @uses __('There is no detailed status information available for this storage engine.')
* @uses PMA_showHint()
* @uses PMA_formatByteDown()
* @uses PMA_formatNumber()
@@ -267,6 +263,8 @@ class PMA_StorageEngine
return $mysql_vars;
}
function engine_init() {}
/**
* Constructor
*
@@ -305,6 +303,8 @@ class PMA_StorageEngine
default:
$this->support = PMA_ENGINE_SUPPORT_NO;
}
} else {
$this->engine_init();
}
}
@@ -335,11 +335,6 @@ class PMA_StorageEngine
/**
* public String getSupportInformationMessage()
*
* @uses __('%s is the default storage engine on this MySQL server.')
* @uses __('%s is available on this MySQL server.')
* @uses __('%s has been disabled for this MySQL server.')
* @uses __('This MySQL server does not support the %s storage engine.')
* @uses __('This MySQL server does not support the %s storage engine.')
* @uses PMA_ENGINE_SUPPORT_DEFAULT
* @uses PMA_ENGINE_SUPPORT_YES
* @uses PMA_ENGINE_SUPPORT_DISABLED

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
*
* @version $Id$
* @package phpMyAdmin
*/

View File

@@ -3,7 +3,6 @@
/**
* hold PMA_Theme class
*
* @version $Id$
* @package phpMyAdmin
*/
@@ -145,7 +144,6 @@ class PMA_Theme {
* @uses PMA_Theme::setImgPath()
* @uses PMA_Theme::getName()
* @uses $GLOBALS['cfg']['ThemePath']
* @uses __('No valid image path for theme %s found!')
* @uses is_dir()
* @uses sprintf()
*/
@@ -357,8 +355,6 @@ class PMA_Theme {
* @uses PMA_Theme::getVersion()
* @uses PMA_Theme::getId()
* @uses PMA_Theme::getPath()
* @uses __('No preview available.')
* @uses __('take it')
* @uses PMA_generate_common_url()
* @uses addslashes()
* @uses file_exists()

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
*
* @version $Id$
* @package phpMyAdmin
*/

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
*
* @version $Id$
* @package phpMyAdmin
*/

View File

@@ -4,7 +4,6 @@
* Set of functions used to run config authentication (ie no authentication).
*
* @package phpMyAdmin-Auth-Config
* @version $Id$
*/

View File

@@ -4,7 +4,6 @@
* Set of functions used to run cookie based authentication.
*
* @package phpMyAdmin-Auth-Cookie
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
@@ -115,17 +114,6 @@ function PMA_get_blowfish_secret() {
* @uses $GLOBALS['target']
* @uses $GLOBALS['db']
* @uses $GLOBALS['table']
* @uses __('Welcome to %s')
* @uses __('The configuration file now needs a secret passphrase (blowfish_secret).')
* @uses __('Error')
* @uses __('Log in')
* @uses __('Server:')
* @uses __('Username:')
* @uses __('Password:')
* @uses __('Server Choice')
* @uses __('Go')
* @uses __('Cookies must be enabled past this point.')
* @uses __('phpMyAdmin documentation')
* @uses $GLOBALS['pmaThemeImage']
* @uses $cfg['Servers']
* @uses $cfg['LoginCookieRecall']
@@ -184,14 +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>
<script type="text/javascript">
//<![CDATA[
// show login form in top frame
if (top != self) {
window.top.location.href=location;
<?php
if ( false === $GLOBALS['cfg']['AllowThirdPartyFraming']) {
?>
<script src="./js/cross_framing_protection.js" type="text/javascript"></script>
<?php
}
//]]>
</script>
?>
<script src="./js/functions.js" type="text/javascript"></script>
</head>
<body class="loginform">
@@ -324,22 +312,6 @@ if (top != self) {
}
?>
</div>
<script type="text/javascript">
// <![CDATA[
function PMA_focusInput()
{
var input_username = document.getElementById('input_username');
var input_password = document.getElementById('input_password');
if (input_username.value == '') {
input_username.focus();
} else {
input_password.focus();
}
}
window.setTimeout('PMA_focusInput()', 500);
// ]]>
</script>
<?php
if (file_exists(CUSTOM_FOOTER_FILE)) {
require CUSTOM_FOOTER_FILE;
@@ -644,9 +616,6 @@ function PMA_auth_set_user()
*
* @uses $GLOBALS['server']
* @uses $GLOBALS['allowDeny_forbidden']
* @uses __('Access denied')
* @uses __('No activity within %s seconds; please log in again')
* @uses __('Cannot log in to the MySQL server')
* @uses $GLOBALS['no_activity']
* @uses $cfg['LoginCookieValidity']
* @uses $GLOBALS['PMA_Config']->removeCookie()

View File

@@ -5,7 +5,6 @@
* NOTE: Requires PHP loaded as a Apache module.
*
* @package phpMyAdmin-Auth-HTTP
* @version $Id$
*/

View File

@@ -4,7 +4,6 @@
* Set of functions used to run single signon authentication.
*
* @package phpMyAdmin-Auth-Signon
* @version $Id$
*/

View File

@@ -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,37 @@ 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')) {
PMA_cacheSet('skip_blobstreaming', true, true);
return FALSE;
}
}
// 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 +164,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 +222,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,138 +235,265 @@ 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);
// generate bs reference link
$pbms_host = $PMA_Config->get('BLOBSTREAMING_HOST');
$pbms_port = $PMA_Config->get('BLOBSTREAMING_PORT');
// get last known error (if applicable)
PMA_DBI_getError();
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);
}
// return success of query execution
if ($result && 0 == $GLOBALS['errno'])
return TRUE;
else
if ($ok == FALSE) {
if ($quiet == FALSE) {
PMA_BS_ReportPBMSError("PBMS Connection failed: pbms_connect($pbms_host, $pbms_port, $db_name)");
}
return FALSE;
}
return TRUE;
}
/**
* gets the SQL table definition for a given BLOBStreaming table
*
* @access public
* @param string - table name
* @uses PMA_Config::get()
* @return string - SQL table definition
*/
function PMA_BS_GetTableStruct($tbl_name)
//------------
function PMA_do_disconnect()
{
// retrieve table structures for BS tables
$bs_tables = $GLOBALS['PMA_Config']->get('BLOBSTREAMING_TABLES');
// return if tables don't exist
if (!$bs_tables)
return;
// return if specified table doesn't exist in collection of BS tables
if (!isset($bs_tables[$tbl_name]))
return;
// return specified table's structure
return $bs_tables[$tbl_name]['struct'];
pbms_close();
}
//------------
/**
* creates the BLOBStreaming tables for a given database
* checks whether the BLOB reference looks valid
*
* @access public
* @param string - database name
* @uses PMA_Config::get()
* @uses PMA_DBI_select_db()
* @uses PMA_DBI_query()
* @uses PMA_BS_GetTableStruct()
* @return boolean - success/failure of transactional query execution
*/
function PMA_BS_CreateTables($db_name)
function PMA_BS_IsPBMSReference($bs_reference, $db_name)
{
// retrieve BS tables
$bs_tables = $GLOBALS['PMA_Config']->get('BLOBSTREAMING_TABLES');
// select specified database
PMA_DBI_select_db($db_name);
// create necessary BS tables for specified database
foreach ($bs_tables as $table_key=>$table)
{
$result = PMA_DBI_query(PMA_BS_GetTableStruct($table_key));
// return false if query execution fails
if (!$result)
if (PMA_cacheGet('skip_blobstreaming', true)) {
return FALSE;
}
// return true on success
return TRUE;
// You do not really need a connection to the PBMS Daemon
// to check if a reference looks valid.
$ok = pbms_is_blob_reference($bs_reference);
return $ok ;
}
/**
* drops BLOBStreaming tables for a given database
*
* @access public
* @param string - database name
* @uses PMA_Config::get()
* @uses PMA_DBI_select_db()
* @uses PMA_backquote()
* @uses PMA_DBI_query()
* @return boolean - success/failure of transactional query execution
*/
function PMA_BS_DropTables($db_name)
//------------
function PMA_BS_CreateReferenceLink($bs_reference, $db_name)
{
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("'$content_type' 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) {
// no content specified
case NULL:
$output = "NULL";
break;
// image content
case 'image/jpeg':
case 'image/png':
$output .= ' (<a href="' . $bs_url . '" target="new">' . __('View image') . '</a>)';
break;
// audio content
case 'audio/mpeg':
$output .= ' (<a href="#" onclick="popupBSMedia(\'' . PMA_generate_common_url() . '\',\'' . urlencode($bs_reference) . '\', \'' . urlencode($content_type) . '\',' . ($is_custom_type ? 1 : 0) . ', 640, 120)">' . __('Play audio'). '</a>)';
break;
// video content
case 'application/x-flash-video':
case 'video/mpeg':
$output .= ' (<a href="#" onclick="popupBSMedia(\'' . PMA_generate_common_url() . '\',\'' . urlencode($bs_reference) . '\', \'' . urlencode($content_type) . '\',' . ($is_custom_type ? 1 : 0) . ', 640, 480)">' . __('View video') . '</a>)';
break;
// unsupported content. specify download
default:
$output .= ' (<a href="' . $bs_url . '" target="new">' . __('Download file'). '</a>)';
}
return $output;
}
//------------
// 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))
if (empty($PMA_Config)) {
return FALSE;
}
// retrieve BS tables
$bs_tables = $PMA_Config->get('BLOBSTREAMING_TABLES');
if (! $PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST')) {
return FALSE;
}
// 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);
// 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);
// return false if query execution fails
if (!$result)
$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;
}
// return true on success
if (PMA_do_connect($db_name, FALSE) == FALSE) {
return FALSE;
}
$fh = fopen($file_name, 'r');
if (! $fh) {
PMA_do_disconnect();
PMA_showMessage("Could not open file: $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() Failed");
}
fclose($fh);
PMA_do_disconnect();
return $pbms_blob_url;
}
//------------
function PMA_BS_SetContentType($db_name, $bsTable, $blobReference, $contentType)
{
if (PMA_cacheGet('skip_blobstreaming', true)) {
return FALSE;
}
// This is a really ugly way to do this but currently there is nothing better.
// In a future version of PBMS the system tables will be redesigned to make this
// more eficient.
$query = "SELECT Repository_id, Repo_blob_offset FROM pbms_reference WHERE Blob_url='" . PMA_sqlAddslashes($blobReference) . "'";
//error_log(" PMA_BS_SetContentType: $query\n", 3, "/tmp/mylog");
$result = PMA_DBI_query($query);
//error_log(" $query\n", 3, "/tmp/mylog");
// if record exists
if ($data = PMA_DBI_fetch_assoc($result)) {
$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;
}
/**
* returns the field name for a primary key of a given table in a given database
*
@@ -547,13 +508,6 @@ function PMA_BS_DropTables($db_name)
*/
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);
@@ -562,152 +516,12 @@ function PMA_BS_GetPrimaryField($db_name, $tbl_name)
$result = PMA_DBI_query($query);
// while there are records to parse
while ($data = PMA_DBI_fetch_assoc($result))
if ("PRI" == $data['Key'])
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;
// 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;
}
else
$content_type = $data['Content_type'];
if (!$content_type)
$content_type = NULL;
$output = "<a href=\"#\" onclick=\"requestMIMETypeChange('" . urlencode($db_name) . "', '" . urlencode($GLOBALS['table']) . "', '" . urlencode($bs_reference) . "', '" . urlencode($content_type) . "')\">$content_type</a>";
// specify custom HTML for various content types
switch ($content_type)
{
// no content specified
case NULL:
$output = "NULL";
break;
// image content
case 'image/jpeg':
case 'image/png':
$output .= ' (<a href="' . $bs_ref_link . '" target="new">' . __('View image') . '</a>)';
break;
// audio content
case 'audio/mpeg':
$output .= ' (<a href="#" onclick="popupBSMedia(\'' . PMA_generate_common_url() . '\',\'' . urlencode($bs_reference) . '\', \'' . urlencode($content_type) . '\',' . ($is_custom_type ? 1 : 0) . ', 640, 120)">' . __('Play audio'). '</a>)';
break;
// video content
case 'application/x-flash-video':
case 'video/mpeg':
$output .= ' (<a href="#" onclick="popupBSMedia(\'' . PMA_generate_common_url() . '\',\'' . urlencode($bs_reference) . '\', \'' . urlencode($content_type) . '\',' . ($is_custom_type ? 1 : 0) . ', 640, 480)">' . __('View video') . '</a>)';
break;
// unsupported content. specify download
default:
$output .= ' (<a href="' . $bs_ref_link . '" target="new">' . __('Download file'). '</a>)';
}
// return HTML
return $output;
} // end if ($data = @PMA_DBI_fetch_assoc($result))
// return on error
return 'Error';
}
?>

View File

@@ -11,7 +11,6 @@
* See the enclosed file COPYING for license information (LGPL). If you
* did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
*
* @version $Id$
* @since Horde 2.2
* @package horde.cipher
*/

View File

@@ -3,7 +3,6 @@
/**
* Set of functions used with the bookmark feature
*
* @version $Id$
* @package phpMyAdmin
*/

View File

@@ -3,7 +3,6 @@
/**
* Charset conversion functions.
*
* @version $Id$
* @package phpMyAdmin
*/
if (! defined('PHPMYADMIN')) {
@@ -84,49 +83,4 @@ function PMA_convert_string($src_charset, $dest_charset, $what) {
}
} // end of the "PMA_convert_string()" function
/**
* Converts encoding of file according to parameters with detected
* conversion function. The old file will be unlinked and new created and
* its file name is returned.
*
* @param string source charset
* @param string target charset
* @param string file to convert
*
* @return string new temporay file
*
* @access public
*
*/
function PMA_convert_file($src_charset, $dest_charset, $file) {
switch ($GLOBALS['PMA_recoding_engine']) {
case PMA_CHARSET_RECODE:
case PMA_CHARSET_ICONV:
$tmpfname = tempnam('', 'PMA_convert_file');
$fin = fopen($file, 'r');
$fout = fopen($tmpfname, 'w');
if ($GLOBALS['PMA_recoding_engine'] == PMA_CHARSET_RECODE) {
recode_file($src_charset . '..' . $dest_charset, $fin, $fout);
} else {
while (!feof($fin)) {
$line = fgets($fin, 4096);
if ($GLOBALS['PMA_recoding_engine'] == PMA_CHARSET_ICONV) {
$dist = iconv($src_charset, $dest_charset . $GLOBALS['cfg']['IconvExtraParams'], $line);
} elseif ($GLOBALS['PMA_recoding_engine'] == PMA_CHARSET_ICONV_AIX) {
$dist = PMA_aix_iconv_wrapper($src_charset, $dest_charset . $GLOBALS['cfg']['IconvExtraParams'], $line);
}
fputs($fout, $dist);
} // end while
}
fclose($fin);
fclose($fout);
unlink($file);
return $tmpfname;
default:
return $file;
}
} // end of the "PMA_convert_file()" function
?>

View File

@@ -3,7 +3,6 @@
/**
* Get user's global privileges and some db-specific privileges
*
* @version $Id$
* @package phpMyAdmin
*/
if (! defined('PHPMYADMIN')) {

View File

@@ -3,7 +3,6 @@
/**
* Functions for cleanup of user input.
*
* @version $Id$
* @package phpMyAdmin
*/

View File

@@ -28,7 +28,6 @@
* - db connection
* - authentication work
*
* @version $Id$
* @package phpMyAdmin
*/
@@ -810,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 {
@@ -954,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')
// load user preferences

View File

@@ -3,7 +3,6 @@
/**
* Misc functions used all over the scripts.
*
* @version $Id$
* @package phpMyAdmin
*/
@@ -130,7 +129,6 @@ function PMA_getIcon($icon, $alternate = '', $container = false, $force_text = f
/**
* Displays the maximum size for an upload
*
* @uses __('Max: %s%s')
* @uses PMA_formatByteDown()
* @uses sprintf()
* @param integer the size
@@ -346,7 +344,6 @@ function PMA_formatSql($parsed_sql, $unparsed_sql = '')
* @uses $cfg['MySQLManualType']
* @uses $cfg['MySQLManualBase']
* @uses $cfg['ReplaceHelpImg']
* @uses __('Documentation')
* @uses $GLOBALS['pmaThemeImage']
* @uses PMA_MYSQL_INT_VERSION
* @uses strtolower()
@@ -501,11 +498,7 @@ function PMA_showHint($message, $bbcode = false, $type = 'notice')
* @uses footer.inc.php
* @uses header.inc.php
* @uses $GLOBALS['sql_query']
* @uses __('Error')
* @uses __('SQL query')
* @uses $GLOBALS['pmaThemeImage']
* @uses __('Edit')
* @uses __('MySQL said: ')
* @uses $GLOBALS['cfg']['PropertiesIconic']
* @uses $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']
* @uses PMA_backquote()
@@ -798,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']) {
@@ -1137,7 +1123,11 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view
if (! empty($GLOBALS['show_as_php'])) {
$query_base = '$sql = "' . $query_base;
} elseif (! empty($GLOBALS['validatequery'])) {
try {
$query_base = PMA_validateSQL($query_base);
} catch (Exception $e) {
PMA_Message::error(__('Failed to connect to SQL validator!'))->display();
}
} elseif (isset($parsed_sql)) {
$query_base = PMA_formatSql($parsed_sql, $query_base);
}
@@ -1253,7 +1243,11 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view
$validate_link = '';
} //validator
if (!empty($GLOBALS['validatequery'])) {
echo '<div class="sqlvalidate">';
} else {
echo '<code class="sql">';
}
if ($query_too_big) {
echo $shortened_query_base;
} else {
@@ -1264,7 +1258,11 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view
if (! empty($GLOBALS['show_as_php'])) {
echo '";';
}
if (!empty($GLOBALS['validatequery'])) {
echo '</div>';
} else {
echo '</code>';
}
echo '<div class="tools">';
// avoid displaying a Profiling checkbox that could
@@ -1272,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=\"" .
@@ -1614,8 +1623,6 @@ function PMA_localisedDate($timestamp = -1, $format = '')
* If the variables $link and $args ar left empty, an inactive tab is created
*
* @uses $GLOBALS['PMA_PHP_SELF']
* @uses __('Empty')
* @uses __('Drop')
* @uses $GLOBALS['active_page']
* @uses $GLOBALS['url_query']
* @uses $cfg['MainPageIconic']
@@ -1882,7 +1889,6 @@ function PMA_linkOrButton($url, $message, $tag_params = array(),
/**
* Returns a given timespan value in a readable format.
*
* @uses __('%s days, %s hours, %s minutes and %s seconds')
* @uses sprintf()
* @uses floor()
* @param int the timespan
@@ -2191,7 +2197,6 @@ function PMA_buttonOrImage($button_name, $button_class, $image_name, $text,
* Generate a pagination selector for browsing resultsets
*
* @todo $url is not javascript escaped!?
* @uses __('Page number:')
* @uses range()
* @param string URL for the JavaScript
* @param string Number of rows in the pagination set
@@ -2295,7 +2300,6 @@ function PMA_pageselector($url, $rows, $pageNow = 1, $nbTotalPage = 1,
* Generate navigation for a list
*
* @todo use $pos from $_url_params
* @uses __('Page number:')
* @uses range()
* @param integer number of elements in the list
* @param integer current position in the list
@@ -2406,7 +2410,6 @@ function PMA_userDir($dir)
*
* @uses $cfg['DefaultTabDatabase']
* @uses $GLOBALS['db']
* @uses __('Jump to database &quot;%s&quot;.')
* @uses PMA_generate_common_url()
* @uses PMA_unescape_mysql_wildcards()
* @uses strlen()
@@ -2436,7 +2439,6 @@ function PMA_getDbLink($database = null)
* that affects a functionality
*
* @uses PMA_MYSQL_INT_VERSION
* @uses __('The %s functionality is affected by a known bug, see %s')
* @uses PMA_showHint()
* @uses sprintf()
* @param string $functionality localized message explaining the func.
@@ -2841,19 +2843,54 @@ $mapping = array(
return $mapping[$target];
}
function PMA_js($code, $print=true)
{
// these generated newlines are needed
$out = '';
$out .= '<script type="text/javascript">'."\n";
$out .= "\n" . '// <![CDATA[' . "\n";
$out .= $code;
$out .= "\n" . '// ]]>' . "\n";
$out .= '</script>'."\n";
/**
* Formats user string, expading @VARIABLES@, accepting strftime format string.
*
* @param string Text where to do expansion.
* @param function Function to call for escaping variable values.
* @param array Array with overrides for default parameters (obtained from GLOBALS).
*/
function PMA_expandUserString($string, $escape = NULL, $updates = array()) {
/* Content */
$vars['http_host'] = PMA_getenv('HTTP_HOST') ? PMA_getenv('HTTP_HOST') : '';
$vars['server_name'] = $GLOBALS['cfg']['Server']['host'];
$vars['server_verbose'] = $GLOBALS['cfg']['Server']['verbose'];
$vars['server_verbose_or_name'] = !empty($GLOBALS['cfg']['Server']['verbose']) ? $GLOBALS['cfg']['Server']['verbose'] : $GLOBALS['cfg']['Server']['host'];
$vars['database'] = $GLOBALS['db'];
$vars['table'] = $GLOBALS['table'];
$vars['phpmyadmin_version'] = 'phpMyAdmin ' . PMA_VERSION;
if ($print)
echo $out;
/* Update forced variables */
foreach($updates as $key => $val) {
$vars[$key] = $val;
}
return $out;
/* Replacement mapping */
/*
* The __VAR__ ones are for backward compatibility, because user
* might still have it in cookies.
*/
$replace = array(
'@HTTP_HOST@' => $vars['http_host'],
'@SERVER@' => $vars['server_name'],
'__SERVER__' => $vars['server_name'],
'@VERBOSE@' => $vars['server_verbose'],
'@VSERVER@' => $vars['server_verbose_or_name'],
'@DATABASE@' => $vars['database'],
'__DB__' => $vars['database'],
'@TABLE@' => $vars['table'],
'__TABLE__' => $vars['table'],
'@PHPMYADMIN@' => $vars['phpmyadmin_version'],
);
/* Optional escaping */
if (!is_null($escape)) {
foreach($replace as $key => $val) {
$replace[$key] = $escape($val);
}
}
/* Do the replacement */
return str_replace(array_keys($replace), array_values($replace), strftime($string));
}
?>

View File

@@ -16,7 +16,6 @@
*
* All directives are explained in Documentation.html
*
* @version $Id$
* @package phpMyAdmin
*/
@@ -138,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)
*
@@ -1126,21 +1119,21 @@ $cfg['Export']['remember_file_template'] = true;
*
* @global string $cfg['Export']['file_template_table']
*/
$cfg['Export']['file_template_table'] = '__TABLE__';
$cfg['Export']['file_template_table'] = '@TABLE@';
/**
*
*
* @global string $cfg['Export']['file_template_database']
*/
$cfg['Export']['file_template_database'] = '__DB__';
$cfg['Export']['file_template_database'] = '@DB@';
/**
*
*
* @global string $cfg['Export']['file_template_server']
*/
$cfg['Export']['file_template_server'] = '__SERVER__';
$cfg['Export']['file_template_server'] = '@SERVER@';
/**
*
@@ -1462,14 +1455,14 @@ $cfg['Export']['latex_data_continued_caption'] = 'strLatexContent strLatexContin
*
* @global string $cfg['Export']['latex_data_label']
*/
$cfg['Export']['latex_data_label'] = 'tab:__TABLE__-data';
$cfg['Export']['latex_data_label'] = 'tab:@TABLE@-data';
/**
*
*
* @global string $cfg['Export']['latex_structure_label']
*/
$cfg['Export']['latex_structure_label'] = 'tab:__TABLE__-structure';
$cfg['Export']['latex_structure_label'] = 'tab:@TABLE@-structure';
/**
*
@@ -2331,14 +2324,6 @@ $cfg['disable'] = array(
'ShowPhpInfo' => false,
'ShowChgPassword' => false);
//-----------------------------------------------------------------------------
// custom-setup by mkkeck: 2004-05-04
// some specials for new icons and scrolling
/**
* @todo We need to rearrange these variables.
*/
/*******************************************************************************
* Window title settings
*/

View File

@@ -5,7 +5,6 @@
* This script is distinct from libraries/common.inc.php because this
* script is called from /test.
*
* @version $Id$
* @package phpMyAdmin
*/
@@ -202,7 +201,6 @@ function PMA_securePath($path)
* @todo use detected argument separator (PMA_Config)
* @uses $GLOBALS['session_name']
* @uses $GLOBALS['text_dir']
* @uses __('Error')
* @uses $GLOBALS['available_languages']
* @uses $GLOBALS['lang']
* @uses $GLOBALS['PMA_Config']->removeCookie()
@@ -281,7 +279,8 @@ function PMA_fatalError($error_message, $message_args = null)
*/
function PMA_warnMissingExtension($extension, $fatal = false, $extra = '')
{
$message = sprintf(__('Cannot load [a@http://php.net/%1$s@Documentation][em]%1$s[/em][/a] extension. Please check your PHP configuration.'), $extension);
$message = sprintf(__('The %s extension is missing. Please check your PHP configuration.'),
sprintf('[a@http://php.net/%1$s@Documentation][em]%1$s[/em][/a]', $extension));
if ($extra != '') {
$message .= ' ' . $extra;
}
@@ -311,31 +310,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 {

View File

@@ -3,7 +3,6 @@
/**
* Common Option Constants For DBI Functions
*
* @version $Id$
* @package phpMyAdmin
*/
if (! defined('PHPMYADMIN')) {

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
*
* @version $Id$
* @package phpMyAdmin
*/
if (! defined('PHPMYADMIN')) {
@@ -66,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';
/**

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
*
* @version $Id$
* @package phpMyAdmin
*/
if (! defined('PHPMYADMIN')) {

View File

@@ -31,7 +31,6 @@
* @uses strnatcasecmp()
* @uses count()
* @uses addslashes()
* @version $Id$
* @package phpMyAdmin
*/
if (! defined('PHPMYADMIN')) {
@@ -59,7 +58,6 @@ $pos = $_SESSION['tmp_user_values']['table_limit_offset'];
* fills given tooltip arrays
*
* @uses $cfg['ShowTooltipAliasTB']
* @uses __('Creation')
* @uses PMA_localisedDate()
* @uses strtotime()
* @param array $tooltip_truename tooltip data

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
*
* @version $Id$
* @package phpMyAdmin
*/
if (! defined('PHPMYADMIN')) {

View File

@@ -12,7 +12,6 @@
* our current sql.php.
* Of course the interface would need a way to pass calling parameters.
* Also, support DEFINER (like we do in export).
* @version $Id$
* @package phpMyAdmin
*/
if (! defined('PHPMYADMIN')) {

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
*
* @version $Id$
* @package phpMyAdmin
*/
if (! defined('PHPMYADMIN')) {
@@ -17,14 +16,6 @@ if (! defined('PHPMYADMIN')) {
* @uses PMA_showHint()
* @uses $GLOBALS['cfg']['PropertiesNumColumns']
* @uses $GLOBALS['is_show_stats']
* @uses __('Table')
* @uses __('Action')
* @uses __('Rows')
* @uses __('May be approximate. See [a@./Documentation.html#faq3_11@Documentation]FAQ 3.11[/a]')
* @uses __('Type')
* @uses __('Collation')
* @uses __('Size')
* @uses __('Overhead')
* @uses $GLOBALS['colspan_for_structure']
* @uses PMA_SortableTableHeader()
* @param boolean $db_is_information_schema

View File

@@ -4,7 +4,6 @@
* Ensure the database and the table exist (else move to the "parent" script)
* and display headers
*
* @version $Id$
* @package phpMyAdmin
*/
if (! defined('PHPMYADMIN')) {

View File

@@ -1,7 +1,6 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* @version $Id$
* @package phpMyAdmin-DBG
*/
if (! defined('PHPMYADMIN')) {
@@ -19,8 +18,8 @@ if ($GLOBALS['cfg']['DBG']['php']) {
* Loads the DBG extension if needed
*/
if (! @extension_loaded('dbg') ) {
$message = PMA_Message::error(__('Cannot load [a@http://php.net/%1$s@Documentation][em]%1$s[/em][/a] extension. Please check your PHP configuration.'));
$message->addParam('DBG');
$message = PMA_Message::error(__('The %s extension is missing. Please check your PHP configuration.'),
$message->addParam(sprintf('[a@http://php.net/%1$s@Documentation][em]%1$s[/em][/a]', 'dbg'));
$message->addMessage('<a href="./Documentation.html#faqdbg" target="documentation">', false);
$message->addString(__('Documentation'));
$message->addMessage('</a>', false);

View File

@@ -4,7 +4,6 @@
* Interface to the classic MySQL extension
*
* @package phpMyAdmin-DBI-MySQL
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
@@ -308,9 +307,6 @@ function PMA_DBI_get_client_info()
* @uses PMA_DBI_convert_message()
* @uses $GLOBALS['errno']
* @uses $GLOBALS['userlink']
* @uses __('The server is not responding')
* @uses __('(or the local MySQL server's socket is not correctly configured)')
* @uses __('Details...')
* @uses mysql_errno()
* @uses mysql_error()
* @uses defined()

View File

@@ -4,7 +4,6 @@
* Interface to the improved MySQL extension (MySQLi)
*
* @package phpMyAdmin-DBI-MySQLi
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
@@ -364,8 +363,6 @@ function PMA_DBI_get_client_info()
* @uses PMA_DBI_convert_message()
* @uses $GLOBALS['errno']
* @uses $GLOBALS['userlink']
* @uses __('The server is not responding')
* @uses __('(or the local MySQL server's socket is not correctly configured)')
* @uses mysqli_errno()
* @uses mysqli_error()
* @uses mysqli_connect_errno()
@@ -491,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] = 'real';
$typeAr[MYSQLI_TYPE_NEWDECIMAL] = 'real';
$typeAr[MYSQLI_TYPE_DECIMAL] = 'decimal';
$typeAr[MYSQLI_TYPE_NEWDECIMAL] = 'decimal';
$typeAr[MYSQLI_TYPE_BIT] = 'int';
$typeAr[MYSQLI_TYPE_TINY] = 'int';
$typeAr[MYSQLI_TYPE_SHORT] = 'int';

View File

@@ -3,7 +3,6 @@
/**
* Displays form for password change
*
* @version $Id$
* @package phpMyAdmin
*/
if (! defined('PHPMYADMIN')) {

View File

@@ -3,7 +3,6 @@
/**
* Displays form for creating database (if user has privileges for that)
*
* @version $Id$
* @package phpMyAdmin
*/
if (! defined('PHPMYADMIN')) {

View File

@@ -22,7 +22,6 @@
* warnings about the lack of privileges for CREATE TABLE. Tested
* on MySQL 5.0.18.
*
* @version $Id$
* @package phpMyAdmin
*/
if (! defined('PHPMYADMIN')) {

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
*
* @version $Id$
* @package phpMyAdmin
*/
if (! defined('PHPMYADMIN')) {
@@ -148,13 +147,13 @@ echo PMA_pluginGetJavascript($export_list);
echo __('File name template');
$trans = new PMA_Message;
$trans->addMessage('__SERVER__/');
$trans->addMessage('@SERVER@/');
$trans->addString(__('server name'));
if ($export_type == 'database' || $export_type == 'table') {
$trans->addMessage('__DB__/');
$trans->addMessage('@DB@/');
$trans->addString(__('database name'));
if ($export_type == 'table') {
$trans->addMessage('__TABLE__/');
$trans->addMessage('@TABLE@/');
$trans->addString(__('table name'));
}
}
@@ -188,6 +187,7 @@ echo PMA_pluginGetJavascript($export_list);
?>
/>
<?php echo PMA_showDocu('faq6_27'); ?>
(
<input type="checkbox" name="remember_template"
id="checkbox_remember_template"

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
*
* @version $Id$
* @package phpMyAdmin
*/

View File

@@ -3,7 +3,6 @@
/**
* Code for displaying language selection
*
* @version $Id$
* @package phpMyAdmin
*/
if (! defined('PHPMYADMIN')) {

View File

@@ -3,7 +3,6 @@
/**
* library for displaying table with results from all sort of select queries
*
* @version $Id$
* @package phpMyAdmin
*/
@@ -1286,47 +1285,8 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
$vertical_display['data'][$row_no][$i] = ' <td align="right"' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '"><i>NULL</i></td>' . "\n";
} else {
// for blobstreaming
$bs_reference_exists = $allBSTablesExist = FALSE;
// load PMA configuration
$PMA_Config = $GLOBALS['PMA_Config'];
// if PMA configuration exists
if ($PMA_Config) {
// load BS variables
$pluginsExist = $PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST');
// if BS plugins exist
if ($pluginsExist) {
// load BS databases
$bs_tables = $PMA_Config->get('BLOBSTREAMABLE_DATABASES');
// if BS db array and specified db string not empty and valid
if (!empty($bs_tables) && strlen($db) > 0) {
$bs_tables = $bs_tables[$db];
if (isset($bs_tables)) {
$allBSTablesExist = TRUE;
// check if BS tables exist for given database
foreach ($bs_tables as $table_key=>$bs_tbl)
if (!$bs_tables[$table_key]['Exists']) {
$allBSTablesExist = FALSE;
break;
}
}
}
}
}
// if necessary BS tables exist
if ($allBSTablesExist) {
$bs_reference_exists = PMA_BS_ReferenceExists($row[$i], $db);
}
// if valid BS reference exists
if ($bs_reference_exists) {
if (PMA_BS_IsPBMSReference($row[$i], $db)) {
$blobtext = PMA_BS_CreateReferenceLink($row[$i], $db);
} else {
$blobtext = PMA_handle_non_printable_contents('BLOB', (isset($row[$i]) ? $row[$i] : ''), $transform_function, $transform_options, $default_function, $meta, $_url_params);
@@ -1380,8 +1340,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 {
@@ -2309,7 +2268,6 @@ function PMA_handle_non_printable_contents($category, $content, $transform_funct
* @uses PMA_DBI_try_query()
* @uses PMA_DBI_num_rows()
* @uses PMA_DBI_fetch_row()
* @uses __('Link not found')
* @uses PMA_DBI_free_result()
* @uses $GLOBALS['printview']
* @uses htmlspecialchars()

View File

@@ -7,7 +7,6 @@
* - reversed the right modify links: 1. drop, 2. edit, 3. checkbox
* - also changes made in js/functions.js
*
* @version $Id$
* @package phpMyAdmin
*/
if (! defined('PHPMYADMIN')) {

View File

@@ -1,7 +1,6 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* @version $Id$
* @package phpMyAdmin-Engines
*/

View File

@@ -1,7 +1,6 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* @version $Id$
* @package phpMyAdmin-Engines
*/

View File

@@ -1,7 +1,6 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* @version $Id$
* @package phpMyAdmin-Engines
*/

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
*
* @version $Id$
* @package phpMyAdmin-Engines
*/

View File

@@ -1,7 +1,6 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* @version $Id$
* @package phpMyAdmin-Engines
*/
@@ -12,13 +11,6 @@
class PMA_StorageEngine_innodb extends PMA_StorageEngine
{
/**
* @uses __('Data home directory')
* @uses __('The common part of the directory path for all InnoDB data files.')
* @uses __('Data files')
* @uses __('Autoextend increment')
* @uses __(' The increment size for extending the size of an autoextending tablespace when it becomes full.')
* @uses __('Buffer pool size')
* @uses __('The size of the memory buffer InnoDB uses to cache data and indexes of its tables.')
* @uses PMA_ENGINE_DETAILS_TYPE_NUMERIC
* @uses PMA_ENGINE_DETAILS_TYPE_SIZE
* @return array
@@ -131,8 +123,6 @@ class PMA_StorageEngine_innodb extends PMA_StorageEngine
/**
* @uses $this->support
* @uses PMA_ENGINE_SUPPORT_YES
* @uses __('Buffer Pool')
* @uses __('InnoDB Status')
* @return array detail pages
*/
function getInfoPages()
@@ -152,22 +142,6 @@ class PMA_StorageEngine_innodb extends PMA_StorageEngine
* @uses PMA_DBI_fetch_result()
* @uses PMA_formatNumber()
* @uses PMA_formatByteDown()
* @uses __('Buffer Pool Usage')
* @uses __('Total')
* @uses __('pages')
* @uses __('Free pages')
* @uses __('Dirty pages')
* @uses __('Pages containing data')
* @uses __('Pages to be flushed')
* @uses __('Busy pages')
* @uses __('Latched pages')
* @uses __('Buffer Pool Activity')
* @uses __('Read requests')
* @uses __('Write requests')
* @uses __('Read misses')
* @uses __('Write waits')
* @uses __('Read misses in %')
* @uses __('Write waits in %')
* @uses join()
* @uses htmlspecialchars()
* @uses PMA_formatNumber()

View File

@@ -1,7 +1,6 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* @version $Id$
* @package phpMyAdmin-Engines
*/

View File

@@ -1,7 +1,6 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* @version $Id$
* @package phpMyAdmin-Engines
*/

View File

@@ -1,7 +1,6 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* @version $Id$
* @package phpMyAdmin-Engines
*/

View File

@@ -1,7 +1,6 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* @version $Id$
* @package phpMyAdmin-Engines
*/

View File

@@ -1,7 +1,6 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* @version $Id$
* @package phpMyAdmin-Engines
*/

View 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;
}
}
?>

View File

@@ -1,7 +1,6 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* @version $Id$
* @package phpMyAdmin-Engines
*/
@@ -99,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;
}
}
?>

View File

@@ -4,7 +4,6 @@
* Set of functions used to build NHibernate dumps of tables
*
* @package phpMyAdmin-Export-Codegen
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* @package phpMyAdmin-Export-CSV
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;

View File

@@ -4,7 +4,6 @@
* Set of functions used to build CSV dumps of tables
*
* @package phpMyAdmin-Export-CSV
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;

View File

@@ -4,7 +4,6 @@
* Set of functions used to build CSV dumps of tables
*
* @package phpMyAdmin-Export-HTMLWord
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;

View File

@@ -4,12 +4,16 @@
* Set of functions used to build dumps of tables
*
* @package phpMyAdmin-Export-Latex
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/* Messages used in default captions */
$GLOBALS['strLatexContent'] = __('Content of table @TABLE@');
$GLOBALS['strLatexContinued'] = __('(continued)');
$GLOBALS['strLatexStructure'] = __('Structure of table @TABLE@');
/**
*
*/
@@ -32,11 +36,11 @@ if (isset($plugin_list)) {
$plugin_list['latex']['options'][] =
array('type' => 'bgroup', 'name' => 'structure', 'text' => __('Structure'), 'force' => 'data');
$plugin_list['latex']['options'][] =
array('type' => 'text', 'name' => 'structure_caption', 'text' => __('Table caption'));
array('type' => 'text', 'name' => 'structure_caption', 'text' => __('Table caption'), 'doc' => 'faq6_27');
$plugin_list['latex']['options'][] =
array('type' => 'text', 'name' => 'structure_continued_caption', 'text' => __('Continued table caption'));
array('type' => 'text', 'name' => 'structure_continued_caption', 'text' => __('Continued table caption'), 'doc' => 'faq6_27');
$plugin_list['latex']['options'][] =
array('type' => 'text', 'name' => 'structure_label', 'text' => __('Label key'));
array('type' => 'text', 'name' => 'structure_label', 'text' => __('Label key'), 'doc' => 'faq6_27');
if (!empty($GLOBALS['cfgRelation']['relation'])) {
$plugin_list['latex']['options'][] =
array('type' => 'bool', 'name' => 'relation', 'text' => __('Relations'));
@@ -56,11 +60,11 @@ if (isset($plugin_list)) {
$plugin_list['latex']['options'][] =
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row'));
$plugin_list['latex']['options'][] =
array('type' => 'text', 'name' => 'data_caption', 'text' => __('Table caption'));
array('type' => 'text', 'name' => 'data_caption', 'text' => __('Table caption'), 'doc' => 'faq6_27');
$plugin_list['latex']['options'][] =
array('type' => 'text', 'name' => 'data_continued_caption', 'text' => __('Continued table caption'));
array('type' => 'text', 'name' => 'data_continued_caption', 'text' => __('Continued table caption'), 'doc' => 'faq6_27');
$plugin_list['latex']['options'][] =
array('type' => 'text', 'name' => 'data_label', 'text' => __('Label key'));
array('type' => 'text', 'name' => 'data_label', 'text' => __('Label key'), 'doc' => 'faq6_27');
$plugin_list['latex']['options'][] =
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by'));
$plugin_list['latex']['options'][] =
@@ -208,8 +212,8 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
$buffer .= ' \\hline \\endhead \\hline \\endfoot \\hline ' . $crlf;
if (isset($GLOBALS['latex_caption'])) {
$buffer .= ' \\caption{' . str_replace('__TABLE__', PMA_texEscape($table), $GLOBALS['latex_data_caption'])
. '} \\label{' . str_replace('__TABLE__', $table, $GLOBALS['latex_data_label']) . '} \\\\';
$buffer .= ' \\caption{' . PMA_expandUserString($GLOBALS['latex_data_caption'], 'PMA_texEscape', array('table' => $table, 'database' => $db))
. '} \\label{' . PMA_expandUserString($GLOBALS['latex_data_label'], NULL, array('table' => $table, 'database' => $db)) . '} \\\\';
}
if (!PMA_exportOutputHandler($buffer)) {
return FALSE;
@@ -227,7 +231,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
return FALSE;
}
if (isset($GLOBALS['latex_caption'])) {
if (!PMA_exportOutputHandler('\\caption{' . str_replace('__TABLE__', PMA_texEscape($table), $GLOBALS['latex_data_continued_caption']) . '} \\\\ ')) return FALSE;
if (!PMA_exportOutputHandler('\\caption{' . PMA_expandUserString($GLOBALS['latex_data_continued_caption'], 'PMA_texEscape', array('table' => $table, 'database' => $db)) . '} \\\\ ')) return FALSE;
}
if (!PMA_exportOutputHandler($buffer . '\\endhead \\endfoot' . $crlf)) {
return FALSE;
@@ -374,14 +378,14 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
// Table caption for first page and label
if (isset($GLOBALS['latex_caption'])) {
$buffer .= ' \\caption{'. str_replace('__TABLE__', PMA_texEscape($table), $GLOBALS['latex_structure_caption'])
. '} \\label{' . str_replace('__TABLE__', $table, $GLOBALS['latex_structure_label'])
$buffer .= ' \\caption{'. PMA_expandUserString($GLOBALS['latex_structure_caption'], 'PMA_texEscape', array('table' => $table, 'database' => $db))
. '} \\label{' . PMA_expandUserString($GLOBALS['latex_structure_label'], NULL, array('table' => $table, 'database' => $db))
. '} \\\\' . $crlf;
}
$buffer .= $header . ' \\\\ \\hline \\hline' . $crlf . '\\endfirsthead' . $crlf;
// Table caption on next pages
if (isset($GLOBALS['latex_caption'])) {
$buffer .= ' \\caption{'. str_replace('__TABLE__', PMA_texEscape($table), $GLOBALS['latex_structure_continued_caption'])
$buffer .= ' \\caption{'. PMA_expandUserString($GLOBALS['latex_structure_continued_caption'], 'PMA_texEscape', array('table' => $table, 'database' => $db))
. '} \\\\ ' . $crlf;
}
$buffer .= $header . ' \\\\ \\hline \\hline \\endhead \\endfoot ' . $crlf;

View File

@@ -4,7 +4,6 @@
* Set of functions used to build OpenDocument Spreadsheet dumps of tables
*
* @package phpMyAdmin-Export-ODS
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;

View File

@@ -4,7 +4,6 @@
* Set of functions used to build OpenDocument Text dumps of tables
*
* @package phpMyAdmin-Export-ODT
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;

View File

@@ -4,7 +4,6 @@
* Produce a PDF report (export) from a query
*
* @package phpMyAdmin-Export-PDF
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;

View File

@@ -4,7 +4,6 @@
* Set of functions used to build SQL dumps of tables
*
* @package phpMyAdmin-Export-SQL
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;

View File

@@ -4,7 +4,6 @@
*
*
* @package phpMyAdmin-Export-XLS
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;

View File

@@ -4,7 +4,6 @@
*
*
* @package phpMyAdmin-Export-XLSX
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;

View File

@@ -4,7 +4,6 @@
* Set of functions used to build XML dumps of tables
*
* @todo
* @version $Id$
* @package phpMyAdmin-Export-XML
*/
if (! defined('PHPMYADMIN')) {

View File

@@ -3,7 +3,6 @@
/**
* Set of functions used to build YAML dumps of tables
*
* @version $Id$
* @package phpMyAdmin-Export-YAML
*/
if (! defined('PHPMYADMIN')) {

View File

@@ -4,7 +4,6 @@
* Functions for listing directories
*
* @todo rename to file_listing.lib.php
* @version $Id$
* @package phpMyAdmin
*/

View File

@@ -31,7 +31,6 @@
* @uses $cfg['NavigationBarIconic']
* @uses $cfg['DBG']['enable']
* @uses $cfg['DBG']['profile']['enable']
* @uses __('Open new phpMyAdmin window')
* @uses $cfg['MaxCharactersInDisplayedSQL']
* @uses PMA_isValid()
* @uses PMA_setHistory()
@@ -41,7 +40,6 @@
* @uses PMA_generate_common_url()
* @uses basename()
* @uses file_exists()
* @version $Id$
* @package phpMyAdmin
*/
if (! defined('PHPMYADMIN')) {

Some files were not shown because too many files have changed in this diff Show More