This repository has been archived on 2025-08-17. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
versa/src/Console/Command/InstallCommand.php

30 lines
783 B
PHP
Raw Normal View History

2024-02-21 12:48:33 +00:00
<?php
namespace App\Console\Command;
use App\Process\Process;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
final class InstallCommand extends AbstractCommand
{
public function execute(InputInterface $input, OutputInterface $output): int
{
$extraArgs = $input->getOption('extra-args');
$workingDir = $input->getOption('working-dir');
2024-02-21 12:48:33 +00:00
// TODO: Composer in Docker Compose?
$process = Process::create(
command: ['composer', 'install'],
extraArgs: $extraArgs,
workingDir: $workingDir,
2024-02-21 12:48:33 +00:00
);
2024-02-21 13:20:41 +00:00
$process->setTimeout(null);
2024-02-21 12:48:33 +00:00
$process->run();
return Command::SUCCESS;
}
}