<?php
+namespace Adminer;
+
$PROCEDURE = ($_GET["name"] ? $_GET["name"] : $_GET["call"]);
page_header(lang('Call') . ": " . h($PROCEDURE), $error);
<?php
+namespace Adminer;
+
$TABLE = $_GET["check"];
$name = $_GET["name"];
$row = $_POST;
<?php
+namespace Adminer;
+
$TABLE = $_GET["create"];
$partition_by = array();
foreach (array('HASH', 'LINEAR HASH', 'KEY', 'LINEAR KEY', 'RANGE', 'LIST') as $key) {
<?php
+namespace Adminer;
+
$row = $_POST;
if ($_POST && !$error && !isset($_POST["add_x"])) { // add is an image and PHP changes add.x to add_x
<?php
+namespace Adminer;
+
$tables_views = array_merge((array) $_POST["tables"], (array) $_POST["views"]);
if ($tables_views && !$error && !$_POST["search"]) {
<?php
+namespace Adminer;
+
$TABLE = $_GET["download"];
$fields = fields($TABLE);
header("Content-Type: application/octet-stream");
<?php
+namespace Adminer;
+
$drivers["mongo"] = "MongoDB (alpha)";
if (isset($_GET["mongo"])) {
* @author Jakub Vrana
*/
+namespace Adminer;
+
$drivers["mssql"] = "MS SQL";
if (isset($_GET["mssql"])) {
<?php
+namespace Adminer;
+
$drivers = array("server" => "MySQL") + $drivers;
if (!defined("DRIVER")) {
define("DRIVER", "server"); // server - backwards compatibility
// MySQLi supports everything, MySQL doesn't support multiple result sets, PDO_MySQL doesn't support orgtable
if (extension_loaded("mysqli")) {
- class Min_DB extends MySQLi {
+ class Min_DB extends \MySQLi {
var $extension = "MySQLi";
function __construct() {
<?php
+namespace Adminer;
+
$drivers["oracle"] = "Oracle (beta)";
if (isset($_GET["oracle"])) {
<?php
+namespace Adminer;
+
$drivers["pgsql"] = "PostgreSQL";
if (isset($_GET["pgsql"])) {
<?php
+namespace Adminer;
+
$drivers["sqlite"] = "SQLite";
if (isset($_GET["sqlite"])) {
var $extension = "SQLite3", $server_info, $affected_rows, $errno, $error, $_link;
function __construct($filename) {
- $this->_link = new SQLite3($filename);
+ $this->_link = new \SQLite3($filename);
$version = $this->_link->version();
$this->server_info = $version["versionString"];
}
}
- if (class_exists("Min_SQLite")) {
+ if (class_exists('Adminer\Min_SQLite')) {
class Min_DB extends Min_SQLite {
function __construct() {
<?php
+namespace Adminer;
+
$TABLE = $_GET["dump"];
if ($_POST && !$error) {
<?php
+namespace Adminer;
+
$TABLE = $_GET["edit"];
$fields = fields($TABLE);
$where = (isset($_GET["select"]) ? ($_POST["check"] && count($_POST["check"]) == 1 ? where_check($_POST["check"][0], $fields) : "") : where($_GET, $fields));
<?php
+namespace Adminer;
+
$EVENT = $_GET["event"];
$intervals = array("YEAR", "QUARTER", "MONTH", "DAY", "HOUR", "MINUTE", "WEEK", "SECOND", "YEAR_MONTH", "DAY_HOUR", "DAY_MINUTE", "DAY_SECOND", "HOUR_MINUTE", "HOUR_SECOND", "MINUTE_SECOND");
$statuses = array("ENABLED" => "ENABLE", "DISABLED" => "DISABLE", "SLAVESIDE_DISABLED" => "DISABLE ON SLAVE");
<?php
+namespace Adminer;
+
// caching headers added in compile.php
if ($_GET["file"] == "favicon.ico") {
<?php
+namespace Adminer;
+
$TABLE = $_GET["foreign"];
$name = $_GET["name"];
$row = $_POST;
<?php
+namespace Adminer;
+
// any method change in this file should be transferred to editor/include/adminer.inc.php and plugins/plugin.php
class Adminer {
<?php
+namespace Adminer;
+
$connection = '';
$has_token = $_SESSION["token"];
exit;
}
-if (isset($_GET["username"]) && !class_exists("Min_DB")) {
+if (isset($_GET["username"]) && !class_exists('Adminer\Min_DB')) {
unset($_SESSION["pwds"][DRIVER]);
unset_permanent();
page_header(lang('No extension'), lang('None of the supported PHP extensions (%s) are available.', implode(", ", $possible_drivers)), false);
<?php
+namespace Adminer;
+
include "../adminer/include/version.inc.php";
include "../adminer/include/errors.inc.php";
include "../adminer/include/coverage.inc.php";
<?php
+namespace Adminer;
+
if (isset($_GET["status"])) {
$_GET["variables"] = $_GET["status"];
}
<?php
+namespace Adminer;
+
// coverage is used in tests and removed in compilation
if (extension_loaded("xdebug") && file_exists(sys_get_temp_dir() . "/adminer_coverage.ser")) {
function save_coverage() {
<?php
+namespace Adminer;
+
if (!ob_get_level()) {
ob_start(null, 4096);
}
<?php
+namespace Adminer;
+
$drivers = array();
/** Add a driver
<?php
+namespace Adminer;
+
// This file is not used in Adminer Editor.
/** Print select result
<?php
+namespace Adminer;
+
function adminer_errors($errno, $errstr) {
return !!preg_match('~^(Trying to access array offset on( value of type)? null|Undefined (array key|property))~', $errstr);
}
error_reporting(6135); // errors and warnings
-set_error_handler('adminer_errors', E_WARNING);
+set_error_handler('Adminer\adminer_errors', E_WARNING);
<?php
+namespace Adminer;
+
// This file is used both in Adminer and Adminer Editor.
/** Get database connection
<?php
+namespace Adminer;
+
// not used in a single language version
$langs = array(
<?php
+namespace Adminer;
+
// PDO can be used in several database drivers
if (extension_loaded('pdo')) {
/*abstract*/ class Min_PDO {
}
}
- class Min_PDOStatement extends PDOStatement {
+ class Min_PDOStatement extends \PDOStatement {
var $_offset = 0, $num_rows;
function fetch_assoc() {
<?php
+namespace Adminer;
class TmpFile {
var $handler;
<?php
+namespace Adminer;
+
$VERSION = "5.0.0-dev";
<?php
+namespace Adminer;
+
/** PHP implementation of XXTEA encryption algorithm
* @author Ma Bingyao <andot@ujn.edu.cn>
* @link http://www.coolcode.cn/?action=show&id=128
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
+namespace Adminer;
+
include "./include/bootstrap.inc.php";
include "./include/tmpfile.inc.php";
<?php
+namespace Adminer;
+
$TABLE = $_GET["indexes"];
$index_types = array("PRIMARY", "UNIQUE", "INDEX");
$table_status = table_status($TABLE, true);
<?php
+namespace Adminer;
+
$translations = array(
'Login' => 'تسجيل الدخول',
'Logout successful.' => 'تم تسجيل الخروج بنجاح.',
<?php
+namespace Adminer;
+
$translations = array(
// label for database system selection (MySQL, SQLite, ...)
'System' => 'Система',
<?php
+namespace Adminer;
+
$translations = array(
'Login' => 'লগইন',
'Logout successful.' => 'সফলভাবে লগআউট হয়েছে।',
<?php
+namespace Adminer;
+
$translations = array(
// label for database system selection (MySQL, SQLite, ...)
'System' => 'Sistem',
<?php
+namespace Adminer;
+
$translations = array(
'Login' => 'Inicia la sessió',
'Logout successful.' => 'Desconnexió correcta.',
<?php
+namespace Adminer;
+
$translations = array(
// label for database system selection (MySQL, SQLite, ...)
'System' => 'Systém',
<?php
+namespace Adminer;
+
$translations = array(
'System' => 'System',
'Server' => 'Server',
<?php
+namespace Adminer;
+
$translations = array(
'Login' => 'Login',
'Logout successful.' => 'Abmeldung erfolgreich.',
<?php
+namespace Adminer;
+
$translations = array(
// label for database system selection (MySQL, SQLite, ...)
'System' => 'Σύστημα',
<?php
+namespace Adminer;
+
$translations = array(
'Too many unsuccessful logins, try again in %d minute(s).' => array('Too many unsuccessful logins, try again in %d minute.', 'Too many unsuccessful logins, try again in %d minutes.'),
'Query executed OK, %d row(s) affected.' => array('Query executed OK, %d row affected.', 'Query executed OK, %d rows affected.'),
<?php
+namespace Adminer;
+
$translations = array(
'Login' => 'Login',
'Logout successful.' => 'Sesión finalizada con éxito.',
<?php
+namespace Adminer;
+
$translations = array(
'Login' => 'Logi sisse',
'Logout successful.' => 'Väljalogimine õnnestus.',
<?php
+namespace Adminer;
+
$translations = array(
// label for database system selection (MySQL, SQLite, ...)
'System' => 'سیستم',
<?php
+namespace Adminer;
+
$translations = array(
// label for database system selection (MySQL, SQLite, ...)
'System' => 'Järjestelmä',
<?php
+namespace Adminer;
+
$translations = array(
'Login' => 'Authentification',
'Logout successful.' => 'Au revoir !',
<?php
+namespace Adminer;
+
$translations = array(
'Login' => 'Conectar',
'Logout successful.' => 'Pechouse a sesión con éxito.',
<?php
+namespace Adminer;
+
$translations = array(
'Login' => 'התחברות',
'Logout successful.' => 'ההתחברות הצליחה',
<?php
+namespace Adminer;
+
$translations = array(
'Login' => 'Belépés',
'Logout successful.' => 'Sikeres kilépés.',
<?php
+namespace Adminer;
+
$translations = array(
// label for database system selection (MySQL, SQLite, ...)
'System' => 'Sistem',
<?php
+namespace Adminer;
+
$translations = array(
'Login' => 'Autenticazione',
'Logout successful.' => 'Uscita effettuata con successo.',
<?php
+namespace Adminer;
+
$translations = array(
'Login' => 'ログイン',
'Logout successful.' => 'ログアウト',
<?php
+namespace Adminer;
+
$translations = array(
'Login' => 'შესვლა',
'Logout successful.' => 'გამოხვედით სისტემიდან.',
<?php
+namespace Adminer;
+
$translations = array(
'$1-$3-$5' => '$1-$3-$5',
'%.3f s' => '%.3f 초',
<?php
+namespace Adminer;
+
$translations = array(
// label for database system selection (MySQL, SQLite, ...)
'System' => 'Sistema',
<?php
+namespace Adminer;
+
$translations = array(
'Login' => 'Ieiet',
'Logout successful.' => 'Jūs veiksmīgi izgājāt no sistēmas.',
<?php
+namespace Adminer;
+
$translations = array(
// label for database system selection (MySQL, SQLite, ...)
'System' => 'Sistem',
<?php
+namespace Adminer;
+
$translations = array(
'Login' => 'Aanmelden',
'Logout successful.' => 'Successvol afgemeld.',
<?php
+namespace Adminer;
+
$translations = array(
'System' => 'System',
'Server' => 'Server',
<?php
+namespace Adminer;
+
$translations = array(
// label for database system selection (MySQL, SQLite, ...)
'System' => 'Rodzaj bazy',
<?php
+namespace Adminer;
+
$translations = array(
'Login' => 'Entrar',
'Logout successful.' => 'Saída bem sucedida.',
<?php
+namespace Adminer;
+
$translations = array(
'Login' => 'Entrar',
'Logout successful.' => 'Sessão terminada com sucesso.',
<?php
+namespace Adminer;
+
$translations = array(
'Login' => 'Intră',
'Logout successful.' => 'Ați ieșit cu succes.',
<?php
+namespace Adminer;
+
$translations = array(
'Login' => 'Войти',
'Logout successful.' => 'Вы успешно покинули систему.',
<?php
+namespace Adminer;
+
$translations = array(
'Login' => 'Prihlásiť sa',
'Logout successful.' => 'Odhlásenie prebehlo v poriadku.',
<?php
+namespace Adminer;
+
$translations = array(
// label for database system selection (MySQL, SQLite, ...)
'System' => 'Sistem',
<?php
+namespace Adminer;
+
$translations = array(
// label for database system selection (MySQL, SQLite, ...)
'System' => 'Систем',
<?php
+namespace Adminer;
+
$translations = array(
// label for database system selection (MySQL, SQLite, ...)
'System' => 'System',
<?php
+namespace Adminer;
+
$translations = array(
'Login' => 'நுழை',
'Logout successful.' => 'வெற்றிகரமாய் வெளியேறியாயிற்று.',
<?php
+namespace Adminer;
+
$translations = array(
'Login' => 'เข้าสู่ระบบ',
'Logout successful.' => 'ออกจากระบบเรียบร้อยแล้ว.',
<?php
+namespace Adminer;
+
$translations = array(
// label for database system selection (MySQL, SQLite, ...)
'System' => 'Sistem',
<?php
+namespace Adminer;
+
$translations = array(
// label for database system selection (MySQL, SQLite, ...)
'System' => 'Система Бази Даних',
<?php
+namespace Adminer;
+
$translations = array(
// label for database system selection (MySQL, SQLite, ...)
'System' => 'Hệ thống',
<?php
+namespace Adminer;
+
$translations = array(
// label for database system selection (MySQL, SQLite, ...)
'System' => 'Xx',
<?php
+namespace Adminer;
+
$translations = array(
// label for database system selection (MySQL, SQLite, ...)
'System' => '資料庫系統',
<?php
+namespace Adminer;
+
$translations = array(
// label for database system selection (MySQL, SQLite, ...)
'System' => '系统',
<?php
+namespace Adminer;
+
page_header(lang('Privileges'));
echo '<p class="links"><a href="' . h(ME) . 'user=">' . lang('Create user') . "</a>";
<?php
+namespace Adminer;
+
$PROCEDURE = ($_GET["name"] ? $_GET["name"] : $_GET["procedure"]);
$routine = (isset($_GET["function"]) ? "FUNCTION" : "PROCEDURE");
$row = $_POST;
<?php
+namespace Adminer;
+
if (support("kill")) {
if ($_POST && !$error) {
$killed = 0;
<?php
+namespace Adminer;
+
page_header(lang('Database schema'), "", array(), h(DB . ($_GET["ns"] ? ".$_GET[ns]" : "")));
$table_pos = array();
<?php
+namespace Adminer;
+
$row = $_POST;
if ($_POST && !$error) {
<?php
+namespace Adminer;
+
header("Content-Type: text/javascript; charset=utf-8");
if ($_GET["script"] == "db") {
<?php
+namespace Adminer;
+
$TABLE = $_GET["select"];
$table_status = table_status1($TABLE);
$indexes = indexes($TABLE);
<?php
+namespace Adminer;
+
$SEQUENCE = $_GET["sequence"];
$row = $_POST;
<?php
+namespace Adminer;
+
if (!$error && $_POST["export"]) {
dump_headers("sql");
$adminer->dumpTable("", "");
<?php
+namespace Adminer;
+
$TABLE = $_GET["table"];
$fields = fields($TABLE);
if (!$fields) {
<?php
+namespace Adminer;
+
$TABLE = $_GET["trigger"];
$name = $_GET["name"];
$trigger_options = trigger_options();
<?php
+namespace Adminer;
+
$TYPE = $_GET["type"];
$row = $_POST;
<?php
+namespace Adminer;
+
$USER = $_GET["user"];
$privileges = array("" => array("All privileges" => ""));
foreach (get_rows("SHOW PRIVILEGES") as $row) {
<?php
+namespace Adminer;
+
$status = isset($_GET["status"]);
page_header($status ? lang('Status') : lang('Variables'));
<?php
+namespace Adminer;
+
$TABLE = $_GET["view"];
$row = $_POST;
$orig_type = "VIEW";
#!/usr/bin/env php
<?php
+namespace Adminer;
+
include __DIR__ . "/adminer/include/version.inc.php";
include __DIR__ . "/adminer/include/errors.inc.php";
include __DIR__ . "/externals/JsShrink/jsShrink.php";
<?php
+namespace Adminer;
+
page_header(lang('Server'), "", false);
if ($adminer->homepage()) {
<?php
+namespace Adminer;
+
class Adminer {
var $operators = array("<=", ">=");
var $_values = array();
<?php
+namespace Adminer;
+
$connection->select_db($adminer->database());
<?php
+namespace Adminer;
+
/** Encode e-mail header in UTF-8
* @param string
* @return string
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
+namespace Adminer;
+
include "../adminer/include/bootstrap.inc.php";
$drivers[DRIVER] = lang('Login');
<?php
+namespace Adminer;
+
if ($_GET["script"] == "kill") {
$connection->query("KILL " . number($_POST["kill"]));
#!/usr/bin/env php
<?php
+namespace Adminer;
+
include __DIR__ . "/adminer/include/errors.inc.php";
unset($_COOKIE["adminer_lang"]);
<exclude name="PSR12.Files.FileHeader.SpacingAfterBlock"/>
<exclude name="PSR12.Operators.OperatorSpacing.NoSpaceBefore"/>
<exclude name="PSR12.Operators.OperatorSpacing.NoSpaceAfter"/>
- <exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace"/>
<exclude name="PSR1.Classes.ClassDeclaration.MultipleClasses"/>
<exclude name="PSR2.Classes.ClassDeclaration.OpenBraceNewLine"/><!-- Replaced by: Generic.Classes.OpeningBraceSameLine -->
<exclude name="PSR2.Classes.ClassDeclaration.CloseBraceAfterBody"/>
<exclude name="Generic.WhiteSpace.ScopeIndent.IncorrectExact"/>
</rule>
+ <rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
+ <exclude-pattern>plugins/[^/]+\.php</exclude-pattern>
+ </rule>
+
<rule ref="Generic.Classes.OpeningBraceSameLine"/>
<rule ref="Generic.Whitespace.DisallowSpaceIndent"/>
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie"/>
<?php
+namespace Adminer;
+
add_driver("clickhouse", "ClickHouse (alpha)");
if (isset($_GET["clickhouse"])) {
<?php
+namespace Adminer;
+
add_driver("elastic", "Elasticsearch 7 (beta)");
if (isset($_GET["elastic"])) {
<?php
+namespace Adminer;
+
add_driver("elastic5", "Elasticsearch 5 (beta)");
if (isset($_GET["elastic5"])) {
* @author Steve Krämer
*/
+namespace Adminer;
+
add_driver('firebird', 'Firebird (alpha)');
if (isset($_GET["firebird"])) {
<?php
+namespace Adminer;
+
add_driver("simpledb", "SimpleDB");
if (isset($_GET["simpledb"])) {
function head() {
echo $this->prepend;
- if ($this->langPath && function_exists('get_lang')) { // since Adminer 3.2.0
+ if ($this->langPath) {
$lang = get_lang();
$lang = ($lang == "zh" ? "zh-CN" : ($lang == "zh-tw" ? "zh-TW" : $lang));
if ($lang != "en" && file_exists(sprintf($this->langPath, $lang))) {
}
function head() {
- $lang = "en";
- if (function_exists('get_lang')) { // since Adminer 3.2.0
- $lang = get_lang();
- $lang = ($lang == "zh" ? "zh-cn" : ($lang == "zh-tw" ? "zh" : $lang));
- if (!file_exists(dirname($this->path) . "/langs/$lang.js")) {
- $lang = "en";
- }
+ $lang = get_lang();
+ $lang = ($lang == "zh" ? "zh-cn" : ($lang == "zh-tw" ? "zh" : $lang));
+ if (!file_exists(dirname($this->path) . "/langs/$lang.js")) {
+ $lang = "en";
}
echo script_src($this->path);
?>
function editInput($table, $field, $attrs, $value) {
static $lang = "";
if (!$lang && preg_match("~text~", $field["type"]) && preg_match("~_html~", $field["field"])) {
- $lang = "en";
- if (function_exists('get_lang')) { // since Adminer 3.2.0
- $lang = get_lang();
- $lang = ($lang == "zh" || $lang == "zh-tw" ? "zh_cn" : $lang);
- }
+ $lang = get_lang();
+ $lang = ($lang == "zh" || $lang == "zh-tw" ? "zh_cn" : $lang);
return "<textarea$attrs id='fields-" . h($field["field"]) . "' rows='12' cols='50'>" . h($value) . "</textarea>" . script("
jQuery('#fields-" . js_escape($field["field"]) . "').wymeditor({ updateSelector: '#form [type=\"submit\"]', lang: '$lang'" . ($this->options ? ", $this->options" : "") . " });
");