Minor fixes (#166)

* Minor fixes

* Update CHANGELOG.md
This commit is contained in:
Roman Kelesidis 2023-04-30 15:29:19 +07:00 committed by GitHub
parent 843641c22a
commit 14554da61e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 76 additions and 70 deletions

View File

@ -28,7 +28,7 @@
- Use constants instead of string literals [\#151](https://github.com/torrentpier/torrentpier-lts/pull/151), [\#160](https://github.com/torrentpier/torrentpier-lts/pull/160) ([belomaxorka](https://github.com/belomaxorka))
- Sync language (html dir) with latest sources [\#152](https://github.com/torrentpier/torrentpier-lts/pull/152) ([belomaxorka](https://github.com/belomaxorka))
- Updated UK lang icons [\#155](https://github.com/torrentpier/torrentpier-lts/pull/155) ([belomaxorka](https://github.com/belomaxorka))
- Minor fixes [\#124](https://github.com/torrentpier/torrentpier-lts/pull/124), [\#133](https://github.com/torrentpier/torrentpier-lts/pull/133), [\#135](https://github.com/torrentpier/torrentpier-lts/pull/135), [\#136](https://github.com/torrentpier/torrentpier-lts/pull/136), [\#139](https://github.com/torrentpier/torrentpier-lts/pull/139), [\#142](https://github.com/torrentpier/torrentpier-lts/pull/142), [\#144](https://github.com/torrentpier/torrentpier-lts/pull/144), [\#145](https://github.com/torrentpier/torrentpier-lts/pull/145), [\#148](https://github.com/torrentpier/torrentpier-lts/pull/148), [\#153](https://github.com/torrentpier/torrentpier-lts/pull/153), [\#154](https://github.com/torrentpier/torrentpier-lts/pull/154), [\#156](https://github.com/torrentpier/torrentpier-lts/pull/156), [\#157](https://github.com/torrentpier/torrentpier-lts/pull/157), [\#158](https://github.com/torrentpier/torrentpier-lts/pull/158), [\#159](https://github.com/torrentpier/torrentpier-lts/pull/159), [\#162](https://github.com/torrentpier/torrentpier-lts/pull/162), [\#163](https://github.com/torrentpier/torrentpier-lts/pull/163), [\#164](https://github.com/torrentpier/torrentpier-lts/pull/164), [\#165](https://github.com/torrentpier/torrentpier-lts/pull/165) ([belomaxorka](https://github.com/belomaxorka))
- Minor fixes [\#124](https://github.com/torrentpier/torrentpier-lts/pull/124), [\#133](https://github.com/torrentpier/torrentpier-lts/pull/133), [\#135](https://github.com/torrentpier/torrentpier-lts/pull/135), [\#136](https://github.com/torrentpier/torrentpier-lts/pull/136), [\#139](https://github.com/torrentpier/torrentpier-lts/pull/139), [\#142](https://github.com/torrentpier/torrentpier-lts/pull/142), [\#144](https://github.com/torrentpier/torrentpier-lts/pull/144), [\#145](https://github.com/torrentpier/torrentpier-lts/pull/145), [\#148](https://github.com/torrentpier/torrentpier-lts/pull/148), [\#153](https://github.com/torrentpier/torrentpier-lts/pull/153), [\#154](https://github.com/torrentpier/torrentpier-lts/pull/154), [\#156](https://github.com/torrentpier/torrentpier-lts/pull/156), [\#157](https://github.com/torrentpier/torrentpier-lts/pull/157), [\#158](https://github.com/torrentpier/torrentpier-lts/pull/158), [\#159](https://github.com/torrentpier/torrentpier-lts/pull/159), [\#162](https://github.com/torrentpier/torrentpier-lts/pull/162), [\#163](https://github.com/torrentpier/torrentpier-lts/pull/163), [\#164](https://github.com/torrentpier/torrentpier-lts/pull/164), [\#165](https://github.com/torrentpier/torrentpier-lts/pull/165), [\#166](https://github.com/torrentpier/torrentpier-lts/pull/166) ([belomaxorka](https://github.com/belomaxorka))
## [v2.1.5-2023.03](https://github.com/torrentpier/torrentpier-lts/tree/v2.1.5-2023.03) (2023-04-04)
[Full Changelog](https://github.com/torrentpier/torrentpier-lts/compare/v2.1.5-2023.03...main)

View File

@ -35,6 +35,8 @@ class sql_db
var $DBS = array();
var $engine = 'MySQL';
/**
* Constructor
*/
@ -95,11 +97,12 @@ class sql_db
{
$server = (DBG_USER) ? $this->cfg['dbhost'] : '';
header("HTTP/1.0 503 Service Unavailable");
$con_error = "Could not connect to {$this->engine} server $server";
if (DBG_USER)
{
dbg_log("Could not connect to mysql server $server", "{$server}-DB-connect-FAIL_" . time());
dbg_log($con_error, "{$server}-DB-connect-FAIL_" . time());
}
die("Could not connect to mysql server $server");
die($con_error);
}
register_shutdown_function(array(&$this, 'close'));
@ -952,7 +955,7 @@ class sql_db
<table width="98%" cellpadding="0" cellspacing="0" class="bodyline row2 bCenter" style="border-bottom: 0px;">
<tr>
<th style="height: 22px; cursor: pointer;" align="left">&nbsp;'. $dbg['src'] .'&nbsp; ['. sprintf('%.4f', $dbg['time']) .' s]&nbsp; <i>'. $dbg['info'] .'</i></th>
<th style="height: 22px; cursor: pointer;" align="right" title="Copy to clipboard" onclick="$(\'#'. $htid .'\').CopyToClipboard();">'. "$this->db_server.$this->selected_db" .' :: Query #'. ($this->num_queries+1) .'&nbsp;</th>
<th style="height: 22px; cursor: pointer;" align="right" title="Copy to clipboard" onclick="$(\'#'. $htid .'\').CopyToClipboard();">'. "[$this->engine] $this->db_server.$this->selected_db" .' :: Query #'. ($this->num_queries+1) .'&nbsp;</th>
</tr>
<tr><td colspan="2">'. $this->explain_hold .'</td></tr>
</table>
@ -980,12 +983,15 @@ class sql_db
$this->explain_hold .= '</tr>';
return $html_table;
break;
case 'display':
echo '<a name="explain"></a><div class="med">'. $this->explain_out .'</div>';
break;
default:
die("Invalid {$this->engine} explain mode");
break;
}
}
}

View File

@ -10,7 +10,7 @@ function get_sql_log ()
foreach ($DBS->srv as $srv_name => $db_obj)
{
$log .= !empty($db_obj) ? get_sql_log_html($db_obj, "$srv_name [MySQL]") : '';
$log .= !empty($db_obj) ? get_sql_log_html($db_obj, "database: $srv_name [{$db_obj->engine}]") : '';
}
foreach ($CACHES->obj as $cache_name => $cache_obj)