⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.74
Server IP:
104.21.112.1
Server:
Linux vmi2315822.contaboserver.net 5.15.0-134-generic #145-Ubuntu SMP Wed Feb 12 20:08:39 UTC 2025 x86_64
Server Software:
LiteSpeed
PHP Version:
8.3.21
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
php
/
Composer
/
Repository
/
View File Name :
WritableArrayRepository.php
<?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; use Composer\Package\AliasPackage; use Composer\Installer\InstallationManager; /** * Writable array repository. * * @author Jordi Boggiano <j.boggiano@seld.be> */ class WritableArrayRepository extends ArrayRepository implements WritableRepositoryInterface { /** * @var string[] */ protected $devPackageNames = array(); /** @var bool|null */ private $devMode = null; /** * @return bool|null true if dev requirements were installed, false if --no-dev was used, null if yet unknown */ public function getDevMode() { return $this->devMode; } /** * @inheritDoc */ public function setDevPackageNames(array $devPackageNames) { $this->devPackageNames = $devPackageNames; } /** * @inheritDoc */ public function getDevPackageNames() { return $this->devPackageNames; } /** * @inheritDoc */ public function write($devMode, InstallationManager $installationManager) { $this->devMode = $devMode; } /** * @inheritDoc */ public function reload() { $this->devMode = null; } /** * @inheritDoc */ public function getCanonicalPackages() { $packages = $this->getPackages(); // get at most one package of each name, preferring non-aliased ones $packagesByName = array(); foreach ($packages as $package) { if (!isset($packagesByName[$package->getName()]) || $packagesByName[$package->getName()] instanceof AliasPackage) { $packagesByName[$package->getName()] = $package; } } $canonicalPackages = array(); // unfold aliased packages foreach ($packagesByName as $package) { while ($package instanceof AliasPackage) { $package = $package->getAliasOf(); } $canonicalPackages[] = $package; } return $canonicalPackages; } }