/
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/StatusCommand.php
(8653B)
<?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 Symfony\Component\Console\Input\InputInterface; use Composer\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Composer\Downloader\ChangeReportInterface; use Composer\Downloader\DvcsDownloaderInterface; use Composer\Downloader\VcsCapableDownloaderInterface; use Composer\Package\Dumper\ArrayDumper; use Composer\Package\Version\VersionGuesser; use Composer\Package\Version\VersionParser; use Composer\Plugin\CommandEvent; use Composer\Plugin\PluginEvents; use Composer\Script\ScriptEvents; use Composer\Util\ProcessExecutor; /** * @author Tiago Ribeiro <tiago.ribeiro@seegno.com> * @author Rui Marinho <rui.marinho@seegno.com> */ class StatusCommand extends BaseCommand { private const EXIT_CODE_ERRORS = 1; private const EXIT_CODE_UNPUSHED_CHANGES = 2; private const EXIT_CODE_VERSION_CHANGES = 4; /** * @throws \Symfony\Component\Console\Exception\InvalidArgumentException */ protected function configure(): void { $this ->setName('status') ->setDescription('Shows a list of locally modified packages') ->setDefinition([ new InputOption('verbose', 'v|vv|vvv', InputOption::VALUE_NONE, 'Show modified files for each directory that contains changes.'), ]) ->setHelp( <<<EOT The status command displays a list of dependencies that have been modified locally. Read more at https://getcomposer.org/doc/03-cli.md#status EOT ) ; } protected function execute(InputInterface $input, OutputInterface $output): int { $composer = $this->requireComposer(); $commandEvent = new CommandEvent(PluginEvents::COMMAND, 'status', $input, $output); $composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent); // Dispatch pre-status-command $composer->getEventDispatcher()->dispatchScript(ScriptEvents::PRE_STATUS_CMD, true); $exitCode = $this->doExecute($input); // Dispatch post-status-command $composer->getEventDispatcher()->dispatchScript(ScriptEvents::POST_STATUS_CMD, true); return $exitCode; } private function doExecute(InputInterface $input): int { // init repos $composer = $this->requireComposer(); $installedRepo = $composer->getRepositoryManager()->getLocalRepository(); $dm = $composer->getDownloadManager(); $im = $composer->getInstallationManager(); $errors = []; $io = $this->getIO(); $unpushedChanges = []; $vcsVersionChanges = []; $parser = new VersionParser; $guesser = new VersionGuesser($composer->getConfig(), $composer->getLoop()->getProcessExecutor() ?? new ProcessExecutor($io), $parser); $dumper = new ArrayDumper; // list packages foreach ($installedRepo->getCanonicalPackages() as $package) { $downloader = $dm->getDownloaderForPackage($package); $targetDir = $im->getInstallPath($package); if ($targetDir === null) { continue; } if ($downloader instanceof ChangeReportInterface) { if (is_link($targetDir)) { $errors[$targetDir] = $targetDir . ' is a symbolic link.'; } if (null !== ($changes = $downloader->getLocalChanges($package, $targetDir))) { $errors[$targetDir] = $changes; } } if ($downloader instanceof VcsCapableDownloaderInterface) { if ($downloader->getVcsReference($package, $targetDir)) { switch ($package->getInstallationSource()) { case 'source': $previousRef = $package->getSourceReference(); break; case 'dist': $previousRef = $package->getDistReference(); break; default: $previousRef = null; } $currentVersion = $guesser->guessVersion($dumper->dump($package), $targetDir); if ($previousRef && $currentVersion && $currentVersion['commit'] !== $previousRef && $currentVersion['pretty_version'] !== $previousRef) { $vcsVersionChanges[$targetDir] = [ 'previous' => [ 'version' => $package->getPrettyVersion(), 'ref' => $previousRef, ], 'current' => [ 'version' => $currentVersion['pretty_version'], 'ref' => $currentVersion['commit'], ], ]; } } } if ($downloader instanceof DvcsDownloaderInterface) { if ($unpushed = $downloader->getUnpushedChanges($package, $targetDir)) { $unpushedChanges[$targetDir] = $unpushed; } } } // output errors/warnings if (!$errors && !$unpushedChanges && !$vcsVersionChanges) { $io->writeError('<info>No local changes</info>'); return 0; } if ($errors) { $io->writeError('<error>You have changes in the following dependencies:</error>'); foreach ($errors as $path => $changes) { if ($input->getOption('verbose')) { $indentedChanges = implode("\n", array_map(static function ($line): string { return ' ' . ltrim($line); }, explode("\n", $changes))); $io->write('<info>'.$path.'</info>:'); $io->write($indentedChanges); } else { $io->write($path); } } } if ($unpushedChanges) { $io->writeError('<warning>You have unpushed changes on the current branch in the following dependencies:</warning>'); foreach ($unpushedChanges as $path => $changes) { if ($input->getOption('verbose')) { $indentedChanges = implode("\n", array_map(static function ($line): string { return ' ' . ltrim($line); }, explode("\n", $changes))); $io->write('<info>'.$path.'</info>:'); $io->write($indentedChanges); } else { $io->write($path); } } } if ($vcsVersionChanges) { $io->writeError('<warning>You have version variations in the following dependencies:</warning>'); foreach ($vcsVersionChanges as $path => $changes) { if ($input->getOption('verbose')) { // If we don't can't find a version, use the ref instead. $currentVersion = $changes['current']['version'] ?: $changes['current']['ref']; $previousVersion = $changes['previous']['version'] ?: $changes['previous']['ref']; if ($io->isVeryVerbose()) { // Output the ref regardless of whether or not it's being used as the version $currentVersion .= sprintf(' (%s)', $changes['current']['ref']); $previousVersion .= sprintf(' (%s)', $changes['previous']['ref']); } $io->write('<info>'.$path.'</info>:'); $io->write(sprintf(' From <comment>%s</comment> to <comment>%s</comment>', $previousVersion, $currentVersion)); } else { $io->write($path); } } } if (($errors || $unpushedChanges || $vcsVersionChanges) && !$input->getOption('verbose')) { $io->writeError('Use --verbose (-v) to see a list of files'); } return ($errors ? self::EXIT_CODE_ERRORS : 0) + ($unpushedChanges ? self::EXIT_CODE_UNPUSHED_CHANGES : 0) + ($vcsVersionChanges ? self::EXIT_CODE_VERSION_CHANGES : 0); } }
Save
cmd:
run