Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurício Meneghini Fauth <mauriciofauth@gmail.com>2017-08-21 18:59:45 +0300
committerMaurício Meneghini Fauth <mauriciofauth@gmail.com>2017-08-21 19:04:36 +0300
commitbb0555bb25210d0332e3b8d9d7064ea6b258f1b0 (patch)
tree09561307808c4286a5835c6f7d555bf814b18a5f /db_tracking.php
parentf5c2c5419f0cd2c893ab8e66fea86b79e235278a (diff)
Refactor tracking functions to static methods
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
Diffstat (limited to 'db_tracking.php')
-rw-r--r--db_tracking.php31
1 files changed, 16 insertions, 15 deletions
diff --git a/db_tracking.php b/db_tracking.php
index 9facdd6e91..3f8f148180 100644
--- a/db_tracking.php
+++ b/db_tracking.php
@@ -5,15 +5,16 @@
*
* @package PhpMyAdmin
*/
+use PhpMyAdmin\Message;
use PhpMyAdmin\Response;
use PhpMyAdmin\Tracker;
+use PhpMyAdmin\Tracking;
+use PhpMyAdmin\Util;
/**
* Run common work
*/
require_once 'libraries/common.inc.php';
-
-require_once './libraries/tracking.lib.php';
require_once 'libraries/display_create_table.lib.php';
//Get some js files needed for Ajax requests
@@ -42,21 +43,21 @@ list(
$tooltip_truename,
$tooltip_aliasname,
$pos
-) = PhpMyAdmin\Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
+) = Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
// Work to do?
// (here, do not use $_REQUEST['db] as it can be crafted)
if (isset($_REQUEST['delete_tracking']) && isset($_REQUEST['table'])) {
Tracker::deleteTracking($GLOBALS['db'], $_REQUEST['table']);
- PhpMyAdmin\Message::success(
+ Message::success(
__('Tracking data deleted successfully.')
)->display();
} elseif (isset($_REQUEST['submit_create_version'])) {
- PMA_createTrackingForMultipleTables($_REQUEST['selected']);
- PhpMyAdmin\Message::success(
+ Tracking::createTrackingForMultipleTables($_REQUEST['selected']);
+ Message::success(
sprintf(
__(
'Version %1$s was created for selected tables,'
@@ -74,13 +75,13 @@ if (isset($_REQUEST['delete_tracking']) && isset($_REQUEST['table'])) {
foreach ($_REQUEST['selected_tbl'] as $table) {
Tracker::deleteTracking($GLOBALS['db'], $table);
}
- PhpMyAdmin\Message::success(
+ Message::success(
__('Tracking data deleted successfully.')
)->display();
} elseif ($_REQUEST['submit_mult'] == 'track') {
- echo PMA_getHtmlForDataDefinitionAndManipulationStatements(
+ echo Tracking::getHtmlForDataDefinitionAndManipulationStatements(
'db_tracking.php' . $url_query,
0,
$GLOBALS['db'],
@@ -89,7 +90,7 @@ if (isset($_REQUEST['delete_tracking']) && isset($_REQUEST['table'])) {
exit;
}
} else {
- PhpMyAdmin\Message::notice(
+ Message::notice(
__('No tables selected.')
)->display();
}
@@ -113,8 +114,8 @@ $cfgRelation = PMA_getRelationsParam();
// Prepare statement to get HEAD version
$all_tables_query = ' SELECT table_name, MAX(version) as version FROM ' .
- PhpMyAdmin\Util::backquote($cfgRelation['db']) . '.' .
- PhpMyAdmin\Util::backquote($cfgRelation['tracking']) .
+ Util::backquote($cfgRelation['db']) . '.' .
+ Util::backquote($cfgRelation['tracking']) .
' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($_REQUEST['db']) .
'\' ' .
' GROUP BY table_name' .
@@ -126,17 +127,17 @@ $all_tables_result = PMA_queryAsControlUser($all_tables_query);
if (is_object($all_tables_result)
&& $GLOBALS['dbi']->numRows($all_tables_result) > 0
) {
- PMA_displayTrackedTables(
+ Tracking::displayTrackedTables(
$GLOBALS['db'], $all_tables_result, $url_query, $pmaThemeImage,
$text_dir, $cfgRelation
);
}
-$untracked_tables = PMA_getUntrackedTables($GLOBALS['db']);
+$untracked_tables = Tracking::getUntrackedTables($GLOBALS['db']);
// If untracked tables exist
if (count($untracked_tables) > 0) {
- PMA_displayUntrackedTables(
+ Tracking::displayUntrackedTables(
$GLOBALS['db'], $untracked_tables, $url_query, $pmaThemeImage, $text_dir
);
}
@@ -147,5 +148,5 @@ if (count($data['ddlog']) > 0) {
$log .= '# ' . $entry['date'] . ' ' . $entry['username'] . "\n"
. $entry['statement'] . "\n";
}
- echo PhpMyAdmin\Util::getMessage(__('Database Log'), $log);
+ echo Util::getMessage(__('Database Log'), $log);
}