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

Use private visibility on methods

This commit is contained in:
Jakub Vrana
2025-03-11 07:56:28 +01:00
parent c454ea8430
commit 0c15a9f42d
8 changed files with 103 additions and 103 deletions

View File

@@ -16,7 +16,7 @@ if (isset($_GET["mssql"])) {
var $extension = "sqlsrv", $server_info, $affected_rows, $errno, $error; var $extension = "sqlsrv", $server_info, $affected_rows, $errno, $error;
private $link, $result; private $link, $result;
function _get_error() { private function get_error() {
$this->error = ""; $this->error = "";
foreach (sqlsrv_errors() as $error) { foreach (sqlsrv_errors() as $error) {
$this->errno = $error["code"]; $this->errno = $error["code"];
@@ -44,7 +44,7 @@ if (isset($_GET["mssql"])) {
$info = sqlsrv_server_info($this->link); $info = sqlsrv_server_info($this->link);
$this->server_info = $info['SQLServerVersion']; $this->server_info = $info['SQLServerVersion'];
} else { } else {
$this->_get_error(); $this->get_error();
} }
return (bool) $this->link; return (bool) $this->link;
} }
@@ -62,7 +62,7 @@ if (isset($_GET["mssql"])) {
$result = sqlsrv_query($this->link, $query); //! , array(), ($unbuffered ? array() : array("Scrollable" => "keyset")) $result = sqlsrv_query($this->link, $query); //! , array(), ($unbuffered ? array() : array("Scrollable" => "keyset"))
$this->error = ""; $this->error = "";
if (!$result) { if (!$result) {
$this->_get_error(); $this->get_error();
return false; return false;
} }
return $this->store_result($result); return $this->store_result($result);
@@ -72,7 +72,7 @@ if (isset($_GET["mssql"])) {
$this->result = sqlsrv_query($this->link, $query); $this->result = sqlsrv_query($this->link, $query);
$this->error = ""; $this->error = "";
if (!$this->result) { if (!$this->result) {
$this->_get_error(); $this->get_error();
return false; return false;
} }
return true; return true;

View File

@@ -248,7 +248,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row //! requires MySQL 5
); );
echo "</div>\n"; echo "</div>\n";
unset($columns[$name]); unset($columns[$name]);
} elseif (is_array($options = $this->_foreignKeyOptions($_GET["select"], $name))) { } elseif (is_array($options = $this->foreignKeyOptions($_GET["select"], $name))) {
if ($fields[$name]["null"]) { if ($fields[$name]["null"]) {
$options[0] = '(' . lang('empty') . ')'; $options[0] = '(' . lang('empty') . ')';
} }
@@ -482,7 +482,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row //! requires MySQL 5
. enum_input("radio", $attrs, $field, ($value || isset($_GET["select"]) ? $value : 0), ($field["null"] ? "" : null)) . enum_input("radio", $attrs, $field, ($value || isset($_GET["select"]) ? $value : 0), ($field["null"] ? "" : null))
; ;
} }
$options = $this->_foreignKeyOptions($table, $field["field"], $value); $options = $this->foreignKeyOptions($table, $field["field"], $value);
if ($options !== null) { if ($options !== null) {
return (is_array($options) return (is_array($options)
? "<select$attrs>" . optionlist($options, $value, true) . "</select>" ? "<select$attrs>" . optionlist($options, $value, true) . "</select>"
@@ -651,7 +651,7 @@ qsl('div').onclick = whisperClick;", "")
} }
} }
function _foreignKeyOptions($table, $column, $value = null) { private function foreignKeyOptions($table, $column, $value = null) {
if (list($target, $id, $name) = $this->_foreignColumn(column_foreign_keys($table), $column)) { if (list($target, $id, $name) = $this->_foreignColumn(column_foreign_keys($table), $column)) {
$return = &$this->values[$target]; $return = &$this->values[$target];
if ($return === null) { if ($return === null) {

View File

@@ -66,8 +66,8 @@ if (isset($_GET["simpledb"])) {
$row['itemName()'] = (string) $item->Name; $row['itemName()'] = (string) $item->Name;
} }
foreach ($item->Attribute as $attribute) { foreach ($item->Attribute as $attribute) {
$name = $this->_processValue($attribute->Name); $name = $this->processValue($attribute->Name);
$value = $this->_processValue($attribute->Value); $value = $this->processValue($attribute->Value);
if (isset($row[$name])) { if (isset($row[$name])) {
$row[$name] = (array) $row[$name]; $row[$name] = (array) $row[$name];
$row[$name][] = $value; $row[$name][] = $value;
@@ -85,7 +85,7 @@ if (isset($_GET["simpledb"])) {
$this->num_rows = count($this->rows); $this->num_rows = count($this->rows);
} }
function _processValue($element) { private function processValue($element) {
return (is_object($element) && $element['encoding'] == 'base64' ? base64_decode($element) : (string) $element); return (is_object($element) && $element['encoding'] == 'base64' ? base64_decode($element) : (string) $element);
} }
@@ -128,7 +128,7 @@ if (isset($_GET["simpledb"])) {
public $primary = "itemName()"; public $primary = "itemName()";
function _chunkRequest($ids, $action, $params, $expand = array()) { private function chunkRequest($ids, $action, $params, $expand = array()) {
$connection = connection(); $connection = connection();
foreach (array_chunk($ids, 25) as $chunk) { foreach (array_chunk($ids, 25) as $chunk) {
$params2 = $params; $params2 = $params;
@@ -146,7 +146,7 @@ if (isset($_GET["simpledb"])) {
return true; return true;
} }
function _extractIds($table, $queryWhere, $limit) { private function extractIds($table, $queryWhere, $limit) {
$return = array(); $return = array();
if (preg_match_all("~itemName\(\) = (('[^']*+')+)~", $queryWhere, $matches)) { if (preg_match_all("~itemName\(\) = (('[^']*+')+)~", $queryWhere, $matches)) {
$return = array_map('Adminer\idf_unescape', $matches[1]); $return = array_map('Adminer\idf_unescape', $matches[1]);
@@ -167,8 +167,8 @@ if (isset($_GET["simpledb"])) {
} }
function delete($table, $queryWhere, $limit = 0) { function delete($table, $queryWhere, $limit = 0) {
return $this->_chunkRequest( return $this->chunkRequest(
$this->_extractIds($table, $queryWhere, $limit), $this->extractIds($table, $queryWhere, $limit),
'BatchDeleteAttributes', 'BatchDeleteAttributes',
array('DomainName' => $table) array('DomainName' => $table)
); );
@@ -178,7 +178,7 @@ if (isset($_GET["simpledb"])) {
$delete = array(); $delete = array();
$insert = array(); $insert = array();
$i = 0; $i = 0;
$ids = $this->_extractIds($table, $queryWhere, $limit); $ids = $this->extractIds($table, $queryWhere, $limit);
$id = idf_unescape($set["`itemName()`"]); $id = idf_unescape($set["`itemName()`"]);
unset($set["`itemName()`"]); unset($set["`itemName()`"]);
foreach ($set as $key => $val) { foreach ($set as $key => $val) {
@@ -198,8 +198,8 @@ if (isset($_GET["simpledb"])) {
} }
} }
$params = array('DomainName' => $table); $params = array('DomainName' => $table);
return (!$insert || $this->_chunkRequest(($id != "" ? array($id) : $ids), 'BatchPutAttributes', $params, $insert)) return (!$insert || $this->chunkRequest(($id != "" ? array($id) : $ids), 'BatchPutAttributes', $params, $insert))
&& (!$delete || $this->_chunkRequest($ids, 'BatchDeleteAttributes', $params, $delete)) && (!$delete || $this->chunkRequest($ids, 'BatchDeleteAttributes', $params, $delete))
; ;
} }

View File

@@ -8,14 +8,14 @@
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other) * @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/ */
class AdminerJsonColumn { class AdminerJsonColumn {
private function _testJson($value) { private function testJson($value) {
if ((substr($value, 0, 1) == '{' || substr($value, 0, 1) == '[') && ($json = json_decode($value, true))) { if ((substr($value, 0, 1) == '{' || substr($value, 0, 1) == '[') && ($json = json_decode($value, true))) {
return $json; return $json;
} }
return $value; return $value;
} }
private function _buildTable($json) { private function buildTable($json) {
echo '<table style="margin:2px; font-size:100%;">'; echo '<table style="margin:2px; font-size:100%;">';
foreach ($json as $key => $val) { foreach ($json as $key => $val) {
echo '<tr>'; echo '<tr>';
@@ -31,7 +31,7 @@ class AdminerJsonColumn {
} }
echo '<code class="jush-js">' . $val . '</code>'; echo '<code class="jush-js">' . $val . '</code>';
} else { } else {
$this->_buildTable($val); $this->buildTable($val);
} }
echo '</td>'; echo '</td>';
echo '</tr>'; echo '</tr>';
@@ -40,9 +40,9 @@ class AdminerJsonColumn {
} }
function editInput($table, $field, $attrs, $value) { function editInput($table, $field, $attrs, $value) {
$json = $this->_testJson($value); $json = $this->testJson($value);
if ($json !== $value) { if ($json !== $value) {
$this->_buildTable($json); $this->buildTable($json);
} }
} }
} }

View File

@@ -25,11 +25,11 @@ class AdminerPlugin extends Adminer\Adminer {
//! it is possible to use ReflectionObject to find out which plugins defines which methods at once //! it is possible to use ReflectionObject to find out which plugins defines which methods at once
} }
function _callParent($function, $args) { private function callParent($function, $args) {
return call_user_func_array(array('parent', $function), $args); return call_user_func_array(array('parent', $function), $args);
} }
function _applyPlugin($function, $args) { private function applyPlugin($function, $args) {
foreach ($this->plugins as $plugin) { foreach ($this->plugins as $plugin) {
if (method_exists($plugin, $function)) { if (method_exists($plugin, $function)) {
switch (count($args)) { // call_user_func_array() doesn't work well with references switch (count($args)) { // call_user_func_array() doesn't work well with references
@@ -62,11 +62,11 @@ class AdminerPlugin extends Adminer\Adminer {
} }
} }
} }
return $this->_callParent($function, $args); return $this->callParent($function, $args);
} }
function _appendPlugin($function, $args) { private function appendPlugin($function, $args) {
$return = $this->_callParent($function, $args); $return = $this->callParent($function, $args);
foreach ($this->plugins as $plugin) { foreach ($this->plugins as $plugin) {
if (method_exists($plugin, $function)) { if (method_exists($plugin, $function)) {
$value = call_user_func_array(array($plugin, $function), $args); $value = call_user_func_array(array($plugin, $function), $args);
@@ -82,333 +82,333 @@ class AdminerPlugin extends Adminer\Adminer {
function dumpFormat() { function dumpFormat() {
$args = func_get_args(); $args = func_get_args();
return $this->_appendPlugin(__FUNCTION__, $args); return $this->appendPlugin(__FUNCTION__, $args);
} }
function dumpOutput() { function dumpOutput() {
$args = func_get_args(); $args = func_get_args();
return $this->_appendPlugin(__FUNCTION__, $args); return $this->appendPlugin(__FUNCTION__, $args);
} }
function editRowPrint($table, $fields, $row, $update) { function editRowPrint($table, $fields, $row, $update) {
$args = func_get_args(); $args = func_get_args();
return $this->_appendPlugin(__FUNCTION__, $args); return $this->appendPlugin(__FUNCTION__, $args);
} }
function editFunctions($field) { function editFunctions($field) {
$args = func_get_args(); $args = func_get_args();
return $this->_appendPlugin(__FUNCTION__, $args); return $this->appendPlugin(__FUNCTION__, $args);
} }
// applyPlugin // applyPlugin
function name() { function name() {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function credentials() { function credentials() {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function connectSsl() { function connectSsl() {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function permanentLogin($create = false) { function permanentLogin($create = false) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function bruteForceKey() { function bruteForceKey() {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function serverName($server) { function serverName($server) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function database() { function database() {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function schemas() { function schemas() {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function databases($flush = true) { function databases($flush = true) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function queryTimeout() { function queryTimeout() {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function headers() { function headers() {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function csp() { function csp() {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function head() { function head() {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function css() { function css() {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function loginForm() { function loginForm() {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function loginFormField($name, $heading, $value) { function loginFormField($name, $heading, $value) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function login($login, $password) { function login($login, $password) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function tableName($tableStatus) { function tableName($tableStatus) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function fieldName($field, $order = 0) { function fieldName($field, $order = 0) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function selectLinks($tableStatus, $set = "") { function selectLinks($tableStatus, $set = "") {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function foreignKeys($table) { function foreignKeys($table) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function backwardKeys($table, $tableName) { function backwardKeys($table, $tableName) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function backwardKeysPrint($backwardKeys, $row) { function backwardKeysPrint($backwardKeys, $row) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function selectQuery($query, $start, $failed = false) { function selectQuery($query, $start, $failed = false) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function sqlCommandQuery($query) { function sqlCommandQuery($query) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function rowDescription($table) { function rowDescription($table) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function rowDescriptions($rows, $foreignKeys) { function rowDescriptions($rows, $foreignKeys) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function selectLink($val, $field) { function selectLink($val, $field) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function selectVal($val, $link, $field, $original) { function selectVal($val, $link, $field, $original) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function editVal($val, $field) { function editVal($val, $field) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function tableStructurePrint($fields) { function tableStructurePrint($fields) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function tableIndexesPrint($indexes) { function tableIndexesPrint($indexes) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function selectColumnsPrint($select, $columns) { function selectColumnsPrint($select, $columns) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function selectSearchPrint($where, $columns, $indexes) { function selectSearchPrint($where, $columns, $indexes) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function selectOrderPrint($order, $columns, $indexes) { function selectOrderPrint($order, $columns, $indexes) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function selectLimitPrint($limit) { function selectLimitPrint($limit) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function selectLengthPrint($text_length) { function selectLengthPrint($text_length) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function selectActionPrint($indexes) { function selectActionPrint($indexes) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function selectCommandPrint() { function selectCommandPrint() {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function selectImportPrint() { function selectImportPrint() {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function selectEmailPrint($emailFields, $columns) { function selectEmailPrint($emailFields, $columns) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function selectColumnsProcess($columns, $indexes) { function selectColumnsProcess($columns, $indexes) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function selectSearchProcess($fields, $indexes) { function selectSearchProcess($fields, $indexes) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function selectOrderProcess($fields, $indexes) { function selectOrderProcess($fields, $indexes) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function selectLimitProcess() { function selectLimitProcess() {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function selectLengthProcess() { function selectLengthProcess() {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function selectEmailProcess($where, $foreignKeys) { function selectEmailProcess($where, $foreignKeys) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function selectQueryBuild($select, $where, $group, $order, $limit, $page) { function selectQueryBuild($select, $where, $group, $order, $limit, $page) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function messageQuery($query, $time, $failed = false) { function messageQuery($query, $time, $failed = false) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function editInput($table, $field, $attrs, $value) { function editInput($table, $field, $attrs, $value) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function editHint($table, $field, $value) { function editHint($table, $field, $value) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function processInput($field, $value, $function = "") { function processInput($field, $value, $function = "") {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function dumpDatabase($db) { function dumpDatabase($db) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function dumpTable($table, $style, $is_view = 0) { function dumpTable($table, $style, $is_view = 0) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function dumpData($table, $style, $query) { function dumpData($table, $style, $query) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function dumpFilename($identifier) { function dumpFilename($identifier) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function dumpHeaders($identifier, $multi_table = false) { function dumpHeaders($identifier, $multi_table = false) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function importServerPath() { function importServerPath() {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function homepage() { function homepage() {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function navigation($missing) { function navigation($missing) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function databasesPrint($missing) { function databasesPrint($missing) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
function tablesPrint($tables) { function tablesPrint($tables) {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->applyPlugin(__FUNCTION__, $args);
} }
} }

View File

@@ -10,7 +10,7 @@ class AdminerPrettyJsonColumn {
$this->adminer = $adminer; $this->adminer = $adminer;
} }
private function _testJson($value) { private function testJson($value) {
if ((substr($value, 0, 1) == '{' || substr($value, 0, 1) == '[') && ($json = json_decode($value, true))) { if ((substr($value, 0, 1) == '{' || substr($value, 0, 1) == '[') && ($json = json_decode($value, true))) {
return $json; return $json;
} }
@@ -18,7 +18,7 @@ class AdminerPrettyJsonColumn {
} }
function editInput($table, $field, $attrs, $value) { function editInput($table, $field, $attrs, $value) {
$json = $this->_testJson($value); $json = $this->testJson($value);
if ($json !== $value) { if ($json !== $value) {
$jsonText = json_encode($json, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); $jsonText = json_encode($json, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
return <<<HTML return <<<HTML
@@ -30,7 +30,7 @@ HTML;
function processInput($field, $value, $function = '') { function processInput($field, $value, $function = '') {
if ($function === '') { if ($function === '') {
$json = $this->_testJson($value); $json = $this->testJson($value);
if ($json !== $value) { if ($json !== $value) {
$value = json_encode($json); $value = json_encode($json);
} }

View File

@@ -17,14 +17,14 @@ class AdminerSqlLog {
} }
function messageQuery($query, $time, $failed = false) { function messageQuery($query, $time, $failed = false) {
$this->_log($query); $this->log($query);
} }
function sqlCommandQuery($query) { function sqlCommandQuery($query) {
$this->_log($query); $this->log($query);
} }
function _log($query) { private function log($query) {
if ($this->filename == "") { if ($this->filename == "") {
$adminer = Adminer\adminer(); $adminer = Adminer\adminer();
$this->filename = $adminer->database() . ".sql"; // no database goes to ".sql" to avoid collisions $this->filename = $adminer->database() . ".sql"; // no database goes to ".sql" to avoid collisions

View File

@@ -18,7 +18,7 @@ CREATE TABLE translation (
*/ */
class AdminerTranslation { class AdminerTranslation {
function _translate($idf) { private function translate($idf) {
static $translations, $lang; static $translations, $lang;
if ($lang === null) { if ($lang === null) {
$lang = Adminer\get_lang(); $lang = Adminer\get_lang();
@@ -39,16 +39,16 @@ class AdminerTranslation {
} }
function tableName(&$tableStatus) { function tableName(&$tableStatus) {
$tableStatus["Comment"] = $this->_translate($tableStatus["Comment"]); $tableStatus["Comment"] = $this->translate($tableStatus["Comment"]);
} }
function fieldName(&$field, $order = 0) { function fieldName(&$field, $order = 0) {
$field["comment"] = $this->_translate($field["comment"]); $field["comment"] = $this->translate($field["comment"]);
} }
function editVal(&$val, $field) { function editVal(&$val, $field) {
if ($field["type"] == "enum") { if ($field["type"] == "enum") {
$val = $this->_translate($val); $val = $this->translate($val);
} }
} }
} }