diff --git a/arrow.gif b/adminer/arrow.gif
similarity index 100%
rename from arrow.gif
rename to adminer/arrow.gif
diff --git a/call.inc.php b/adminer/call.inc.php
similarity index 100%
rename from call.inc.php
rename to adminer/call.inc.php
diff --git a/create.inc.php b/adminer/create.inc.php
similarity index 100%
rename from create.inc.php
rename to adminer/create.inc.php
diff --git a/createv.inc.php b/adminer/createv.inc.php
similarity index 100%
rename from createv.inc.php
rename to adminer/createv.inc.php
diff --git a/cross.gif b/adminer/cross.gif
similarity index 100%
rename from cross.gif
rename to adminer/cross.gif
diff --git a/database.inc.php b/adminer/database.inc.php
similarity index 100%
rename from database.inc.php
rename to adminer/database.inc.php
diff --git a/db.inc.php b/adminer/db.inc.php
similarity index 100%
rename from db.inc.php
rename to adminer/db.inc.php
diff --git a/default.css b/adminer/default.css
similarity index 100%
rename from default.css
rename to adminer/default.css
diff --git a/down.gif b/adminer/down.gif
similarity index 100%
rename from down.gif
rename to adminer/down.gif
diff --git a/download.inc.php b/adminer/download.inc.php
similarity index 100%
rename from download.inc.php
rename to adminer/download.inc.php
diff --git a/dump.inc.php b/adminer/dump.inc.php
similarity index 100%
rename from dump.inc.php
rename to adminer/dump.inc.php
diff --git a/edit.inc.php b/adminer/edit.inc.php
similarity index 100%
rename from edit.inc.php
rename to adminer/edit.inc.php
diff --git a/event.inc.php b/adminer/event.inc.php
similarity index 100%
rename from event.inc.php
rename to adminer/event.inc.php
diff --git a/favicon.ico b/adminer/favicon.ico
similarity index 100%
rename from favicon.ico
rename to adminer/favicon.ico
diff --git a/foreign.inc.php b/adminer/foreign.inc.php
similarity index 100%
rename from foreign.inc.php
rename to adminer/foreign.inc.php
diff --git a/functions.js b/adminer/functions.js
similarity index 98%
rename from functions.js
rename to adminer/functions.js
index f9d4e4b5..825c938b 100644
--- a/functions.js
+++ b/adminer/functions.js
@@ -23,9 +23,9 @@ function verify_version(version) {
function load_jush() {
var script = document.createElement('script');
- script.src = 'externals/jush/jush.js';
+ script.src = '../externals/jush/jush.js';
script.onload = function () {
- jush.style('externals/jush/jush.css');
+ jush.style('../externals/jush/jush.css');
jush.highlight_tag('pre');
jush.highlight_tag('code');
}
diff --git a/include/auth.inc.php b/adminer/include/auth.inc.php
similarity index 100%
rename from include/auth.inc.php
rename to adminer/include/auth.inc.php
diff --git a/include/connect.inc.php b/adminer/include/connect.inc.php
similarity index 100%
rename from include/connect.inc.php
rename to adminer/include/connect.inc.php
diff --git a/include/design.inc.php b/adminer/include/design.inc.php
similarity index 100%
rename from include/design.inc.php
rename to adminer/include/design.inc.php
diff --git a/include/editing.inc.php b/adminer/include/editing.inc.php
similarity index 100%
rename from include/editing.inc.php
rename to adminer/include/editing.inc.php
diff --git a/include/export.inc.php b/adminer/include/export.inc.php
similarity index 100%
rename from include/export.inc.php
rename to adminer/include/export.inc.php
diff --git a/include/functions.inc.php b/adminer/include/functions.inc.php
similarity index 100%
rename from include/functions.inc.php
rename to adminer/include/functions.inc.php
diff --git a/include/lang.inc.php b/adminer/include/lang.inc.php
similarity index 100%
rename from include/lang.inc.php
rename to adminer/include/lang.inc.php
diff --git a/include/mysql.inc.php b/adminer/include/mysql.inc.php
similarity index 100%
rename from include/mysql.inc.php
rename to adminer/include/mysql.inc.php
diff --git a/include/pdo.inc.php b/adminer/include/pdo.inc.php
similarity index 100%
rename from include/pdo.inc.php
rename to adminer/include/pdo.inc.php
diff --git a/include/sqlite.inc.php b/adminer/include/sqlite.inc.php
similarity index 100%
rename from include/sqlite.inc.php
rename to adminer/include/sqlite.inc.php
diff --git a/include/version.inc.php b/adminer/include/version.inc.php
similarity index 100%
rename from include/version.inc.php
rename to adminer/include/version.inc.php
diff --git a/index.php b/adminer/index.php
similarity index 100%
rename from index.php
rename to adminer/index.php
diff --git a/indexes.inc.php b/adminer/indexes.inc.php
similarity index 100%
rename from indexes.inc.php
rename to adminer/indexes.inc.php
diff --git a/lang/cs.inc.php b/adminer/lang/cs.inc.php
similarity index 100%
rename from lang/cs.inc.php
rename to adminer/lang/cs.inc.php
diff --git a/lang/de.inc.php b/adminer/lang/de.inc.php
similarity index 100%
rename from lang/de.inc.php
rename to adminer/lang/de.inc.php
diff --git a/lang/en.inc.php b/adminer/lang/en.inc.php
similarity index 100%
rename from lang/en.inc.php
rename to adminer/lang/en.inc.php
diff --git a/lang/es.inc.php b/adminer/lang/es.inc.php
similarity index 100%
rename from lang/es.inc.php
rename to adminer/lang/es.inc.php
diff --git a/lang/et.inc.php b/adminer/lang/et.inc.php
similarity index 100%
rename from lang/et.inc.php
rename to adminer/lang/et.inc.php
diff --git a/lang/fr.inc.php b/adminer/lang/fr.inc.php
similarity index 100%
rename from lang/fr.inc.php
rename to adminer/lang/fr.inc.php
diff --git a/lang/it.inc.php b/adminer/lang/it.inc.php
similarity index 100%
rename from lang/it.inc.php
rename to adminer/lang/it.inc.php
diff --git a/lang/nl.inc.php b/adminer/lang/nl.inc.php
similarity index 100%
rename from lang/nl.inc.php
rename to adminer/lang/nl.inc.php
diff --git a/lang/ru.inc.php b/adminer/lang/ru.inc.php
similarity index 100%
rename from lang/ru.inc.php
rename to adminer/lang/ru.inc.php
diff --git a/lang/sk.inc.php b/adminer/lang/sk.inc.php
similarity index 100%
rename from lang/sk.inc.php
rename to adminer/lang/sk.inc.php
diff --git a/lang/zh.inc.php b/adminer/lang/zh.inc.php
similarity index 100%
rename from lang/zh.inc.php
rename to adminer/lang/zh.inc.php
diff --git a/plus.gif b/adminer/plus.gif
similarity index 100%
rename from plus.gif
rename to adminer/plus.gif
diff --git a/privileges.inc.php b/adminer/privileges.inc.php
similarity index 100%
rename from privileges.inc.php
rename to adminer/privileges.inc.php
diff --git a/procedure.inc.php b/adminer/procedure.inc.php
similarity index 100%
rename from procedure.inc.php
rename to adminer/procedure.inc.php
diff --git a/processlist.inc.php b/adminer/processlist.inc.php
similarity index 100%
rename from processlist.inc.php
rename to adminer/processlist.inc.php
diff --git a/schema.inc.php b/adminer/schema.inc.php
similarity index 100%
rename from schema.inc.php
rename to adminer/schema.inc.php
diff --git a/select.inc.php b/adminer/select.inc.php
similarity index 100%
rename from select.inc.php
rename to adminer/select.inc.php
diff --git a/sql.inc.php b/adminer/sql.inc.php
similarity index 100%
rename from sql.inc.php
rename to adminer/sql.inc.php
diff --git a/table.inc.php b/adminer/table.inc.php
similarity index 100%
rename from table.inc.php
rename to adminer/table.inc.php
diff --git a/trigger.inc.php b/adminer/trigger.inc.php
similarity index 100%
rename from trigger.inc.php
rename to adminer/trigger.inc.php
diff --git a/up.gif b/adminer/up.gif
similarity index 100%
rename from up.gif
rename to adminer/up.gif
diff --git a/user.inc.php b/adminer/user.inc.php
similarity index 100%
rename from user.inc.php
rename to adminer/user.inc.php
diff --git a/view.inc.php b/adminer/view.inc.php
similarity index 100%
rename from view.inc.php
rename to adminer/view.inc.php
diff --git a/_compile.php b/compile.php
similarity index 86%
rename from _compile.php
rename to compile.php
index ad77f440..237d74e8 100644
--- a/_compile.php
+++ b/compile.php
@@ -1,5 +1,5 @@
$val) {
if (!isset($lang_ids[$key])) {
@@ -37,7 +37,7 @@ function put_file($match) {
}
}
}
- foreach (glob(dirname(__FILE__) . "/lang/*.inc.php") as $filename) {
+ foreach (glob(dirname(__FILE__) . "/adminer/lang/*.inc.php") as $filename) {
include $filename;
$translation_ids = array_flip($lang_ids);
foreach ($translations as $key => $val) {
@@ -51,7 +51,7 @@ function put_file($match) {
}
return "switch (\$LANG) {\n$return}\n";
}
- $return = file_get_contents(dirname(__FILE__) . "/$match[2]");
+ $return = file_get_contents(dirname(__FILE__) . "/adminer/$match[2]");
if ($match[2] != "./include/lang.inc.php" || !$_COOKIE["lang"]) {
$tokens = token_get_all($return);
return "?>\n$return" . (in_array($tokens[count($tokens) - 1][0], array(T_CLOSE_TAG, T_INLINE_HTML), true) ? " 1) {
$_COOKIE["lang"] = $_SERVER["argv"][1];
- include dirname(__FILE__) . "/include/lang.inc.php";
+ include dirname(__FILE__) . "/adminer/include/lang.inc.php";
if ($_SERVER["argc"] != 2 || !isset($langs[$_COOKIE["lang"]])) {
- echo "Usage: php _compile.php [lang]\nPurpose: Compile adminer[-lang].php from index.php.\n";
+ echo "Usage: php compile.php [lang]\nPurpose: Compile adminer[-lang].php from index.php.\n";
exit(1);
}
- include dirname(__FILE__) . "/lang/$_COOKIE[lang].inc.php";
+ include dirname(__FILE__) . "/adminer/lang/$_COOKIE[lang].inc.php";
}
$filename = "adminer" . ($_COOKIE["lang"] ? "-$_COOKIE[lang]" : "") . ".php";
-$file = file_get_contents(dirname(__FILE__) . "/index.php");
+$file = file_get_contents(dirname(__FILE__) . "/adminer/index.php");
$file = preg_replace_callback('~\\b(include|require) "([^"]*)";~', 'put_file', $file);
$file = preg_replace("~if \\(isset\\(\\\$_SESSION\\[\"coverage.*\n}\n| && !isset\\(\\\$_SESSION\\[\"coverage\"\\]\\)~sU", '', $file);
if ($_COOKIE["lang"]) {
@@ -182,26 +182,26 @@ if (isset($_GET["file"])) {
header("Expires: " . gmdate("D, d M Y H:i:s", time() + 365*24*60*60) . " GMT");
if ($_GET["file"] == "favicon.ico") {
header("Content-Type: image/x-icon");
- echo base64_decode("' . base64_encode(file_get_contents(dirname(__FILE__) . "/favicon.ico")) . '");
+ echo base64_decode("' . base64_encode(file_get_contents(dirname(__FILE__) . "/adminer/favicon.ico")) . '");
} elseif ($_GET["file"] == "default.css") {
header("Content-Type: text/css");
- ?>' . preg_replace('~\\s*([:;{},])\\s*~', '\\1', file_get_contents(dirname(__FILE__) . "/default.css")) . '' . preg_replace('~\\s*([:;{},])\\s*~', '\\1', file_get_contents(dirname(__FILE__) . "/adminer/default.css")) . '' . JSMin::minify(file_get_contents(dirname(__FILE__) . "/functions.js")) . '' . JSMin::minify(file_get_contents(dirname(__FILE__) . "/adminer/functions.js")) . '\n?|\\?>\n?<\\?php~", '', $file);
$file = php_shrink($file);
fwrite(fopen($filename, "w"), $file);
diff --git a/_coverage.php b/coverage.php
similarity index 69%
rename from _coverage.php
rename to coverage.php
index 8363ca46..30ea9e4b 100644
--- a/_coverage.php
+++ b/coverage.php
@@ -26,12 +26,12 @@ if (!extension_loaded("xdebug")) {
if ($_GET["start"]) {
xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);
$_SESSION["coverage"] = array();
- include "./index.php";
+ include "./adminer/index.php";
header("Location: .");
exit;
}
-if ($_GET["filename"]) {
- $filename = basename($_GET["filename"]);
+if (preg_match('~^(include/)?[-_.a-z0-9]+$~i', $_GET["filename"])) {
+ $filename = "adminer/$_GET[filename]";
$cov = $_SESSION["coverage"][realpath($filename)];
$file = explode("
", highlight_file($filename, true));
unset($prev_color);
@@ -61,17 +61,16 @@ if ($_GET["filename"]) {
}
} else {
echo "
$ratio% | $filename |
$ratio% | $filename |
Start new coverage (requires Xdebug)
\n"; + echo "Start new coverage (requires Xdebug)
\n"; } diff --git a/_lang.php b/lang.php similarity index 71% rename from _lang.php rename to lang.php index 4be0f33d..f9de597b 100644 --- a/_lang.php +++ b/lang.php @@ -2,22 +2,22 @@ error_reporting(E_ALL & ~E_NOTICE); if ($_SERVER["argc"] > 1) { $_COOKIE["lang"] = $_SERVER["argv"][1]; - include dirname(__FILE__) . "/include/lang.inc.php"; + include dirname(__FILE__) . "/adminer/include/lang.inc.php"; if ($_SERVER["argc"] != 2 || !isset($langs[$_COOKIE["lang"]])) { - echo "Usage: php _lang.php [lang]\nPurpose: Update lang/*.inc.php from source code messages.\n"; + echo "Usage: php lang.php [lang]\nPurpose: Update lang/*.inc.php from source code messages.\n"; exit(1); } } $messages_all = array(); -foreach (array_merge(glob(dirname(__FILE__) . "/*.php"), glob(dirname(__FILE__) . "/include/*.php")) as $filename) { +foreach (array_merge(glob(dirname(__FILE__) . "/adminer/*.php"), glob(dirname(__FILE__) . "/adminer/include/*.php")) as $filename) { $file = file_get_contents($filename); if (preg_match_all("~lang\\(('(?:[^\\\\']+|\\\\.)*')([),])~", $file, $matches)) { $messages_all += array_combine($matches[1], $matches[2]); } } -foreach (glob(dirname(__FILE__) . "/lang/" . ($_COOKIE["lang"] ? $_COOKIE["lang"] : "*") . ".inc.php") as $filename) { +foreach (glob(dirname(__FILE__) . "/adminer/lang/" . ($_COOKIE["lang"] ? $_COOKIE["lang"] : "*") . ".inc.php") as $filename) { $messages = $messages_all; preg_match_all("~^(\\s*)(?:// )?(('(?:[^\\\\']+|\\\\.)*') => .*[^,\n]),?~m", file_get_contents($filename), $matches, PREG_SET_ORDER); $s = ""; diff --git a/tests/0-login.html b/tests/0-login.html index bf3dfc40..aac7c98a 100644 --- a/tests/0-login.html +++ b/tests/0-login.html @@ -13,12 +13,12 @@