class Tracking

PhpMyAdmin\Tracking class

Properties

Template $template
protected Relation $relation

Methods

__construct(SqlQueryForm $sqlQueryForm, Template $template, Relation $relation)

Tracking constructor.

array
filter(array $data, string $filter_ts_from, string $filter_ts_to, array $filter_users)

Filters tracking entries

string
getHtmlForActivateDeactivateTracking(string $action, string $urlQuery, int $lastVersion)

Function to get html for activate/deactivate tracking

array
getListOfVersionsOfTable()

Function to get the list versions of the table

string
getHtmlForMainPage(array $urlParams, string $pmaThemeImage, string $textDir, int $lastVersion = null)

Function to get html for main page parts that do not use $_REQUEST

int
getTableLastVersionNumber(array $sql_result)

Function to get the last version number of a table

array
getSqlResultForSelectableTables()

Function to get sql results for selectable tables

string
getHtmlForTrackingReport(array $data, array $url_params, boolean $selection_schema, boolean $selection_data, boolean $selection_both, int $filter_ts_to, int $filter_ts_from, array $filter_users)

Function to get html for tracking report and tracking report export

array
getHtmlForElementsOfTrackingReport(boolean $selection_schema, boolean $selection_data, boolean $selection_both)

Generate HTML element for report form

string
getHtmlForTrackingReportExportForm1(array $data, array $url_params, boolean $selection_schema, boolean $selection_data, boolean $selection_both, int $filter_ts_to, int $filter_ts_from, array $filter_users, string $str1, string $str2, string $str3, string $str4, string $str5, string $drop_image_or_text)

Generate HTML for export form

string
getHtmlForTrackingReportExportForm2(array $url_params, string $str1, string $str2, string $str3, string $str4, string $str5)

Generate HTML for export form

string
getHtmlForDataManipulationStatements(array $data, array $filter_users, int $filter_ts_from, int $filter_ts_to, array $url_params, int $ddlog_count, string $drop_image_or_text)

Function to get html for data manipulation statements

array
getHtmlForDataDefinitionStatements(array $data, array $filter_users, int $filter_ts_from, int $filter_ts_to, array $url_params, string $drop_image_or_text)

Function to get html for data definition statements in schema snapshot

string
getHtmlForSchemaSnapshot(array $params)

Function to get html for schema snapshot

string
getHtmlForColumns(array $columns)

Function to get html for displaying columns in the schema snapshot

string
getHtmlForIndexes(array $indexes)

Function to get html for the indexes in schema snapshot

string
deleteTrackingReportRows(array $data)

Function to handle the tracking report

string
deleteFromTrackingReportLog(array $data, string $which_log, string $type, string $message)

Function to delete from a tracking report log

string
exportAsSqlDump(array $entries)

Function to export as sql dump

array
exportAsSqlExecution(array $entries)

Function to export as sql execution

void
exportAsFileDownload(array $entries)

Function to export as entries

string
changeTracking(string $action)

Function to activate or deactivate tracking

string
getTrackingSet()

Function to get tracking set

string
deleteTrackingVersion(string $version)

Deletes a tracking version

string
createTrackingVersion()

Function to create the tracking version

void
createTrackingForMultipleTables(array $selected)

Create tracking version for multiple tables

array
getEntries(array $data, int $filter_ts_from, int $filter_ts_to, array $filter_users)

Function to get the entries

string
getVersionStatus(array $version)

Function to get version status

string
getHtmlForDbTrackingTables(string $db, array $urlParams, string $pmaThemeImage, string $textDir)

Get HTML for tracked and untracked tables

array
extractTableNames(array $table_list, string $db, boolean $testing = false)

Helper function: Recursive function for getting table names from $table_list

array
getUntrackedTables(string $db)

Get untracked tables

Details

at line 40
__construct(SqlQueryForm $sqlQueryForm, Template $template, Relation $relation)

Tracking constructor.

Parameters

SqlQueryForm $sqlQueryForm SqlQueryForm instance
Template $template Template instance
Relation $relation Relation instance

at line 57
array filter(array $data, string $filter_ts_from, string $filter_ts_to, array $filter_users)

Filters tracking entries

Parameters

array $data the entries to filter
string $filter_ts_from "from" date
string $filter_ts_to "to" date
array $filter_users users

Return Value

array filtered entries

at line 93
string getHtmlForActivateDeactivateTracking(string $action, string $urlQuery, int $lastVersion)

Function to get html for activate/deactivate tracking

Parameters

string $action activate|deactivate
string $urlQuery url query
int $lastVersion last version

Return Value

string HTML

at line 112
array getListOfVersionsOfTable()

Function to get the list versions of the table

Return Value

array

at line 138
string getHtmlForMainPage(array $urlParams, string $pmaThemeImage, string $textDir, int $lastVersion = null)

Function to get html for main page parts that do not use $_REQUEST

Parameters

array $urlParams url parameters
string $pmaThemeImage path to theme's image folder
string $textDir text direction
int $lastVersion last tracking version

Return Value

string

at line 191
int getTableLastVersionNumber(array $sql_result)

Function to get the last version number of a table

Parameters

array $sql_result sql result

Return Value

int

at line 202
array getSqlResultForSelectableTables()

Function to get sql results for selectable tables

Return Value

array

at line 231
string getHtmlForTrackingReport(array $data, array $url_params, boolean $selection_schema, boolean $selection_data, boolean $selection_both, int $filter_ts_to, int $filter_ts_from, array $filter_users)

Function to get html for tracking report and tracking report export

Parameters

array $data data
array $url_params url params
boolean $selection_schema selection schema
boolean $selection_data selection data
boolean $selection_both selection both
int $filter_ts_to filter time stamp from
int $filter_ts_from filter time stamp tp
array $filter_users filter users

Return Value

string

at line 315
array getHtmlForElementsOfTrackingReport(boolean $selection_schema, boolean $selection_data, boolean $selection_both)

Generate HTML element for report form

Parameters

boolean $selection_schema selection schema
boolean $selection_data selection data
boolean $selection_both selection both

Return Value

array

at line 368
string getHtmlForTrackingReportExportForm1(array $data, array $url_params, boolean $selection_schema, boolean $selection_data, boolean $selection_both, int $filter_ts_to, int $filter_ts_from, array $filter_users, string $str1, string $str2, string $str3, string $str4, string $str5, string $drop_image_or_text)

Generate HTML for export form

Parameters

array $data data
array $url_params url params
boolean $selection_schema selection schema
boolean $selection_data selection data
boolean $selection_both selection both
int $filter_ts_to filter time stamp from
int $filter_ts_from filter time stamp tp
array $filter_users filter users
string $str1 HTML for logtype select
string $str2 HTML for "from date"
string $str3 HTML for "to date"
string $str4 HTML for user
string $str5 HTML for "list report"
string $drop_image_or_text HTML for image or text

Return Value

string HTML for form

at line 444
string getHtmlForTrackingReportExportForm2(array $url_params, string $str1, string $str2, string $str3, string $str4, string $str5)

Generate HTML for export form

Parameters

array $url_params Parameters
string $str1 HTML for logtype select
string $str2 HTML for "from date"
string $str3 HTML for "to date"
string $str4 HTML for user
string $str5 HTML for "list report"

Return Value

string HTML for form

at line 510
string getHtmlForDataManipulationStatements(array $data, array $filter_users, int $filter_ts_from, int $filter_ts_to, array $url_params, int $ddlog_count, string $drop_image_or_text)

Function to get html for data manipulation statements

Parameters

array $data data
array $filter_users filter users
int $filter_ts_from filter time staml from
int $filter_ts_to filter time stamp to
array $url_params url parameters
int $ddlog_count data definition log count
string $drop_image_or_text drop image or text

Return Value

string

at line 548
array getHtmlForDataDefinitionStatements(array $data, array $filter_users, int $filter_ts_from, int $filter_ts_to, array $url_params, string $drop_image_or_text)

Function to get html for data definition statements in schema snapshot

Parameters

array $data data
array $filter_users filter users
int $filter_ts_from filter time stamp from
int $filter_ts_to filter time stamp to
array $url_params url parameters
string $drop_image_or_text drop image or text

Return Value

array

at line 645
string getHtmlForSchemaSnapshot(array $params)

Function to get html for schema snapshot

Parameters

array $params url parameters

Return Value

string

at line 700
string getHtmlForColumns(array $columns)

Function to get html for displaying columns in the schema snapshot

Parameters

array $columns columns

Return Value

string

at line 714
string getHtmlForIndexes(array $indexes)

Function to get html for the indexes in schema snapshot

Parameters

array $indexes indexes

Return Value

string

at line 728
string deleteTrackingReportRows(array $data)

Function to handle the tracking report

Parameters

array $data tracked data

Return Value

string HTML for the message

at line 763
string deleteFromTrackingReportLog(array $data, string $which_log, string $type, string $message)

Function to delete from a tracking report log

Parameters

array $data tracked data
string $which_log ddlog|dmlog
string $type DDL|DML
string $message success message

Return Value

string HTML for the message

at line 796
string exportAsSqlDump(array $entries)

Function to export as sql dump

Parameters

array $entries entries

Return Value

string HTML SQL query form

at line 839
array exportAsSqlExecution(array $entries)

Function to export as sql execution

Parameters

array $entries entries

Return Value

array

at line 856
void exportAsFileDownload(array $entries)

Function to export as entries

Parameters

array $entries entries

Return Value

void

at line 889
string changeTracking(string $action)

Function to activate or deactivate tracking

Parameters

string $action activate|deactivate

Return Value

string HTML for the success message

at line 923
string getTrackingSet()

Function to get tracking set

Return Value

string

at line 980
string deleteTrackingVersion(string $version)

Deletes a tracking version

Parameters

string $version tracking version

Return Value

string HTML of the success message

at line 1007
string createTrackingVersion()

Function to create the tracking version

Return Value

string HTML of the success message

at line 1040
void createTrackingForMultipleTables(array $selected)

Create tracking version for multiple tables

Parameters

array $selected list of selected tables

Return Value

void

at line 1065
array getEntries(array $data, int $filter_ts_from, int $filter_ts_to, array $filter_users)

Function to get the entries

Parameters

array $data data
int $filter_ts_from filter time stamp from
int $filter_ts_to filter time stamp to
array $filter_users filter users

Return Value

array

at line 1129
string getVersionStatus(array $version)

Function to get version status

Parameters

array $version version info

Return Value

string The status message

at line 1148
string getHtmlForDbTrackingTables(string $db, array $urlParams, string $pmaThemeImage, string $textDir)

Get HTML for tracked and untracked tables

Parameters

string $db current database
array $urlParams url parameters
string $pmaThemeImage path to theme's image folder
string $textDir text direction

Return Value

string HTML

at line 1218
array extractTableNames(array $table_list, string $db, boolean $testing = false)

Helper function: Recursive function for getting table names from $table_list

Parameters

array $table_list Table list
string $db Current database
boolean $testing Testing

Return Value

array

at line 1245
array getUntrackedTables(string $db)

Get untracked tables

Parameters

string $db current database

Return Value

array