Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.119
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
share /
php /
Composer /
Downloader /
Delete
Unzip
Name
Size
Permission
Date
Action
ArchiveDownloader.php
6.14
KB
-rw-r--r--
2016-11-03 17:43
ChangeReportInterface.php
766
B
-rw-r--r--
2016-11-03 17:43
DownloadManager.php
10.27
KB
-rw-r--r--
2016-11-03 17:43
DownloaderInterface.php
1.74
KB
-rw-r--r--
2016-11-03 17:43
DvcsDownloaderInterface.php
782
B
-rw-r--r--
2016-11-03 17:43
FileDownloader.php
8.94
KB
-rw-r--r--
2016-11-03 17:43
FilesystemException.php
672
B
-rw-r--r--
2016-11-03 17:43
FossilDownloader.php
3.92
KB
-rw-r--r--
2021-05-09 23:44
GitDownloader.php
18.61
KB
-rw-r--r--
2021-05-09 23:44
GzipDownloader.php
2.54
KB
-rw-r--r--
2021-05-09 23:44
HgDownloader.php
3.24
KB
-rw-r--r--
2021-05-09 23:44
PathDownloader.php
5.82
KB
-rw-r--r--
2016-11-03 17:43
PearPackageExtractor.php
11.39
KB
-rw-r--r--
2016-11-03 17:43
PerforceDownloader.php
2.82
KB
-rw-r--r--
2016-11-03 17:43
PharDownloader.php
937
B
-rw-r--r--
2016-11-03 17:43
RarDownloader.php
2.99
KB
-rw-r--r--
2021-05-09 23:44
SvnDownloader.php
6.56
KB
-rw-r--r--
2016-11-03 17:43
TarDownloader.php
697
B
-rw-r--r--
2016-11-03 17:43
TransportException.php
1009
B
-rw-r--r--
2016-11-03 17:43
VcsCapableDownloaderInterface.php
796
B
-rw-r--r--
2016-11-03 17:43
VcsDownloader.php
9.91
KB
-rw-r--r--
2016-11-03 17:43
XzDownloader.php
1.67
KB
-rw-r--r--
2016-11-03 17:43
ZipDownloader.php
4.75
KB
-rw-r--r--
2016-11-03 17:43
Save
Rename
<?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\Downloader; use Composer\Package\PackageInterface; use Composer\IO\IOInterface; use Composer\Util\Filesystem; /** * Downloaders manager. * * @author Konstantin Kudryashov <ever.zet@gmail.com> */ class DownloadManager { private $io; private $preferDist = false; private $preferSource = false; private $packagePreferences = array(); private $filesystem; private $downloaders = array(); /** * Initializes download manager. * * @param IOInterface $io The Input Output Interface * @param bool $preferSource prefer downloading from source * @param Filesystem|null $filesystem custom Filesystem object */ public function __construct(IOInterface $io, $preferSource = false, Filesystem $filesystem = null) { $this->io = $io; $this->preferSource = $preferSource; $this->filesystem = $filesystem ?: new Filesystem(); } /** * Makes downloader prefer source installation over the dist. * * @param bool $preferSource prefer downloading from source * @return DownloadManager */ public function setPreferSource($preferSource) { $this->preferSource = $preferSource; return $this; } /** * Makes downloader prefer dist installation over the source. * * @param bool $preferDist prefer downloading from dist * @return DownloadManager */ public function setPreferDist($preferDist) { $this->preferDist = $preferDist; return $this; } /** * Sets fine tuned preference settings for package level source/dist selection. * * @param array $preferences array of preferences by package patterns * @return DownloadManager */ public function setPreferences(array $preferences) { $this->packagePreferences = $preferences; return $this; } /** * Sets whether to output download progress information for all registered * downloaders * * @param bool $outputProgress * @return DownloadManager */ public function setOutputProgress($outputProgress) { foreach ($this->downloaders as $downloader) { $downloader->setOutputProgress($outputProgress); } return $this; } /** * Sets installer downloader for a specific installation type. * * @param string $type installation type * @param DownloaderInterface $downloader downloader instance * @return DownloadManager */ public function setDownloader($type, DownloaderInterface $downloader) { $type = strtolower($type); $this->downloaders[$type] = $downloader; return $this; } /** * Returns downloader for a specific installation type. * * @param string $type installation type * @throws \InvalidArgumentException if downloader for provided type is not registered * @return DownloaderInterface */ public function getDownloader($type) { $type = strtolower($type); if (!isset($this->downloaders[$type])) { throw new \InvalidArgumentException(sprintf('Unknown downloader type: %s. Available types: %s.', $type, implode(', ', array_keys($this->downloaders)))); } return $this->downloaders[$type]; } /** * Returns downloader for already installed package. * * @param PackageInterface $package package instance * @throws \InvalidArgumentException if package has no installation source specified * @throws \LogicException if specific downloader used to load package with * wrong type * @return DownloaderInterface|null */ public function getDownloaderForInstalledPackage(PackageInterface $package) { $installationSource = $package->getInstallationSource(); if ('metapackage' === $package->getType()) { return; } if ('dist' === $installationSource) { $downloader = $this->getDownloader($package->getDistType()); } elseif ('source' === $installationSource) { $downloader = $this->getDownloader($package->getSourceType()); } else { throw new \InvalidArgumentException( 'Package '.$package.' seems not been installed properly' ); } if ($installationSource !== $downloader->getInstallationSource()) { throw new \LogicException(sprintf( 'Downloader "%s" is a %s type downloader and can not be used to download %s', get_class($downloader), $downloader->getInstallationSource(), $installationSource )); } return $downloader; } /** * Downloads package into target dir. * * @param PackageInterface $package package instance * @param string $targetDir target dir * @param bool $preferSource prefer installation from source * * @throws \InvalidArgumentException if package have no urls to download from * @throws \RuntimeException */ public function download(PackageInterface $package, $targetDir, $preferSource = null) { $preferSource = null !== $preferSource ? $preferSource : $this->preferSource; $sourceType = $package->getSourceType(); $distType = $package->getDistType(); $sources = array(); if ($sourceType) { $sources[] = 'source'; } if ($distType) { $sources[] = 'dist'; } if (empty($sources)) { throw new \InvalidArgumentException('Package '.$package.' must have a source or dist specified'); } if (!$preferSource && ($this->preferDist || 'dist' === $this->resolvePackageInstallPreference($package))) { $sources = array_reverse($sources); } $this->filesystem->ensureDirectoryExists($targetDir); foreach ($sources as $i => $source) { if (isset($e)) { $this->io->writeError(' <warning>Now trying to download from ' . $source . '</warning>'); } $package->setInstallationSource($source); try { $downloader = $this->getDownloaderForInstalledPackage($package); if ($downloader) { $downloader->download($package, $targetDir); } break; } catch (\RuntimeException $e) { if ($i === count($sources) - 1) { throw $e; } $this->io->writeError( ' <warning>Failed to download '. $package->getPrettyName(). ' from ' . $source . ': '. $e->getMessage().'</warning>' ); } } } /** * Updates package from initial to target version. * * @param PackageInterface $initial initial package version * @param PackageInterface $target target package version * @param string $targetDir target dir * * @throws \InvalidArgumentException if initial package is not installed */ public function update(PackageInterface $initial, PackageInterface $target, $targetDir) { $downloader = $this->getDownloaderForInstalledPackage($initial); if (!$downloader) { return; } $installationSource = $initial->getInstallationSource(); if ('dist' === $installationSource) { $initialType = $initial->getDistType(); $targetType = $target->getDistType(); } else { $initialType = $initial->getSourceType(); $targetType = $target->getSourceType(); } // upgrading from a dist stable package to a dev package, force source reinstall if ($target->isDev() && 'dist' === $installationSource) { $downloader->remove($initial, $targetDir); $this->download($target, $targetDir); return; } if ($initialType === $targetType) { $target->setInstallationSource($installationSource); try { $downloader->update($initial, $target, $targetDir); return; } catch (\RuntimeException $e) { if (!$this->io->isInteractive()) { throw $e; } $this->io->writeError('<error> Update failed ('.$e->getMessage().')</error>'); if (!$this->io->askConfirmation(' Would you like to try reinstalling the package instead [<comment>yes</comment>]? ', true)) { throw $e; } } } $downloader->remove($initial, $targetDir); $this->download($target, $targetDir, 'source' === $installationSource); } /** * Removes package from target dir. * * @param PackageInterface $package package instance * @param string $targetDir target dir */ public function remove(PackageInterface $package, $targetDir) { $downloader = $this->getDownloaderForInstalledPackage($package); if ($downloader) { $downloader->remove($package, $targetDir); } } /** * Determines the install preference of a package * * @param PackageInterface $package package instance * * @return string */ protected function resolvePackageInstallPreference(PackageInterface $package) { foreach ($this->packagePreferences as $pattern => $preference) { $pattern = '{^'.str_replace('\\*', '.*', preg_quote($pattern)).'$}i'; if (preg_match($pattern, $package->getName())) { if ('dist' === $preference || (!$package->isDev() && 'auto' === $preference)) { return 'dist'; } return 'source'; } } return $package->isDev() ? 'source' : 'dist'; } }