function drupal_ftp_connected in Backup and Migrate 8.2
Same name and namespace in other branches
- 8.3 includes/destinations.ftp.inc \drupal_ftp_connected()
- 6.3 includes/destinations.ftp.inc \drupal_ftp_connected()
- 6.2 includes/destinations.ftp.inc \drupal_ftp_connected()
- 7.3 includes/destinations.ftp.inc \drupal_ftp_connected()
- 7.2 includes/destinations.ftp.inc \drupal_ftp_connected()
The drupal_ftp_connected function This function queries the FTP server with the ftp_systype command to check if the connection is still alive. It returns TRUE on success or FALSE on disconnection.
1 call to drupal_ftp_connected()
- drupal_ftp_connect in includes/
destinations.ftp.inc - The drupal_ftp_connect function This function connects to an FTP server and attempts to change into the directory specified by the fourth parameter, $directory.
File
- includes/
destinations.ftp.inc, line 180 - Functions to handle the FTP backup destination.
Code
function drupal_ftp_connected(&$ftp) {
// Attempt to call the ftp_systype to see if the connect
// to the FTP server is still alive and kicking
if (is_NULL($ftp)) {
$ftp = drupal_ftp_ftp_object();
return FALSE;
}
if (!@ftp_systype($ftp->__conn)) {
// The connection is dead
return FALSE;
}
else {
// The connection is still alive
return TRUE;
}
}