refactor MonitoringServer class for improved code structure

This commit is contained in:
jhartworks
2025-09-30 09:57:17 +02:00
parent 49f8cbfa71
commit 2790a47a4c
+7 -7
View File
@@ -710,13 +710,13 @@ public function sendFtp() {
$ftp = ftp_ssl_connect($ftp_server); $ftp = ftp_ssl_connect($ftp_server);
if (!$ftp) { if (!$ftp) {
IPS_LogMessage("FTP", "FTP-Verbindung fehlgeschlagen."); //IPS_LogMessage("FTP", "FTP-Verbindung fehlgeschlagen.");
return; return;
} }
$login_result = ftp_login($ftp, $ftp_user_name, $ftp_user_pass); $login_result = ftp_login($ftp, $ftp_user_name, $ftp_user_pass);
if (!$login_result) { if (!$login_result) {
IPS_LogMessage("FTP", "FTP-Login fehlgeschlagen."); //IPS_LogMessage("FTP", "FTP-Login fehlgeschlagen.");
ftp_close($ftp); ftp_close($ftp);
return; return;
} }
@@ -766,16 +766,16 @@ private function generateAndUploadCsv($catId, $ftp, $remotePath, $localPath) {
fclose($file); fclose($file);
// Logging // Logging
IPS_LogMessage("FTP", "Lokaler Pfad: " . $localPath); //IPS_LogMessage("FTP", "Lokaler Pfad: " . $localPath);
IPS_LogMessage("FTP", "Remote Pfad: " . $remotePath); //IPS_LogMessage("FTP", "Remote Pfad: " . $remotePath);
IPS_LogMessage("FTP", "Dateigröße lokal: " . filesize($localPath)); //IPS_LogMessage("FTP", "Dateigröße lokal: " . filesize($localPath));
// Upload // Upload
$putstate = ftp_put($ftp, $remotePath, $localPath, FTP_BINARY); $putstate = ftp_put($ftp, $remotePath, $localPath, FTP_BINARY);
if ($putstate) { if ($putstate) {
IPS_LogMessage("FTP", "Upload OK: $remotePath"); //IPS_LogMessage("FTP", "Upload OK: $remotePath");
} else { } else {
IPS_LogMessage("FTP", "Upload FEHLGESCHLAGEN: $remotePath"); //IPS_LogMessage("FTP", "Upload FEHLGESCHLAGEN: $remotePath");
} }
} }