protected function generateRemoteAlias($environment, $app, $multiApp = false)
{
if (!$environment->hasLink('ssh') || !$environment->hasLink('public-url')) {
return false;
}
$sshUrl = parse_url($environment->getLink('ssh'));
if (!$sshUrl) {
return false;
}
$sshUser = $sshUrl['user'];
if ($multiApp) {
$sshUser .= '--' . $app->getName();
}
$uri = $environment->getLink('public-url');
if ($multiApp) {
$guess = str_replace('http://', 'http://' . $app->getName() . '---', $uri);
if (in_array($guess, $environment->getRouteUrls())) {
$uri = $guess;
}
}
return ['uri' => $uri, 'remote-host' => $sshUrl['host'], 'remote-user' => $sshUser, 'root' => '/app/' . $app->getDocumentRoot(), $this->getAutoRemoveKey() => true, 'command-specific' => ['site-install' => ['sites-subdir' => 'default']]];
}