Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / diffusion / protocol / DiffusionSubversionCommandEngine.php
blob75b8785a6e982af298cb95a1c34bad38963bc65f
1 <?php
3 final class DiffusionSubversionCommandEngine
4 extends DiffusionCommandEngine {
6 protected function canBuildForRepository(
7 PhabricatorRepository $repository) {
8 return $repository->isSVN();
11 protected function newFormattedCommand($pattern, array $argv) {
12 $flags = array();
13 $args = array();
15 $flags[] = '--non-interactive';
17 if ($this->isAnyHTTPProtocol() || $this->isSVNProtocol()) {
18 $flags[] = '--no-auth-cache';
20 if ($this->isAnyHTTPProtocol()) {
21 $flags[] = '--trust-server-cert';
24 $credential_phid = $this->getCredentialPHID();
25 if ($credential_phid) {
26 $key = PassphrasePasswordKey::loadFromPHID(
27 $credential_phid,
28 PhabricatorUser::getOmnipotentUser());
30 $flags[] = '--username %P';
31 $args[] = $key->getUsernameEnvelope();
33 $flags[] = '--password %P';
34 $args[] = $key->getPasswordEnvelope();
38 $flags = implode(' ', $flags);
39 $pattern = "svn {$flags} {$pattern}";
41 return array($pattern, array_merge($args, $argv));
44 protected function newCustomEnvironment() {
45 $env = array();
47 $env['SVN_SSH'] = $this->getSSHWrapper();
49 return $env;