/** * Open the connection * @throws Ryaan_Ftp_Exception_ConnectionFailed */ protected function openConnection() { $message = null; $configData = $this->getConfigData(); try { return $this->client->open(['host' => (string) $configData->hostname, 'user' => (string) $configData->username, 'password' => (string) $configData->password, 'timeout' => (int) $configData->timeout]); } catch (Varien_Io_Exception $e) { $message = $e->getMessage(); } throw new Ryaan_Ftp_Exception_ConnectionFailed($message ?: $this->__(static::CONNECTION_FAILED_MESSAGE)); }
/** * @param string $directory * @return bool */ private function _makeDirectory($directory) { if ($this->_ioObject->isWriteable($directory)) { return true; } return $this->_ioObject->mkdir($directory, self::DIRECTORY_PERMISSION, true); }