Przeglądaj źródła

Update windows update files - still testing

causefx 7 lat temu
rodzic
commit
2da705f462
1 zmienionych plików z 2 dodań i 8 usunięć
  1. 2 8
      api/functions/organizr-functions.php

+ 2 - 8
api/functions/organizr-functions.php

@@ -2163,14 +2163,8 @@ function windowsUpdate()
 	ini_set('max_execution_time', 0);
 	ini_set('max_execution_time', 0);
 	set_time_limit(0);
 	set_time_limit(0);
 	$logFile = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'scripts' . DIRECTORY_SEPARATOR . 'log.txt';
 	$logFile = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'scripts' . DIRECTORY_SEPARATOR . 'log.txt';
-	if (!file_exists($logFile)) {
-		touch($logFile);
-	} else {
-		@unlink($logFile);
-		touch($logFile);
-	}
-	$windowsScript = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'scripts' . DIRECTORY_SEPARATOR . 'windows-update.bat ' . $branch . ' > log.txt 2>&1';
-	$windowsUpdate = exec($windowsScript);
+	$windowsScript = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'scripts' . DIRECTORY_SEPARATOR . 'windows-update.bat ' . $branch . ' > ' . $logFile . ' 2>&1';
+	$windowsUpdate = shell_exec($windowsScript);
 	return ($windowsUpdate) ? $windowsUpdate : 'Update Complete - check log.txt for output';
 	return ($windowsUpdate) ? $windowsUpdate : 'Update Complete - check log.txt for output';
 }
 }