class StructureController extends AbstractController

Handles database structure logic

Properties

protected Response $response from AbstractController
protected DatabaseInterface $dbi from AbstractController
protected Template $template from AbstractController
protected string $db from AbstractController
protected int $numTables
protected int $position
protected bool $dbIsSystemSchema
protected int $totalNumTables
protected array $tables
protected bool $isShowStats

Methods

__construct(Response $response, DatabaseInterface $dbi, Template $template, string $db, Relation $relation, Replication $replication)

Constructor

string
index(array $params)

Index action

array|null
addRemoveFavoriteTablesAction(array $params)

Add or remove favorite tables

array
handleRealRowCountRequestAction(array $params)

Handles request for real row count on database level view page.

void
multiSubmitAction()

Handles actions related to multiple tables

string
displayTableList()

Displays the list of tables

string
getTrackingIcon(string $table)

Returns the tracking icon if the table is tracked

array
isRowCountApproximated(array $current_table, bool $table_is_view)

Returns whether the row count is approximated

array
getReplicationStatus(string $table)

Returns the replication status of the table.

array
synchronizeFavoriteTables(RecentFavoriteTable $favoriteInstance, string $user, array $favoriteTables)

Synchronize favorite tables

bool
checkFavoriteTable(string $currentTable)

Function to check if a table is already in favorite list.

bool
hasTable(array $db, string $truename)

Find table with truename

array
getStuffForEngineTypeTable(array $current_table, integer $sum_size, integer $overhead_size)

Get the value set for ENGINE table,

array
getValuesForAriaTable(array $current_table, integer $sum_size, integer $overhead_size, integer $formatted_size, string $unit, integer $formatted_overhead, string $overhead_unit)

Get values for ARIA/MARIA tables

array
getValuesForInnodbTable(array $current_table, integer $sum_size)

Get values for InnoDB table

Details

at line 79
__construct(Response $response, DatabaseInterface $dbi, Template $template, string $db, Relation $relation, Replication $replication)

Constructor

Parameters

Response $response Response object
DatabaseInterface $dbi DatabaseInterface object
Template $template Template that should be used (if provided, default one otherwise)
string $db Database name
Relation $relation Relation instance
Replication $replication Replication instance

at line 121
string index(array $params)

Index action

Parameters

array $params Request parameters

Return Value

string HTML

at line 195
array|null addRemoveFavoriteTablesAction(array $params)

Add or remove favorite tables

Parameters

array $params Request parameters

Return Value

array|null JSON

at line 278
array handleRealRowCountRequestAction(array $params)

Handles request for real row count on database level view page.

Parameters

array $params Request parameters

Return Value

array JSON

at line 313
void multiSubmitAction()

Handles actions related to multiple tables

Return Value

void

at line 336
protected string displayTableList()

Displays the list of tables

Return Value

string HTML

at line 667
protected string getTrackingIcon(string $table)

Returns the tracking icon if the table is tracked

Parameters

string $table table name

Return Value

string HTML for tracking icon

at line 693
protected array isRowCountApproximated(array $current_table, bool $table_is_view)

Returns whether the row count is approximated

Parameters

array $current_table array containing details about the table
bool $table_is_view whether the table is a view

Return Value

array

at line 745
protected array getReplicationStatus(string $table)

Returns the replication status of the table.

Parameters

string $table table name

Return Value

array

at line 804
protected array synchronizeFavoriteTables(RecentFavoriteTable $favoriteInstance, string $user, array $favoriteTables)

Synchronize favorite tables

Parameters

RecentFavoriteTable $favoriteInstance Instance of this class
string $user The user hash
array $favoriteTables Existing favorites

Return Value

array

at line 838
protected bool checkFavoriteTable(string $currentTable)

Function to check if a table is already in favorite list.

Parameters

string $currentTable current table

Return Value

bool

at line 858
protected bool hasTable(array $db, string $truename)

Find table with truename

Parameters

array $db DB to look into
string $truename Table name

Return Value

bool

at line 884
protected array getStuffForEngineTypeTable(array $current_table, integer $sum_size, integer $overhead_size)

Get the value set for ENGINE table,

Parameters

array $current_table current table
integer $sum_size total table size
integer $overhead_size overhead size

Return Value

array

at line 991
protected array getValuesForAriaTable(array $current_table, integer $sum_size, integer $overhead_size, integer $formatted_size, string $unit, integer $formatted_overhead, string $overhead_unit)

Get values for ARIA/MARIA tables

Parameters

array $current_table current table
integer $sum_size sum size
integer $overhead_size overhead size
integer $formatted_size formatted size
string $unit unit
integer $formatted_overhead overhead formatted
string $overhead_unit overhead unit

Return Value

array

at line 1046
protected array getValuesForInnodbTable(array $current_table, integer $sum_size)

Get values for InnoDB table

Parameters

array $current_table current table
integer $sum_size sum size

Return Value

array