示例#1
0
 /**
  * Get file from sftp location
  * @param string $remoteFile Remote file path
  * @param string $localFile Local file path
  * @return a string containing the contents of $remoteFile if $localFile is left undefined or a boolean false if
  * the operation was unsuccessful.  If $localFile is defined, returns true or false depending on the success of the
  * operation
  * @throws CException if file transfer fails
  */
 public function getFile($remoteFile, $localFile = false)
 {
     if ($return = $this->objSftp->get($remoteFile, $localFile)) {
         return $return;
     } else {
         throw new CException(Yii::t('XSFtp.sftp', 'File get failed.'));
     }
 }