diff --git a/includes/classes/database.php b/includes/classes/database.php index 4ee194ce..4089c463 100644 --- a/includes/classes/database.php +++ b/includes/classes/database.php @@ -23,11 +23,7 @@ class Database $dsn = 'mysql:host=' . $this->host . ';dbname=' . $this->database . ';port=3306;charset=utf8'; $options = array(); - try { - $this->pdo = new \PDO($dsn, $this->user, $this->password, $options); - } catch (\PDOException $PDOE) { - throw new \PDOException($PDOE->getMessage(), (int)$PDOE->getCode()); - } + $this->pdo = new \PDO($dsn, $this->user, $this->password, $options); } public function query(string $query) diff --git a/includes/classes/options.php b/includes/classes/options.php index 0a551af6..f5579ade 100644 --- a/includes/classes/options.php +++ b/includes/classes/options.php @@ -12,6 +12,8 @@ namespace wishthis; class Options { + public bool $updateAvailable = false; + public function __construct(private Database $database) { } @@ -23,6 +25,6 @@ class Options WHERE `key` = "' . $key . '";' )->fetch(); - return $option['value']; + return $option['value'] ?? ''; } } diff --git a/includes/classes/page.php b/includes/classes/page.php index c3576b9e..182805c5 100644 --- a/includes/classes/page.php +++ b/includes/classes/page.php @@ -146,6 +146,12 @@ class Page ?> + + updateAvailable) { ?> + + Update + +
The requested URL was not found on this server.
+