Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2015-12-31 14:10:00 +01:00
commit 6aef0a192e
17 changed files with 37 additions and 37 deletions

View File

@ -905,14 +905,14 @@ class DatabaseInterface
// display only databases also in official database list
// f.e. to apply hide_db and only_db
$drops = array_diff(
array_keys($databases), (array) $GLOBALS['pma']->databases
array_keys($databases), (array) $GLOBALS['dblist']->databases
);
foreach ($drops as $drop) {
unset($databases[$drop]);
}
} else {
$databases = array();
foreach ($GLOBALS['pma']->databases as $database_name) {
foreach ($GLOBALS['dblist']->databases as $database_name) {
// MySQL forward compatibility
// so pma could use this array as if every server is of version >5.0
// todo : remove and check the rest of the code for usage,
@ -1130,7 +1130,7 @@ class DatabaseInterface
} else {
$columns = array();
if (null === $database) {
foreach ($GLOBALS['pma']->databases as $database) {
foreach ($GLOBALS['dblist']->databases as $database) {
$columns[$database] = $this->getColumnsFull(
$database, null, null, $link
);

View File

@ -1,7 +1,7 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* phpMyAdmin main Controller
* holds the DbList class
*
* @package PhpMyAdmin
*
@ -9,14 +9,14 @@
namespace PMA\libraries;
/**
* phpMyAdmin main Controller
* holds the DbList class
*
* @package PhpMyAdmin
*
* @property object $userlink
* @property object $controllink
*/
class PMA
class DbList
{
/**
* Holds database list

View File

@ -728,8 +728,8 @@ class Table
$GLOBALS['asfile'] = 1;
// Ensuring the target database is valid.
if (! $GLOBALS['pma']->databases->exists($source_db, $target_db)) {
if (! $GLOBALS['pma']->databases->exists($source_db)) {
if (! $GLOBALS['dblist']->databases->exists($source_db, $target_db)) {
if (! $GLOBALS['dblist']->databases->exists($source_db)) {
$GLOBALS['message'] = Message::rawError(
sprintf(
__('Source database `%s` was not found!'),
@ -737,7 +737,7 @@ class Table
)
);
}
if (! $GLOBALS['pma']->databases->exists($target_db)) {
if (! $GLOBALS['dblist']->databases->exists($target_db)) {
$GLOBALS['message'] = Message::rawError(
sprintf(
__('Target database `%s` was not found!'),
@ -1271,7 +1271,7 @@ class Table
if (null !== $new_db && $new_db !== $this->getDbName()) {
// Ensure the target is valid
if (! $GLOBALS['pma']->databases->exists($new_db)) {
if (! $GLOBALS['dblist']->databases->exists($new_db)) {
$this->errors[] = __('Invalid database:') . ' ' . $new_db;
return false;
}

View File

@ -35,7 +35,7 @@ use PMA\libraries\DatabaseInterface;
use PMA\libraries\ErrorHandler;
use PMA\libraries\Message;
use PMA\libraries\plugins\AuthenticationPlugin;
use PMA\libraries\PMA;
use PMA\libraries\DbList;
use PMA\libraries\Theme;
use PMA\libraries\ThemeManager;
use PMA\libraries\Tracker;
@ -931,11 +931,11 @@ if (! defined('PMA_MINIMUM_COMMON')) {
// TODO: Set SQL modes too.
/**
* the ListDatabase class
* the DbList class as a stub for the ListDatabase class
*/
$pma = new PMA;
$pma->userlink = $userlink;
$pma->controllink = $controllink;
$dblist = new DbList;
$dblist->userlink = $userlink;
$dblist->controllink = $controllink;
/**
* some resetting has to be done when switching servers
@ -1077,7 +1077,7 @@ if (! defined('PMA_MINIMUM_COMMON')
}
$cfgRelation = PMA_getRelationsParam();
if (empty($cfgRelation['db'])) {
foreach ($GLOBALS['pma']->databases as $database) {
foreach ($GLOBALS['dblist']->databases as $database) {
if ($database == 'phpmyadmin') {
PMA_fixPMATables($database, false);
}

View File

@ -105,7 +105,7 @@ class ServerDatabasesController extends Controller
null, $this->_dbstats, null, $this->_sort_by,
$this->_sort_order, $this->_pos, true
);
$this->_database_count = count($GLOBALS['pma']->databases);
$this->_database_count = count($GLOBALS['dblist']->databases);
} else {
$this->_database_count = 0;
}

View File

@ -58,7 +58,7 @@ function PMA_getHtmlForExportSelectOptions($tmp_select = '')
$_GET['db_select'] = explode(",", $_GET['db_select']);
}
foreach ($GLOBALS['pma']->databases as $current_db) {
foreach ($GLOBALS['dblist']->databases as $current_db) {
if ($GLOBALS['dbi']->isSystemSchema($current_db, true)) {
continue;
}

View File

@ -553,7 +553,7 @@ function PMA_exportServer(
$tmp_select = '|' . $tmp_select . '|';
}
// Walk over databases
foreach ($GLOBALS['pma']->databases as $current_db) {
foreach ($GLOBALS['dblist']->databases as $current_db) {
if (isset($tmp_select)
&& /*overload*/mb_strpos(' ' . $tmp_select, '|' . $current_db . '|')
) {

View File

@ -323,7 +323,7 @@ if (!empty($submit_mult) && !empty($what)) {
if ($rebuild_database_list) {
// avoid a problem with the database list navigator
// when dropping a db from server_databases
$GLOBALS['pma']->databases->build();
$GLOBALS['dblist']->databases->build();
}
} else {
if (isset($submit_mult)

View File

@ -326,7 +326,7 @@ function PMA_getHtmlForCopyMultipleTables($action, $_url_params)
$html .= PMA_URL_getHiddenInputs($_url_params);
$html .= '<fieldset class = "input">';
$html .= '<legend>' . __('Copy tables to') . '</legend>';
$databases_list = $GLOBALS['pma']->databases;
$databases_list = $GLOBALS['dblist']->databases;
foreach ($databases_list as $key => $db_name)
if ($db_name == $GLOBALS['db']){
$databases_list->offsetUnset($key);

View File

@ -389,7 +389,7 @@ function PMA_createDbBeforeCopy()
// rebuild the database list because Table::moveCopy
// checks in this list if the target db exists
$GLOBALS['pma']->databases->build();
$GLOBALS['dblist']->databases->build();
}
/**
@ -825,13 +825,13 @@ function PMA_getHtmlForMoveTable()
$html_output .= '<legend>' . __('Move table to (database<b>.</b>table)')
. '</legend>';
if (count($GLOBALS['pma']->databases) > $GLOBALS['cfg']['MaxDbList']) {
if (count($GLOBALS['dblist']->databases) > $GLOBALS['cfg']['MaxDbList']) {
$html_output .= '<input type="text" maxlength="100" size="30" '
. 'name="target_db" value="' . htmlspecialchars($GLOBALS['db'])
. '"/>';
} else {
$html_output .= '<select class="halfWidth" name="target_db">'
. $GLOBALS['pma']->databases->getHtmlOptions(true, false)
. $GLOBALS['dblist']->databases->getHtmlOptions(true, false)
. '</select>';
}
$html_output .= '&nbsp;<strong>.</strong>&nbsp;';
@ -1251,13 +1251,13 @@ function PMA_getHtmlForCopytable()
$html_output .= '<legend>'
. __('Copy table to (database<b>.</b>table)') . '</legend>';
if (count($GLOBALS['pma']->databases) > $GLOBALS['cfg']['MaxDbList']) {
if (count($GLOBALS['dblist']->databases) > $GLOBALS['cfg']['MaxDbList']) {
$html_output .= '<input class="halfWidth" type="text" maxlength="100" '
. 'size="30" name="target_db" '
. 'value="' . htmlspecialchars($GLOBALS['db']) . '"/>';
} else {
$html_output .= '<select class="halfWidth" name="target_db">'
. $GLOBALS['pma']->databases->getHtmlOptions(true, false)
. $GLOBALS['dblist']->databases->getHtmlOptions(true, false)
. '</select>';
}
$html_output .= '&nbsp;<strong>.</strong>&nbsp;';

View File

@ -363,7 +363,7 @@ function PMA_getHtmlForReplicationDbMultibox()
$multi_values .= '<select name="db_select[]" '
. 'size="6" multiple="multiple" id="db_select">';
foreach ($GLOBALS['pma']->databases as $current_db) {
foreach ($GLOBALS['dblist']->databases as $current_db) {
if ($GLOBALS['dbi']->isSystemSchema($current_db)) {
continue;
}

View File

@ -3492,7 +3492,7 @@ function PMA_getHtmlForAllTableSpecificRights(
// we already have the list of databases from libraries/common.inc.php
// via $pma = new PMA;
$pred_db_array = $GLOBALS['pma']->databases;
$pred_db_array = $GLOBALS['dblist']->databases;
$databases_to_skip = array('information_schema', 'performance_schema');
$databases = array();

View File

@ -145,7 +145,7 @@ if ($foreign_db) {
array(
'name' => 'destination_foreign_db[' . $i . ']',
'title' => __('Database'),
'values' => $GLOBALS['pma']->databases,
'values' => $GLOBALS['dblist']->databases,
'foreign' => $foreign_db
)
); ?>
@ -193,4 +193,4 @@ if ($foreign_db) {
</span>
<?php endif; ?>
</td>
</tr>
</tr>

View File

@ -55,7 +55,7 @@ if ($foreign_db && $foreign_table) {
array(
'name' => 'destination_db[' . $myfield_md5 . ']',
'title' => __('Database'),
'values' => $GLOBALS['pma']->databases,
'values' => $GLOBALS['dblist']->databases,
'foreign' => $foreign_db
)
); ?>

View File

@ -51,8 +51,8 @@ class TableTest extends PMATestCase
$GLOBALS['pmaThemeImage'] = 'themes/dot.gif';
$GLOBALS['is_ajax_request'] = false;
$GLOBALS['cfgRelation'] = PMA_getRelationsParam();
$GLOBALS['pma'] = new DataBasePMAMock();
$GLOBALS['pma']->databases = new DataBaseMock();
$GLOBALS['dblist'] = new DataBasePMAMock();
$GLOBALS['dblist']->databases = new DataBaseMock();
$sql_isView_true = "SELECT TABLE_NAME
FROM information_schema.VIEWS

View File

@ -47,8 +47,8 @@ class TableRelationControllerTest extends PMATestCase
$_REQUEST['foreignDb'] = 'db';
$_REQUEST['foreignTable'] = 'table';
$GLOBALS['pma'] = new DataBasePMAMockForTblRelation();
$GLOBALS['pma']->databases = new DataBaseMockForTblRelation();
$GLOBALS['dblist'] = new DataBasePMAMockForTblRelation();
$GLOBALS['dblist']->databases = new DataBaseMockForTblRelation();
$dbi = $this->getMockBuilder('PMA\libraries\DatabaseInterface')
->disableOriginalConstructor()

View File

@ -2096,8 +2096,8 @@ class PMA_ServerPrivileges_Test extends PHPUnit_Framework_TestCase
);
// Test case 2
$GLOBALS['pma'] = new stdClass();
$GLOBALS['pma']->databases = array('x', 'y', 'z');
$GLOBALS['dblist'] = new stdClass();
$GLOBALS['dblist']->databases = array('x', 'y', 'z');
$actual = PMA_getHtmlForAllTableSpecificRights('pma2', 'host2', 'database', '');
$this->assertContains(
'<legend data-submenu-label="Database">'