示例#1
0
 public function initPerforce($package, $path)
 {
     if ($this->perforce) {
         $this->perforce->initializePath($path);
         return;
     }
     $repository = $package->getRepository();
     $repoConfig = null;
     if ($repository instanceof VcsRepository) {
         $repoConfig = $this->getRepoConfig($repository);
     }
     $this->perforce = Perforce::create($repoConfig, $package->getSourceUrl(), $path);
 }
示例#2
0
 public function initPerforce($package, $path, $url)
 {
     if (!empty($this->perforce)) {
         $this->perforce->initializePath($path);
         return;
     }
     $repository = $package->getRepository();
     $repoConfig = null;
     if ($repository instanceof VcsRepository) {
         $repoConfig = $this->getRepoConfig($repository);
     }
     $this->perforce = Perforce::create($repoConfig, $url, $path, $this->process, $this->io);
 }
示例#3
0
 public static function supports(IOInterface $io, Config $config, $url, $deep = false)
 {
     if ($deep || preg_match('#\\b(perforce|p4)\\b#i', $url)) {
         return Perforce::checkServerExists($url, new ProcessExecutor($io));
     }
     return false;
 }
示例#4
0
 /**
  * {@inheritDoc}
  */
 protected function getCommitLogs($fromReference, $toReference, $path)
 {
     $commitLogs = $this->perforce->getCommitLogs($fromReference, $toReference);
     return $commitLogs;
 }
示例#5
0
 /**
  * {@inheritDoc}
  */
 public function cleanup()
 {
     $this->perforce->cleanupClientSpec();
     $this->perforce = null;
 }
示例#6
0
 /**
  * @param array $repoConfig
  */
 public function initialize($repoConfig)
 {
     parent::initialize($repoConfig);
     $this->filename = (string) $repoConfig['filename'];
 }