1
0
Fork 0

Updated comments

pull/2184/merge^2
matt-whittom 2013-08-16 09:37:11 -05:00 committed by mwhittom
parent 8379985166
commit f3722a46ed
2 changed files with 42 additions and 30 deletions

View File

@ -51,19 +51,10 @@ class PerforceDownloader extends VcsDownloader
return; return;
} }
$repository = $package->getRepository(); $repository = $package->getRepository();
$repoConfig = $this->getRepoConfig($repository); $repoConfig = $repository->getRepoConfig();
$this->perforce = Perforce::createPerforce($repoConfig, $package->getSourceUrl(), $path); $this->perforce = Perforce::createPerforce($repoConfig, $package->getSourceUrl(), $path);
} }
public function injectPerforce($perforce){
$this->perforce = $perforce;
$this->perforceInjected = true;
}
private function getRepoConfig(VcsRepository $repository){
return $repository->getRepoConfig();
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@ -91,4 +82,10 @@ class PerforceDownloader extends VcsDownloader
return $commitLogs; return $commitLogs;
} }
public function injectPerforce($perforce){
$this->perforce = $perforce;
$this->perforceInjected = true;
}
} }

View File

@ -34,7 +34,8 @@ class PerforceDriver extends VcsDriver {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function initialize() { public function initialize()
{
$this->depot = $this->repoConfig['depot']; $this->depot = $this->repoConfig['depot'];
$this->branch = ""; $this->branch = "";
if (isset($this->repoConfig['branch'])) { if (isset($this->repoConfig['branch'])) {
@ -51,7 +52,8 @@ class PerforceDriver extends VcsDriver {
return TRUE; return TRUE;
} }
private function initPerforce() { private function initPerforce()
{
if (isset($this->perforce)) { if (isset($this->perforce)) {
return; return;
} }
@ -60,15 +62,11 @@ class PerforceDriver extends VcsDriver {
$this->perforce = Perforce::createPerforce($this->repoConfig, $this->getUrl(), $repoDir, $this->process); $this->perforce = Perforce::createPerforce($this->repoConfig, $this->getUrl(), $repoDir, $this->process);
} }
public function injectPerforce(Perforce $perforce) {
$this->perforce = $perforce;
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function getComposerInformation($identifier) { public function getComposerInformation($identifier)
{
if (isset($this->composer_info_identifier)){ if (isset($this->composer_info_identifier)){
if (strcmp($identifier, $this->composer_info_identifier) === 0 ) if (strcmp($identifier, $this->composer_info_identifier) === 0 )
{ {
@ -83,14 +81,16 @@ class PerforceDriver extends VcsDriver {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function getRootIdentifier() { public function getRootIdentifier()
{
return $this->branch; return $this->branch;
} }
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function getBranches() { public function getBranches()
{
$branches = $this->perforce->getBranches(); $branches = $this->perforce->getBranches();
return $branches; return $branches;
@ -99,7 +99,8 @@ class PerforceDriver extends VcsDriver {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function getTags() { public function getTags()
{
$tags = $this->perforce->getTags(); $tags = $this->perforce->getTags();
return $tags; return $tags;
@ -108,14 +109,16 @@ class PerforceDriver extends VcsDriver {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function getDist($identifier) { public function getDist($identifier)
{
return NULL; return NULL;
} }
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function getSource($identifier) { public function getSource($identifier)
{
$source = array( $source = array(
'type' => 'perforce', 'type' => 'perforce',
'url' => $this->repoConfig['url'], 'url' => $this->repoConfig['url'],
@ -128,14 +131,16 @@ class PerforceDriver extends VcsDriver {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function getUrl() { public function getUrl()
{
return $this->url; return $this->url;
} }
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function hasComposerFile($identifier) { public function hasComposerFile($identifier)
{
$this->composer_info = $this->perforce->getComposerInformation("//$this->depot/$identifier"); $this->composer_info = $this->perforce->getComposerInformation("//$this->depot/$identifier");
$this->composer_info_identifier = $identifier; $this->composer_info_identifier = $identifier;
$result = false; $result = false;
@ -148,30 +153,40 @@ class PerforceDriver extends VcsDriver {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function getContents($url) { public function getContents($url)
{
return FALSE; return FALSE;
} }
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public static function supports(IOInterface $io, $url, $deep = FALSE) { public static function supports(IOInterface $io, $url, $deep = FALSE)
{
return Perforce::checkServerExists($url, new ProcessExecutor); return Perforce::checkServerExists($url, new ProcessExecutor);
} }
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function cleanup(){ public function cleanup()
{
$this->perforce->cleanupClientSpec(); $this->perforce->cleanupClientSpec();
$this->perforce = null; $this->perforce = null;
} }
public function getDepot(){ public function getDepot()
{
return $this->depot; return $this->depot;
} }
public function getBranch(){ public function getBranch()
{
return $this->branch; return $this->branch;
} }
public function injectPerforce(Perforce $perforce)
{
$this->perforce = $perforce;
}
} }