Skip to content

Commit

Permalink
Merge pull request phpmyadmin#11428 from Tithugues/useNamespaces_master
Browse files Browse the repository at this point in the history
Use namespaces and autoloading.
  • Loading branch information
Tithugues committed Oct 7, 2015
2 parents b239793 + 0bc489b commit e8e1650
Show file tree
Hide file tree
Showing 741 changed files with 16,292 additions and 14,119 deletions.
4 changes: 2 additions & 2 deletions browse_foreigners.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
}
}

PMA_Util::checkParameters(array('db', 'table', 'field'));
PMA\libraries\Util::checkParameters(array('db', 'table', 'field'));

$response = PMA_Response::getInstance();
$response = PMA\libraries\Response::getInstance();
$response->getFooter()->setMinimal();
$header = $response->getHeader();
$header->disableMenuAndConsole();
Expand Down
2 changes: 1 addition & 1 deletion changelog.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
require 'libraries/common.inc.php';

$response = PMA_Response::getInstance();
$response = PMA\libraries\Response::getInstance();
$response->disable();

$filename = CHANGELOG_FILE;
Expand Down
2 changes: 1 addition & 1 deletion chk_rel.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
PMA_fixPMATables($cfgRelation['db']);
}

$response = PMA_Response::getInstance();
$response = PMA\libraries\Response::getInstance();
$response->addHTML(
PMA_getRelationsParamDiagnostic($cfgRelation)
);
4 changes: 2 additions & 2 deletions db_central_columns.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
$selected_col[] = $_POST['column-select'];
$tmp_msg = PMA_syncUniqueColumns($selected_col, false, $selected_tbl);
}
$response = PMA_Response::getInstance();
$response = PMA\libraries\Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('jquery/jquery.uitablefilter.js');
Expand Down Expand Up @@ -145,7 +145,7 @@
$tablefooter = PMA_getCentralColumnsTableFooter($pmaThemeImage, $text_dir);
$response->addHTML($tablefooter);
$response->addHTML('</form></div>');
$message = PMA_Message::success(
$message = PMA\libraries\Message::success(
sprintf(__('Showing rows %1$s - %2$s.'), ($pos + 1), ($pos + count($result)))
);
if (isset($tmp_msg) && $tmp_msg !== true) {
Expand Down
16 changes: 8 additions & 8 deletions db_create.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/**
* Builds and executes the db creation sql query
*/
$sql_query = 'CREATE DATABASE ' . PMA_Util::backquote($_POST['new_db']);
$sql_query = 'CREATE DATABASE ' . PMA\libraries\Util::backquote($_POST['new_db']);
if (! empty($_POST['db_collation'])) {
list($db_charset) = explode('_', $_POST['db_collation']);
if (in_array($db_charset, $mysql_charsets)
Expand All @@ -42,23 +42,23 @@
$result = $GLOBALS['dbi']->tryQuery($sql_query);

if (! $result) {
$message = PMA_Message::rawError($GLOBALS['dbi']->getError());
$message = PMA\libraries\Message::rawError($GLOBALS['dbi']->getError());
// avoid displaying the not-created db name in header or navi panel
$GLOBALS['db'] = '';
$GLOBALS['table'] = '';

/**
* If in an Ajax request, just display the message with {@link PMA_Response}
* If in an Ajax request, just display the message with {@link PMA\libraries\Response}
*/
if ($GLOBALS['is_ajax_request'] == true) {
$response = PMA_Response::getInstance();
$response = PMA\libraries\Response::getInstance();
$response->setRequestStatus(false);
$response->addJSON('message', $message);
} else {
include_once 'index.php';
}
} else {
$message = PMA_Message::success(__('Database %1$s has been created.'));
$message = PMA\libraries\Message::success(__('Database %1$s has been created.'));
$message->addParam($_POST['new_db']);
$GLOBALS['db'] = $_POST['new_db'];

Expand Down Expand Up @@ -120,18 +120,18 @@

$new_db_string .= '</tr>';

$response = PMA_Response::getInstance();
$response = PMA\libraries\Response::getInstance();
$response->addJSON('message', $message);
$response->addJSON('new_db_string', $new_db_string);
$response->addJSON(
'sql_query',
PMA_Util::getMessage(
PMA\libraries\Util::getMessage(
null, $sql_query, 'success'
)
);
$response->addJSON(
'url_query',
PMA_Util::getScriptNameForOption(
PMA\libraries\Util::getScriptNameForOption(
$GLOBALS['cfg']['DefaultTabDatabase'], 'database'
)
. $url_query . '&amp;db='
Expand Down
19 changes: 9 additions & 10 deletions db_datadict.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
$tooltip_truename,
$tooltip_aliasname,
$pos
) = PMA_Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
) = PMA\libraries\Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
}

$response = PMA_Response::getInstance();
$response = PMA\libraries\Response::getInstance();
$header = $response->getHeader();
$header->enablePrintView();

Expand All @@ -36,12 +36,11 @@
$cfgRelation = PMA_getRelationsParam();

require_once 'libraries/transformations.lib.php';
require_once 'libraries/Index.class.php';

/**
* Check parameters
*/
PMA_Util::checkParameters(array('db'));
PMA\libraries\Util::checkParameters(array('db'));

/**
* Defines the url to return to in case of error in a sql statement
Expand Down Expand Up @@ -86,7 +85,7 @@
$GLOBALS['dbi']->selectDb($db);
$indexes = $GLOBALS['dbi']->getTableIndexes($db, $table);
list($primary, $pk_array, $indexes_info, $indexes_data)
= PMA_Util::processIndexData($indexes);
= PMA\libraries\Util::processIndexData($indexes);

/**
* Gets columns properties
Expand Down Expand Up @@ -130,7 +129,7 @@
$row['Null'] = 'NO';
}
$extracted_columnspec
= PMA_Util::extractColumnSpec($row['Type']);
= PMA\libraries\Util::extractColumnSpec($row['Type']);

// reformat mysql query output
// set or enum types: slashes single quotes inside options
Expand All @@ -157,7 +156,7 @@
}
echo '</td>';
echo '<td'
. PMA_Util::getClassForType(
. PMA\libraries\Util::getClassForType(
$extracted_columnspec['type']
)
. ' lang="en" dir="ltr">' . $type . '</td>';
Expand Down Expand Up @@ -203,13 +202,13 @@
$count++;
echo '</table>';
// display indexes information
if (count(PMA_Index::getFromTable($table, $db)) > 0) {
echo PMA_Index::getHtmlForIndexes($table, $db, true);
if (count(PMA\libraries\Index::getFromTable($table, $db)) > 0) {
echo PMA\libraries\Index::getHtmlForIndexes($table, $db, true);
}
echo '</div>';
} //ends main while

/**
* Displays the footer
*/
echo PMA_Util::getButton();
echo PMA\libraries\Util::getButton();
6 changes: 3 additions & 3 deletions db_designer.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
require_once 'libraries/pmd_common.php';
require_once 'libraries/db_designer.lib.php';

$response = PMA_Response::getInstance();
$response = PMA\libraries\Response::getInstance();

if (isset($_REQUEST['dialog'])) {

Expand Down Expand Up @@ -111,7 +111,7 @@
$params['db'] = $_GET['db'];
}

$response = PMA_Response::getInstance();
$response = PMA\libraries\Response::getInstance();
$response->getFooter()->setMinimal();
$header = $response->getHeader();
$header->setBodyId('pmd_body');
Expand All @@ -138,7 +138,7 @@
$tooltip_truename,
$tooltip_aliasname,
$pos
) = PMA_Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
) = PMA\libraries\Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');

// Embed some data into HTML, later it will be read
// by pmd/init.js and converted to JS variables.
Expand Down
1 change: 0 additions & 1 deletion db_events.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
* Include required files
*/
require_once 'libraries/common.inc.php';
require_once 'libraries/Util.class.php';

/**
* Include all other files
Expand Down
17 changes: 10 additions & 7 deletions db_export.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,25 @@
*
* @package PhpMyAdmin
*/
use PMA\libraries\config\PageSettings;
use PMA\libraries\Response;

/**
* Gets some core libraries
*/
require_once 'libraries/common.inc.php';
require_once 'libraries/config/page_settings.class.php';
require_once 'libraries/config/user_preferences.forms.php';
require_once 'libraries/config/page_settings.forms.php';
require_once 'libraries/export.lib.php';

PMA_PageSettings::showGroup('Export');
PageSettings::showGroup('Export');

$response = PMA_Response::getInstance();
$response = Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('export.js');

// $sub_part is used in PMA_Util::getDbInfo() to see if we are coming from
// $sub_part is used in PMA\libraries\Util::getDbInfo() to see if we are coming from
// db_export.php, in which case we don't obey $cfg['MaxTableList']
$sub_part = '_export';
require_once 'libraries/db_common.inc.php';
Expand All @@ -36,7 +39,7 @@
$tooltip_truename,
$tooltip_aliasname,
$pos
) = PMA_Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
) = PMA\libraries\Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');

/**
* Displays the form
Expand All @@ -45,7 +48,7 @@

// exit if no tables in db found
if ($num_tables < 1) {
PMA_Message::error(__('No tables found in database.'))->display();
PMA\libraries\Message::error(__('No tables found in database.'))->display();
exit;
} // end if

Expand Down Expand Up @@ -144,7 +147,7 @@
if (! isset($multi_values)) {
$multi_values = '';
}
$response = PMA_Response::getInstance();
$response = Response::getInstance();
$response->addHTML(
PMA_getExportDisplay(
'database', $db, $table, $sql_query, $num_tables,
Expand Down
13 changes: 8 additions & 5 deletions db_import.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
* @package PhpMyAdmin
*/

use PMA\libraries\config\PageSettings;

require_once 'libraries/common.inc.php';
require_once 'libraries/config/page_settings.class.php';
require_once 'libraries/config/user_preferences.forms.php';
require_once 'libraries/config/page_settings.forms.php';

PMA_PageSettings::showGroup('Import');
PageSettings::showGroup('Import');

$response = PMA_Response::getInstance();
$response = PMA\libraries\Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('import.js');
Expand All @@ -31,10 +34,10 @@
$tooltip_truename,
$tooltip_aliasname,
$pos
) = PMA_Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
) = PMA\libraries\Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');

require 'libraries/display_import.lib.php';
$response = PMA_Response::getInstance();
$response = PMA\libraries\Response::getInstance();
$response->addHTML(
PMA_getImportDisplay(
'database', $db, $table, $max_upload_size
Expand Down
Loading

0 comments on commit e8e1650

Please sign in to comment.