Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f0ba28f

Browse files
committed
Set namespace on Advisor, Config, Console and Util classes.
Set namespace on DbQbe. Set namespace to 'DbSearch'. Split Advisor.class.php file. Change Advisor namespace. Rename DbQbe class and file. Set namespace on DisplayResults. Set namespace on Error. Use namespace for ErrorHandler. Add class autoloader. Change ErrorHandler filename. Remove some require. Update Config namespace path. Update PMA_Util to PMA\libraries\Util. Rename Font and File classes files. Use namespace for Footer. Set namespace in all libraries classes. Namespace OutputBuffering. Export SubPartition. Rename Partition file. Namespace PDF. Namespace RecentFavoriteTable. Replace PMA_Response by Response and PMA_Message by Message. Update uses and calls. Fix unit tests. Fix SqlParser autoload. Signed-off-by: Hugues Peccatte <[email protected]>
1 parent a4456bd commit f0ba28f

546 files changed

Lines changed: 5989 additions & 5420 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

browse_foreigners.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
}
2525
}
2626

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

29-
$response = PMA_Response::getInstance();
29+
$response = PMA\libraries\Response::getInstance();
3030
$response->getFooter()->setMinimal();
3131
$header = $response->getHeader();
3232
$header->disableMenuAndConsole();

changelog.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
require 'libraries/common.inc.php';
1313

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

1717
$filename = CHANGELOG_FILE;

chk_rel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
PMA_fixPMATables($cfgRelation['db']);
2727
}
2828

29-
$response = PMA_Response::getInstance();
29+
$response = PMA\libraries\Response::getInstance();
3030
$response->addHTML(
3131
PMA_getRelationsParamDiagnostic($cfgRelation)
3232
);

db_central_columns.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
$selected_col[] = $_POST['column-select'];
5656
$tmp_msg = PMA_syncUniqueColumns($selected_col, false, $selected_tbl);
5757
}
58-
$response = PMA_Response::getInstance();
58+
$response = PMA\libraries\Response::getInstance();
5959
$header = $response->getHeader();
6060
$scripts = $header->getScripts();
6161
$scripts->addFile('jquery/jquery.uitablefilter.js');
@@ -145,7 +145,7 @@
145145
$tablefooter = PMA_getCentralColumnsTableFooter($pmaThemeImage, $text_dir);
146146
$response->addHTML($tablefooter);
147147
$response->addHTML('</form></div>');
148-
$message = PMA_Message::success(
148+
$message = PMA\libraries\Message::success(
149149
sprintf(__('Showing rows %1$s - %2$s.'), ($pos + 1), ($pos + count($result)))
150150
);
151151
if (isset($tmp_msg) && $tmp_msg !== true) {

db_create.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
/**
2626
* Builds and executes the db creation sql query
2727
*/
28-
$sql_query = 'CREATE DATABASE ' . PMA_Util::backquote($_POST['new_db']);
28+
$sql_query = 'CREATE DATABASE ' . PMA\libraries\Util::backquote($_POST['new_db']);
2929
if (! empty($_POST['db_collation'])) {
3030
list($db_charset) = explode('_', $_POST['db_collation']);
3131
if (in_array($db_charset, $mysql_charsets)
@@ -42,23 +42,23 @@
4242
$result = $GLOBALS['dbi']->tryQuery($sql_query);
4343

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

5050
/**
51-
* If in an Ajax request, just display the message with {@link PMA_Response}
51+
* If in an Ajax request, just display the message with {@link PMA\libraries\Response}
5252
*/
5353
if ($GLOBALS['is_ajax_request'] == true) {
54-
$response = PMA_Response::getInstance();
54+
$response = PMA\libraries\Response::getInstance();
5555
$response->isSuccess(false);
5656
$response->addJSON('message', $message);
5757
} else {
5858
include_once 'index.php';
5959
}
6060
} else {
61-
$message = PMA_Message::success(__('Database %1$s has been created.'));
61+
$message = PMA\libraries\Message::success(__('Database %1$s has been created.'));
6262
$message->addParam($_POST['new_db']);
6363
$GLOBALS['db'] = $_POST['new_db'];
6464

@@ -120,18 +120,18 @@
120120

121121
$new_db_string .= '</tr>';
122122

123-
$response = PMA_Response::getInstance();
123+
$response = PMA\libraries\Response::getInstance();
124124
$response->addJSON('message', $message);
125125
$response->addJSON('new_db_string', $new_db_string);
126126
$response->addJSON(
127127
'sql_query',
128-
PMA_Util::getMessage(
128+
PMA\libraries\Util::getMessage(
129129
null, $sql_query, 'success'
130130
)
131131
);
132132
$response->addJSON(
133133
'url_query',
134-
PMA_Util::getScriptNameForOption(
134+
PMA\libraries\Util::getScriptNameForOption(
135135
$GLOBALS['cfg']['DefaultTabDatabase'], 'database'
136136
)
137137
. $url_query . '&amp;db='

db_datadict.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
$tooltip_truename,
2424
$tooltip_aliasname,
2525
$pos
26-
) = PMA_Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
26+
) = PMA\libraries\Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
2727
}
2828

29-
$response = PMA_Response::getInstance();
29+
$response = PMA\libraries\Response::getInstance();
3030
$header = $response->getHeader();
3131
$header->enablePrintView();
3232

@@ -36,12 +36,12 @@
3636
$cfgRelation = PMA_getRelationsParam();
3737

3838
require_once 'libraries/transformations.lib.php';
39-
require_once 'libraries/Index.class.php';
39+
require_once 'libraries/Index.php';
4040

4141
/**
4242
* Check parameters
4343
*/
44-
PMA_Util::checkParameters(array('db'));
44+
PMA\libraries\Util::checkParameters(array('db'));
4545

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

9191
/**
9292
* Gets columns properties
@@ -130,7 +130,7 @@
130130
$row['Null'] = 'NO';
131131
}
132132
$extracted_columnspec
133-
= PMA_Util::extractColumnSpec($row['Type']);
133+
= PMA\libraries\Util::extractColumnSpec($row['Type']);
134134

135135
// reformat mysql query output
136136
// set or enum types: slashes single quotes inside options
@@ -157,7 +157,7 @@
157157
}
158158
echo '</td>';
159159
echo '<td'
160-
. PMA_Util::getClassForType(
160+
. PMA\libraries\Util::getClassForType(
161161
$extracted_columnspec['type']
162162
)
163163
. ' lang="en" dir="ltr">' . $type . '</td>';
@@ -203,13 +203,13 @@
203203
$count++;
204204
echo '</table>';
205205
// display indexes information
206-
if (count(PMA_Index::getFromTable($table, $db)) > 0) {
207-
echo PMA_Index::getHtmlForIndexes($table, $db, true);
206+
if (count(PMA\libraries\Index::getFromTable($table, $db)) > 0) {
207+
echo PMA\libraries\Index::getHtmlForIndexes($table, $db, true);
208208
}
209209
echo '</div>';
210210
} //ends main while
211211

212212
/**
213213
* Displays the footer
214214
*/
215-
echo PMA_Util::getButton();
215+
echo PMA\libraries\Util::getButton();

db_designer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
require_once 'libraries/pmd_common.php';
1111
require_once 'libraries/db_designer.lib.php';
1212

13-
$response = PMA_Response::getInstance();
13+
$response = PMA\libraries\Response::getInstance();
1414

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

@@ -111,7 +111,7 @@
111111
$params['db'] = $_GET['db'];
112112
}
113113

114-
$response = PMA_Response::getInstance();
114+
$response = PMA\libraries\Response::getInstance();
115115
$response->getFooter()->setMinimal();
116116
$header = $response->getHeader();
117117
$header->setBodyId('pmd_body');
@@ -138,7 +138,7 @@
138138
$tooltip_truename,
139139
$tooltip_aliasname,
140140
$pos
141-
) = PMA_Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
141+
) = PMA\libraries\Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
142142

143143
// Embed some data into HTML, later it will be read
144144
// by pmd/init.js and converted to JS variables.

db_events.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Include required files
1111
*/
1212
require_once 'libraries/common.inc.php';
13-
require_once 'libraries/Util.class.php';
13+
require_once 'libraries/Util.php';
1414

1515
/**
1616
* Include all other files

db_export.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515

1616
PMA_PageSettings::showGroup('Export');
1717

18-
$response = PMA_Response::getInstance();
18+
$response = PMA\libraries\Response::getInstance();
1919
$header = $response->getHeader();
2020
$scripts = $header->getScripts();
2121
$scripts->addFile('export.js');
2222

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

4141
/**
4242
* Displays the form
@@ -45,7 +45,7 @@
4545

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

db_import.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
PMA_PageSettings::showGroup('Import');
1313

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

3636
require 'libraries/display_import.lib.php';
37-
$response = PMA_Response::getInstance();
37+
$response = PMA\libraries\Response::getInstance();
3838
$response->addHTML(
3939
PMA_getImportDisplay(
4040
'database', $db, $table, $max_upload_size

0 commit comments

Comments
 (0)