more niceurlness

This commit is contained in:
Shish 2020-03-27 20:53:21 +00:00
parent 02675609b4
commit a3a129df5f
4 changed files with 6 additions and 18 deletions

View file

@ -63,7 +63,7 @@ class ET extends Extension
"about" => [ "about" => [
'title' => $config->get_string(SetupConfig::TITLE), 'title' => $config->get_string(SetupConfig::TITLE),
'theme' => $config->get_string(SetupConfig::THEME), 'theme' => $config->get_string(SetupConfig::THEME),
'url' => "http://" . $_SERVER["HTTP_HOST"] . get_base_href(), 'url' => make_http(make_link("/")),
], ],
"versions" => [ "versions" => [
'shimmie' => VERSION, 'shimmie' => VERSION,
@ -71,7 +71,7 @@ class ET extends Extension
'php' => phpversion(), 'php' => phpversion(),
'db' => $database->get_driver_name() . " " . $database->get_version(), 'db' => $database->get_driver_name() . " " . $database->get_version(),
'os' => php_uname(), 'os' => php_uname(),
'server' => isset($_SERVER["SERVER_SOFTWARE"]) ? $_SERVER["SERVER_SOFTWARE"] : 'unknown', 'server' => $_SERVER["SERVER_SOFTWARE"] ?? 'unknown',
], ],
"extensions" => [ "extensions" => [
"core" => $core_exts, "core" => $core_exts,

View file

@ -324,16 +324,7 @@ class Setup extends Extension
$themes[$human] = $name; $themes[$human] = $name;
} }
if (isset($_SERVER["HTTP_HOST"])) { $test_url = make_http(str_replace("/index.php", "/nicetest", $_SERVER["SCRIPT_NAME"]));
$host = $_SERVER["HTTP_HOST"];
} else {
$host = $_SERVER["SERVER_NAME"];
if ($_SERVER["SERVER_PORT"] != "80") {
$host .= ":" . $_SERVER["SERVER_PORT"];
}
}
$full = "//" . $host . $_SERVER["SCRIPT_NAME"];
$test_url = str_replace("/index.php", "/nicetest", $full);
$nicescript = "<script type='text/javascript'> $nicescript = "<script type='text/javascript'>
function getHTTPObject() { function getHTTPObject() {
@ -356,7 +347,7 @@ class Setup extends Extension
http_request.open('GET', '$test_url', false); http_request.open('GET', '$test_url', false);
http_request.send(null); http_request.send(null);
if(http_request.status == 200 && http_request.responseText == 'ok') { if(http_request.status === 200 && http_request.responseText === 'ok') {
checkbox.disabled = false; checkbox.disabled = false;
out_span.innerHTML = '(tested ok)'; out_span.innerHTML = '(tested ok)';
} }
@ -375,7 +366,7 @@ class Setup extends Extension
$sb->add_choice_option(SetupConfig::THEME, $themes, "<br>Theme: "); $sb->add_choice_option(SetupConfig::THEME, $themes, "<br>Theme: ");
//$sb->add_multichoice_option("testarray", array("a" => "b", "c" => "d"), "<br>Test Array: "); //$sb->add_multichoice_option("testarray", array("a" => "b", "c" => "d"), "<br>Test Array: ");
$sb->add_bool_option("nice_urls", "<br>Nice URLs: "); $sb->add_bool_option("nice_urls", "<br>Nice URLs: ");
$sb->add_label("<span id='nicetest'>(Javascript inactive, can't test!)</span>$nicescript"); $sb->add_label("<span title='$test_url' id='nicetest'>(Javascript inactive, can't test!)</span>$nicescript");
$event->panel->add_block($sb); $event->panel->add_block($sb);
$sb = new SetupBlock("Remote API Integration"); $sb = new SetupBlock("Remote API Integration");

View file

@ -43,9 +43,6 @@ class StatsDInterface extends Extension
} elseif ($event->page_matches("api")) { } elseif ($event->page_matches("api")) {
$this->_stats("api"); $this->_stats("api");
} else { } else {
#global $_shm_load_start;
#$time = microtime(true) - $_shm_load_start;
#file_put_contents("data/other.log", "{$_SERVER['REQUEST_URI']} $time\n", FILE_APPEND);
$this->_stats("other"); $this->_stats("other");
} }

View file

@ -71,7 +71,7 @@ $_tracer->end();
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
try { try {
// $_tracer->mark(@$_SERVER["REQUEST_URI"]); // $_tracer->mark($_SERVER["REQUEST_URI"] ?? "No Request");
$_tracer->begin( $_tracer->begin(
$_SERVER["REQUEST_URI"] ?? "No Request", $_SERVER["REQUEST_URI"] ?? "No Request",
[ [