GIF89; GIF89; %PDF- %PDF-
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Repository\Vcs;
use Composer\Config;
use Composer\Cache;
use Composer\IO\IOInterface;
use Composer\Pcre\Preg;
use Composer\Util\ProcessExecutor;
use Composer\Util\Perforce;
/**
* @author Matt Whittom <Matt.Whittom@veteransunited.com>
*/
class PerforceDriver extends VcsDriver
{
/** @var string */
protected $depot;
/** @var string */
protected $branch;
/** @var ?Perforce */
protected $perforce = null;
/**
* @inheritDoc
*/
public function initialize()
{
$this->depot = $this->repoConfig['depot'];
$this->branch = '';
if (!empty($this->repoConfig['branch'])) {
$this->branch = $this->repoConfig['branch'];
}
$this->initPerforce($this->repoConfig);
$this->perforce->p4Login();
$this->perforce->checkStream();
$this->perforce->writeP4ClientSpec();
$this->perforce->connectClient();
}
/**
* @param array<string, mixed> $repoConfig
*
* @return void
*/
private function initPerforce($repoConfig)
{
if (!empty($this->perforce)) {
return;
}
if (!Cache::isUsable((string) $this->config->get('cache-vcs-dir'))) {
throw new \RuntimeException('PerforceDriver requires a usable cache directory, and it looks like you set it to be disabled');
}
$repoDir = $this->config->get('cache-vcs-dir') . '/' . $this->depot;
$this->perforce = Perforce::create($repoConfig, $this->getUrl(), $repoDir, $this->process, $this->io);
}
/**
* @inheritDoc
*/
public function getFileContent($file, $identifier)
{
return $this->perforce->getFileContent($file, $identifier);
}
/**
* @inheritDoc
*/
public function getChangeDate($identifier)
{
return null;
}
/**
* @inheritDoc
*/
public function getRootIdentifier()
{
return $this->branch;
}
/**
* @inheritDoc
*/
public function getBranches()
{
return $this->perforce->getBranches();
}
/**
* @inheritDoc
*/
public function getTags()
{
return $this->perforce->getTags();
}
/**
* @inheritDoc
*/
public function getDist($identifier)
{
return null;
}
/**
* @inheritDoc
*/
public function getSource($identifier)
{
return array(
'type' => 'perforce',
'url' => $this->repoConfig['url'],
'reference' => $identifier,
'p4user' => $this->perforce->getUser(),
);
}
/**
* @inheritDoc
*/
public function getUrl()
{
return $this->url;
}
/**
* @inheritDoc
*/
public function hasComposerFile($identifier)
{
$composerInfo = $this->perforce->getComposerInformation('//' . $this->depot . '/' . $identifier);
return !empty($composerInfo);
}
/**
* @inheritDoc
*/
public function getContents($url)
{
throw new \BadMethodCallException('Not implemented/used in PerforceDriver');
}
/**
* @inheritDoc
*/
public static function supports(IOInterface $io, Config $config, $url, $deep = false)
{
if ($deep || Preg::isMatch('#\b(perforce|p4)\b#i', $url)) {
return Perforce::checkServerExists($url, new ProcessExecutor($io));
}
return false;
}
/**
* @inheritDoc
*/
public function cleanup()
{
$this->perforce->cleanupClientSpec();
$this->perforce = null;
}
/**
* @return string
*/
public function getDepot()
{
return $this->depot;
}
/**
* @return string
*/
public function getBranch()
{
return $this->branch;
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| FossilDriver.php | File | 7.51 KB | 0644 |
|
| GitBitbucketDriver.php | File | 15.8 KB | 0644 |
|
| GitDriver.php | File | 7.69 KB | 0644 |
|
| GitHubDriver.php | File | 20.55 KB | 0644 |
|
| GitLabDriver.php | File | 19.77 KB | 0644 |
|
| HgDriver.php | File | 7 KB | 0644 |
|
| PerforceDriver.php | File | 4.03 KB | 0644 |
|
| SvnDriver.php | File | 12.23 KB | 0644 |
|
| VcsDriver.php | File | 4.91 KB | 0644 |
|
| VcsDriverInterface.php | File | 3.29 KB | 0644 |
|