Allow disabling svn branches/tags, fixes composer/satis#43

main
Jordi Boggiano 12 years ago
parent ae734229d7
commit 5b24a48827

@ -259,6 +259,9 @@ repository like this:
] ]
} }
If you have no branches or tags directory you can disable them entirely by
setting the `branches-path` or `tags-path` to `false`.
### PEAR ### PEAR
It is possible to install packages from any PEAR channel by using the `pear` It is possible to install packages from any PEAR channel by using the `pear`

@ -160,14 +160,16 @@ class SvnDriver extends VcsDriver
if (null === $this->tags) { if (null === $this->tags) {
$this->tags = array(); $this->tags = array();
$output = $this->execute('svn ls --verbose', $this->baseUrl . '/' . $this->tagsPath); if ($this->tagsPath !== false) {
if ($output) { $output = $this->execute('svn ls --verbose', $this->baseUrl . '/' . $this->tagsPath);
foreach ($this->process->splitLines($output) as $line) { if ($output) {
$line = trim($line); foreach ($this->process->splitLines($output) as $line) {
if ($line && preg_match('{^\s*(\S+).*?(\S+)\s*$}', $line, $match)) { $line = trim($line);
if (isset($match[1]) && isset($match[2]) && $match[2] !== './') { if ($line && preg_match('{^\s*(\S+).*?(\S+)\s*$}', $line, $match)) {
$this->tags[rtrim($match[2], '/')] = '/' . $this->tagsPath . if (isset($match[1]) && isset($match[2]) && $match[2] !== './') {
'/' . $match[2] . '@' . $match[1]; $this->tags[rtrim($match[2], '/')] = '/' . $this->tagsPath .
'/' . $match[2] . '@' . $match[1];
}
} }
} }
} }
@ -200,14 +202,16 @@ class SvnDriver extends VcsDriver
} }
unset($output); unset($output);
$output = $this->execute('svn ls --verbose', $this->baseUrl . '/' . $this->branchesPath); if ($this->branchesPath !== false) {
if ($output) { $output = $this->execute('svn ls --verbose', $this->baseUrl . '/' . $this->branchesPath);
foreach ($this->process->splitLines(trim($output)) as $line) { if ($output) {
$line = trim($line); foreach ($this->process->splitLines(trim($output)) as $line) {
if ($line && preg_match('{^\s*(\S+).*?(\S+)\s*$}', $line, $match)) { $line = trim($line);
if (isset($match[1]) && isset($match[2]) && $match[2] !== './') { if ($line && preg_match('{^\s*(\S+).*?(\S+)\s*$}', $line, $match)) {
$this->branches[rtrim($match[2], '/')] = '/' . $this->branchesPath . if (isset($match[1]) && isset($match[2]) && $match[2] !== './') {
'/' . $match[2] . '@' . $match[1]; $this->branches[rtrim($match[2], '/')] = '/' . $this->branchesPath .
'/' . $match[2] . '@' . $match[1];
}
} }
} }
} }

Loading…
Cancel
Save