Skip to content
Snippets Groups Projects

SFTP support

Open Borut Piletic requested to merge sftp into 8.x-1.x
6 files
+ 104
48
Compare changes
  • Side-by-side
  • Inline
Files
6
@@ -97,6 +97,15 @@ class FTPDirectorySync extends OperationPluginBase {
@@ -97,6 +97,15 @@ class FTPDirectorySync extends OperationPluginBase {
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$form = parent::buildConfigurationForm($form, $form_state);
$form = parent::buildConfigurationForm($form, $form_state);
$settings = $this->getEntity()->getPluginSettings();
$settings = $this->getEntity()->getPluginSettings();
 
$form['connection'] = [
 
'#type' => 'radios',
 
'#title' => $this->t('Connection type'),
 
'#default_value' => $settings['connection'] ?? 'ftp',
 
'#options' => [
 
'ftp' => $this->t('FTP'),
 
'sftp' => $this->t('SFTP'),
 
],
 
];
$form['username'] = [
$form['username'] = [
'#type' => 'textfield',
'#type' => 'textfield',
'#title' => $this->t('Username'),
'#title' => $this->t('Username'),
@@ -144,7 +153,7 @@ class FTPDirectorySync extends OperationPluginBase {
@@ -144,7 +153,7 @@ class FTPDirectorySync extends OperationPluginBase {
$form['passive'] = [
$form['passive'] = [
'#type' => 'checkbox',
'#type' => 'checkbox',
'#title' => $this->t('Passive'),
'#title' => $this->t('Passive'),
'#description' => $this->t('Use passive FTP connection.'),
'#description' => $this->t('Use passive FTP connection (not supported by SFTP).'),
'#default_value' => $settings['passive'] ?? 1,
'#default_value' => $settings['passive'] ?? 1,
];
];
$form['log'] = [
$form['log'] = [
Loading