/
var
/
www
/
vhosts
/
ihelp.ro
/
httpdocs
/
vendor
/
composer
/
composer
/
src
/
Composer
/
Command
/
/var/www/vhosts/ihelp.ro/httpdocs/vendor/composer/composer/src/Composer/Command
mkdir
upload
Name
Size
Mode
Actions
AboutCommand.php
1307
0644
edit
dl
rm
ArchiveCommand.php
8699
0644
edit
dl
rm
AuditCommand.php
3391
0644
edit
dl
rm
BaseCommand.php
15279
0644
edit
dl
rm
BaseDependencyCommand.php
11039
0644
edit
dl
rm
BumpCommand.php
9852
0644
edit
dl
rm
CheckPlatformReqsCommand.php
9049
0644
edit
dl
rm
ClearCacheCommand.php
3456
0644
edit
dl
rm
CompletionTrait.php
8110
0644
edit
dl
rm
ConfigCommand.php
42755
0644
edit
dl
rm
CreateProjectCommand.php
24587
0644
edit
dl
rm
DependsCommand.php
1928
0644
edit
dl
rm
DiagnoseCommand.php
28819
0644
edit
dl
rm
DumpAutoloadCommand.php
5886
0644
edit
dl
rm
ExecCommand.php
4735
0644
edit
dl
rm
FundCommand.php
5462
0644
edit
dl
rm
GlobalCommand.php
5666
0644
edit
dl
rm
HomeCommand.php
5535
0644
edit
dl
rm
InitCommand.php
23795
0644
edit
dl
rm
InstallCommand.php
8194
0644
edit
dl
rm
LicensesCommand.php
5926
0644
edit
dl
rm
OutdatedCommand.php
5557
0644
edit
dl
rm
PackageDiscoveryTrait.php
21170
0644
edit
dl
rm
ProhibitsCommand.php
2104
0644
edit
dl
rm
ReinstallCommand.php
8324
0644
edit
dl
rm
RemoveCommand.php
15369
0644
edit
dl
rm
RequireCommand.php
29997
0644
edit
dl
rm
RunScriptCommand.php
6441
0644
edit
dl
rm
ScriptAliasCommand.php
2479
0644
edit
dl
rm
SearchCommand.php
5120
0644
edit
dl
rm
SelfUpdateCommand.php
27156
0644
edit
dl
rm
ShowCommand.php
62808
0644
edit
dl
rm
StatusCommand.php
8653
0644
edit
dl
rm
SuggestsCommand.php
4066
0644
edit
dl
rm
UpdateCommand.php
16532
0644
edit
dl
rm
ValidateCommand.php
9565
0644
edit
dl
rm
Edit:
/var/www/vhosts/ihelp.ro/httpdocs/vendor/composer/composer/src/Composer/Command/ArchiveCommand.php
(8699B)
<?php declare(strict_types=1); /* * 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\Command; use Composer\Factory; use Composer\IO\IOInterface; use Composer\Config; use Composer\Composer; use Composer\Package\BasePackage; use Composer\Package\CompletePackageInterface; use Composer\Package\Version\VersionParser; use Composer\Package\Version\VersionSelector; use Composer\Pcre\Preg; use Composer\Repository\CompositeRepository; use Composer\Repository\RepositoryFactory; use Composer\Repository\RepositorySet; use Composer\Script\ScriptEvents; use Composer\Plugin\CommandEvent; use Composer\Plugin\PluginEvents; use Composer\Util\Filesystem; use Composer\Util\Loop; use Composer\Util\Platform; use Composer\Util\ProcessExecutor; use Composer\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Composer\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; /** * Creates an archive of a package for distribution. * * @author Nils Adermann <naderman@naderman.de> */ class ArchiveCommand extends BaseCommand { use CompletionTrait; private const FORMATS = ['tar', 'tar.gz', 'tar.bz2', 'zip']; protected function configure(): void { $this ->setName('archive') ->setDescription('Creates an archive of this composer package') ->setDefinition([ new InputArgument('package', InputArgument::OPTIONAL, 'The package to archive instead of the current project', null, $this->suggestAvailablePackage()), new InputArgument('version', InputArgument::OPTIONAL, 'A version constraint to find the package to archive'), new InputOption('format', 'f', InputOption::VALUE_REQUIRED, 'Format of the resulting archive: tar, tar.gz, tar.bz2 or zip (default tar)', null, self::FORMATS), new InputOption('dir', null, InputOption::VALUE_REQUIRED, 'Write the archive to this directory'), new InputOption('file', null, InputOption::VALUE_REQUIRED, 'Write the archive with the given file name.' .' Note that the format will be appended.'), new InputOption('ignore-filters', null, InputOption::VALUE_NONE, 'Ignore filters when saving package'), ]) ->setHelp( <<<EOT The <info>archive</info> command creates an archive of the specified format containing the files and directories of the Composer project or the specified package in the specified version and writes it to the specified directory. <info>php composer.phar archive [--format=zip] [--dir=/foo] [--file=filename] [package [version]]</info> Read more at https://getcomposer.org/doc/03-cli.md#archive EOT ) ; } protected function execute(InputInterface $input, OutputInterface $output): int { $composer = $this->tryComposer(); $config = null; if ($composer) { $config = $composer->getConfig(); $commandEvent = new CommandEvent(PluginEvents::COMMAND, 'archive', $input, $output); $eventDispatcher = $composer->getEventDispatcher(); $eventDispatcher->dispatch($commandEvent->getName(), $commandEvent); $eventDispatcher->dispatchScript(ScriptEvents::PRE_ARCHIVE_CMD); } if (!$config) { $config = Factory::createConfig(); } $format = $input->getOption('format') ?? $config->get('archive-format'); $dir = $input->getOption('dir') ?? $config->get('archive-dir'); $returnCode = $this->archive( $this->getIO(), $config, $input->getArgument('package'), $input->getArgument('version'), $format, $dir, $input->getOption('file'), $input->getOption('ignore-filters'), $composer ); if (0 === $returnCode && $composer) { $composer->getEventDispatcher()->dispatchScript(ScriptEvents::POST_ARCHIVE_CMD); } return $returnCode; } /** * @throws \Exception */ protected function archive(IOInterface $io, Config $config, ?string $packageName, ?string $version, string $format, string $dest, ?string $fileName, bool $ignoreFilters, ?Composer $composer): int { if ($composer) { $archiveManager = $composer->getArchiveManager(); } else { $factory = new Factory; $process = new ProcessExecutor(); $httpDownloader = Factory::createHttpDownloader($io, $config); $downloadManager = $factory->createDownloadManager($io, $config, $httpDownloader, $process); $archiveManager = $factory->createArchiveManager($config, $downloadManager, new Loop($httpDownloader, $process)); } if ($packageName) { $package = $this->selectPackage($io, $packageName, $version); if (!$package) { return 1; } } else { $package = $this->requireComposer()->getPackage(); } $io->writeError('<info>Creating the archive into "'.$dest.'".</info>'); $packagePath = $archiveManager->archive($package, $format, $dest, $fileName, $ignoreFilters); $fs = new Filesystem; $shortPath = $fs->findShortestPath(Platform::getCwd(), $packagePath, true); $io->writeError('Created: ', false); $io->write(strlen($shortPath) < strlen($packagePath) ? $shortPath : $packagePath); return 0; } /** * @return (BasePackage&CompletePackageInterface)|false */ protected function selectPackage(IOInterface $io, string $packageName, ?string $version = null) { $io->writeError('<info>Searching for the specified package.</info>'); if ($composer = $this->tryComposer()) { $localRepo = $composer->getRepositoryManager()->getLocalRepository(); $repo = new CompositeRepository(array_merge([$localRepo], $composer->getRepositoryManager()->getRepositories())); $minStability = $composer->getPackage()->getMinimumStability(); } else { $defaultRepos = RepositoryFactory::defaultReposWithDefaultManager($io); $io->writeError('No composer.json found in the current directory, searching packages from ' . implode(', ', array_keys($defaultRepos))); $repo = new CompositeRepository($defaultRepos); $minStability = 'stable'; } if ($version !== null && Preg::isMatchStrictGroups('{@(stable|RC|beta|alpha|dev)$}i', $version, $match)) { $minStability = $match[1]; $version = (string) substr($version, 0, -strlen($match[0])); } $repoSet = new RepositorySet($minStability); $repoSet->addRepository($repo); $parser = new VersionParser(); $constraint = $version !== null ? $parser->parseConstraints($version) : null; $packages = $repoSet->findPackages(strtolower($packageName), $constraint); if (count($packages) > 1) { $versionSelector = new VersionSelector($repoSet); $package = $versionSelector->findBestCandidate(strtolower($packageName), $version, $minStability); if ($package === false) { $package = reset($packages); } $io->writeError('<info>Found multiple matches, selected '.$package->getPrettyString().'.</info>'); $io->writeError('Alternatives were '.implode(', ', array_map(static function ($p): string { return $p->getPrettyString(); }, $packages)).'.'); $io->writeError('<comment>Please use a more specific constraint to pick a different package.</comment>'); } elseif (count($packages) === 1) { $package = reset($packages); $io->writeError('<info>Found an exact match '.$package->getPrettyString().'.</info>'); } else { $io->writeError('<error>Could not find a package matching '.$packageName.'.</error>'); return false; } if (!$package instanceof CompletePackageInterface) { throw new \LogicException('Expected a CompletePackageInterface instance but found '.get_class($package)); } if (!$package instanceof BasePackage) { throw new \LogicException('Expected a BasePackage instance but found '.get_class($package)); } return $package; } }
Save
cmd:
run