Change directory structure

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@682 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana 2009-06-13 20:55:19 +00:00
parent 2f910b937e
commit e1bc7af8f3
77 changed files with 60 additions and 61 deletions

View file

Before

Width:  |  Height:  |  Size: 56 B

After

Width:  |  Height:  |  Size: 56 B

View file

Before

Width:  |  Height:  |  Size: 74 B

After

Width:  |  Height:  |  Size: 74 B

View file

Before

Width:  |  Height:  |  Size: 71 B

After

Width:  |  Height:  |  Size: 71 B

View file

Before

Width:  |  Height:  |  Size: 318 B

After

Width:  |  Height:  |  Size: 318 B

View file

@ -23,9 +23,9 @@ function verify_version(version) {
function load_jush() { function load_jush() {
var script = document.createElement('script'); var script = document.createElement('script');
script.src = 'externals/jush/jush.js'; script.src = '../externals/jush/jush.js';
script.onload = function () { script.onload = function () {
jush.style('externals/jush/jush.css'); jush.style('../externals/jush/jush.css');
jush.highlight_tag('pre'); jush.highlight_tag('pre');
jush.highlight_tag('code'); jush.highlight_tag('code');
} }

View file

Before

Width:  |  Height:  |  Size: 72 B

After

Width:  |  Height:  |  Size: 72 B

View file

Before

Width:  |  Height:  |  Size: 71 B

After

Width:  |  Height:  |  Size: 71 B

View file

@ -1,5 +1,5 @@
<?php <?php
include dirname(__FILE__) . "/include/version.inc.php"; include dirname(__FILE__) . "/adminer/include/version.inc.php";
include dirname(__FILE__) . "/externals/jsmin-php/jsmin.php"; include dirname(__FILE__) . "/externals/jsmin-php/jsmin.php";
function add_apo_slashes($s) { function add_apo_slashes($s) {
@ -29,7 +29,7 @@ function put_file($match) {
return ""; return "";
} }
$return = ""; $return = "";
foreach (glob(dirname(__FILE__) . "/lang/*.inc.php") as $filename) { foreach (glob(dirname(__FILE__) . "/adminer/lang/*.inc.php") as $filename) {
include $filename; include $filename;
foreach ($translations as $key => $val) { foreach ($translations as $key => $val) {
if (!isset($lang_ids[$key])) { 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; include $filename;
$translation_ids = array_flip($lang_ids); $translation_ids = array_flip($lang_ids);
foreach ($translations as $key => $val) { foreach ($translations as $key => $val) {
@ -51,7 +51,7 @@ function put_file($match) {
} }
return "switch (\$LANG) {\n$return}\n"; 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"]) { if ($match[2] != "./include/lang.inc.php" || !$_COOKIE["lang"]) {
$tokens = token_get_all($return); $tokens = token_get_all($return);
return "?>\n$return" . (in_array($tokens[count($tokens) - 1][0], array(T_CLOSE_TAG, T_INLINE_HTML), true) ? "<?php" : ""); return "?>\n$return" . (in_array($tokens[count($tokens) - 1][0], array(T_CLOSE_TAG, T_INLINE_HTML), true) ? "<?php" : "");
@ -155,16 +155,16 @@ function php_shrink($input) {
error_reporting(E_ALL & ~E_NOTICE); error_reporting(E_ALL & ~E_NOTICE);
if ($_SERVER["argc"] > 1) { if ($_SERVER["argc"] > 1) {
$_COOKIE["lang"] = $_SERVER["argv"][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"]])) { 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); 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"; $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_callback('~\\b(include|require) "([^"]*)";~', 'put_file', $file);
$file = preg_replace("~if \\(isset\\(\\\$_SESSION\\[\"coverage.*\n}\n| && !isset\\(\\\$_SESSION\\[\"coverage\"\\]\\)~sU", '', $file); $file = preg_replace("~if \\(isset\\(\\\$_SESSION\\[\"coverage.*\n}\n| && !isset\\(\\\$_SESSION\\[\"coverage\"\\]\\)~sU", '', $file);
if ($_COOKIE["lang"]) { 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"); header("Expires: " . gmdate("D, d M Y H:i:s", time() + 365*24*60*60) . " GMT");
if ($_GET["file"] == "favicon.ico") { if ($_GET["file"] == "favicon.ico") {
header("Content-Type: image/x-icon"); 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") { } elseif ($_GET["file"] == "default.css") {
header("Content-Type: text/css"); header("Content-Type: text/css");
?>' . preg_replace('~\\s*([:;{},])\\s*~', '\\1', file_get_contents(dirname(__FILE__) . "/default.css")) . '<?php ?>' . preg_replace('~\\s*([:;{},])\\s*~', '\\1', file_get_contents(dirname(__FILE__) . "/adminer/default.css")) . '<?php
} elseif ($_GET["file"] == "functions.js") { } elseif ($_GET["file"] == "functions.js") {
header("Content-Type: text/javascript"); header("Content-Type: text/javascript");
?>' . JSMin::minify(file_get_contents(dirname(__FILE__) . "/functions.js")) . '<?php ?>' . JSMin::minify(file_get_contents(dirname(__FILE__) . "/adminer/functions.js")) . '<?php
} else { } else {
header("Content-Type: image/gif"); header("Content-Type: image/gif");
switch ($_GET["file"]) { switch ($_GET["file"]) {
case "arrow.gif": echo base64_decode("' . base64_encode(file_get_contents(dirname(__FILE__) . "/arrow.gif")) . '"); break; case "arrow.gif": echo base64_decode("' . base64_encode(file_get_contents(dirname(__FILE__) . "/adminer/arrow.gif")) . '"); break;
case "up.gif": echo base64_decode("' . base64_encode(file_get_contents(dirname(__FILE__) . "/up.gif")) . '"); break; case "up.gif": echo base64_decode("' . base64_encode(file_get_contents(dirname(__FILE__) . "/adminer/up.gif")) . '"); break;
case "down.gif": echo base64_decode("' . base64_encode(file_get_contents(dirname(__FILE__) . "/down.gif")) . '"); break; case "down.gif": echo base64_decode("' . base64_encode(file_get_contents(dirname(__FILE__) . "/adminer/down.gif")) . '"); break;
case "plus.gif": echo base64_decode("' . base64_encode(file_get_contents(dirname(__FILE__) . "/plus.gif")) . '"); break; case "plus.gif": echo base64_decode("' . base64_encode(file_get_contents(dirname(__FILE__) . "/adminer/plus.gif")) . '"); break;
case "cross.gif": echo base64_decode("' . base64_encode(file_get_contents(dirname(__FILE__) . "/cross.gif")) . '"); break; case "cross.gif": echo base64_decode("' . base64_encode(file_get_contents(dirname(__FILE__) . "/adminer/cross.gif")) . '"); break;
} }
} }
exit; exit;
}', $file); }', $file);
$file = str_replace("externals/jush/", "http://jush.sourceforge.net/", $file); $file = str_replace("../externals/jush/", "http://jush.sourceforge.net/", $file);
$file = preg_replace("~<\\?php\\s*\\?>\n?|\\?>\n?<\\?php~", '', $file); $file = preg_replace("~<\\?php\\s*\\?>\n?|\\?>\n?<\\?php~", '', $file);
$file = php_shrink($file); $file = php_shrink($file);
fwrite(fopen($filename, "w"), $file); fwrite(fopen($filename, "w"), $file);

View file

@ -26,12 +26,12 @@ if (!extension_loaded("xdebug")) {
if ($_GET["start"]) { if ($_GET["start"]) {
xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE); xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);
$_SESSION["coverage"] = array(); $_SESSION["coverage"] = array();
include "./index.php"; include "./adminer/index.php";
header("Location: ."); header("Location: .");
exit; exit;
} }
if ($_GET["filename"]) { if (preg_match('~^(include/)?[-_.a-z0-9]+$~i', $_GET["filename"])) {
$filename = basename($_GET["filename"]); $filename = "adminer/$_GET[filename]";
$cov = $_SESSION["coverage"][realpath($filename)]; $cov = $_SESSION["coverage"][realpath($filename)];
$file = explode("<br />", highlight_file($filename, true)); $file = explode("<br />", highlight_file($filename, true));
unset($prev_color); unset($prev_color);
@ -61,17 +61,16 @@ if ($_GET["filename"]) {
} }
} else { } else {
echo "<table border='0' cellspacing='0' cellpadding='1'>\n"; echo "<table border='0' cellspacing='0' cellpadding='1'>\n";
foreach (glob("*.php") as $filename) { foreach (array_merge(glob("adminer/*.php"), glob("adminer/include/*.php")) as $filename) {
if ($filename{0} != "_") { $cov = $_SESSION["coverage"][realpath($filename)];
$cov = $_SESSION["coverage"][realpath($filename)]; $filename = substr($filename, 8);
$ratio = 0; $ratio = 0;
if (isset($cov)) { if (isset($cov)) {
$values = array_count_values($cov); $values = array_count_values($cov);
$ratio = round(100 - 100 * $values[-1] / count($cov)); $ratio = round(100 - 100 * $values[-1] / count($cov));
}
echo "<tr><td align='right' style='background-color: " . ($ratio < 50 ? "Red" : ($ratio < 75 ? "#FFEA20" : "#A7FC9D")) . ";'>$ratio%</td><td><a href='_coverage.php?filename=$filename'>$filename</a></td></tr>\n";
} }
echo "<tr><td align='right' style='background-color: " . ($ratio < 50 ? "Red" : ($ratio < 75 ? "#FFEA20" : "#A7FC9D")) . ";'>$ratio%</td><td><a href='coverage.php?filename=$filename'>$filename</a></td></tr>\n";
} }
echo "</table>\n"; echo "</table>\n";
echo "<p><a href='_coverage.php?start=1'>Start new coverage</a> (requires <a href='http://www.xdebug.org'>Xdebug</a>)</p>\n"; echo "<p><a href='coverage.php?start=1'>Start new coverage</a> (requires <a href='http://www.xdebug.org'>Xdebug</a>)</p>\n";
} }

View file

@ -2,22 +2,22 @@
error_reporting(E_ALL & ~E_NOTICE); error_reporting(E_ALL & ~E_NOTICE);
if ($_SERVER["argc"] > 1) { if ($_SERVER["argc"] > 1) {
$_COOKIE["lang"] = $_SERVER["argv"][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"]])) { 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); exit(1);
} }
} }
$messages_all = array(); $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); $file = file_get_contents($filename);
if (preg_match_all("~lang\\(('(?:[^\\\\']+|\\\\.)*')([),])~", $file, $matches)) { if (preg_match_all("~lang\\(('(?:[^\\\\']+|\\\\.)*')([),])~", $file, $matches)) {
$messages_all += array_combine($matches[1], $matches[2]); $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; $messages = $messages_all;
preg_match_all("~^(\\s*)(?:// )?(('(?:[^\\\\']+|\\\\.)*') => .*[^,\n]),?~m", file_get_contents($filename), $matches, PREG_SET_ORDER); preg_match_all("~^(\\s*)(?:// )?(('(?:[^\\\\']+|\\\\.)*') => .*[^,\n]),?~m", file_get_contents($filename), $matches, PREG_SET_ORDER);
$s = ""; $s = "";

View file

@ -13,12 +13,12 @@
</thead><tbody> </thead><tbody>
<tr> <tr>
<td>open</td> <td>open</td>
<td>/adminer/_coverage.php?start=1</td> <td>/adminer/coverage.php?start=1</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>open</td> <td>open</td>
<td>/adminer/?lang=en&amp;username=</td> <td>/adminer/adminer/?lang=en&amp;username=</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>

View file

@ -13,7 +13,7 @@
</thead><tbody> </thead><tbody>
<tr> <tr>
<td>open</td> <td>open</td>
<td>/adminer/</td> <td>/adminer/adminer/</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>

View file

@ -13,7 +13,7 @@
</thead><tbody> </thead><tbody>
<tr> <tr>
<td>open</td> <td>open</td>
<td>/adminer/?db=selenium&amp;select=albums</td> <td>/adminer/adminer/?db=selenium&amp;select=albums</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>

View file

@ -13,7 +13,7 @@
</thead><tbody> </thead><tbody>
<tr> <tr>
<td>open</td> <td>open</td>
<td>/adminer/?db=selenium&amp;select=albums</td> <td>/adminer/adminer/?db=selenium&amp;select=albums</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>

View file

@ -13,7 +13,7 @@
</thead><tbody> </thead><tbody>
<tr> <tr>
<td>open</td> <td>open</td>
<td>/adminer/?db=selenium&amp;edit=albums&amp;where%5Bid%5D=2</td> <td>/adminer/adminer/?db=selenium&amp;edit=albums&amp;where%5Bid%5D=2</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>

View file

@ -13,7 +13,7 @@
</thead><tbody> </thead><tbody>
<tr> <tr>
<td>open</td> <td>open</td>
<td>/adminer/?db=selenium&amp;edit=albums&amp;where%5Bid%5D=2</td> <td>/adminer/adminer/?db=selenium&amp;edit=albums&amp;where%5Bid%5D=2</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>

View file

@ -13,7 +13,7 @@
</thead><tbody> </thead><tbody>
<tr> <tr>
<td>open</td> <td>open</td>
<td>/adminer/?db=selenium&amp;select=albums</td> <td>/adminer/adminer/?db=selenium&amp;select=albums</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>

View file

@ -13,7 +13,7 @@
</thead><tbody> </thead><tbody>
<tr> <tr>
<td>open</td> <td>open</td>
<td>/adminer/?user=</td> <td>/adminer/adminer/?user=</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>

View file

@ -13,7 +13,7 @@
</thead><tbody> </thead><tbody>
<tr> <tr>
<td>open</td> <td>open</td>
<td>/adminer/?processlist=</td> <td>/adminer/adminer/?processlist=</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>

View file

@ -13,7 +13,7 @@
</thead><tbody> </thead><tbody>
<tr> <tr>
<td>open</td> <td>open</td>
<td>/adminer/?db=selenium&amp;dump=</td> <td>/adminer/adminer/?db=selenium&amp;dump=</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>

View file

@ -13,7 +13,7 @@
</thead><tbody> </thead><tbody>
<tr> <tr>
<td>open</td> <td>open</td>
<td>/adminer/?db=selenium&amp;event=</td> <td>/adminer/adminer/?db=selenium&amp;event=</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>

View file

@ -13,7 +13,7 @@
</thead><tbody> </thead><tbody>
<tr> <tr>
<td>open</td> <td>open</td>
<td>/adminer/?db=selenium&amp;procedure=</td> <td>/adminer/adminer/?db=selenium&amp;procedure=</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>

View file

@ -13,7 +13,7 @@
</thead><tbody> </thead><tbody>
<tr> <tr>
<td>open</td> <td>open</td>
<td>/adminer/?db=selenium</td> <td>/adminer/adminer/?db=selenium</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>

View file

@ -13,7 +13,7 @@
</thead><tbody> </thead><tbody>
<tr> <tr>
<td>open</td> <td>open</td>
<td>/adminer/?db=selenium&amp;table=interprets</td> <td>/adminer/adminer/?db=selenium&amp;table=interprets</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>

View file

@ -13,7 +13,7 @@
</thead><tbody> </thead><tbody>
<tr> <tr>
<td>open</td> <td>open</td>
<td>/adminer/?db=selenium&amp;table=interprets</td> <td>/adminer/adminer/?db=selenium&amp;table=interprets</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>

View file

@ -13,7 +13,7 @@
</thead><tbody> </thead><tbody>
<tr> <tr>
<td>open</td> <td>open</td>
<td>/adminer/?db=selenium&amp;table=interprets&amp;lang=en</td> <td>/adminer/adminer/?db=selenium&amp;table=interprets&amp;lang=en</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>

View file

@ -13,7 +13,7 @@
</thead><tbody> </thead><tbody>
<tr> <tr>
<td>open</td> <td>open</td>
<td>/adminer/?db=selenium&amp;table=albums</td> <td>/adminer/adminer/?db=selenium&amp;table=albums</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>

View file

@ -13,7 +13,7 @@
</thead><tbody> </thead><tbody>
<tr> <tr>
<td>open</td> <td>open</td>
<td>/adminer/?db=selenium&amp;table=interprets</td> <td>/adminer/adminer/?db=selenium&amp;table=interprets</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>

View file

@ -13,7 +13,7 @@
</thead><tbody> </thead><tbody>
<tr> <tr>
<td>open</td> <td>open</td>
<td>/adminer/?db=selenium&amp;trigger=albums</td> <td>/adminer/adminer/?db=selenium&amp;trigger=albums</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>

View file

@ -13,7 +13,7 @@
</thead><tbody> </thead><tbody>
<tr> <tr>
<td>open</td> <td>open</td>
<td>/adminer/?db=selenium&amp;createv=</td> <td>/adminer/adminer/?db=selenium&amp;createv=</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>

View file

@ -13,7 +13,7 @@
</thead><tbody> </thead><tbody>
<tr> <tr>
<td>open</td> <td>open</td>
<td>/adminer/?db=selenium&amp;edit=interprets</td> <td>/adminer/adminer/?db=selenium&amp;edit=interprets</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
@ -33,7 +33,7 @@
</tr> </tr>
<tr> <tr>
<td>open</td> <td>open</td>
<td>/adminer/?db=selenium&amp;edit=albums</td> <td>/adminer/adminer/?db=selenium&amp;edit=albums</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>

View file

@ -13,7 +13,7 @@
</thead><tbody> </thead><tbody>
<tr> <tr>
<td>open</td> <td>open</td>
<td>/adminer/</td> <td>/adminer/adminer/</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
@ -38,7 +38,7 @@
</tr> </tr>
<tr> <tr>
<td>open</td> <td>open</td>
<td>/adminer/_coverage.php</td> <td>/adminer/coverage.php</td>
<td></td> <td></td>
</tr> </tr>