Пример #1
0
 /**
  * Instances of this class should be created usign the 'getInstance' of the 'kFileTransferMgr' class
  * Supported options:
  * - useCmd - indicates that sftp CLI should be used for GET and PUT actions.
  * - cmdPutMinimumFileSize - CLI will be used for PUT aactions on files larger than this option.
  * 
  * @param array $options
  */
 protected function __construct(array $options = null)
 {
     if (!function_exists('ssh2_connect')) {
         throw new kFileTransferMgrException("SSH2 extension is not installed.", kFileTransferMgrException::extensionMissing);
     }
     if (!function_exists('ssh2_sftp')) {
         throw new kFileTransferMgrException("SSH2 SFTP extension is not installed.", kFileTransferMgrException::extensionMissing);
     }
     parent::__construct($options);
     $this->tmpDir = sys_get_temp_dir();
     if ($options) {
         if (isset($options['useCmd'])) {
             $this->useCmd = $options['useCmd'];
         }
         if (isset($options['sftpCmd'])) {
             $this->sftpCmd = $options['sftpCmd'];
         }
         if (isset($options['sshpassCmd'])) {
             $this->sshpassCmd = $options['sshpassCmd'];
         }
         if (isset($options['useCmdChmod'])) {
             $this->useCmdChmod = $options['useCmdChmod'];
         }
         if (isset($options['cmdPutMinimumFileSize'])) {
             $this->cmdPutMinimumFileSize = $options['cmdPutMinimumFileSize'];
         }
         if (isset($options['tmpDir'])) {
             $this->tmpDir = $options['tmpDir'];
         }
     }
 }
Пример #2
0
 protected function __construct(array $options = null)
 {
     if (!function_exists('ssh2_connect')) {
         throw new kFileTransferMgrException("SSH2 extension is not installed.", kFileTransferMgrException::extensionMissing);
     }
     parent::__construct($options);
 }
Пример #3
0
 protected function __construct(array $options = null)
 {
     parent::__construct($options);
     if ($options) {
         if (isset($options['createLink'])) {
             $this->createLink = $options['createLink'];
         }
     }
 }
Пример #4
0
 protected function __construct(array $options = null)
 {
     parent::__construct($options);
     if (!$options || !isset($options['asperaTempFolder'])) {
         throw new kFileTransferMgrException("Option attribute [asperaTempFolder] is missing.", kFileTransferMgrException::attributeMissing);
     }
     $this->asperaTempFolder = $options['asperaTempFolder'];
     if (isset($options['ascpCmd'])) {
         $this->ascpCmd = $options['ascpCmd'];
     }
 }
Пример #5
0
 protected function __construct(array $options = null)
 {
     parent::__construct($options);
     if ($options && isset($options['filesAcl'])) {
         $this->filesAcl = $options['filesAcl'];
     }
     if ($options && isset($options['s3Region'])) {
         $this->s3Region = $options['s3Region'];
     }
     // do nothing
     $this->connection_id = 1;
     //SIMULATING!
 }
Пример #6
0
 protected function __construct(array $options = null)
 {
     parent::__construct($options);
     if ($options) {
         if (isset($options['userAgent'])) {
             $this->userAgent = $options['userAgent'];
         }
         if (isset($options['fieldName'])) {
             $this->fieldName = $options['fieldName'];
         }
         if (isset($options['fileName'])) {
             $this->fileName = $options['fileName'];
         }
     }
 }
Пример #7
0
 protected function __construct(array $options = null)
 {
     if (!function_exists('ftp_connect')) {
         throw new kFileTransferMgrException("FTP extension is not installed.", kFileTransferMgrException::extensionMissing);
     }
     parent::__construct($options);
     if ($options) {
         if (isset($options['mode'])) {
             $this->mode = $options['mode'];
         }
         if (isset($options['passiveMode'])) {
             $this->passiveMode = $options['passiveMode'];
         }
     }
     if ($this->mode != FTP_ASCII) {
         $this->mode = FTP_BINARY;
     }
 }