File tree Expand file tree Collapse file tree 3 files changed +34
-40
lines changed
Expand file tree Collapse file tree 3 files changed +34
-40
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 44
55namespace Shlinkio \Shlink \Installer \Command ;
66
7- class InstallCommand extends AbstractInstallCommand
7+ use Shlinkio \Shlink \Installer \Service \InstallationRunnerInterface ;
8+ use Symfony \Component \Console \Command \Command ;
9+ use Symfony \Component \Console \Input \InputInterface ;
10+ use Symfony \Component \Console \Output \OutputInterface ;
11+ use Symfony \Component \Console \Style \SymfonyStyle ;
12+
13+ class InstallCommand extends Command
814{
915 public const string NAME = 'install ' ;
1016
17+ public function __construct (private readonly InstallationRunnerInterface $ installationRunner )
18+ {
19+ parent ::__construct ();
20+ }
21+
1122 protected function configure (): void
1223 {
1324 $ this
1425 ->setName (self ::NAME )
1526 ->setDescription ('Guides you through the installation process, to get Shlink up and running. ' );
1627 }
1728
18- protected function isUpdate ( ): bool
29+ protected function execute ( InputInterface $ input , OutputInterface $ output ): int
1930 {
20- return false ;
31+ $ io = new SymfonyStyle ($ input , $ output );
32+ $ initCommand = $ this ->getApplication ()?->find(InitCommand::NAME );
33+
34+ return $ this ->installationRunner ->runInstallation ($ initCommand , $ io );
2135 }
2236}
Original file line number Diff line number Diff line change 44
55namespace Shlinkio \Shlink \Installer \Command ;
66
7- class UpdateCommand extends AbstractInstallCommand
7+ use Shlinkio \Shlink \Installer \Service \InstallationRunnerInterface ;
8+ use Symfony \Component \Console \Command \Command ;
9+ use Symfony \Component \Console \Input \InputInterface ;
10+ use Symfony \Component \Console \Output \OutputInterface ;
11+ use Symfony \Component \Console \Style \SymfonyStyle ;
12+
13+ class UpdateCommand extends Command
814{
915 public const string NAME = 'update ' ;
1016
17+ public function __construct (private readonly InstallationRunnerInterface $ installationRunner )
18+ {
19+ parent ::__construct ();
20+ }
21+
1122 protected function configure (): void
1223 {
1324 $ this
1425 ->setName (self ::NAME )
1526 ->setDescription ('Helps you import Shlink \'s config from an older version to a new one. ' );
1627 }
1728
18- protected function isUpdate ( ): bool
29+ protected function execute ( InputInterface $ input , OutputInterface $ output ): int
1930 {
20- return true ;
31+ $ io = new SymfonyStyle ($ input , $ output );
32+ $ initCommand = $ this ->getApplication ()?->find(InitCommand::NAME );
33+
34+ return $ this ->installationRunner ->runUpdate ($ initCommand , $ io );
2135 }
2236}
You can’t perform that action at this time.
0 commit comments