src/fwidm/dwdHourlyCrawler/hourly/DWDStationsController.php
public static function getStationFile($stationFtpPath, $outputPath)
    {
        $ftpConfig = DWDConfiguration::getFTPConfiguration();

        $ftp_connection = ftp_connect($ftpConfig->url);

        $login_result = ftp_login($ftp_connection, $ftpConfig->userName, $ftpConfig->userPassword);
        if ($login_result && ftp_size($ftp_connection, $stationFtpPath) > -1) {
            $result = ftp_get($ftp_connection, $outputPath, $stationFtpPath, FTP_BINARY);
//            DWDUtil::log(self::class, "out=" . $outputPath);
//            DWDUtil::log(self::class, "ftp=" . $stationFtpPath);
            ftp_close($ftp_connection);

            if (!isset($result)) {
                throw new DWDLibException("Could not retrieve data from ftp location: " . $stationFtpPath);
            }
        }

    }
public static function getStationFile($stationFtpPath, $outputPath)
    {
        $ftpConfig = DWDConfiguration::getFTPConfiguration();

        $ftp_connection = ftp_connect($ftpConfig->url);

        $login_result = ftp_login($ftp_connection, $ftpConfig->userName, $ftpConfig->userPassword);
        if ($login_result && ftp_size($ftp_connection, $stationFtpPath) > -1) {
            $result = ftp_get($ftp_connection, $outputPath, $stationFtpPath, FTP_BINARY);
//            DWDUtil::log(self::class, "out=" . $outputPath);
//            DWDUtil::log(self::class, "ftp=" . $stationFtpPath);
            ftp_close($ftp_connection);

            if (!isset($result)) {
                throw new DWDLibException("Could not retrieve data from ftp location: " . $stationFtpPath);
            }
        }

    }
public static function getStationFile ( $ stationFtpPath , $ outputPath ) { $ ftpConfig = DWDConfiguration :: getFTPConfiguration ( ) ; $ ftp_connection = ftp_connect ( $ ftpConfig -> url ) ; $ login_result = ftp_login ( $ ftp_connection , $ ftpConfig -> userName , $ ftpConfig -> userPassword ) ; if ( $ login_result && ftp_size ( $ ftp_connection , $ stationFtpPath ) > - 1 ) { $ result = ftp_get ( $ ftp_connection , $ outputPath , $ stationFtpPath , FTP_BINARY ) ; //            DWDUtil::log(self::class, "out=" . $outputPath); //            DWDUtil::log(self::class, "ftp=" . $stationFtpPath); ftp_close ( $ ftp_connection ) ; if ( ! isset ( $ result ) ) { throw new DWDLibException ( "Could not retrieve data from ftp location: " . $ stationFtpPath ) ; } } }
Tries to download the station file from the given path.
@param $stationFtpPath - path/to/the/station_file.txt
@param $outputPath - location of the resulting file
@throws DWDLibException - if result is empty
Tries to download the station file from the given path .