class Operations

Set of functions with the operations section in phpMyAdmin

Methods

__construct(DatabaseInterface $dbi, Relation $relation)

Operations constructor.

string
getHtmlForDatabaseComment(string $db)

Get HTML output for database comment

string
getHtmlForRenameDatabase(string $db, string $db_collation)

Get HTML output for rename database

string
getHtmlForDropDatabaseLink(string $db)

Get HTML for database drop link

string
getHtmlForCopyDatabase(string $db, string $db_collation)

Get HTML snippet for copy database

string
getHtmlForChangeDatabaseCharset(string $db, string $db_collation)

Get HTML snippet for change database charset

void
runProcedureAndFunctionDefinitions(string $db)

Run the Procedure definitions and function definitions

void
createDbBeforeCopy()

Create database before copy

array
getViewsAndCreateSqlViewStandIn(array $tables_full, ExportSql $export_sql_plugin, string $db)

Get views as an array and create SQL view stand-in

array
copyTables(array $tables_full, boolean $move, string $db)

Get sql query for copy/rename table and boolean for whether copy/rename or not

void
runEventDefinitionsForDb(string $db)

Run the EVENT definition for selected database

void
handleTheViews(array $views, boolean $move, string $db)

Handle the views, return the boolean value whether table rename/copy or not

void
adjustPrivilegesMoveDb(string $oldDb, string $newname)

Adjust the privileges after Renaming the db

void
adjustPrivilegesCopyDb(string $oldDb, string $newname)

Adjust the privileges after Copying the db

void
createAllAccumulatedConstraints(array $sqlConstratints)

Create all accumulated constraints

void
duplicateBookmarks(boolean $_error, string $db)

Duplicate the bookmarks for the db (done once for each db)

string
getHtmlForOrderTheTable(array $columns)

Get the HTML snippet for order the table

string
getHtmlForMoveTable()

Get the HTML snippet for move table

string
getTableOptionDiv(Table $pma_table, string $comment, string $tbl_collation, string $tbl_storage_engine, string $pack_keys, string $auto_increment, string $delay_key_write, string $transactional, string $page_checksum, string $checksum)

Get the HTML div for Table option

string
getHtmlForCopytable()

Get HTML div for copy table

string
getHtmlForTableMaintenance(Table $pma_table, array $url_params)

Get HTML snippet for table maintenance

string
getHtmlForDeleteDataOrTable(array $truncate_table_url_params, array $dropTableUrlParams)

Get HTML for Delete data or table (truncate table, drop table)

string
getDeleteDataOrTablelink(array $url_params, string $syntax, string $link, string $htmlId)

Get the HTML link for Truncate table, Drop table and Drop db

string
getHtmlForPartitionMaintenance(array $partition_names, array $url_params)

Get HTML snippet for partition maintenance

string
getHtmlForReferentialIntegrityCheck(array $foreign, array $url_params)

Get the HTML for Referential Integrity check

array
getQueryAndResultForReorderingTable()

Reorder table based on request params

array
getTableAltersArray(Table $pma_table, string $pack_keys, string $checksum, string $page_checksum, string $delay_key_write, string $row_format, string $newTblStorageEngine, string $transactional, string $tbl_collation)

Get table alters array

array
getWarningMessagesArray()

Get warning messages array

array
getQueryAndResultForPartition()

Get SQL query and result after ran this SQL query for a partition operation has been requested by the user

void
adjustPrivilegesRenameOrMoveTable(string $oldDb, string $oldTable, string $newDb, string $newTable)

Adjust the privileges after renaming/moving a table

void
adjustPrivilegesCopyTable(string $oldDb, string $oldTable, string $newDb, string $newTable)

Adjust the privileges after copying a table

void
changeAllColumnsCollation(string $db, string $table, string $tbl_collation)

Change all collations and character sets of all columns in table

void
moveOrCopyTable(string $db, string $table)

Move or copy a table

Details

at line 39
__construct(DatabaseInterface $dbi, Relation $relation)

Operations constructor.

Parameters

DatabaseInterface $dbi DatabaseInterface object
Relation $relation Relation object

at line 52
string getHtmlForDatabaseComment(string $db)

Get HTML output for database comment

Parameters

string $db database name

Return Value

string

at line 87
string getHtmlForRenameDatabase(string $db, string $db_collation)

Get HTML output for rename database

Parameters

string $db database name
string $db_collation dataset collation

Return Value

string

Get HTML for database drop link

Parameters

string $db database name

Return Value

string

at line 197
string getHtmlForCopyDatabase(string $db, string $db_collation)

Get HTML snippet for copy database

Parameters

string $db database name
string $db_collation dataset collation

Return Value

string

at line 298
string getHtmlForChangeDatabaseCharset(string $db, string $db_collation)

Get HTML snippet for change database charset

Parameters

string $db database name
string $db_collation dataset collation

Return Value

string

at line 367
void runProcedureAndFunctionDefinitions(string $db)

Run the Procedure definitions and function definitions

to avoid selecting alternatively the current and new db we would need to modify the CREATE definitions to qualify the db name

Parameters

string $db database name

Return Value

void

at line 411
void createDbBeforeCopy()

Create database before copy

Return Value

void

at line 448
array getViewsAndCreateSqlViewStandIn(array $tables_full, ExportSql $export_sql_plugin, string $db)

Get views as an array and create SQL view stand-in

Parameters

array $tables_full array of all tables in given db or dbs
ExportSql $export_sql_plugin export plugin instance
string $db database name

Return Value

array

at line 496
array copyTables(array $tables_full, boolean $move, string $db)

Get sql query for copy/rename table and boolean for whether copy/rename or not

Parameters

array $tables_full array of all tables in given db or dbs
boolean $move whether database name is empty or not
string $db database name

Return Value

array SQL queries for the constraints

at line 569
void runEventDefinitionsForDb(string $db)

Run the EVENT definition for selected database

to avoid selecting alternatively the current and new db we would need to modify the CREATE definitions to qualify the db name

Parameters

string $db database name

Return Value

void

at line 596
void handleTheViews(array $views, boolean $move, string $db)

Handle the views, return the boolean value whether table rename/copy or not

Parameters

array $views views as an array
boolean $move whether database name is empty or not
string $db database name

Return Value

void

at line 637
void adjustPrivilegesMoveDb(string $oldDb, string $newname)

Adjust the privileges after Renaming the db

Parameters

string $oldDb Database name before renaming
string $newname New Database name requested

Return Value

void

at line 685
void adjustPrivilegesCopyDb(string $oldDb, string $newname)

Adjust the privileges after Copying the db

Parameters

string $oldDb Database name before copying
string $newname New Database name requested

Return Value

void

at line 788
void createAllAccumulatedConstraints(array $sqlConstratints)

Create all accumulated constraints

Parameters

array $sqlConstratints array of sql constraints for the database

Return Value

void

at line 806
void duplicateBookmarks(boolean $_error, string $db)

Duplicate the bookmarks for the db (done once for each db)

Parameters

boolean $_error whether table rename/copy or not
string $db database name

Return Value

void

at line 833
string getHtmlForOrderTheTable(array $columns)

Get the HTML snippet for order the table

Parameters

array $columns columns array

Return Value

string

at line 875
string getHtmlForMoveTable()

Get the HTML snippet for move table

Return Value

string

at line 956
string getTableOptionDiv(Table $pma_table, string $comment, string $tbl_collation, string $tbl_storage_engine, string $pack_keys, string $auto_increment, string $delay_key_write, string $transactional, string $page_checksum, string $checksum)

Get the HTML div for Table option

Parameters

Table $pma_table Table object
string $comment Comment
string $tbl_collation table collation
string $tbl_storage_engine table storage engine
string $pack_keys pack keys
string $auto_increment value of auto increment
string $delay_key_write delay key write
string $transactional value of transactional
string $page_checksum value of page checksum
string $checksum the checksum

Return Value

string

at line 1335
string getHtmlForCopytable()

Get HTML div for copy table

Return Value

string

at line 1441
string getHtmlForTableMaintenance(Table $pma_table, array $url_params)

Get HTML snippet for table maintenance

Parameters

Table $pma_table Table object
array $url_params array of URL parameters

Return Value

string

at line 1608
string getHtmlForDeleteDataOrTable(array $truncate_table_url_params, array $dropTableUrlParams)

Get HTML for Delete data or table (truncate table, drop table)

Parameters

array $truncate_table_url_params url parameter array for truncate table
array $dropTableUrlParams url parameter array for drop table

Return Value

string

Get the HTML link for Truncate table, Drop table and Drop db

Parameters

array $url_params url parameter array for delete data or table
string $syntax TRUNCATE_TABLE or DROP_TABLE or DROP_DATABASE
string $link link to be shown
string $htmlId id of the link

Return Value

string html output

at line 1671
string getHtmlForPartitionMaintenance(array $partition_names, array $url_params)

Get HTML snippet for partition maintenance

Parameters

array $partition_names array of partition names for a specific db/table
array $url_params url parameters

Return Value

string

at line 1764
string getHtmlForReferentialIntegrityCheck(array $foreign, array $url_params)

Get the HTML for Referential Integrity check

Parameters

array $foreign all Relations to foreign tables for a given table or optionally a given column in a table
array $url_params array of url parameters

Return Value

string

at line 1827
array getQueryAndResultForReorderingTable()

Reorder table based on request params

Return Value

array SQL query and result

at line 1864
array getTableAltersArray(Table $pma_table, string $pack_keys, string $checksum, string $page_checksum, string $delay_key_write, string $row_format, string $newTblStorageEngine, string $transactional, string $tbl_collation)

Get table alters array

Parameters

Table $pma_table The Table object
string $pack_keys pack keys
string $checksum value of checksum
string $page_checksum value of page checksum
string $delay_key_write delay key write
string $row_format row format
string $newTblStorageEngine table storage engine
string $transactional value of transactional
string $tbl_collation collation of the table

Return Value

array

at line 1965
array getWarningMessagesArray()

Get warning messages array

Return Value

array

at line 1993
array getQueryAndResultForPartition()

Get SQL query and result after ran this SQL query for a partition operation has been requested by the user

Return Value

array $sql_query, $result

at line 2024
void adjustPrivilegesRenameOrMoveTable(string $oldDb, string $oldTable, string $newDb, string $newTable)

Adjust the privileges after renaming/moving a table

Parameters

string $oldDb Database name before table renaming/moving table
string $oldTable Table name before table renaming/moving table
string $newDb Database name after table renaming/ moving table
string $newTable Table name after table renaming/moving table

Return Value

void

at line 2061
void adjustPrivilegesCopyTable(string $oldDb, string $oldTable, string $newDb, string $newTable)

Adjust the privileges after copying a table

Parameters

string $oldDb Database name before table copying
string $oldTable Table name before table copying
string $newDb Database name after table copying
string $newTable Table name after table copying

Return Value

void

at line 2123
void changeAllColumnsCollation(string $db, string $table, string $tbl_collation)

Change all collations and character sets of all columns in table

Parameters

string $db Database name
string $table Table name
string $tbl_collation Collation Name

Return Value

void

at line 2147
void moveOrCopyTable(string $db, string $table)

Move or copy a table

Parameters

string $db current database name
string $table current table name

Return Value

void