/**
* Send command to the FTP server and validate an expected response code
*
* @param string $cmd Command to send to the FTP server
* @param mixed $expectedResponse Integer response code or array of integer response codes
*
* @return boolean True if command executed successfully
*
* @since 1.5
*/
protected function _putCmd($cmd, $expectedResponse)
{
// Make sure we have a connection to the server
if (!\is_resource($this->_conn)) {
Log::add(Text::sprintf('JLIB_CLIENT_ERROR_FTP_PUTCMD_UNCONNECTED', __METHOD__), Log::WARNING, 'jerror');
return false;
}
// Send the command to the server
if (!fwrite($this->_conn, $cmd . "\r\n")) {
Log::add(Text::sprintf('DDD', Text::sprintf('JLIB_CLIENT_ERROR_FTP_PUTCMD_SEND', __METHOD__, $cmd)), Log::WARNING, 'jerror');
}
return $this->_verifyResponse($expectedResponse);
}