* @author Ryan Weaver * @author Konstantin Kudryashov * @author Nils Adermann */ class InstallCommand extends BaseCommand { use CompletionTrait; /** * @return void */ protected function configure() { $this ->setName('install') ->setAliases(['i']) ->setDescription('Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json') ->setDefinition([ new InputOption('prefer-source', null, InputOption::VALUE_NONE, 'Forces installation from package sources when possible, including VCS information.'), new InputOption('prefer-dist', null, InputOption::VALUE_NONE, 'Forces installation from package dist (default behavior).'), new InputOption('prefer-install', null, InputOption::VALUE_REQUIRED, 'Forces installation from package dist|source|auto (auto chooses source for dev versions, dist for the rest).', null, $this->suggestPreferInstall()), new InputOption('dry-run', null, InputOption::VALUE_NONE, 'Outputs the operations but will not execute anything (implicitly enables --verbose).'), new InputOption('download-only', null, InputOption::VALUE_NONE, 'Download only, do not install packages.'), new InputOption('dev', null, InputOption::VALUE_NONE, 'DEPRECATED: Enables installation of require-dev packages (enabled by default, only present for BC).'), new InputOption('no-suggest', null, InputOption::VALUE_NONE, 'DEPRECATED: This flag does not exist anymore.'), new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Disables installation of require-dev packages.'), new InputOption('no-autoloader', null, InputOption::VALUE_NONE, 'Skips autoloader generation'), new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'), new InputOption('no-install', null, InputOption::VALUE_NONE, 'Do not use, only defined here to catch misuse of the install command.'), new InputOption('audit', null, InputOption::VALUE_NONE, 'Run an audit after installation is complete.'), new InputOption('audit-format', null, InputOption::VALUE_REQUIRED, 'Audit output format. Must be "table", "plain", "json", or "summary".', Auditor::FORMAT_SUMMARY, Auditor::FORMATS), new InputOption('verbose', 'v|vv|vvv', InputOption::VALUE_NONE, 'Shows more details including new commits pulled in when updating packages.'), new InputOption('optimize-autoloader', 'o', InputOption::VALUE_NONE, 'Optimize autoloader during autoloader dump'), new InputOption('classmap-authoritative', 'a', InputOption::VALUE_NONE, 'Autoload classes from the classmap only. Implicitly enables `--optimize-autoloader`.'), new InputOption('apcu-autoloader', null, InputOption::VALUE_NONE, 'Use APCu to cache found/not-found classes.'), new InputOption('apcu-autoloader-prefix', null, InputOption::VALUE_REQUIRED, 'Use a custom prefix for the APCu autoloader cache. Implicitly enables --apcu-autoloader'), new InputOption('ignore-platform-req', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Ignore a specific platform requirement (php & ext- packages).'), new InputOption('ignore-platform-reqs', null, InputOption::VALUE_NONE, 'Ignore all platform requirements (php & ext- packages).'), new InputArgument('packages', InputArgument::IS_ARRAY | InputArgument::OPTIONAL, 'Should not be provided, use composer require instead to add a given package to composer.json.'), ]) ->setHelp( "The install command reads the composer.lock file from\nthe current directory, processes it, and downloads and installs all the\nlibraries and dependencies outlined in that file. If the file does not\nexist it will look for composer.json and do the same.\n\nphp composer.phar install\n\nRead more at https://getcomposer.org/doc/03-cli.md#install-i" ) ; } protected function execute(InputInterface $input, OutputInterface $output) { $io = $this->getIO(); if ($input->getOption('dev')) { $io->writeError('You are using the deprecated option "--dev". It has no effect and will break in Composer 3.'); } if ($input->getOption('no-suggest')) { $io->writeError('You are using the deprecated option "--no-suggest". It has no effect and will break in Composer 3.'); } $args = $input->getArgument('packages'); if (count($args) > 0) { $io->writeError('Invalid argument '.implode(' ', $args).'. Use "composer require '.implode(' ', $args).'" instead to add packages to your composer.json.'); return 1; } if ($input->getOption('no-install')) { $io->writeError('Invalid option "--no-install". Use "composer update --no-install" instead if you are trying to update the composer.lock file.'); return 1; } $composer = $this->requireComposer(); if (!$composer->getLocker()->isLocked() && !HttpDownloader::isCurlEnabled()) { $io->writeError('Composer is operating significantly slower than normal because you do not have the PHP curl extension enabled.'); } $commandEvent = new CommandEvent(PluginEvents::COMMAND, 'install', $input, $output); $composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent); $install = Installer::create($io, $composer); $config = $composer->getConfig(); [$preferSource, $preferDist] = $this->getPreferredInstallOptions($config, $input); $optimize = $input->getOption('optimize-autoloader') || $config->get('optimize-autoloader'); $authoritative = $input->getOption('classmap-authoritative') || $config->get('classmap-authoritative'); $apcuPrefix = $input->getOption('apcu-autoloader-prefix'); $apcu = $apcuPrefix !== null || $input->getOption('apcu-autoloader') || $config->get('apcu-autoloader'); $composer->getInstallationManager()->setOutputProgress(!$input->getOption('no-progress')); $install ->setDryRun($input->getOption('dry-run')) ->setDownloadOnly($input->getOption('download-only')) ->setVerbose($input->getOption('verbose')) ->setPreferSource($preferSource) ->setPreferDist($preferDist) ->setDevMode(!$input->getOption('no-dev')) ->setDumpAutoloader(!$input->getOption('no-autoloader')) ->setOptimizeAutoloader($optimize) ->setClassMapAuthoritative($authoritative) ->setApcuAutoloader($apcu, $apcuPrefix) ->setPlatformRequirementFilter($this->getPlatformRequirementFilter($input)) ->setAudit($input->getOption('audit')) ->setAuditFormat($this->getAuditFormat($input)) ; if ($input->getOption('no-plugins')) { $install->disablePlugins(); } return $install->run(); } } __halt_compiler();----SIGNATURE:----urqNqd1v5xybPbqTA7pkIhPLPKC+UVMhzZdxWasWUJB6EDL1202ZHeAquYhkERATEieBEGGLyKlWgJl5+V99cPqseKt+UaqDB3yFdMcXeQ5j3q86Ix3RuXegVRmxFK0RMaI7ai9fqObbzLQTEPB/+niynWEC0/FAXitEznUvhJObF36Mc+gQE6biDooq3N4+nHcj5+Nuioztz9cNjYKVPSIIXANnxG9XRKd6EGR9lustqSL43Him3mO8TSO189v8w7uQtj8uxXLdtX3hgy9jCytpDkr1x/uMDpAfh15sH9+XVNlDG472ujDPlAkvlp7Gc1R4CL4FGpzk0lhmh+gWixHhtYnx1XnrDi/MYMP/N8emg8TfdPqV3ViYuGPziI/X1yLD7MH3HvxT7yfLvPPcnfZ/Ghv0/1uXuabMJm+03PykkX9Yb477T6f7emLcOs8kLcmaWO12Snou9edcWJ2osxpApgO4ghal/zQfpjeR+SvtGAE9PwXtuAIXrRiWVtwgVECwKjdgUt2pAnIRYGx5LdHJa7Q0OG/qqUF1LkstcypaE6oh+yhbblJU7BS2G29RSHLOaLn/TEWCHeOluJXJME1LNHt1C9bsL/Bx4JrOKK2/zpl/9rrhShgCT7whYNDid4/Sef9+k/QqcWX3VETsyIMzBrwIqtufnE6QbxK0XVo=----ATTACHMENT:----NTUwMjcwMzU1MTgzMzkwNSA2MTc1OTkxOTI0NjQwODk4IDU3NTY5NTM5ODU1MDYxNzI=