diff -u b/drush/Provision/Service/remote/import/hostmaster.php b/drush/Provision/Service/remote/import/hostmaster.php --- b/drush/Provision/Service/remote/import/hostmaster.php +++ b/drush/Provision/Service/remote/import/hostmaster.php @@ -24,9 +24,9 @@ */ /** - * Initialize this class, including option handling. + * {@inheritdoc} */ - function init_server() { + public function init_server() { parent::init_server(); $this->server->setProperty('remote_user', ''); } @@ -132,14 +132,19 @@ 'root' => NULL, 'uri' => NULL, ); + $config = array('remote-host' => $this->server->remote_host); if (!empty($this->server->remote_user)) { - $config['remote-user'] = $this->server->remote_user; + $config['remote-user'] = $this->server->remote_user; } else { $config['remote-user'] = $this->server->script_user; } - return drush_invoke_process($config, $command, $data, array(), array('method' => 'POST', 'integrate' => TRUE)); + + return drush_invoke_process($config, $command, $data, array(), array( + 'method' => 'POST', + 'integrate' => TRUE, + )); } function fetch_site($site) { @@ -160,11 +165,14 @@ $options = array( 'omit-dir-times' => TRUE, ); + $user = $this->server->script_user; if (!empty($this->server->remote_user)) { $user = $this->server->remote_user; } - if (drush_core_call_rsync(escapeshellarg($user . '@' . $this->server->remote_host . ':/') . $path, $dest, $options, TRUE, FALSE)) { + + $user_and_host = escapeshellarg($user . '@' . $this->server->remote_host . ':/'); + if (drush_core_call_rsync($user_and_host . $path, $dest, $options, TRUE, FALSE)) { drush_log(dt('@path has been fetched from remote server @remote_host.', array( '@path' => $path, '@remote_host' => $this->server->remote_host)) diff -u b/hosting_remote_import.service.inc b/hosting_remote_import.service.inc --- b/hosting_remote_import.service.inc +++ b/hosting_remote_import.service.inc @@ -26,33 +26,48 @@ */ public $has_port = FALSE; - /** * The name displayed to users when creating or editing a server. + * + * @var name */ public $name = 'Remote hostmaster'; - - function load() { + /** + * {@inheritdoc} + */ + public function load() { parent::load(); $this->remote_user = variable_get('hosting_user_remote_server_' . $this->server->nid, ''); } - function insert() { + /** + * {@inheritdoc} + */ + public function insert() { parent::insert(); variable_set('hosting_user_remote_server_' . $this->server->nid, $this->remote_user); } - function update() { + /** + * {@inheritdoc} + */ + public function update() { parent::update(); variable_set('hosting_user_remote_server_' . $this->server->nid, $this->remote_user); } - function delete() { + /** + * {@inheritdoc} + */ + public function delete() { parent::delete(); variable_del('hosting_user_remote_server_' . $this->server->nid); } + /** + * {@inheritdoc} + */ public function form(&$form) { parent::form($form); $form['remote_user'] = array( @@ -61,11 +76,14 @@ '#description' => t('The remote ssh user.'), '#default_value' => (isset($this->remote_user)) ? $this->remote_user : '', '#size' => 20, - '#maxlength' => 255 + '#maxlength' => 255, ); } - function view(&$render) { + /** + * {@inheritdoc} + */ + public function view(&$render) { parent::view($render); $render['remote_user'] = array( '#type' => 'item', @@ -73,12 +91,13 @@ '#markup' => filter_xss($this->remote_user), ); } - + /** + * {@inheritdoc} + */ public function context_options($task_type, $ref_type, &$task) { parent::context_options($task_type, $ref_type, $task); $task->context_options['remote_user'] = variable_get('hosting_user_remote_server_' . $this->server->nid, ''); - drush_log("context_options " . print_r($task,1)); } }