adminer-svn Mailing List for Adminer
Database management in a single PHP file
Brought to you by:
jakubvrana
You can subscribe to this list here.
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(83) |
Sep
(104) |
Oct
(66) |
Nov
(36) |
Dec
(26) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 |
Jan
(16) |
Feb
(35) |
Mar
(19) |
Apr
(155) |
May
(14) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
| 2011 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: 庞申杰(千. <she...@al...> - 2016-01-12 04:12:15
|
Hello, I discovered a bug about the adminer that can leads to remote PHP code execution vulnerability. Is there any safety way to submit the vulnerability detail for you? Thank you for your attention to this matter. |
|
From: <jak...@us...> - 2011-02-24 16:50:57
|
Revision: 1528
http://adminer.svn.sourceforge.net/adminer/?rev=1528&view=rev
Author: jakubvrana
Date: 2011-02-24 16:50:50 +0000 (Thu, 24 Feb 2011)
Log Message:
-----------
Release
Modified Paths:
--------------
trunk/version.js
Modified: trunk/version.js
===================================================================
--- trunk/version.js 2010-11-16 12:17:46 UTC (rev 1527)
+++ trunk/version.js 2011-02-24 16:50:50 UTC (rev 1528)
@@ -2,5 +2,5 @@
(function () { // cookie function is not defined in older versions
var date = new Date();
date.setDate(date.getDate() + 1);
- document.cookie = 'adminer_version=3.1.0; expires=' + date; // last released version
+ document.cookie = 'adminer_version=3.2.0; expires=' + date; // last released version
})();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jak...@us...> - 2010-11-16 12:17:52
|
Revision: 1527
http://adminer.svn.sourceforge.net/adminer/?rev=1527&view=rev
Author: jakubvrana
Date: 2010-11-16 12:17:46 +0000 (Tue, 16 Nov 2010)
Log Message:
-----------
Release
Modified Paths:
--------------
trunk/version.js
Modified: trunk/version.js
===================================================================
--- trunk/version.js 2010-10-18 08:35:32 UTC (rev 1526)
+++ trunk/version.js 2010-11-16 12:17:46 UTC (rev 1527)
@@ -1,6 +1,6 @@
// downloaded from repository by verifyVersion() before Adminer 3.0.0
(function () { // cookie function is not defined in older versions
var date = new Date();
- date.setDate(date.getDate() + 7); // valid for 7 days
- document.cookie = 'adminer_version=3.0.1; expires=' + date; // last released version
+ date.setDate(date.getDate() + 1);
+ document.cookie = 'adminer_version=3.1.0; expires=' + date; // last released version
})();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jak...@us...> - 2010-10-18 08:35:38
|
Revision: 1526
http://adminer.svn.sourceforge.net/adminer/?rev=1526&view=rev
Author: jakubvrana
Date: 2010-10-18 08:35:32 +0000 (Mon, 18 Oct 2010)
Log Message:
-----------
Release
Modified Paths:
--------------
trunk/version.js
Modified: trunk/version.js
===================================================================
--- trunk/version.js 2010-10-15 12:04:56 UTC (rev 1525)
+++ trunk/version.js 2010-10-18 08:35:32 UTC (rev 1526)
@@ -2,5 +2,5 @@
(function () { // cookie function is not defined in older versions
var date = new Date();
date.setDate(date.getDate() + 7); // valid for 7 days
- document.cookie = 'adminer_version=3.0.0; expires=' + date; // last released version
+ document.cookie = 'adminer_version=3.0.1; expires=' + date; // last released version
})();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jak...@us...> - 2010-10-15 12:05:02
|
Revision: 1525
http://adminer.svn.sourceforge.net/adminer/?rev=1525&view=rev
Author: jakubvrana
Date: 2010-10-15 12:04:56 +0000 (Fri, 15 Oct 2010)
Log Message:
-----------
Release
Modified Paths:
--------------
trunk/version.js
Modified: trunk/version.js
===================================================================
--- trunk/version.js 2010-07-14 09:11:04 UTC (rev 1524)
+++ trunk/version.js 2010-10-15 12:04:56 UTC (rev 1525)
@@ -2,5 +2,5 @@
(function () { // cookie function is not defined in older versions
var date = new Date();
date.setDate(date.getDate() + 7); // valid for 7 days
- document.cookie = 'adminer_version=2.3.2; expires=' + date; // last released version
+ document.cookie = 'adminer_version=3.0.0; expires=' + date; // last released version
})();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jak...@us...> - 2010-07-14 09:11:10
|
Revision: 1524
http://adminer.svn.sourceforge.net/adminer/?rev=1524&view=rev
Author: jakubvrana
Date: 2010-07-14 09:11:04 +0000 (Wed, 14 Jul 2010)
Log Message:
-----------
Source codes moved to adminer.git.sourceforge.net
Removed Paths:
-------------
trunk/externals/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jak...@us...> - 2010-05-07 11:55:30
|
Revision: 1523
http://adminer.svn.sourceforge.net/adminer/?rev=1523&view=rev
Author: jakubvrana
Date: 2010-05-07 11:55:19 +0000 (Fri, 07 May 2010)
Log Message:
-----------
Source codes moved to adminer.git.sourceforge.net
Removed Paths:
-------------
trunk/adminer/
trunk/changes.txt
trunk/compile.php
trunk/coverage.php
trunk/editor/
trunk/lang.php
trunk/tests/
trunk/todo.txt
Deleted: trunk/changes.txt
===================================================================
--- trunk/changes.txt 2010-05-05 16:31:39 UTC (rev 1522)
+++ trunk/changes.txt 2010-05-07 11:55:19 UTC (rev 1523)
@@ -1,260 +0,0 @@
-Adminer 3.0.0-dev:
-Drivers for MS SQL, SQLite, PostgreSQL
-Allow concurrent logins on the same server
-In-place editation in select
-Show number of tables in server overview
-Operator LIKE %%
-Remember export parameters in cookie
-Allow semicolon as CSV separator
-Autofocus username in login form
-Disable spellchecking in SQL textareas
-Japanese translation
-Link table names in SQL queries
-Defer table information in database overview to JavaScript (performance)
-Big tables optimizations (performance)
-
-Adminer 2.3.2 (released 2010-04-21):
-Fix COUNT(*) link
-Fix Save and continue edit
-
-Adminer 2.3.1 (released 2010-04-06):
-Add Drop button to Alter pages (regression from 2.0.0)
-Link COUNT(*) result to listing
-Newlines in select query edit
-Return to referer after edit
-Respect session.auto_start (bug #2967284)
-
-Adminer 2.3.0 (released 2010-02-26):
-Support for permanent login (customization required)
-Search in all tables
-Show status variables
-Print sums in tables overview
-Add Delete button to Edit page (regression from 2.0.0)
-Print error summary in SQL command
-Simplify SQL syntax error message
-Show SQL query info if available
-Delete length when changing type in alter table
-Ability to check table prefix in export
-
-Adminer 2.2.1 (released 2009-11-26):
-Highlight current links
-Improve concurrency
-Move number of tables to DB info (performance)
-Search by foreign keys (Editor)
-Link new item in backward keys (Editor)
-
-Adminer 2.2.0 (released 2009-10-20):
-Database list - bulk drop, number of tables
-Enlarge field for enum and set definition
-Display table links above table structure
-Link URLs in select
-Display number of manipulated rows in JS confirm
-Set required memory in SQL command
-Fix removed default in ALTER
-Display whitespace in texts (bug #2858042)
-ClickJacking protection in modern browsers
-E-mail attachments (Editor)
-Optional year in date (Editor)
-Search operators (Editor)
-Align numbers to right in select (Editor)
-Move <h1> to $adminer->navigation (customization)
-Rename get_dbh to connection (customization)
-
-Adminer 2.1.0 (released 2009-09-12):
-Edit default values directly in table creation
-Execute SQL file stored on server disk
-Display EXPLAIN in SQL query
-Compress export and import
-Display column comments in table overview
-Use ON DUPLICATE KEY UPDATE for CSV import
-Print ALTER export instead of executing it
-Click on row selects it
-Fix Editor date format
-Fix long SQL query crash (bug #2839231)
-Speedup of simple alter table
-Traditional Chinese translation
-
-Adminer 2.0.0 (released 2009-08-06):
-Editor: User friendly data editor
-Customization: Adminer class
-Create single column foreign key in table structure
-Table relations (Editor)
-Send e-mails (Editor)
-Display images in blob (Editor)
-Localize date (Editor)
-Treat tinyint(1) as bool (Editor)
-Divide types to groups in table creation
-Link e-mails in select
-Show type in field name title (thanks to Jakub Sochor)
-Preselect now() for timestamp columns (thanks to paranoiq)
-Clear history (thanks to paranoiq)
-Prefill insert by foreign key searches
-Print number of rows in SQL command
-Remove Delete button from Edit page - use mass operation for it
-Faster multiple update, clone and delete
-Faster table list in navigation
-Download version checker and syntax highlighting from HTTPS
-Use HTML Strict instead of XHTML
-Remove function minification in favor of performance and customization
-Fix grant ALL PRIVILEGES with GRANT OPTION
-Fix CSV import
-Fix work with default values (thanks to Jiri Pospisil)
-
-Adminer 1.11.1 (released 2009-07-03):
-Fix problem with enabled Filter extension
-
-Adminer 1.11.0 (released 2009-07-02):
-Connection through socket by server :/path/to/socket
-Simplify export
-Display execution time in SQL query
-Relative date and time functions
-Version checker
-Save queries to history and display it on SQL page
-Display MySQL variables
-Ability to select all rows on current page of select
-Separate JavaScript functions
-Always use the default style before the external one
-Always try to use the syntax highlighter
-All privileges in user rights
-Fix FOUND_ROWS() in SQL command
-Export only selected columns in select
-Bulk database creation
-Include views in drop and move on database overview
-Hide fieldsets in select
-Automatically add new fields in table creation
-Use \n in SQL commands
-
-phpMinAdmin 1.10.1 (released 2009-05-07):
-Highlight odd and hover rows
-Partition editing comfort (bug #2783446)
-Allow full length in limited int (thanks to Vlasta Neubauer)
-
-phpMinAdmin 1.10.0 (released 2009-04-28):
-Partitioning (MySQL 5.1)
-CSV import
-Plus and minus functions
-Option to stop on error in SQL command (thanks to Vaclav Marik)
-Cross links to select and table (bug #2236232), link new item
-Suhosin compatibility (thanks to Klemens Hackel)
-Remove max_allowed_packet from export
-Read style from phpMinAdmin.css if exists
-Size reduction by minification of variables and functions
-Russian translation
-
-phpMinAdmin 1.9.1 (released 2008-10-27):
-Update translations
-
-phpMinAdmin 1.9.0 (released 2008-10-16):
-List of tables and views with maintenance commands
-Clone rows
-Bulk edit and clone
-Function results in edit
-NOT operators in select
-Search without column restriction
-Use type=password for unhashed password
-Only one button for each action in select
-Choose language through option-list
-XHTML syntax errors (thanks to kozotoc)
-Don't set global variable in export
-SHOW DATABASES can be revoked
-Order by function result working also in older MySQL versions
-Tested on IIS (thanks to krasl.cz)
-
-phpMinAdmin 1.8.0 (released 2008-09-12):
-Events (MySQL 5.1)
-Access without login - accept ?username=
-Print SQL query in select, messages and warnings
-Display number of found rows
-Don't wrap lines in select table
-Italian and Estonian translation
-Order by COUNT(*)
-
-phpMinAdmin 1.7.0 (released 2008-08-26):
-Customizable export (select objects to export, SQL or CSV)
-Ability to alter existing tables and drop old tables in export
-Choose columns in select, aggregation
-Order rows by clicking on table heading
-Truncate only search results
-Automatically select name for trigger
-Chinese and French translation
-Preserve default values when altering table
-Maintain auto_increment when moving columns
-Smaller multilingual file
-Cache static files
-Faster checking of number of results
-
-phpMinAdmin 1.6.1 (released 2008-05-22):
-Set session parameters only if not session.auto_start
-
-phpMinAdmin 1.6.0 (released 2008-05-16):
-Order of columns in table
-Set max_allowed_packet in dump and use extended insert
-Spanish and German translations
-Use images for editing buttons
-Protection against big POST data
-Logout by POST
-Information about logged user
-Separate stylesheet
-Last-Modified header for files
-Several bug fixes
-
-phpMinAdmin 1.5.0 (released 2008-01-09):
-Mass delete
-Vertical privileges
-Specify connection port by colon in server
-Ignore length in date and time types
-Boolean fulltext search for all columns in MyISAM
-Shrink compiled output
-Remove maxlength from server and username
-Uncheck NULL by change
-Mark shortened fields in select
-
-phpMinAdmin 1.4.0 (released 2007-08-15):
-Privileges
-New design
-Dutch translation
-Use NULL for auto_increment (bug #1768966)
-Fix dropping procedure parameters
-
-phpMinAdmin 1.3.2 (released 2007-08-06):
-Next field by JavaScript in foreign keys
-Set time zone in dump
-Refresh lang cookie
-Remember drop result in case of faulty create
-Move vertical lines in schema properly
-Fix maximum page in select
-
-phpMinAdmin 1.3.1 (released 2007-07-31):
-Move references lines in schema
-Fix dump
-Fix update links
-
-phpMinAdmin 1.3.0 (released 2007-07-27):
-Breadcrumb navigation
-Operator IN
-Timestamp default values
-Draggable tables in schema
-Number of rows in navigation
-Display MySQL version and used PHP extension
-More friendly user interface
-Slovak translation
-
-phpMinAdmin 1.2.0 (released 2007-07-25):
-Manipulate triggers
-PDO Abstraction
-Auto_increment value
-JavaScript for adding rows
-
-phpMinAdmin 1.1.0 (released 2007-07-19):
-Routines manipulation
-Views manipulation
-Foreign keys manipulation
-Database schema with references
-Processlist
-Index length
-Dump individual tables
-JavaScript for next rows in table edit
-Cache databases list
-
-phpMinAdmin 1.0.0 (released 2007-07-11):
-First official release
Deleted: trunk/compile.php
===================================================================
--- trunk/compile.php 2010-05-05 16:31:39 UTC (rev 1522)
+++ trunk/compile.php 2010-05-07 11:55:19 UTC (rev 1523)
@@ -1,238 +0,0 @@
-<?php
-error_reporting(6135); // errors and warnings
-include dirname(__FILE__) . "/adminer/include/version.inc.php";
-include dirname(__FILE__) . "/externals/jsmin-php/jsmin.php";
-
-function add_apo_slashes($s) {
- return addcslashes($s, "\\'");
-}
-
-function remove_lang($match) {
- global $translations;
- $idf = strtr($match[2], array("\\'" => "'", "\\\\" => "\\"));
- $s = ($translations[$idf] ? $translations[$idf] : $idf);
- if ($match[3] == ",") { // lang() has parameters
- return "$match[1]" . (is_array($s) ? "lang(array('" . implode("', '", array_map('add_apo_slashes', $s)) . "')," : "sprintf('" . add_apo_slashes($s) . "',");
- }
- return ($match[1] && $match[4] ? $s : "$match[1]'" . add_apo_slashes($s) . "'$match[4]");
-}
-
-function lang_ids($match) {
- global $lang_ids;
- $lang_id = &$lang_ids[stripslashes($match[1])];
- if (!isset($lang_id)) {
- $lang_id = count($lang_ids) - 1;
- }
- return ($_SESSION["lang"] ? $match[0] : "lang($lang_id$match[2]");
-}
-
-function put_file($match) {
- global $project;
- if (basename($match[2]) == '$LANG.inc.php') {
- return $match[0]; // processed later
- }
- $return = file_get_contents(dirname(__FILE__) . "/$project/$match[2]");
- if (basename($match[2]) != "lang.inc.php" || !$_SESSION["lang"]) {
- $tokens = token_get_all($return); // to find out the last token
- return "?>\n$return" . (in_array($tokens[count($tokens) - 1][0], array(T_CLOSE_TAG, T_INLINE_HTML), true) ? "<?php" : "");
- } elseif (preg_match('~\\s*(\\$pos = .*)~', $return, $match2)) {
- // single language lang() is used for plural
- return "function lang(\$translation, \$number) {\n\t" . str_replace('$LANG', "'$_SESSION[lang]'", $match2[1]) . "\n\treturn sprintf(\$translation[\$pos], \$number);\n}\n";
- } else {
- echo "lang() not found\n";
- }
-}
-
-function put_file_lang($match) {
- global $lang_ids, $project;
- if ($_SESSION["lang"]) {
- return "";
- }
- $return = "";
- foreach (glob(dirname(__FILE__) . "/adminer/lang/*.inc.php") as $filename) {
- include $filename; // assign $translations
- $translation_ids = array_flip($lang_ids); // default translation
- foreach ($translations as $key => $val) {
- if (isset($val)) {
- $translation_ids[$lang_ids[$key]] = $val;
- }
- }
- $return .= "\tcase \"" . basename($filename, '.inc.php') . '": $translations = array(';
- foreach ($translation_ids as $val) {
- $return .= (is_array($val) ? "array('" . implode("', '", array_map('add_apo_slashes', $val)) . "')" : "'" . add_apo_slashes($val) . "'") . ", ";
- }
- $return = substr($return, 0, -2) . "); break;\n";
- }
- return "switch (\$LANG) {\n$return}\n";
-}
-
-function short_identifier($number, $chars) {
- $return = '';
- while ($number >= 0) {
- $return .= $chars{$number % strlen($chars)};
- $number = floor($number / strlen($chars)) - 1;
- }
- return $return;
-}
-
-// based on http://latrine.dgx.cz/jak-zredukovat-php-skripty
-function php_shrink($input) {
- $special_variables = array_flip(array('$this', '$GLOBALS', '$_GET', '$_POST', '$_FILES', '$_COOKIE', '$_SESSION', '$_SERVER'));
- $short_variables = array();
- $shortening = true;
- $tokens = token_get_all($input);
-
- foreach ($tokens as $i => $token) {
- if ($token[0] === T_VARIABLE && !isset($special_variables[$token[1]])) {
- $short_variables[$token[1]]++;
- }
- }
-
- arsort($short_variables);
- foreach (array_keys($short_variables) as $number => $key) {
- $short_variables[$key] = short_identifier($number, implode("", range('a', 'z')) . '_' . implode("", range('A', 'Z'))); // could use also numbers and \x7f-\xff
- }
-
- $set = array_flip(preg_split('//', '!"#$&\'()*+,-./:;<=>?@[\]^`{|}'));
- $space = '';
- $output = '';
- $in_echo = false;
- $doc_comment = false; // include only first /**
- for (reset($tokens); list($i, $token) = each($tokens); ) {
- if (!is_array($token)) {
- $token = array(0, $token);
- }
- if ($tokens[$i+2][0] === T_CLOSE_TAG && $tokens[$i+3][0] === T_INLINE_HTML && $tokens[$i+4][0] === T_OPEN_TAG
- && strlen(addcslashes($tokens[$i+3][1], "'\\")) < strlen($tokens[$i+3][1]) + 3
- ) {
- $tokens[$i+2] = array(T_ECHO, 'echo');
- $tokens[$i+3] = array(T_CONSTANT_ENCAPSED_STRING, "'" . addcslashes($tokens[$i+3][1], "'\\") . "'");
- $tokens[$i+4] = array(0, ';');
- }
- if ($token[0] == T_COMMENT || $token[0] == T_WHITESPACE || ($token[0] == T_DOC_COMMENT && $doc_comment)) {
- $space = "\n";
- } else {
- if ($token[0] == T_DOC_COMMENT) {
- $doc_comment = true;
- }
- if ($token[0] == T_VAR) {
- $shortening = false;
- } elseif (!$shortening) {
- if ($token[1] == ';') {
- $shortening = true;
- }
- } elseif ($token[0] == T_ECHO) {
- $in_echo = true;
- } elseif ($token[1] == ';' && $in_echo) {
- if ($tokens[$i+1][0] === T_WHITESPACE && $tokens[$i+2][0] === T_ECHO) {
- next($tokens);
- $i++;
- }
- if ($tokens[$i+1][0] === T_ECHO) {
- // join two consecutive echos
- next($tokens);
- $token[1] = ','; // '.' would conflict with "a".1+2 and would use more memory //! remove ',' and "," but not $var","
- } else {
- $in_echo = false;
- }
- } elseif ($token[0] === T_VARIABLE && !isset($special_variables[$token[1]])) {
- $token[1] = '$' . $short_variables[$token[1]];
- }
- if (isset($set[substr($output, -1)]) || isset($set[$token[1][0]])) {
- $space = '';
- }
- $output .= $space . $token[1];
- $space = '';
- }
- }
- return $output;
-}
-
-function minify_css($file) {
- return preg_replace('~\\s*([:;{},])\\s*~', '\\1', $file);
-}
-
-function compile_file($match) {
- global $project;
- return call_user_func($match[2], file_get_contents(dirname(__FILE__) . "/$project/$match[1]"));
-}
-
-$DRIVER = "";
-if (file_exists(dirname(__FILE__) . "/adminer/drivers/" . $_SERVER["argv"][1] . ".inc.php")) {
- $DRIVER = $_SERVER["argv"][1];
- array_shift($_SERVER["argv"]);
-}
-
-unset($_COOKIE["adminer_lang"]);
-$_SESSION["lang"] = $_SERVER["argv"][1]; // Adminer functions read language from session
-include dirname(__FILE__) . "/adminer/include/lang.inc.php";
-if (isset($_SESSION["lang"])) {
- if (isset($_SERVER["argv"][2]) || !isset($langs[$_SESSION["lang"]])) {
- echo "Usage: php compile.php [lang]\nPurpose: Compile adminer[-lang].php and editor[-lang].php.\n";
- exit(1);
- }
- include dirname(__FILE__) . "/adminer/lang/$_SESSION[lang].inc.php";
-}
-
-// check function definition in drivers
-$filename = dirname(__FILE__) . "/adminer/drivers/mysql.inc.php";
-preg_match_all('~\\bfunction ([^(]+)~', file_get_contents($filename), $matches); //! respect context (extension, class)
-$functions = array_combine($matches[1], $matches[0]);
-unset($functions["__destruct"], $functions["Min_DB"], $functions["Min_Result"]);
-foreach (glob(dirname(__FILE__) . "/adminer/drivers/" . ($DRIVER ? $DRIVER : "*") . ".inc.php") as $filename) {
- if ($filename != "mysql.inc.php") {
- $file = file_get_contents($filename);
- foreach ($functions as $val) {
- if (!strpos($file, "$val(")) {
- echo "Missing $val in $filename\n";
- }
- }
- }
-}
-
-$drivers = array();
-foreach (array("adminer", "editor") as $project) {
- $lang_ids = array(); // global variable simplifies usage in a callback function
- $file = file_get_contents(dirname(__FILE__) . "/$project/index.php");
- if ($DRIVER) {
- $connection = (object) array("server_info" => 5.1); // MySQL support is version specific
- $_GET[$DRIVER] = true; // to load the driver
- include_once dirname(__FILE__) . "/adminer/drivers/$DRIVER.inc.php";
- foreach (array("view", "event", "privileges", "user", "processlist", "variables", "trigger", "scheme") as $feature) {
- if (!support($feature)) {
- $file = str_replace("} elseif (isset(\$_GET[\"$feature\"])) {\n\tinclude \"./$feature.inc.php\";\n", "", $file);
- }
- }
- if (!support("routine")) {
- $file = str_replace("} elseif (isset(\$_GET[\"procedure\"])) {\n\tinclude \"./procedure.inc.php\";\n", "", $file);
- $file = str_replace("} elseif (isset(\$_GET[\"call\"])) {\n\tinclude \"./call.inc.php\";\n", "", $file);
- $file = str_replace("if (isset(\$_GET[\"callf\"])) {\n\t\$_GET[\"call\"] = \$_GET[\"callf\"];\n}\nif (isset(\$_GET[\"function\"])) {\n\t\$_GET[\"procedure\"] = \$_GET[\"function\"];\n}\n", "", $file);
- }
- }
- $file = preg_replace_callback('~\\b(include|require) "([^"]*)";~', 'put_file', $file);
- $file = str_replace('include "../adminer/include/coverage.inc.php";', '', $file);
- if ($DRIVER) {
- $file = preg_replace('(include "../adminer/drivers/(?!' . preg_quote($DRIVER) . ').*\\s*)', '', $file);
- }
- $file = preg_replace_callback('~\\b(include|require) "([^"]*)";~', 'put_file', $file); // bootstrap.inc.php
- $file = preg_replace_callback("~lang\\('((?:[^\\\\']+|\\\\.)*)'([,)])~s", 'lang_ids', $file);
- $file = preg_replace_callback('~\\b(include|require) "([^"]*\\$LANG.inc.php)";~', 'put_file_lang', $file);
- if ($_SESSION["lang"]) {
- // single language version
- $file = preg_replace_callback("~(<\\?php\\s*echo )?lang\\('((?:[^\\\\']+|\\\\.)*)'([,)])(;\\s*\\?>)?~s", 'remove_lang', $file);
- $file = str_replace("<?php switch_lang(); ?>\n", "", $file);
- $file = str_replace('<?php echo $LANG; ?>', $_SESSION["lang"], $file);
- }
- $file = str_replace('<script type="text/javascript" src="static/editing.js"></script>' . "\n", "", $file);
- $file = preg_replace_callback("~compile_file\\('([^']+)', '([^']+)'\\);~", 'compile_file', $file); // integrate static files
- $replace = 'h(preg_replace("~\\\\\\\\?.*~", "", $_SERVER["REQUEST_URI"])) . "?file=\\1&version=' . $VERSION;
- $file = preg_replace('~\\.\\./adminer/static/(default\\.css|functions\\.js|favicon\\.ico)~', '<?php echo ' . $replace . '"; ?>', $file);
- $file = preg_replace('~\\.\\./adminer/static/([^\'"]*)~', '" . ' . $replace, $file);
- $file = str_replace("../externals/jush/", "https://www.adminer.org/static/", $file);
- $file = preg_replace("~<\\?php\\s*\\?>\n?|\\?>\n?<\\?php~", '', $file);
- $file = php_shrink($file);
-
- $filename = $project . (preg_match('~-dev$~', $VERSION) ? "" : "-$VERSION") . ($DRIVER ? "-$DRIVER" : "") . ($_SESSION["lang"] ? "-$_SESSION[lang]" : "") . ".php";
- fwrite(fopen($filename, "w"), $file); // file_put_contents() since PHP 5
- echo "$filename created (" . strlen($file) . " B).\n";
-}
Deleted: trunk/coverage.php
===================================================================
--- trunk/coverage.php 2010-05-05 16:31:39 UTC (rev 1522)
+++ trunk/coverage.php 2010-05-07 11:55:19 UTC (rev 1523)
@@ -1,82 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="cs">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Coverage</title>
-</head>
-
-<body>
-
-<?php
-function xhtml_open_tags($s) {
- // returns array of opened tags in $s
- $return = array();
- preg_match_all('~<([^>]+)~', $s, $matches);
- foreach ($matches[1] as $val) {
- if ($val[0] == "/") {
- array_pop($return);
- } elseif (substr($val, -1) != "/") {
- $return[] = $val;
- }
- }
- return $return;
-}
-
-$coverage_filename = sys_get_temp_dir() . "/adminer_coverage.ser";
-if (!extension_loaded("xdebug")) {
- echo "<p class='error'>Xdebug has to be enabled.</p>\n";
-} elseif ($_GET["coverage"] === "0") {
- file_put_contents($coverage_filename, serialize(array()));
- echo "<p class='message'>Coverage started.</p>\n";
-} elseif (preg_match('~^(adminer|editor)/(include/)?[-_.a-z0-9]+$~i', $_GET["coverage"])) {
- // highlight single file
- $filename = $_GET["coverage"];
- $coverage = (file_exists($coverage_filename) ? unserialize(file_get_contents($coverage_filename)) : array());
- $file = explode("<br />", highlight_file($filename, true));
- unset($prev_color);
- $s = "";
- for ($l=0; $l <= count($file); $l++) {
- $line = $file[$l];
- $color = "#C0FFC0"; // tested
- switch ($coverage[realpath($filename)][$l+1]) {
- case -1: $color = "#FFC0C0"; break; // untested
- case -2: $color = "Silver"; break; // dead code
- case null: $color = ""; break; // not executable
- }
- if (!isset($prev_color)) {
- $prev_color = $color;
- }
- if ($prev_color != $color || !isset($line)) {
- echo "<div" . ($prev_color ? " style='background-color: $prev_color;'" : "") . ">$s";
- $open_tags = xhtml_open_tags($s);
- foreach (array_reverse($open_tags) as $tag) {
- echo "</" . preg_replace('~ .*~', '', $tag) . ">";
- }
- echo "</div>\n";
- $s = ($open_tags ? "<" . implode("><", $open_tags) . ">" : "");
- $prev_color = $color;
- }
- $s .= "$line<br />\n";
- }
-} else {
- if (file_exists($coverage_filename)) {
- // display list of files
- $coverage = unserialize(file_get_contents($coverage_filename));
- echo "<table border='1' cellspacing='0'>\n";
- foreach (array_merge(glob("adminer/*.php"), glob("adminer/include/*.php"), glob("editor/*.php"), glob("editor/include/*.php")) as $filename) {
- $cov = $coverage[realpath($filename)];
- $ratio = 0;
- if (is_array($cov)) {
- $values = array_count_values($cov);
- $ratio = round(100 - 100 * $values[-1] / (count($cov) - $values[-2]));
- }
- echo "<tr><td align='right' style='background-color: " . ($ratio < 50 ? "Red" : ($ratio < 75 ? "#FFEA20" : "#A7FC9D")) . ";'>$ratio%</td><td><a href='coverage.php?coverage=$filename'>$filename</a></td></tr>\n";
- }
- echo "</table>\n";
- }
- echo "<p><a href='coverage.php?coverage=0'>Start new coverage</a></p>\n";
-}
-?>
-
-</body>
-</html>
Deleted: trunk/lang.php
===================================================================
--- trunk/lang.php 2010-05-05 16:31:39 UTC (rev 1522)
+++ trunk/lang.php 2010-05-07 11:55:19 UTC (rev 1523)
@@ -1,55 +0,0 @@
-<?php
-error_reporting(6135); // errors and warnings
-unset($_COOKIE["adminer_lang"]);
-$_SESSION["lang"] = $_SERVER["argv"][1]; // Adminer functions read language from session
-if (isset($_SESSION["lang"])) {
- include dirname(__FILE__) . "/adminer/include/lang.inc.php";
- if (isset($_SERVER["argv"][2]) || !isset($langs[$_SESSION["lang"]])) {
- echo "Usage: php lang.php [lang]\nPurpose: Update adminer/lang/*.inc.php from source code messages.\n";
- exit(1);
- }
-}
-
-$messages_all = array();
-foreach (array_merge(
- glob(dirname(__FILE__) . "/adminer/*.php"),
- glob(dirname(__FILE__) . "/adminer/include/*.php"),
- glob(dirname(__FILE__) . "/adminer/drivers/*.php"),
- glob(dirname(__FILE__) . "/editor/*.php"),
- glob(dirname(__FILE__) . "/editor/include/*.php")
-) as $filename) {
- $file = file_get_contents($filename);
- if (preg_match_all("~lang\\(('(?:[^\\\\']+|\\\\.)*')([),])~", $file, $matches)) { // lang() always uses apostrophes
- $messages_all += array_combine($matches[1], $matches[2]);
- }
-}
-
-foreach (glob(dirname(__FILE__) . "/adminer/lang/" . ($_SESSION["lang"] ? $_SESSION["lang"] : "*") . ".inc.php") as $filename) {
- $messages = $messages_all;
- $file = file_get_contents($filename);
- preg_match_all("~^(\\s*)(?:// )?(('(?:[^\\\\']+|\\\\.)*') => .*[^,\n]),?~m", $file, $matches, PREG_SET_ORDER);
- $s = "";
- foreach ($matches as $match) {
- if (isset($messages[$match[3]])) {
- // keep current messages
- $s .= "$match[1]$match[2],\n";
- unset($messages[$match[3]]);
- } else {
- // comment deprecated messages
- $s .= "$match[1]// $match[2],\n";
- }
- }
- foreach($messages as $idf => $val) {
- // add new messages
- if ($val == "," && strpos($idf, "%d")) {
- $s .= "\t$idf => array(),\n";
- } elseif (basename($filename) != "en.inc.php") {
- $s .= "\t$idf => null,\n";
- }
- }
- $s = "<?php\n\$translations = array(\n$s);\n";
- if ($s != $file) {
- fwrite(fopen($filename, "w"), $s); // file_put_contents() since PHP 5
- echo "$filename updated.\n";
- }
-}
Deleted: trunk/todo.txt
===================================================================
--- trunk/todo.txt 2010-05-05 16:31:39 UTC (rev 1522)
+++ trunk/todo.txt 2010-05-07 11:55:19 UTC (rev 1523)
@@ -1,49 +0,0 @@
-Transactions in export
-Create view and routine options
-Variables editation, especially timezone
-Accept Tab in SQL textareas, Ctrl+Enter to send form
-Highlight SQL textarea, then display query inside textarea in select - may use external CodePress
-Blob download and image display in edit form (important for Editor with hidden fields in select)
-Add title to Logout, edit (in select) and select (in menu) in style "hever"
-Shift-click in checkboxes to select range
-Export by GET parameters
-Only first part of big BZ2 export is readable
-Auto-refresh processlist (thanks to Jan Garaj)
-Show pagination above and under the table in select
-? Filter by value in row under <thead> in select
-? Column and table names auto-completition in SQL textarea
-? Aliasing of built-in functions can save 7 KB, function minification can save 7 KB, substitution of repetitive $a["a"] can save 4 KB, substitution of $_GET and friends can save 2 KB, aliasing of $connection->query, $connection->result and $connection->quote can save ~ 3 KB, JS packer can save 1 KB, not enclosing HTML attribute values can save 1.2 KB, replacing \\n by \n can save .3 KB
-? Branch binary_compile: LZW compression of translations can save 30 KB, LZW compression of all texts can save 11 KB, remove of base64_decode() + using chars 127-255 in minification can save 1 KB
-
-Editor:
-JavaScript data validation - columns containing word email, url, ...
-Joining tables - PRIMARY KEY (table, joining)
-Rank, Tree structure
-Add whisperer to fields with foreign key to big table
-In-place editation of foreign keys and date
-
-MySQL:
-Saving of MySQL 5 BIT data type - don't use quote()
-? Geometry support
-
-SQLite:
-CSV import - ON DUPLICATE KEY UPDATE
-Export - CREATE DATABASE
-Delimiter in export and SQL command
-Backward keys in Editor
-
-PostgreSQL:
-Users - SELECT * FROM pg_user
-ORDER BY COUNT(*)
-Export - http://www.postgresql.org/docs/8.4/static/functions-info.html
-Column rights - http://www.postgresql.org/docs/8.4/static/functions-info.html
-Dollar terminated string in SQL command
-Move table - ALTER TABLE SET SCHEMA
-Sequences
-bool in Editor
-Check PDO driver
-
-MS SQL:
-Rename by sp_rename
-Detection of table collation
-PDO driver with seek
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jak...@us...> - 2010-05-05 16:31:45
|
Revision: 1522
http://adminer.svn.sourceforge.net/adminer/?rev=1522&view=rev
Author: jakubvrana
Date: 2010-05-05 16:31:39 +0000 (Wed, 05 May 2010)
Log Message:
-----------
PostgreSQL variables
Modified Paths:
--------------
trunk/adminer/drivers/pgsql.inc.php
trunk/adminer/static/editing.js
Modified: trunk/adminer/drivers/pgsql.inc.php
===================================================================
--- trunk/adminer/drivers/pgsql.inc.php 2010-05-05 16:30:55 UTC (rev 1521)
+++ trunk/adminer/drivers/pgsql.inc.php 2010-05-05 16:31:39 UTC (rev 1522)
@@ -470,8 +470,12 @@
return "\connect " . idf_escape($database);
}
+ function show_variables() {
+ return get_key_vals("SHOW ALL");
+ }
+
function support($feature) {
- return ereg('^(comment|view|scheme|trigger|drop_col)$', $feature); //! routine|sequence|
+ return ereg('^(comment|view|scheme|trigger|variables|drop_col)$', $feature); //! routine|sequence|
}
$driver = "pgsql";
Modified: trunk/adminer/static/editing.js
===================================================================
--- trunk/adminer/static/editing.js 2010-05-05 16:30:55 UTC (rev 1521)
+++ trunk/adminer/static/editing.js 2010-05-05 16:31:39 UTC (rev 1522)
@@ -10,10 +10,13 @@
script.onload = function () {
if (window.jush) { // IE runs in case of an error too
jush.create_links = ' target="_blank"';
- jush.urls.pgsql[0] = 'http://www.postgresql.org/docs/' + version + '/static/$key';
jush.urls.sql[0] = 'http://dev.mysql.com/doc/refman/' + version + '/en/$key';
+ jush.urls.sql_sqlset = jush.urls.sql[0];
jush.urls.sqlset[0] = jush.urls.sql[0];
jush.urls.sqlstatus[0] = jush.urls.sql[0];
+ jush.urls.pgsql[0] = 'http://www.postgresql.org/docs/' + version + '/static/$key';
+ jush.urls.pgsql_pgsqlset = jush.urls.pgsql[0];
+ jush.urls.pgsqlset[0] = 'http://www.postgresql.org/docs/' + version + '/static/runtime-config-$key.html#GUC-$1';
jush.style(jushRoot + 'jush.css');
if (window.jushLinks) {
jush.custom_links = jushLinks;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jak...@us...> - 2010-05-05 16:31:01
|
Revision: 1521
http://adminer.svn.sourceforge.net/adminer/?rev=1521&view=rev
Author: jakubvrana
Date: 2010-05-05 16:30:55 +0000 (Wed, 05 May 2010)
Log Message:
-----------
Schema support for PostgreSQL
Modified Paths:
--------------
trunk/adminer/database.inc.php
trunk/adminer/db.inc.php
trunk/adminer/drivers/mssql.inc.php
trunk/adminer/drivers/mysql.inc.php
trunk/adminer/drivers/pgsql.inc.php
trunk/adminer/drivers/sqlite.inc.php
trunk/adminer/include/adminer.inc.php
trunk/adminer/include/auth.inc.php
trunk/adminer/include/bootstrap.inc.php
trunk/adminer/include/connect.inc.php
trunk/adminer/include/design.inc.php
trunk/adminer/index.php
trunk/adminer/lang/cs.inc.php
trunk/compile.php
trunk/todo.txt
Added Paths:
-----------
trunk/adminer/scheme.inc.php
Modified: trunk/adminer/database.inc.php
===================================================================
--- trunk/adminer/database.inc.php 2010-05-05 16:29:17 UTC (rev 1520)
+++ trunk/adminer/database.inc.php 2010-05-05 16:30:55 UTC (rev 1521)
@@ -65,7 +65,7 @@
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="submit" value="<?php echo lang('Save'); ?>">
<?php
-if (strlen(DB)) {
+if (DB != "") {
echo "<input type='submit' name='drop' value='" . lang('Drop') . "'$confirm>\n";
} elseif (!$_POST["add_x"] && $_GET["db"] == "") {
echo "<input type='image' name='add' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "'>\n";
Modified: trunk/adminer/db.inc.php
===================================================================
--- trunk/adminer/db.inc.php 2010-05-05 16:29:17 UTC (rev 1520)
+++ trunk/adminer/db.inc.php 2010-05-05 16:30:55 UTC (rev 1521)
@@ -36,125 +36,128 @@
queries_redirect(substr(ME, 0, -1), $message, $result);
}
-page_header(lang('Database') . ": " . h(DB), $error, true);
-echo '<p><a href="' . h(ME) . 'database=">' . lang('Alter database') . "</a>\n";
-echo '<a href="' . h(ME) . 'schema=">' . lang('Database schema') . "</a>\n";
-$sums = array("Data_length" => 0, "Index_length" => 0, "Data_free" => 0);
-
-echo "<h3>" . lang('Tables and views') . "</h3>\n";
-$tables_list = tables_list();
-if (!$tables_list) {
- echo "<p class='message'>" . lang('No tables.') . "\n";
-} else {
- echo "<form action='' method='post'>\n";
- echo "<p><input name='query' value='" . h($_POST["query"]) . "'> <input type='submit' name='search' value='" . lang('Search') . "'>\n";
- if ($_POST["search"] && $_POST["query"] != "") {
- $_GET["where"][0]["op"] = "LIKE %%";
- $_GET["where"][0]["val"] = $_POST["query"];
- search_tables();
- }
- echo "<table cellspacing='0' class='nowrap' onclick='tableClick(event);'>\n";
- echo '<thead><tr class="wrap"><td><input id="check-all" type="checkbox" onclick="formCheck(this, /^(tables|views)\[/);"><th>' . lang('Table') . '<td>' . lang('Engine') . '<td>' . lang('Collation') . '<td>' . lang('Data Length') . '<td>' . lang('Index Length') . '<td>' . lang('Data Free') . '<td>' . lang('Auto Increment') . '<td>' . lang('Rows') . (support("comment") ? '<td>' . lang('Comment') : '') . "</thead>\n";
- foreach ($tables_list as $name => $type) {
- $view = (isset($type) && !eregi("table", $type));
- echo '<tr' . odd() . '><td>' . checkbox(($view ? "views[]" : "tables[]"), $name, in_array($name, $tables_views, true), "", "formUncheck('check-all');");
- echo '<th><a href="' . h(ME) . 'table=' . urlencode($name) . '">' . h($name) . '</a>';
- if ($view) {
- echo '<td colspan="6"><a href="' . h(ME) . "view=" . urlencode($name) . '">' . lang('View') . '</a>';
- echo '<td align="right"><a href="' . h(ME) . "select=" . urlencode($name) . '">?</a>';
- } else {
- echo "<td id='Engine-" . h($name) . "'> <td id='Collation-" . h($name) . "'> ";
- foreach (array("Data_length" => "create", "Index_length" => "indexes", "Data_free" => "edit", "Auto_increment" => "auto_increment=1&create", "Rows" => "select") as $key => $link) {
- echo "<td align='right'><a href='" . h(ME . "$link=") . urlencode($name) . "' id='$key-" . h($name) . "'>?</a>";
+page_header(($_GET["ns"] == "" ? lang('Database') . ": " . h(DB) : lang('Schema') . ": " . h($_GET["ns"])), $error, true);
+echo '<p>' . ($_GET["ns"] == "" ? '<a href="' . h(ME) . 'database=">' . lang('Alter database') . "</a>\n" : "");
+echo (support("scheme") ? "<a href='" . h(ME) . "scheme='>" . ($_GET["ns"] != "" ? lang('Alter schema') : lang('Create schema')) . "</a>\n" : "");
+if ($_GET["ns"] !== "") {
+ echo '<a href="' . h(ME) . 'schema=">' . lang('Database schema') . "</a>\n";
+ $sums = array("Data_length" => 0, "Index_length" => 0, "Data_free" => 0);
+
+ echo "<h3>" . lang('Tables and views') . "</h3>\n";
+ $tables_list = tables_list();
+ if (!$tables_list) {
+ echo "<p class='message'>" . lang('No tables.') . "\n";
+ } else {
+ echo "<form action='' method='post'>\n";
+ echo "<p><input name='query' value='" . h($_POST["query"]) . "'> <input type='submit' name='search' value='" . lang('Search') . "'>\n";
+ if ($_POST["search"] && $_POST["query"] != "") {
+ $_GET["where"][0]["op"] = "LIKE %%";
+ $_GET["where"][0]["val"] = $_POST["query"];
+ search_tables();
+ }
+ echo "<table cellspacing='0' class='nowrap' onclick='tableClick(event);'>\n";
+ echo '<thead><tr class="wrap"><td><input id="check-all" type="checkbox" onclick="formCheck(this, /^(tables|views)\[/);"><th>' . lang('Table') . '<td>' . lang('Engine') . '<td>' . lang('Collation') . '<td>' . lang('Data Length') . '<td>' . lang('Index Length') . '<td>' . lang('Data Free') . '<td>' . lang('Auto Increment') . '<td>' . lang('Rows') . (support("comment") ? '<td>' . lang('Comment') : '') . "</thead>\n";
+ foreach ($tables_list as $name => $type) {
+ $view = (isset($type) && !eregi("table", $type));
+ echo '<tr' . odd() . '><td>' . checkbox(($view ? "views[]" : "tables[]"), $name, in_array($name, $tables_views, true), "", "formUncheck('check-all');");
+ echo '<th><a href="' . h(ME) . 'table=' . urlencode($name) . '">' . h($name) . '</a>';
+ if ($view) {
+ echo '<td colspan="6"><a href="' . h(ME) . "view=" . urlencode($name) . '">' . lang('View') . '</a>';
+ echo '<td align="right"><a href="' . h(ME) . "select=" . urlencode($name) . '">?</a>';
+ } else {
+ echo "<td id='Engine-" . h($name) . "'> <td id='Collation-" . h($name) . "'> ";
+ foreach (array("Data_length" => "create", "Index_length" => "indexes", "Data_free" => "edit", "Auto_increment" => "auto_increment=1&create", "Rows" => "select") as $key => $link) {
+ echo "<td align='right'><a href='" . h(ME . "$link=") . urlencode($name) . "' id='$key-" . h($name) . "'>?</a>";
+ }
}
+ echo (support("comment") ? "<td id='Comment-" . h($name) . "'> " : "");
}
- echo (support("comment") ? "<td id='Comment-" . h($name) . "'> " : "");
+ echo "<tr><td> <th>" . lang('%d in total', count($tables_list));
+ echo "<td>" . $connection->result("SELECT @@storage_engine");
+ echo "<td>" . db_collation(DB, collations());
+ foreach ($sums as $key => $val) {
+ echo "<td align='right' id='sum-$key'> ";
+ }
+ echo "</table>\n";
+ if (!information_schema(DB)) {
+ echo "<p><input type='hidden' name='token' value='$token'>" . ($driver == "sql" ? "<input type='submit' value='" . lang('Analyze') . "'> <input type='submit' name='optimize' value='" . lang('Optimize') . "'> <input type='submit' name='check' value='" . lang('Check') . "'> <input type='submit' name='repair' value='" . lang('Repair') . "'> " : "") . "<input type='submit' name='truncate' value='" . lang('Truncate') . "' onclick=\"return confirm('" . lang('Are you sure?') . " (' + formChecked(this, /tables/) + ')');\"> <input type='submit' name='drop' value='" . lang('Drop') . "' onclick=\"return confirm('" . lang('Are you sure?') . " (' + formChecked(this, /tables|views/) + ')');\">\n";
+ $dbs = get_databases();
+ if (count($dbs) != 1) {
+ $db = (isset($_POST["target"]) ? $_POST["target"] : DB);
+ echo "<p>" . lang('Move to other database') . ($dbs ? ": " . html_select("target", $dbs, $db) : ': <input name="target" value="' . h($db) . '">') . " <input type='submit' name='move' value='" . lang('Move') . "'>\n";
+ }
+ }
+ echo "</form>\n";
}
- echo "<tr><td> <th>" . lang('%d in total', count($tables_list));
- echo "<td>" . $connection->result("SELECT @@storage_engine");
- echo "<td>" . db_collation(DB, collations());
- foreach ($sums as $key => $val) {
- echo "<td align='right' id='sum-$key'> ";
+
+ echo '<p><a href="' . h(ME) . 'create=">' . lang('Create table') . "</a>\n";
+ if (support("view")) {
+ echo '<a href="' . h(ME) . 'view=">' . lang('Create view') . "</a>\n";
}
- echo "</table>\n";
- if (!information_schema(DB)) {
- echo "<p><input type='hidden' name='token' value='$token'>" . ($driver == "sql" ? "<input type='submit' value='" . lang('Analyze') . "'> <input type='submit' name='optimize' value='" . lang('Optimize') . "'> <input type='submit' name='check' value='" . lang('Check') . "'> <input type='submit' name='repair' value='" . lang('Repair') . "'> " : "") . "<input type='submit' name='truncate' value='" . lang('Truncate') . "' onclick=\"return confirm('" . lang('Are you sure?') . " (' + formChecked(this, /tables/) + ')');\"> <input type='submit' name='drop' value='" . lang('Drop') . "' onclick=\"return confirm('" . lang('Are you sure?') . " (' + formChecked(this, /tables|views/) + ')');\">\n";
- $dbs = get_databases();
- if (count($dbs) != 1) {
- $db = (isset($_POST["target"]) ? $_POST["target"] : DB);
- echo "<p>" . lang('Move to other database') . ($dbs ? ": " . html_select("target", $dbs, $db) : ': <input name="target" value="' . h($db) . '">') . " <input type='submit' name='move' value='" . lang('Move') . "'>\n";
+ if (support("routine")) {
+ echo "<h3>" . lang('Routines') . "</h3>\n";
+ $routines = routines();
+ if ($routines) {
+ echo "<table cellspacing='0'>\n";
+ echo '<thead><tr><th>' . lang('Name') . '<td>' . lang('Type') . '<td>' . lang('Return type') . "<td> </thead>\n";
+ odd('');
+ foreach ($routines as $row) {
+ echo '<tr' . odd() . '>';
+ echo '<th><a href="' . h(ME) . ($row["ROUTINE_TYPE"] == "FUNCTION" ? 'callf=' : 'call=') . urlencode($row["ROUTINE_NAME"]) . '">' . h($row["ROUTINE_NAME"]) . '</a>';
+ echo '<td>' . h($row["ROUTINE_TYPE"]);
+ echo '<td>' . h($row["DTD_IDENTIFIER"]);
+ echo '<td><a href="' . h(ME) . ($row["ROUTINE_TYPE"] == "FUNCTION" ? 'function=' : 'procedure=') . urlencode($row["ROUTINE_NAME"]) . '">' . lang('Alter') . "</a>";
+ }
+ echo "</table>\n";
}
+ echo '<p><a href="' . h(ME) . 'procedure=">' . lang('Create procedure') . '</a> <a href="' . h(ME) . 'function=">' . lang('Create function') . "</a>\n";
}
- echo "</form>\n";
-}
-
-echo '<p><a href="' . h(ME) . 'create=">' . lang('Create table') . "</a>\n";
-if (support("view")) {
- echo '<a href="' . h(ME) . 'view=">' . lang('Create view') . "</a>\n";
-}
-if (support("routine")) {
- echo "<h3>" . lang('Routines') . "</h3>\n";
- $routines = routines();
- if ($routines) {
- echo "<table cellspacing='0'>\n";
- echo '<thead><tr><th>' . lang('Name') . '<td>' . lang('Type') . '<td>' . lang('Return type') . "<td> </thead>\n";
- odd('');
- foreach ($routines as $row) {
- echo '<tr' . odd() . '>';
- echo '<th><a href="' . h(ME) . ($row["ROUTINE_TYPE"] == "FUNCTION" ? 'callf=' : 'call=') . urlencode($row["ROUTINE_NAME"]) . '">' . h($row["ROUTINE_NAME"]) . '</a>';
- echo '<td>' . h($row["ROUTINE_TYPE"]);
- echo '<td>' . h($row["DTD_IDENTIFIER"]);
- echo '<td><a href="' . h(ME) . ($row["ROUTINE_TYPE"] == "FUNCTION" ? 'function=' : 'procedure=') . urlencode($row["ROUTINE_NAME"]) . '">' . lang('Alter') . "</a>";
+
+ if (support("event")) {
+ echo "<h3>" . lang('Events') . "</h3>\n";
+ $result = $connection->query("SHOW EVENTS");
+ if ($result && $result->num_rows) {
+ echo "<table cellspacing='0'>\n";
+ echo "<thead><tr><th>" . lang('Name') . "<td>" . lang('Schedule') . "<td>" . lang('Start') . "<td>" . lang('End') . "</thead>\n";
+ while ($row = $result->fetch_assoc()) {
+ echo "<tr>";
+ echo '<th><a href="' . h(ME) . 'event=' . urlencode($row["Name"]) . '">' . h($row["Name"]) . "</a>";
+ echo "<td>" . ($row["Execute at"] ? lang('At given time') . "<td>" . $row["Execute at"] : lang('Every') . " " . $row["Interval value"] . " " . $row["Interval field"] . "<td>$row[Starts]");
+ echo "<td>$row[Ends]";
+ }
+ echo "</table>\n";
}
- echo "</table>\n";
+ echo '<p><a href="' . h(ME) . 'event=">' . lang('Create event') . "</a>\n";
}
- echo '<p><a href="' . h(ME) . 'procedure=">' . lang('Create procedure') . '</a> <a href="' . h(ME) . 'function=">' . lang('Create function') . "</a>\n";
-}
-
-if (support("event")) {
- echo "<h3>" . lang('Events') . "</h3>\n";
- $result = $connection->query("SHOW EVENTS");
- if ($result && $result->num_rows) {
- echo "<table cellspacing='0'>\n";
- echo "<thead><tr><th>" . lang('Name') . "<td>" . lang('Schedule') . "<td>" . lang('Start') . "<td>" . lang('End') . "</thead>\n";
- while ($row = $result->fetch_assoc()) {
- echo "<tr>";
- echo '<th><a href="' . h(ME) . 'event=' . urlencode($row["Name"]) . '">' . h($row["Name"]) . "</a>";
- echo "<td>" . ($row["Execute at"] ? lang('At given time') . "<td>" . $row["Execute at"] : lang('Every') . " " . $row["Interval value"] . " " . $row["Interval field"] . "<td>$row[Starts]");
- echo "<td>$row[Ends]";
- }
- echo "</table>\n";
- }
- echo '<p><a href="' . h(ME) . 'event=">' . lang('Create event') . "</a>\n";
-}
-
-page_footer();
-$table_status = table_status();
-if ($table_status) {
- echo "<script type='text/javascript'>\n";
- foreach ($table_status as $row) {
- $id = addcslashes($row["Name"], "\\'/");
- echo "setHtml('Comment-$id', '" . nbsp($row["Comment"]) . "');\n";
- if (!eregi("view", $row["Engine"])) {
- foreach (array("Engine", "Collation") as $key) {
- echo "setHtml('$key-$id', '" . nbsp($row[$key]) . "');\n";
- }
- foreach ($sums + array("Auto_increment" => 0, "Rows" => 0) as $key => $val) {
- if ($row[$key] != "") {
- $val = number_format($row[$key], 0, '.', lang(','));
- echo "setHtml('$key-$id', '" . ($key == "Rows" && $row["Engine"] == "InnoDB" && $val ? "~ $val" : $val) . "');\n";
- if (isset($sums[$key])) {
- $sums[$key] += ($row["Engine"] != "InnoDB" || $key != "Data_free" ? $row[$key] : 0);
+
+ page_footer();
+ $table_status = table_status();
+ if ($table_status) {
+ echo "<script type='text/javascript'>\n";
+ foreach ($table_status as $row) {
+ $id = addcslashes($row["Name"], "\\'/");
+ echo "setHtml('Comment-$id', '" . nbsp($row["Comment"]) . "');\n";
+ if (!eregi("view", $row["Engine"])) {
+ foreach (array("Engine", "Collation") as $key) {
+ echo "setHtml('$key-$id', '" . nbsp($row[$key]) . "');\n";
+ }
+ foreach ($sums + array("Auto_increment" => 0, "Rows" => 0) as $key => $val) {
+ if ($row[$key] != "") {
+ $val = number_format($row[$key], 0, '.', lang(','));
+ echo "setHtml('$key-$id', '" . ($key == "Rows" && $row["Engine"] == "InnoDB" && $val ? "~ $val" : $val) . "');\n";
+ if (isset($sums[$key])) {
+ $sums[$key] += ($row["Engine"] != "InnoDB" || $key != "Data_free" ? $row[$key] : 0);
+ }
+ } elseif (array_key_exists($key, $row)) {
+ echo "setHtml('$key-$id');\n";
}
- } elseif (array_key_exists($key, $row)) {
- echo "setHtml('$key-$id');\n";
}
}
}
+ foreach ($sums as $key => $val) {
+ echo "setHtml('sum-$key', '" . number_format($val, 0, '.', lang(',')) . "');\n";
+ }
+ echo "</script>\n";
}
- foreach ($sums as $key => $val) {
- echo "setHtml('sum-$key', '" . number_format($val, 0, '.', lang(',')) . "');\n";
- }
- echo "</script>\n";
+ exit; // page_footer() already called
}
-exit; // page_footer() already called
Modified: trunk/adminer/drivers/mssql.inc.php
===================================================================
--- trunk/adminer/drivers/mssql.inc.php 2010-05-05 16:29:17 UTC (rev 1520)
+++ trunk/adminer/drivers/mssql.inc.php 2010-05-05 16:30:55 UTC (rev 1521)
@@ -490,7 +490,7 @@
}
function support($feature) {
- return ereg('^(trigger|drop_col)$', $feature); //! view|routine|
+ return ereg('^(trigger|drop_col)$', $feature); //! view|routine|scheme|
}
$driver = "mssql";
Modified: trunk/adminer/drivers/mysql.inc.php
===================================================================
--- trunk/adminer/drivers/mysql.inc.php 2010-05-05 16:29:17 UTC (rev 1520)
+++ trunk/adminer/drivers/mysql.inc.php 2010-05-05 16:30:55 UTC (rev 1521)
@@ -755,6 +755,28 @@
return $connection->query("EXPLAIN $query");
}
+ /** Get existing schemas
+ * @return array
+ */
+ function schemas() {
+ return array();
+ }
+
+ /** Get current schema
+ * @return string
+ */
+ function get_schema() {
+ return "";
+ }
+
+ /** Set current schema
+ * @param string
+ * @return bool
+ */
+ function set_schema($schema) {
+ return true;
+ }
+
/** Get SQL command to create table
* @param string
* @return string
@@ -810,7 +832,7 @@
*/
function support($feature) {
global $connection;
- return ($connection->server_info >= 5.1 || ($connection->server_info >= 5 && !ereg("event|partitioning")) || !ereg("view|routine|trigger"));
+ return !ereg("scheme" . ($connection->server_info < 5.1 ? "|event|partitioning" . ($connection->server_info < 5 ? "|view|routine|trigger" : "") : ""), $feature);
}
$driver = "sql"; ///< @var string JUSH identifier
Modified: trunk/adminer/drivers/pgsql.inc.php
===================================================================
--- trunk/adminer/drivers/pgsql.inc.php 2010-05-05 16:29:17 UTC (rev 1520)
+++ trunk/adminer/drivers/pgsql.inc.php 2010-05-05 16:30:55 UTC (rev 1521)
@@ -452,12 +452,26 @@
return $connection->query("EXPLAIN $query");
}
+ function schemas() {
+ return get_vals("SELECT nspname FROM pg_namespace");
+ }
+
+ function get_schema() {
+ global $connection;
+ return $connection->result("SELECT current_schema()");
+ }
+
+ function set_schema($schema) {
+ global $connection;
+ return $connection->query("SET search_path TO " . idf_escape($schema));
+ }
+
function use_sql($database) {
return "\connect " . idf_escape($database);
}
function support($feature) {
- return ereg('^(comment|view|trigger|drop_col)$', $feature); //! routine|
+ return ereg('^(comment|view|scheme|trigger|drop_col)$', $feature); //! routine|sequence|
}
$driver = "pgsql";
Modified: trunk/adminer/drivers/sqlite.inc.php
===================================================================
--- trunk/adminer/drivers/sqlite.inc.php 2010-05-05 16:29:17 UTC (rev 1520)
+++ trunk/adminer/drivers/sqlite.inc.php 2010-05-05 16:30:55 UTC (rev 1521)
@@ -496,6 +496,18 @@
return $connection->query("EXPLAIN $query");
}
+ function schemas() {
+ return array();
+ }
+
+ function get_schema() {
+ return "";
+ }
+
+ function set_schema($scheme) {
+ return true;
+ }
+
function create_sql($table) {
global $connection;
return $connection->result("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = " . $connection->quote($table));
Modified: trunk/adminer/include/adminer.inc.php
===================================================================
--- trunk/adminer/include/adminer.inc.php 2010-05-05 16:29:17 UTC (rev 1520)
+++ trunk/adminer/include/adminer.inc.php 2010-05-05 16:30:55 UTC (rev 1521)
@@ -506,32 +506,40 @@
<p>
<?php hidden_fields_get(); ?>
<?php echo ($databases ? html_select("db", array("" => "(" . lang('database') . ")") + $databases, DB, "this.form.submit();") : '<input name="db" value="' . h(DB) . '">'); ?>
-<?php if (isset($_GET["sql"])) { ?><input type="hidden" name="sql" value=""><?php } ?>
-<?php if (isset($_GET["schema"])) { ?><input type="hidden" name="schema" value=""><?php } ?>
-<?php if (isset($_GET["dump"])) { ?><input type="hidden" name="dump" value=""><?php } ?>
<input type="submit" value="<?php echo lang('Use'); ?>"<?php echo ($databases ? " class='hidden'" : ""); ?>>
-</p>
-</form>
<?php
if ($missing != "db" && DB != "" && $connection->select_db(DB)) {
- $tables = tables_list();
- if (!$tables) {
- echo "<p class='message'>" . lang('No tables.') . "\n";
- } else {
- $this->tablesPrint($tables);
- $links = array();
- foreach ($tables as $table => $type) {
- $links[] = preg_quote($table, '/');
+ if (support("scheme")) {
+ echo "<br>" . html_select("ns", array("" => "(" . lang('schema') . ")") + schemas(), $_GET["ns"], "this.form.submit();");
+ if ($_GET["ns"] != "") {
+ set_schema($_GET["ns"]);
}
- echo "<script type='text/javascript'>\n";
- echo "var jushLinks = { $driver: [ '" . addcslashes(h(ME), "\\'/") . "table=\$&', /\\b(" . implode("|", $links) . ")\\b/g ] };\n";
- foreach (array("bac", "bra", "sqlite_quo", "mssql_bra") as $val) {
- echo "jushLinks.$val = jushLinks.$driver;\n";
+ }
+ if ($_GET["ns"] !== "") {
+ $tables = tables_list();
+ if (!$tables) {
+ echo "<p class='message'>" . lang('No tables.') . "\n";
+ } else {
+ $this->tablesPrint($tables);
+ $links = array();
+ foreach ($tables as $table => $type) {
+ $links[] = preg_quote($table, '/');
+ }
+ echo "<script type='text/javascript'>\n";
+ echo "var jushLinks = { $driver: [ '" . addcslashes(h(ME), "\\'/") . "table=\$&', /\\b(" . implode("|", $links) . ")\\b/g ] };\n";
+ foreach (array("bac", "bra", "sqlite_quo", "mssql_bra") as $val) {
+ echo "jushLinks.$val = jushLinks.$driver;\n";
+ }
+ echo "</script>\n";
}
- echo "</script>\n";
+ echo '<p><a href="' . h(ME) . 'create=">' . bold(lang('Create new table'), $_GET["create"] === "") . "</a>\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="">'
+ : (isset($_GET["schema"]) ? '<input type="hidden" name="schema" value="">'
+ : (isset($_GET["dump"]) ? '<input type="hidden" name="dump" value="">'
+ : "")));
+ echo "</form>\n";
}
}
Modified: trunk/adminer/include/auth.inc.php
===================================================================
--- trunk/adminer/include/auth.inc.php 2010-05-05 16:29:17 UTC (rev 1520)
+++ trunk/adminer/include/auth.inc.php 2010-05-05 16:30:55 UTC (rev 1521)
@@ -46,7 +46,7 @@
set_session($key, null);
}
cookie("adminer_permanent", "");
- redirect(substr(preg_replace('~(username|db)=[^&]*&~', '', ME), 0, -1), lang('Logout successful.'));
+ redirect(substr(preg_replace('~(username|db|ns)=[^&]*&~', '', ME), 0, -1), lang('Logout successful.'));
}
} elseif ($_COOKIE["adminer_permanent"]) {
list($server, $username, $cipher, $system) = array_map('base64_decode', explode(":", $_COOKIE["adminer_permanent"])); // $driver is a global variable
Modified: trunk/adminer/include/bootstrap.inc.php
===================================================================
--- trunk/adminer/include/bootstrap.inc.php 2010-05-05 16:29:17 UTC (rev 1520)
+++ trunk/adminer/include/bootstrap.inc.php 2010-05-05 16:30:55 UTC (rev 1521)
@@ -71,7 +71,7 @@
. (SID && !$_COOKIE ? SID . '&' : '') // !$_COOKIE - don't pass SID with permanent login
. (SERVER !== null ? DRIVER . "=" . urlencode(SERVER) . '&' : '')
. (isset($_GET["username"]) ? "username=" . urlencode($_GET["username"]) . '&' : '')
- . (DB != "" ? 'db=' . urlencode(DB) . '&' : '')
+ . (DB != "" ? 'db=' . urlencode(DB) . '&' . (isset($_GET["ns"]) ? "ns=" . urlencode($_GET["ns"]) . "&" : "") : '')
);
include "../adminer/include/version.inc.php";
Modified: trunk/adminer/include/connect.inc.php
===================================================================
--- trunk/adminer/include/connect.inc.php 2010-05-05 16:29:17 UTC (rev 1520)
+++ trunk/adminer/include/connect.inc.php 2010-05-05 16:30:55 UTC (rev 1521)
@@ -61,3 +61,7 @@
connect_error(); // separate function to catch SQLite error
exit;
}
+
+if (support("scheme") && DB != "" && $_GET["ns"] !== "" && (!isset($_GET["ns"]) || !set_schema($_GET["ns"]))) {
+ redirect(preg_replace('~ns=[^&]*&~', '', ME) . "ns=" . get_schema());
+}
Modified: trunk/adminer/include/design.inc.php
===================================================================
--- trunk/adminer/include/design.inc.php 2010-05-05 16:29:17 UTC (rev 1520)
+++ trunk/adminer/include/design.inc.php 2010-05-05 16:30:55 UTC (rev 1521)
@@ -31,17 +31,20 @@
<div id="content">
<?php
if (isset($breadcrumb)) {
- $link = substr(preg_replace('~(username|db)=[^&]*&~', '', ME), 0, -1);
+ $link = substr(preg_replace('~(username|db|ns)=[^&]*&~', '', ME), 0, -1);
echo '<p id="breadcrumb"><a href="' . ($link ? h($link) : ".") . '">' . $drivers[DRIVER] . '</a> » ';
- $link = substr(preg_replace('~db=[^&]*&~', '', ME), 0, -1);
+ $link = substr(preg_replace('~(db|ns)=[^&]*&~', '', ME), 0, -1);
$server = (SERVER != "" ? h(SERVER) : lang('Server'));
if ($breadcrumb === false) {
echo "$server\n";
} else {
echo "<a href='" . ($link ? h($link) : ".") . "'>$server</a> » ";
+ if ($_GET["ns"] != "" || (DB != "" && is_array($breadcrumb))) {
+ echo '<a href="' . h($link . "&db=" . urlencode(DB) . (support("scheme") ? "&ns=" : "")) . '">' . h(DB) . '</a> » ';
+ }
if (is_array($breadcrumb)) {
- if (DB != "") {
- echo '<a href="' . h(substr(ME, 0, -1)) . '">' . h(DB) . '</a> » ';
+ if ($_GET["ns"] != "") {
+ echo '<a href="' . h(substr(ME, 0, -1)) . '">' . h($_GET["ns"]) . '</a> » ';
}
foreach ($breadcrumb as $key => $val) {
$desc = (is_array($val) ? $val[1] : $val);
Modified: trunk/adminer/index.php
===================================================================
--- trunk/adminer/index.php 2010-05-05 16:29:17 UTC (rev 1520)
+++ trunk/adminer/index.php 2010-05-05 16:30:55 UTC (rev 1521)
@@ -40,6 +40,8 @@
include "./indexes.inc.php";
} elseif (isset($_GET["database"])) {
include "./database.inc.php";
+} elseif (isset($_GET["scheme"])) {
+ include "./scheme.inc.php";
} elseif (isset($_GET["call"])) {
include "./call.inc.php";
} elseif (isset($_GET["foreign"])) {
Modified: trunk/adminer/lang/cs.inc.php
===================================================================
--- trunk/adminer/lang/cs.inc.php 2010-05-05 16:29:17 UTC (rev 1520)
+++ trunk/adminer/lang/cs.inc.php 2010-05-05 16:30:55 UTC (rev 1521)
@@ -237,4 +237,11 @@
'Double click on a value to modify it.' => 'Dvojklikněte na políčko, které chcete změnit.',
'Increase text length to modify this value.' => 'Ke změně této hodnoty zvyšte délku textů.',
'Use edit link to modify this value.' => 'Ke změně této hodnoty použijte odkaz upravit.',
+ 'Alter schema' => 'Pozměnit schéma',
+ 'Create schema' => 'Vytvořit schéma',
+ 'Schema has been dropped.' => 'Schéma bylo odstraněno.',
+ 'Schema has been created.' => 'Schéma bylo vytvořeno.',
+ 'Schema has been altered.' => 'Schéma bylo změněno.',
+ 'schema' => 'schéma',
+ 'Schema' => 'Schéma',
);
Added: trunk/adminer/scheme.inc.php
===================================================================
--- trunk/adminer/scheme.inc.php (rev 0)
+++ trunk/adminer/scheme.inc.php 2010-05-05 16:30:55 UTC (rev 1521)
@@ -0,0 +1,35 @@
+<?php
+if ($_POST && !$error) {
+ $link = preg_replace('~ns=[^&]*&~', '', ME) . "ns=";
+ if ($_POST["drop"]) {
+ query_redirect("DROP SCHEMA " . idf_escape($_GET["ns"]), $link, lang('Schema has been dropped.'));
+ } else {
+ $link .= urlencode($_POST["name"]);
+ if ($_GET["ns"] == "") {
+ query_redirect("CREATE SCHEMA " . idf_escape($_POST["name"]), $link, lang('Schema has been created.'));
+ } elseif ($_GET["ns"] != $_POST["name"]) {
+ query_redirect("ALTER SCHEMA " . idf_escape($_GET["ns"]) . " RENAME TO " . idf_escape($_POST["name"]), $link, lang('Schema has been altered.'));
+ } else {
+ redirect($link);
+ }
+ }
+}
+
+page_header($_GET["ns"] != "" ? lang('Alter schema') : lang('Create schema'), $error);
+
+$row = array("name" => $_GET["ns"]);
+if ($_POST) {
+ $row = $_POST;
+}
+?>
+
+<form action="" method="post">
+<p><input name="name" value="<?php echo h($row["name"]); ?>">
+<input type="hidden" name="token" value="<?php echo $token; ?>">
+<input type="submit" value="<?php echo lang('Save'); ?>">
+<?php
+if ($_GET["ns"] != "") {
+ echo "<input type='submit' name='drop' value='" . lang('Drop') . "'$confirm>\n";
+}
+?>
+</form>
Modified: trunk/compile.php
===================================================================
--- trunk/compile.php 2010-05-05 16:29:17 UTC (rev 1520)
+++ trunk/compile.php 2010-05-05 16:30:55 UTC (rev 1521)
@@ -190,13 +190,15 @@
}
}
+$drivers = array();
foreach (array("adminer", "editor") as $project) {
$lang_ids = array(); // global variable simplifies usage in a callback function
$file = file_get_contents(dirname(__FILE__) . "/$project/index.php");
- if ($DRIVER && $DRIVER != "mysql") {
+ if ($DRIVER) {
+ $connection = (object) array("server_info" => 5.1); // MySQL support is version specific
$_GET[$DRIVER] = true; // to load the driver
include_once dirname(__FILE__) . "/adminer/drivers/$DRIVER.inc.php";
- foreach (array("view", "event", "privileges", "user", "processlist", "variables", "trigger") as $feature) {
+ foreach (array("view", "event", "privileges", "user", "processlist", "variables", "trigger", "scheme") as $feature) {
if (!support($feature)) {
$file = str_replace("} elseif (isset(\$_GET[\"$feature\"])) {\n\tinclude \"./$feature.inc.php\";\n", "", $file);
}
Modified: trunk/todo.txt
===================================================================
--- trunk/todo.txt 2010-05-05 16:29:17 UTC (rev 1520)
+++ trunk/todo.txt 2010-05-05 16:30:55 UTC (rev 1521)
@@ -35,7 +35,6 @@
PostgreSQL:
Users - SELECT * FROM pg_user
ORDER BY COUNT(*)
-Table schema - SELECT * FROM pg_namespace, CREATE|ALTER|DROP SCHEMA, SET default_tablespace
Export - http://www.postgresql.org/docs/8.4/static/functions-info.html
Column rights - http://www.postgresql.org/docs/8.4/static/functions-info.html
Dollar terminated string in SQL command
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jak...@us...> - 2010-05-05 16:29:23
|
Revision: 1520
http://adminer.svn.sourceforge.net/adminer/?rev=1520&view=rev
Author: jakubvrana
Date: 2010-05-05 16:29:17 +0000 (Wed, 05 May 2010)
Log Message:
-----------
Clear cache only for MySQL
Modified Paths:
--------------
trunk/adminer/database.inc.php
trunk/adminer/drivers/mysql.inc.php
Modified: trunk/adminer/database.inc.php
===================================================================
--- trunk/adminer/database.inc.php 2010-05-05 16:28:37 UTC (rev 1519)
+++ trunk/adminer/database.inc.php 2010-05-05 16:29:17 UTC (rev 1520)
@@ -2,11 +2,9 @@
if ($_POST && !$error && !isset($_POST["add_x"])) { // add is an image and PHP changes add.x to add_x
restart_session();
if ($_POST["drop"]) {
- set_session("databases", null);
queries_redirect(remove_from_uri("db|database"), lang('Database has been dropped.'), drop_databases(array(DB)));
} elseif (DB !== $_POST["name"]) {
// create or rename database
- set_session("databases", null); // clear cache
if (DB != "") {
queries_redirect(preg_replace('~db=[^&]*&~', '', ME) . "db=" . urlencode($_POST["name"]), lang('Database has been renamed.'), rename_database($_POST["name"], $_POST["collation"]));
} else {
Modified: trunk/adminer/drivers/mysql.inc.php
===================================================================
--- trunk/adminer/drivers/mysql.inc.php 2010-05-05 16:28:37 UTC (rev 1519)
+++ trunk/adminer/drivers/mysql.inc.php 2010-05-05 16:29:17 UTC (rev 1520)
@@ -506,6 +506,7 @@
* @return string
*/
function create_database($db, $collation) {
+ set_session("databases", null);
return queries("CREATE DATABASE " . idf_escape($db) . ($collation ? " COLLATE " . $connection->quote($collation) : ""));
}
@@ -514,6 +515,7 @@
* @return bool
*/
function drop_databases($databases) {
+ set_session("databases", null);
foreach ($databases as $db) {
if (!queries("DROP DATABASE " . idf_escape($db))) {
return false;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jak...@us...> - 2010-05-05 16:28:43
|
Revision: 1519
http://adminer.svn.sourceforge.net/adminer/?rev=1519&view=rev
Author: jakubvrana
Date: 2010-05-05 16:28:37 +0000 (Wed, 05 May 2010)
Log Message:
-----------
Driver specific trigger export
Modified Paths:
--------------
trunk/adminer/drivers/mysql.inc.php
trunk/adminer/drivers/sqlite.inc.php
trunk/adminer/dump.inc.php
trunk/adminer/include/export.inc.php
trunk/todo.txt
Modified: trunk/adminer/drivers/mysql.inc.php
===================================================================
--- trunk/adminer/drivers/mysql.inc.php 2010-05-05 16:27:39 UTC (rev 1518)
+++ trunk/adminer/drivers/mysql.inc.php 2010-05-05 16:28:37 UTC (rev 1519)
@@ -770,6 +770,24 @@
return "USE " . idf_escape($database);
}
+ /** Get SQL commands to create triggers
+ * @param string
+ * @param string
+ * @return string
+ */
+ function trigger_sql($table, $style) {
+ global $connection;
+ $result = $connection->query("SHOW TRIGGERS LIKE " . $connection->quote(addcslashes($table, "%_")));
+ $return = "";
+ if ($result->num_rows) {
+ while ($row = $result->fetch_assoc()) {
+ $return .= "\n" . ($style == 'CREATE+ALTER' ? "DROP TRIGGER IF EXISTS " . idf_escape($row["Trigger"]) . ";;\n" : "")
+ . "CREATE TRIGGER " . idf_escape($row["Trigger"]) . " $row[Timing] $row[Event] ON " . idf_escape($row["Table"]) . " FOR EACH ROW\n$row[Statement];;\n";
+ }
+ }
+ return $return;
+ }
+
/** Get server variables
* @return array ($name => $value)
*/
Modified: trunk/adminer/drivers/sqlite.inc.php
===================================================================
--- trunk/adminer/drivers/sqlite.inc.php 2010-05-05 16:27:39 UTC (rev 1518)
+++ trunk/adminer/drivers/sqlite.inc.php 2010-05-05 16:28:37 UTC (rev 1519)
@@ -498,7 +498,7 @@
function create_sql($table) {
global $connection;
- return $connection->result("SELECT sql FROM sqlite_master WHERE name = " . $connection->quote($table));
+ return $connection->result("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = " . $connection->quote($table));
}
function use_sql($database) {
@@ -506,6 +506,11 @@
return "ATTACH " . $connection->quote($database) . " AS " . idf_escape($database);
}
+ function trigger_sql($table, $style) {
+ global $connection;
+ return implode("", get_vals("SELECT sql || ';;\n' FROM sqlite_master WHERE type = 'trigger' AND name = " . $connection->quote($table)));
+ }
+
function show_variables() {
global $connection;
$return = array();
Modified: trunk/adminer/dump.inc.php
===================================================================
--- trunk/adminer/dump.inc.php 2010-05-05 16:27:39 UTC (rev 1518)
+++ trunk/adminer/dump.inc.php 2010-05-05 16:28:37 UTC (rev 1519)
@@ -80,8 +80,11 @@
if ($data) {
dump_data($row["Name"], $_POST["data_style"]);
}
- if ($_POST["triggers"]) {
- dump_triggers($row["Name"], $_POST["table_style"]);
+ if ($_POST["format"] == "sql" && $_POST["triggers"]) {
+ $triggers = trigger_sql($row["Name"], $_POST["table_style"]);
+ if ($triggers) {
+ echo "\nDELIMITER ;;\n$triggers\nDELIMITER ;\n";
+ }
}
if ($ext == "tar") {
echo tar_file((DB != "" ? "" : "$db/") . "$row[Name].csv", ob_get_clean());
Modified: trunk/adminer/include/export.inc.php
===================================================================
--- trunk/adminer/include/export.inc.php 2010-05-05 16:27:39 UTC (rev 1518)
+++ trunk/adminer/include/export.inc.php 2010-05-05 16:28:37 UTC (rev 1519)
@@ -9,21 +9,6 @@
return $return . str_repeat("\0", 512 - strlen($return)) . $contents . str_repeat("\0", 511 - (strlen($contents) + 511) % 512);
}
-function dump_triggers($table, $style) {
- global $connection;
- if ($_POST["format"] == "sql" && $style && support("trigger")) {
- $result = $connection->query("SHOW TRIGGERS LIKE " . $connection->quote(addcslashes($table, "%_")));
- if ($result->num_rows) {
- $s = "\nDELIMITER ;;\n";
- while ($row = $result->fetch_assoc()) {
- $s .= "\n" . ($style == 'CREATE+ALTER' ? "DROP TRIGGER IF EXISTS " . idf_escape($row["Trigger"]) . ";;\n" : "")
- . "CREATE TRIGGER " . idf_escape($row["Trigger"]) . " $row[Timing] $row[Event] ON " . idf_escape($row["Table"]) . " FOR EACH ROW\n$row[Statement];;\n";
- }
- echo "$s\nDELIMITER ;\n";
- }
- }
-}
-
function dump_table($table, $style, $is_view = false) {
global $connection;
if ($_POST["format"] != "sql") {
Modified: trunk/todo.txt
===================================================================
--- trunk/todo.txt 2010-05-05 16:27:39 UTC (rev 1518)
+++ trunk/todo.txt 2010-05-05 16:28:37 UTC (rev 1519)
@@ -28,7 +28,7 @@
SQLite:
CSV import - ON DUPLICATE KEY UPDATE
-Export - triggers, CREATE DATABASE
+Export - CREATE DATABASE
Delimiter in export and SQL command
Backward keys in Editor
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jak...@us...> - 2010-05-05 16:27:45
|
Revision: 1518
http://adminer.svn.sourceforge.net/adminer/?rev=1518&view=rev
Author: jakubvrana
Date: 2010-05-05 16:27:39 +0000 (Wed, 05 May 2010)
Log Message:
-----------
Respect move and drop column support
Modified Paths:
--------------
trunk/adminer/drivers/mssql.inc.php
trunk/adminer/drivers/mysql.inc.php
trunk/adminer/drivers/pgsql.inc.php
trunk/adminer/drivers/sqlite.inc.php
trunk/adminer/include/editing.inc.php
trunk/todo.txt
Modified: trunk/adminer/drivers/mssql.inc.php
===================================================================
--- trunk/adminer/drivers/mssql.inc.php 2010-05-05 16:26:41 UTC (rev 1517)
+++ trunk/adminer/drivers/mssql.inc.php 2010-05-05 16:27:39 UTC (rev 1518)
@@ -490,7 +490,7 @@
}
function support($feature) {
- return ereg('^(trigger)$', $feature); //! view|routine|
+ return ereg('^(trigger|drop_col)$', $feature); //! view|routine|
}
$driver = "mssql";
Modified: trunk/adminer/drivers/mysql.inc.php
===================================================================
--- trunk/adminer/drivers/mysql.inc.php 2010-05-05 16:26:41 UTC (rev 1517)
+++ trunk/adminer/drivers/mysql.inc.php 2010-05-05 16:27:39 UTC (rev 1518)
@@ -790,14 +790,7 @@
*/
function support($feature) {
global $connection;
- $features = array(
- "view" => ($connection->server_info >= 5),
- "routine" => ($connection->server_info >= 5),
- "trigger" => ($connection->server_info >= 5),
- "event" => ($connection->server_info >= 5.1),
- "partitioning" => ($connection->server_info >= 5.1),
- );
- return (isset($features[$feature]) ? $features[$feature] : true);
+ return ($connection->server_info >= 5.1 || ($connection->server_info >= 5 && !ereg("event|partitioning")) || !ereg("view|routine|trigger"));
}
$driver = "sql"; ///< @var string JUSH identifier
Modified: trunk/adminer/drivers/pgsql.inc.php
===================================================================
--- trunk/adminer/drivers/pgsql.inc.php 2010-05-05 16:26:41 UTC (rev 1517)
+++ trunk/adminer/drivers/pgsql.inc.php 2010-05-05 16:27:39 UTC (rev 1518)
@@ -197,7 +197,7 @@
function table_status($name = "") {
global $connection;
$return = array();
- $result = $connection->query("SELECT relname AS \"Name\", CASE relkind WHEN 'r' THEN '' ELSE 'view' END AS \"Engine\", pg_relation_size(oid) AS \"Data_length\", pg_catalog.obj_description(oid, 'pg_class') AS \"Comment\"
+ $result = $connection->query("SELECT relname AS \"Name\", CASE relkind WHEN 'r' THEN '' ELSE 'view' END AS \"Engine\", pg_relation_size(oid) AS \"Data_length\", pg_total_relation_size(oid) - pg_relation_size(oid) AS \"Index_length\", pg_catalog.obj_description(oid, 'pg_class') AS \"Comment\"
FROM pg_catalog.pg_class
WHERE relkind IN ('r','v')
AND relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema())"
@@ -457,7 +457,7 @@
}
function support($feature) {
- return ereg('^(comment|view|routine|trigger)$', $feature);
+ return ereg('^(comment|view|trigger|drop_col)$', $feature); //! routine|
}
$driver = "pgsql";
Modified: trunk/adminer/drivers/sqlite.inc.php
===================================================================
--- trunk/adminer/drivers/sqlite.inc.php 2010-05-05 16:26:41 UTC (rev 1517)
+++ trunk/adminer/drivers/sqlite.inc.php 2010-05-05 16:27:39 UTC (rev 1518)
@@ -393,7 +393,9 @@
global $connection;
$alter = array();
foreach ($fields as $field) {
- $alter[] = ($table != "" && $field[0] == "" ? "ADD " : " ") . implode("", $field[1]);
+ if ($field[1]) {
+ $alter[] = ($table != "" && $field[0] == "" ? "ADD " : " ") . implode("", $field[1]);
+ }
}
$alter = array_merge($alter, $foreign);
if ($table != "") {
Modified: trunk/adminer/include/editing.inc.php
===================================================================
--- trunk/adminer/include/editing.inc.php 2010-05-05 16:26:41 UTC (rev 1517)
+++ trunk/adminer/include/editing.inc.php 2010-05-05 16:27:39 UTC (rev 1518)
@@ -203,16 +203,17 @@
<td class="hidden"><?php echo lang('Default values'); ?>
<?php echo (support("comment") ? "<td" . ($comments ? "" : " class='hidden'") . ">" . lang('Comment') : ""); ?>
<?php } ?>
-<td><?php echo "<input type='image' name='add[0]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "'>"; ?><script type="text/javascript">row_count = <?php echo count($fields); ?>;</script>
+<td><?php echo "<input type='image' name='add[" . (support("move_col") ? 0 : count($fields)) . "]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "'>"; ?><script type="text/javascript">row_count = <?php echo count($fields); ?>;</script>
</thead>
<?php
foreach ($fields as $i => $field) {
$i++;
- $display = (isset($_POST["add"][$i-1]) || (isset($field["field"]) && !$_POST["drop_col"][$i]));
+ $orig = $field[($_POST ? "orig" : "field")];
+ $display = (isset($_POST["add"][$i-1]) || (isset($field["field"]) && !$_POST["drop_col"][$i])) && (support("drop_col") || $orig == "");
?>
<tr<?php echo ($display ? "" : " style='display: none;'"); ?>>
<?php echo ($type == "PROCEDURE" ? "<td>" . html_select("fields[$i][inout]", $inout, $field["inout"]) : ""); ?>
-<th><?php if ($display) { ?><input name="fields[<?php echo $i; ?>][field]" value="<?php echo h($field["field"]); ?>" onchange="<?php echo ($field["field"] != "" || count($fields) > 1 ? "" : "editingAddRow(this, $allowed); "); ?>editingNameChange(this);" maxlength="64"><?php } ?><input type="hidden" name="fields[<?php echo $i; ?>][orig]" value="<?php echo h($field[($_POST ? "orig" : "field")]); ?>">
+<th><?php if ($display) { ?><input name="fields[<?php echo $i; ?>][field]" value="<?php echo h($field["field"]); ?>" onchange="<?php echo ($field["field"] != "" || count($fields) > 1 ? "" : "editingAddRow(this, $allowed); "); ?>editingNameChange(this);" maxlength="64"><?php } ?><input type="hidden" name="fields[<?php echo $i; ?>][orig]" value="<?php echo h($orig); ?>">
<?php edit_type("fields[$i]", $field, $collations, $foreign_keys); ?>
<?php if ($type == "TABLE") { ?>
<td><?php echo checkbox("fields[$i][null]", 1, $field["null"]); ?>
@@ -221,11 +222,13 @@
<?php echo (support("comment") ? "<td" . ($comments ? "" : " class='hidden'") . "><input name='fields[$i][comment]' value='" . h($field["comment"]) . "' maxlength='255'>" : ""); ?>
<?php } ?>
<?php
- //! hide operations not supported by the driver - column change, adding column not at the end, drop column, ...
- echo "<td><input type='image' name='add[$i]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "' onclick='return !editingAddRow(this, $allowed, 1);'>";
- echo " <input type='image' name='drop_col[$i]' src='../adminer/static/cross.gif' alt='x' title='" . lang('Remove') . "' onclick='return !editingRemoveRow(this);'>";
- echo " <input type='image' name='up[$i]' src='../adminer/static/up.gif' alt='^' title='" . lang('Move up') . "'>";
- echo " <input type='image' name='down[$i]' src='../adminer/static/down.gif' alt='v' title='" . lang('Move down') . "'>";
+ echo "<td>";
+ echo (support("move_col") ?
+ "<input type='image' name='add[$i]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "' onclick='return !editingAddRow(this, $allowed, 1);'> "
+ . "<input type='image' name='up[$i]' src='../adminer/static/up.gif' alt='^' title='" . lang('Move up') . "'> "
+ . "<input type='image' name='down[$i]' src='../adminer/static/down.gif' alt='v' title='" . lang('Move down') . "'> "
+ : "");
+ echo ($orig == "" || support("drop_col") ? "<input type='image' name='drop_col[$i]' src='../adminer/static/cross.gif' alt='x' title='" . lang('Remove') . "' onclick='return !editingRemoveRow(this);'>" : "");
echo "\n";
}
return $comments;
Modified: trunk/todo.txt
===================================================================
--- trunk/todo.txt 2010-05-05 16:26:41 UTC (rev 1517)
+++ trunk/todo.txt 2010-05-05 16:27:39 UTC (rev 1518)
@@ -37,7 +37,6 @@
ORDER BY COUNT(*)
Table schema - SELECT * FROM pg_namespace, CREATE|ALTER|DROP SCHEMA, SET default_tablespace
Export - http://www.postgresql.org/docs/8.4/static/functions-info.html
-Table status - http://www.postgresql.org/docs/8.4/static/functions-admin.html
Column rights - http://www.postgresql.org/docs/8.4/static/functions-info.html
Dollar terminated string in SQL command
Move table - ALTER TABLE SET SCHEMA
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jak...@us...> - 2010-05-05 16:26:46
|
Revision: 1517
http://adminer.svn.sourceforge.net/adminer/?rev=1517&view=rev
Author: jakubvrana
Date: 2010-05-05 16:26:41 +0000 (Wed, 05 May 2010)
Log Message:
-----------
Revert 1511 (always dump all tables)
Modified Paths:
--------------
trunk/adminer/include/adminer.inc.php
Modified: trunk/adminer/include/adminer.inc.php
===================================================================
--- trunk/adminer/include/adminer.inc.php 2010-05-05 11:11:33 UTC (rev 1516)
+++ trunk/adminer/include/adminer.inc.php 2010-05-05 16:26:41 UTC (rev 1517)
@@ -497,7 +497,7 @@
<form action="" method="post">
<p class="logout">
<a href="<?php echo h(ME); ?>sql="><?php echo bold(lang('SQL command'), isset($_GET["sql"])); ?></a>
-<a href="<?php echo h(ME); ?>dump="><?php echo bold(lang('Dump'), isset($_GET["dump"])); ?></a>
+<a href="<?php echo h(ME); ?>dump=<?php echo urlencode(isset($_GET["table"]) ? $_GET["table"] : $_GET["select"]); ?>"><?php echo bold(lang('Dump'), isset($_GET["dump"])); ?></a>
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="submit" name="logout" value="<?php echo lang('Logout'); ?>">
</p>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jak...@us...> - 2010-05-05 11:11:39
|
Revision: 1516
http://adminer.svn.sourceforge.net/adminer/?rev=1516&view=rev
Author: jakubvrana
Date: 2010-05-05 11:11:33 +0000 (Wed, 05 May 2010)
Log Message:
-----------
Update MS SQL
Modified Paths:
--------------
trunk/adminer/drivers/mssql.inc.php
Modified: trunk/adminer/drivers/mssql.inc.php
===================================================================
--- trunk/adminer/drivers/mssql.inc.php 2010-05-05 08:52:20 UTC (rev 1515)
+++ trunk/adminer/drivers/mssql.inc.php 2010-05-05 11:11:33 UTC (rev 1516)
@@ -477,8 +477,20 @@
);
}
+ function use_sql($database) {
+ return "USE " . idf_escape($database);
+ }
+
+ function show_variables() {
+ return array();
+ }
+
+ function show_status() {
+ return array();
+ }
+
function support($feature) {
- return ereg('^(view|routine|trigger)$', $feature);
+ return ereg('^(trigger)$', $feature); //! view|routine|
}
$driver = "mssql";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jak...@us...> - 2010-05-05 08:52:26
|
Revision: 1515
http://adminer.svn.sourceforge.net/adminer/?rev=1515&view=rev
Author: jakubvrana
Date: 2010-05-05 08:52:20 +0000 (Wed, 05 May 2010)
Log Message:
-----------
Apply processInput to modified value
Modified Paths:
--------------
trunk/adminer/select.inc.php
Modified: trunk/adminer/select.inc.php
===================================================================
--- trunk/adminer/select.inc.php 2010-05-03 16:09:43 UTC (rev 1514)
+++ trunk/adminer/select.inc.php 2010-05-05 08:52:20 UTC (rev 1515)
@@ -112,7 +112,7 @@
$set = array();
foreach ($row as $key => $val) {
$key = bracket_escape($key, 1); // 1 - back
- $set[] = idf_escape($key) . " = " . $connection->quote($adminer->editVal($val, $fields[$key]));
+ $set[] = idf_escape($key) . " = " . $adminer->processInput($fields[$key], $val);
}
$result = queries("UPDATE" . limit1(idf_escape($TABLE) . " SET " . implode(", ", $set) . " WHERE " . where_check($unique_idf) . ($where ? " AND " . implode(" AND ", $where) : ""))); // can change row on a different page without unique key
if (!$result) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jak...@us...> - 2010-05-03 16:09:50
|
Revision: 1514
http://adminer.svn.sourceforge.net/adminer/?rev=1514&view=rev
Author: jakubvrana
Date: 2010-05-03 16:09:43 +0000 (Mon, 03 May 2010)
Log Message:
-----------
Shorten code
Modified Paths:
--------------
trunk/adminer/include/adminer.inc.php
Modified: trunk/adminer/include/adminer.inc.php
===================================================================
--- trunk/adminer/include/adminer.inc.php 2010-05-03 16:09:13 UTC (rev 1513)
+++ trunk/adminer/include/adminer.inc.php 2010-05-03 16:09:43 UTC (rev 1514)
@@ -525,10 +525,9 @@
}
echo "<script type='text/javascript'>\n";
echo "var jushLinks = { $driver: [ '" . addcslashes(h(ME), "\\'/") . "table=\$&', /\\b(" . implode("|", $links) . ")\\b/g ] };\n";
- echo "jushLinks.bac = jushLinks.$driver;\n";
- echo "jushLinks.bra = jushLinks.$driver;\n";
- echo "jushLinks.mssql_bra = jushLinks.$driver;\n";
- echo "jushLinks.sqlite_quo = jushLinks.$driver;\n";
+ foreach (array("bac", "bra", "sqlite_quo", "mssql_bra") as $val) {
+ echo "jushLinks.$val = jushLinks.$driver;\n";
+ }
echo "</script>\n";
}
echo '<p><a href="' . h(ME) . 'create=">' . bold(lang('Create new table'), $_GET["create"] === "") . "</a>\n";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jak...@us...> - 2010-05-03 16:09:19
|
Revision: 1513
http://adminer.svn.sourceforge.net/adminer/?rev=1513&view=rev
Author: jakubvrana
Date: 2010-05-03 16:09:13 +0000 (Mon, 03 May 2010)
Log Message:
-----------
Ability to not export triggers (thanks to paranoiq)
Modified Paths:
--------------
trunk/adminer/dump.inc.php
Modified: trunk/adminer/dump.inc.php
===================================================================
--- trunk/adminer/dump.inc.php 2010-05-03 16:08:46 UTC (rev 1512)
+++ trunk/adminer/dump.inc.php 2010-05-03 16:09:13 UTC (rev 1513)
@@ -68,7 +68,6 @@
if ($_POST["table_style"] || $_POST["data_style"]) {
$views = array();
- //! defer number of rows to JavaScript
foreach (table_status() as $row) {
$table = (DB == "" || in_array($row["Name"], (array) $_POST["tables"]));
$data = (DB == "" || in_array($row["Name"], (array) $_POST["data"]));
@@ -81,7 +80,7 @@
if ($data) {
dump_data($row["Name"], $_POST["data_style"]);
}
- if ($table) {
+ if ($_POST["triggers"]) {
dump_triggers($row["Name"], $_POST["table_style"]);
}
if ($ext == "tar") {
@@ -164,17 +163,16 @@
if (!$row) {
$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('Database') . "<td>" . html_select('db_style', $db_style, $row["db_style"]);
-$checked = ($_GET["dump"] == "");
-if (support("routine")) {
- echo checkbox("routines", 1, $checked, lang('Routines'));
-}
-if (support("event")) {
- echo checkbox("events", 1, $checked, lang('Events'));
-}
-echo "<tr><th>" . lang('Tables') . "<td>" . html_select('table_style', $table_style, $row["table_style"]);
+echo "<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')) : "")
+;
+echo "<tr><th>" . lang('Tables') . "<td>" . html_select('table_style', $table_style, $row["table_style"])
+ . (support("trigger") ? checkbox("triggers", 1, $row["table_style"], lang('Triggers')) : "")
+;
echo "<tr><th>" . lang('Data') . "<td>" . html_select('data_style', $data_style, $row["data_style"]);
?>
</table>
@@ -190,6 +188,7 @@
echo "<th style='text-align: right;'><label>" . lang('Data') . "<input type='checkbox' id='check-data'$checked onclick='formCheck(this, /^data\\[/);'></label>";
echo "</thead>\n";
$views = "";
+ //! defer number of rows to JavaScript
foreach (table_status() as $row) {
$name = $row["Name"];
$prefix = ereg_replace("_.*", "", $name);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jak...@us...> - 2010-05-03 16:08:53
|
Revision: 1512
http://adminer.svn.sourceforge.net/adminer/?rev=1512&view=rev
Author: jakubvrana
Date: 2010-05-03 16:08:46 +0000 (Mon, 03 May 2010)
Log Message:
-----------
Fix big tables check
Modified Paths:
--------------
trunk/editor/include/adminer.inc.php
Modified: trunk/editor/include/adminer.inc.php
===================================================================
--- trunk/editor/include/adminer.inc.php 2010-05-03 16:08:14 UTC (rev 1511)
+++ trunk/editor/include/adminer.inc.php 2010-05-03 16:08:46 UTC (rev 1512)
@@ -479,7 +479,6 @@
function _foreignKeyOptions($table, $column) {
global $connection;
- $table_status = table_status($table);
$foreignKeys = column_foreign_keys($table);
foreach ((array) $foreignKeys[$column] as $foreignKey) {
if (count($foreignKey["source"]) == 1) {
@@ -488,6 +487,7 @@
if ($name != "") {
$return = &$this->_values[$foreignKey["table"]];
if (!isset($return)) {
+ $table_status = table_status($foreignKey["table"]);
$return = ($table_status["Rows"] > 1000 ? array() : array("" => "") + get_key_vals("SELECT $id, $name FROM " . idf_escape($foreignKey["table"]) . " ORDER BY 2"));
}
return $return;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jak...@us...> - 2010-05-03 16:08:20
|
Revision: 1511
http://adminer.svn.sourceforge.net/adminer/?rev=1511&view=rev
Author: jakubvrana
Date: 2010-05-03 16:08:14 +0000 (Mon, 03 May 2010)
Log Message:
-----------
Always link dump of all tables
Modified Paths:
--------------
trunk/adminer/include/adminer.inc.php
Modified: trunk/adminer/include/adminer.inc.php
===================================================================
--- trunk/adminer/include/adminer.inc.php 2010-05-02 21:37:05 UTC (rev 1510)
+++ trunk/adminer/include/adminer.inc.php 2010-05-03 16:08:14 UTC (rev 1511)
@@ -497,7 +497,7 @@
<form action="" method="post">
<p class="logout">
<a href="<?php echo h(ME); ?>sql="><?php echo bold(lang('SQL command'), isset($_GET["sql"])); ?></a>
-<a href="<?php echo h(ME); ?>dump=<?php echo urlencode(isset($_GET["table"]) ? $_GET["table"] : $_GET["select"]); ?>"><?php echo bold(lang('Dump'), isset($_GET["dump"])); ?></a>
+<a href="<?php echo h(ME); ?>dump="><?php echo bold(lang('Dump'), isset($_GET["dump"])); ?></a>
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="submit" name="logout" value="<?php echo lang('Logout'); ?>">
</p>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jak...@us...> - 2010-05-02 21:37:15
|
Revision: 1510
http://adminer.svn.sourceforge.net/adminer/?rev=1510&view=rev
Author: jakubvrana
Date: 2010-05-02 21:37:05 +0000 (Sun, 02 May 2010)
Log Message:
-----------
Link table names in SQL queries
Modified Paths:
--------------
trunk/adminer/include/adminer.inc.php
trunk/adminer/static/editing.js
trunk/changes.txt
Modified: trunk/adminer/include/adminer.inc.php
===================================================================
--- trunk/adminer/include/adminer.inc.php 2010-04-30 21:31:44 UTC (rev 1509)
+++ trunk/adminer/include/adminer.inc.php 2010-05-02 21:37:05 UTC (rev 1510)
@@ -483,7 +483,7 @@
* @return null
*/
function navigation($missing) {
- global $VERSION, $connection, $token;
+ global $VERSION, $connection, $token, $driver;
?>
<h1>
<a href="http://www.adminer.org/" id="h1"><?php echo $this->name(); ?></a>
@@ -519,6 +519,17 @@
echo "<p class='message'>" . lang('No tables.') . "\n";
} else {
$this->tablesPrint($tables);
+ $links = array();
+ foreach ($tables as $table => $type) {
+ $links[] = preg_quote($table, '/');
+ }
+ echo "<script type='text/javascript'>\n";
+ echo "var jushLinks = { $driver: [ '" . addcslashes(h(ME), "\\'/") . "table=\$&', /\\b(" . implode("|", $links) . ")\\b/g ] };\n";
+ echo "jushLinks.bac = jushLinks.$driver;\n";
+ echo "jushLinks.bra = jushLinks.$driver;\n";
+ echo "jushLinks.mssql_bra = jushLinks.$driver;\n";
+ echo "jushLinks.sqlite_quo = jushLinks.$driver;\n";
+ echo "</script>\n";
}
echo '<p><a href="' . h(ME) . 'create=">' . bold(lang('Create new table'), $_GET["create"] === "") . "</a>\n";
}
Modified: trunk/adminer/static/editing.js
===================================================================
--- trunk/adminer/static/editing.js 2010-04-30 21:31:44 UTC (rev 1509)
+++ trunk/adminer/static/editing.js 2010-05-02 21:37:05 UTC (rev 1510)
@@ -15,6 +15,9 @@
jush.urls.sqlset[0] = jush.urls.sql[0];
jush.urls.sqlstatus[0] = jush.urls.sql[0];
jush.style(jushRoot + 'jush.css');
+ if (window.jushLinks) {
+ jush.custom_links = jushLinks;
+ }
jush.highlight_tag('pre', 0);
jush.highlight_tag('code');
}
Modified: trunk/changes.txt
===================================================================
--- trunk/changes.txt 2010-04-30 21:31:44 UTC (rev 1509)
+++ trunk/changes.txt 2010-05-02 21:37:05 UTC (rev 1510)
@@ -9,6 +9,7 @@
Autofocus username in login form
Disable spellchecking in SQL textareas
Japanese translation
+Link table names in SQL queries
Defer table information in database overview to JavaScript (performance)
Big tables optimizations (performance)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jak...@us...> - 2010-04-30 21:31:50
|
Revision: 1509
http://adminer.svn.sourceforge.net/adminer/?rev=1509&view=rev
Author: jakubvrana
Date: 2010-04-30 21:31:44 +0000 (Fri, 30 Apr 2010)
Log Message:
-----------
Respect different table charset (bug #2991944)
Modified Paths:
--------------
trunk/adminer/drivers/mysql.inc.php
Modified: trunk/adminer/drivers/mysql.inc.php
===================================================================
--- trunk/adminer/drivers/mysql.inc.php 2010-04-28 00:11:39 UTC (rev 1508)
+++ trunk/adminer/drivers/mysql.inc.php 2010-04-30 21:31:44 UTC (rev 1509)
@@ -498,7 +498,7 @@
*/
function exact_value($val) {
global $connection;
- return "BINARY " . $connection->quote($val);
+ return $connection->quote($val) . " COLLATE utf8_bin";
}
/** Create database
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jak...@us...> - 2010-04-28 00:11:45
|
Revision: 1508
http://adminer.svn.sourceforge.net/adminer/?rev=1508&view=rev
Author: jakubvrana
Date: 2010-04-28 00:11:39 +0000 (Wed, 28 Apr 2010)
Log Message:
-----------
Driver specific routines
Modified Paths:
--------------
trunk/adminer/db.inc.php
trunk/adminer/drivers/mysql.inc.php
trunk/adminer/drivers/sqlite.inc.php
trunk/adminer/include/editing.inc.php
Modified: trunk/adminer/db.inc.php
===================================================================
--- trunk/adminer/db.inc.php 2010-04-28 00:10:30 UTC (rev 1507)
+++ trunk/adminer/db.inc.php 2010-04-28 00:11:39 UTC (rev 1508)
@@ -94,12 +94,12 @@
}
if (support("routine")) {
echo "<h3>" . lang('Routines') . "</h3>\n";
- $result = $connection->query("SELECT * FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA = " . $connection->quote(DB));
- if ($result->num_rows) {
- odd('');
+ $routines = routines();
+ if ($routines) {
echo "<table cellspacing='0'>\n";
echo '<thead><tr><th>' . lang('Name') . '<td>' . lang('Type') . '<td>' . lang('Return type') . "<td> </thead>\n";
- while ($row = $result->fetch_assoc()) {
+ odd('');
+ foreach ($routines as $row) {
echo '<tr' . odd() . '>';
echo '<th><a href="' . h(ME) . ($row["ROUTINE_TYPE"] == "FUNCTION" ? 'callf=' : 'call=') . urlencode($row["ROUTINE_NAME"]) . '">' . h($row["ROUTINE_NAME"]) . '</a>';
echo '<td>' . h($row["ROUTINE_TYPE"]);
Modified: trunk/adminer/drivers/mysql.inc.php
===================================================================
--- trunk/adminer/drivers/mysql.inc.php 2010-04-28 00:10:30 UTC (rev 1507)
+++ trunk/adminer/drivers/mysql.inc.php 2010-04-28 00:11:39 UTC (rev 1508)
@@ -681,6 +681,53 @@
);
}
+ /** Get information about stored routine
+ * @param string
+ * @param string FUNCTION or PROCEDURE
+ * @return array ("fields" => array("field" => , "type" => , "length" => , "unsigned" => , "inout" => , "collation" => ), "returns" => , "definition" => )
+ */
+ function routine($name, $type) {
+ global $connection, $enum_length, $inout, $types;
+ $aliases = array("bit" => "tinyint", "bool" => "tinyint", "boolean" => "tinyint", "integer" => "int", "double precision" => "float", "real" => "float", "dec" => "decimal", "numeric" => "decimal", "fixed" => "decimal", "national char" => "char", "national varchar" => "varchar");
+ $type_pattern = "((" . implode("|", array_keys($types + $aliases)) . ")(?:\\s*\\(((?:[^'\")]*|$enum_length)+)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s]+)['\"]?)?";
+ $pattern = "\\s*(" . ($type == "FUNCTION" ? "" : implode("|", $inout)) . ")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$type_pattern";
+ $create = $connection->result("SHOW CREATE $type " . idf_escape($name), 2);
+ preg_match("~\\(((?:$pattern\\s*,?)*)\\)" . ($type == "FUNCTION" ? "\\s*RETURNS\\s+$type_pattern" : "") . "\\s*(.*)~is", $create, $match);
+ $fields = array();
+ preg_match_all("~$pattern\\s*,?~is", $match[1], $matches, PREG_SET_ORDER);
+ foreach ($matches as $param) {
+ $name = str_replace("``", "`", $param[2]) . $param[3];
+ $data_type = strtolower($param[5]);
+ $fields[] = array(
+ "field" => $name,
+ "type" => (isset($aliases[$data_type]) ? $aliases[$data_type] : $data_type),
+ "length" => preg_replace_callback("~$enum_length~s", 'normalize_enum', $param[6]),
+ "unsigned" => strtolower(preg_replace('~\\s+~', ' ', trim("$param[8] $param[7]"))),
+ "full_type" => $param[4],
+ "inout" => strtoupper($param[1]),
+ "collation" => strtolower($param[9]),
+ );
+ }
+ if ($type != "FUNCTION") {
+ return array("fields" => $fields, "definition" => $match[11]);
+ }
+ return array(
+ "fields" => $fields,
+ "returns" => array("type" => $match[12], "length" => $match[13], "unsigned" => $match[15], "collation" => $match[16]),
+ "definition" => $match[17],
+ );
+ }
+
+ function routines() {
+ global $connection;
+ $return = array();
+ $result = $connection->query("SELECT * FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA = " . $connection->quote(DB));
+ while ($row = $result->fetch_assoc()) {
+ $return[] = $row;
+ }
+ return $return;
+ }
+
/** Begin transaction
* @return bool
*/
Modified: trunk/adminer/drivers/sqlite.inc.php
===================================================================
--- trunk/adminer/drivers/sqlite.inc.php 2010-04-28 00:10:30 UTC (rev 1507)
+++ trunk/adminer/drivers/sqlite.inc.php 2010-04-28 00:11:39 UTC (rev 1508)
@@ -474,6 +474,14 @@
);
}
+ function routine($name, $type) {
+ // not supported by SQLite
+ }
+
+ function routines() {
+ // not supported by SQLite
+ }
+
function begin() {
return queries("BEGIN");
}
Modified: trunk/adminer/include/editing.inc.php
===================================================================
--- trunk/adminer/include/editing.inc.php 2010-04-28 00:10:30 UTC (rev 1507)
+++ trunk/adminer/include/editing.inc.php 2010-04-28 00:11:39 UTC (rev 1508)
@@ -280,43 +280,6 @@
return "'" . str_replace("'", "''", addcslashes(stripcslashes(str_replace($match[0][0] . $match[0][0], $match[0][0], substr($match[0], 1, -1))), '\\')) . "'";
}
-/** Get information about stored routine
-* @param string
-* @param string FUNCTION or PROCEDURE
-* @return array ("fields" => array("field" => , "type" => , "length" => , "unsigned" => , "inout" => , "collation" => ), "returns" => , "definition" => )
-*/
-function routine($name, $type) {
- global $connection, $enum_length, $inout, $types;
- $aliases = array("bit" => "tinyint", "bool" => "tinyint", "boolean" => "tinyint", "integer" => "int", "double precision" => "float", "real" => "float", "dec" => "decimal", "numeric" => "decimal", "fixed" => "decimal", "national char" => "char", "national varchar" => "varchar");
- $type_pattern = "((" . implode("|", array_keys($types + $aliases)) . ")(?:\\s*\\(((?:[^'\")]*|$enum_length)+)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s]+)['\"]?)?";
- $pattern = "\\s*(" . ($type == "FUNCTION" ? "" : implode("|", $inout)) . ")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$type_pattern";
- $create = $connection->result("SHOW CREATE $type " . idf_escape($name), 2);
- preg_match("~\\(((?:$pattern\\s*,?)*)\\)" . ($type == "FUNCTION" ? "\\s*RETURNS\\s+$type_pattern" : "") . "\\s*(.*)~is", $create, $match);
- $fields = array();
- preg_match_all("~$pattern\\s*,?~is", $match[1], $matches, PREG_SET_ORDER);
- foreach ($matches as $param) {
- $name = str_replace("``", "`", $param[2]) . $param[3];
- $data_type = strtolower($param[5]);
- $fields[] = array(
- "field" => $name,
- "type" => (isset($aliases[$data_type]) ? $aliases[$data_type] : $data_type),
- "length" => preg_replace_callback("~$enum_length~s", 'normalize_enum', $param[6]),
- "unsigned" => strtolower(preg_replace('~\\s+~', ' ', trim("$param[8] $param[7]"))),
- "full_type" => $param[4],
- "inout" => strtoupper($param[1]),
- "collation" => strtolower($param[9]),
- );
- }
- if ($type != "FUNCTION") {
- return array("fields" => $fields, "definition" => $match[11]);
- }
- return array(
- "fields" => $fields,
- "returns" => array("type" => $match[12], "length" => $match[13], "unsigned" => $match[15], "collation" => $match[16]),
- "definition" => $match[17],
- );
-}
-
/** Issue grant or revoke commands
* @param string GRANT or REVOKE
* @param array
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jak...@us...> - 2010-04-28 00:10:36
|
Revision: 1507
http://adminer.svn.sourceforge.net/adminer/?rev=1507&view=rev
Author: jakubvrana
Date: 2010-04-28 00:10:30 +0000 (Wed, 28 Apr 2010)
Log Message:
-----------
Display routine parameter type in title (thanks to paranoiq)
Modified Paths:
--------------
trunk/adminer/call.inc.php
trunk/adminer/include/editing.inc.php
Modified: trunk/adminer/call.inc.php
===================================================================
--- trunk/adminer/call.inc.php 2010-04-27 15:57:15 UTC (rev 1506)
+++ trunk/adminer/call.inc.php 2010-04-28 00:10:30 UTC (rev 1507)
@@ -55,7 +55,7 @@
foreach ($in as $key) {
$field = $routine["fields"][$key];
$name = $field["field"];
- echo "<tr><th>" . h($name);
+ echo "<tr><th>" . $adminer->fieldName($field);
$value = $_POST["fields"][$name];
if ($value != "" && ereg("enum|set", $field["type"])) {
$value = intval($value);
Modified: trunk/adminer/include/editing.inc.php
===================================================================
--- trunk/adminer/include/editing.inc.php 2010-04-27 15:57:15 UTC (rev 1506)
+++ trunk/adminer/include/editing.inc.php 2010-04-28 00:10:30 UTC (rev 1507)
@@ -288,7 +288,7 @@
function routine($name, $type) {
global $connection, $enum_length, $inout, $types;
$aliases = array("bit" => "tinyint", "bool" => "tinyint", "boolean" => "tinyint", "integer" => "int", "double precision" => "float", "real" => "float", "dec" => "decimal", "numeric" => "decimal", "fixed" => "decimal", "national char" => "char", "national varchar" => "varchar");
- $type_pattern = "(" . implode("|", array_keys($types + $aliases)) . ")(?:\\s*\\(((?:[^'\")]*|$enum_length)+)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s]+)['\"]?)?";
+ $type_pattern = "((" . implode("|", array_keys($types + $aliases)) . ")(?:\\s*\\(((?:[^'\")]*|$enum_length)+)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s]+)['\"]?)?";
$pattern = "\\s*(" . ($type == "FUNCTION" ? "" : implode("|", $inout)) . ")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$type_pattern";
$create = $connection->result("SHOW CREATE $type " . idf_escape($name), 2);
preg_match("~\\(((?:$pattern\\s*,?)*)\\)" . ($type == "FUNCTION" ? "\\s*RETURNS\\s+$type_pattern" : "") . "\\s*(.*)~is", $create, $match);
@@ -296,21 +296,25 @@
preg_match_all("~$pattern\\s*,?~is", $match[1], $matches, PREG_SET_ORDER);
foreach ($matches as $param) {
$name = str_replace("``", "`", $param[2]) . $param[3];
- $data_type = strtolower($param[4]);
+ $data_type = strtolower($param[5]);
$fields[] = array(
"field" => $name,
"type" => (isset($aliases[$data_type]) ? $aliases[$data_type] : $data_type),
- "length" => preg_replace_callback("~$enum_length~s", 'normalize_enum', $param[5]),
- "unsigned" => strtolower(preg_replace('~\\s+~', ' ', trim("$param[7] $param[6]"))),
+ "length" => preg_replace_callback("~$enum_length~s", 'normalize_enum', $param[6]),
+ "unsigned" => strtolower(preg_replace('~\\s+~', ' ', trim("$param[8] $param[7]"))),
+ "full_type" => $param[4],
"inout" => strtoupper($param[1]),
- "collation" => strtolower($param[8]),
+ "collation" => strtolower($param[9]),
);
}
if ($type != "FUNCTION") {
- return array("fields" => $fields, "definition" => $match[10]);
+ return array("fields" => $fields, "definition" => $match[11]);
}
- $returns = array("type" => $match[10], "length" => $match[11], "unsigned" => $match[13], "collation" => $match[14]);
- return array("fields" => $fields, "returns" => $returns, "definition" => $match[15]);
+ return array(
+ "fields" => $fields,
+ "returns" => array("type" => $match[12], "length" => $match[13], "unsigned" => $match[15], "collation" => $match[16]),
+ "definition" => $match[17],
+ );
}
/** Issue grant or revoke commands
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jak...@us...> - 2010-04-27 15:57:21
|
Revision: 1506
http://adminer.svn.sourceforge.net/adminer/?rev=1506&view=rev
Author: jakubvrana
Date: 2010-04-27 15:57:15 +0000 (Tue, 27 Apr 2010)
Log Message:
-----------
Add date function in select (thanks to paranoiq)
Modified Paths:
--------------
trunk/adminer/drivers/mysql.inc.php
Modified: trunk/adminer/drivers/mysql.inc.php
===================================================================
--- trunk/adminer/drivers/mysql.inc.php 2010-04-27 15:56:42 UTC (rev 1505)
+++ trunk/adminer/drivers/mysql.inc.php 2010-04-27 15:57:15 UTC (rev 1506)
@@ -768,7 +768,7 @@
}
$unsigned = array("unsigned", "zerofill", "unsigned zerofill"); ///< @var array number variants
$operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "REGEXP", "IN", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL"); ///< @var array operators used in select
- $functions = array("char_length", "from_unixtime", "hex", "lower", "round", "sec_to_time", "time_to_sec", "upper"); ///< @var array functions used in select
+ $functions = array("char_length", "date", "from_unixtime", "hex", "lower", "round", "sec_to_time", "time_to_sec", "upper"); ///< @var array functions used in select
$grouping = array("avg", "count", "count distinct", "group_concat", "max", "min", "sum"); ///< @var array grouping functions used in select
$edit_functions = array( ///< @var array of array("$type|$type2" => "$function/$function2") functions used in editing, [0] - edit and insert, [1] - edit only
array(
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jak...@us...> - 2010-04-27 15:56:49
|
Revision: 1505
http://adminer.svn.sourceforge.net/adminer/?rev=1505&view=rev
Author: jakubvrana
Date: 2010-04-27 15:56:42 +0000 (Tue, 27 Apr 2010)
Log Message:
-----------
Improve routines listing (thanks to paranoiq)
Modified Paths:
--------------
trunk/adminer/db.inc.php
Modified: trunk/adminer/db.inc.php
===================================================================
--- trunk/adminer/db.inc.php 2010-04-27 15:56:13 UTC (rev 1504)
+++ trunk/adminer/db.inc.php 2010-04-27 15:56:42 UTC (rev 1505)
@@ -96,11 +96,14 @@
echo "<h3>" . lang('Routines') . "</h3>\n";
$result = $connection->query("SELECT * FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA = " . $connection->quote(DB));
if ($result->num_rows) {
+ odd('');
echo "<table cellspacing='0'>\n";
+ echo '<thead><tr><th>' . lang('Name') . '<td>' . lang('Type') . '<td>' . lang('Return type') . "<td> </thead>\n";
while ($row = $result->fetch_assoc()) {
- echo "<tr>";
- echo "<td>" . h($row["ROUTINE_TYPE"]);
+ echo '<tr' . odd() . '>';
echo '<th><a href="' . h(ME) . ($row["ROUTINE_TYPE"] == "FUNCTION" ? 'callf=' : 'call=') . urlencode($row["ROUTINE_NAME"]) . '">' . h($row["ROUTINE_NAME"]) . '</a>';
+ echo '<td>' . h($row["ROUTINE_TYPE"]);
+ echo '<td>' . h($row["DTD_IDENTIFIER"]);
echo '<td><a href="' . h(ME) . ($row["ROUTINE_TYPE"] == "FUNCTION" ? 'function=' : 'procedure=') . urlencode($row["ROUTINE_NAME"]) . '">' . lang('Alter') . "</a>";
}
echo "</table>\n";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|