Skip to content

Commit

Permalink
Merge pull request #13427 from mauriciofauth/classes
Browse files Browse the repository at this point in the history
Move classes to PhpMyAdmin namespace
  • Loading branch information
MauricioFauth committed Jun 30, 2017
2 parents af84c6a + 54a15db commit 2bf5dba
Show file tree
Hide file tree
Showing 92 changed files with 236 additions and 233 deletions.
2 changes: 1 addition & 1 deletion db_central_columns.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
$tablefooter = PMA_getCentralColumnsTableFooter($pmaThemeImage, $text_dir);
$response->addHTML($tablefooter);
$response->addHTML('</form></div>');
$message = PMA\libraries\Message::success(
$message = PhpMyAdmin\Message::success(
sprintf(__('Showing rows %1$s - %2$s.'), ($pos + 1), ($pos + count($result)))
);
if (isset($tmp_msg) && $tmp_msg !== true) {
Expand Down
2 changes: 1 addition & 1 deletion db_export.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

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

Expand Down
12 changes: 6 additions & 6 deletions db_operations.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
}

if (! isset($_REQUEST['newname']) || strlen($_REQUEST['newname']) === 0) {
$message = PMA\libraries\Message::error(__('The database name is empty!'));
$message = PhpMyAdmin\Message::error(__('The database name is empty!'));
} else if($_REQUEST['newname'] === $_REQUEST['db']) {
$message = PMA\libraries\Message::error(
$message = PhpMyAdmin\Message::error(
__('Cannot copy database to the same name. Change the name and try again.')
);
} else {
Expand Down Expand Up @@ -138,7 +138,7 @@
$sql_query .= "\n" . $local_query;
$GLOBALS['dbi']->query($local_query);

$message = PMA\libraries\Message::success(
$message = PhpMyAdmin\Message::success(
__('Database %1$s has been renamed to %2$s.')
);
$message->addParam($GLOBALS['db']);
Expand All @@ -150,13 +150,13 @@
PMA_AdjustPrivileges_copyDB($GLOBALS['db'], $_REQUEST['newname']);
}

$message = PMA\libraries\Message::success(
$message = PhpMyAdmin\Message::success(
__('Database %1$s has been copied to %2$s.')
);
$message->addParam($GLOBALS['db']);
$message->addParam($_REQUEST['newname']);
} else {
$message = PMA\libraries\Message::error();
$message = PhpMyAdmin\Message::error();
}
$reload = true;

Expand Down Expand Up @@ -276,7 +276,7 @@
if (! $cfgRelation['allworks']
&& $cfg['PmaNoRelation_DisableWarning'] == false
) {
$message = PMA\libraries\Message::notice(
$message = PhpMyAdmin\Message::notice(
__(
'The phpMyAdmin configuration storage has been deactivated. ' .
'%sFind out why%s.'
Expand Down
4 changes: 2 additions & 2 deletions db_qbe.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
) = PMA\libraries\Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');

if ($message_to_display) {
PMA\libraries\Message::error(
PhpMyAdmin\Message::error(
__('You have to choose at least one column to display!')
)
->display();
Expand All @@ -140,7 +140,7 @@
)
);
$response->addHTML(
PMA\libraries\Message::notice(
PhpMyAdmin\Message::notice(
sprintf(
__('Switch to %svisual builder%s'),
'<a href="' . $url . '">',
Expand Down
8 changes: 4 additions & 4 deletions db_tracking.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@
if (isset($_REQUEST['delete_tracking']) && isset($_REQUEST['table'])) {

Tracker::deleteTracking($GLOBALS['db'], $_REQUEST['table']);
PMA\libraries\Message::success(
PhpMyAdmin\Message::success(
__('Tracking data deleted successfully.')
)->display();

} elseif (isset($_REQUEST['submit_create_version'])) {

PMA_createTrackingForMultipleTables($_REQUEST['selected']);
PMA\libraries\Message::success(
PhpMyAdmin\Message::success(
sprintf(
__(
'Version %1$s was created for selected tables,'
Expand All @@ -74,7 +74,7 @@
foreach ($_REQUEST['selected_tbl'] as $table) {
Tracker::deleteTracking($GLOBALS['db'], $table);
}
PMA\libraries\Message::success(
PhpMyAdmin\Message::success(
__('Tracking data deleted successfully.')
)->display();

Expand All @@ -89,7 +89,7 @@
exit;
}
} else {
PMA\libraries\Message::notice(
PhpMyAdmin\Message::notice(
__('No tables selected.')
)->display();
}
Expand Down
4 changes: 2 additions & 2 deletions error_report.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@

/* Create message object */
if ($success) {
$msg = PMA\libraries\Message::notice($msg);
$msg = PhpMyAdmin\Message::notice($msg);
} else {
$msg = PMA\libraries\Message::error($msg);
$msg = PhpMyAdmin\Message::error($msg);
}

/* Add message to response */
Expand Down
2 changes: 1 addition & 1 deletion export.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@
if ($export_type == 'database') {
$num_tables = count($tables);
if ($num_tables == 0) {
$message = PMA\libraries\Message::error(
$message = PhpMyAdmin\Message::error(
__('No tables found in database.')
);
$active_page = 'db_export.php';
Expand Down
22 changes: 11 additions & 11 deletions import.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
// If we didn't get any parameters, either user called this directly, or
// upload limit has been reached, let's assume the second possibility.
if ($_POST == array() && $_GET == array()) {
$message = PMA\libraries\Message::error(
$message = PhpMyAdmin\Message::error(
__(
'You probably tried to upload a file that is too large. Please refer ' .
'to %sdocumentation%s for a workaround for this limit.'
Expand Down Expand Up @@ -364,7 +364,7 @@
$bookmark = Bookmark::get($db, $id_bookmark);
$import_text = $bookmark->getQuery();
if ($response->isAjax()) {
$message = PMA\libraries\Message::success(__('Showing bookmark'));
$message = PhpMyAdmin\Message::success(__('Showing bookmark'));
$response->setRequestStatus($message->isSuccess());
$response->addJSON('message', $message);
$response->addJSON('sql_query', $import_text);
Expand All @@ -379,7 +379,7 @@
if (! empty($bookmark)) {
$bookmark->delete();
if ($response->isAjax()) {
$message = PMA\libraries\Message::success(
$message = PhpMyAdmin\Message::success(
__('The bookmark has been deleted.')
);
$response->setRequestStatus($message->isSuccess());
Expand Down Expand Up @@ -472,7 +472,7 @@
}
} elseif (! $error) {
if (! isset($import_text) || empty($import_text)) {
$message = PMA\libraries\Message::error(
$message = PhpMyAdmin\Message::error(
__(
'No data was received to import. Either no file name was ' .
'submitted, or the file size exceeded the maximum size permitted ' .
Expand Down Expand Up @@ -525,7 +525,7 @@
$import_type
);
if ($import_plugin == null) {
$message = PMA\libraries\Message::error(
$message = PhpMyAdmin\Message::error(
__('Could not load import plugins, please check your installation!')
);
PMA_stopImport($message);
Expand Down Expand Up @@ -561,11 +561,11 @@

// Show correct message
if (! empty($id_bookmark) && $_REQUEST['action_bookmark'] == 2) {
$message = PMA\libraries\Message::success(__('The bookmark has been deleted.'));
$message = PhpMyAdmin\Message::success(__('The bookmark has been deleted.'));
$display_query = $import_text;
$error = false; // unset error marker, it was used just to skip processing
} elseif (! empty($id_bookmark) && $_REQUEST['action_bookmark'] == 1) {
$message = PMA\libraries\Message::notice(__('Showing bookmark'));
$message = PhpMyAdmin\Message::notice(__('Showing bookmark'));
} elseif ($bookmark_created) {
$special_message = '[br]' . sprintf(
__('Bookmark %s has been created.'),
Expand All @@ -575,7 +575,7 @@
// Do not display the query with message, we do it separately
$display_query = ';';
if ($import_type != 'query') {
$message = PMA\libraries\Message::success(
$message = PhpMyAdmin\Message::success(
'<em>'
. _ngettext(
'Import has been successfully finished, %d query executed.',
Expand Down Expand Up @@ -607,7 +607,7 @@

$importUrl = $err_url = $goto . URL::getCommon($urlparams);

$message = PMA\libraries\Message::error(
$message = PhpMyAdmin\Message::error(
__(
'Script timeout passed, if you want to finish import,'
. ' please %sresubmit the same file%s and import will resume.'
Expand Down Expand Up @@ -752,14 +752,14 @@
}

$response->setRequestStatus(true);
$response->addJSON('message', PMA\libraries\Message::success($msg));
$response->addJSON('message', PhpMyAdmin\Message::success($msg));
$response->addJSON(
'sql_query',
PMA\libraries\Util::getMessage($msg, $sql_query, 'success')
);
} else if ($result == false) {
$response->setRequestStatus(false);
$response->addJSON('message', PMA\libraries\Message::error($msg));
$response->addJSON('message', PhpMyAdmin\Message::error($msg));
} else {
$active_page = $goto;
include '' . $goto;
Expand Down
2 changes: 1 addition & 1 deletion import_status.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
session_start();

if ((time() - $timestamp) > $maximumTime) {
$_SESSION['Import_message']['message'] = PMA\libraries\Message::error(
$_SESSION['Import_message']['message'] = PhpMyAdmin\Message::error(
__('Could not load the progress of the import.')
)->getDisplay();
break;
Expand Down
4 changes: 2 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use PhpMyAdmin\Charsets;
use PhpMyAdmin\Core;
use PhpMyAdmin\LanguageManager;
use PMA\libraries\Message;
use PhpMyAdmin\Message;
use PMA\libraries\RecentFavoriteTable;
use PMA\libraries\Response;
use PMA\libraries\Sanitize;
Expand Down Expand Up @@ -572,7 +572,7 @@
. 'to set it up there.'
);
}
$msg = PMA\libraries\Message::notice($msg_text);
$msg = PhpMyAdmin\Message::notice($msg_text);
$msg->addParamHtml('<a href="./chk_rel.php' . $common_url_query . '">');
$msg->addParamHtml('</a>');
/* Show error if user has configured something, notice elsewhere */
Expand Down
2 changes: 1 addition & 1 deletion libraries/Sql.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\DisplayResults;
use PhpMyAdmin\Index;
use PMA\libraries\Message;
use PhpMyAdmin\Message;
use PMA\libraries\Response;
use PMA\libraries\Table;
use PMA\libraries\Transformations;
Expand Down
1 change: 1 addition & 0 deletions libraries/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\Index;
use PhpMyAdmin\Message;
use PMA\libraries\plugins\export\ExportSql;
use PhpMyAdmin\SqlParser\Components\Expression;
use PhpMyAdmin\SqlParser\Components\OptionsArray;
Expand Down
12 changes: 6 additions & 6 deletions libraries/central_columns.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @package PhpMyAdmin
*/
use PhpMyAdmin\Charsets;
use PMA\libraries\Message;
use PhpMyAdmin\Message;
use PMA\libraries\Util;
use PMA\libraries\URL;

Expand Down Expand Up @@ -211,7 +211,7 @@ function PMA_getInsertQuery($column, $def, $db, $central_list_table)
* @param string $table if $isTable is false,
* then table name to which columns belong
*
* @return true|PMA\libraries\Message
* @return true|PhpMyAdmin\Message
*/
function PMA_syncUniqueColumns($field_select, $isTable=true, $table=null)
{
Expand Down Expand Up @@ -316,7 +316,7 @@ function PMA_syncUniqueColumns($field_select, $isTable=true, $table=null)
* selected list of columns to remove from central list
* @param bool $isTable if passed array is of tables or columns
*
* @return true|PMA\libraries\Message
* @return true|PhpMyAdmin\Message
*/
function PMA_deleteColumnsFromList($field_select, $isTable=true)
{
Expand Down Expand Up @@ -399,7 +399,7 @@ function PMA_deleteColumnsFromList($field_select, $isTable=true)
* @param string $db current database
* @param array $selected_tables list of selected tables.
*
* @return true|PMA\libraries\Message
* @return true|PhpMyAdmin\Message
*/
function PMA_makeConsistentWithList($db, $selected_tables)
{
Expand Down Expand Up @@ -508,7 +508,7 @@ function PMA_getCentralColumnsFromTable($db, $table, $allFields=false)
* @param string $col_extra new column extra property
* @param string $col_default new column default value
*
* @return true|PMA\libraries\Message
* @return true|PhpMyAdmin\Message
*/
function PMA_updateOneColumn($db, $orig_col_name, $col_name, $col_type,
$col_attribute,$col_length, $col_isNull, $collation, $col_extra, $col_default
Expand Down Expand Up @@ -556,7 +556,7 @@ function PMA_updateOneColumn($db, $orig_col_name, $col_name, $col_type,
/**
* Update Multiple column in central columns list if a chnage is requested
*
* @return true|PMA\libraries\Message
* @return true|PhpMyAdmin\Message
*/
function PMA_updateMultipleColumn()
{
Expand Down
2 changes: 1 addition & 1 deletion libraries/classes/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace PhpMyAdmin;

use PhpMyAdmin\DatabaseInterface;
use PMA\libraries\Message;
use PhpMyAdmin\Message;
use PMA\libraries\Response;
use PMA\libraries\Sanitize;
use PMA\libraries\Template;
Expand Down
2 changes: 1 addition & 1 deletion libraries/classes/DisplayResults.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use PhpMyAdmin\Core;
use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\Index;
use PMA\libraries\Message;
use PhpMyAdmin\Message;
use PMA\libraries\plugins\transformations\Text_Plain_Link;
use PMA\libraries\Response;
use PMA\libraries\Sanitize;
Expand Down
2 changes: 1 addition & 1 deletion libraries/classes/Error.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace PhpMyAdmin;

use Exception;
use PMA\libraries\Message;
use PhpMyAdmin\Message;

/**
* a single error
Expand Down
2 changes: 1 addition & 1 deletion libraries/classes/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

use PMA\libraries\config\ConfigFile;
use PhpMyAdmin\Core;
use PMA\libraries\Message;
use PhpMyAdmin\Message;
use PMA\libraries\Util;
use PMA\libraries\ZipExtension;

Expand Down
2 changes: 1 addition & 1 deletion libraries/classes/Footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

use PhpMyAdmin\Config;
use PhpMyAdmin\Core;
use PMA\libraries\Message;
use PhpMyAdmin\Message;
use PMA\libraries\Response;
use PMA\libraries\Sanitize;
use PMA\libraries\Scripts;
Expand Down
4 changes: 2 additions & 2 deletions libraries/classes/Header.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
use PhpMyAdmin\Config;
use PhpMyAdmin\Console;
use PhpMyAdmin\Core;
use PMA\libraries\Menu;
use PMA\libraries\Message;
use PhpMyAdmin\Menu;
use PhpMyAdmin\Message;
use PMA\libraries\navigation\Navigation;
use PMA\libraries\RecentFavoriteTable;
use PMA\libraries\Sanitize;
Expand Down
2 changes: 1 addition & 1 deletion libraries/classes/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace PhpMyAdmin;

use PhpMyAdmin\IndexColumn;
use PMA\libraries\Message;
use PhpMyAdmin\Message;
use PMA\libraries\Sanitize;
use PMA\libraries\URL;
use PMA\libraries\Util;
Expand Down

0 comments on commit 2bf5dba

Please sign in to comment.