Преглед изворни кода

added check for updates on organizr class

CauseFX пре 3 година
родитељ
комит
32428c2757
3 измењених фајлова са 7 додато и 4 уклоњено
  1. 3 3
      api/classes/organizr.class.php
  2. 3 0
      api/functions/upgrade-functions.php
  3. 1 1
      index.php

+ 3 - 3
api/classes/organizr.class.php

@@ -87,17 +87,17 @@ class Organizr
 	public $timeExecution;
 	public $root;
 	public $paths;
-	public $updating;
+	public $checkForUpdates;
 	public $groupOptions;
 	public $warnings;
 	public $errors;
 	public bool $loggerSetup = false;
 	public \Nekonomokochan\PhpJsonLogger\Logger $logger;
 
-	public function __construct($updating = false)
+	public function __construct($checkForUpdates = false)
 	{
 		// Constructed from Updater?
-		$this->updating = $updating;
+		$this->checkForUpdates = $checkForUpdates;
 		// Set Project Root directory and paths
 		$this->root = dirname(__DIR__, 2);
 		$this->paths = [

+ 3 - 0
api/functions/upgrade-functions.php

@@ -4,6 +4,9 @@ trait UpgradeFunctions
 {
 	public function upgradeCheck()
 	{
+		if (!$this->checkForUpdates) {
+			return true;
+		}
 		if ($this->hasDB()) {
 			$tempLock = $this->config['dbLocation'] . 'DBLOCK.txt';
 			$updateComplete = $this->config['dbLocation'] . 'completed.txt';

+ 1 - 1
index.php

@@ -1,6 +1,6 @@
 <?php
 include 'api/functions.php';
-$Organizr = new Organizr();
+$Organizr = new Organizr(true);
 ?>
 <!DOCTYPE html>
 <html lang="en" ontouchmove>