Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/storage/PhabricatorRepository.php
| Show First 20 Lines • Show All 827 Lines • ▼ Show 20 Lines | public function getSSHCloneURIObject() { | ||||
| $uri = new PhutilURI(PhabricatorEnv::getProductionURI($this->getURI())); | $uri = new PhutilURI(PhabricatorEnv::getProductionURI($this->getURI())); | ||||
| if ($this->isSVN()) { | if ($this->isSVN()) { | ||||
| $uri->setProtocol('svn+ssh'); | $uri->setProtocol('svn+ssh'); | ||||
| } else { | } else { | ||||
| $uri->setProtocol('ssh'); | $uri->setProtocol('ssh'); | ||||
| } | } | ||||
| if ($this->isGit()) { | |||||
| $uri->setPath($uri->getPath().$this->getCloneName().'.git'); | |||||
| } else if ($this->isHg()) { | |||||
| $uri->setPath($uri->getPath().$this->getCloneName().'/'); | |||||
| } | |||||
| $ssh_user = PhabricatorEnv::getEnvConfig('diffusion.ssh-user'); | $ssh_user = PhabricatorEnv::getEnvConfig('diffusion.ssh-user'); | ||||
| if ($ssh_user) { | if ($ssh_user) { | ||||
| $uri->setUser($ssh_user); | $uri->setUser($ssh_user); | ||||
| } | } | ||||
| $uri->setPort(PhabricatorEnv::getEnvConfig('diffusion.ssh-port')); | $uri->setPort(PhabricatorEnv::getEnvConfig('diffusion.ssh-port')); | ||||
| return $uri; | return $uri; | ||||
| Show All 12 Lines | if (!$this->isHosted()) { | ||||
| } | } | ||||
| } | } | ||||
| $serve_http = $this->getServeOverHTTP(); | $serve_http = $this->getServeOverHTTP(); | ||||
| if ($serve_http === self::SERVE_OFF) { | if ($serve_http === self::SERVE_OFF) { | ||||
| return null; | return null; | ||||
| } | } | ||||
| $uri = PhabricatorEnv::getProductionURI($this->getURI()); | $uri = PhabricatorEnv::getProductionURI($this->getURI()); | ||||
| $uri = new PhutilURI($uri); | |||||
| if ($this->isGit()) { | |||||
| $uri->setPath($uri->getPath().$this->getCloneName().'.git'); | |||||
| } else if ($this->isHg()) { | |||||
| $uri->setPath($uri->getPath().$this->getCloneName().'/'); | |||||
| } | |||||
| return $uri; | return $uri; | ||||
| } | } | ||||
| /** | /** | ||||
| * Determine if we should connect to the remote using SSH flags and | * Determine if we should connect to the remote using SSH flags and | ||||
| * credentials. | * credentials. | ||||
| ▲ Show 20 Lines • Show All 410 Lines • Show Last 20 Lines | |||||