Esempio n. 1
0
 /**
  * @param Environment $environment
  *
  * @return array|false
  */
 protected function generateRemoteAlias($environment)
 {
     if (!$environment->hasLink('ssh')) {
         return false;
     }
     $sshUrl = parse_url($environment->getLink('ssh'));
     if (!$sshUrl) {
         return false;
     }
     return array('uri' => $environment->getLink('public-url'), 'remote-host' => $sshUrl['host'], 'remote-user' => $sshUrl['user'], 'root' => '/app/public', self::AUTO_REMOVE_KEY => true);
 }
Esempio n. 2
0
 /**
  * @param Environment $environment
  *
  * @return array|false
  */
 protected function generateRemoteAlias($environment)
 {
     if (!$environment->hasLink('ssh')) {
         return false;
     }
     $sshUrl = parse_url($environment->getLink('ssh'));
     if (!$sshUrl) {
         return false;
     }
     return array('uri' => $environment->getLink('public-url'), 'remote-host' => $sshUrl['host'], 'remote-user' => $sshUrl['user'], 'root' => '/app/public', self::AUTO_REMOVE_KEY => true, 'command-specific' => array('site-install' => array('sites-subdir' => 'default')));
 }
Esempio n. 3
0
 /**
  * @param Environment $environment
  * @param LocalApplication $app
  * @param bool $multiApp
  *
  * @return array|false
  */
 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;
         }
     }
     $appConfig = $app->getConfig();
     $documentRoot = '/public';
     if (isset($appConfig['web']['document_root']) && $appConfig['web']['document_root'] !== '/') {
         $documentRoot = $appConfig['web']['document_root'];
     }
     return ['uri' => $uri, 'remote-host' => $sshUrl['host'], 'remote-user' => $sshUser, 'root' => '/app/' . ltrim($documentRoot, '/'), self::AUTO_REMOVE_KEY => true, 'command-specific' => ['site-install' => ['sites-subdir' => 'default']]];
 }
Esempio n. 4
0
 /**
  * @param Environment $environment
  * @param LocalApplication $app
  * @param bool $multiApp
  *
  * @return array|false
  */
 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']]];
 }