1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-07 07:06:45 +02:00

Compile: Do not warn about functions without declared support

This commit is contained in:
Jakub Vrana
2025-02-25 06:30:16 +01:00
parent 242f5a1ed8
commit 0d8028ddc5

View File

@@ -66,7 +66,29 @@ header("Cache-Control: immutable");
$matches
); //! respect context (extension, class)
$functions = array_combine($matches[1], $matches[0]);
//! do not warn about functions without declared support()
$requires = array(
"check" => array("check_constraints"),
"copy" => array("copy_tables"),
"database" => array("create_database", "rename_database", "drop_databases"),
"dump" => array("use_sql", "create_sql", "truncate_sql", "trigger_sql"),
"indexes" => array("indexes"),
"kill" => array("kill_process", "connection_id", "max_connections"),
"processlist" => array("process_list"),
"routine" => array("routines", "routine", "routine_languages", "create_routine", "routine_id"),
"scheme" => array("schemas", "get_schema", "set_schema"),
"status" => array("show_status"),
"table" => array("search_tables", "is_view"),
"trigger" => array("triggers", "trigger", "trigger_options", "trigger_sql"),
"type" => array("types"),
"variables" => array("show_variables"),
);
foreach ($requires as $support => $fns) {
if (!support($support)) {
foreach ($fns as $fn) {
unset($functions[$fn]);
}
}
}
unset($functions["__construct"], $functions["__destruct"], $functions["set_charset"]);
foreach ($functions as $val) {
if (!strpos($return, "$val(")) {