Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge from master

  • Loading branch information...
commit 9802869d0a32bf5c7d9cace3b8b9fdff2f81f070 2 parents d8c7ea9 + af0cacb
@vrana authored
Showing with 1,437 additions and 704 deletions.
  1. +7 −2 adminer/call.inc.php
  2. +2 −2 adminer/create.inc.php
  3. +3 −2 adminer/database.inc.php
  4. +4 −7 adminer/drivers/mssql.inc.php
  5. +7 −12 adminer/drivers/mysql.inc.php
  6. +3 −6 adminer/drivers/oracle.inc.php
  7. +5 −8 adminer/drivers/pgsql.inc.php
  8. +64 −70 adminer/drivers/sqlite.inc.php
  9. +18 −14 adminer/dump.inc.php
  10. +1 −1  adminer/edit.inc.php
  11. +2 −2 adminer/foreign.inc.php
  12. +216 −24 adminer/include/adminer.inc.php
  13. +7 −7 adminer/include/auth.inc.php
  14. +2 −2 adminer/include/bootstrap.inc.php
  15. +4 −0 adminer/include/connect.inc.php
  16. +2 −2 adminer/include/design.inc.php
  17. +15 −0 adminer/include/editing.inc.php
  18. +0 −176 adminer/include/export.inc.php
  19. +20 −11 adminer/include/functions.inc.php
  20. +1 −0  adminer/include/lang.inc.php
  21. +0 −1  adminer/include/pdo.inc.php
  22. +1 −1  adminer/include/version.inc.php
  23. +3 −2 adminer/index.php
  24. +1 −1  adminer/indexes.inc.php
  25. +268 −0 adminer/lang/ar.inc.php
  26. +16 −10 adminer/lang/ca.inc.php
  27. +214 −199 adminer/lang/cs.inc.php
  28. +7 −0 adminer/lang/de.inc.php
  29. +1 −0  adminer/lang/en.inc.php
  30. +7 −0 adminer/lang/es.inc.php
  31. +7 −0 adminer/lang/et.inc.php
  32. +7 −1 adminer/lang/hu.inc.php
  33. +7 −0 adminer/lang/nl.inc.php
  34. +279 −0 adminer/lang/pl.inc.php
  35. +7 −0 adminer/lang/ru.inc.php
  36. +7 −0 adminer/lang/sk.inc.php
  37. +6 −0 adminer/lang/ta.inc.php
  38. +14 −7 adminer/lang/zh-tw.inc.php
  39. +6 −2 adminer/processlist.inc.php
  40. +15 −17 adminer/schema.inc.php
  41. +2 −2 adminer/script.inc.php
  42. +26 −21 adminer/select.inc.php
  43. +44 −31 adminer/sql.inc.php
  44. +6 −0 adminer/static/default.css
  45. +7 −7 adminer/static/editing.js
  46. BIN  adminer/static/favicon.ico
  47. +17 −3 adminer/static/functions.js
  48. +1 −1  adminer/trigger.inc.php
  49. +17 −0 changes.txt
  50. +4 −1 editor/example.php
  51. +40 −12 editor/include/adminer.inc.php
  52. +0 −23 editor/include/export.inc.php
  53. +2 −1  editor/index.php
  54. +9 −6 lang.php
  55. +2 −2 readme.txt
  56. +4 −5 todo.txt
View
9 adminer/call.inc.php
@@ -57,8 +57,13 @@
$name = $field["field"];
echo "<tr><th>" . $adminer->fieldName($field);
$value = $_POST["fields"][$name];
- if ($value != "" && ereg("enum|set", $field["type"])) {
- $value = intval($value);
+ if ($value != "") {
+ if ($field["type"] == "enum") {
+ $value = +$value;
+ }
+ if ($field["type"] == "set") {
+ $value = array_sum($value);
+ }
}
input($field, $value, (string) $_POST["function"][$name]); // param name can be empty
echo "\n";
View
4 adminer/create.inc.php
@@ -65,7 +65,7 @@
}
$partitioning .= "\nPARTITION BY $_POST[partition_by]($_POST[partition])" . ($partitions // $_POST["partition"] can be expression, not only column
? " (" . implode(",", $partitions) . "\n)"
- : ($_POST["partitions"] ? " PARTITIONS " . intval($_POST["partitions"]) : "")
+ : ($_POST["partitions"] ? " PARTITIONS " . (+$_POST["partitions"]) : "")
);
} elseif ($TABLE != "" && support("partitioning")) {
$partitioning .= "\nREMOVE PARTITIONING";
@@ -83,7 +83,7 @@
$_POST["Comment"],
($_POST["Engine"] && $_POST["Engine"] != $orig_status["Engine"] ? $_POST["Engine"] : ""),
($_POST["Collation"] && $_POST["Collation"] != $orig_status["Collation"] ? $_POST["Collation"] : ""),
- ($_POST["Auto_increment"] != "" ? preg_replace('~\\D+~', '', $_POST["Auto_increment"]) : ""),
+ ($_POST["Auto_increment"] != "" ? +$_POST["Auto_increment"] : ""),
$partitioning
));
}
View
5 adminer/database.inc.php
@@ -57,10 +57,11 @@
<p>
<?php
echo ($_POST["add_x"] || strpos($name, "\n")
- ? '<textarea name="name" rows="10" cols="40" onkeydown="return textareaKeydown(this, event);">' . h($name) . '</textarea><br>'
- : '<input name="name" value="' . h($name) . '" maxlength="64">'
+ ? '<textarea id="name" name="name" rows="10" cols="40" onkeydown="return textareaKeydown(this, event);">' . h($name) . '</textarea><br>'
+ : '<input id="name" name="name" value="' . h($name) . '" maxlength="64">'
) . "\n" . ($collations ? html_select("collation", array("" => "(" . lang('collation') . ")") + $collations, $collate) : "");
?>
+<script type='text/javascript'>document.getElementById('name').focus();</script>
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="submit" value="<?php echo lang('Save'); ?>">
<?php
View
11 adminer/drivers/mssql.inc.php
@@ -5,13 +5,10 @@
* @author Jakub Vrana
*/
-$possible_drivers[] = "SQLSRV";
-$possible_drivers[] = "MSSQL";
-if (extension_loaded("sqlsrv") || extension_loaded("mssql")) {
- $drivers["mssql"] = "MS SQL";
-}
+$drivers["mssql"] = "MS SQL";
if (isset($_GET["mssql"])) {
+ $possible_drivers = array("SQLSRV", "MSSQL");
define("DRIVER", "mssql");
if (extension_loaded("sqlsrv")) {
class Min_DB {
@@ -309,7 +306,7 @@ function fk_support($table_status) {
return true;
}
- function fields($table, $hidden = false) {
+ function fields($table) {
$return = array();
foreach (get_rows("SELECT c.*, t.name type, d.definition [default]
FROM sys.all_columns c
@@ -399,7 +396,7 @@ function rename_database($name, $collation) {
}
function auto_increment() {
- return " IDENTITY" . ($_POST["Auto_increment"] != "" ? "(" . preg_replace('~\\D+~', '', $_POST["Auto_increment"]) . ",1)" : "");
+ return " IDENTITY" . ($_POST["Auto_increment"] != "" ? "(" . (+$_POST["Auto_increment"]) . ",1)" : "");
}
function alter_table($table, $name, $fields, $foreign, $comment, $engine, $collation, $auto_increment, $partitioning) {
View
19 adminer/drivers/mysql.inc.php
@@ -1,12 +1,8 @@
<?php
-$possible_drivers[] = "MySQLi";
-$possible_drivers[] = "MySQL";
-$possible_drivers[] = "PDO_MySQL";
-if (extension_loaded("mysqli") || extension_loaded("mysql") || extension_loaded("pdo_mysql")) {
- $drivers = array("server" => "MySQL") + $drivers;
-}
+$drivers = array("server" => "MySQL") + $drivers;
if (!defined("DRIVER")) {
+ $possible_drivers = array("MySQLi", "MySQL", "PDO_MySQL");
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")) {
@@ -164,7 +160,7 @@ function result($query, $field = 0) {
class Min_Result {
var
$num_rows, ///< @var int number of rows in the result
- $_result ///< @access private
+ $_result, $_offset = 0 ///< @access private
;
/** Constructor
@@ -193,7 +189,7 @@ function fetch_row() {
* @return object properties: name, type, orgtable, orgname, charsetnr
*/
function fetch_field() {
- $return = mysql_fetch_field($this->_result);
+ $return = mysql_fetch_field($this->_result, $this->_offset++); // offset required under certain conditions
$return->orgtable = $return->table;
$return->orgname = $return->name;
$return->charsetnr = ($return->blob ? 63 : 0);
@@ -212,7 +208,7 @@ class Min_DB extends Min_PDO {
var $extension = "PDO_MySQL";
function connect($server, $username, $password) {
- $this->dsn("mysql:host=" . str_replace(":", ";unix_socket=", preg_replace('~:([0-9])~', ';port=\\1', $server)), $username, $password);
+ $this->dsn("mysql:host=" . str_replace(":", ";unix_socket=", preg_replace('~:(\\d)~', ';port=\\1', $server)), $username, $password);
$this->query("SET NAMES utf8"); // charset in DSN is ignored
return true;
}
@@ -397,10 +393,9 @@ function fk_support($table_status) {
/** Get information about fields
* @param string
- * @param bool display hidden table columns
* @return array array($name => array("field" => , "full_type" => , "type" => , "length" => , "unsigned" => , "default" => , "null" => , "auto_increment" => , "on_update" => , "collation" => , "privileges" => , "comment" => , "primary" => ))
*/
- function fields($table, $hidden = false) {
+ function fields($table) {
$return = array();
foreach (get_rows("SHOW FULL COLUMNS FROM " . table($table)) as $row) {
preg_match('~^([^( ]+)(?:\\((.+)\\))?( unsigned)?( zerofill)?$~', $row["Type"], $match);
@@ -820,7 +815,7 @@ function create_sql($table, $auto_increment) {
global $connection;
$return = $connection->result("SHOW CREATE TABLE " . table($table), 1);
if (!$auto_increment) {
- $return = preg_replace('~ AUTO_INCREMENT=[0-9]+~', '', $return); //! skip comments
+ $return = preg_replace('~ AUTO_INCREMENT=\\d+~', '', $return); //! skip comments
}
return $return;
}
View
9 adminer/drivers/oracle.inc.php
@@ -1,11 +1,8 @@
<?php
-$possible_drivers[] = "OCI8";
-$possible_drivers[] = "PDO_OCI";
-if (extension_loaded("oci8") || extension_loaded("pdo_oci")) {
- $drivers["oracle"] = "Oracle";
-}
+$drivers["oracle"] = "Oracle";
if (isset($_GET["oracle"])) {
+ $possible_drivers = array("OCI8", "PDO_OCI");
define("DRIVER", "oracle");
if (extension_loaded("oci8")) {
class Min_DB {
@@ -206,7 +203,7 @@ function fk_support($table_status) {
return true;
}
- function fields($table, $hidden = false) {
+ function fields($table) {
$return = array();
foreach (get_rows("SELECT * FROM all_tab_columns WHERE table_name = " . q($table) . " ORDER BY column_id") as $row) {
$type = $row["DATA_TYPE"];
View
13 adminer/drivers/pgsql.inc.php
@@ -1,11 +1,8 @@
<?php
-$possible_drivers[] = "PgSQL";
-$possible_drivers[] = "PDO_PgSQL";
-if (extension_loaded("pgsql") || extension_loaded("pdo_pgsql")) {
- $drivers["pgsql"] = "PostgreSQL";
-}
+$drivers["pgsql"] = "PostgreSQL";
if (isset($_GET["pgsql"])) {
+ $possible_drivers = array("PgSQL", "PDO_PgSQL");
define("DRIVER", "pgsql");
if (extension_loaded("pgsql")) {
class Min_DB {
@@ -218,7 +215,7 @@ function fk_support($table_status) {
return true;
}
- function fields($table, $hidden = false) {
+ function fields($table) {
$return = array();
foreach (get_rows("SELECT a.attname AS field, format_type(a.atttypid, a.atttypmod) AS full_type, d.adsrc AS default, a.attnotnull, col_description(c.oid, a.attnum) AS comment
FROM pg_class c
@@ -228,8 +225,8 @@ function fields($table, $hidden = false) {
WHERE c.relname = " . q($table) . "
AND n.nspname = current_schema()
AND NOT a.attisdropped
-" . ($hidden ? "" : "AND a.attnum > 0") . "
-ORDER BY a.attnum < 0, a.attnum"
+AND a.attnum > 0
+ORDER BY a.attnum"
) as $row) {
//! collation, primary
ereg('(.*)(\\((.*)\\))?', $row["full_type"], $match);
View
134 adminer/drivers/sqlite.inc.php
@@ -1,42 +1,36 @@
<?php
-$possible_drivers[] = "SQLite";
-$possible_drivers[] = "SQLite3";
-$possible_drivers[] = "PDO_SQLite";
-if (extension_loaded("sqlite3") || extension_loaded("pdo_sqlite")) {
- $drivers["sqlite"] = "SQLite 3";
-}
-if (extension_loaded("sqlite") || extension_loaded("pdo_sqlite")) {
- $drivers["sqlite2"] = "SQLite 2";
-}
+$drivers["sqlite"] = "SQLite 3";
+$drivers["sqlite2"] = "SQLite 2";
if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
+ $possible_drivers = array((isset($_GET["sqlite"]) ? "SQLite3" : "SQLite"), "PDO_SQLite");
define("DRIVER", (isset($_GET["sqlite"]) ? "sqlite" : "sqlite2"));
- if (extension_loaded(isset($_GET["sqlite2"]) ? "sqlite" : "sqlite3")) {
- if (isset($_GET["sqlite2"])) {
+ if (extension_loaded(isset($_GET["sqlite"]) ? "sqlite3" : "sqlite")) {
+ if (isset($_GET["sqlite"])) {
class Min_SQLite {
- var $extension = "SQLite", $server_info, $affected_rows, $error, $_link;
+ var $extension = "SQLite3", $server_info, $affected_rows, $error, $_link;
function Min_SQLite($filename) {
- $this->server_info = sqlite_libversion();
- $this->_link = new SQLiteDatabase($filename);
+ $this->_link = new SQLite3($filename);
+ $version = $this->_link->version();
+ $this->server_info = $version["versionString"];
}
- function query($query, $unbuffered = false) {
- $method = ($unbuffered ? "unbufferedQuery" : "query");
- $result = @$this->_link->$method($query, SQLITE_BOTH, $error);
+ function query($query) {
+ $result = @$this->_link->query($query);
if (!$result) {
- $this->error = $error;
+ $this->error = $this->_link->lastErrorMsg();
return false;
- } elseif ($result === true) {
- $this->affected_rows = $this->changes();
- return true;
+ } elseif ($result->numColumns()) {
+ return new Min_Result($result);
}
- return new Min_Result($result);
+ $this->affected_rows = $this->_link->changes();
+ return true;
}
function quote($string) {
- return "'" . sqlite_escape_string($string) . "'";
+ return "'" . $this->_link->escapeString($string) . "'";
}
function store_result() {
@@ -48,7 +42,7 @@ function result($query, $field = 0) {
if (!is_object($result)) {
return false;
}
- $row = $result->_result->fetch();
+ $row = $result->_result->fetchArray();
return $row[$field];
}
}
@@ -58,68 +52,56 @@ class Min_Result {
function Min_Result($result) {
$this->_result = $result;
- if (method_exists($result, 'numRows')) { // not available in unbuffered query
- $this->num_rows = $result->numRows();
- }
}
function fetch_assoc() {
- $row = $this->_result->fetch(SQLITE_ASSOC);
- if (!$row) {
- return false;
- }
- $return = array();
- foreach ($row as $key => $val) {
- $return[($key[0] == '"' ? idf_unescape($key) : $key)] = $val;
- }
- return $return;
+ return $this->_result->fetchArray(SQLITE3_ASSOC);
}
function fetch_row() {
- return $this->_result->fetch(SQLITE_NUM);
+ return $this->_result->fetchArray(SQLITE3_NUM);
}
function fetch_field() {
- $name = $this->_result->fieldName($this->_offset++);
- $pattern = '(\\[.*]|"(?:[^"]|"")*"|(.+))';
- if (preg_match("~^($pattern\\.)?$pattern\$~", $name, $match)) {
- $table = ($match[3] != "" ? $match[3] : idf_unescape($match[2]));
- $name = ($match[5] != "" ? $match[5] : idf_unescape($match[4]));
- }
+ $column = $this->_offset++;
+ $type = $this->_result->columnType($column);
return (object) array(
- "name" => $name,
- "orgname" => $name,
- "orgtable" => $table,
+ "name" => $this->_result->columnName($column),
+ "type" => $type,
+ "charsetnr" => ($type == SQLITE3_BLOB ? 63 : 0), // 63 - binary
);
}
+ function __desctruct() {
+ return $this->_result->finalize();
+ }
}
} else {
class Min_SQLite {
- var $extension = "SQLite3", $server_info, $affected_rows, $error, $_link;
+ var $extension = "SQLite", $server_info, $affected_rows, $error, $_link;
function Min_SQLite($filename) {
- $this->_link = new SQLite3($filename);
- $version = $this->_link->version();
- $this->server_info = $version["versionString"];
+ $this->server_info = sqlite_libversion();
+ $this->_link = new SQLiteDatabase($filename);
}
- function query($query) {
- $result = @$this->_link->query($query);
+ function query($query, $unbuffered = false) {
+ $method = ($unbuffered ? "unbufferedQuery" : "query");
+ $result = @$this->_link->$method($query, SQLITE_BOTH, $error);
if (!$result) {
- $this->error = $this->_link->lastErrorMsg();
+ $this->error = $error;
return false;
- } elseif ($result->numColumns()) {
- return new Min_Result($result);
+ } elseif ($result === true) {
+ $this->affected_rows = $this->changes();
+ return true;
}
- $this->affected_rows = $this->_link->changes();
- return true;
+ return new Min_Result($result);
}
function quote($string) {
- return "'" . $this->_link->escapeString($string) . "'";
+ return "'" . sqlite_escape_string($string) . "'";
}
function store_result() {
@@ -131,7 +113,7 @@ function result($query, $field = 0) {
if (!is_object($result)) {
return false;
}
- $row = $result->_result->fetchArray();
+ $row = $result->_result->fetch();
return $row[$field];
}
}
@@ -141,29 +123,41 @@ class Min_Result {
function Min_Result($result) {
$this->_result = $result;
+ if (method_exists($result, 'numRows')) { // not available in unbuffered query
+ $this->num_rows = $result->numRows();
+ }
}
function fetch_assoc() {
- return $this->_result->fetchArray(SQLITE3_ASSOC);
+ $row = $this->_result->fetch(SQLITE_ASSOC);
+ if (!$row) {
+ return false;
+ }
+ $return = array();
+ foreach ($row as $key => $val) {
+ $return[($key[0] == '"' ? idf_unescape($key) : $key)] = $val;
+ }
+ return $return;
}
function fetch_row() {
- return $this->_result->fetchArray(SQLITE3_NUM);
+ return $this->_result->fetch(SQLITE_NUM);
}
function fetch_field() {
- $column = $this->_offset++;
- $type = $this->_result->columnType($column);
+ $name = $this->_result->fieldName($this->_offset++);
+ $pattern = '(\\[.*]|"(?:[^"]|"")*"|(.+))';
+ if (preg_match("~^($pattern\\.)?$pattern\$~", $name, $match)) {
+ $table = ($match[3] != "" ? $match[3] : idf_unescape($match[2]));
+ $name = ($match[5] != "" ? $match[5] : idf_unescape($match[4]));
+ }
return (object) array(
- "name" => $this->_result->columnName($column),
- "type" => $type,
- "charsetnr" => ($type == SQLITE3_BLOB ? 63 : 0), // 63 - binary
+ "name" => $name,
+ "orgname" => $name,
+ "orgtable" => $table,
);
}
- function __desctruct() {
- return $this->_result->finalize();
- }
}
}
@@ -269,7 +263,7 @@ function fk_support($table_status) {
return !$connection->result("SELECT sqlite_compileoption_used('OMIT_FOREIGN_KEY')");
}
- function fields($table, $hidden = false) {
+ function fields($table) {
$return = array();
foreach (get_rows("PRAGMA table_info(" . table($table) . ")") as $row) {
$type = strtolower($row["type"]);
View
32 adminer/dump.inc.php
@@ -7,8 +7,9 @@
$cookie .= "&$key=" . urlencode($_POST[$key]);
}
cookie("adminer_export", substr($cookie, 1));
- $ext = dump_headers(($TABLE != "" ? $TABLE : DB), (DB == "" || count((array) $_POST["tables"] + (array) $_POST["data"]) > 1));
- if ($_POST["format"] == "sql") {
+ $ext = $adminer->dumpHeaders(($TABLE != "" ? $TABLE : DB), (DB == "" || count((array) $_POST["tables"] + (array) $_POST["data"]) > 1));
+ $is_sql = ($_POST["format"] == "sql");
+ if ($is_sql) {
echo "-- Adminer $VERSION " . $drivers[DRIVER] . " dump
" . ($jush != "sql" ? "" : "SET NAMES utf8;
@@ -29,13 +30,13 @@
}
foreach ((array) $databases as $db) {
if ($connection->select_db($db)) {
- if ($_POST["format"] == "sql" && ereg('CREATE', $style) && ($create = $connection->result("SHOW CREATE DATABASE " . idf_escape($db), 1))) {
+ if ($is_sql && ereg('CREATE', $style) && ($create = $connection->result("SHOW CREATE DATABASE " . idf_escape($db), 1))) {
if ($style == "DROP+CREATE") {
echo "DROP DATABASE IF EXISTS " . idf_escape($db) . ";\n";
}
echo ($style == "CREATE+ALTER" ? preg_replace('~^CREATE DATABASE ~', '\\0IF NOT EXISTS ', $create) : $create) . ";\n";
}
- if ($_POST["format"] == "sql") {
+ if ($is_sql) {
if ($style) {
echo use_sql($db) . ";\n\n";
}
@@ -72,11 +73,11 @@
if ($ext == "tar") {
ob_start();
}
- dump_table($row["Name"], ($table ? $_POST["table_style"] : ""));
+ $adminer->dumpTable($row["Name"], ($table ? $_POST["table_style"] : ""));
if ($data) {
- dump_data($row["Name"], $_POST["data_style"]);
+ $adminer->dumpData($row["Name"], $_POST["data_style"], "SELECT * FROM " . table($row["Name"]));
}
- if ($_POST["format"] == "sql" && $_POST["triggers"]) {
+ if ($is_sql && $_POST["triggers"]) {
$triggers = trigger_sql($row["Name"], $_POST["table_style"]);
if ($triggers) {
echo "\nDELIMITER ;;\n$triggers\nDELIMITER ;\n";
@@ -84,23 +85,23 @@
}
if ($ext == "tar") {
echo tar_file((DB != "" ? "" : "$db/") . "$row[Name].csv", ob_get_clean());
- } elseif ($_POST["format"] == "sql") {
+ } elseif ($is_sql) {
echo "\n";
}
- } elseif ($_POST["format"] == "sql") {
+ } elseif ($is_sql) {
$views[] = $row["Name"];
}
}
}
foreach ($views as $view) {
- dump_table($view, $_POST["table_style"], true);
+ $adminer->dumpTable($view, $_POST["table_style"], true);
}
if ($ext == "tar") {
echo pack("x512");
}
}
- if ($style == "CREATE+ALTER" && $_POST["format"] == "sql") {
+ if ($style == "CREATE+ALTER" && $is_sql) {
// drop old tables
$query = "SELECT TABLE_NAME, ENGINE, TABLE_COLLATION, TABLE_COMMENT FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE()";
echo "DELIMITER ;;
@@ -136,11 +137,14 @@
DROP PROCEDURE adminer_alter;
";
}
- if (in_array("CREATE+ALTER", array($style, $_POST["table_style"])) && $_POST["format"] == "sql") {
+ if (in_array("CREATE+ALTER", array($style, $_POST["table_style"])) && $is_sql) {
echo "SELECT @adminer_alter;\n";
}
}
}
+ if ($is_sql) {
+ echo "-- " . $connection->result("SELECT NOW()") . "\n";
+ }
exit;
}
@@ -163,8 +167,8 @@
$row = array("output" => "text", "format" => "sql", "db_style" => (DB != "" ? "" : "CREATE"), "table_style" => "DROP+CREATE", "data_style" => "INSERT");
}
$checked = ($_GET["dump"] == "");
-echo "<tr><th>" . lang('Output') . "<td>" . $adminer->dumpOutput(0, $row["output"]) . "\n";
-echo "<tr><th>" . lang('Format') . "<td>" . $adminer->dumpFormat(0, $row["format"]) . "\n";
+echo "<tr><th>" . lang('Output') . "<td>" . html_select("output", $adminer->dumpOutput(), $row["output"], 0) . "\n"; // 0 - radio
+echo "<tr><th>" . lang('Format') . "<td>" . html_select("format", $adminer->dumpFormat(), $row["format"], 0) . "\n"; // 0 - radio
echo ($jush == "sqlite" ? "" : "<tr><th>" . lang('Database') . "<td>" . html_select('db_style', $db_style, $row["db_style"])
. (support("routine") ? checkbox("routines", 1, $checked, lang('Routines')) : "")
. (support("event") ? checkbox("events", 1, $checked, lang('Events')) : "")
View
2  adminer/edit.inc.php
@@ -72,7 +72,7 @@
echo "<tr><th>" . $adminer->fieldName($field);
$default = $_GET["set"][bracket_escape($name)];
$value = (isset($row)
- ? ($row[$name] != "" && ereg("enum|set", $field["type"]) ? intval($row[$name]) : $row[$name])
+ ? ($row[$name] != "" && ereg("enum|set", $field["type"]) ? +$row[$name] : $row[$name])
: (!$update && $field["auto_increment"] ? "" : (isset($_GET["select"]) ? false : (isset($default) ? $default : $field["default"])))
);
if (!$_POST["save"] && is_string($value)) {
View
4 adminer/foreign.inc.php
@@ -60,8 +60,8 @@
$j = 0;
foreach ($row["source"] as $key => $val) {
echo "<tr>";
- echo "<td>" . html_select("source[" . intval($key) . "]", array(-1 => "") + $source, $val, ($j == count($row["source"]) - 1 ? "foreignAddRow(this);" : 1));
- echo "<td>" . html_select("target[" . intval($key) . "]", $target, $row["target"][$key]);
+ echo "<td>" . html_select("source[" . (+$key) . "]", array(-1 => "") + $source, $val, ($j == count($row["source"]) - 1 ? "foreignAddRow(this);" : 1));
+ echo "<td>" . html_select("target[" . (+$key) . "]", $target, $row["target"][$key]);
$j++;
}
?>
View
240 adminer/include/adminer.inc.php
@@ -36,7 +36,8 @@ function database() {
* @return null
*/
function headers() {
- header("X-Frame-Options: deny"); // ClickJacking protection in IE8, Safari 4, Chrome 2, Firefox NoScript plugin
+ header("X-Frame-Options: deny"); // ClickJacking protection in IE8, Safari 4, Chrome 2, Firefox 3.6.9
+ header("X-XSS-Protection: 0"); // prevents introducing XSS in IE8 by removing safe parts of the page
}
/** Print login form
@@ -107,6 +108,14 @@ function selectLinks($tableStatus, $set = "") {
echo "\n";
}
+ /** Get foreign keys for table
+ * @param string
+ * @return array same format as foreign_keys()
+ */
+ function foreignKeys($table) {
+ return foreign_keys($table);
+ }
+
/** Find backward keys for table
* @param string
* @param string
@@ -130,7 +139,7 @@ function backwardKeysPrint($backwardKeys, $row) {
*/
function selectQuery($query) {
global $jush;
- return "<p><a href='" . h(remove_from_uri("page")) . "&amp;page=last' title='" . lang('Page') . ": " . lang('last') . "' onclick='return !ajaxMain(this.href, undefined, event);'>&gt;&gt;</a> <code class='jush-$jush'>" . h(str_replace("\n", " ", $query)) . "</code> <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a>\n";
+ return "<p><a href='" . h(remove_from_uri("page")) . "&amp;page=last' title='" . lang('Last page') . "' onclick='return !ajaxMain(this.href, undefined, event);'>&gt;&gt;</a> <code class='jush-$jush'>" . h(str_replace("\n", " ", $query)) . "</code> <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a>\n";
}
/** Description of a row in a table
@@ -157,7 +166,7 @@ function rowDescriptions($rows, $foreignKeys) {
* @return string
*/
function selectVal($val, $link, $field) {
- $return = ($val != "<i>NULL</i>" && ereg("^char|binary", $field["type"]) ? "<code>$val</code>" : $val);
+ $return = ($val != "<i>NULL</i>" && ereg("char|binary", $field["type"]) && !ereg("var", $field["type"]) ? "<code>$val</code>" : $val);
if (ereg('blob|bytea|raw|file', $field["type"]) && !is_utf8($val)) {
$return = lang('%d byte(s)', strlen(html_entity_decode($val, ENT_QUOTES)));
}
@@ -429,8 +438,10 @@ function editFunctions($field) {
*/
function editInput($table, $field, $attrs, $value) {
if ($field["type"] == "enum") {
- return ($field["null"] ? "<label><input type='radio'$attrs value=''" . (isset($value) || isset($_GET["select"]) ? "" : " checked") . "><i>NULL</i></label> " : "")
+ return (isset($_GET["select"]) ? "<label><input type='radio'$attrs value='-1' checked><i>" . lang('original') . "</i></label> " : "")
+ . ($field["null"] ? "<label><input type='radio'$attrs value=''" . (isset($value) || isset($_GET["select"]) ? "" : " checked") . "><i>NULL</i></label> " : "")
. "<label><input type='radio'$attrs value='0'" . ($value === 0 ? " checked" : "") . "><i>" . lang('empty') . "</i></label>"
+ . enum_input("radio", $attrs, $field, $value)
;
}
return "";
@@ -452,7 +463,7 @@ function processInput($field, $value, $function = "") {
} elseif (ereg('^([+-]|\\|\\|)$', $function)) {
$return = idf_escape($name) . " $function $return";
} elseif (ereg('^[+-] interval$', $function)) {
- $return = idf_escape($name) . " $function " . (preg_match("~^([0-9]+|'[0-9.: -]') [A-Z_]+$~i", $value) ? $value : $return);
+ $return = idf_escape($name) . " $function " . (preg_match("~^(\\d+|'[0-9.: -]') [A-Z_]+$~i", $value) ? $value : $return);
} elseif (ereg('^(addtime|subtime|concat)$', $function)) {
$return = "$function(" . idf_escape($name) . ", $return)";
} elseif (ereg('^(md5|sha1|password|encrypt|hex)$', $function)) {
@@ -465,11 +476,9 @@ function processInput($field, $value, $function = "") {
}
/** Returns export output options
- * @param bool generate select (otherwise radio)
- * @param string
- * @return string
+ * @return array
*/
- function dumpOutput($select, $value = "") {
+ function dumpOutput() {
$return = array('text' => lang('open'), 'file' => lang('save'));
if (function_exists('gzencode')) {
$return['gz'] = 'gzip';
@@ -478,16 +487,199 @@ function dumpOutput($select, $value = "") {
$return['bz2'] = 'bzip2';
}
// ZipArchive requires temporary file, ZIP can be created by gzcompress - see PEAR File_Archive
- return html_select("output", $return, $value, $select);
+ return $return;
}
/** Returns export format options
- * @param bool generate select (otherwise radio)
- * @param string
- * @return string
+ * @return array
*/
- function dumpFormat($select, $value = "") {
- return html_select("format", array('sql' => 'SQL', 'csv' => 'CSV,', 'csv;' => 'CSV;'), $value, $select);
+ function dumpFormat() {
+ return array('sql' => 'SQL', 'csv' => 'CSV,', 'csv;' => 'CSV;', 'tsv' => 'TSV');
+ }
+
+ /** Export table structure
+ * @param string
+ * @param string
+ * @param bool
+ * @return null prints data
+ */
+ function dumpTable($table, $style, $is_view = false) {
+ if ($_POST["format"] != "sql") {
+ echo "\xef\xbb\xbf"; // UTF-8 byte order mark
+ if ($style) {
+ dump_csv(array_keys(fields($table)));
+ }
+ } elseif ($style) {
+ $create = create_sql($table, $_POST["auto_increment"]);
+ if ($create) {
+ if ($style == "DROP+CREATE") {
+ echo "DROP " . ($is_view ? "VIEW" : "TABLE") . " IF EXISTS " . table($table) . ";\n";
+ }
+ if ($is_view) {
+ // remove DEFINER with current user
+ $create = preg_replace('~^([A-Z =]+) DEFINER=`' . str_replace("@", "`@`", logged_user()) . '`~', '\\1', $create); //! proper escaping of user
+ }
+ echo ($style != "CREATE+ALTER" ? $create : ($is_view ? substr_replace($create, " OR REPLACE", 6, 0) : substr_replace($create, " IF NOT EXISTS", 12, 0))) . ";\n\n";
+ }
+ if ($style == "CREATE+ALTER" && !$is_view) {
+ // create procedure which iterates over original columns and adds new and removes old
+ $query = "SELECT COLUMN_NAME, COLUMN_DEFAULT, IS_NULLABLE, COLLATION_NAME, COLUMN_TYPE, EXTRA, COLUMN_COMMENT FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = " . q($table) . " ORDER BY ORDINAL_POSITION";
+ echo "DELIMITER ;;
+CREATE PROCEDURE adminer_alter (INOUT alter_command text) BEGIN
+ DECLARE _column_name, _collation_name, after varchar(64) DEFAULT '';
+ DECLARE _column_type, _column_default text;
+ DECLARE _is_nullable char(3);
+ DECLARE _extra varchar(30);
+ DECLARE _column_comment varchar(255);
+ DECLARE done, set_after bool DEFAULT 0;
+ DECLARE add_columns text DEFAULT '";
+ $fields = array();
+ $after = "";
+ foreach (get_rows($query) as $row) {
+ $default = $row["COLUMN_DEFAULT"];
+ $row["default"] = (isset($default) ? q($default) : "NULL");
+ $row["after"] = q($after); //! rgt AFTER lft, lft AFTER id doesn't work
+ $row["alter"] = escape_string(idf_escape($row["COLUMN_NAME"])
+ . " $row[COLUMN_TYPE]"
+ . ($row["COLLATION_NAME"] ? " COLLATE $row[COLLATION_NAME]" : "")
+ . (isset($default) ? " DEFAULT " . ($default == "CURRENT_TIMESTAMP" ? $default : $row["default"]) : "")
+ . ($row["IS_NULLABLE"] == "YES" ? "" : " NOT NULL")
+ . ($row["EXTRA"] ? " $row[EXTRA]" : "")
+ . ($row["COLUMN_COMMENT"] ? " COMMENT " . q($row["COLUMN_COMMENT"]) : "")
+ . ($after ? " AFTER " . idf_escape($after) : " FIRST")
+ );
+ echo ", ADD $row[alter]";
+ $fields[] = $row;
+ $after = $row["COLUMN_NAME"];
+ }
+ echo "';
+ DECLARE columns CURSOR FOR $query;
+ DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
+ SET @alter_table = '';
+ OPEN columns;
+ REPEAT
+ FETCH columns INTO _column_name, _column_default, _is_nullable, _collation_name, _column_type, _extra, _column_comment;
+ IF NOT done THEN
+ SET set_after = 1;
+ CASE _column_name";
+ foreach ($fields as $row) {
+ echo "
+ WHEN " . q($row["COLUMN_NAME"]) . " THEN
+ SET add_columns = REPLACE(add_columns, ', ADD $row[alter]', '');
+ IF NOT (_column_default <=> $row[default]) OR _is_nullable != '$row[IS_NULLABLE]' OR _collation_name != '$row[COLLATION_NAME]' OR _column_type != " . q($row["COLUMN_TYPE"]) . " OR _extra != '$row[EXTRA]' OR _column_comment != " . q($row["COLUMN_COMMENT"]) . " OR after != $row[after] THEN
+ SET @alter_table = CONCAT(@alter_table, ', MODIFY $row[alter]');
+ END IF;"; //! don't replace in comment
+ }
+ echo "
+ ELSE
+ SET @alter_table = CONCAT(@alter_table, ', DROP ', _column_name);
+ SET set_after = 0;
+ END CASE;
+ IF set_after THEN
+ SET after = _column_name;
+ END IF;
+ END IF;
+ UNTIL done END REPEAT;
+ CLOSE columns;
+ 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');
+ END IF;
+END;;
+DELIMITER ;
+CALL adminer_alter(@adminer_alter);
+DROP PROCEDURE adminer_alter;
+
+";
+ //! indexes
+ }
+ }
+ }
+
+ /** Export table data
+ * @param string
+ * @param string
+ * @param string
+ * @return null prints data
+ */
+ function dumpData($table, $style, $query) {
+ global $connection, $jush;
+ $max_packet = ($jush == "sqlite" ? 0 : 1048576); // default, minimum is 1024
+ if ($style) {
+ if ($_POST["format"] == "sql" && $style == "TRUNCATE+INSERT") {
+ echo truncate_sql($table) . ";\n";
+ }
+ $fields = fields($table);
+ $result = $connection->query($query, 1); // 1 - MYSQLI_USE_RESULT //! enum and set as numbers
+ if ($result) {
+ $insert = "";
+ $buffer = "";
+ while ($row = $result->fetch_assoc()) {
+ if ($_POST["format"] != "sql") {
+ dump_csv($row);
+ } else {
+ if (!$insert) {
+ $insert = "INSERT INTO " . table($table) . " (" . implode(", ", array_map('idf_escape', array_keys($row))) . ") VALUES";
+ }
+ foreach ($row as $key => $val) {
+ $row[$key] = (isset($val) ? (ereg('int|float|double|decimal', $fields[$key]["type"]) ? $val : q($val)) : "NULL"); //! columns looking like functions
+ }
+ $s = implode(",\t", $row);
+ if ($style == "INSERT+UPDATE") {
+ $set = array();
+ foreach ($row as $key => $val) {
+ $set[] = idf_escape($key) . " = $val";
+ }
+ echo "$insert ($s) ON DUPLICATE KEY UPDATE " . implode(", ", $set) . ";\n";
+ } else {
+ $s = ($max_packet ? "\n" : " ") . "($s)";
+ if (!$buffer) {
+ $buffer = $insert . $s;
+ } elseif (strlen($buffer) + 2 + strlen($s) < $max_packet) { // 2 - separator and terminator length
+ $buffer .= ",$s";
+ } else {
+ $buffer .= ";\n";
+ echo $buffer;
+ $buffer = $insert . $s;
+ }
+ }
+ }
+ }
+ if ($_POST["format"] == "sql" && $style != "INSERT+UPDATE" && $buffer) {
+ $buffer .= ";\n";
+ echo $buffer;
+ }
+ } elseif ($_POST["format"] == "sql") {
+ echo "-- " . str_replace("\n", " ", $connection->error) . "\n";
+ }
+ }
+ }
+
+ /** Send headers for export
+ * @param string
+ * @param bool
+ * @return string extension
+ */
+ function dumpHeaders($identifier, $multi_table = false) {
+ $filename = ($identifier != "" ? friendly_url($identifier) : "adminer");
+ $output = $_POST["output"];
+ $ext = ($_POST["format"] == "sql" ? "sql" : ($multi_table ? "tar" : "csv")); // multiple CSV packed to TAR
+ header("Content-Type: " .
+ ($output == "bz2" ? "application/x-bzip" :
+ ($output == "gz" ? "application/x-gzip" :
+ ($ext == "tar" ? "application/x-tar" :
+ ($ext == "sql" || $output != "file" ? "text/plain" : "text/csv") . "; charset=utf-8"
+ ))));
+ if ($output != "text") {
+ header("Content-Disposition: attachment; filename=$filename.$ext" . ($output != "file" && !ereg('[^0-9a-z]', $output) ? ".$output" : ""));
+ }
+ session_write_close();
+ if ($_POST["output"] == "bz2") {
+ ob_start('bzcompress', 1e6);
+ }
+ if ($_POST["output"] == "gz") {
+ ob_start('gzencode', 1e6);
+ }
+ return $ext;
}
/** Prints navigation after Adminer title
@@ -524,13 +716,13 @@ function navigation($missing) {
<form action="" method="post">
<p class="logout">
<?php
-if (DB == "" || !$missing) {
- echo "<a href='" . h(ME) . "sql='>" . bold(lang('SQL command'), isset($_GET["sql"])) . "</a>\n";
- if (support("dump")) {
- echo "<a href='" . h(ME) . "dump=" . urlencode(isset($_GET["table"]) ? $_GET["table"] : $_GET["select"]) . "'>" . bold(lang('Dump'), isset($_GET["dump"])) . "</a>\n";
- }
-}
-?>
+ if (DB == "" || !$missing) {
+ echo "<a href='" . h(ME) . "sql='>" . bold(lang('SQL command'), isset($_GET["sql"])) . "</a>\n";
+ if (support("dump")) {
+ echo "<a href='" . h(ME) . "dump=" . urlencode(isset($_GET["table"]) ? $_GET["table"] : $_GET["select"]) . "'>" . bold(lang('Dump'), isset($_GET["dump"])) . "</a>\n";
+ }
+ }
+ ?>
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="submit" name="logout" value="<?php echo lang('Logout'); ?>">
</p>
@@ -549,6 +741,7 @@ function navigation($missing) {
}
}
if ($_GET["ns"] !== "" && !$missing) {
+ echo '<p><a href="' . h(ME) . 'create=">' . bold(lang('Create new table'), $_GET["create"] === "") . "</a>\n";
$tables = tables_list();
if (!$tables) {
echo "<p class='message'>" . lang('No tables.') . "\n";
@@ -559,13 +752,12 @@ function navigation($missing) {
$links[] = preg_quote($table, '/');
}
echo "<script type='text/javascript'>\n";
- echo "var jushLinks = { $jush: [ '" . addcslashes(h(ME), "\\'/") . "table=\$&', /\\b(" . implode("|", $links) . ")\\b/g ] };\n";
+ echo "var jushLinks = { $jush: [ '" . js_escape(ME) . "table=\$&', /\\b(" . implode("|", $links) . ")\\b/g ] };\n";
foreach (array("bac", "bra", "sqlite_quo", "mssql_bra") as $val) {
echo "jushLinks.$val = jushLinks.$jush;\n";
}
echo "</script>\n";
}
- echo '<p><a href="' . h(ME) . 'create=">' . bold(lang('Create new table'), $_GET["create"] === "") . "</a>\n";
}
}
echo (isset($_GET["sql"]) ? '<input type="hidden" name="sql" value="">'
View
14 adminer/include/auth.inc.php
@@ -1,12 +1,6 @@
<?php
$connection = '';
-if (!$drivers) {
- page_header(lang('No extension'), lang('None of the supported PHP extensions (%s) are available.', implode(", ", $possible_drivers)), null);
- page_footer("auth");
- exit;
-}
-
$token = $_SESSION["token"];
if (!$_SESSION["token"]) {
$_SESSION["token"] = rand(1, 1e6); // defense against cross-site request forgery
@@ -89,7 +83,13 @@ function auth_error($exception = null) {
page_footer("auth");
}
-if (isset($_GET["username"]) && class_exists("Min_DB")) { // doesn't exists with passing wrong driver
+if (isset($_GET["username"])) {
+ if (!class_exists("Min_DB")) {
+ unset($_SESSION["pwds"][DRIVER]); //! remove also from adminer_permanent
+ page_header(lang('No extension'), lang('None of the supported PHP extensions (%s) are available.', implode(", ", $possible_drivers)), false);
+ page_footer("auth");
+ exit;
+ }
$connection = connect();
}
if (is_string($connection) || !$adminer->login($_GET["username"], get_session("pwds"))) {
View
4 adminer/include/bootstrap.inc.php
@@ -39,11 +39,12 @@
// disable magic quotes to be able to use database escaping function
remove_slashes(array(&$_GET, &$_POST, &$_COOKIE));
-if (function_exists("set_magic_quotes_runtime")) {
+if (function_exists("set_magic_quotes_runtime")) { // removed in PHP 6
set_magic_quotes_runtime(false);
}
@set_time_limit(0); // @ - can be disabled
@ini_set("zend.ze1_compatibility_mode", false); // @ - deprecated
+@ini_set("precision", 20); // @ - can be disabled
include "../adminer/include/lang.inc.php";
include "../adminer/lang/$LANG.inc.php";
@@ -70,7 +71,6 @@
include "../adminer/include/auth.inc.php";
include "./include/connect.inc.php";
include "./include/editing.inc.php";
-include "./include/export.inc.php";
session_cache_limiter(""); // to allow restarting session
if (!ini_bool("session.use_cookies") || @ini_set("session.use_cookies", false) !== false) { // @ - may be disabled
View
4 adminer/include/connect.inc.php
@@ -23,6 +23,9 @@ function connect_error() {
}
echo "<p>" . lang('%s version: %s through PHP extension %s', $drivers[DRIVER], "<b>$connection->server_info</b>", "<b>$connection->extension</b>") . "\n";
echo "<p>" . lang('Logged as: %s', "<b>" . h(logged_user()) . "</b>") . "\n";
+ if ($_GET["refresh"]) {
+ set_session("dbs", null);
+ }
$databases = get_databases();
if ($databases) {
$scheme = support("scheme");
@@ -40,6 +43,7 @@ function connect_error() {
}
echo "</table>\n";
echo "<p><input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm("formChecked(this, /db/)") . ">\n";
+ echo "<a href='" . h(ME) . "refresh=1'>" . lang('Refresh') . "</a>\n";
echo "</form>\n";
}
}
View
4 adminer/include/design.inc.php
@@ -15,7 +15,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
$protocol = ($HTTPS ? "https" : "http");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html lang="<?php echo $LANG; ?>">
+<html lang="<?php echo $LANG; ?>" dir="<?php echo lang('ltr'); ?>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta name="robots" content="noindex">
@@ -26,7 +26,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
<link rel="stylesheet" type="text/css" href="adminer.css">
<?php } ?>
-<body onload="bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info, 0, 3) : ""); ?>', '<?php echo $protocol; ?>');<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verifyVersion('$protocol');"); ?>">
+<body class="<?php echo lang('ltr'); ?>" onload="bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info, 0, 3) : ""); ?>', '<?php echo $protocol; ?>');<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verifyVersion('$protocol');"); ?>">
<script type="text/javascript" src="../adminer/static/functions.js"></script>
<script type="text/javascript" src="static/editing.js"></script>
View
15 adminer/include/editing.inc.php
@@ -333,3 +333,18 @@ function drop_create($drop, $create, $location, $message_drop, $message_alter, $
}
return $dropped;
}
+
+/** Get string to add a file in TAR
+* @param string
+* @param string
+* @return string
+*/
+function tar_file($filename, $contents) {
+ $return = pack("a100a8a8a8a12a12", $filename, 644, 0, 0, decoct(strlen($contents)), decoct(time()));
+ $checksum = 8*32; // space for checksum itself
+ for ($i=0; $i < strlen($return); $i++) {
+ $checksum += ord($return{$i});
+ }
+ $return .= sprintf("%06o", $checksum) . "\0 ";
+ return $return . str_repeat("\0", 512 - strlen($return)) . $contents . str_repeat("\0", 511 - (strlen($contents) + 511) % 512);
+}
View
176 adminer/include/export.inc.php
@@ -1,176 +0,0 @@
-<?php
-function tar_file($filename, $contents) {
- $return = pack("a100a8a8a8a12a12", $filename, 644, 0, 0, decoct(strlen($contents)), decoct(time()));
- $checksum = 8*32; // space for checksum itself
- for ($i=0; $i < strlen($return); $i++) {
- $checksum += ord($return{$i});
- }
- $return .= sprintf("%06o", $checksum) . "\0 ";
- return $return . str_repeat("\0", 512 - strlen($return)) . $contents . str_repeat("\0", 511 - (strlen($contents) + 511) % 512);
-}
-
-function dump_table($table, $style, $is_view = false) {
- if ($_POST["format"] != "sql") {
- echo "\xef\xbb\xbf"; // UTF-8 byte order mark
- if ($style) {
- dump_csv(array_keys(fields($table)));
- }
- } elseif ($style) {
- $create = create_sql($table, $_POST["auto_increment"]);
- if ($create) {
- if ($style == "DROP+CREATE") {
- echo "DROP " . ($is_view ? "VIEW" : "TABLE") . " IF EXISTS " . table($table) . ";\n";
- }
- if ($is_view) {
- // remove DEFINER with current user
- $create = preg_replace('~^([A-Z =]+) DEFINER=`' . str_replace("@", "`@`", logged_user()) . '`~', '\\1', $create); //! proper escaping of user
- }
- echo ($style != "CREATE+ALTER" ? $create : ($is_view ? substr_replace($create, " OR REPLACE", 6, 0) : substr_replace($create, " IF NOT EXISTS", 12, 0))) . ";\n\n";
- }
- if ($style == "CREATE+ALTER" && !$is_view) {
- // create procedure which iterates over original columns and adds new and removes old
- $query = "SELECT COLUMN_NAME, COLUMN_DEFAULT, IS_NULLABLE, COLLATION_NAME, COLUMN_TYPE, EXTRA, COLUMN_COMMENT FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = " . q($table) . " ORDER BY ORDINAL_POSITION";
- echo "DELIMITER ;;
-CREATE PROCEDURE adminer_alter (INOUT alter_command text) BEGIN
- DECLARE _column_name, _collation_name, after varchar(64) DEFAULT '';
- DECLARE _column_type, _column_default text;
- DECLARE _is_nullable char(3);
- DECLARE _extra varchar(30);
- DECLARE _column_comment varchar(255);
- DECLARE done, set_after bool DEFAULT 0;
- DECLARE add_columns text DEFAULT '";
- $fields = array();
- $after = "";
- foreach (get_rows($query) as $row) {
- $default = $row["COLUMN_DEFAULT"];
- $row["default"] = (isset($default) ? q($default) : "NULL");
- $row["after"] = q($after); //! rgt AFTER lft, lft AFTER id doesn't work
- $row["alter"] = escape_string(idf_escape($row["COLUMN_NAME"])
- . " $row[COLUMN_TYPE]"
- . ($row["COLLATION_NAME"] ? " COLLATE $row[COLLATION_NAME]" : "")
- . (isset($default) ? " DEFAULT " . ($default == "CURRENT_TIMESTAMP" ? $default : $row["default"]) : "")
- . ($row["IS_NULLABLE"] == "YES" ? "" : " NOT NULL")
- . ($row["EXTRA"] ? " $row[EXTRA]" : "")
- . ($row["COLUMN_COMMENT"] ? " COMMENT " . q($row["COLUMN_COMMENT"]) : "")
- . ($after ? " AFTER " . idf_escape($after) : " FIRST")
- );
- echo ", ADD $row[alter]";
- $fields[] = $row;
- $after = $row["COLUMN_NAME"];
- }
- echo "';
- DECLARE columns CURSOR FOR $query;
- DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
- SET @alter_table = '';
- OPEN columns;
- REPEAT
- FETCH columns INTO _column_name, _column_default, _is_nullable, _collation_name, _column_type, _extra, _column_comment;
- IF NOT done THEN
- SET set_after = 1;
- CASE _column_name";
- foreach ($fields as $row) {
- echo "
- WHEN " . q($row["COLUMN_NAME"]) . " THEN
- SET add_columns = REPLACE(add_columns, ', ADD $row[alter]', '');
- IF NOT (_column_default <=> $row[default]) OR _is_nullable != '$row[IS_NULLABLE]' OR _collation_name != '$row[COLLATION_NAME]' OR _column_type != " . q($row["COLUMN_TYPE"]) . " OR _extra != '$row[EXTRA]' OR _column_comment != " . q($row["COLUMN_COMMENT"]) . " OR after != $row[after] THEN
- SET @alter_table = CONCAT(@alter_table, ', MODIFY $row[alter]');
- END IF;"; //! don't replace in comment
- }
- echo "
- ELSE
- SET @alter_table = CONCAT(@alter_table, ', DROP ', _column_name);
- SET set_after = 0;
- END CASE;
- IF set_after THEN
- SET after = _column_name;
- END IF;
- END IF;
- UNTIL done END REPEAT;
- CLOSE columns;
- 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');
- END IF;
-END;;
-DELIMITER ;
-CALL adminer_alter(@adminer_alter);
-DROP PROCEDURE adminer_alter;
-
-";
- //! indexes
- }
- }
-}
-
-function dump_data($table, $style, $select = "") {
- global $connection, $jush;
- $max_packet = ($jush == "sqlite" ? 0 : 1048576); // default, minimum is 1024
- if ($style) {
- if ($_POST["format"] == "sql" && $style == "TRUNCATE+INSERT") {
- echo truncate_sql($table) . ";\n";
- }
- $fields = fields($table);
- $result = $connection->query(($select ? $select : "SELECT * FROM " . table($table)), 1); // 1 - MYSQLI_USE_RESULT //! enum and set as numbers
- if ($result) {
- $insert = "";
- $buffer = "";
- while ($row = $result->fetch_assoc()) {
- if ($_POST["format"] != "sql") {
- dump_csv($row);
- } else {
- if (!$insert) {
- $insert = "INSERT INTO " . table($table) . " (" . implode(", ", array_map('idf_escape', array_keys($row))) . ") VALUES";
- }
- foreach ($row as $key => $val) {
- $row[$key] = (isset($val) ? (ereg('int|float|double|decimal', $fields[$key]["type"]) ? $val : q($val)) : "NULL"); //! columns looking like functions
- }
- $s = implode(",\t", $row);
- if ($style == "INSERT+UPDATE") {
- $set = array();
- foreach ($row as $key => $val) {
- $set[] = idf_escape($key) . " = $val";
- }
- echo "$insert ($s) ON DUPLICATE KEY UPDATE " . implode(", ", $set) . ";\n";
- } else {
- $s = ($max_packet ? "\n" : " ") . "($s)";
- if (!$buffer) {
- $buffer = $insert . $s;
- } elseif (strlen($buffer) + 2 + strlen($s) < $max_packet) { // 2 - separator and terminator length
- $buffer .= ",$s";
- } else {
- $buffer .= ";\n";
- echo $buffer;
- $buffer = $insert . $s;
- }
- }
- }
- }
- if ($_POST["format"] == "sql" && $style != "INSERT+UPDATE" && $buffer) {
- $buffer .= ";\n";
- echo $buffer;
- }
- }
- }
-}
-
-function dump_headers($identifier, $multi_table = false) {
- $filename = ($identifier != "" ? friendly_url($identifier) : "adminer");
- $output = $_POST["output"];
- $ext = ($_POST["format"] == "sql" ? "sql" : ($multi_table ? "tar" : "csv")); // multiple CSV packed to TAR
- header("Content-Type: " .
- ($output == "bz2" ? "application/x-bzip" :
- ($output == "gz" ? "application/x-gzip" :
- ($ext == "tar" ? "application/x-tar" :
- ($ext == "sql" || $output != "file" ? "text/plain" : "text/csv") . "; charset=utf-8"
- ))));
- if ($output != "text") {
- header("Content-Disposition: attachment; filename=$filename.$ext" . ($output != "file" && !ereg('[^0-9a-z]', $output) ? ".$output" : ""));
- }
- session_write_close();
- if ($_POST["output"] == "bz2") {
- ob_start('bzcompress', 1e6);
- }
- if ($_POST["output"] == "gz") {
- ob_start('gzencode', 1e6);
- }
- return $ext;
-}
View
31 adminer/include/functions.inc.php
@@ -143,6 +143,14 @@ function confirm($count = "") {
return " onclick=\"return confirm('" . lang('Are you sure?') . ($count ? " (' + $count + ')" : "") . "');\"";
}
+/** Escape string for JavaScript apostrophes
+* @param string
+* @return string
+*/
+function js_escape($string) {
+ return addcslashes($string, "\r\n'\\/"); // slash for <script>
+}
+
/** Get INI boolean value
* @param string
* @return bool
@@ -575,8 +583,9 @@ function hidden_fields_get() {
* @return array array($col => array())
*/
function column_foreign_keys($table) {
+ global $adminer;
$return = array();
- foreach (foreign_keys($table) as $foreign_key) {
+ foreach ($adminer->foreignKeys($table) as $foreign_key) {
foreach ($foreign_key["source"] as $val) {
$return[$val][] = $foreign_key;
}
@@ -593,11 +602,13 @@ function column_foreign_keys($table) {
*/
function enum_input($type, $attrs, $field, $value) {
preg_match_all("~'((?:[^']|'')*)'~", $field["length"], $matches);
+ $return = "";
foreach ($matches[1] as $i => $val) {
$val = stripcslashes(str_replace("''", "'", $val));
$checked = (is_int($value) ? $value == $i+1 : (is_array($value) ? in_array($i+1, $value) : $value === $val));
- echo " <label><input type='$type'$attrs value='" . ($i+1) . "'" . ($checked ? ' checked' : '') . '>' . h($val) . '</label>';
+ $return .= " <label><input type='$type'$attrs value='" . ($i+1) . "'" . ($checked ? ' checked' : '') . '>' . h($val) . '</label>';
}
+ return $return;
}
/** Print edit input field
@@ -613,9 +624,7 @@ function input($field, $value, $function) {
$functions = (isset($_GET["select"]) ? array("orig" => lang('original')) : array()) + $adminer->editFunctions($field);
$attrs = " name='fields[$name]'";
if ($field["type"] == "enum") {
- echo nbsp($functions[""]) . "<td>" . ($functions["orig"] ? "<label><input type='radio'$attrs value='-1' checked><i>$functions[orig]</i></label> " : "");
- echo $adminer->editInput($_GET["edit"], $field, $attrs, $value);
- enum_input("radio", $attrs, $field, $value);
+ echo nbsp($functions[""]) . "<td>" . $adminer->editInput($_GET["edit"], $field, $attrs, $value);
} else {
$first = 0;
foreach ($functions as $key => $val) {
@@ -624,7 +633,7 @@ function input($field, $value, $function) {
}
$first++;
}
- $onchange = ($first ? " onchange=\"var f = this.form['function[" . addcslashes($name, "\r\n'\\") . "]']; if ($first > f.selectedIndex) f.selectedIndex = $first;\"" : "");
+ $onchange = ($first ? " onchange=\"var f = this.form['function[" . js_escape($name) . "]']; if ($first > f.selectedIndex) f.selectedIndex = $first;\"" : "");
$attrs .= $onchange;
echo (count($functions) > 1 ? html_select("function[$name]", $functions, !isset($function) || in_array($function, $functions) || isset($functions[$function]) ? $function : "") : nbsp(reset($functions))) . '<td>';
$input = $adminer->editInput($_GET["edit"], $field, $attrs, $value); // usage in call is without a table
@@ -643,7 +652,7 @@ function input($field, $value, $function) {
echo "<textarea " . ($jush != "sqlite" || ereg("\n", $value) ? "cols='50' rows='12'" : "cols='30' rows='1' style='height: 1.2em;'") . "$attrs onkeydown='return textareaKeydown(this, event);'>" . h($value) . '</textarea>'; // 1.2em - line-height
} else {
// int(3) is only a display hint
- $maxlength = (!ereg('int', $field["type"]) && preg_match('~^([0-9]+)(,([0-9]+))?$~', $field["length"], $match) ? ((ereg("binary", $field["type"]) ? 2 : 1) * $match[1] + ($match[3] ? 1 : 0) + ($match[2] && !$field["unsigned"] ? 1 : 0)) : ($types[$field["type"]] ? $types[$field["type"]] + ($field["unsigned"] ? 0 : 1) : 0));
+ $maxlength = (!ereg('int', $field["type"]) && preg_match('~^(\\d+)(,(\\d+))?$~', $field["length"], $match) ? ((ereg("binary", $field["type"]) ? 2 : 1) * $match[1] + ($match[3] ? 1 : 0) + ($match[2] && !$field["unsigned"] ? 1 : 0)) : ($types[$field["type"]] ? $types[$field["type"]] + ($field["unsigned"] ? 0 : 1) : 0));
echo "<input value='" . h($value) . "'" . ($maxlength ? " maxlength='$maxlength'" : "") . (ereg('char|binary', $field["type"]) && $maxlength > 20 ? " size='40'" : "") . "$attrs>";
}
}
@@ -665,7 +674,7 @@ function process_input($field) {
if ($value == "") {
return "NULL";
}
- return intval($value);
+ return +$value;
}
if ($field["auto_increment"] && $value == "") {
return null;
@@ -721,11 +730,11 @@ function search_tables() {
*/
function dump_csv($row) {
foreach ($row as $key => $val) {
- if (preg_match("~[\"\n,;]~", $val) || $val === "") {
+ if (preg_match("~[\"\n,;\t]~", $val) || $val === "") {
$row[$key] = '"' . str_replace('"', '""', $val) . '"';
}
}
- echo implode(($_POST["format"] == "csv" ? "," : ";"), $row) . "\n";
+ echo implode(($_POST["format"] == "csv" ? "," : ($_POST["format"] == "tsv" ? "\t" : ";")), $row) . "\n";
}
/** Apply SQL function
@@ -785,7 +794,7 @@ function is_mail($email) {
*/
function is_url($string) {
$domain = '[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])'; // one domain component //! IDN
- return (preg_match("~^(https?)://($domain?\\.)+$domain(:[0-9]+)?(/.*)?(\\?.*)?(#.*)?\$~i", $string, $match) ? strtolower($match[1]) : ""); //! restrict path, query and fragment characters
+ return (preg_match("~^(https?)://($domain?\\.)+$domain(:\\d+)?(/.*)?(\\?.*)?(#.*)?\$~i", $string, $match) ? strtolower($match[1]) : ""); //! restrict path, query and fragment characters
}
/** Print header for hidden fieldset (close by </div></fieldset>)
View
1  adminer/include/lang.inc.php
@@ -18,6 +18,7 @@
'zh-tw' => '繁體中文', // http://tzangms.com
'ja' => '日本語', // Hitoshi Ozawa - http://sourceforge.jp/projects/oss-ja-jpn/releases/
'ta' => 'த‌மிழ்', // G. Sampath Kumar, Chennai, India, sampathkumar11@gmail.com
+ 'ar' => 'العربية', // Y.M Amine - Algeria - nbr7@live.fr
);
function lang($idf, $number = null) {
View
1  adminer/include/pdo.inc.php
@@ -79,5 +79,4 @@ function fetch_field() {
}
}
-$possible_drivers = array();
$drivers = array();
View
2  adminer/include/version.inc.php
@@ -1,2 +1,2 @@
<?php
-$VERSION = "3.0.2-dev";
+$VERSION = "3.1.0-dev";
View
5 adminer/index.php
@@ -1,14 +1,15 @@
<?php
/** Adminer - Compact database management
* @link http://www.adminer.org/
-* @author Jakub Vrana, http://php.vrana.cz/
+* @author Jakub Vrana, http://www.vrana.cz/
* @copyright 2007 Jakub Vrana
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
+* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
include "./include/bootstrap.inc.php";
-$enum_length = '\'(?:\'\'|[^\'\\\\]|\\\\.)*\'|"(?:""|[^"\\\\]|\\\\.)*"';
+$enum_length = "'(?:''|[^'\\\\]|\\\\.)*+'";
$inout = array("IN", "OUT", "INOUT");
if (isset($_GET["select"]) && ($_POST["edit"] || $_POST["clone"]) && !$_POST["save"]) {
View
2  adminer/indexes.inc.php
@@ -21,7 +21,7 @@
foreach ($index["columns"] as $key => $column) {
if ($column != "") {
$length = $index["lengths"][$key];
- $set[] = idf_escape($column) . ($length ? "(" . intval($length) . ")" : "");
+ $set[] = idf_escape($column) . ($length ? "(" . (+$length) . ")" : "");
$columns[] = $column;
$lengths[] = ($length ? $length : null);
}
View
268 adminer/lang/ar.inc.php
@@ -0,0 +1,268 @@
+<?php
+$translations = array(
+ 'Login' => 'تسجيل الدخول',
+ 'Logout successful.' => 'مع السلامة.',
+ 'Invalid credentials.' => 'فشل في تسجيل الدخول.',
+ 'Server' => 'الخادم',
+ 'Username' => 'المستعمل',
+ 'Password' => 'كلمة المرور',
+ 'Select database' => 'إختر قاعدة البيانات',
+ 'Invalid database.' => 'قاعدة بيانات خاطئة.',
+ 'Create new database' => 'أنشئ فاعدة بيانات',
+ 'Table has been dropped.' => 'تم حذف الجدول.',
+ 'Table has been altered.' => 'تم تعديل الجدول.',
+ 'Table has been created.' => 'تم إنشاء الجدول.',
+ 'Alter table' => 'تعديل الجدول',
+ 'Create table' => 'إنشاء جدول',
+ 'Table name' => 'إسم الجدول',
+ 'engine' => 'المحرك',
+ 'collation' => 'الترتيب',
+ 'Column name' => 'إسم العمود',
+ 'Type' => 'النوع',
+ 'Length' => 'الطول',
+ 'Auto Increment' => 'تزايد تلقائي',
+ 'Options' => 'خيارات',
+ 'Save' => 'حفظ',
+ 'Drop' => 'حذف',
+ 'Database has been created.' => 'تم إنشاء قاعدة البيانات.',
+ 'Database has been renamed.' => 'تمت إعادة تسمية فاعدة البيانات.',
+ 'Database has been altered.' => 'تم تعديل قاعدة البيانات.',
+ 'Alter database' => 'تعديل قاعدة البيانات',
+ 'Create database' => 'إنشاء قاعدة بيانات',
+ 'SQL command' => 'إستعلام SQL',
+ 'Dump' => 'تصدير',
+ 'Logout' => 'تسجيل الخروج',
+ 'database' => 'قاعدة بيانات',
+ 'Use' => 'المستعمل',
+ 'No tables.' => 'لا توجد جداول.',
+ 'select' => 'تحديد',
+ 'Create new table' => 'أنشئ جدول جديد',
+ 'Item has been deleted.' => 'تم حذف العنصر.',
+ 'Item has been updated.' => 'تم تعديل العنصر.',
+ 'Edit' => 'تعديل',
+ 'Insert' => 'إنشاء',
+ 'Save and insert next' => 'جفظ و إنشاء التالي',
+ 'Delete' => 'مسح',
+ 'Database' => 'قاعدة بيانات',
+ 'Routines' => 'الروتينات',
+ 'Indexes have been altered.' => 'تم تعديل المؤشر.',
+ 'Indexes' => 'المؤشرات',
+ 'Alter indexes' => 'تعديل المؤشرات',
+ 'Add next' => 'إضافة التالي',
+ 'Language' => 'اللغة',
+ 'Select' => 'إختيار',
+ 'New item' => 'عنصر جديد',
+ 'Search' => 'بحث',
+ 'Sort' => 'ترتيب',
+ 'descending' => 'تنازلي',
+ 'Limit' => 'حد',
+ 'No rows.' => 'لا توجد نتائج.',
+ 'Action' => 'حركة',
+ 'edit' => 'تعديل',
+ 'Page' => 'صفحة',
+ 'Query executed OK, %d row(s) affected.' => 'تم تنفسذ الإستعلام, %d عدد الأسطر المعدلة.',
+ 'Error in query' => 'هناك خطأ في الإستعلام',
+ 'Execute' => 'تنفيذ',
+ 'Table' => 'جدول',
+ 'Foreign keys' => 'مفاتيح أجنبية',
+ 'Triggers' => 'الزنادات',
+ 'View' => 'عرض',
+ 'Unable to select the table' => 'من غير الممكن إختيار الجدول',
+ 'Invalid CSRF token. Send the form again.' => 'CSRF Token خاطئ. من فضلك أعد إرسال الإستمارة.',
+ 'Comment' => 'تعليق',
+ 'Default values' => 'القيمة الإفتراضية',
+ '%d byte(s)' => '%d بايت',
+ 'No commands to execute.' => 'لا توجد أوامر للتنفيذ.',
+ 'Unable to upload a file.' => 'من غير الممكن رفع الملف.',
+ 'File upload' => 'رفع ملف',
+ 'File uploads are disabled.' => 'تم إلغاء رفع الملفات.',
+ 'Routine has been called, %d row(s) affected.' => 'تم إستدعاء الروتين, عدد الأسطر المعدلة %d.',
+ 'Call' => 'إستدعاء',
+ 'No extension' => 'إمتداد غير موجود',
+ 'None of the supported PHP extensions (%s) are available.' => 'إمتدادات php المدعومة غير موجودة.',
+ 'Session support must be enabled.' => 'عليك تفعيل نظام الجلسات.',
+ 'Session expired, please login again.' => 'إنتهت الجلسة، من فضلك أعد تسجيل الدخول.',
+ 'Text length' => 'طول النص',
+ 'Foreign key has been dropped.' => 'المفتاح الأجنبي تم مسحه.',
+ 'Foreign key has been altered.' => 'المفتاح الأجنبي تم تعديله.',
+ 'Foreign key has been created.' => 'المفتاح الأجنبي تم إنشاؤه.',
+ 'Foreign key' => 'مفتاح أجنبي',
+ 'Target table' => 'الجدول المستهدف',
+ 'Change' => 'تعديل',
+ 'Source' => 'المصدر',
+ 'Target' => 'الهدف',
+ 'Add column' => 'أضف عمود',
+ 'Alter' => 'تعديل',
+ 'Add foreign key' => 'إضافة مفتاح أجنبي',
+ 'ON DELETE' => 'ON DELETE',
+ 'ON UPDATE' => 'ON UPDATE',
+ 'Index Type' => 'نوع المؤشر',
+ 'Column (length)' => 'العمود (الطول)',
+ 'View has been dropped.' => 'تم مسح العرض.',
+ 'View has been altered.' => 'تم تعديل العرض.',
+ 'View has been created.' => 'تم إنشاء العرض.',
+ 'Alter view' => 'تعديل عرض',
+ 'Create view' => 'إنشاء عرض',
+ 'Name' => 'الإسم',
+ 'Process list' => 'قائمة الإجراءات',
+ '%d process(es) have been killed.' => 'عدد الإجراءات التي تم إيقافها %d.',
+ 'Kill' => 'إيقاف',
+ 'Parameter name' => 'إسم المتغير',
+ 'Database schema' => 'مخطط فاعدة البيانات',
+ 'Create procedure' => 'إنشاء إجراء',
+ 'Create function' => 'إنشاء دالة',
+ 'Routine has been dropped.' => 'تم حذف الروتين.',
+ 'Routine has been altered.' => 'تم تعديل الروتين.',
+ 'Routine has been created.' => 'تم إنشاء الروتين.',
+ 'Alter function' => 'تعديل الدالة',
+ 'Alter procedure' => 'تعديل الإجراء',
+ 'Return type' => 'نوع العودة',
+ 'Add trigger' => 'إضافة زناد',
+ 'Trigger has been dropped.' => 'تم حذف الزناد.',
+ 'Trigger has been altered.' => 'تم تعديل الزناد.',
+ 'Trigger has been created.' => 'تم إنشاء الزناد.',
+ 'Alter trigger' => 'تعديل زناد',
+ 'Create trigger' => 'إنشاء زناد',
+ 'Time' => 'الوقت',
+ 'Event' => 'الحدث',
+ '%d row(s)' => '%d أسطر',
+ 'Remove' => 'مسح',
+ 'Are you sure?' => 'هل أنت متأكد؟',
+ 'Privileges' => 'الإمتيازات',
+ 'Create user' => 'إنشاء مستخدم',
+ 'User has been dropped.' => 'تم حذف المستخدم.',
+ 'User has been altered.' => 'تم تعديل المستخدم.',
+ 'User has been created.' => 'تم إنشاء المستخدم.',
+ 'Hashed' => 'تلبيد',
+ 'Column' => 'عمود',
+ 'Routine' => 'روتين',
+ 'Grant' => 'Grant',
+ 'Revoke' => 'Revoke',
+ '%s version: %s through PHP extension %s' => 'النسخة %s : %s عن طريق إمتداد ال PHP %s',
+ 'Logged as: %s' => 'تم تسجيل الدخول بإسم %s',
+ 'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'معلومات POST كبيرة جدا. قم بتقليص حجم المعلومات أو قم بزيادة قيمة %s في خيارات ال PHP.',
+ 'Move up' => 'نقل للأعلى',
+ 'Move down' => 'نقل للأسفل',
+ 'Export' => 'تصدير',
+ 'Tables' => 'جداول',
+ 'Data' => 'معلومات',
+ 'Output' => 'إخراج',
+ 'open' => 'فتح',
+ 'save' => 'حفظ',
+ 'Format' => 'الصيغة',
+ 'Functions' => 'الدوال',
+ 'Aggregation' => 'تجميع',
+ 'Event has been dropped.' => 'تم مسح الحدث.',
+ 'Event has been altered.' => 'تم تعديل الحدث.',
+ 'Event has been created.' => 'تم إنشاء الحدث.',
+ 'Alter event' => 'تعديل حدث',
+ 'Create event' => 'إنشاء حدث',
+ 'Start' => 'إبدأ',
+ 'End' => 'إنهاء',
+ 'Every' => 'كل',
+ 'Status' => 'حالة',
+ 'On completion preserve' => 'حفظ عند الإنتهاء',
+ 'Events' => 'الأحداث',
+ 'Schedule' => 'مواعيد',
+ 'At given time' => 'في وقت محدد',
+ 'Save and continue edit' => 'إحفظ و واصل التعديل',
+ 'original' => 'الأصلي',
+ 'Tables have been truncated.' => 'تم قطع الجداول.',
+ 'Tables have been moved.' => 'تم نقل الجداول.',
+ 'Tables have been dropped.' => 'تم حذف الجداول.',
+ 'Tables and views' => 'الجداول و العروض',
+ 'Engine' => 'المحرك',
+ 'Collation' => 'ترتيب',
+ 'Data Length' => 'طول المعطيات.',
+ 'Index Length' => 'طول المؤشر.',
+ 'Data Free' => 'المساحة الحرة',
+ 'Rows' => 'الأسطر',
+ ',' => ',',
+ 'Analyze' => 'تحليل',
+ 'Optimize' => 'تحسين',
+ 'Check' => 'فحص',
+ 'Repair' => 'إصلاح',
+ 'Truncate' => 'قطع',
+ 'Move to other database' => 'نقل إلى قاعدة بيانات أخرى',
+ 'Move' => 'نقل',
+ '%d item(s) have been affected.' => 'عدد العناصر المعدلة هو %d.',
+ 'whole result' => 'نتيجة كاملة',
+ 'Clone' => 'نسخ',
+ 'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'لقد تجاوزت العدد الأقصى للحقول. يرجى الرفع من %s و %s.',
+ 'Partition by' => 'مقسم بواسطة',
+ 'Partitions' => 'التقسيمات',
+ 'Partition name' => 'إسم التقسيم',
+ 'Values' => 'القيم',
+ '%d row(s) have been imported.' => 'عدد الأسطر المستوردة هو %d.',
+ 'anywhere' => 'في اي مكان',
+ 'CSV Import' => 'إستيراد CSV',
+ 'Import' => 'إستيراد',
+ 'Stop on error' => 'أوقف في حالة حدوث خطأ',
+ '%.3f s' => '%.3f s',
+ '$1-$3-$5' => '$5/$3/$1',
+ '[yyyy]-mm-dd' => 'jj/mm/[aaaa]',
+ 'History' => 'تاريخ',