mirror of
https://github.com/vrana/adminer.git
synced 2025-08-08 15:47:00 +02:00
Plugins: Use namespace for driver functions
This commit is contained in:
@@ -18,7 +18,7 @@ class AdminerDatabaseHide {
|
|||||||
|
|
||||||
function databases($flush = true) {
|
function databases($flush = true) {
|
||||||
$return = array();
|
$return = array();
|
||||||
foreach (get_databases($flush) as $db) {
|
foreach (Adminer\get_databases($flush) as $db) {
|
||||||
if (!in_array(strtolower($db), $this->disabled)) {
|
if (!in_array(strtolower($db), $this->disabled)) {
|
||||||
$return[] = $db;
|
$return[] = $db;
|
||||||
}
|
}
|
||||||
|
@@ -69,7 +69,7 @@ SELECT @adminer_alter;
|
|||||||
|
|
||||||
function dumpTable($table, $style, $is_view = 0) {
|
function dumpTable($table, $style, $is_view = 0) {
|
||||||
if ($_POST["format"] == "sql_alter") {
|
if ($_POST["format"] == "sql_alter") {
|
||||||
$create = create_sql($table, $_POST["auto_increment"], $style);
|
$create = Adminer\create_sql($table, $_POST["auto_increment"], $style);
|
||||||
if ($is_view) {
|
if ($is_view) {
|
||||||
echo substr_replace($create, " OR REPLACE", 6, 0) . ";\n\n";
|
echo substr_replace($create, " OR REPLACE", 6, 0) . ";\n\n";
|
||||||
} else {
|
} else {
|
||||||
@@ -140,7 +140,7 @@ CREATE PROCEDURE adminer_alter (INOUT alter_command text) BEGIN
|
|||||||
UNTIL done END REPEAT;
|
UNTIL done END REPEAT;
|
||||||
CLOSE columns;
|
CLOSE columns;
|
||||||
IF @alter_table != '' OR add_columns != '' THEN
|
IF @alter_table != '' OR add_columns != '' THEN
|
||||||
SET alter_command = CONCAT(alter_command, 'ALTER TABLE " . table($table) . "', SUBSTR(CONCAT(add_columns, @alter_table), 2), ';\\n');
|
SET alter_command = CONCAT(alter_command, 'ALTER TABLE " . Adminer\table($table) . "', SUBSTR(CONCAT(add_columns, @alter_table), 2), ';\\n');
|
||||||
END IF;
|
END IF;
|
||||||
END;;
|
END;;
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
@@ -30,7 +30,7 @@ class AdminerEditForeign {
|
|||||||
if (preg_match('~binary~', $field["type"])) {
|
if (preg_match('~binary~', $field["type"])) {
|
||||||
$column = "HEX($column)";
|
$column = "HEX($column)";
|
||||||
}
|
}
|
||||||
$options = array("" => "") + Adminer\get_vals("SELECT $column FROM " . table($target) . " ORDER BY 1" . ($this->_limit ? " LIMIT " . ($this->_limit + 1) : ""));
|
$options = array("" => "") + Adminer\get_vals("SELECT $column FROM " . Adminer\table($target) . " ORDER BY 1" . ($this->_limit ? " LIMIT " . ($this->_limit + 1) : ""));
|
||||||
if ($this->_limit && count($options) - 1 > $this->_limit) {
|
if ($this->_limit && count($options) - 1 > $this->_limit) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -17,7 +17,7 @@ class AdminerEnumTypes {
|
|||||||
|
|
||||||
// read types and "cache" it
|
// read types and "cache" it
|
||||||
if (is_null($this->_types)) {
|
if (is_null($this->_types)) {
|
||||||
$types = types();
|
$types = Adminer\types();
|
||||||
$this->_types = array();
|
$this->_types = array();
|
||||||
|
|
||||||
foreach ($types as $type) {
|
foreach ($types as $type) {
|
||||||
|
@@ -25,7 +25,7 @@ class AdminerSlugify {
|
|||||||
if ($slugify === null) {
|
if ($slugify === null) {
|
||||||
$slugify = array();
|
$slugify = array();
|
||||||
$prev = null;
|
$prev = null;
|
||||||
foreach (fields($table) as $name => $val) {
|
foreach (Adminer\fields($table) as $name => $val) {
|
||||||
if ($prev && preg_match('~(^|_)slug(_|$)~', $name)) {
|
if ($prev && preg_match('~(^|_)slug(_|$)~', $name)) {
|
||||||
$slugify[$prev] = $name;
|
$slugify[$prev] = $name;
|
||||||
}
|
}
|
||||||
|
@@ -15,7 +15,7 @@ class AdminerTableStructure {
|
|||||||
function tableStructurePrint($fields) {
|
function tableStructurePrint($fields) {
|
||||||
echo "<div class='scrollable'>\n";
|
echo "<div class='scrollable'>\n";
|
||||||
echo "<table class='nowrap odds'>\n";
|
echo "<table class='nowrap odds'>\n";
|
||||||
echo "<thead><tr><th>" . Adminer\lang('Column') . "<th>" . Adminer\lang('Type') . "<th>" . Adminer\lang('Collation') . "<th>" . Adminer\lang('Nullable') . "<th>" . Adminer\lang('Default') . (support("comment") ? "<th>" . Adminer\lang('Comment') : "") . "</thead>\n";
|
echo "<thead><tr><th>" . Adminer\lang('Column') . "<th>" . Adminer\lang('Type') . "<th>" . Adminer\lang('Collation') . "<th>" . Adminer\lang('Nullable') . "<th>" . Adminer\lang('Default') . (Adminer\support("comment") ? "<th>" . Adminer\lang('Comment') : "") . "</thead>\n";
|
||||||
foreach ($fields as $field) {
|
foreach ($fields as $field) {
|
||||||
echo "<tr><th>" . Adminer\h($field["field"]) . ($field["primary"] ? " (PRIMARY)" : "");
|
echo "<tr><th>" . Adminer\h($field["field"]) . ($field["primary"] ? " (PRIMARY)" : "");
|
||||||
echo "<td><span>" . Adminer\h($field["full_type"]) . "</span>";
|
echo "<td><span>" . Adminer\h($field["full_type"]) . "</span>";
|
||||||
@@ -23,7 +23,7 @@ class AdminerTableStructure {
|
|||||||
echo "<td>" . ($field["collation"] ? " <i>" . Adminer\h($field["collation"]) . "</i>" : "");
|
echo "<td>" . ($field["collation"] ? " <i>" . Adminer\h($field["collation"]) . "</i>" : "");
|
||||||
echo "<td>" . ($field["null"] ? Adminer\lang('Yes') : Adminer\lang('No'));
|
echo "<td>" . ($field["null"] ? Adminer\lang('Yes') : Adminer\lang('No'));
|
||||||
echo "<td>" . Adminer\h($field["default"]);
|
echo "<td>" . Adminer\h($field["default"]);
|
||||||
echo (support("comment") ? "<td>" . Adminer\h($field["comment"]) : "");
|
echo (Adminer\support("comment") ? "<td>" . Adminer\h($field["comment"]) : "");
|
||||||
echo "\n";
|
echo "\n";
|
||||||
}
|
}
|
||||||
echo "</table>\n";
|
echo "</table>\n";
|
||||||
|
Reference in New Issue
Block a user