Back to FtpClient class

Method reinit

public bool
reinit
()
Method to reinitialise the server, ie. need to login again
Returns
  • bool True if successful
Since
  • 1.5
Class: FtpClient
Project: Joomla

Method reinit - Source code

/**
 * Method to reinitialise the server, ie. need to login again
 *
 * NOTE: This command not available on all servers
 *
 * @return  boolean  True if successful
 *
 * @since   1.5
 */
public function reinit()
{
    // If native FTP support is enabled let's use it...
    if (FTP_NATIVE) {
        if (@ftp_site($this->_conn, 'REIN') === false) {
            Log::add(Text::sprintf('JLIB_CLIENT_ERROR_FTP_BAD_RESPONSE', __METHOD__), Log::WARNING, 'jerror');
            return false;
        }
        return true;
    }
    // Send reinitialise command to the server
    if (!$this->_putCmd('REIN', 220)) {
        Log::add(Text::sprintf('JLIB_CLIENT_ERROR_FTP_NOT_EXPECTED_RESPONSE', __METHOD__, $this->_response, 220), Log::WARNING, 'jerror');
        return false;
    }
    return true;
}