diff --git a/includes/classes/options.php b/includes/classes/options.php index 3a20cafe..50fe634b 100644 --- a/includes/classes/options.php +++ b/includes/classes/options.php @@ -14,8 +14,13 @@ class Options { public bool $updateAvailable = false; + public string $version; + public function __construct(private Database $database) { + $this->version = $this->getOption('version') + ? $this->getOption('version') + : '0.1.0'; } public function getOption(string $key): string diff --git a/index.php b/index.php index 1a2ff928..a3136d96 100644 --- a/index.php +++ b/index.php @@ -73,9 +73,7 @@ if (!$options) { * Update */ if ($options) { - $version_current = $options->getOption('version') ?? '0.0.0'; - - if (-1 === version_compare($version_current, $version_new)) { + if (-1 === version_compare($options->version, $version_new)) { $options->updateAvailable = true; } }