|
@@ -116,16 +116,14 @@ class Perforce
|
|
|
|
|
|
protected function executeCommand($command)
|
|
|
{
|
|
|
- $this->commandResult = "";
|
|
|
- $exit_code = $this->process->execute($command, $this->commandResult);
|
|
|
-
|
|
|
- return $exit_code;
|
|
|
+ $this->commandResult = '';
|
|
|
+ return $this->process->execute($command, $this->commandResult);
|
|
|
}
|
|
|
|
|
|
public function getClient()
|
|
|
{
|
|
|
if (!isset($this->p4Client)) {
|
|
|
- $cleanStreamName = str_replace('@', '', str_replace('/', '_', str_replace('//', '', $this->getStream())));
|
|
|
+ $cleanStreamName = str_replace(array('//', '/', '@'), array('', '_', ''), $this->getStream());
|
|
|
$this->p4Client = 'composer_perforce_' . $this->uniquePerforceClientName . '_' . $cleanStreamName;
|
|
|
}
|
|
|
|
|
@@ -189,9 +187,7 @@ class Perforce
|
|
|
|
|
|
public function getP4ClientSpec()
|
|
|
{
|
|
|
- $p4clientSpec = $this->path . '/' . $this->getClient() . '.p4.spec';
|
|
|
-
|
|
|
- return $p4clientSpec;
|
|
|
+ return $this->path . '/' . $this->getClient() . '.p4.spec';
|
|
|
}
|
|
|
|
|
|
public function getUser()
|
|
@@ -276,8 +272,7 @@ class Perforce
|
|
|
if ($useClient) {
|
|
|
$p4Command = $p4Command . '-c ' . $this->getClient() . ' ';
|
|
|
}
|
|
|
- $p4Command = $p4Command . '-p ' . $this->getPort() . ' ';
|
|
|
- $p4Command = $p4Command . $command;
|
|
|
+ $p4Command = $p4Command . '-p ' . $this->getPort() . ' ' . $command;
|
|
|
|
|
|
return $p4Command;
|
|
|
}
|
|
@@ -538,9 +533,8 @@ class Perforce
|
|
|
return null;
|
|
|
}
|
|
|
$fields = explode(' ', $changes);
|
|
|
- $changeList = $fields[1];
|
|
|
|
|
|
- return $changeList;
|
|
|
+ return $fields[1];
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -562,9 +556,8 @@ class Perforce
|
|
|
$main = substr($fromReference, 0, $index) . '/...';
|
|
|
$command = $this->generateP4Command('filelog ' . $main . '@' . $fromChangeList. ',' . $toChangeList);
|
|
|
$this->executeCommand($command);
|
|
|
- $result = $this->commandResult;
|
|
|
|
|
|
- return $result;
|
|
|
+ return $this->commandResult;
|
|
|
}
|
|
|
|
|
|
public function getFilesystem()
|