-
Notifications
You must be signed in to change notification settings - Fork 787
Expand file tree
/
Copy pathsql_error.php
More file actions
executable file
·39 lines (34 loc) · 1.3 KB
/
sql_error.php
File metadata and controls
executable file
·39 lines (34 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php if (!defined('VERSION_VISIBLE') || Config::ValueOf('disable_installer')) { print _("Install scripts disabled"); exit(0); } ?>
<div class="widget-dash col-xs-12 col-md-8 col-md-offset-2">
<div class="inner install" style="min-height:auto;">
<h4><?php print _("Database connection check"); ?></h4>
<div class="hContent">
<div class="text-muted" style="margin:10px;">
<?php print _("Database connection check result:"); ?>
</div>
<?php
// default error flag
$error = false;
// try to fetch
try {
$Database->getObjectsQuery("settings", "SELECT * FROM settings LIMIT 1;");
} catch (Exception $e) {
$Result->show("danger", _("Error") . ":<hr>" . $e->getMessage(), false);
$error = true;
// text
print '<div class="text-muted" style="margin:10px;margin-bottom:20px;">';
print _("Troubleshooting:");
print '<ul>';
print ' <li>' . _("Make sure all settings in config.php are correct.") . '</li>';
print ' <li>' . _("Make sure database is running and accepting connections.") . '</li>';
print ' <li>' . _("Make sure user defined in config.php has access to database.") . '</li>';
print '</ul>';
print '</div>';
}
if ($error === false) {
$Result->show("success", _("Database connection successful"), false);
}
?>
</div>
</div>
</div>