コード例 #1
0
 public function getPassword()
 {
     return $this->password;
 }
 /**
  * Set the remote file path
  *
  * @return string
コード例 #2
0
  */
 public function getWrittenFiles()
 {
     return $this->writtenFiles;
 }
 /**
  * Set the host of the SFTP Connection
  *
  * @param string $delimiter
  */
 public function setHost($host)
 {
     $this->host = $host;
 }
 /**
  * Get the port of the SFTP Connection
  *
  * @return string
  */
 public function getHost()
 {
     return $this->host;
 }
 /**
  * Set the port of the SFTP Connection
  *
コード例 #3
0
 /**
  * @param array|AbstractProductMedia $media
  * //TODO Add a "/" after the image folder path
  *
  * @return void
  */
 public function sendMedia($media)
 {
     $filePath = null;
     $exportPath = null;
     if (is_array($media)) {
         $filePath = $media['filePath'];
         $exportPath = $media['exportPath'];
     } else {
         if ('' !== $media->getFileName()) {
             $filePath = $media->getFilePath();
         }
         $exportPath = $this->mediaManager->getExportPath($media);
     }
     if (null === $filePath) {
         return;
     }
     $dirname = dirname($exportPath);
     $sftpConnection = new SFTPConnection($this->getHost(), $this->getPort());
     $sftpConnection->login($this->getUsername(), $this->getPassword());
     $sftpConnection->createDirectory($this->getImageFolderPath() . $dirname);
     $sftpConnection->uploadFile($filePath, $this->getImageFolderPath() . $exportPath);
 }