public function getModifiedTimestamp(string $remoteFile, int $attempts = 1, int $sleepBetweenAttempts = 5)
    {
        $timestamp = @ftp_mdtm($this->ftp, $remoteFile);

        if ($timestamp < 0) {
            if (--$attempts > 0) {
                sleep($sleepBetweenAttempts);

                return $this->getModifiedTimestamp($remoteFile, $attempts, $sleepBetweenAttempts);
            }

            throw new Exception("Cannot get file modification timestamp");
        }

        return $timestamp;
    }
public function getModifiedTimestamp(string $remoteFile, int $attempts = 1, int $sleepBetweenAttempts = 5)
    {
        $timestamp = @ftp_mdtm($this->ftp, $remoteFile);

        if ($timestamp < 0) {
            if (--$attempts > 0) {
                sleep($sleepBetweenAttempts);

                return $this->getModifiedTimestamp($remoteFile, $attempts, $sleepBetweenAttempts);
            }

            throw new Exception("Cannot get file modification timestamp");
        }

        return $timestamp;
    }
public function getModifiedTimestamp ( string $ remoteFile , int $ attempts = 1 , int $ sleepBetweenAttempts = 5 ) { $ timestamp = @ ftp_mdtm ( $ this -> ftp , $ remoteFile ) ; if ( $ timestamp < 0 ) { if ( -- $ attempts > 0 ) { sleep ( $ sleepBetweenAttempts ) ; return $ this -> getModifiedTimestamp ( $ remoteFile , $ attempts , $ sleepBetweenAttempts ) ; } throw new Exception ( "Cannot get file modification timestamp" ) ; } return $ timestamp ; }
Get timestamp of last modification of file on ftp-server.

@param string $remoteFile           Remote file path.
@param int    $attempts             [optional] Number of retries in case of error.
@param int    $sleepBetweenAttempts [optional] Sleep time in seconds between attempts.

@return int Timestamp.
@throws Exception
Get timestamp of last modification of file on ftp - server .