Explorar o código

Update windows update files - still testing

causefx %!s(int64=7) %!d(string=hai) anos
pai
achega
2da705f462
Modificáronse 1 ficheiros con 2 adicións e 8 borrados
  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);
 	set_time_limit(0);
 	$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';
 }