class Routines

PhpMyAdmin\Rte\Routines class

Methods

__construct(DatabaseInterface $dbi)

Routines constructor.

void
setGlobals()

Sets required globals

void
main(string $type)

Main function for the routines functionality

void
handleEditor()

Handles editor requests for adding or editing an item

array
handleRequestCreateOrEdit(array $errors, string $db)

Handle request to create or edit a routine

array
backupPrivileges()

Backup the privileges

array
create(string $routine_query, string $create_routine, array $privilegesBackup)

Create the routine

flushPrivileges(bool $flushPrivileges)

Flush privileges and get message

array
getDataFromRequest()

This function will generate the values that are required to complete the editor form. It is especially necessary to handle the 'Add another parameter', 'Remove last parameter' and 'Change routine type' functionalities when JS is disabled.

array|bool
getDataFromName(string $name, string $type, bool $all = true)

This function will generate the values that are required to complete the "Edit routine" form given the name of a routine.

string
getParameterRow(array $routine = [], mixed $index = null, string $class = '')

Creates one row for the parameter table used in the routine editor.

string
getEditorForm(string $mode, string $operation, array $routine)

Displays a form used to add/edit a routine

string
getQueryFromRequest()

Composes the query necessary to create a routine from an HTTP request.

void
handleExecute()

Handles requests for executing a routine

string
getExecuteForm(array $routine)

Creates the HTML code that shows the routine execution dialog.

Details

at line 66
__construct(DatabaseInterface $dbi)

Routines constructor.

Parameters

DatabaseInterface $dbi DatabaseInterface object

at line 81
void setGlobals()

Sets required globals

Return Value

void

at line 112
void main(string $type)

Main function for the routines functionality

Parameters

string $type 'FUNCTION' for functions, 'PROCEDURE' for procedures, null for both

Return Value

void

at line 157
void handleEditor()

Handles editor requests for adding or editing an item

Return Value

void

at line 254
array handleRequestCreateOrEdit(array $errors, string $db)

Handle request to create or edit a routine

Parameters

array $errors Errors
string $db DB name

Return Value

array

at line 388
array backupPrivileges()

Backup the privileges

Return Value

array

at line 427
array create(string $routine_query, string $create_routine, array $privilegesBackup)

Create the routine

Parameters

string $routine_query Query to create routine
string $create_routine Query to restore routine
array $privilegesBackup Privileges backup

Return Value

array

at line 501
Message flushPrivileges(bool $flushPrivileges)

Flush privileges and get message

Parameters

bool $flushPrivileges Flush privileges

Return Value

Message

at line 533
array getDataFromRequest()

This function will generate the values that are required to complete the editor form. It is especially necessary to handle the 'Add another parameter', 'Remove last parameter' and 'Change routine type' functionalities when JS is disabled.

Return Value

array Data necessary to create the routine editor.

at line 649
array|bool getDataFromName(string $name, string $type, bool $all = true)

This function will generate the values that are required to complete the "Edit routine" form given the name of a routine.

Parameters

string $name The name of the routine.
string $type Type of routine (ROUTINE|PROCEDURE)
bool $all Whether to return all data or just the info about parameters.

Return Value

array|bool Data necessary to create the routine editor.

at line 761
string getParameterRow(array $routine = [], mixed $index = null, string $class = '')

Creates one row for the parameter table used in the routine editor.

Parameters

array $routine Data for the routine returned by getDataFromRequest() or getDataFromName()
mixed $index Either a numeric index of the row being processed or NULL to create a template row for AJAX request
string $class Class used to hide the direction column, if the row is for a stored function.

Return Value

string HTML code of one row of parameter table for the editor.

at line 831
string getEditorForm(string $mode, string $operation, array $routine)

Displays a form used to add/edit a routine

Parameters

string $mode If the editor will be used to edit a routine or add a new one: 'edit' or 'add'.
string $operation If the editor was previously invoked with JS turned off, this will hold the name of the current operation
array $routine Data for the routine returned by getDataFromRequest() or getDataFromName()

Return Value

string HTML code for the editor.

at line 1123
string getQueryFromRequest()

Composes the query necessary to create a routine from an HTTP request.

Return Value

string The CREATE [ROUTINE | PROCEDURE] query.

at line 1343
void handleExecute()

Handles requests for executing a routine

Return Value

void

at line 1609
string getExecuteForm(array $routine)

Creates the HTML code that shows the routine execution dialog.

Parameters

array $routine Data for the routine returned by getDataFromName()

Return Value

string HTML code for the routine execution dialog.