m7v
8/13/2015 - 12:57 PM

Upload file to remote server. Needs task runner Robo (Download http://robo.li)

Upload file to remote server. Needs task runner Robo (Download http://robo.li)

/**
 * Upload files for import
 */
public function UFI($siteprefix) {
  $dir = "/path/to/dir/{$siteprefix}/";

  $task = $this->taskExecStack();
  $this->taskSshExec('user@host')
    ->remoteDir("/path/to/dir/")
    ->exec("rm -rf {$siteprefix}/*")
    ->run();
  $task->exec("scp -r $dir user@host:/path/to/dir/{$siteprefix}/");
  $task->run();
}