refactor MonitoringServer class for improved code structure
This commit is contained in:
@@ -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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user