ftp_connection::check_response

Description

Checks to see if the desired response code was returned.

Syntax

bool ftp_connection::check_response (int $desired)



Parameter $desired

Expected type: Enumerated Integer
Description: The desired response code (these are the ones used by SMF - see http://www.faqs.org/rfcs/rfc959.html for a complete list)

Possible integer values
Allowed values Description
200 Command ok
220 Service ready for new user
230 User logged in, proceed
250 File command ok, completed
331 Username ok, need password



Return value

Expected type: Boolean
Description: True if the FTP server returned the desired response code, false otherwise


Notes

  • Example: $package_ftp->check_response(200);
  • Assumes there's already a valid connection
  • Doesn't send any commands to the server.
  • Waits 5 seconds for a valid response and then returns
  • Returns true if the response was the desired one, otherwise false
  • Only those response codes used by SMF are documented here
Advertisement: