}
/** Check if table supports foreign keys
- * @param TableStatus $table_status result of table_status1()
+ * @param TableStatus $table_status
*/
function fk_support(array $table_status): bool {
return preg_match('~InnoDB|IBMDB2I' . (min_version(5.6) ? '|NDB' : '') . '~i', $table_status["Engine"]);
* @param 'FUNCTION'|'PROCEDURE' $type
* @return Routine
*/
- function routine(string $name, $type): array {
+ function routine(string $name, string $type): array {
global $driver;
$aliases = array("bool", "boolean", "integer", "double precision", "real", "dec", "numeric", "fixed", "national char", "national varchar");
$space = "(?:\\s|/\\*[\s\S]*?\\*/|(?:#|-- )[^\n]*\n?|--\r?\n)";
}
/** Get routine signature
- * @param Routine $row result of routine()
+ * @param Routine $row
*/
function routine_id(string $name, array $row): string {
return idf_escape($name);
}
/** Convert field in select and edit
- * @param Field $field one element from fields()
+ * @param Field $field
* @return string|void
*/
function convert_field(array $field) {
}
/** Convert value in edit after applying functions back
- * @param Field $field one element from fields()
+ * @param Field $field
* @param string $return SQL expression
*/
function unconvert_field(array $field, string $return): string {
}
/** Table caption used in navigation and headings
- * @param TableStatus $tableStatus result of table_status1()
+ * @param TableStatus $tableStatus
* @return string HTML code, "" to ignore table
*/
function tableName(array $tableStatus): string {
}
/** Field caption used in select and edit
- * @param Field $field single field returned from fields()
+ * @param Field $field
* @param int $order order of column in select
* @return string HTML code, "" to ignore field
*/
}
/** Print links after select heading
- * @param TableStatus $tableStatus result of table_status1()
+ * @param TableStatus $tableStatus
* @param ?string $set new item options, NULL for no new item
*/
function selectLinks(array $tableStatus, ?string $set = ""): void {
}
/** Print backward keys for row
- * @param BackwardKey[] $backwardKeys result of $this->backwardKeys()
+ * @param BackwardKey[] $backwardKeys
* @param string[] $row
*/
function backwardKeysPrint(array $backwardKeys, array $row): void {
/** Get a link to use in select table
* @param string $val raw value of the field
- * @param Field $field single field returned from fields()
+ * @param Field $field
* @return string|void null to create the default link
*/
function selectLink(?string $val, array $field) {
/** Value printed in select table
* @param ?string $val HTML-escaped value to print
* @param ?string $link link to foreign key
- * @param Field $field single field returned from fields()
+ * @param Field $field
* @param string $original original value before applying editVal() and escaping
*/
function selectVal(?string $val, ?string $link, array $field, ?string $original): string {
}
/** Value conversion used in select and edit
- * @param Field $field single field returned from fields()
+ * @param Field $field
*/
function editVal(?string $val, array $field): ?string {
return $val;
}
/** Print table structure in tabular format
- * @param Field[] $fields data about individual fields
+ * @param Field[] $fields
* @param TableStatus $tableStatus
*/
function tableStructurePrint(array $fields, array $tableStatus = null): void {
}
/** Print list of indexes on table in tabular format
- * @param Index[] $indexes data about all indexes on a table
+ * @param Index[] $indexes
*/
function tableIndexesPrint(array $indexes): void {
echo "<table>\n";
}
/** Functions displayed in edit form
- * @param Field $field single field from fields()
+ * @param Field $field
* @return list<string>
*/
function editFunctions(array $field): array {
}
/** Get options to display edit field
- * @param string $table table name
- * @param Field $field single field from fields()
+ * @param Field $field
* @param string $attrs attributes to use inside the tag
* @return string custom input field or empty string for default
*/
}
/** Get hint for edit field
- * @param string $table table name
- * @param Field $field single field from fields()
+ * @param Field $field
*/
function editHint(string $table, array $field, ?string $value): string {
return "";
}
/** Process sent input
- * @param Field $field single field from fields()
+ * @param Field $field
* @return string expression to use in a query
*/
function processInput(array $field, string $value, ?string $function = ""): string {
}
/** Set up syntax highlight for code and <textarea>
- * @param TableStatus[] $tables result of table_status('', true)
+ * @param TableStatus[] $tables
*/
function syntaxHighlighting(array $tables): void {
global $connection;
}
/** Print table list in menu
- * @param TableStatus[] $tables result of table_status('', true)
+ * @param TableStatus[] $tables
*/
function tablesPrint(array $tables): void {
global $adminer;
}
/** Print HTML footer
-* @param string $missing "auth", "db", "ns"
+* @param ''|'auth'|'db'|'ns' $missing
*/
function page_footer(string $missing = ""): void {
global $adminer;
}
/** Check whether table supports indexes
- * @param TableStatus $table_status result of table_status1()
+ * @param TableStatus $table_status
*/
function supportsIndex(array $table_status): bool {
return !is_view($table_status);
}
/** Issue grant or revoke commands
-* @param string $grant GRANT or REVOKE
+* @param 'GRANT'|'REVOKE' $grant
* @param list<string> $privileges
* @return Result|bool
*/
}
/** Generate SQL query for creating trigger
-* @param Trigger $row result of trigger()
+* @param Trigger $row
*/
function create_trigger(string $on, array $row): string {
$timing_event = " $row[Timing] $row[Event]" . (preg_match('~ OF~', $row["Event"]) ? " $row[Of]" : ""); // SQL injection
/** Generate SQL query for creating routine
* @param 'PROCEDURE'|'FUNCTION' $routine
-* @param Routine $row result of routine()
+* @param Routine $row
*/
function create_routine($routine, array $row): string {
global $driver;
/** Find unique identifier of a row
* @param string[] $row
-* @param Index[] $indexes result of indexes()
+* @param Index[] $indexes
* @return string[]|void null if there is no unique identifier
*/
function unique_array(?array $row, array $indexes) {
}
/** Send Location header and exit
-* @param string $location null to only set a message
+* @param ?string $location null to only set a message
*/
-function redirect(string $location, string $message = null): void {
+function redirect(?string $location, string $message = null): void {
if ($message !== null) {
restart_session();
$_SESSION["messages"][preg_replace('~^[^?]*~', '', ($location !== null ? $location : $_SERVER["REQUEST_URI"]))][] = $message;
}
/** Print enum or set input field
-* @param string $type "radio"|"checkbox"
+* @param 'radio'|'checkbox' $type
* @param Field $field
* @param mixed $value string|array
*/
}
/** Print edit input field
-* @param Field|RoutineField $field one field from fields()
+* @param Field|RoutineField $field
* @param mixed $value
*/
function input(array $field, $value, string $function, bool $autofocus = false): void {
}
/** Process edit input field
-* @param Field|RoutineField $field one field from fields()
+* @param Field|RoutineField $field
* @return mixed false to leave the original value
*/
function process_input(array $field) {
protected $password_hash;
/** Set allowed password
- * @param string $password_hash result of password_hash
+ * @param string $password_hash result of password_hash()
*/
function __construct(string $password_hash) {
$this->password_hash = $password_hash;