From 3a0011b49ac6a8a766af7d1986eb0b12a61ddf93 Mon Sep 17 00:00:00 2001 From: amazuecos Date: Thu, 29 Aug 2024 01:04:10 +0200 Subject: [PATCH] delete FTPService, moved to Libraries --- ci4/app/Services/FTPService.php | 48 --------------------------------- 1 file changed, 48 deletions(-) delete mode 100644 ci4/app/Services/FTPService.php diff --git a/ci4/app/Services/FTPService.php b/ci4/app/Services/FTPService.php deleted file mode 100644 index fa4650cc..00000000 --- a/ci4/app/Services/FTPService.php +++ /dev/null @@ -1,48 +0,0 @@ -ftp = new FtpClient(); - $this->ftp_config = config("FTP"); - $this->host = $this->ftp_config->host; - $this->username = $this->ftp_config->username; - $this->password = $this->ftp_config->password; - $this->base_dir = $this->ftp_config->base_dir; - } - /** - * Upload the content of $filename to the base directory declared in App\Config\FTP.php - * - * @param string $content - * @param string $filename - * @return boolean - */ - public function uploadXML(string $content, string $filename): bool - { - try { - $remotePath = implode("/", [$this->base_dir, $filename]); - $this->ftp->connect(host: $this->host, port: $this->port); - $this->ftp->login(username: $this->username, password: $this->password); - $this->ftp->putFromString($remotePath, $content); - return true; - } catch (\Throwable $th) { - log_message('error',$th->getMessage()); - return false; - } - } -}