Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6cff15964f | |||
| be9baee799 | |||
| c94f166153 | |||
| 972c2e6520 | |||
| 428e383c91 | |||
| 8cf8a26821 | |||
| d4f1efe96a | |||
| 5e5fb356c7 |
+1
-1
@@ -82,7 +82,7 @@ body {
|
||||
.nav-fix-scroll {
|
||||
overflow: auto;
|
||||
max-height: 85vh;
|
||||
align-items: unset;
|
||||
align-items: flex-start;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1605
-1416
File diff suppressed because it is too large
Load Diff
@@ -11,6 +11,7 @@ if (!file_exists(__PRIVATE_DIR . "/vendor/autoload.php")) {
|
||||
'<h3>In 2.0, the installation procedure is a little different. Go to the ' .
|
||||
'<a href="https://github.com/Wruczek/ts-website/wiki/%5BEN%5D-Website-Installation" target="_blank">wiki</a> ' .
|
||||
'and follow the installation tutorial.</h3>' .
|
||||
'<h2 style="color: red">Please do not contact us for help with that error. Read the wiki.</h2>' .
|
||||
'Or, if you know what you are doing, run <code>composer update</code> in the ' .
|
||||
'<code>' . realpath(__BASE_DIR) . '</code> directory'
|
||||
);
|
||||
|
||||
@@ -43,7 +43,15 @@ if (!empty($_POST)) {
|
||||
// try to connect only if dbconfig is defined
|
||||
if (isset($dbconfig)) {
|
||||
try {
|
||||
$db = new Medoo($dbconfig);
|
||||
$errmodeException = [
|
||||
"option" => [
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
]
|
||||
];
|
||||
|
||||
// Enable DB exceptions instead of silent fails, only for the Medoo
|
||||
// object and not for the dbConfig, we dont want to get it saved
|
||||
$db = new Medoo($dbconfig + $errmodeException);
|
||||
|
||||
$sqlfiles = [];
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ class ServerIconCache {
|
||||
}
|
||||
|
||||
public static function syncIcons() {
|
||||
if (!file_exists(self::$iconsCacheDir) && !mkdir(self::$iconsCacheDir, true)) {
|
||||
if (!file_exists(self::$iconsCacheDir) && !mkdir(self::$iconsCacheDir)) {
|
||||
throw new \Exception("Cannot create icons cache directory at " . self::$iconsCacheDir);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Wruczek\TSWebsite\Utils;
|
||||
use Medoo\Medoo;
|
||||
use PDO;
|
||||
use Wruczek\TSWebsite\Config;
|
||||
|
||||
/**
|
||||
@@ -28,7 +29,14 @@ class DatabaseUtils {
|
||||
public function getDb() {
|
||||
if($this->db === null) {
|
||||
try {
|
||||
$db = new Medoo($this->configUtils->getDatabaseConfig());
|
||||
$config = $this->configUtils->getDatabaseConfig();
|
||||
|
||||
// Enable DB exceptions instead of silent fails
|
||||
$config["option"] = [
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
];
|
||||
|
||||
$db = new Medoo($config);
|
||||
} catch (\Exception $e) {
|
||||
TemplateUtils::i()->renderErrorTemplate("DB error", "Connection to database failed", $e->getMessage());
|
||||
exit;
|
||||
|
||||
Reference in New Issue
Block a user